|
@@ -28,6 +28,27 @@ function getCountdownTime(expireTime?: string): number {
|
|
|
const remaining = expire - Date.now()
|
|
const remaining = expire - Date.now()
|
|
|
return remaining > 0 ? remaining : 0
|
|
return remaining > 0 ? remaining : 0
|
|
|
}
|
|
}
|
|
|
|
|
+function handleCancelOrder(order: Api.xsbOrderList) {
|
|
|
|
|
+ useGlobalMessage().confirm({
|
|
|
|
|
+ title: '提示',
|
|
|
|
|
+ msg: '确定要取消该订单吗?',
|
|
|
|
|
+ zIndex: 9999,
|
|
|
|
|
+ success: async () => {
|
|
|
|
|
+ uni.showLoading({ mask: true })
|
|
|
|
|
+ try {
|
|
|
|
|
+ await Apis.refueling.cancelOrder({ params: { orderId: String(order.orderNumber) } })
|
|
|
|
|
+ useGlobalToast().show('取消成功')
|
|
|
|
|
+ _emit('refresh')
|
|
|
|
|
+ }
|
|
|
|
|
+ catch {
|
|
|
|
|
+ useGlobalToast().show('取消失败')
|
|
|
|
|
+ }
|
|
|
|
|
+ finally {
|
|
|
|
|
+ uni.hideLoading()
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -96,15 +117,15 @@ function getCountdownTime(expireTime?: string): number {
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<!-- 操作按钮 -->
|
|
<!-- 操作按钮 -->
|
|
|
- <!-- <view v-if="order.oilOrderStatus === 1" class="mt20rpx flex items-center justify-end gap-20rpx">
|
|
|
|
|
|
|
+ <view v-if="order.oilOrderStatus === 1" class="mt20rpx flex items-center justify-end gap-20rpx">
|
|
|
<wd-button plain size="small" custom-class="action-btn" @click="handleCancelOrder(order)">
|
|
<wd-button plain size="small" custom-class="action-btn" @click="handleCancelOrder(order)">
|
|
|
取消订单
|
|
取消订单
|
|
|
</wd-button>
|
|
</wd-button>
|
|
|
- <wd-button plain size="small" custom-class="action-btn" @click="handlePay(order)">
|
|
|
|
|
|
|
+ <!-- <wd-button plain size="small" custom-class="action-btn" @click="handlePay(order)">
|
|
|
付款
|
|
付款
|
|
|
- </wd-button>
|
|
|
|
|
|
|
+ </wd-button> -->
|
|
|
</view>
|
|
</view>
|
|
|
- <view v-else-if="order.oilOrderStatus === 2" class="mt20rpx flex items-center justify-end">
|
|
|
|
|
|
|
+ <!-- <view v-else-if="order.oilOrderStatus === 2" class="mt20rpx flex items-center justify-end">
|
|
|
<wd-button plain size="small" custom-class="action-btn" @click="handleInvoice(order)">
|
|
<wd-button plain size="small" custom-class="action-btn" @click="handleInvoice(order)">
|
|
|
申请开票
|
|
申请开票
|
|
|
</wd-button>
|
|
</wd-button>
|