Browse Source

MX TX账号设置 PAY完善

zhejiushizhuce 2 years ago
parent
commit
6398bbb9ac

+ 1 - 0
src/api/config.js

@@ -65,6 +65,7 @@ export const APP_WITHDRAW_RECORD=BASE_PREFIX+"withDraw/record";
 export const APP_WITHDRAW_SET_INFO=BASE_PREFIX+"withDraw/withDrawInfo";
 export const APP_WITHDRAW_PAYOUT=BASE_PREFIX+"withDraw/payout";
 export const APP_FORGET_PAY_PASS=BASE_PREFIX+"forgetPayPass";
+export const APP_MEX_WITHDRAW_SET_INFO=BASE_PREFIX+"withDraw/mexWithDrawInfo";
 //withdraw
 //userinfo
 export const APP_GAME_INFO=BASE_PREFIX+"info";

+ 25 - 1
src/features/api.js

@@ -28,7 +28,7 @@ import {
     APP_MAIL_DEL,
     APP_MAIL_LIST,
     APP_MAIL_READ,
-    APP_MAIL_TAKE,
+    APP_MAIL_TAKE, APP_MEX_WITHDRAW_SET_INFO,
     APP_PAGE_MODULES,
     APP_PAY_ORDER_LIST,
     APP_PAYMENT_ORDER, APP_PROTECT_CHECK, APP_PROTECT_GET,
@@ -492,6 +492,30 @@ export const reqWithdrawPayout=createAsyncThunk(
         return response;
     }
 )
+export const reqMexWithdrawSetInfo=createAsyncThunk(
+    APP_MEX_WITHDRAW_SET_INFO,
+    async (arg,thunkAPI) => {
+        let pass=global.getWDPass();
+        let params={
+            url:APP_MEX_WITHDRAW_SET_INFO,
+            data:{
+                paypass:pass,
+                bank:arg.bank,
+                account:arg.account,
+                userName:arg.userName,
+                phone:arg.phone,
+                email:arg.email,
+                PixType:1,
+                IFSCNumber:arg.IFSC
+            }
+        }
+        const response=await Http.post(params);
+        if (response&&response.code===200){
+            thunkAPI.dispatch(reqWithdrawBaseInfo());
+        }
+        return response;
+    }
+)
 //withdraw
 //用户信息
 export const reqGameInfo=createAsyncThunk(

+ 3 - 1
src/features/paySlice.js

@@ -4,7 +4,7 @@ import {
     buildReqReducer,
     reqChangePayPass,
     reqFirstPayConfig, reqForgetPayPass,
-    reqGetAccountsPayInfo,
+    reqGetAccountsPayInfo, reqMexWithdrawSetInfo,
     reqPaymentOrder,
     reqPayOrderList,
     reqRechargeConfig,
@@ -188,6 +188,7 @@ const reducerWithdrawSetInfo=(state,action,arg)=>{
     let payload=action.payload;
     let msg=payload.msg;
     if (msg==null)msg="";
+    else msg=getHttpMsg(payload);
     if (payload&&payload.code===200){
         let data=payload.data;
         toast.success(msg);
@@ -279,6 +280,7 @@ export const Pay=createSlice({
         buildReqReducer(builder,reqWithdrawSetInfo,reducerWithdrawSetInfo,withdrawSetInfoStatus);
         buildReqReducer(builder,reqWithdrawPayout,reducerWithdrawPayout,withdrawPayoutStatus);
         buildReqReducer(builder,reqForgetPayPass,reducerChangePayPass,changePayPassStatus);
+        buildReqReducer(builder,reqMexWithdrawSetInfo,reducerWithdrawSetInfo,withdrawSetInfoStatus);
     },
 })
 export const {updatePayFinish,setChangePayPassType} = Pay.actions;

+ 21 - 0
src/locales/languages/en_US.json

@@ -348,6 +348,27 @@
 
       }
     },
+    "account_mx": {
+      "userName": "Name",
+      "name_holder": "Enter Name",
+      "email": "Email",
+      "email_holder": "Input Email-ID",
+      "phone": "Telephone[+52]",
+      "phone_holder": "Enter 10 digits",
+      "tedCon": "Bank accounts",
+      "tedCon_holder": "exemple:123456",
+      "tedBan": "Bank Code",
+      "tedBan_holder": "exemple:123456",
+      "clabe": "CLABE",
+      "clabe_holder": "exemple:002-010-12345678901-5",
+      "help": "Please make sure your Account Number is correct,we do not take any responsi-bilty caused by incorrect input",
+      "s_title": "Bank code selection",
+      "clabe_help_title": "What is CLABE?",
+      "clabe_help_1": "3 digits:Bank Code of Mexico",
+      "clabe_help_2": "3 digits: branch location code",
+      "clabe_help_3": "11 digits: bank account number",
+      "clabe_help_4": "1 digit: validation of CLABE number"
+    },
     "pass": {
       "prompt": "For the security of your funds, please set up a fund password first",
       "btn_confirm": "Confirm",

+ 21 - 0
src/locales/languages/es_MX.json

@@ -343,6 +343,27 @@
         "is_error": "formato incorrecto"
       }
     },
