|
|
|
@ -100,7 +100,7 @@ export default function Subscribe() { |
|
|
|
|
for(let item of res.data.data.FreeProducts){ |
|
|
|
|
|
|
|
|
|
b++ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(let sec_item of item.Child){ |
|
|
|
|
|
|
|
|
|
if(!singleArr.some((arr_item : any) => arr_item === sec_item)){ |
|
|
|
@ -172,7 +172,7 @@ export default function Subscribe() { |
|
|
|
|
let singleArr: any = [] |
|
|
|
|
|
|
|
|
|
for(let item of res.data.data.FreeProducts){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(let sec_item of item.Child){ |
|
|
|
|
|
|
|
|
|
if(!singleArr.some((arr_item : any) => arr_item === sec_item)){ |
|
|
|
@ -217,7 +217,7 @@ export default function Subscribe() { |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}, [isFilter]) |
|
|
|
|
|
|
|
|
@ -257,7 +257,7 @@ export default function Subscribe() { |
|
|
|
|
for(let item of res.data.data.FreeProducts){ |
|
|
|
|
|
|
|
|
|
b++ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(let sec_item of item.Child){ |
|
|
|
|
|
|
|
|
|
if(!singleArr.some((arr_item : any) => arr_item.PrdtId === sec_item.PrdtId)){ |
|
|
|
@ -391,7 +391,7 @@ export default function Subscribe() { |
|
|
|
|
s_res.data.data.Subscribed.forEach(element => { |
|
|
|
|
modalContent += `兑换成功: ${element.PrdtTitle}\n` |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Taro.showModal({ |
|
|
|
|
title: '兑换成功', |
|
|
|
|
content: modalContent, |
|
|
|
@ -417,7 +417,7 @@ export default function Subscribe() { |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
@ -478,24 +478,25 @@ export default function Subscribe() { |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<View className='subscribe_bg'> |
|
|
|
|
<View className='subscribe_header'> |
|
|
|
|
<View
|
|
|
|
|
<View |
|
|
|
|
className='subscribe_header_searchContainer' |
|
|
|
|
> |
|
|
|
|
</View> |
|
|
|
|
<Input
|
|
|
|
|
className='subscribe_header_input'
|
|
|
|
|
<Input |
|
|
|
|
className='subscribe_header_input' |
|
|
|
|
placeholder='请输入绘本名称' |
|
|
|
|
value={searchValue} |
|
|
|
|
disabled |
|
|
|
|
confirmType='search' |
|
|
|
|
onConfirm={() => handleSearch()} |
|
|
|
|
onInput={(e) => { |
|
|
|
|
setsearchValue(e.detail.value) |
|
|
|
|
}}
|
|
|
|
|
onClick={() => handleSearchToDetail()}
|
|
|
|
|
}} |
|
|
|
|
onClick={() => handleSearchToDetail()} |
|
|
|
|
></Input> |
|
|
|
|
<View |
|
|
|
|
className='subscribe_header_dressing' |
|
|
|
@ -508,25 +509,25 @@ export default function Subscribe() { |
|
|
|
|
></Image> |
|
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
<PopupHalfScreen
|
|
|
|
|
visible={isPopupOpen}
|
|
|
|
|
<PopupHalfScreen |
|
|
|
|
visible={isPopupOpen} |
|
|
|
|
onClose={() => setisPopupOpen(!isPopupOpen)} |
|
|
|
|
isfilter={isFilter} |
|
|
|
|
onFilter={setisFilter} |
|
|
|
|
></PopupHalfScreen> |
|
|
|
|
|
|
|
|
|
<View className='subscribe_selection'> |
|
|
|
|
<View
|
|
|
|
|
<View |
|
|
|
|
className='subscribe_selection_item' |
|
|
|
|
style={userSelect === 0 ? {color: '#3ba366', fontSize: '1rem', height: '1rem', lineHeight: '1rem'} : {color: 'rgba(0, 0, 0, .3)', fontSize: '.875rem', height: '.875rem', lineHeight: '.875rem'}} |
|
|
|
|
onClick={()=>{setuserSelect(0)}} |
|
|
|
|
> |
|
|
|
|
<Text className='subscribe_selection_item_text'>单本</Text> |
|
|
|
|
</View> |
|
|
|
|
<View
|
|
|
|
|
<View |
|
|
|
|
className='subscribe_selection_item' |
|
|
|
|
style={userSelect === 1 ? {color: '#3ba366', fontSize: '1rem', height: '1rem', lineHeight: '1rem'} : {color: 'rgba(0, 0, 0, .3)', fontSize: '.875rem', height: '.875rem', lineHeight: '.875rem'}} |
|
|
|
|
onClick={()=>{setuserSelect(1)}}
|
|
|
|
|
onClick={()=>{setuserSelect(1)}} |
|
|
|
|
> |
|
|
|
|
<Text className='subscribe_selection_item_text'>套装</Text> |
|
|
|
|
</View> |
|
|
|
@ -534,11 +535,11 @@ export default function Subscribe() { |
|
|
|
|
|
|
|
|
|
{/* 列表渲染 */} |
|
|
|
|
{ |
|
|
|
|
isGetUsePhone &&
|
|
|
|
|
isGetUsePhone && |
|
|
|
|
<ScrollView |
|
|
|
|
scrollY |
|
|
|
|
scrollWithAnimation |
|
|
|
|
className='subscribe_content' |
|
|
|
|
className={`subscribe_content ${!userSubscribeSingleList.length && !userSubscribeCollectionList.length ? 'empty' : ''}`} |
|
|
|
|
enableFlex |
|
|
|
|
> |
|
|
|
|
<View |
|
|
|
@ -547,7 +548,7 @@ export default function Subscribe() { |
|
|
|
|
> |
|
|
|
|
{ |
|
|
|
|
userSelect === 0 && userSubscribeSingleList.length > 0 && userSubscribeSingleList.map((item: any, index: number) => ( |
|
|
|
|
<View
|
|
|
|
|
<View |
|
|
|
|
className='subscribe_content_singleItem' |
|
|
|
|
key={index} |
|
|
|
|
onClick={() => handleToSingleDetail(item.PrdtId)} |
|
|
|
@ -561,7 +562,7 @@ export default function Subscribe() { |
|
|
|
|
</View> |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Image |
|
|
|
|
className='subscribe_content_singleItem_cover' |
|
|
|
|
src={item.PrdtCover} |
|
|
|
@ -575,7 +576,7 @@ export default function Subscribe() { |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
userSelect === 1 && userSubscribeCollectionList.length > 0 && userSubscribeCollectionList.map((item: any, index: number) => ( |
|
|
|
|
<View
|
|
|
|
|
<View |
|
|
|
|
className='subscribe_content_collectionItem' |
|
|
|
|
key={index} |
|
|
|
|
onClick={() => handleToCollectionDetail(item.PrdtId)} |
|
|
|
@ -592,7 +593,7 @@ export default function Subscribe() { |
|
|
|
|
<Image |
|
|
|
|
className='subscribe_content_singleItem_cover' |
|
|
|
|
src={item.PrdtCover} |
|
|
|
|
mode='aspectFit' |
|
|
|
|
mode='widthFix' |
|
|
|
|
lazyLoad |
|
|
|
|
></Image> |
|
|
|
|
<View className='subscribe_content_singleItem_title'>{item.PrdtTitle}</View> |
|
|
|
@ -611,40 +612,41 @@ export default function Subscribe() { |
|
|
|
|
} |
|
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
isGetUsePhone && (isFilter === '' || isFilter === 'reset') &&
|
|
|
|
|
<View className='subscribe_footer'> |
|
|
|
|
<Text className='subscribe_footer_tips'> |
|
|
|
|
{ |
|
|
|
|
userSelect === 0 ? `${userSubscribeSingleFreeCount}本免费绘本,${userSubscribeSinglePaidCount}本订阅绘本 ` : `${userSubscribeCollectionFreeCount}套免费绘本,${userSubscribeCollectionPaidCount}套订阅绘本 ` |
|
|
|
|
} |
|
|
|
|
</Text> |
|
|
|
|
<Text
|
|
|
|
|
className='subscribe_footer_add' |
|
|
|
|
onClick={handleNavigateToMiniProgram}
|
|
|
|
|
> |
|
|
|
|
订阅更多绘本 |
|
|
|
|
</Text> |
|
|
|
|
</View> |
|
|
|
|
} |
|
|
|
|
</ScrollView> |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
isGetUsePhone && userSelect === 0 && userSubscribeSingleList.length === 0 &&
|
|
|
|
|
<DefaultPage3></DefaultPage3> |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
isGetUsePhone && userSelect === 1 && userSubscribeCollectionList.length === 0 &&
|
|
|
|
|
<DefaultPage3></DefaultPage3> |
|
|
|
|
{ |
|
|
|
|
isGetUsePhone && (isFilter === '' || isFilter === 'reset') && |
|
|
|
|
<View className='subscribe_footer'> |
|
|
|
|
<Text className='subscribe_footer_tips'> |
|
|
|
|
{ |
|
|
|
|
userSelect === 0 ? `${userSubscribeSingleFreeCount}本免费绘本,${userSubscribeSinglePaidCount}本订阅绘本 ` : `${userSubscribeCollectionFreeCount}套免费绘本,${userSubscribeCollectionPaidCount}套订阅绘本 ` |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
</ScrollView> |
|
|
|
|
</Text> |
|
|
|
|
<Text |
|
|
|
|
className='subscribe_footer_add' |
|
|
|
|
onClick={handleNavigateToMiniProgram} |
|
|
|
|
> |
|
|
|
|
订阅更多绘本 |
|
|
|
|
</Text> |
|
|
|
|
</View> |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
isGetUsePhone && userSelect === 0 && userSubscribeSingleList.length === 0 && |
|
|
|
|
<DefaultPage3></DefaultPage3> |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
isGetUsePhone && userSelect === 1 && userSubscribeCollectionList.length === 0 && |
|
|
|
|
<DefaultPage3></DefaultPage3> |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/* 用户未登录 */} |
|
|
|
|
{ |
|
|
|
|
!isGetUsePhone &&
|
|
|
|
|
!isGetUsePhone && |
|
|
|
|
<DefaultPage1 |
|
|
|
|
setisGetUsePhone={setisGetUsePhone} |
|
|
|
|
></DefaultPage1> |
|
|
|
@ -652,15 +654,15 @@ export default function Subscribe() { |
|
|
|
|
|
|
|
|
|
<GetPhoneNumber |
|
|
|
|
onClose={setisGetUsePhone} |
|
|
|
|
scene={userScene}
|
|
|
|
|
scene={userScene} |
|
|
|
|
modalVisible={isLoginOpen} |
|
|
|
|
onModalClose={() => setisLoginOpen(false)} |
|
|
|
|
></GetPhoneNumber> |
|
|
|
|
|
|
|
|
|
{/* 跳转商城 */} |
|
|
|
|
<GoToStoreModal
|
|
|
|
|
visible={isToStoreOpen}
|
|
|
|
|
onClose={() => setisToStoreOpen(false)}
|
|
|
|
|
<GoToStoreModal |
|
|
|
|
visible={isToStoreOpen} |
|
|
|
|
onClose={() => setisToStoreOpen(false)} |
|
|
|
|
type={1} |
|
|
|
|
setmallLink={(link: string) => {}} |
|
|
|
|
></GoToStoreModal> |
|
|
|
|