ci
This commit is contained in:
parent
184305e6a0
commit
01eb9a425a
@ -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: '查询结果中...' })
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
const BASE_URL = 'https://mini-chat.1024tool.vip'
|
||||
const BASE_URL = 'https://kdy.1024tool.vip'
|
||||
|
||||
let authModalShown = false
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user