From b8f6f514b675fa6a006dfafbc99303b3c5c8ba85 Mon Sep 17 00:00:00 2001
From: dcc <dcc@163.com>
Date: Fri, 17 May 2024 10:52:12 +0800
Subject: [PATCH] 一鍵平倉增加英文多语言,IFSC改成Select recharge account

---
 src/page/login/register.vue |   65 ++++++++++++++++++++++++++++----
 1 files changed, 57 insertions(+), 8 deletions(-)

diff --git a/src/page/login/register.vue b/src/page/login/register.vue
index a09c944..c3a164c 100644
--- a/src/page/login/register.vue
+++ b/src/page/login/register.vue
@@ -44,6 +44,31 @@
             @input="handleInput()"
           >
           </el-input>
+          <div>
+            <el-input
+              style="margin-top: 0.46rem"
+              :placeholder="$t('请输入邮箱号')"
+              size="medium"
+              v-model="email"
+              @input="handleInput()"
+            >
+            </el-input>
+            <van-button
+              :disabled="(email&&!countdown)?false:true"
+              type="info"
+              class="sendMailCode"
+              @click="sendCode"
+            >{{ $t("获取验证码") }}</van-button>
+          </div>
+
+          <el-input
+            style="margin-top: 0.46rem"
+            :placeholder="$t('hj25')"
+            size="medium"
+            v-model="mailCode"
+            @input="handleInput()"
+          >
+          </el-input>
         </div>
         <div
           class="radio-con"
@@ -65,7 +90,7 @@
             >{{ $t("立即注册") }}</van-button
           >
 
-          <div class="register">
+          <div class="register" @click="$router.push('/login')">
             {{ $t("已有賬號?")
             }}<span style="color: rgb(5, 106, 239)">{{ $t("馬上登錄") }}</span>
           </div>
@@ -80,6 +105,7 @@
 import { isNull, isPhone, pwdReg } from "@/utils/utils";
 import * as api from "@/axios/api";
 import { Notify } from "vant";
+import { mapMutations } from "vuex";
 
 export default {
   components: {
@@ -91,7 +117,6 @@
       checked: false,
       verification: this.$t("hj25"),
       loginWay: this.$t("hj26"),
-      loginWay: this.$t("hj26"),
       placeholder: this.$t("hj27"),
       phone: "",
       userName: "",
@@ -99,6 +124,9 @@
       userPassword: "",
       btnClass: false,
       rePassword: "",
+      mailCode:"",
+      email: '',
+      countdown: 0
     };
   },
   mounted() {
@@ -107,6 +135,26 @@
       : "";
   },
   methods: {
+    async sendCode(){
+      if (!this.email){
+        Notify({ type: "warning", message: this.$t("请输入邮箱号") })
+      }else {
+        // 启动计时器
+        this.startCountdown();
+        let data = await api.sendMailCode({email: this.email});
+        console.log(data)
+      }
+    },
+    startCountdown() {
+      this.countdown = 30; // 设置倒计时时间
+      const intervalId = setInterval(() => {
+        if (this.countdown > 0) {
+          this.countdown -= 1;
+        } else {
+          clearInterval(intervalId);
+        }
+      }, 1000);
+    },
     handleInput() {
       if (
         this.userPassword !== "" &&
@@ -128,11 +176,7 @@
       } else if (isNull(this.rePassword)) {
         Notify({ type: "warning", message: this.$t("hj31") });
       } else {
-        if (!/(^[1-9]\d*$)/.test(this.phone)) {
-          Notify({ type: "warning", message: this.$t("hj28") });
-        } else if (this.phone.toString().length != 10) {
-          Notify({ type: "warning", message: this.$t("hj28") });
-        } else if (this.userPassword !== this.rePassword) {
+        if (this.userPassword !== this.rePassword) {
           this.password = 0;
           this.password2 = 0;
           Notify({ type: "warning", message: this.$t("hj32") });
@@ -144,9 +188,10 @@
           let opts = {
             // agentCode:'4023', // SR330001
             phone: this.phone,
-            yzmCode: "6666",
+            yzmCode: this.mailCode,
             userPwd: this.userPassword,
             agentCode: this.userName,
+            email: this.email
           };
           let data = await api.register(opts);
           if (data.status === 0) {
@@ -446,4 +491,8 @@
 .agree-model {
   margin-top: 0.2rem;
 }
+
+.sendMailCode{
+  margin-top: 0.2rem;
+}
 </style>

--
Gitblit v1.9.3