自动选择优惠券
This commit is contained in:
parent
f3c0ab6d8f
commit
ffd0073fdd
@ -95,12 +95,21 @@ const selectedCard = computed(() => {
|
|||||||
return null
|
return null
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(() => props.visible, (val) => {
|
watch(
|
||||||
if (val) {
|
[() => props.visible, () => (Array.isArray(props.coupons) ? props.coupons.length : 0)],
|
||||||
couponIndex.value = -1
|
([vis, len]) => {
|
||||||
|
if (!vis) return
|
||||||
cardIndex.value = -1
|
cardIndex.value = -1
|
||||||
}
|
if (len <= 0) {
|
||||||
})
|
couponIndex.value = -1
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (couponIndex.value < 0) {
|
||||||
|
couponIndex.value = 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
)
|
||||||
|
|
||||||
function onCouponChange(e) {
|
function onCouponChange(e) {
|
||||||
couponIndex.value = e.detail.value
|
couponIndex.value = e.detail.value
|
||||||
|
|||||||
@ -450,6 +450,20 @@ function onPaymentSuccess(payload) {
|
|||||||
console.log('Payment Success:', payload)
|
console.log('Payment Success:', payload)
|
||||||
|
|
||||||
const result = payload.result
|
const result = payload.result
|
||||||
|
const status = String((result && (result.status || result.data?.status || result.result?.status)) || '')
|
||||||
|
if (status === 'paid_waiting') {
|
||||||
|
const next = result && (result.next_draw_time || result.nextDrawTime || result.next_draw_at || result.nextDrawAt)
|
||||||
|
const nextText = next ? formatDateTime(next) : ''
|
||||||
|
const content = nextText ? `下单成功,等待系统自动开启本期赏品。\n预计开赏时间:${nextText}` : '下单成功,等待系统自动开启本期赏品。'
|
||||||
|
try {
|
||||||
|
uni.showModal({
|
||||||
|
title: '下单成功',
|
||||||
|
content,
|
||||||
|
showCancel: false
|
||||||
|
})
|
||||||
|
} catch (_) {}
|
||||||
|
return
|
||||||
|
}
|
||||||
let wonItems = []
|
let wonItems = []
|
||||||
|
|
||||||
// 尝试解析返回结果中的奖励列表
|
// 尝试解析返回结果中的奖励列表
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user