From a1fb6cd3c3b8a48da4f9393e09718da04f51a373 Mon Sep 17 00:00:00 2001
From: DESKTOP-CVS3R96\我恁爹 <11>
Date: Tue, 15 Nov 2022 09:58:00 +0800
Subject: [PATCH] 11111

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

diff --git a/src/page/login/register.vue b/src/page/login/register.vue
index 00a1170..0756d82 100644
--- a/src/page/login/register.vue
+++ b/src/page/login/register.vue
@@ -8,7 +8,7 @@
     </div> -->
     <div class="logins_content">
       <div class="login_title animated slideInDown">
-        <span>{{ '手机注册' }}</span>
+        <span>{{ $t('hj18') }}</span>
       </div>
       <div class="login_forms">
         <div class="top_forms">
@@ -30,23 +30,23 @@
           <div class="user_name">
             <input type="text" placeholder="机构代码" v-model="userName" />
           </div> -->
-          <el-input :placeholder="placeholder" :size="medium" v-model="phone" clearable @input="handleInput()">
+          <el-input :placeholder="placeholder" size="medium" v-model="phone" clearable @input="handleInput()" maxlength="11">
           </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="密码为6~12位数字、字母或符号" :size="medium"
+          <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="请再次确认密码" :size="medium" v-model="rePassword"
+          <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="邀请码" :size="medium" v-model="userName" clearable
+          <el-input style="margin-top: 0.46rem;" :placeholder="$t('hj21')" size="medium" v-model="userName" clearable
             @input="handleInput()">
           </el-input>
         </div>
         <div class="bottom_btns" :class="btnClass ? 'on' : 'off'">
           <div class="top_btn " @click="gook" :class="dengl ? 'animated pulse' : ''">
-            <span>{{ '安全注册' }}</span>
+            <span>{{ $t('hj22') }}</span>
           </div>
           <!-- <div
            class="register-form-item agree-model"
@@ -57,8 +57,8 @@
           <a  style="color:#fff">《注册协议》</a>
           </div> -->
           <div class="mes">
-            <span>{{ '已有账户?' }}</span>
-            <span @click="$router.push('/login')" style="color: rgb(54,124,248);">{{ '登录>' }}</span>
+            <span>{{ $t('hj23') }}?</span>
+            <span @click="$router.push('/login')" style="color: rgb(54,124,248);"> {{ $t('hj24') }} ></span>
           </div>
         </div>
       </div>
@@ -80,10 +80,10 @@
   name: "newRegister",
   data() {
     return {
-      verification: "验证码",
-      loginWay: "手机号注册",
-      loginWay: "手机号注册",
-      placeholder: "手机号",
+      verification: this.$t('hj25'),
+      loginWay: this.$t('hj26'),
+      loginWay: this.$t('hj26'),
+      placeholder: this.$t('hj27'),
       Logo,
       phone: "",
       userName: "",
@@ -117,7 +117,7 @@
     checkCodeBox() {
       if (isNull(this.phone) || !isPhone(this.phone)) {
         // Toast('请输入正确的手机号')
-        this.texts = "请输入正确的手机号"
+        this.texts = this.$t('hj28')
         this.alertShow = true
         setTimeout(() => {
           this.alertShow = false
@@ -149,14 +149,14 @@
       //   var reg = 11 && /^((13|14|15|17|18)[0-9]{1}\d{8})$/
       let reg = /^[0-9]{11}$/ // 手机号码验证
       if (isNull(this.phone)) {
-        this.texts = "手机号不能为空"
+        this.texts = this.$t('hj29')
         this.alertShow = true
         setTimeout(() => {
           this.alertShow = false
         }, 2000)
       } else {
         if (!reg.test(this.phone)) {
-          this.texts = "请输入正确的手机号码"
+          this.texts = this.$t('hj28')
           this.alertShow = true
           setTimeout(() => {
             this.alertShow = false
@@ -187,7 +187,6 @@
               setTimeout(() => {
                 this.alertShow = false
                 this.elType = "warning"
-
               }, 2000)
             }
           } else {
@@ -216,37 +215,29 @@
       // } else
       if (isNull(this.phone) || !isPhone(this.phone)) {
 
-        this.texts = "请输入正确的手机号码"
+        this.texts = this.$t('hj28')
         this.alertShow = true
         setTimeout(() => {
           this.alertShow = false
         }, 2000)
         this.loginBtn = false;
       } else if (isNull(this.userPassword)) {
-        this.texts = "请输入密码"
+        this.texts = this.$t('hj30')
         this.alertShow = true
         setTimeout(() => {
           this.alertShow = false
         }, 2000)
         this.loginBtn = false;
       } else if (isNull(this.rePassword)) {
-        this.texts = "请确认密码"
+        this.texts = this.$t('hj31')
         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 
+      } else {
         if (this.userPassword !== this.rePassword) {
-          this.texts = "两次输入的密码不一致"
+          this.texts = this.$t('hj32')
           this.alertShow = true
           setTimeout(() => {
             this.alertShow = false
@@ -256,14 +247,14 @@
           this.loginBtn = false;
         } else if (!pwdReg(this.userPassword)) {
 
-          this.texts = "密码为6~12位,数字、字母或符号"
+          this.texts = this.$t('hj19')
           this.alertShow = true
           setTimeout(() => {
             this.alertShow = false
           }, 2000)
           this.loginBtn = false;
         } else if (isNull(this.userName)) {
-          this.texts = "请输入邀请码"
+          this.texts = this.$t('hj33')
           this.alertShow = true
           setTimeout(() => {
             this.alertShow = false
@@ -279,16 +270,16 @@
           }
           let data = await api.register(opts)
           if (data.status === 0) {
-
-            this.texts = "注册成功,请登录"
+            this.texts = this.$t('hj34')
             this.elType = "success"
             this.alertShow = true
             setTimeout(() => {
+              this.$router.push('/login')
               this.alertShow = false
               this.elType = "warning"
-            }, 2000)
+            }, 1000)
             this.loginBtn = false;
-            this.$router.push('/login')
+           
           } else {
             this.texts = data.msg
             this.alertShow = true
@@ -298,6 +289,20 @@
             this.loginBtn = false;
           }
         }
+      }
+      if (navigator.vibrate) {
+          // 支持
+        navigator.vibrate([55]);
+      }
+        //   if (isNull(this.code)) {
+        //     this.texts="请输入验证码"
+        // this.alertShow=true
+        // setTimeout(()=>{
+        //   this.alertShow=false
+        // },2000)
+        //     this.loginBtn = false;
+        //   } else 
+       
     },
     isAgree() {
       this.agree = !this.agree
@@ -307,7 +312,7 @@
       let data = await api.checkPhone({ phoneNum: this.phone })
       if (data.status === 0) {
         // 如果用户已存在返回 0
-        this.texts = "用户已注册,请登录"
+        this.texts = this.$t('hj35')
             this.alertShow = true
             setTimeout(() => {
               this.alertShow = false

--
Gitblit v1.9.3