+    "account_mx": {
+      "userName": "Nombre",
+      "name_holder": "Introduce el nombre",
+      "email": "Correo",
+      "email_holder": "Introduce el correo electrónico",
+      "phone": "Teléfono[+52]",
+      "phone_holder": "Introduzca 10 dígitos",
+      "tedCon": "Cuenta bancaria",
+      "tedCon_holder": "ejemplo:123456",
+      "tedBan": "Código del banco",
+      "tedBan_holder": "ejemplo:123456",
+      "clabe": "CLABE",
+      "clabe_holder": "ejemplo:002-010-12345678901-5",
+      "help": "Comprueba que tu cuenta es correcta, no nos responsabilizaremos de las pérdidas causadas por introducir datos erróneos.",
+      "s_title": "Selección de código bancario",
+      "clabe_help_title": "¿Qué es CLABE?",
+      "clabe_help_1": "3 dígitos: Código Bancario de México",
+      "clabe_help_2": "3 dígitos: código de ubicación de la sucursal",
+      "clabe_help_3": "11 dígitos: número de cuenta bancaria",
+      "clabe_help_4": "1 dígito: validación del número CLABE"
+    },
     "pass": {
       "prompt": "Para la seguridad de tus fondos, por favor configura una contraseña de fondos primero",
       "btn_confirm": "Confirmar",

+ 21 - 0
src/locales/languages/pt_BR.json

@@ -343,6 +343,27 @@
         "is_error": "formato incorreto"
       }
     },
+    "account_mx": {
+      "userName": "Nome",
+      "name_holder": "Nome de entrada",
+      "email": "E-mail",
+      "email_holder": "insira o e-mail",
+      "phone": "telefone[+52]",
+      "phone_holder": "Digite o telefone",
+      "tedCon": "Contas Bancárias",
+      "tedCon_holder": "exemplo: 123456",
+      "tedBan": "Banco Código",
+      "tedBan_holder": "exemplo: 123456",
+      "clabe": "CLABE",
+      "clabe_holder": "exemplo:002-010-12345678901-5",
+      "help": "Verifique se o seu número de conta está correto,não assumimos qualquer responsabilidade causada por entrada incorreta",
+      "s_title": "Seleção de código bancário",
+      "clabe_help_title": "O que é CLAB?",
+      "clabe_help_1": "3 dígitos: Código Bancário do México",
+      "clabe_help_2": "3 dígitos: código de localização da filial",
+      "clabe_help_3": "11 dígitos: número da conta bancária",
+      "clabe_help_4": "1 dígito: validação do número CLABE"
+    },
     "pass": {
       "prompt": "Para a segurança dos seus fundos, por favor configure uma senha de fundos primeiro",
       "btn_confirm": "Confirmar",

+ 21 - 0
src/locales/languages/ru_RU.json

@@ -343,6 +343,27 @@
         "is_error": "неправильный формат"
       }
     },
+    "account_mx": {
+      "userName": "Имя",
+      "name_holder": "Введите имя",
+      "email": "Электронная почта",
+      "email_holder": "Введите идентификатор электронной почты",
+      "phone": "Телефон[+52]",
+      "phone_holder": "Введите 10 цифр",
+      "tedCon": "Банковские счета",
+      "tedCon_holder": "пример:123456",
+      "tedBan": "Код банка",
+      "tedBan_holder": "пример:123456",
+      "clabe": "CLABE",
+      "clabe_holder": "пример:002-010-12345678901-5",
+      "help": "Пожалуйста, убедитесь, что номер вашего счета указан правильно. Мы не несем ответственности за неправильный ввод данных.",
+      "s_title": "Выбор банковского кода",
+      "clabe_help_title": "Что такое КЛАБЕ?",
+      "clabe_help_1": "3 цифры: Банковский код Мексики",
+      "clabe_help_2": "3 цифры: код местоположения филиала",
+      "clabe_help_3": "11 цифр: номер банковского счета",
+      "clabe_help_4": "1 цифра: проверка номера CLABE"
+    },
     "pass": {
       "prompt": "Пожалуйста, сначала установите пароль для безопасности ваших средств",
       "btn_confirm": "Подтвердить",

+ 21 - 0
src/locales/languages/zh_TW.json

@@ -343,6 +343,27 @@
         "is_error": "格式錯誤"
       }
     },
