|
@@ -143,18 +143,28 @@ Page({
|
|
|
title: '提交中',
|
|
|
mask: true
|
|
|
})
|
|
|
- let res = await androidbuyVip({
|
|
|
+ // #if MP
|
|
|
+ userEvent({
|
|
|
+ action: 'ANDROID_PAY_ACTIVITY',
|
|
|
+ })
|
|
|
+ let res = await buyVip({
|
|
|
productId: currentTarget.dataset.id
|
|
|
}).finally(() => {
|
|
|
wx.hideLoading()
|
|
|
})
|
|
|
- wx.miniapp.requestPayment({
|
|
|
- timeStamp: res.timestamp,
|
|
|
- mchId: res.partnerid,
|
|
|
- prepayId: res.prepayid,
|
|
|
+ let {
|
|
|
+ timeStamp,
|
|
|
+ nonceStr,
|
|
|
+ signType,
|
|
|
+ paySign
|
|
|
+ } = res
|
|
|
+ // package保留字
|
|
|
+ wx.requestPayment({
|
|
|
+ timeStamp,
|
|
|
+ nonceStr,
|
|
|
package: res.package,
|
|
|
- nonceStr: res.noncestr,
|
|
|
- sign: res.sign,
|
|
|
+ signType,
|
|
|
+ paySign,
|
|
|
success: async (res) => {
|
|
|
setTimeout(() => {
|
|
|
this.setUserInfo()
|
|
@@ -170,28 +180,21 @@ Page({
|
|
|
icon: "none",
|
|
|
duration: 3000
|
|
|
})
|
|
|
- },
|
|
|
- complete: (res) => {
|
|
|
- console.error('wx.miniapp.requestPayment complete:', res)
|
|
|
}
|
|
|
})
|
|
|
- return
|
|
|
- userEvent({
|
|
|
- action: 'ANDROID_PAY_ACTIVITY',
|
|
|
+ // #elif ANDROID
|
|
|
+ let res = await androidbuyVip({
|
|
|
+ productId: currentTarget.dataset.id
|
|
|
+ }).finally(() => {
|
|
|
+ wx.hideLoading()
|
|
|
})
|
|
|
- let {
|
|
|
- timeStamp,
|
|
|
- nonceStr,
|
|
|
- signType,
|
|
|
- paySign
|
|
|
- } = res
|
|
|
- // package保留字
|
|
|
- wx.requestPayment({
|
|
|
- timeStamp,
|
|
|
- nonceStr,
|
|
|
+ wx.miniapp.requestPayment({
|
|
|
+ timeStamp: res.timestamp,
|
|
|
+ mchId: res.partnerid,
|
|
|
+ prepayId: res.prepayid,
|
|
|
package: res.package,
|
|
|
- signType,
|
|
|
- paySign,
|
|
|
+ nonceStr: res.noncestr,
|
|
|
+ sign: res.sign,
|
|
|
success: async (res) => {
|
|
|
setTimeout(() => {
|
|
|
this.setUserInfo()
|
|
@@ -207,8 +210,12 @@ Page({
|
|
|
icon: "none",
|
|
|
duration: 3000
|
|
|
})
|
|
|
+ },
|
|
|
+ complete: (res) => {
|
|
|
+ console.error('wx.miniapp.requestPayment complete:', res)
|
|
|
}
|
|
|
})
|
|
|
+ // #endif
|
|
|
},
|
|
|
jump({
|
|
|
currentTarget
|