|
|
|
@ -118,6 +118,7 @@ export default function Subscribe() { |
|
|
|
|
|
|
|
|
|
if(!singleArr.some((arr_item : any) => arr_item === sec_item)){ |
|
|
|
|
sec_item.isFree = 0 |
|
|
|
|
sec_item.MallLink = item.MallLink || '' |
|
|
|
|
singleArr.push(sec_item) |
|
|
|
|
c++ |
|
|
|
|
} |
|
|
|
@ -187,6 +188,7 @@ export default function Subscribe() { |
|
|
|
|
|
|
|
|
|
if(!singleArr.some((arr_item : any) => arr_item === sec_item)){ |
|
|
|
|
sec_item.isFree = 0 |
|
|
|
|
sec_item.MallLink = item.MallLink || '' |
|
|
|
|
singleArr.push(sec_item) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -282,6 +284,7 @@ export default function Subscribe() { |
|
|
|
|
|
|
|
|
|
if(!singleArr.some((arr_item : any) => arr_item.PrdtId === sec_item.PrdtId)){ |
|
|
|
|
sec_item.isFree = 0 |
|
|
|
|
sec_item.MallLink = item.MallLink || '' |
|
|
|
|
singleArr.push(sec_item) |
|
|
|
|
c++ |
|
|
|
|
} |
|
|
|
@ -370,6 +373,9 @@ export default function Subscribe() { |
|
|
|
|
|
|
|
|
|
const [isPopupOpen, setisPopupOpen] = useState(false) |
|
|
|
|
|
|
|
|
|
//管理跳转页面路径
|
|
|
|
|
const [prdtMallLink, setprdtMallLink] = useState('') |
|
|
|
|
|
|
|
|
|
const [isToStoreOpen, setisToStoreOpen] = useState(false) |
|
|
|
|
|
|
|
|
|
const [userScene, setuserScene] = useState<any>(null) |
|
|
|
@ -427,10 +433,24 @@ export default function Subscribe() { |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//跳转详情页
|
|
|
|
|
//跳转套装详情页
|
|
|
|
|
const handleToCollectionDetail = (item: any) => { |
|
|
|
|
if (item.SubscribedState === -1) { |
|
|
|
|
// 已过期,跳转商城
|
|
|
|
|
setprdtMallLink(item.MallLink || '') |
|
|
|
|
setisToStoreOpen(true) |
|
|
|
|
} else { |
|
|
|
|
Taro.navigateTo({ |
|
|
|
|
url: '/pages/CollectionDetail/index?id=' + item.PrdtId |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 套装删除
|
|
|
|
|
const handleDelCollection = (item: any) => { |
|
|
|
|
if (item.SubscribedState === -1) { |
|
|
|
|
// 已过期,直接删除
|
|
|
|
|
debugger |
|
|
|
|
Taro.request({ |
|
|
|
|
url: 'https://interapi.jm-kid.com/api/mark/subscribed', |
|
|
|
|
method: 'POST', |
|
|
|
@ -445,16 +465,27 @@ export default function Subscribe() { |
|
|
|
|
requestUserSubscribe() |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 单本跳转详情
|
|
|
|
|
const handleToSingleDetail = (item: any) => { |
|
|
|
|
if (item.SubscribedState === -1) { |
|
|
|
|
// 已过期,跳转商城
|
|
|
|
|
setprdtMallLink(item.MallLink || '') |
|
|
|
|
setisToStoreOpen(true) |
|
|
|
|
} else { |
|
|
|
|
Taro.navigateTo({ |
|
|
|
|
url: '/pages/CollectionDetail/index?id=' + item.PrdtId |
|
|
|
|
url: '/pages/SingleDetail/index?id=' + item.PrdtId |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const handleToSingleDetail = (item: any) => { |
|
|
|
|
// 单本删除
|
|
|
|
|
const handleDelSingle = (item: any) => { |
|
|
|
|
if (item.SubscribedState === -1) { |
|
|
|
|
// 已过期,直接删除
|
|
|
|
|
debugger |
|
|
|
|
Taro.request({ |
|
|
|
|
url: 'https://interapi.jm-kid.com/api/mark/subscribed', |
|
|
|
|
method: 'POST', |
|
|
|
@ -469,10 +500,6 @@ export default function Subscribe() { |
|
|
|
|
requestUserSubscribe() |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
Taro.navigateTo({ |
|
|
|
|
url: '/pages/SingleDetail/index?id=' + item.PrdtId |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -603,7 +630,7 @@ export default function Subscribe() { |
|
|
|
|
{ |
|
|
|
|
item.SubscribedState === -1 && ( |
|
|
|
|
<View className='expire'> |
|
|
|
|
<Image src='https://oss.jm-kid.com/wx_5colorflower/error.png' className='expire_icon'></Image> |
|
|
|
|
<Image src='https://oss.jm-kid.com/wx_5colorflower/error.png' className='expire_icon' onClick={() => handleDelSingle(item)}></Image> |
|
|
|
|
<View className='expire_text'>已 过 期</View> |
|
|
|
|
</View> |
|
|
|
|
) |
|
|
|
@ -635,6 +662,14 @@ export default function Subscribe() { |
|
|
|
|
mode='widthFix' |
|
|
|
|
lazyLoad |
|
|
|
|
></Image> |
|
|
|
|
{ |
|
|
|
|
item.SubscribedState === -1 && ( |
|
|
|
|
<View className='expire'> |
|
|
|
|
<Image src='https://oss.jm-kid.com/wx_5colorflower/error.png' className='expire_icon' onClick={() => handleDelCollection(item)}></Image> |
|
|
|
|
<View className='expire_text'>已 过 期</View> |
|
|
|
|
</View> |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
{ |
|
|
|
|
item.isFree === 1 && <Text className='subscribe_content_singleItem_label'>免费绘本</Text> |
|
|
|
|
} |
|
|
|
@ -712,7 +747,8 @@ export default function Subscribe() { |
|
|
|
|
visible={isToStoreOpen} |
|
|
|
|
onClose={() => setisToStoreOpen(false)} |
|
|
|
|
type={1} |
|
|
|
|
setmallLink={(link: string) => {}} |
|
|
|
|
mallLink={prdtMallLink} |
|
|
|
|
setmallLink={setprdtMallLink} |
|
|
|
|
></GoToStoreModal> |
|
|
|
|
|
|
|
|
|
<UserExchangeSuccessModal exchangeState={exchangeState} prdtList={prdtList} prdtNames={prdtNames} isOpen={isUserExchangeSuccessModalOpen} setIsOpen={setisUserExchangeSuccessModalOpen}></UserExchangeSuccessModal> |
|
|
|
|