|
|
@@ -82,6 +82,28 @@ function handleRebook() {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+/** 是否显示取消/退款按钮 */
|
|
|
+const showCancelOrRefundButton = computed(() => {
|
|
|
+ const status = statusValue.value
|
|
|
+ const cancelState = orderInfo.value?.cancelRecords?.cancelState
|
|
|
+ const isChangeask = orderInfo.value?.scenicOrder?.isChangeask
|
|
|
+
|
|
|
+ // 必须允许退改申请
|
|
|
+ if (isChangeask !== 1)
|
|
|
+ return false
|
|
|
+
|
|
|
+ // 状态为0(待支付)时可以取消订单
|
|
|
+ if (status === 0)
|
|
|
+ return true
|
|
|
+
|
|
|
+ // 状态为60(已退款)或80(已完成)时不显示
|
|
|
+ if (status === 60 || status === 80)
|
|
|
+ return false
|
|
|
+
|
|
|
+ // 其他状态:没有退款申请或申请已通过时可以再次申请
|
|
|
+ return cancelState == null || cancelState === 1
|
|
|
+})
|
|
|
+
|
|
|
const isCancel = computed(() => statusValue.value === 0)
|
|
|
|
|
|
/** 取消订单 / 申请退款 */
|
|
|
@@ -162,14 +184,14 @@ function orderDetailBack() {
|
|
|
<view :style="{ height: `${(Number(statusBarHeight) || 44) + MenuButtonHeight + 30}px` }" />
|
|
|
<view v-if="orderInfo" class="px-24rpx">
|
|
|
<view class="rounded-16rpx bg-#FFF p-24rpx">
|
|
|
- <OrderDetailStatus v-if="!hasVoucher" :status="statusValue" @pay="handleGoPay" @rebook="handleRebook" />
|
|
|
+ <OrderDetailStatus v-if="!hasVoucher || orderInfo.hbOrderStatus == 60" :status="statusValue" @pay="handleGoPay" @rebook="handleRebook" />
|
|
|
<view class="flex items-center justify-between gap-50rpx text-32rpx font-bold">
|
|
|
<view>{{ orderInfo.scenicOrder?.productName }}</view>
|
|
|
<view class="w-100rpx text-24rpx text-#9ED605" @click="router.push({ name: 'attractions-detail', params: { productNo: String(orderInfo.scenicOrder?.productNo) } })">
|
|
|
详情
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view v-if="hasVoucher" class="text-center">
|
|
|
+ <view v-if="hasVoucher && orderInfo.hbOrderStatus != 60" class="text-center">
|
|
|
<view class="mt-24rpx h-2rpx w-full bg-#F0F0F0" />
|
|
|
<view class="mt-24rpx flex items-center justify-center gap-10rpx">
|
|
|
<wd-icon :name="currentStatus.icon" size="20px" :color="currentStatus.color" />
|
|
|
@@ -185,7 +207,7 @@ function orderDetailBack() {
|
|
|
>
|
|
|
<swiper-item v-for="(people, idx) in voucherPeoples" :key="idx" class="flex flex-col items-center justify-center">
|
|
|
<view class="flex items-center justify-center">
|
|
|
- <QCode class="my-20rpx rounded-16rpx" :text="people.voucherCode || ''" :qwidth="80" :qr-key="`qr-${idx}`" />
|
|
|
+ <QCode class="mb-20rpx rounded-16rpx" :text="people.voucherCode || ''" :qwidth="80" :qr-key="`qr-${idx}`" />
|
|
|
</view>
|
|
|
<view class="text-28rpx font-bold">
|
|
|
{{ people.voucherCode }}
|
|
|
@@ -195,7 +217,7 @@ function orderDetailBack() {
|
|
|
</view>
|
|
|
</swiper-item>
|
|
|
</swiper>
|
|
|
- <view class="mt-20rpx text-24rpx text-#AAAAAA">
|
|
|
+ <view class="text-24rpx text-#AAAAAA">
|
|
|
{{ currentStatus.desc }}
|
|
|
</view>
|
|
|
<view class="mt-24rpx flex items-center justify-center gap-10rpx" @click="router.push({ name: 'attractions-tabbar', params: { tabbar: '1' } })">
|
|
|
@@ -379,7 +401,7 @@ function orderDetailBack() {
|
|
|
</Zcontact>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <wd-button v-if="(statusValue === 0 || statusValue != 60) && (orderInfo?.cancelState != 0 || orderInfo?.cancelState === 1) && orderInfo?.scenicOrder?.isChangeask === 1" custom-class="w-546rpx" block size="large" @click="orderPopup = true">
|
|
|
+ <wd-button v-if="showCancelOrRefundButton" custom-class="w-546rpx" block size="large" @click="orderPopup = true">
|
|
|
{{ isCancel ? '取消订单' : '退款申请' }}
|
|
|
</wd-button>
|
|
|
</view>
|