From 0d29d9a2bf0d893a67f1263bb9525131a50a2128 Mon Sep 17 00:00:00 2001
From: jhzh <1628036192@qq.com>
Date: Sat, 23 Mar 2024 11:12:55 +0800
Subject: [PATCH] 首次提交大宝wap

---
 src/page/login/register.vue |   64 ++++++++++++++++++++------------
 1 files changed, 40 insertions(+), 24 deletions(-)

diff --git a/src/page/login/register.vue b/src/page/login/register.vue
index 0756d82..623f84e 100644
--- a/src/page/login/register.vue
+++ b/src/page/login/register.vue
@@ -30,15 +30,15 @@
           <div class="user_name">
             <input type="text" placeholder="机构代码" v-model="userName" />
           </div> -->
-          <el-input :placeholder="placeholder" size="medium" v-model="phone" clearable @input="handleInput()" maxlength="11">
+          <el-input :placeholder="placeholder" size="medium" v-model="phone" clearable @input="handleInput()">
           </el-input>
           <!-- <el-input style="margin-top: 0.46rem;" :placeholder="verification" :size="medium" v-model="code" clearable>
           </el-input> -->
           <el-input style="margin-top: 0.46rem;" show-password :placeholder="$t('hj19')" size="medium"
             v-model="userPassword" @input="handleInput()">
           </el-input>
-          <el-input style="margin-top: 0.46rem;" show-password :placeholder="$t('hj20')" size="medium" v-model="rePassword"
-            @input="handleInput()">
+          <el-input style="margin-top: 0.46rem;" show-password :placeholder="$t('hj20')" size="medium"
+            v-model="rePassword" @input="handleInput()">
           </el-input>
           <el-input style="margin-top: 0.46rem;" :placeholder="$t('hj21')" size="medium" v-model="userName" clearable
             @input="handleInput()">
@@ -103,7 +103,7 @@
     }
   },
   mounted() {
-
+    this.userName = this.$route.query.agentCode ? this.$route.query.agentCode : ''
   },
   methods: {
     handleInput() {
@@ -126,14 +126,14 @@
         this.checkPhone()
       }
     },
-    async is_login(){
+    async is_login() {
       //获取localStorage中的token
       let token = localStorage.getItem('USERTOEKN')
-      if(token){
+      if (token) {
         this.$router.push('/home')
       }
     },
-   
+
     async getcode() {
       // if(!this.checkCode()){
       //     // 验证图形码是否正确
@@ -213,7 +213,7 @@
       //   Toast('需同意注册协议才能注册!')
       //   this.loginBtn = false;
       // } else
-      if (isNull(this.phone) || !isPhone(this.phone)) {
+      if (isNull(this.phone)) {
 
         this.texts = this.$t('hj28')
         this.alertShow = true
@@ -236,7 +236,23 @@
         }, 2000)
         this.loginBtn = false;
       } else {
-        if (this.userPassword !== this.rePassword) {
+        if (!(/(^[1-9]\d*$)/.test(this.phone))) {
+          this.texts = this.$t('hj28')
+          this.alertShow = true
+          setTimeout(() => {
+            this.alertShow = false
+          }, 2000)
+          this.loginBtn = false;
+        }
+        else if (this.phone.toString().length != 10) {
+          this.texts = this.$t('hj28')
+          this.alertShow = true
+          setTimeout(() => {
+            this.alertShow = false
+          }, 2000)
+          this.loginBtn = false;
+        }
+        else if (this.userPassword !== this.rePassword) {
           this.texts = this.$t('hj32')
           this.alertShow = true
           setTimeout(() => {
@@ -279,7 +295,7 @@
               this.elType = "warning"
             }, 1000)
             this.loginBtn = false;
-           
+
           } else {
             this.texts = data.msg
             this.alertShow = true
@@ -291,18 +307,18 @@
         }
       }
       if (navigator.vibrate) {
-          // 支持
+        // 支持
         navigator.vibrate([55]);
       }
-        //   if (isNull(this.code)) {
-        //     this.texts="请输入验证码"
-        // this.alertShow=true
-        // setTimeout(()=>{
-        //   this.alertShow=false
-        // },2000)
-        //     this.loginBtn = false;
-        //   } else 
-       
+      //   if (isNull(this.code)) {
+      //     this.texts="请输入验证码"
+      // this.alertShow=true
+      // setTimeout(()=>{
+      //   this.alertShow=false
+      // },2000)
+      //     this.loginBtn = false;
+      //   } else 
+
     },
     isAgree() {
       this.agree = !this.agree
@@ -313,10 +329,10 @@
       if (data.status === 0) {
         // 如果用户已存在返回 0
         this.texts = this.$t('hj35')
-            this.alertShow = true
-            setTimeout(() => {
-              this.alertShow = false
-            }, 2000)
+        this.alertShow = true
+        setTimeout(() => {
+          this.alertShow = false
+        }, 2000)
         this.$router.push('/login')
       } else {
         // this.dialogShow = false

--
Gitblit v1.9.3