继续完善居家服务模块

This commit is contained in:
2026-05-22 10:16:51 +08:00
parent 3a7b2808af
commit d25f80ccdd
10 changed files with 670 additions and 110 deletions

View File

@@ -43,15 +43,10 @@ import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uv
import type { DeliveryOrderStatus, DeliveryOrderType } from '@/types/delivery.uts'
import {
acceptServiceOrder,
checkInServiceOrder,
completeServiceOrder,
getHistoryServiceOrders,
getPendingServiceOrders,
getTodayServiceOrders,
markArrived,
markDeparted,
rejectServiceOrder,
startServiceOrder
rejectServiceOrder
} from '@/services/deliveryService.uts'
import { getDeliveryOrderTabs, getPrimaryActionText } from '@/utils/deliveryCareUi.uts'
import { requireDeliveryAuth } from '@/utils/deliveryAuth.uts'
@@ -137,27 +132,15 @@ async function handleAction(orderId: string, status: DeliveryOrderStatus) {
return
}
if (status == 'accepted' || status == 'waiting_departure') {
await markDeparted(orderId)
uni.showToast({ title: '已标记出发', icon: 'success' })
loadData()
uni.navigateTo({ url: '/pages/mall/delivery/orders/route?id=' + orderId })
return
}
if (status == 'departed' || status == 'on_the_way') {
await markArrived(orderId)
uni.showToast({ title: '已标记到达', icon: 'success' })
loadData()
uni.navigateTo({ url: '/pages/mall/delivery/orders/route?id=' + orderId })
return
}
if (status == 'arrived') {
await checkInServiceOrder(orderId, '已到达并签到', null)
uni.showToast({ title: '签到成功', icon: 'success' })
loadData()
return
}
if (status == 'checked_in') {
await startServiceOrder(orderId)
uni.showToast({ title: '已开始服务', icon: 'success' })
loadData()
uni.navigateTo({ url: '/pages/mall/delivery/orders/checkin?id=' + orderId })
return
}
if (status == 'in_service' || status == 'serving' || status == 'completed') {
@@ -165,13 +148,7 @@ async function handleAction(orderId: string, status: DeliveryOrderStatus) {
return
}
if (status == 'pending_confirm' || status == 'pending_acceptance' || status == 'pending_submit') {
const result = await completeServiceOrder(orderId)
if (result == null) {
uni.showToast({ title: '请先填写服务记录', icon: 'none' })
return
}
uni.showToast({ title: '服务已完成', icon: 'success' })
loadData()
uni.showToast({ title: '已完成服务,等待用户验收', icon: 'none' })
return
}
goDetail(orderId)