yujialong 2 weeks ago
parent 123a0f1b24
commit 50c331d799
  1. 23
      src/pages/Subscribe/index.less
  2. 54
      src/pages/Subscribe/index.tsx

@ -208,6 +208,29 @@
background-color: #fcca1e;
}
.expire {
position: absolute;
top: 0;
left: 0;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .6);
.expire_icon {
position: absolute;
top: .3rem;
right: .3rem;
width: 1.5rem;
height: 1.5rem;
}
.expire_text {
font-size: .8rem;
color: #f00;
}
}
.subscribe_content_singleItem_cover {
width: 100%;
height: 5.8rem;

@ -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>

Loading…
Cancel
Save