|
|
@ -8,7 +8,7 @@ |
|
|
|
<view class="sjh list-call"> |
|
|
|
<input class="sl-input" v-model="login.mobile" type="number" maxlength="11" placeholder="输入手机号码" /> |
|
|
|
</view> |
|
|
|
<view class="tips">手机号码格式错误,请重新填写</view> |
|
|
|
<view class="tips" v-if="showPhoneErr">手机号码格式错误,请重新填写</view> |
|
|
|
|
|
|
|
<view class="yzm flex_row"> |
|
|
|
<view class="list-call l-short"> |
|
|
@ -21,7 +21,7 @@ |
|
|
|
</view> |
|
|
|
<view v-else class="list-call l-small flex_col">{{count}}s</view> |
|
|
|
</view> |
|
|
|
<view class="tips">验证码错误,请重新填写</view> |
|
|
|
<view class="tips" v-if="showCodeErr">验证码错误,请重新填写</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
@ -59,20 +59,32 @@ |
|
|
|
count:5, |
|
|
|
code:"", |
|
|
|
agreed:false,//是否同意协议 |
|
|
|
login: {//后台让先写死 |
|
|
|
mobile: '13500071371',//手机 |
|
|
|
ticket: 'test',//短信验证码返回的 |
|
|
|
verify_code:'666666',//验证码 |
|
|
|
login: {//后台让先写死 |
|
|
|
mobile: '',//手机 |
|
|
|
ticket: '',//短信验证码返回的 |
|
|
|
verify_code:'',//验证码 |
|
|
|
// mobile: '13500071371',//手机 |
|
|
|
// ticket: 'test',//短信验证码返回的 |
|
|
|
// verify_code:'666666',//验证码 |
|
|
|
}, |
|
|
|
WXdetail:{ |
|
|
|
code:"", |
|
|
|
appid:"", |
|
|
|
encryptedData:"", |
|
|
|
iv:"", |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
showCodeErr:false, |
|
|
|
showPhoneErr:false |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed:{ |
|
|
|
checkMobile(){ |
|
|
|
return this.login.mobile |
|
|
|
}, |
|
|
|
checkCode(){ |
|
|
|
return this.login.verify_code |
|
|
|
} |
|
|
|
}, |
|
|
|
async onLoad() { |
|
|
|
// let _login = await this.$tools.promisify(uni.login)() |
|
|
|
// this.code = _login.code |
|
|
@ -84,11 +96,23 @@ |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
...mapActions(["setUserData"]), |
|
|
|
bindLogin() { |
|
|
|
if (this.login.mobile.length != 11) { |
|
|
|
return this.$tools.showNone("请输入正确的手机号");} |
|
|
|
if (this.login.verify_code.length < 6) { |
|
|
|
return this.$tools.showNone("请输入正确的验证码");} |
|
|
|
bindLogin() { |
|
|
|
let {mobile} = this.login |
|
|
|
let phoneReg = new RegExp(/^1(3|4|5|6|7|8|9)\d{9}$/); |
|
|
|
if (!phoneReg.test(mobile)) { |
|
|
|
this.showPhoneErr = true |
|
|
|
return this.$tools.showNone("请输入正确的手机号"); |
|
|
|
} |
|
|
|
this.showPhoneErr = false |
|
|
|
if (this.login.verify_code.length < 6) { |
|
|
|
this.showCodeErr = true |
|
|
|
return this.$tools.showNone("请输入正确的验证码"); |
|
|
|
} |
|
|
|
this.showCodeErr = false |
|
|
|
|
|
|
|
if(!this.agreed){ |
|
|
|
return this.$tools.showNone("请确认已阅读并同意隐私协议"); |
|
|
|
} |
|
|
|
postLogin(this.login).then(res => { |
|
|
|
this.loginSuccess(res) |
|
|
|
}).catch((e)=>{ |
|
|
@ -104,7 +128,15 @@ |
|
|
|
this.$Router.push('/pages/login/agreement') |
|
|
|
}, |
|
|
|
sendSMS(){ |
|
|
|
console.log("sendSMS"); |
|
|
|
let {mobile} = this.login |
|
|
|
let phoneReg = new RegExp(/^1(3|4|5|6|7|8|9)\d{9}$/); |
|
|
|
if(!mobile||!phoneReg.test(mobile)){ |
|
|
|
this.showPhoneErr = true |
|
|
|
return |
|
|
|
}else if(phoneReg.test(mobile)){ |
|
|
|
this.showPhoneErr = false |
|
|
|
} |
|
|
|
postSendSMS({mobile}).then(res => { |
|
|
|
this.$tools.showNone("发送成功"); |
|
|
|
this.login.ticket = res.data||"" |
|
|
@ -125,6 +157,9 @@ |
|
|
|
}, |
|
|
|
async decryptPhoneNumber(e){ |
|
|
|
console.log("decryptPhoneNumber",e); |
|
|
|
if(!this.agreed){ |
|
|
|
return this.$tools.showNone("请确认已阅读并同意隐私协议"); |
|
|
|
} |
|
|
|
if(e.detail.errMsg!=="getPhoneNumber:ok")return this.$tools.showNone(e.detail.errMsg) |
|
|
|
this.$tools.showNone("解析数据...") |
|
|
|
|
|
|
@ -136,6 +171,7 @@ |
|
|
|
this.getWXPhoneNumber(this.WXdetail) |
|
|
|
}, |
|
|
|
getWXPhoneNumber(WXdetail){ |
|
|
|
|
|
|
|
wechatGetPhoneNumberLogin(WXdetail).then(res => { |
|
|
|
// this.login.ticket = res.data||"" |
|
|
|
this.loginSuccess(res) |
|
|
@ -259,6 +295,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
.agreement-box{ |
|
|
|
margin-top: 20rpx; |
|
|
|
padding-left: 30rpx; |
|
|
|
color: #696D6F; |
|
|
|
.a-icon{ |
|
|
|