From ac8212c8f0db1b039623cd8477e95f79818af911 Mon Sep 17 00:00:00 2001 From: wangxiaowei <1121133807@qq.com> Date: Mon, 3 Nov 2025 18:36:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/order.ts | 42 ++++ src/api/tea.ts | 101 ++++++++- src/api/types/order.ts | 17 ++ src/api/types/tea.ts | 32 +++ src/bundle/coupon/coupon.vue | 4 +- .../order/tea-specialist/order-detail.vue | 130 +++++++----- .../order/tea-specialist/order-list.vue | 133 ++++++------ src/components/BookingTime.vue | 36 +--- src/components/order/ComboCard.vue | 79 ++++--- src/hooks/useOrder.ts | 13 ++ src/hooks/useWeiXin.ts | 2 +- src/pages/cashier/cashier.vue | 127 +++++++++--- src/pages/index/detail.vue | 25 ++- src/pages/index/index.vue | 70 +++++-- src/pages/my/my.vue | 9 +- src/pages/reserve/group-tea-specialist.vue | 120 ++++++++--- src/pages/reserve/tea-room.vue | 195 +++++++++++------- src/utils/order.ts | 56 ++++- src/utils/pay.ts | 6 + 19 files changed, 845 insertions(+), 352 deletions(-) create mode 100644 src/api/order.ts create mode 100644 src/api/types/order.ts create mode 100644 src/hooks/useOrder.ts diff --git a/src/api/order.ts b/src/api/order.ts new file mode 100644 index 0000000..92a0898 --- /dev/null +++ b/src/api/order.ts @@ -0,0 +1,42 @@ +import { http } from '@/http/alova' +import type { IOrderListResult, IOrderDetailsResult } from '@/api/types/order' + +/** + * 获取订单列表 + */ +export interface ITeaSpecialistOrderListParams { + page: number + size: number + order_status: string + search: string +} + +export function getTeaSpecialistOrderList(data: ITeaSpecialistOrderListParams) { + return http.Post('/api/order/orderList', + data + ) +} + +/** + * 获取订单详情 + */ +export interface ITeaSpecialistOrderDetailsParams { + id: number +} +export function getTeaSpecialistOrderDetails(data: ITeaSpecialistOrderDetailsParams) { + return http.Post('/api/order/orderDetails', + data + ) +} + +/** + * 取消订单 + */ +export interface ICancelTeaSpecialistOrderParams { + id: number +} +export function cancelTeaSpecialistOrder(data: ICancelTeaSpecialistOrderParams) { + return http.Post('/api/order/cancelOrder', + data + ) +} \ No newline at end of file diff --git a/src/api/tea.ts b/src/api/tea.ts index 920960f..03ec21e 100644 --- a/src/api/tea.ts +++ b/src/api/tea.ts @@ -1,5 +1,12 @@ import { http } from '@/http/alova' -import type { ITeaSpecialistDetailsResult, ITeaSpecialistFuture7DaysResult, ITeaTypeListResult, ICollectTeaSpecialistResult } from '@/api/types/tea' +import type { + ITeaSpecialistDetailsResult, + ITeaSpecialistFuture7DaysResult, + ITeaTypeListResult, + ICollectTeaSpecialistResult, + ICreateTeaSpecialistOrderResult, + ITeaSpecialistOrderDetailsResult, + ITeaSpecialistPrepayResult } from '@/api/types/tea' /** * 获取茶艺师详情 @@ -44,7 +51,6 @@ export function getTeaSpecialistRewardAmounts() { /** * 获取门店地址 */ - export interface ITeaHouseListParams { page: number size: number @@ -84,3 +90,94 @@ export interface IGetCollectTeaSpecialistParams { export function getCollect(data: IGetCollectTeaSpecialistParams) { return http.Post('/api/Teamaster/teamasterCollectList', data) } + +/** + * 茶艺师邀约 + */ +export interface ITeaSpecialistInviteParams { + id: number +} + +export function teaSpecialistInvite(data: ITeaSpecialistInviteParams) { + return http.Post('/api/Teamaster/invitation', data) +} + +/** + * 创建预约茶艺师订单 + */ +export interface ICreateTeaSpecialistOrderParams { + teamaster_id: number + address_id: number + start_time: number + end_time: number + nums: number + tea_id: string + service_type: number + store_id: number + latitude: number + longitude: number + remark: string + coupon_id: number + hours: number +} + +export function createTeaSpecialistOrder(data: ICreateTeaSpecialistOrderParams) { + return http.Post('/api/order/submitOrder', data) +} + +/*** + * 获取订单详情 + */ +export interface IGetTeaSpecialistOrderDetailsParams { + id: number +} + +export function getTeaSpecialistOrderDetails(data: IGetTeaSpecialistOrderDetailsParams) { + return http.Post('/api/order/orderDetails', data) +} + +/** + * 预支付 + */ +export interface ITeaSpecialistPrepayParams { + order_id: number + from: string + pay_way: number + order_source: number +} + +export function teaSpecialistPrepay(data: ITeaSpecialistPrepayParams) { + return http.Post('/api/pay/prepay', data) +} + +/** + * 支付接口 + */ +export interface ITeaSpecialistPayParams { + id: number +} + +export function teaSpecialistPay(data: ITeaSpecialistPayParams) { + return http.Post('/api/pay/yuePay', data) +} + +/** + * 团体预约 + */ +export interface ITeaSpecialistGroupReserveParams { + numbers: string + other_require: string + res_time: string + contact: string + phone: string + code: string + province: string + city: string + district: string + address: string + content: string +} + +export function teaSpecialistGroupReserve(data: ITeaSpecialistGroupReserveParams) { + return http.Post('/api/Teamaster/groupReservation', data) +} \ No newline at end of file diff --git a/src/api/types/order.ts b/src/api/types/order.ts new file mode 100644 index 0000000..15bd80d --- /dev/null +++ b/src/api/types/order.ts @@ -0,0 +1,17 @@ +/** + * 订单列表返回数据 + */ +export interface IOrderListResult { + count: number + list: Array + more: number + page: string + size: string +} + +/** + * 订单详情返回数据 + */ +export interface IOrderDetailsResult { + details: any +} \ No newline at end of file diff --git a/src/api/types/tea.ts b/src/api/types/tea.ts index e3532cc..f5325b4 100644 --- a/src/api/types/tea.ts +++ b/src/api/types/tea.ts @@ -9,6 +9,7 @@ export interface ITeaSpecialistDetailsResult { * 茶艺师详情字段 */ export interface ITeaSpecialistDetailsFields { + id: 0, name: string star: number image: string @@ -27,6 +28,7 @@ export interface ITeaSpecialistDetailsFields { price: number fare_price: number collect: number + up_status: number } /** @@ -78,4 +80,34 @@ export interface ICollectTeaSpecialistResult { more: Number page: string size: string +} + +/** + * 创建订单返回id + */ +export interface ICreateTeaSpecialistOrderResult { + id: number +} + +/** + * 订单详情返回结果 + */ +export interface ITeaSpecialistOrderDetailsResult { + details: { + order_amount: string + order_sn: string + } +} + +/** + * 预支付返回结果 + */ +export interface ITeaSpecialistPrepayResult { + pay_id: number +} + +/** + * 支付返回结果 + */ +export interface ITeaSpecialistPayResult { } \ No newline at end of file diff --git a/src/bundle/coupon/coupon.vue b/src/bundle/coupon/coupon.vue index df6f1a4..bcf9786 100644 --- a/src/bundle/coupon/coupon.vue +++ b/src/bundle/coupon/coupon.vue @@ -91,9 +91,9 @@ couponType.value = args.type } - if (args.id && args.time) { + if (args.id && args.numbers) { // 获取到茶艺师ID和预定了几个小时 - Coupons.handleInit(args.id, args.time) + Coupons.handleInit(args.id, args.numbers) } }) diff --git a/src/bundle/order/tea-specialist/order-detail.vue b/src/bundle/order/tea-specialist/order-detail.vue index d5863b0..9749d58 100644 --- a/src/bundle/order/tea-specialist/order-detail.vue +++ b/src/bundle/order/tea-specialist/order-detail.vue @@ -40,7 +40,7 @@ + @click="OrderDetail.handleToggleRenewTea(item.id)"> {{item.title}} {{item.price}} @@ -116,7 +116,7 @@ 取消 - 确定退款 + 确定退款 @@ -206,54 +206,53 @@ - - + - 使用过程中有任何问题,请联系客服 - + 使用过程中有任何问题,请联系客服 + 还剩 - + 订单自动取消 - 品一口香茗,让生活慢下来,从一杯好茶开始 - 您的服务已经结束,请及时确认订单 + 感谢您的选择,期待再续茶香! + 您的服务已经结束,请及时确认订单 - + - 茶艺师名称 + {{ order.teamaster.name }} - ¥324 + ¥{{ order.order_amount }} - ¥108/小时 - x3 + ¥{{ order.teamaster.price }}/小时 + x{{ order.hours }} - 车马费(¥3.00元/公里) - x3 + 车马费(¥{{ order.fare_price }}元/公里) + ¥{{ order.fare_distance_price }}/小时 - + 实付 - ¥29.32 + ¥{{ order.order_amount }} @@ -262,11 +261,11 @@ 预约信息 - 预约时间:2025-03-18 09:00-12:00 + 预约时间:{{ order.start_time }} - {{ order.end_time }} 预约时长:3小时 一键续订 @@ -275,7 +274,7 @@ - + 地图显示 信息没有更新,想问问茶艺师到哪里了? @@ -298,14 +297,14 @@ 服务方式 - 到店服务 + {{ order.service_type }} - + 服务门店 - 茶馆名称茶馆名称茶馆名称茶馆名称茶馆名称茶馆名称茶馆名称 + {{ order.store_address }} - {{ orderStatus === OrderStatus.Serving ? '门店地址' : '服务地址' }} + {{ orderStatus === TeaSpecialistOrderStatus.Serving ? '门店地址' : '服务地址' }} 青浦区仓桥路478号 @@ -313,7 +312,7 @@ - + @@ -322,7 +321,7 @@ - + - 可用202.22 + 可用202.22 @@ -350,22 +349,22 @@ 订单编号 - 7327328627526903 + {{ order.order_sn }} - 复制 + 复制 - + 交易方式 - 微信支付 + {{ PayValueText[order.pay_way] }} 创建时间 - 2019-05-16 12:20:26 + {{ order.dtime }} - + 付款时间 - 2019-05-16 13:20:26 + {{ order.update_dtime }} @@ -373,15 +372,15 @@ - - 再次预定 - 确认订单 + + 再次预定 + 确认订单 - + - 取消 + 取消 @@ -396,14 +395,14 @@ - + 申请退款 - 联系客服 + 联系客服 + v-if="orderStatus == TeaSpecialistOrderStatus.Finished || orderStatus == TeaSpecialistOrderStatus.Cancelled"> 再次预定 @@ -413,15 +412,16 @@ diff --git a/src/bundle/order/tea-specialist/order-list.vue b/src/bundle/order/tea-specialist/order-list.vue index 0779752..b819a39 100644 --- a/src/bundle/order/tea-specialist/order-list.vue +++ b/src/bundle/order/tea-specialist/order-list.vue @@ -8,25 +8,22 @@