+    "account_mx": {
+      "userName": "姓名",
+      "name_holder": "輸入姓名",
+      "email": "電子郵件",
+      "email_holder": "輸入電子郵件 ID",
+      "phone": "電話[+52]",
+      "phone_holder": "輸入10位數字",
+      "tedCon": "銀行帳戶",
+      "tedCon_holder": "例子:123456",
+      "tedBan": "銀行代碼",
+      "tedBan_holder": "例子:123456",
+      "clabe": "CLABE",
+      "clabe_holder": "例子:002-010-12345678901-5",
+      "help": "請確保您的帳號正確,我們不承擔因輸入錯誤而造成的任何責任",
+      "s_title": "銀行代碼選擇",
+      "clabe_help_title": "什麼是CLABE?",
+      "clabe_help_1": "3 位數字:墨西哥銀行代碼",
+      "clabe_help_2": "3位數字:分行位置代碼",
+      "clabe_help_3": "11位數字:銀行帳號",
+      "clabe_help_4": "1 位數字:CLABE 編號驗證"
+    },
     "pass": {
       "prompt": "為了資金安全,請先設置資金密碼",
       "btn_confirm": "確認",

+ 5 - 3
src/widgets/WPaymentOrder/BR/BRPayOrder.jsx

@@ -12,6 +12,7 @@ import {CopyToClipboard} from "react-copy-to-clipboard";
 import {toast} from "react-toastify";
 import QRCode from 'qrcode.react';
 import {ReactComponent as SuccessIcon} from "@assets/singlesvg/succss.svg";
+import WOrderSuccess from "@widgets/WPaymentOrder/WOrderSuccess";
 const i18n=global.i18n;
 const BRPayOrder=({close})=>{
     const navigate=useNavigate();
@@ -158,9 +159,10 @@ const BRPayOrder=({close})=>{
         if (orderInfo==null)return view;
         if (orderInfo.status==="success"){
             view=(
-                <Spring type="slideUp" className={styles.container}>
-                    {renderSuccess()}
-                </Spring>
+                // <Spring type="slideUp" className={styles.container}>
+                //     {renderSuccess()}
+                // </Spring>
+                <WOrderSuccess close={close}/>
             )
         }
         else

+ 4 - 1
src/widgets/WPaymentOrder/MX/MXPayOrder.jsx

@@ -10,6 +10,7 @@ import {CopyToClipboard} from "react-copy-to-clipboard";
 import {ReactComponent as Warning} from '@assets/singlesvg/warning.svg';
 import {ROUTE_PATH} from "@constants/routes";
 import {useNavigate} from "react-router-dom";
+import WOrderSuccess from "@widgets/WPaymentOrder/WOrderSuccess";
 const i18n=global.i18n;
 const MXPayOrder = ({close}) => {
     const orderInfo=useSelector(getCurrPayOrder);
@@ -210,7 +211,9 @@ const MXPayOrder = ({close}) => {
     const renderView = () => {
         if (orderInfo != null) {
             if (orderInfo.status === "success") {
-
+                return (
+                    <WOrderSuccess close={close}/>
+                )
             } else {
                 return renderOrder();
             }

+ 27 - 0
src/widgets/WPaymentOrder/WOrderSuccess.jsx

@@ -0,0 +1,27 @@
+import styles from "./styles.module.scss";
+import Spring from "@components/Spring";
+import React from "react";
+import {ReactComponent as SuccessIcon} from "@assets/singlesvg/succss.svg";
+const i18n=global.i18n;
+
+const WOrderSuccess = ({close})=>{
+    const renderSuccess=()=>{
+        return (
+            <div className={styles.success}>
+                <SuccessIcon className={styles.logo}/>
+                <div className={styles.tips}>{i18n.t("deposit.order_info.tips2")}</div>
+                <div className={styles.btns_con}>
+                    <button className={"button-green"} onClick={()=>{
+                        if(close)close();
+                    }}>{i18n.t("deposit.order_info.okey")}</button>
+                </div>
+            </div>
+        )
+    }
+    return (
+        <Spring type="slideUp" className={styles.success_con}>
+            {renderSuccess()}
+        </Spring>
+    )
+}
+export default WOrderSuccess;

+ 34 - 0
src/widgets/WPaymentOrder/styles.module.scss

@@ -3,3 +3,37 @@
   min-height: 100%;
   background-color: var(--widget-bg);
 }
+.success_con{
+  display: flex;
+  flex-direction: column;
+  position: relative;
+  padding: 1rem;
+  width: 100%;
+  gap: 0.5rem;
+}
+.success{
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  margin-top: 3.8rem;
+  width: 100%;
+  gap: 3rem;
+  font-size: 0.9rem;
+  color: var(--header);
+  text-align: center;
+  & .tips{
+    font-size: 1rem;
+  }
+  & .logo{
+    //width: 3rem;
+    //height: 3rem;
+  }
+  & .btns_con{
+    display: flex;
+    align-items: center;
+    justify-content: space-around;
+    gap: 1.5rem;
+    margin-top: 2rem;
+    width: 50%;
+  }
+}

+ 17 - 1
src/widgets/WWithdraw/AccountEdit.jsx

@@ -1,9 +1,25 @@
 import styles from './styles.module.scss';
 import BRAccountEdit from "@widgets/WWithdraw/BR/BRAccountEdit";
+import MXAccountEdit from "@widgets/WWithdraw/MX/MXAccountEdit";
 const AccountEdit=({...props})=>{
+    const components={
+        "br":BRAccountEdit,
+        "mx":MXAccountEdit
+    }
+    const renderAccountEdit=()=>{
+        let areaItem=global.getLocalAreaItem();
+        if (areaItem!=null){
+            let Comp=components[areaItem.code];
+            if (Comp!=null){
+                return <Comp {...props} />
+            }
+        }
+        return (<></>);
+    }
     return (
         <div className={styles.container}>
-            <BRAccountEdit {...props}/>
+            {/*<BRAccountEdit {...props}/>*/}
+            {renderAccountEdit()}
         </div>
     )
 }

+ 53 - 13
src/widgets/WWithdraw/BR/BRWithdraw.jsx

@@ -1,19 +1,20 @@
 import Spring from "@components/Spring";
 import styles from "./styles.module.scss";
-import React, {useState,useEffect} from "react";
+import React, {useState, useEffect} from "react";
 import {useDispatch, useSelector} from "react-redux";
 import {getUserInfo} from "@features/mainSlice";
 import {formatCash, numFormatter, stringFormat} from "@utils/helpers";
-import {getWDPayoutStatus, getWithdrawBaseInfo} from "@features/paySlice";
+import {getWDPayoutStatus, getWithdrawBaseInfo, getWithdrawInfo} from "@features/paySlice";
 import symbol from "@assets/symbol-defs.svg";
 import {ReactComponent as Edit} from '@assets/singlesvg/edit.svg';
 import {useNavigate} from "react-router-dom";
 import {ROUTE_PATH} from "@constants/routes";
 import WDPassBox from "@widgets/WWithdraw/PassBox/WDPassBox";
 import SmallLoading from "@components/SmallLoading";
-import {reqWithdrawBaseInfo, reqWithdrawPayout} from "@features/api";
+import {reqWithdrawBaseInfo, reqWithdrawInfo, reqWithdrawPayout} from "@features/api";
 import {REQ_STATUS} from "@api/config";
 import {toast} from "react-toastify";
+import {APP_COUNTRY_CODE} from "@constants/app";
 const i18n=global.i18n;
 const BRWithdraw=()=>{
     const user=useSelector(getUserInfo);
@@ -26,11 +27,18 @@ const BRWithdraw=()=>{
     const [openPassBox,setOpenPassBox]=useState(false);
     const dispatch = useDispatch();
     const status=useSelector(getWDPayoutStatus);
+    const accountInfo=useSelector(getWithdrawInfo);
+    const areaItem=global.getLocalAreaItem();
     useEffect(()=>{
        // if (info==null){
        //     dispatch(reqWithdrawBaseInfo())
        // }
-        dispatch(reqWithdrawBaseInfo())
+        dispatch(reqWithdrawBaseInfo());
+        if (areaItem.code===APP_COUNTRY_CODE.MX){
+            if (accountInfo==null){
+                dispatch(reqWithdrawInfo({UserID:user.UserID}));
+            }
+        }
     },[])
     const checkBank=()=>{
         if (info!=null){
@@ -101,6 +109,37 @@ const BRWithdraw=()=>{
         }
         return index;
     }
+    const getAccountInfo=()=>{
+        let via="";
+        let accout="";
+        if (areaItem.code===APP_COUNTRY_CODE.MX){
+            let AccountsBank=info.AccountsBank;
+            let BranchBank=info.BranchBank;
+            if (AccountsBank!=null&&AccountsBank!=="")accout=AccountsBank;
+            if (BranchBank!=null&&BranchBank!==""){
+                if (accountInfo!=null){
+                    let bank_list=accountInfo.bank_list;
+                    if (bank_list!=null){
+                        via=bank_list[BranchBank];
+                    }
+                }
+                else via=BranchBank;
+            }
+        }
+        else
+        {
+            if (info!=null){
+                let BankUserName=info.BankUserName;
+                let AccountsBank=info.AccountsBank;
+                let cbPixType=Number(info.PixType);
+                if (BankUserName!==""||AccountsBank!==""){
+                    via=cbPixType >= 10 ? "TED" : "PIX";
+                    accout=cbPixType >= 10 ? AccountsBank : BankUserName
+                }
+            }
+        }
+        return {via,accout};
+    }
     const renderUser=()=>{
         return (
             <div className={styles.content}>
@@ -173,15 +212,16 @@ const BRWithdraw=()=>{
         )
     }
     const renderAccount=()=>{
-        let BankUserName=info.BankUserName;
-        let AccountsBank=info.AccountsBank;
-        let cbPixType=Number(info.PixType);
-        let via="";
-        let accout="";
-        if (BankUserName!==""||AccountsBank!==""){
-            via=cbPixType >= 10 ? "TED" : "PIX";
-            accout=cbPixType >= 10 ? AccountsBank : BankUserName
-        }
+        // let BankUserName=info.BankUserName;
+        // let AccountsBank=info.AccountsBank;
+        // let cbPixType=Number(info.PixType);
+        // let via="";
+        // let accout="";
+        // if (BankUserName!==""||AccountsBank!==""){
+        //     via=cbPixType >= 10 ? "TED" : "PIX";
+        //     accout=cbPixType >= 10 ? AccountsBank : BankUserName
+        // }
+        const {via,accout}=getAccountInfo();
         return (
             <div className={`${styles.content} ${styles.account_info}`}>
                 <div className={styles.title_con}>

+ 459 - 0
src/widgets/WWithdraw/MX/MXAccountEdit.jsx

@@ -0,0 +1,459 @@
+import {useDispatch, useSelector} from "react-redux";
+import {getUserInfo} from "@features/mainSlice";
+import {getWDBaseInfoStatus, getWDInfoStatus, getWDSetInfoStatus, getWithdrawInfo} from "@features/paySlice";
+import React, {useEffect, useRef, useState} from "react";
+import {reqMexWithdrawSetInfo, reqWithdrawInfo} from "@features/api";
+import {REQ_STATUS} from "@api/config";
+import styles from "./styles.module.scss";
+import SmallLoading from "@components/SmallLoading";
+import Spring from "@components/Spring";
+import {Controller, useForm} from "react-hook-form";
+import SvgIcon from "@components/SvgIcon";
+import {ReactComponent as Warning} from '@assets/singlesvg/warning.svg';
+import {useThemeProvider} from "@contexts/themeContext";
+import MuiDrawer from "@mui/material/Drawer";
+import RadioBtn from "@components/RadioBtn";
+import {Popover} from "@mui/material";
+import {validateEmail} from "@utils/helpers";
+
+const i18n=global.i18n;
+const MXAccountEdit=({close})=>{
+    const user=useSelector(getUserInfo);
+    const baseStatus=useSelector(getWDBaseInfoStatus);
+    const setStatus=useSelector(getWDSetInfoStatus);
+    const infoStatus=useSelector(getWDInfoStatus);
+    let info=useSelector(getWithdrawInfo);
+    let dinfo=info==null?{}:info;
+    const dispatch=useDispatch();
+    const {isMobile} = useThemeProvider();
+    const [showBankSelect, setShowBankSelect] = useState(false);
+    const [searchValue, setSearchValue] = useState("");
+    const {register, handleSubmit, formState: {errors}, control} = useForm({
+        values: {
+            account: dinfo.AccountsBank||"",
+            userName: dinfo.BankUserName||"",
+            bank: dinfo.BranchBank||"",
+            branceBank: dinfo.BranchBank||"",
+            phone: dinfo.PhoneNumber||"",
+            PAN: dinfo.PANNumber||"",
+            IFSC:dinfo.IFSCNumber||"",
+            email: dinfo.EmailAddress||"",
+            PixNum: dinfo.PixNum||"",
+            adhaar: dinfo.AdhaarNumber||"",
+            PixType: dinfo.PixType||"",
+            bankName:""
+        }
+    });
+    const [bankNo, setBankNo] = useState(dinfo.BranchBank||"");
+    const selectRef = useRef(null);
+    const [showClabeHelp,setShowClabeHelp] = useState(false);
+    const clabeHelpRef = useRef(null);
+    useEffect(()=>{
+        dispatch(reqWithdrawInfo({UserID:user.UserID}));
+    },[])
+    useEffect(()=>{
+        if (info!=null){
+            setBankNo(info.BranchBank||"");
+        }
+    },[info])
+    const checkLockStatus=()=>{
+        if (baseStatus===REQ_STATUS.LOADING)return true;
+        if (setStatus===REQ_STATUS.LOADING)return true;
+        return false;
+    }
+    const validateBankCode=()=>{
+       let num=Number(bankNo);
+       return num>0;
+    }
+    const getBankNameFromCode=()=>{
+        let bankName="";
+        if (info!=null){
+            let bank_list=info.bank_list;
+            if (bank_list!=null){
+                let name=bank_list[bankNo];
+                if (name!=null)bankName=name;
+            }
+        }
+        return bankName;
+    }
+    const showCSelect=()=>{
+        setSearchValue("");
+        setShowBankSelect(true);
+    }
+    const hideCSelect=()=>{
+        setShowBankSelect(false);
+    }
+    const getBankCodeList=()=>{
+        let list=[];
+        if (info!=null){
+            let tempS=searchValue.toUpperCase();
+            let bank_list=info.bank_list;
+            if (bank_list!=null){
+                for (const key in bank_list) {
+                    let value=bank_list[key];
+                    if (tempS!==""){
+                        let temp=value.replaceAll(" ","");
+                        temp=temp.toUpperCase();
+                        if (temp.indexOf(tempS)!==-1)list.push({code:key,value:value});
+                    }
+                    else list.push({code:key,value:value});
+                }
+            }
+        }
+        list.sort((a, b) => {
+            const valueA = a.value;
+            const valueB = b.value;
+
+            if (valueA < valueB) {
+                return -1;
+            }
+            if (valueA > valueB) {
+                return 1;
+            }
+            return 0;
+        });
+        return list;
+    }
+    const callback=(data)=>{
+        if (data&&data.code===200){
+            // dispatch(reqWithdrawBaseInfo(callbackBase));
+            close();
+        }
+    }
+    const handleChange=(data)=>{
+        if (checkLockStatus())return;
+        data.bank=bankNo;
+        data.callback=callback;
+        dispatch(reqMexWithdrawSetInfo(data));
+    }
+    const validateMail=(value)=>{
+        return validateEmail(value);
+    }
+    const renderTips = () => {
+        return (
+            <div className={styles.notice_con}>
+                <Warning className={styles.n_icon}></Warning>
+                <div className={styles.notice}>
+                    {i18n.t("withdraw.account_mx.help")}
+                </div>
+            </div>
+        )
+    }
+    const renderAccoutForm=()=>{
+        return (
+            <form autoComplete="off" className={styles.accout_form} onSubmit={handleSubmit((data) => {
+                handleChange(data);
+            })}>
+                <Controller control={control}
+                            name="userName"
+                            rules={{required: true}}
+                            render={({field: {ref, onChange, value}, fieldState: {error}}) => (
+                                <div className={styles.form_item}>
+                                    <div className={styles.title}>{i18n.t("withdraw.account_mx.userName")}</div>
+                                    <div className={`input-control ${error ? 'input-control--error' : ''}`}>
+                                        <input
+                                            value={value}
+                                            onChange={e => onChange(e.target.value)}
+                                            placeholder={i18n.t('withdraw.account_mx.name_holder')}
+                                            ref={ref}
+                                        />
+                                    </div>
+                                </div>
+                            )}
+                />
+                <Controller control={control}
+                            name="phone"
+                            rules={{required: true}}
+                            render={({field: {ref, onChange, value}, fieldState: {error}}) => (
+                                <div className={styles.form_item}>
+                                    <div className={styles.title}>{i18n.t("withdraw.account_mx.phone")}</div>
+                                    <div className={`input-control ${error ? 'input-control--error' : ''}`}>
+                                        <input
+                                            value={value}
+                                            onChange={e => onChange(e.target.value)}
+                                            placeholder={i18n.t('withdraw.account_mx.phone_holder')}
+                                            ref={ref}
+                                        />
+                                    </div>
+                                </div>
+                            )}
+                />
+                <Controller control={control}
+                            name="email"
+                            rules={{required: true,validate: validateMail}}
+                            render={({field: {ref, onChange, value}, fieldState: {error}}) => (
+                                <div className={styles.form_item}>
+                                    <div className={styles.title}>{i18n.t("withdraw.account_mx.email")}</div>
+                                    <div className={`input-control ${error ? 'input-control--error' : ''}`}>
+                                        <input
+                                            value={value}
+                                            onChange={e => onChange(e.target.value)}
+                                            placeholder={i18n.t('withdraw.account_mx.email_holder')}
+                                            ref={ref}
+                                        />
+                                    </div>
+                                </div>
+                            )}
+                />
+                <Controller control={control}
+                            name="account"
+                            rules={{required: true}}
+                            render={({field: {ref, onChange, value}, fieldState: {error}}) => (
+                                <div className={styles.form_item}>
+                                    <div className={styles.title}>{i18n.t("withdraw.account_mx.tedCon")}</div>
+                                    <div className={`input-control ${error ? 'input-control--error' : ''}`}>
+                                        <input
+                                            value={value}
+                                            onChange={e => onChange(e.target.value)}
+                                            placeholder={i18n.t('withdraw.account_mx.tedCon_holder')}
+                                            ref={ref}
+                                        />
+                                    </div>
+                                </div>
+                            )}
+                />
+                <Controller control={control}
+                            name="bankName"
+                            rules={{validate: validateBankCode}}
+                            render={({field: {ref, onChange, value}, fieldState: {error}}) =>{
+                                let bname=getBankNameFromCode();
+                                return (
+                                    <div className={styles.form_item}>
+                                        <div className={styles.title}>{i18n.t("withdraw.account_mx.tedBan")}</div>
+                                        <button ref={selectRef} type={"button"}
+                                                className={`input-control ${styles.btn_bank} ${error ? 'input-control--error' : ''}`}
+                                                onClick={()=>{
+                                                    showCSelect();
+                                                }}
+                                        >
+                                            <input
+                                                disabled
+                                                value={bname}
+                                                onChange={e => onChange(e.target.value)}
+                                                placeholder={i18n.t('withdraw.account_mx.tedBan_holder')}
+                                                ref={ref}
+                                            />
+                                            <div className={styles.icon_btn}>
+                                                <SvgIcon className={styles.arrow} herf={"icon_Arrow"}></SvgIcon>
+                                            </div>
+                                        </button>
+                                    </div>
+                                )
+                            }}
+                />
+                <Controller control={control}
+                            name="IFSC"
+                            rules={{required: true}}
+                            render={({field: {ref, onChange, value}, fieldState: {error}}) => (
+                                <div className={styles.form_item}>
+                                    <div className={styles.title}>{i18n.t("withdraw.account_mx.clabe")}</div>
+                                    <div ref={clabeHelpRef} className={`input-control ${error ? 'input-control--error' : ''}`}>
+                                        <input
+                                            value={value}
+                                            onChange={e => onChange(e.target.value)}
+                                            placeholder={i18n.t('withdraw.account_mx.clabe_holder')}
+                                            ref={ref}
+                                        />
+                                        <button type={"button"} className={styles.icon_btn} onClick={()=>{
+                                            setShowClabeHelp(true);
+                                        }}>
+                                            <SvgIcon className={styles.help} herf={"icon_Info"}></SvgIcon>
+                                        </button>
+                                    </div>
+
+                                </div>
+                            )}
+                />
+                {renderTips()}
+                <button className={`button-green ${styles.btn_save}`}>
+                    {checkLockStatus() ? (
+                        <SmallLoading fill={"#FFF"}></SmallLoading>) : i18n.t("withdraw.account.btn_save")}
+                </button>
+            </form>
+        )
+    }
+    const renderClabeHelp=()=>{
+        return (
+            <Popover
+                open={showClabeHelp}
+                anchorEl={clabeHelpRef.current}
+                onClose={()=>{
+                    setShowClabeHelp(false);
+                }}
+                anchorOrigin={{
+                    vertical: 'top',
+                    horizontal: 'right',
+                }}
+                transformOrigin={{
+                    vertical: 'bottom',
+                    horizontal: 'right',
+                }}
+                sx={{
+                    "& .MuiPopover-paper": {
+                        backgroundColor:'var(--widget);',
+                        borderRadius:'var(--border-radius);',
+                        // width:'20rem;',
+                        // height:'20rem;',
+                        boxShadow:'var(--widget-shadow);',
+                        minWidth:'17.4rem;',
+                        minHeight:'11.8rem;'
+                    }
+                }}
+            >
+                <div className={styles.clabe_help_con}>
+                    <span className={styles.title}>{i18n.t("withdraw.account_mx.clabe_help_title")}</span>
+                    <div className={styles.exmp_con}>
+                        <div className={`${styles.exmp_item} ${styles.item_1}`}>
+                            <span>002</span>
+                            <span>|—|</span>
+                        </div>
+                        <div className={`${styles.exmp_item}`}>
+                            <span>-</span>
+                        </div>
+                        <div className={`${styles.exmp_item} ${styles.item_2}`}>
+                            <span>010</span>
+                            <span>|—|</span>
+                        </div>
+                        <div className={`${styles.exmp_item}`}>
+                            <span>-</span>
+                        </div>
+                        <div className={`${styles.exmp_item} ${styles.item_3}`}>
+                            <span>12345678901</span>
+                            <span>| ————— |</span>
+                        </div>
+                        <div className={`${styles.exmp_item}`}>
+                            <span>-</span>
+                        </div>
+                        <div className={`${styles.exmp_item} ${styles.item_4}`}>
+                            <span>5</span>
+                            <span>|</span>
+                        </div>
+                    </div>
+                    <span className={styles.help_1}>{i18n.t("withdraw.account_mx.clabe_help_1")}</span>
+                    <span className={styles.help_2}>{i18n.t("withdraw.account_mx.clabe_help_2")}</span>
+                    <span className={styles.help_3}>{i18n.t("withdraw.account_mx.clabe_help_3")}</span>
+                    <span className={styles.help_4}>{i18n.t("withdraw.account_mx.clabe_help_4")}</span>
+                </div>
+            </Popover>
+        )
+    }
+    const renderSearch = () => {
+        return (
+            <div className={`input-control ${styles.select_search}`}>
+                <SvgIcon className={styles.icon} herf={"icon_Search"}></SvgIcon>
+                <input onChange={e => setSearchValue(e.target.value)}/>
+            </div>
+        )
+    }
+    const renderHeader=()=>{
+        return (
+            <div className={styles.header}>
+                {i18n.t("withdraw.account_mx.s_title")}
+            </div>
+        )
+    }
+    const renderBankCodeList=()=>{
+        let list=getBankCodeList();
+        return (
+            <div className={styles.select_list_con}>
+                {
+                    list.map((item,index)=>{
+                        return (
+                            <button key={index} className={`${styles.item} ${(bankNo+"")===item.code?styles.active:''}`} onClick={()=>{
+                                setBankNo(item.code);
+                                hideCSelect();
+                            }}>
+                                <div className={styles.left}>
+                                    <span className={styles.name}>{item.value}</span>
+                                </div>
+                                <RadioBtn selected={(bankNo+"")===item.code} value={item.value} onChange={(value)=>{
+                                    setBankNo(item.code);
+                                    hideCSelect();
+                                }} />
+                            </button>
+                        )
+                    })
+                }
+            </div>
+        )
+    }
+    const renderMobileBankSelect=()=>{
+         return (
+            <MuiDrawer open={showBankSelect}
+                       anchor={"bottom"}
+                       sx={{
+                           zIndex:1300,
+                           "& .MuiDrawer-paper": {
+                               height: "50%",
+                               boxSizing: "border-box",
+                               overflow: 'visible !important',
+                               backgroundColor: 'var(--widget);',
+                               boxShadow: 'var(--widget-shadow);',
+                               borderTopLeftRadius: '1rem',
+                               borderTopRightRadius: '1rem',
+                           },
+                       }}
+                       variant="temporary"
+                       onClose={() => {
+                           setShowBankSelect(false);
+                       }}>
+                <div className={`${styles.select_bank_con} ${styles.select_bank_con_m}`}>
+                    {renderHeader()}
+                    {renderSearch()}
+                    {renderBankCodeList()}
+                </div>
+            </MuiDrawer>
+        )
+    }
+    const renderDeskBankSelect=()=>{
+         return (
+            <Popover
+                open={showBankSelect}
+                anchorEl={selectRef.current}
+                onClose={()=>{
+                    hideCSelect();
+                }}
+                anchorOrigin={{
+                    vertical: 45,
+                    horizontal: 0,
+                }}
+                sx={{
+                    "& .MuiPopover-paper": {
+                        backgroundColor:'var(--widget);',
+                        borderRadius:'var(--border-radius);',
+                        width:'22rem;',
+                        height:'20rem;',
+                        boxShadow:'var(--widget-shadow);'
+                    }
+                }}
+            >
+                <div className={styles.select_bank_con}>
+                    {renderSearch()}
+                    {renderBankCodeList()}
+                </div>
+            </Popover>
+        )
+    }
+    const renderBankSelect=()=>{
+        if (isMobile())return renderMobileBankSelect();
+        else return renderDeskBankSelect();
+    }
+    return (
+        <>
+            {
+                infoStatus === REQ_STATUS.LOADING ? (
+                    <div className={styles.loading}>
+                        <SmallLoading/>
+                    </div>
+                ) : (
+                    <Spring type="slideUp" className={styles.container}>
+                        {renderAccoutForm()}
+                        {renderBankSelect()}
+                        {renderClabeHelp()}
+                    </Spring>
+                )
+            }
+        </>
+    )
+}
+export default MXAccountEdit;

+ 205 - 0
src/widgets/WWithdraw/MX/styles.module.scss

@@ -0,0 +1,205 @@
+.container{
+  display: flex;
+  flex-direction: column;
+  position: relative;
+  padding: 1rem;
+  width: 100%;
+  gap: 1rem;
+}
+.loading{
+  display: flex;
+  height: 100vh;
+}
+.accout_form{
+  display: flex;
+  flex-direction: column;
+  gap: 1rem;
+  .btn_save{
+    //margin-top: 0.5rem;
+  }
+}
+.form_item{
+  display: flex;
+  flex-direction: column;
+  gap: 0.6rem;
+  color: var(--header);
+  & .title{
+    font-size: 0.9rem;
+    color: var(--header);
+  }
+  & .icon_btn{
+    display: flex;
+    justify-content: flex-end;
+    align-items: center;
+    width: 5rem;
+    height: 2rem;
+  }
+  & .arrow{
+    width: 1.2rem;
+    height: 1.2rem;
+    fill: var(--text);
+    transform: rotate(90deg);
+  }
+  & .help{
+    width: 1.4rem;
+    height: 1.4rem;
+    fill: var(--text);
+  }
+  & .btn_bank{
+    input{
+      pointer-events: none;
+    }
+  }
+}
+.notice{
+  color: var(--coin-yellow);
+  line-height: 1rem;
+  //opacity: 0.9;
+  white-space: pre-wrap;
+}
+.notice_con{
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  padding: 1rem;
+  gap: 0.5rem;
+  border: 1px dashed rgba(237, 195, 73, 0.7);
+  border-radius: var(--border-radius);
+  & .n_icon{
+    width: 3.5rem;
+    height: 3.5rem;
+    fill: var(--coin-yellow);
+  }
+}
+.select_bank_con{
+  display: flex;
+  flex-direction: column;
+  position: relative;
+  width: 100%;
+  height: 100%;
+  padding: 0.5rem;
+  gap: 0.75rem;
+  &_m{
+    padding: 1rem;
+  }
+  & .header{
+    display: flex;
+    width: 100%;
+    align-items: center;
+    justify-content: center;
+    font-weight: bold;
+    font-size: 1rem;
+    color: var(--header);
+    gap: 0.5rem;
+  }
+}
+.select_search{
+  border: 1px solid var(--input-border);
+  background-color: transparent;
+  gap: 0.5rem;
+  & .icon{
+    width: 1.4em;
+    height: 1.4em;
+    fill: var(--text);
+  }
+}
+.select_list_con{
+  display: flex;
+  flex-direction: column;
+  gap: .5rem;
+  width: 100%;
+  height: 100%;
+  overflow-y: auto;
+  overscroll-behavior: contain;
+  touch-action: pan-y;
+  & .item{
+    display: flex;
+    flex: none;
+    align-items: center;
+    justify-content: space-between;
+    position: relative;
+    width: 100%;
+    height: 2.5rem;
+    padding: 0 0.75rem;
+    border-radius: var(--border-radius);
+    color: var(--header);
+    &.active{
+      background: var(--nav-item-hover);
+      font-weight: 600;
+    }
+    & .left{
+      display: flex;
+      align-items: center;
+      gap: 0.25rem;
+      width: 80%;
+      & .icon{
+        width: 1.5rem;
+        height: auto;
+        border-radius: 0.1rem;
+      }
+      & .code{
+        text-align: left;
+        width: 3rem;
+      }
+      & .name{
+        //max-width: 5rem;
+        max-width: 60%;
+        text-align: left;
+        white-space: nowrap;
+        overflow: hidden;
+        text-overflow: ellipsis;
+      }
+    }
+  }
+}
+.clabe_help_con{
+  display: flex;
+  flex-direction: column;
+  //line-height: 1.5rem;
+  padding: 0.8rem;
+  width: 100%;
+  height: 100%;
+  font-size: 0.92rem;
+  font-weight: 600;
+  & .title{
+    font-size: 1rem;
+    color: var(--header);
+  }
+  & .help_1{
+    color: #84B9FF;
+  }
+  & .help_2{
+    color: #EBEA5A;
+  }
+  & .help_3{
+    color: #62C670;
+  }
+  & .help_4{
+    color: #D55913;
+  }
+  & .exmp_con{
+    display: flex;
+    flex-direction: row;
+    font-size: 1.5rem;
+    font-weight: bold;
+    color: var(--header);
+    margin-left: -0.3rem;
+    & .exmp_item{
+      display: flex;
+      flex-direction: column;
+      text-align: center;
+    }
+    & .item_1{
+      color: #84B9FF;
+    }
+    & .item_2{
+      color: #EBEA5A;
+    }
+    & .item_3{
+      color: #62C670;
+    }
+    & .item_4{
+      color: #D55913;
+    }
+  }
+}