From b1c845d571511c18f81818fce0da391faa0b5315 Mon Sep 17 00:00:00 2001
From: not-like-juvenile <16056107+not-like-juvenile@user.noreply.gitee.com>
Date: Fri, 23 Jan 2026 17:13:39 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages.json | 35 ++
pages/mall/delivery/index.uvue | 37 +-
pages/mall/delivery/order-history.uvue | 637 ++++++++++---------------
pages/mall/delivery/profile-edit.uvue | 439 +++++++++++++++++
pages/mall/delivery/profile.uvue | 250 ++++------
pages/mall/delivery/ratings.uvue | 202 ++++++++
pages/mall/delivery/task-detail.uvue | 480 +++++++++++++++++++
pages/mall/delivery/tasks.uvue | 433 +++++++++++++++++
pages/mall/delivery/vehicle.uvue | 273 +++++++++++
9 files changed, 2229 insertions(+), 557 deletions(-)
create mode 100644 pages/mall/delivery/profile-edit.uvue
create mode 100644 pages/mall/delivery/ratings.uvue
create mode 100644 pages/mall/delivery/task-detail.uvue
create mode 100644 pages/mall/delivery/tasks.uvue
create mode 100644 pages/mall/delivery/vehicle.uvue
diff --git a/pages.json b/pages.json
index 605e1945..97b986cd 100644
--- a/pages.json
+++ b/pages.json
@@ -91,6 +91,41 @@
"navigationStyle": "custom"
}
},
+ {
+ "path": "pages/mall/delivery/tasks",
+ "style": {
+ "navigationBarTitleText": "全部任务",
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/mall/delivery/task-detail",
+ "style": {
+ "navigationBarTitleText": "任务详情",
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/mall/delivery/profile-edit",
+ "style": {
+ "navigationBarTitleText": "编辑个人资料",
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/mall/delivery/ratings",
+ "style": {
+ "navigationBarTitleText": "评价",
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/mall/delivery/vehicle",
+ "style": {
+ "navigationBarTitleText": "车辆管理",
+ "navigationStyle": "custom"
+ }
+ },
{
"path": "pages/mall/delivery/settings",
"style": {
diff --git a/pages/mall/delivery/index.uvue b/pages/mall/delivery/index.uvue
index 1883070e..e3de0549 100644
--- a/pages/mall/delivery/index.uvue
+++ b/pages/mall/delivery/index.uvue
@@ -208,7 +208,7 @@
export default {
data() {
return {
- isOnline: false,
+ isOnline: true,
driverInfo: {
id: '',
@@ -429,6 +429,9 @@
// 任务操作方法
acceptTask() {
// TODO: 调用API接受任务
+ if (this.currentTask) {
+ this.currentTask.status = 2 // 更新状态为“已接取”
+ }
uni.showToast({
title: '任务已接受',
icon: 'success'
@@ -437,6 +440,9 @@
startPickup() {
// TODO: 调用API开始取货
+ if (this.currentTask) {
+ this.currentTask.status = 3 // 更新状态为“取货中”
+ }
uni.showToast({
title: '开始取货',
icon: 'success'
@@ -445,6 +451,9 @@
confirmPickup() {
// TODO: 调用API确认取货
+ if (this.currentTask) {
+ this.currentTask.status = 4 // 更新状态为“已取货”
+ }
uni.showToast({
title: '取货完成',
icon: 'success'
@@ -453,6 +462,9 @@
startDelivery() {
// TODO: 调用API开始配送
+ if (this.currentTask) {
+ this.currentTask.status = 5 // 更新状态为“配送中”
+ }
uni.showToast({
title: '开始配送',
icon: 'success'
@@ -460,13 +472,20 @@
},
confirmDelivery() {
- // TODO: 调用API确认送达
- uni.showToast({
- title: '配送完成',
- icon: 'success'
- })
- this.currentTask = null
- this.loadAvailableOrders()
+ // TODO: 调用API确认送达
+ if (this.currentTask) {
+ // 1. 假设将订单状态更新为“已完成” (假设5表示已完成)
+ this.currentTask.status = 5;
+ // 2. 将已完成的任务保存到本地存储,以便历史订单页面可以读取
+ const completedOrder = {...this.currentTask}; // 创建副本,避免引用问题
+ uni.setStorageSync('completed_order_for_history', completedOrder);
+ }
+ uni.showToast({
+ title: '配送完成',
+ icon: 'success'
+ })
+ this.currentTask = null
+ this.loadAvailableOrders()
},
contactCustomer() {
@@ -1008,4 +1027,4 @@
text-align: center;
font-weight: 500;
}
-
+
\ No newline at end of file
diff --git a/pages/mall/delivery/order-history.uvue b/pages/mall/delivery/order-history.uvue
index b7740adb..f069b122 100644
--- a/pages/mall/delivery/order-history.uvue
+++ b/pages/mall/delivery/order-history.uvue
@@ -1,311 +1,172 @@
-
+
-
-
-
-
- ¥{{ totalEarnings }}
- 总收入
-
-
- ¥{{ totalUserTips }}
- 用户打赏
-
-
- ¥{{ totalMerchantTips }}
- 商家打赏
-
-
- {{ totalOrders }}
- 总订单数
-
-
-
+
-
-
-
-
-
- 订单收入:
- ¥{{ order.totalAmount.toFixed(2) }}
+
+
+
+
-
-
-
- 订单号: {{ order.order_no }}
- 时间: {{ formatTime(order.date) }}
- 距离: {{ order.distance }}km
-
-
-
-
-
- {{ getSourceText(detail.source) }}
- +¥{{ detail.amount.toFixed(2) }}
+
+
+
+ 📍
+
+ 取货地址
+ {{ order.pickup_address.detail }}
+ 联系人: {{ order.pickup_contact.name }} {{ order.pickup_contact.phone }}
+
+
+
+
+
+ 🏠
+
+ 收货地址
+ {{ order.delivery_address.detail }}
+ 联系人: {{ order.delivery_contact.name }} {{ order.delivery_contact.phone }}
+
+
+
+
+
+ 配送费: ¥{{ order.delivery_fee }}
+ 预计距离: {{ order.distance }}km
+ 预计时间: {{ order.estimated_time }}分钟
+
+
+
+
-
+
- 暂无收入记录
-
-
-
-
-
+ 暂无历史订单
-
\ No newline at end of file
diff --git a/pages/mall/delivery/profile.uvue b/pages/mall/delivery/profile.uvue
index 1fd1882c..05e07c0b 100644
--- a/pages/mall/delivery/profile.uvue
+++ b/pages/mall/delivery/profile.uvue
@@ -1,8 +1,13 @@
-
+