Browse Source

fix: 【bcwin网站】首充优惠活动图标,限时过期的活动没有实时刷新隐藏,需要手动刷新

Before 8 months ago
parent
commit
e90d806127

+ 2 - 1
src/app/[locale]/(TabBar)/[[...share]]/@actionWidget/Service.tsx

@@ -110,7 +110,7 @@ const ServiceWidget: FC<Props> = (props) => {
             });
         }
     };
-    const { data: paysInfo } = useRequest<PayDataType, any>(getPayInfo, {
+    const { data: paysInfo, run: payRun } = useRequest<PayDataType, any>(getPayInfo, {
         pollingErrorRetryCount: 1,
         pollingWhenHidden: false,
     });
@@ -157,6 +157,7 @@ const ServiceWidget: FC<Props> = (props) => {
                                         " z-1 text-[#fff]"
                                     }
                                     endTime={item.end_time}
+                                    onEndHandler={payRun}
                                 />
                             ) : null}
                         </div>

+ 3 - 3
src/components/Box/UserRecharge.tsx

@@ -21,12 +21,12 @@ export interface RechargeContentProps {
     type?: "page" | "popup";
 }
 
-export function Timeout(props: { endTime: number; className?: string }) {
-    const { endTime, className } = props;
+export function Timeout(props: { endTime: number; className?: string; onEndHandler?: () => void }) {
+    const { endTime, className, onEndHandler } = props;
     const [countdown, time] = useCountDown({
         targetDate: endTime * 1000,
         onEnd: () => {
-            console.log(`🚀🚀🚀🚀🚀-> in UserRecharge.tsx on 26 倒计时拘束`);
+            onEndHandler && onEndHandler();
         },
     });
     const cls = clsx(