|
|
@@ -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
|
|
|
},
|