支付宝优化更新

This commit is contained in:
GaoHao
2024-10-31 09:07:26 +08:00
parent b2abe69e37
commit bec723cd69
12 changed files with 845 additions and 135 deletions

View File

@@ -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)
}
});
}