支付宝优化更新
This commit is contained in:
@@ -49,7 +49,7 @@
|
||||
<button class="getPhone" open-type="getAuthorize" scope='phoneNumber' @getAuthorize="getPhone" @error="getPhoneError">
|
||||
<!-- #endif -->
|
||||
|
||||
<view class="text">{{phonetitle || '获取微信手机号'}}</view>
|
||||
<view class="text">{{'获取微信手机号'}}</view>
|
||||
</button>
|
||||
</view>
|
||||
<view class="agreement">
|
||||
@@ -202,7 +202,6 @@
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: async (data) => {
|
||||
console.log(data)
|
||||
let res = await this.api.userwxlogins({
|
||||
code: data.code,
|
||||
encryptedData: d.detail.encryptedData,
|
||||
@@ -222,36 +221,12 @@
|
||||
console.log(res)
|
||||
my.getPhoneNumber({
|
||||
success: async (data) => {
|
||||
console.log(data)
|
||||
let res = await this.api.userwxlogins({
|
||||
encryptedData: JSON.parse(data.response).response,
|
||||
source: "alipay"
|
||||
})
|
||||
this.phonetitle = res.data.substr(0, 3) + "****" + res.data.substr(7)
|
||||
this.mobile = res.data;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-ALIPAY
|
||||
// 支付宝小程序环境
|
||||
my.getAuthCode({
|
||||
scopes: 'auth_user',
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
let authCode = res.authCode;
|
||||
my.getPhoneNumber({
|
||||
success: async (data) => {
|
||||
let res = await this.api.userwxlogins({
|
||||
// code: authCode,
|
||||
encryptedData: JSON.parse(data.response).response,
|
||||
source: "alipay"
|
||||
})
|
||||
this.phonetitle = res.data.substr(0, 3) + "****" + res.data.substr(7)
|
||||
this.mobile = res.data;
|
||||
console.log(this.phonetitle)
|
||||
this.telephone = res.data
|
||||
// console.log(this.phonetitle)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user