手机好授权
This commit is contained in:
parent
a36ff7e890
commit
a3ad5139b3
@ -129,6 +129,7 @@ Page({
|
|||||||
let THIS=this;
|
let THIS=this;
|
||||||
let usertype = wx.getStorageSync('usertype');
|
let usertype = wx.getStorageSync('usertype');
|
||||||
let next_url = wx.getStorageSync('next_url');
|
let next_url = wx.getStorageSync('next_url');
|
||||||
|
if(e.detail.errMsg == 'getPhoneNumber:ok'){
|
||||||
wx.login({
|
wx.login({
|
||||||
success (res) {
|
success (res) {
|
||||||
if (res.code) {
|
if (res.code) {
|
||||||
@ -161,5 +162,14 @@ Page({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}else if(e.detail.errMsg == 'getPhoneNumber:fail user deny'){
|
||||||
|
console.log('您拒绝手机号授权')
|
||||||
|
}else{
|
||||||
|
wx.showToast({
|
||||||
|
title: '手机号授权失败',
|
||||||
|
icon:'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -18,11 +18,11 @@
|
|||||||
wx:if="{{ checked }}"
|
wx:if="{{ checked }}"
|
||||||
open-type="getPhoneNumber"
|
open-type="getPhoneNumber"
|
||||||
bindgetphonenumber="getPhoneNumber"
|
bindgetphonenumber="getPhoneNumber"
|
||||||
color="#09BB07" custom-style="font-size: 36rpx;" type="primary" round block>微信授权手机号登录</van-button>
|
color="#09BB07" custom-style="font-size: 36rpx;" type="primary" round block>手机号快捷登录</van-button>
|
||||||
<van-button
|
<van-button
|
||||||
wx:else
|
wx:else
|
||||||
bindtap="getPhoneNumber"
|
bindtap="getPhoneNumber"
|
||||||
color="#09BB07" custom-style="font-size: 36rpx;" type="primary" round block>微信授权手机号登录</van-button>
|
color="#09BB07" custom-style="font-size: 36rpx;" type="primary" round block>手机号快捷登录</van-button>
|
||||||
|
|
||||||
<view style="display: flex;margin-top: 30rpx;line-height: 50rpx;">
|
<view style="display: flex;margin-top: 30rpx;line-height: 50rpx;">
|
||||||
<van-checkbox value="{{ checked }}" bind:change="onChange"></van-checkbox>
|
<van-checkbox value="{{ checked }}" bind:change="onChange"></van-checkbox>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user