继续完善居家服务模块
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user