hookehuyr

fix(订单状态): 修正订单状态标签和逻辑不一致的问题

调整订单状态标签显示逻辑,将待发货和待收货状态分开处理,并更新相关状态判断逻辑
......@@ -28,10 +28,13 @@
<view v-if="viewMode === 'buy'" class="tab-item" :class="{ active: activeTab === 3 }" @click="setActiveTab(3)">
待支付
</view>
<view class="tab-item" :class="{ active: activeTab === 4 }" @click="setActiveTab(4)">
{{ viewMode === 'buy' ? '待收货' : '待发货' }}
</view>
<view class="tab-item" :class="{ active: activeTab === 5 }" @click="setActiveTab(5)">
{{ viewMode === 'buy' ? '待发货' : '待发货' }}
</view>
<view class="tab-item" :class="{ active: activeTab === 9 }" @click="setActiveTab(9)">
{{ viewMode === 'buy' ? '待收货' : '已发货' }}
</view>
<view class="tab-item" :class="{ active: activeTab === 11 }" @click="setActiveTab(11)">
已完成
</view>
<view class="tab-item" :class="{ active: activeTab === 7 }" @click="setActiveTab(7)">
......@@ -99,7 +102,7 @@
</template>
<!-- 买车模式:待收货状态 -->
<template v-if="viewMode === 'buy' && order.status === 4">
<template v-if="viewMode === 'buy' && order.status === 9">
<nut-button type="default" size="small" @click="viewOrderDetail(order.id)">
查看详情
</nut-button>
......@@ -110,7 +113,7 @@
</template>
<!-- 卖车模式:待发货状态 -->
<template v-if="viewMode === 'sell' && order.status === 4">
<template v-if="viewMode === 'sell' && order.status === 5">
<nut-button type="default" size="small" @click="viewOrderDetail(order.id)">
查看详情
</nut-button>
......@@ -121,7 +124,7 @@
</template>
<!-- 已完成状态 -->
<template v-if="order.status === 5">
<template v-if="order.status === 11">
<nut-button type="default" size="small" @click="viewOrderDetail(order.id)">
查看详情
</nut-button>
......@@ -433,8 +436,9 @@ const filteredOrders = computed(() => {
return orders.filter(order => {
if (activeTab.value === 3) return order.status === 3
if (activeTab.value === 4) return order.status === 4
if (activeTab.value === 5) return order.status === 5
if (activeTab.value === 9) return order.status === 9
if (activeTab.value === 11) return order.status === 11
if (activeTab.value === 7) return order.status === 7
return true
})
......@@ -479,7 +483,7 @@ const loadOrderData = async (isLoadMore = false) => {
if (page === 0) {
const mockOrder = {
id: `mock_${type}_${Date.now()}`,
status: 4, // 待收货/待发货状态
status: 9, // 已发货/待收货状态
created_time: new Date().toLocaleString('zh-CN'),
total_amount: 15000,
details: {
......@@ -624,9 +628,11 @@ const getStatusText = (status) => {
switch (status) {
case 3:
return '待支付'
case 4:
return viewMode.value === 'buy' ? '待收货' : '待发货'
case 5:
return '待发货'
case 9:
return viewMode.value === 'buy' ? '待收货' : '已发货'
case 11:
return '已完成'
case 7:
return '已取消'
......@@ -642,9 +648,11 @@ const getStatusClass = (status) => {
switch (status) {
case 3:
return 'status-pending'
case 4:
return 'status-shipping'
case 5:
return 'status-shipping'
case 9:
return 'status-shipping'
case 11:
return 'status-completed'
case 7:
return 'status-cancelled'
......@@ -923,7 +931,7 @@ const submitRate = async () => {
}
// 确保订单状态为已完成
order.status = 5
order.status = 11
}
Taro.showToast({
......@@ -1211,8 +1219,8 @@ const performConfirmShip = async (orderId) => {
const order = orders.value.find(o => o.id === orderId)
if (order) {
// 更新订单状态为已完成
order.status = 5
// 更新订单状态为已发货/待收货
order.status = 9
Taro.showToast({
title: response.msg || '发货成功',
......@@ -1296,7 +1304,7 @@ const handleConfirmReceiveSuccess = ({ merchantId, transactionId, merchantTradeN
const order = orders.find(o => o.id === merchantTradeNo)
if (order) {
order.status = 5 // 更新为已完成状态
order.status = 11 // 更新为已完成状态
}
}
......