同步
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
* 改造后:发起人支付,好友领取。支持单页模式引导、登录检测。
|
||||
*/
|
||||
const app = getApp()
|
||||
const soulBridge = require('../../utils/soulBridge.js')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
@@ -180,28 +181,10 @@ Page({
|
||||
}
|
||||
const payParams = res.data.payParams
|
||||
const orderSn = res.data.orderSn
|
||||
// 与正常章节支付一致:只传 5 个必需参数,不传 appId 等多余字段
|
||||
await new Promise((resolve, reject) => {
|
||||
wx.requestPayment({
|
||||
timeStamp: payParams.timeStamp,
|
||||
nonceStr: payParams.nonceStr,
|
||||
package: payParams.package,
|
||||
signType: payParams.signType || 'RSA',
|
||||
paySign: payParams.paySign,
|
||||
success: resolve,
|
||||
fail: reject
|
||||
})
|
||||
})
|
||||
await soulBridge.requestWxJsapiPayment(payParams)
|
||||
wx.showToast({ title: '支付成功', icon: 'success' })
|
||||
this.setData({ paying: false })
|
||||
// 主动同步订单状态(与 read 页一致)
|
||||
if (orderSn) {
|
||||
try {
|
||||
await app.request(`/api/miniprogram/pay?orderSn=${encodeURIComponent(orderSn)}`, { silent: true })
|
||||
} catch (e) {
|
||||
console.warn('[GiftPay] 主动同步订单失败:', e)
|
||||
}
|
||||
}
|
||||
await soulBridge.syncOrderStatusQuery(app, orderSn)
|
||||
this.loadDetail()
|
||||
} catch (e) {
|
||||
this.setData({ paying: false })
|
||||
|
||||
Reference in New Issue
Block a user