瀏覽代碼

【bcwin后台】运营活动-定时送免费币,打码倍数没有随机变化

zcj03 6 月之前
父節點
當前提交
69be0bab78
共有 1 個文件被更改,包括 8 次插入1 次删除
  1. 8 1
      src/components/ModalPopup/SlotsModal/index.tsx

+ 8 - 1
src/components/ModalPopup/SlotsModal/index.tsx

@@ -217,16 +217,23 @@ const SlotsClient: FC<SlotsClientProps> = (props) => {
         }, 200);
         slotsRef.current?.play();
 
+        const Interval = setInterval(() => {
+            const num = Math.floor(Math.random() * 99) + 1
+            setRatio(() => (numberPadding(num, 2)))
+        }, 500)
+
         // 数据获取
         getGiveReceiveApi(params as SlotParams)
             .then((res) => {
                 setTimeout(() => {
+                    Interval && clearInterval(Interval)
                     const rollover = flatPoint(res.data.rollover / 100);
                     slotsRef.current?.stop(numberPadding(res.data.amount));
                     setRatio(numberPadding(rollover > 100 ? 99 : rollover, 2));
-                }, 2500);
+                }, 3000);
             })
             .catch((error) => {
+                Interval && clearInterval(Interval)
                 slotsRef.current.init();
                 rotating.current = false;
                 Toast.show(t(`code.${error.data.code}`));