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

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