|
@@ -404,14 +404,13 @@ const Popup = ( props:any) => {
|
|
|
|
|
|
|
|
|
|
|
|
- console.log('actList',actList)
|
|
|
|
|
|
let isShowRed = isHasStartAct.length>0
|
|
|
let isShowRedDetail = isHasStartAct.length === 0
|
|
|
let redInfo = isShowRed ? isHasStartAct[0] : {}
|
|
|
|
|
|
- let curAct = !!isShowRed ? isHasStartAct : findCurrentActivity(actList)
|
|
|
- let iconList = JSON.parse(curAct[0].icon)
|
|
|
+ let curAct = !!isShowRedDetail ? findCurrentActivity(actList) : actList[0]
|
|
|
+ let iconList = JSON.parse(curAct.icon)
|
|
|
|
|
|
setIconLists(iconList)
|
|
|
setIsShowRed(isShowRed)
|
|
@@ -426,7 +425,7 @@ const Popup = ( props:any) => {
|
|
|
|
|
|
|
|
|
// 筛选出离当前时间最近的活动
|
|
|
- const findCurrentActivity=(activities)=> {
|
|
|
+ const findCurrentActivity=(activities:any)=> {
|
|
|
const now = Math.floor(Date.now() / 1000); // 获取当前时间的时间戳(单位:秒)
|
|
|
let closestActivity = null;
|
|
|
let isInRange = false;
|
|
@@ -464,6 +463,7 @@ const Popup = ( props:any) => {
|
|
|
}
|
|
|
let receiveRedPacketInfo = await receiveRedPacketApi(paramsData)
|
|
|
let redNum = receiveRedPacketInfo.data
|
|
|
+ setIsShowRed(false)
|
|
|
setIsShowReciveRed(true)
|
|
|
setRedAmount(redNum?.amount)
|
|
|
}catch(error){
|
|
@@ -481,7 +481,7 @@ const Popup = ( props:any) => {
|
|
|
{/* <ReceivePackage /> */}
|
|
|
|
|
|
{!!isShowRed && <HbyInfo onCloseHby={onClose} onReciveRed={onReciveRed} iconImg={iconLists[1]}/>}
|
|
|
- {!!isShowReciveRed && <HbyInfo2 onCloseHby={onClose} onReciveRed={onReciveRed} redAmount={redAmount} iconImg={iconLists[2]}/>}
|
|
|
+ {!!isShowReciveRed && <HbyInfo2 onCloseHby={onClose} redAmount={redAmount} iconImg={iconLists[2]}/>}
|
|
|
{!!isShowRedDetail && <HbyInfoDetail onCloseHby={onClose} iconImg={iconLists[0]}/>}
|
|
|
</Mask>
|
|
|
);
|