|
@@ -27,6 +27,7 @@ defineOptions({
|
|
const paging = ref(null)
|
|
const paging = ref(null)
|
|
|
|
|
|
const id = ref<any>()
|
|
const id = ref<any>()
|
|
|
|
+const orderNo = ref<string>()
|
|
const isPayOrder = ref<boolean>(false)
|
|
const isPayOrder = ref<boolean>(false)
|
|
const detail = ref<any>({})
|
|
const detail = ref<any>({})
|
|
const orderStatusEnumData = ref<any>([])
|
|
const orderStatusEnumData = ref<any>([])
|
|
@@ -107,9 +108,15 @@ async function getDetail() {
|
|
title: t('orderDetail.loading'),
|
|
title: t('orderDetail.loading'),
|
|
})
|
|
})
|
|
try {
|
|
try {
|
|
- const res = await orderDetail({ id: id.value })
|
|
|
|
|
|
+ // 根据参数类型构建请求参数
|
|
|
|
+ const params = orderNo.value ? { orderNo: orderNo.value } : { id: id.value }
|
|
|
|
+ const res = await orderDetail(params)
|
|
if (res.code === '200') {
|
|
if (res.code === '200') {
|
|
detail.value = res.data
|
|
detail.value = res.data
|
|
|
|
+ // 如果通过 orderNo 查询,更新 id 值用于其他接口调用
|
|
|
|
+ if (orderNo.value && detail.value?.orderId) {
|
|
|
|
+ id.value = detail.value.orderId
|
|
|
|
+ }
|
|
if (detail.value?.status === 1) {
|
|
if (detail.value?.status === 1) {
|
|
startCountdown() // 开始倒计时
|
|
startCountdown() // 开始倒计时
|
|
// if (isPayOrder.value) {
|
|
// if (isPayOrder.value) {
|
|
@@ -269,8 +276,12 @@ onLoad(async (options) => {
|
|
getConfig('open_red_envelope_rate')
|
|
getConfig('open_red_envelope_rate')
|
|
getConfig('join_red_envelope_rate')
|
|
getConfig('join_red_envelope_rate')
|
|
const params = getPageParams(options)
|
|
const params = getPageParams(options)
|
|
- id.value = params.id
|
|
|
|
- isPayOrder.value = params.isPayOrder
|
|
|
|
|
|
+
|
|
|
|
+ // 兼容 id 和 orderNo 两种传参方式,优先使用 JSON 参数,其次使用直接参数
|
|
|
|
+ orderNo.value = params.orderNo || options.orderNo
|
|
|
|
+ id.value = params.id || options.id
|
|
|
|
+
|
|
|
|
+ isPayOrder.value = params.isPayOrder || options.isPayOrder
|
|
await getOrderStatus()
|
|
await getOrderStatus()
|
|
})
|
|
})
|
|
const balance = ref<number>(0)
|
|
const balance = ref<number>(0)
|