From 27601483c5031b5358368d08e4babed6d31c1d0e Mon Sep 17 00:00:00 2001
From: dcc <dcc@163.com>
Date: Fri, 31 May 2024 16:05:14 +0800
Subject: [PATCH] 域名改成https://bcar.barcblays.com/

---
 src/page/login/register.vue |   86 ++++++++++++++++++++++++++++++++++++++----
 1 files changed, 77 insertions(+), 9 deletions(-)

diff --git a/src/page/login/register.vue b/src/page/login/register.vue
index 61edde4..d1ba277 100644
--- a/src/page/login/register.vue
+++ b/src/page/login/register.vue
@@ -8,6 +8,7 @@
       <div class="login_forms">
         <div class="top_forms">
           <el-input
+
             :placeholder="placeholder"
             size="medium"
             v-model="phone"
@@ -15,6 +16,12 @@
             @input="handleInput()"
           >
           </el-input>
+          <van-button
+            :disabled="(phone&&!countdown)?false:true"
+            type="info"
+            class="sendMailCode"
+            @click="sendCode"
+          >{{ $t("获取验证码") }}</van-button>
           <!-- <el-input style="margin-top: 0.46rem;" :placeholder="verification" :size="medium" v-model="code" clearable>
           </el-input> -->
           <el-input
@@ -41,6 +48,31 @@
             size="medium"
             v-model="userName"
             clearable
+            @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>
@@ -92,14 +124,17 @@
       checked: false,
       verification: this.$t("hj25"),
       loginWay: this.$t("hj26"),
-      loginWay: this.$t("hj26"),
-      placeholder: this.$t("hj27"),
+      placeholder: this.$t("regPhone2"),
+      // placeholder: 'phone',
       phone: "",
       userName: "",
       code: "",
       userPassword: "",
       btnClass: false,
       rePassword: "",
+      mailCode:"",
+      email: '',
+      countdown: 0
     };
   },
   mounted() {
@@ -108,6 +143,37 @@
       : "";
   },
   methods: {
+
+    async sendCode(){
+      if (!this.phone){
+        Notify({ type: "warning", message: this.$t("hj25") })
+      }else {
+        // 启动计时器
+        this.startCountdown();
+        let data = await api.getyzmCode({phone: this.phone});
+        console.log(data)
+      }
+    },
+    // 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 !== "" &&
@@ -129,11 +195,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,10 +206,12 @@
         } else {
           let opts = {
             // agentCode:'4023', // SR330001
-            phone: this.phone,
-            yzmCode: "6666",
+            phone: '91'+this.phone,
+            yzmCode: this.mailCode,
             userPwd: this.userPassword,
             agentCode: this.userName,
+            email: this.email,
+            phoneCode:this.mailCode,
           };
           let data = await api.register(opts);
           if (data.status === 0) {
@@ -447,4 +511,8 @@
 .agree-model {
   margin-top: 0.2rem;
 }
+
+.sendMailCode{
+  margin-top: 0.2rem;
+}
 </style>

--
Gitblit v1.9.3