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