增加展示选择
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
<button class="secondary-btn" @click="getCurrentLocation">获取当前位置</button>
|
||||
<button class="primary-btn" :disabled="submitting" @click="startDepartAction">{{ submitting ? '处理中...' : '点击出发' }}</button>
|
||||
<button class="secondary-btn" @click="openMap">打开地图导航</button>
|
||||
<button class="primary-btn" :disabled="submitting" @click="arriveAction">标记到达</button>
|
||||
<button class="primary-btn" :disabled="submitting" @click="goToCheckin">标记到达签到</button>
|
||||
</view>
|
||||
</ServicePanel>
|
||||
</ServicePageScaffold>
|
||||
@@ -22,7 +22,7 @@ import { onLoad } from '@dcloudio/uni-app'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import ServicePanel from '@/components/homeService/ServicePanel.uvue'
|
||||
import type { DeliveryLocationType, DeliveryOrderType } from '@/types/delivery.uts'
|
||||
import { arriveOrder, getDeliveryOrderDetail, startDepart } from '@/services/deliveryService.uts'
|
||||
import { getDeliveryOrderDetail, startDepart } from '@/services/deliveryService.uts'
|
||||
import { requireDeliveryAuth } from '@/utils/deliveryAuth.uts'
|
||||
import { getDeliveryRouteParam } from '@/utils/deliveryRoute.uts'
|
||||
import { formatDateTime } from '@/utils/utils.uts'
|
||||
@@ -87,22 +87,20 @@ async function startDepartAction() {
|
||||
}
|
||||
}
|
||||
|
||||
async function arriveAction() {
|
||||
/**
|
||||
* 跳转到签到页面
|
||||
* 不再直接调用 arriveOrder RPC,而是进入签到页面执行距离预校验、拍照上传、正式签到
|
||||
*/
|
||||
function goToCheckin() {
|
||||
if (submitting.value) return
|
||||
|
||||
// 先获取当前位置(签到页面会再次获取)
|
||||
if (currentLocation.value == null) {
|
||||
await getCurrentLocation()
|
||||
if (currentLocation.value == null) {
|
||||
return
|
||||
}
|
||||
}
|
||||
submitting.value = true
|
||||
try {
|
||||
await arriveOrder(orderId.value, currentLocation.value as DeliveryLocationType)
|
||||
uni.showToast({ title: '已标记到达', icon: 'success' })
|
||||
uni.navigateTo({ url: '/pages/mall/delivery/orders/checkin?id=' + orderId.value })
|
||||
} finally {
|
||||
submitting.value = false
|
||||
getCurrentLocation()
|
||||
}
|
||||
|
||||
// 直接跳转到签到页面
|
||||
uni.navigateTo({ url: '/pages/mall/delivery/orders/checkin?id=' + orderId.value })
|
||||
}
|
||||
|
||||
function openMap() {
|
||||
|
||||
Reference in New Issue
Block a user