Browse Source

feat: 红包雨图片优化

xiaolin.fu 8 tháng trước cách đây
mục cha
commit
08def8bdf5

+ 5 - 5
src/app/[locale]/(TabBar)/(entire)/promo/PopupHby.tsx

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

+ 2 - 2
src/app/[locale]/(TabBar)/(entire)/promo/style.module.scss

@@ -259,8 +259,8 @@
   z-index: 120;
   .closeIcon{
     position: absolute;
-    right:0.35rem;
-    top:0.4rem;
+    right:0;
+    top:0;
     cursor: pointer;
   }
   .title{