Bläddra i källkod

fix: 修改电话号码区号逻辑

Before 6 månader sedan
förälder
incheckning
aae1540d1c

+ 12 - 7
src/app/[locale]/(enter)/components/Form/index.tsx

@@ -121,6 +121,8 @@ interface FormProps {
      * 渠道链接
      */
     channel_code?: string;
+
+    code_phone?: string;
 }
 interface FormInitStateTypes extends FormProps {
     mobile?: {
@@ -166,7 +168,7 @@ const FormComponent: FC<Props> = (props) => {
         const { mobile } = values;
         const newValue = {
             ...values,
-            user_phone: mobile?.realValue,
+            user_phone: `${mobile?.preValue}${mobile?.realValue}`,
             code_phone: mobile?.preValue,
         };
 
@@ -235,12 +237,14 @@ const FormComponent: FC<Props> = (props) => {
             registerApi(newValues)
                 .then(async (res) => {
                     if (res.code === 200) {
-                        loginHandler({ pwd: values.pwd, user_phone: values.user_phone }).then(
-                            () => {
-                                router.replace("/recharge");
-                                Toast.clear();
-                            }
-                        );
+                        loginHandler({
+                            pwd: values.pwd,
+                            user_phone: values.user_phone,
+                            code_phone: values.code_phone,
+                        }).then(() => {
+                            router.replace("/recharge");
+                            Toast.clear();
+                        });
                     }
                 })
                 .catch((error) => {
@@ -254,6 +258,7 @@ const FormComponent: FC<Props> = (props) => {
                 });
         } else {
             /// 登录
+            console.log(`🚀🚀🚀🚀🚀-> in index.tsx on 257`, values);
             loginHandler(values).then(() => {
                 Toast.clear();
                 const redirect = searchParams.get("redirect")

+ 6 - 0
src/app/[locale]/(navbar)/withdraw/WithdrawWidget.tsx

@@ -221,6 +221,12 @@ const WithdrawWidget: FC<Props> = (props) => {
     const onFinish = async (value: any) => {
         const params = { ...value, ...value.channel, amount: +value.amount };
 
+        // 如果是电话号码,拼接区号
+        if (params.code_phone) {
+            params.account_no = `${params.code_phone}${params.account_no}`;
+        }
+        delete params.channel;
+
         const { data } = await userInfoApi();
 
         // 如果有未完成游戏

+ 1 - 1
src/components/Layout/Sidebar.tsx

@@ -75,7 +75,7 @@ const Sidebar: FC<PropsWithChildren<Props>> = (props) => {
     }, [isCollapse]);
 
     return (
-        <Box>
+        <Box pt={false}>
             <div className={"my-[10px] flex items-center"}>
                 <div className={"flex-1"}>
                     <Image src={"/logo.png"} alt={"logo"} width={140} height={120} />