fix(order): 修复已取消订单状态下的投诉和售后逻辑

- 投诉页面增加订单取消状态校验,已取消订单禁止发起投诉并自动返回
- 订单详情页售后入口增加取消状态判断,取消订单不展示售后按钮
- 退款价格展示增加已支付状态校验,避免未支付订单显示退款信息
- 新增 resolveRefundPrice 函数,全额退款时回退使用 flowPrice 计算
- 重构联系方式区域布局,分离电话号码与图标并优化样式
This commit is contained in:
pikachu1995@126.com
2026-11-12 09:48:04 +08:00
parent 870e9c4db4
commit e71b15036f
2 changed files with 37 additions and 4 deletions

View File

@@ -159,6 +159,10 @@ function loadData(orderSn: string) {
order.value = result.order order.value = result.order
orderGoodsList.value = result.orderItems orderGoodsList.value = result.orderItems
if (store.state.isShowToast) uni.hideLoading() if (store.state.isShowToast) uni.hideLoading()
if (result?.order?.orderStatus === 'CANCELLED') {
uni.showToast({ title: '订单已取消,无法发起投诉', icon: 'none' })
setTimeout(() => { uni.navigateBack() }, 1500)
}
}) })
} }

View File

@@ -80,9 +80,14 @@
<view class="title">自提点地址:</view> <view class="title">自提点地址:</view>
<view class="value address-line-height">{{ order.storeAddressPath }}</view> <view class="value address-line-height">{{ order.storeAddressPath }}</view>
</view> </view>
<view class="order-info-view" @click="handleCallPhone" > <view class="order-info-view" @click="handleCallPhone">
<view class="title">联系方式:</view> <view class="title">联系方式:</view>
<view class="value">{{ order.storeAddressMobile }}<u-icon name='phone-fill' ></u-icon></view> <view class="value contact-phone-value">
<text>{{ order.storeAddressMobile }}</text>
<view class="phone-icon-wrap">
<u-icon name="phone-fill" size="28" :color="lightColor || '#2979ff'"></u-icon>
</view>
</view>
</view> </view>
</view> </view>
@@ -118,8 +123,8 @@
<view class="goods-price" v-else> <view class="goods-price" v-else>
¥{{unitPrice(sku.goodsPrice) }} ¥{{unitPrice(sku.goodsPrice) }}
<!-- <span v-if="sku.point">+{{ sku.point }}积分</span> --> <!-- <span v-if="sku.point">+{{ sku.point }}积分</span> -->
<span style="font-size: 24rpx;margin-left: 14rpx;color: #ff9900;" v-if="!isECouponOrder && !isAppointmentOrderFlag && sku.isRefund && sku.isRefund !== 'NO_REFUND'"> <span style="font-size: 24rpx;margin-left: 14rpx;color: #ff9900;" v-if="order.payStatus === 'PAID' && !isECouponOrder && !isAppointmentOrderFlag && sku.isRefund && sku.isRefund !== 'NO_REFUND'">
{{refundPriceList(sku.isRefund)}} ({{unitPrice(sku.refundPrice, "¥") }}) {{refundPriceList(sku.isRefund)}} ({{unitPrice(resolveRefundPrice(sku), "¥") }})
</span> </span>
</view> </view>
</view> </view>
@@ -550,6 +555,16 @@ function refundPriceList(status: string) {
} }
} }
function resolveRefundPrice(sku: any) {
if (sku?.refundPrice && Number(sku.refundPrice) > 0) {
return sku.refundPrice
}
if (sku?.isRefund === 'ALL_REFUND' && sku?.flowPrice) {
return sku.flowPrice
}
return sku?.refundPrice || 0
}
function handleCallPhone() { function handleCallPhone() {
if (order.value.storeAddressMobile) { if (order.value.storeAddressMobile) {
callPhone(order.value.storeAddressMobile) callPhone(order.value.storeAddressMobile)
@@ -644,6 +659,7 @@ function isGiftItem(sku: any) {
} }
function canShowSkuAfterSale(sku: any) { function canShowSkuAfterSale(sku: any) {
if (order.value?.orderStatus === 'CANCELLED') return false
if (isGiftItem(sku)) return false if (isGiftItem(sku)) return false
if (isECouponOrder.value) return false if (isECouponOrder.value) return false
if (!order.value?.sn || Number(order.value.flowPrice) === 0) return false if (!order.value?.sn || Number(order.value.flowPrice) === 0) return false
@@ -968,6 +984,19 @@ page,
flex:10; flex:10;
} }
.contact-phone-value {
display: flex;
flex-direction: row;
align-items: center;
.phone-icon-wrap {
margin-left: 12rpx;
display: inline-flex;
align-items: center;
justify-content: center;
}
}
.order-sn-value { .order-sn-value {
display: flex; display: flex;
flex-direction: row; flex-direction: row;