新页面和修改对应逻辑

This commit is contained in:
not-like-juvenile
2026-01-26 17:12:37 +08:00
parent b1c845d571
commit 1c83f29f7d
10 changed files with 1297 additions and 157 deletions

View File

@@ -5,7 +5,6 @@
<!-- 左上角:返回主页按钮(箭头+文字 垂直排列) -->
<view class="nav-left" @click="goBackToHome">
<text class="nav-icon">←</text>
<text class="nav-title">返回主页</text>
</view>
<!-- 页面标题居中 -->
@@ -54,7 +53,7 @@
</view>
<view class="order-actions">
<button class="action-btn primary" @click="viewOrderDetail(order.id)">查看详情</button>
<button class="action-btn primary" @click="viewOrderDetail(order.id, order.status)">查看详情</button>
</view>
</view>
</view>
@@ -107,6 +106,31 @@ export default {
loadOrderHistory() {
// TODO: 调用API获取历史订单列表
this.orderList = [
{
id: '1',
order_no: 'D202501081234',
status: 4, // 已接取
pickup_address: {
detail: '深圳公司',
area: '购物公园'
},
delivery_address: {
detail: '梅州',
area: '海岸城'
},
pickup_contact: {
name: '商家联系人',
phone: '138****6567'
},
delivery_contact: {
name: '张先生',
phone: '139****9786'
},
delivery_fee: 12.0,
distance: 8.2,
estimated_time: 25,
created_at: '2025-01-08T15:00:00Z'
},
{
id: '2',
order_no: 'D202501081235',
@@ -131,6 +155,31 @@ export default {
distance: 8.2,
estimated_time: 25,
created_at: '2025-01-08T15:00:00Z'
},
{
id: '3',
order_no: 'D202501081236',
status: 2, // 取货中
pickup_address: {
detail: '罗湖区东门步行街',
area: '罗湖'
},
delivery_address: {
detail: '福田区市民中心',
area: '福田'
},
pickup_contact: {
name: '商家联系人',
phone: '138****5678'
},
delivery_contact: {
name: '李先生',
phone: '139****5678'
},
delivery_fee: 10.0,
distance: 5.0,
estimated_time: 15,
created_at: '2025-01-08T16:00:00Z'
}
]
@@ -144,8 +193,8 @@ export default {
case 1: return 'status-pending'
case 2: return 'status-accepted'
case 3: return 'status-picking'
case 4: return 'status-picked'
case 5: return 'status-delivering' // 这里我们用 '已完成' 的样式
case 4: return 'status-picked' // 已取货
case 5: return 'status-delivered' // 已送达
default: return 'status-default'
}
},
@@ -163,9 +212,9 @@ export default {
},
// 查看订单详情
viewOrderDetail(orderId: string) {
viewOrderDetail(orderId: string, status: number) {
uni.navigateTo({
url: `/pages/mall/delivery/order-detail?id=${orderId}`
url: `/pages/mall/delivery/order-detail?id=${orderId}&status=${status}`
})
},
@@ -298,12 +347,12 @@ export default {
color: #F57C00;
}
.status-picked {
.status-picked {
background-color: #E8F5E8;
color: #388E3C;
}
.status-delivering {
.status-delivered {
background-color: #E8F5E8;
color: #388E3C;
}