继续完善居家服务模块

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

@@ -92,15 +92,10 @@ import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uv
import type { DeliveryOrderType } from '@/types/delivery.uts'
import {
acceptServiceOrder,
checkInServiceOrder,
completeServiceOrder,
getServiceOrderDetail,
markArrived,
markDeparted,
rejectServiceOrder,
startServiceOrder
rejectServiceOrder
} from '@/services/deliveryService.uts'
import { getNextStepText, getPrimaryActionText, needsServiceRecord } from '@/utils/deliveryCareUi.uts'
import { getNextStepText, getPrimaryActionText } from '@/utils/deliveryCareUi.uts'
import { requireDeliveryAuth } from '@/utils/deliveryAuth.uts'
import { getDeliveryRouteParam } from '@/utils/deliveryRoute.uts'
@@ -129,7 +124,10 @@ function makePhoneCall(phone: string) {
}
function mockNavigate() {
uni.showToast({ title: '导航为 mock 占位', icon: 'none' })
if (order.value == null) {
return
}
uni.navigateTo({ url: '/pages/mall/delivery/orders/route?id=' + order.value!.id })
}
function goException() {
@@ -164,27 +162,15 @@ async function handlePrimary() {
return
}
if (status == 'accepted' || status == 'waiting_departure') {
await markDeparted(orderId.value)
uni.showToast({ title: '已出发', icon: 'success' })
loadData()
uni.navigateTo({ url: '/pages/mall/delivery/orders/route?id=' + orderId.value })
return
}
if (status == 'departed' || status == 'on_the_way') {
await markArrived(orderId.value)
uni.showToast({ title: '已到达', icon: 'success' })
loadData()
uni.navigateTo({ url: '/pages/mall/delivery/orders/route?id=' + orderId.value })
return
}
if (status == 'arrived') {
await checkInServiceOrder(orderId.value, '详情页签到', null)
uni.showToast({ title: '签到成功', icon: 'success' })
loadData()
return
}
if (status == 'checked_in') {
await startServiceOrder(orderId.value)
uni.showToast({ title: '开始服务', icon: 'success' })
loadData()
uni.navigateTo({ url: '/pages/mall/delivery/orders/checkin?id=' + orderId.value })
return
}
if (status == 'in_service' || status == 'serving' || status == 'completed') {
@@ -192,14 +178,7 @@ async function handlePrimary() {
return
}
if (status == 'pending_confirm' || status == 'pending_acceptance' || status == 'pending_submit') {
if (needsServiceRecord(order.value)) {
uni.showToast({ title: '请先填写服务记录', icon: 'none' })
goRecord()
return
}
await completeServiceOrder(orderId.value)
uni.showToast({ title: '服务已完成', icon: 'success' })
loadData()
uni.showToast({ title: '已完成服务,等待用户验收', icon: 'none' })
return
}
if (status == 'abnormal' || status == 'exception_pending') {