BF-202210271038\Administrator 1 vuosi sitten
vanhempi
commit
bdd58f752a
3 muutettua tiedostoa jossa 45 lisäystä ja 11 poistoa
  1. 1 1
      pages/login/index.vue
  2. 2 1
      pages/login/model/agreement.vue
  3. 42 9
      pages/login/register.vue

+ 1 - 1
pages/login/index.vue

@@ -120,7 +120,7 @@
         }else if(type===3){
           this.codedShake=true
         }else if(type===4){
-          this.$refs.agreement.setIsConsent()
+          this.$refs.agreement.setConsentShake()
         }
         setTimeout(()=>{
           this.phoneShake=false

+ 2 - 1
pages/login/model/agreement.vue

@@ -1,5 +1,5 @@
 <template>
-  <view class="input-agreement" @click="setIsConsent" :class="{'apply-shake':consentShake}">
+  <view class="input-agreement animate__animated" :class="{'animate__shakeX':consentShake}" @click="setIsConsent" >
     <image class="agreement-agree" v-if="isConsent" src="/static/img/login/Checked1@3x.png" mode="aspectFill"></image>
     <image class="agreement-agree" v-else src="/static/img/login/Checked2@3x.png" mode="aspectFill"></image>
     <view class="agreement-text text-color-666 sys-size-24">已阅读并同意</view>
@@ -23,6 +23,7 @@ export default {
     },
     setConsentShake(){
       this.consentShake=true
+      console.log('consentShake:'+this.consentShake)
       setTimeout(()=>{
         this.consentShake=false
       },500)

+ 42 - 9
pages/login/register.vue

@@ -12,7 +12,7 @@
           <en-input type="number" class="login-input" placeholder="请输入手机号"  v-model="accountData.phone" ></en-input>
         </view>
         <view class="input-item  input-send sys-from-background-color sys-radius-30 animate__animated" :class="{'animate__shakeX':(accountData.code==='' && isShake)}">
-          <en-input type="number" class="login-input" placeholder="请输入验证码"  v-model="loginData.code" maxlength="6"></en-input>
+          <en-input type="number" class="login-input" placeholder="请输入验证码"  v-model="accountData.code" maxlength="6"></en-input>
           <view class="login-send text-color-dominant sys-size-28 sys-weight-400" @click="getVerifiedCode" v-if="timeNum<=0">发送验证码</view>
           <view class="login-send text-color-dominant sys-size-28 sys-weight-400" v-else>{{ timeNum }} s</view>
         </view>
@@ -47,6 +47,7 @@ import EnInput from "../../components/en-from/en-input/index.vue";
 import tools from "../../service/tools";
 import {commonSend} from "../../api/common";
 import Agreement from "@/pages/login/model/agreement.vue";
+import {register, wxLogin} from "@/api/login";
 
 export default {
   components: {Agreement, EnInput},
@@ -66,7 +67,7 @@ export default {
       timeNum:0,
       timer:null,
       isAJAX:false,
-      isConsent: true,
+      isConsent: false,
       isRegister: false,
       isShake: false,
     };
@@ -74,7 +75,7 @@ export default {
   watch:{
     'accountData': {
       handler() {
-        this.verifyData(false)
+        // this.verifyData(false)
       },
       deep: true
     },
@@ -89,27 +90,59 @@ export default {
       let isRegister=true;
       if(!this.accountData.nickname){
         isRegister=false
-        if(type)tools.error('请输入昵称');
+        if(type){
+          this.isShake=true
+          tools.error('请输入昵称');
+        }
       }
       if(!this.accountData.name){
         isRegister=false
-        if(type)tools.error('请输入姓名');
+        if(type){
+          this.isShake=true
+          tools.error('请输入姓名');
+        }
       }
       if(!this.accountData.password){
         isRegister=false
-        if(type)tools.error('请输入密码');
+        if(type){
+          this.isShake=true
+          tools.error('请输入密码');
+        }
       }
       if(!this.accountData.passwordTwo){
         isRegister=false
-        if(type)tools.error('请确认密码');
+        if(type){
+          this.isShake=true
+          tools.error('请确认密码');
+        }
       }
       if(this.accountData.password!==this.accountData.passwordTwo){
         isRegister=false
-        if(type)tools.error('密码输入不一致');
+        if(type){
+          this.isShake=true
+          tools.error('密码输入不一致');
+        }
       }
       if(!this.accountData.code){
         isRegister=false
-        if(type)tools.error('请输入验证码');
+        if(type){
+          this.isShake=true
+          tools.error('请输入验证码');
+        }
+      }
+      console.log(this.isConsent)
+      if(!this.isConsent){
+        isRegister=false
+        if(type){
+          this.isShake=true
+          tools.error('请阅读并同意协议');
+          this.$refs.agreement.setConsentShake()
+        }
+      }
+      if(this.isShake){
+        setTimeout(()=>{
+          this.isShake=false
+        },500)
       }
       this.isRegister=isRegister
     },