feat: 石油券前端价格与核销码改造——价格取服务端 latest.price 下发(测试期 0.01),详情页实时核销码 60 秒轮询
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
5d253c60a8
commit
22035d543b
@@ -84,8 +84,24 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (options.orderNo) this.orderNo = options.orderNo
|
if (options.orderNo) this.orderNo = options.orderNo
|
||||||
|
this.initFromServer()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// xuchao: 价格展示以服务端 latest 为准(测试期 0.01);已有待支付单自动续用;已发券直接跳券详情
|
||||||
|
initFromServer() {
|
||||||
|
this.$u.api.voucherLatest({ phone: this.phone }).then(res => {
|
||||||
|
if (!bizOk(res)) return
|
||||||
|
const d = bizData(res)
|
||||||
|
if (d.price) this.priceText = (d.price / 100).toFixed(2)
|
||||||
|
if (!this.orderNo && d.statusCode === 0 && d.orderNo) {
|
||||||
|
this.orderNo = d.orderNo
|
||||||
|
if (d.amount) this.priceText = (d.amount / 100).toFixed(2)
|
||||||
|
}
|
||||||
|
if (d.statusCode === 2) {
|
||||||
|
uni.redirectTo({ url: '/pages/petrol/voucherDetail?orderNo=' + (d.orderNo || '') })
|
||||||
|
}
|
||||||
|
}).catch(() => {})
|
||||||
|
},
|
||||||
onConfirmPay() {
|
onConfirmPay() {
|
||||||
if (this.submitting) return
|
if (this.submitting) return
|
||||||
// xuchao: 容器拦截——非云闪付且非联调白名单号,弹窗不发起支付(决策 11/13)
|
// xuchao: 容器拦截——非云闪付且非联调白名单号,弹窗不发起支付(决策 11/13)
|
||||||
|
|||||||
@@ -118,10 +118,11 @@ export default {
|
|||||||
voucherBtnText() {
|
voucherBtnText() {
|
||||||
const s = this.voucher ? this.voucher.statusCode : -1
|
const s = this.voucher ? this.voucher.statusCode : -1
|
||||||
if (s === 0) return '继续支付'
|
if (s === 0) return '继续支付'
|
||||||
if (s === 1) return '查看我的券'
|
if (s === 1 || s === 2) return '查看我的券'
|
||||||
if (s === 2) return '查看我的券'
|
|
||||||
if (s === 3 || s === 4) return '重新购买'
|
if (s === 3 || s === 4) return '重新购买'
|
||||||
return '¥200 购买'
|
// xuchao: 购买按钮金额取服务端下发价(测试期 0.01);未登录无数据时用中性文案
|
||||||
|
if (this.voucher && this.voucher.price) return '¥' + (this.voucher.price / 100).toFixed(2) + ' 购买'
|
||||||
|
return '购买汽油券'
|
||||||
},
|
},
|
||||||
ticketInfoList() {
|
ticketInfoList() {
|
||||||
if (!this.store || !this.store.ticketInfo) return []
|
if (!this.store || !this.store.ticketInfo) return []
|
||||||
|
|||||||
Reference in New Issue
Block a user