This commit is contained in:
邹方成 2026-01-08 10:14:13 +08:00
parent 184305e6a0
commit 01eb9a425a
2 changed files with 40 additions and 35 deletions

View File

@ -402,43 +402,48 @@ async function onPaymentConfirm(paymentData) {
throw new Error('创建订单失败:未返回订单号')
}
// 使
uni.showLoading({ title: '拉起支付...' })
//
if (joinResult.actual_amount > 0 && joinResult.status !== 2) {
// 使
uni.showLoading({ title: '拉起支付...' })
// openid
const openid = uni.getStorageSync('openid')
if (!openid) {
throw new Error('缺少OpenID请重新登录')
// openid
const openid = uni.getStorageSync('openid')
if (!openid) {
throw new Error('缺少OpenID请重新登录')
}
const preorderData = {
openid: openid,
order_no: joinResult.order_no
}
console.log('[Yifanshang] Calling wechat preorder with:', preorderData)
const paymentParams = await createWechatOrder(preorderData)
console.log('[Yifanshang] Wechat payment params:', paymentParams)
uni.hideLoading()
//
// #ifdef MP-WEIXIN
const payResult = await uni.requestPayment({
provider: 'wxpay',
...paymentParams
})
console.log('[Yifanshang] Payment result:', payResult)
// #endif
// #ifdef MP-TOUTIAO
const payResult = await tt.pay({
...paymentParams
})
console.log('[Yifanshang] Payment result:', payResult)
// #endif
} else {
console.log('[Yifanshang] Order is free or paid, skipping payment flow. Amount:', joinResult.actual_amount, 'Status:', joinResult.status)
}
const preorderData = {
openid: openid,
order_no: joinResult.order_no
}
console.log('[Yifanshang] Calling wechat preorder with:', preorderData)
const paymentParams = await createWechatOrder(preorderData)
console.log('[Yifanshang] Wechat payment params:', paymentParams)
uni.hideLoading()
//
// #ifdef MP-WEIXIN
const payResult = await uni.requestPayment({
provider: 'wxpay',
...paymentParams
})
console.log('[Yifanshang] Payment result:', payResult)
// #endif
// #ifdef MP-TOUTIAO
const payResult = await tt.pay({
...paymentParams
})
console.log('[Yifanshang] Payment result:', payResult)
// #endif
//
uni.showLoading({ title: '查询结果中...' })

View File

@ -1,4 +1,4 @@
const BASE_URL = 'https://mini-chat.1024tool.vip'
const BASE_URL = 'https://kdy.1024tool.vip'
let authModalShown = false