修复小程序登录提示协议顺序问题

This commit is contained in:
hupeng
2023-12-16 21:32:07 +08:00
parent 62d21567cd
commit 0080d05e28

View File

@ -11,8 +11,14 @@
<button
class="cu-btn author-btn"
open-type="getPhoneNumber"
@getphonenumber="phoneLogin"
>手机号快捷登录</button>
@getphonenumber="phoneLogin"
v-if="isChecked"
>手机号快捷登录</button>
<button
v-else
class="cu-btn author-btn"
@tap="phoneLoginBefore"
>手机号快捷登录</button>
<button
class="cu-btn close-btn"
@tap="toLogin"
@ -185,19 +191,18 @@ export default {
})
})
},
// 微信用户手机号登录
phoneLogin(e) {
console.log('code22:',e)
if(!this.isChecked) {
uni.showToast({
title: '请勾选下面协议',
icon: 'none',
duration: 2000,
})
return
}
console.log('用户微信手机号登录')
// 微信用户手机号登录
phoneLoginBefore() {
if(!this.isChecked) {
uni.showToast({
title: '请勾选下面协议',
icon: 'none',
duration: 2000,
})
return
}
},
phoneLogin(e) {
if (e.mp.detail.errMsg == 'getPhoneNumber:ok') {
console.log('wxLoginCode', this.code)
cookie.set('wxLoginCode', this.code)