This commit is contained in:
Alex-larget
2026-03-24 15:44:08 +08:00
parent 346e8ab057
commit 28ad08da84
62 changed files with 814 additions and 840 deletions

View File

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