From dd8e9f9168074963cf7df13d26d48457244b41bf Mon Sep 17 00:00:00 2001 From: wangxiaowei <1121133807@qq.com> Date: Fri, 2 Jan 2026 03:10:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E8=AE=A2=E5=8D=95=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/tes-specialist.ts | 22 +++++ src/hooks/useOrder.ts | 21 +++- src/pages/order/detail.vue | 134 +++++++++++++++++--------- src/pages/order/order-detail.vue | 1 - src/pages/order/order.vue | 158 ++++++++++++------------------- 5 files changed, 187 insertions(+), 149 deletions(-) diff --git a/src/api/tes-specialist.ts b/src/api/tes-specialist.ts index afde92c..46a002a 100644 --- a/src/api/tes-specialist.ts +++ b/src/api/tes-specialist.ts @@ -78,4 +78,26 @@ export function acceptTeaSpecialistOrder(id: number) { */ export function departTeaSpecialistOrder(id: number) { return http.Post('/teamapi/order/orderDepart', { id }) +} + +/** + * 茶艺师已到达 + * @param id 订单ID + */ +export interface ArriveTeaSpecialistOrderParams { + id: number + longitude: number + latitude: number +} +export function arriveTeaSpecialistOrder(data: ArriveTeaSpecialistOrderParams) { + return http.Post('/teamapi/order/orderArrive', data) +} + +/** + * 茶艺师打卡 + * @param id 订单ID + * @param img 图片(/teamapi/order/orderImage.png) + */ +export function checkInTeaSpecialistOrder(id: number, img: string) { + return http.Post('/teamapi/order/orderImage', { id, img }) } \ No newline at end of file diff --git a/src/hooks/useOrder.ts b/src/hooks/useOrder.ts index cca8249..a6018cc 100644 --- a/src/hooks/useOrder.ts +++ b/src/hooks/useOrder.ts @@ -1,10 +1,12 @@ import { router } from '@/utils/tools' -import { acceptTeaSpecialistOrder } from '@/api/tes-specialist' +import { acceptTeaSpecialistOrder, departTeaSpecialistOrder, arriveTeaSpecialistOrder } from '@/api/tes-specialist' +import { l } from 'vite/dist/node/types.d-aGj9QkWt' /** * 茶艺师接单 * @param id 订单ID + * @param type 来源于订单详情页还是订单列表页 */ export async function handleReleaseOrderHooks(id: number) { try { @@ -21,10 +23,23 @@ export async function handleReleaseOrderHooks(id: number) { */ export async function handleDepartOrderHooks(id: number) { try { - await acceptTeaSpecialistOrder(id) + await departTeaSpecialistOrder(id) return true } catch (error) { return false } -} \ No newline at end of file +} + +/** + * 茶艺师已到达 + */ +export async function handleArriveOrderHooks(data: {id: number, longitude: number, latitude: number}) { + try { + await arriveTeaSpecialistOrder(data) + return true + } + catch (error) { + return false + } +} diff --git a/src/pages/order/detail.vue b/src/pages/order/detail.vue index 3b4b9c2..a2fd902 100644 --- a/src/pages/order/detail.vue +++ b/src/pages/order/detail.vue @@ -42,15 +42,27 @@ - - - + + + + + + + + + @@ -254,7 +266,7 @@ 预约时长: - {{ order.hours }} + {{ order.hours }}小时 @@ -284,7 +296,7 @@ 续单时长 - {{ order.renew_hours || 0 }}/小时 + {{ order.renew_hours || 0 }}小时 续单金额 @@ -378,9 +390,9 @@ 订单编号 - - {{ order.order_sn }} - |复制 + + {{ order.order_sn }} + | 复制 @@ -405,7 +417,7 @@ @@ -415,7 +427,7 @@ @@ -440,13 +452,15 @@