Переглянути джерело

fix: 7128 【bcwin网站】提现后,弹窗提示未自动关闭 7092

Before 7 місяців тому
батько
коміт
aa0f89d59a

+ 95 - 52
src/app/[locale]/(navbar)/withdraw/WithdrawWidget.tsx

@@ -2,7 +2,7 @@
 import { GameListRep } from "@/api/home";
 import { userInfoApi } from "@/api/login";
 import { Wallet } from "@/api/user";
-import { ChannelType, getWithDrawApi, WithDrawType } from "@/api/withdraw";
+import { ChannelType, getWithDrawApi, WithDrawParams, WithDrawType } from "@/api/withdraw";
 import { clearWallet } from "@/app/[locale]/(navbar)/withdraw/actions";
 import Box from "@/components/Box";
 import ButtonOwn from "@/components/ButtonOwn";
@@ -115,7 +115,9 @@ const WithdrawWidget: FC<Props> = (props) => {
 
     const score = useWalletStore((state) => state.score)!;
 
+    // 彩金
     const withdrawRef = useRef<ModalProps>(null);
+    const bounsModalRef = useRef<ModalProps>(null);
     // 积分
     const scoreRef = useRef<ModalProps>(null);
     // 未完成游戏
@@ -125,8 +127,6 @@ const WithdrawWidget: FC<Props> = (props) => {
     const formRef = useRef<FormInstance>(null);
 
     // 是否能提现
-    const [isPay, setIsPay] = useState(false);
-
     const [activeWallet, setActiveWallet] = useState<WithDrawType>(channels[0]);
     const walletAction =
         activeWallet &&
@@ -143,7 +143,7 @@ const WithdrawWidget: FC<Props> = (props) => {
         passport: userInfo.passport,
         user_name: userInfo.user_name,
     };
-    const paramsTarget = useRef<any>(null);
+    const paramsTarget = useRef<WithDrawParams | null>(null);
 
     const AmountValidator = (rules: any, value: string) => {
         const num = +value;
@@ -189,26 +189,31 @@ const WithdrawWidget: FC<Props> = (props) => {
 
         const { data } = await userInfoApi();
 
+        // 如果有未完成游戏
         if (data.play_list && data.play_list.length > 0) {
             game.current = data.play_list[0];
             gameModelRef.current?.onOpen();
             return;
         }
-        paramsTarget.current = params;
+        // 如果彩金 || 彩金打码量不为0
         if (
-            flatPoint(wallet.target_point_rollover - wallet.current_point_rollover) !== 0 &&
-            !isPay
+            flatPoint(wallet.target_point_rollover - wallet.current_point_rollover) > 0 ||
+            (wallet.point || 0) > 0
         ) {
-            withdrawRef.current?.onOpen();
-            setIsPay(true);
+            paramsTarget.current = params;
+            bounsModalRef.current?.onOpen();
             return;
         }
+        extractHandler(params);
+    };
+    const extractHandler = async (params: WithDrawParams) => {
         const withResult = await getWithDrawApi(params).catch((error) => {
             Toast.show(t(`code.${error.data.code}`));
         });
         if (withResult && withResult.code === 200) {
             Toast.show(t("code.200"));
         }
+
         await clearWallet();
     };
 
@@ -444,24 +449,61 @@ const WithdrawWidget: FC<Props> = (props) => {
             {/*彩金*/}
             <TipsModal
                 title={
-                    isPay ? (
-                        <div className={"text-left text-[0.12rem] font-medium text-[#666]"}>
-                            Retirar bem sucedido, seu dinheiro de prémio será limpo. Você tem
-                            certeza?
-                        </div>
-                    ) : (
+                    <div className={"flex items-center"}>
+                        <i
+                            className={"iconfont icon-liwuhuodong mr-[0.0694rem] text-[0.2778rem]"}
+                        ></i>
+                        {t("WithdrawPage.pointTitle")}
+                    </div>
+                }
+                ref={withdrawRef}
+            >
+                <ul>
+                    <li className={"mb-[0.0694rem]"}>
+                        <span>{t("WithdrawPage.pointTips")}</span>
+                        <span>{wallet.point}</span>
+                    </li>
+                    <li>
                         <div className={"flex items-center"}>
-                            <i
-                                className={
-                                    "iconfont icon-liwuhuodong mr-[0.0694rem] text-[0.2778rem]"
-                                }
-                            ></i>
-                            {t("WithdrawPage.pointTitle")}
+                            <ProgressBar
+                                percent={percentage(
+                                    wallet.current_point_rollover,
+                                    wallet.target_point_rollover
+                                )}
+                                className={"mr-[0.0694rem] flex-1"}
+                                style={{
+                                    "--fill-color": "#fb8b05",
+                                    "--track-width": "0.0694rem",
+                                }}
+                            />
+                            <span>
+                                {percentage(
+                                    wallet.current_point_rollover,
+                                    wallet.target_point_rollover
+                                )}
+                                %
+                            </span>
                         </div>
-                    )
+
+                        <div>
+                            <span>{t("WithdrawPage.pointBet")}</span>
+                            <span>
+                                {flatPoint(
+                                    wallet.target_point_rollover - wallet.current_point_rollover
+                                )}
+                            </span>
+                        </div>
+                    </li>
+                </ul>
+            </TipsModal>
+            {/*含有彩金提现拦截*/}
+            <TipsModal
+                title={
+                    <div className={"text-left text-[0.12rem] font-medium text-[#666]"}>
+                        Retirar bem sucedido, seu dinheiro de prémio será limpo. Você tem certeza?
+                    </div>
                 }
-                ref={withdrawRef}
-                onBeforeClose={() => setIsPay(false)}
+                ref={bounsModalRef}
             >
                 <ul>
                     <li className={"mb-[0.0694rem]"}>
@@ -499,34 +541,35 @@ const WithdrawWidget: FC<Props> = (props) => {
                             </span>
                         </div>
 
-                        {isPay ? (
-                            <div className={"mt-[20px] flex justify-around"}>
-                                <Button
-                                    color={"default"}
-                                    fill={"none"}
-                                    style={{
-                                        "--text-color": "var(--primary-color)",
-                                    }}
-                                    onClick={() => {
-                                        setIsPay(false);
-                                        withdrawRef.current?.onClose();
-                                    }}
-                                >
-                                    cancelar
-                                </Button>
-                                <Button
-                                    color={"primary"}
-                                    className={"ml-[30px]"}
-                                    style={{
-                                        "--background-color": "var(--primary-color)",
-                                        "--border-color": "var(--primary-color)",
-                                    }}
-                                    onClick={() => onFinish(paramsTarget.current)}
-                                >
-                                    confirmação
-                                </Button>
-                            </div>
-                        ) : null}
+                        <div className={"mt-[20px] flex justify-around"}>
+                            <Button
+                                color={"default"}
+                                fill={"none"}
+                                style={{
+                                    "--text-color": "var(--primary-color)",
+                                }}
+                                onClick={() => {
+                                    bounsModalRef.current?.onClose();
+                                }}
+                            >
+                                cancelar
+                            </Button>
+                            <Button
+                                color={"primary"}
+                                className={"ml-[30px]"}
+                                style={{
+                                    "--background-color": "var(--primary-color)",
+                                    "--border-color": "var(--primary-color)",
+                                }}
+                                onClick={() => {
+                                    // 关闭彩金弹窗
+                                    bounsModalRef.current?.onClose();
+                                    extractHandler(paramsTarget.current!);
+                                }}
+                            >
+                                confirmação
+                            </Button>
+                        </div>
                     </li>
                 </ul>
             </TipsModal>

+ 1 - 1
src/app/[locale]/affiliate/summary/page.tsx

@@ -148,7 +148,7 @@ const RulesClient = () => {
 
             <ul className={"ml-[0.1389rem] mt-[0.1389rem] list-disc text-[#98a7b5]"}>
                 <li className={"mt-[0.0694rem]"}>
-                    As comissões podem ser retiradas em nossa carteira 8pg do painel a qualquer
+                    As comissões podem ser retiradas em nossa carteira bawin do painel a qualquer
                     momento.
                 </li>
                 <li className={"mt-[0.0694rem]"}>O sistema calcula a comissão a cada 24 horas.</li>

+ 16 - 193
src/components/ModalPopup/ActivityModal/style.module.scss

@@ -1,195 +1,18 @@
-$time: 0.8s;
-.flashingAnimation {
-  animation: flashing $time  linear infinite ;
-}
-@keyframes flashing {
-  0%, 50% {
-    opacity: 0;
-  }
-  50.01%, 100% {
-    opacity: 1;
-  }
-}
-.antiFlashingAnimation {
-  animation: antiFlashing $time  linear infinite ;
-  animation-delay: $time;
-}
-@keyframes antiFlashing {
-  0%, 50% {
-    opacity: 1;
-  }
-  50.01%, 100% {
-    opacity: 0;
-  }
-}
-
-
-
-.activeAnimation{
-  animation: activing  0.3s ease  infinite alternate;
-}
-@keyframes activing {
-  0% {
-    opacity: 0;
-  }
-  100% {
-    opacity: 1;
-  }
-}
-
-
-.rotateAnimation{
-  animation: rotating 10s  linear  infinite ;
-}
-@keyframes rotating {
-  0% {
-    transform: rotate(0deg);
-  }
-
-  20% {
-    transform: rotate(72deg);
-  }
-
-  40% {
-    transform: rotate(144deg);
-  }
-
-  60% {
-    transform: rotate(216deg);
-  }
-
-  80% {
-    transform: rotate(288deg);
-  }
-
-  100% {
-    transform: rotate(360deg);
-  }
-
-}
-
-.floatAnimation {
-  animation: floating 2s  ease  infinite alternate;
-}
-@keyframes floating {
-  0% {
-    transform: translateY(0);
-  }
-  100% {
-    transform: translateY(20px);
-  }
-}
-
-$scaleTime: 3s;
-//展开
-.expandAnimation {
-  animation:  expanding $scaleTime linear forwards;
-}
-@keyframes expanding {
-  0% {
-    transform: scale3d(0,0,0);
-    opacity: 1;
-  }
-  50%{
-    transform: scale3d(1.1,1.1,1.1);
-    opacity: 0.5;
-  }
-  100%{
-    transform: scale3d(2,2,2);
-    opacity: 0;
-  }
-}
-
-
-
-.scaleLxAnimation {
-  animation: scaleLx $scaleTime linear forwards; /* 2s 动画,保持最终状态 */
-}
-@keyframes scaleLx {
-  0% {
-    transform: scale(0.1) translate(0, 0);
-    opacity: 1;
-  }
-  50% {
-    transform: scale(1) translateX(-0.6944rem); /* 最终放大并位移 */
-    opacity: 0.5; /* 渐隐 */
-  }
-  100% {
-    transform: scale(2) translateX(-1.3889rem); /* 最终放大并位移 */
-    opacity: 0; /* 渐隐 */
-  }
-}
-.scaleRxAnimation {
-  animation: scaleRx $scaleTime linear forwards; /* 2s 动画,保持最终状态 */
-}
-@keyframes scaleRx {
-  0% {
-    transform: rotate(180deg) scale(0.1) translate(0, 0);
-    opacity: 1;
-  }
-  50% {
-    transform:rotate(180deg)  scale(1) translateX(-0.6944rem); /* 最终放大并位移 */
-    opacity: 0.5;
-  }
-  100% {
-    transform:rotate(180deg)  scale(2) translateX(-1.3889rem); /* 最终放大并位移 */
-    opacity: 0;
-  }
-}
-
-.moveAnimation{
-  animation: moveIng 5s linear infinite  ; /* 2s 动画,保持最终状态 */
-}
-@keyframes moveIng {
-  0% {
-    background-position: 0 0;
-  }
-  100% {
-    background-position: -100% 0;  /* 终点: /* 终点:向左完全滚出容器 */
-  }
-}
-
-/// 红包雨摇曳动画
-@function random_range($min, $max) {
-  $rand: random();
-  $random_range: $min + floor($rand * (($max - $min) + 1));
-  @return $random_range;
-}
-
-.snow {
-  $total: 300;
-  position: absolute;
-  //width: 77px;
-  //height: 44px;
-  width: fit-content;
-  height: fit-content;
-
-  @for $i from 1 through $total {
-    $random-x: random(100) * 1vw;
-    $random-offset: random_range(-20, 20) * 1vw;
-    $random-x-end: $random-x + $random-offset;
-    $random-x-end-yoyo: $random-x + ($random-offset / 2);
-    $random-yoyo-time: random_range(0.3, 0.8);
-    $random-yoyo-y: $random-yoyo-time * 100vh;
-    $random-scale: random_range(3000, 10000) * 0.0001;
-    $fall-duration: random_range(10, 30) * .5s;
-    $fall-delay: random(30) * -1s;
-    $rotate-speed: random_range(360, 1440);
-    @debug $random-offset;
-    &:nth-child(#{$i}) {
-      //opacity: random(10000) * 0.0001;
-      transform: translate($random-x, -20px) scale($random-scale)  rotate(180deg);
-      animation: fall-#{$i} $fall-duration $fall-delay linear infinite;
-    }
-
-    @keyframes fall-#{$i} {
-      #{percentage($random-yoyo-time)} {
-        transform: translate($random-x-end, $random-yoyo-y) scale($random-scale);
-      }
-
-      to {
-        transform: translate($random-x-end-yoyo, 100vh) scale($random-scale)  rotate(180deg) ;
-      }
-    }
+.ActivityShadow {
+  font-weight: 900;
+  font-size: var(--font-size, 0.2778rem);
+  text-shadow: 0 1px 0 #fff;
+  color: #fbce72;
+  &::before {
+    content: attr(data-text);
+    font-weight: 900;
+    font-size: var(--font-size, 0.2778rem);
+    position: absolute;
+    z-index: 10;
+    background: linear-gradient(to bottom, #fbd68f, #ed7d03);
+    -webkit-background-clip: text;
+    background-clip: text;
+    -webkit-text-fill-color: transparent;
+    text-shadow: none;
   }
 }