添加新页面
This commit is contained in:
@@ -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;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
Reference in New Issue
Block a user