|
|
|
@ -45,7 +45,7 @@ |
|
|
|
|
</u--input> |
|
|
|
|
<!-- #endif --> |
|
|
|
|
</view> |
|
|
|
|
<u-button text="登录" :disabled="!phone||!code" class="loginBtn"></u-button> |
|
|
|
|
<u-button text="登录" :disabled="!phone||!code" @click="smsLogin" class="loginBtn"></u-button> |
|
|
|
|
<!-- <view >登录</view> --> |
|
|
|
|
<view class="otherLogin"> |
|
|
|
|
<view class="line"></view> |
|
|
|
@ -175,6 +175,21 @@ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
async smsLogin(){ |
|
|
|
|
let res = await this.$api.base.smsLogin({ |
|
|
|
|
phone:this.phone, |
|
|
|
|
code:this.code |
|
|
|
|
}) |
|
|
|
|
console.log(res,"---") |
|
|
|
|
this.$util.showLoading({ |
|
|
|
|
title: "登录中..." |
|
|
|
|
}) |
|
|
|
|
try { |
|
|
|
|
this.toLogin(res) |
|
|
|
|
} catch (e) { |
|
|
|
|
this.$util.hideAll() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
async toLogin(userInfo) { |
|
|
|
|
let user_info = await this.$api.base.appLogin({ |
|
|
|
|
data: userInfo |
|
|
|
@ -238,13 +253,14 @@ |
|
|
|
|
phone:this.phone |
|
|
|
|
}) |
|
|
|
|
console.log(res,"999") |
|
|
|
|
setTimeout(() => { |
|
|
|
|
if(res){ |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
// 这里此提示会被this.start()方法中的提示覆盖 |
|
|
|
|
uni.$u.toast('验证码已发送'); |
|
|
|
|
// 通知验证码组件内部开始倒计时 |
|
|
|
|
this.$refs.uCode.start(); |
|
|
|
|
}, 2000); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
uni.$u.toast('倒计时结束后再发送'); |
|
|
|
|
} |
|
|
|
|