From 58f59f1ee5f6aef369238474d163ff54030e9790 Mon Sep 17 00:00:00 2001 From: wangxiaowei <1121133807@qq.com> Date: Fri, 2 Jan 2026 16:22:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E8=AE=A2=E5=8D=95=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=92=8C=E6=B5=81=E6=B0=B4=E6=98=8E=E7=BB=86=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- env/.env | 2 - src/api/tes-specialist.ts | 25 ++++ src/api/user.ts | 6 +- src/bundle/wallet/wallet.vue | 49 +++++-- src/hooks/useOrder.ts | 53 +++++++- src/pages/index/index.vue | 136 +++++++++----------- src/pages/order/detail.vue | 239 +++++++++++++++++++++-------------- src/pages/order/order.vue | 29 +++-- 8 files changed, 336 insertions(+), 203 deletions(-) diff --git a/env/.env b/env/.env index 9ec4814..a4c92cd 100644 --- a/env/.env +++ b/env/.env @@ -12,8 +12,6 @@ VITE_LOGIN_URL = '/pages/login/login' # 第一个请求地址 VITE_SERVER_BASEURL = 'https://cz.stnav.com' -VITE_UPLOAD_BASEURL = 'https://cz.stnav.com/upload' - # h5是否需要配置代理 VITE_APP_PROXY=true VITE_APP_PROXY_PREFIX = '/storeapi' diff --git a/src/api/tes-specialist.ts b/src/api/tes-specialist.ts index 46a002a..9431803 100644 --- a/src/api/tes-specialist.ts +++ b/src/api/tes-specialist.ts @@ -50,6 +50,7 @@ export interface TeaSpecialistOrderListParams { size: number order_status?: string search?: string + day_time?: string } export function getTeaSpecialistOrderList(data: TeaSpecialistOrderListParams) { @@ -100,4 +101,28 @@ export function arriveTeaSpecialistOrder(data: ArriveTeaSpecialistOrderParams) { */ export function checkInTeaSpecialistOrder(id: number, img: string) { return http.Post('/teamapi/order/orderImage', { id, img }) +} + +/** + * 茶艺师完成订单 + * @param id 订单ID + */ +export function completeTeaSpecialistOrder(id: number) { + return http.Post('/teamapi/order/orderFinish', { id }) +} + +/** + * 茶艺师删除订单 + * @param id 订单ID + */ +export function deleteTeaSpecialistOrder(id: number) { + return http.Post('/teamapi/order/orderDel', { id }) +} + +/** + * 费用明细 + * @param id 订单ID + */ +export function getTeaSpecialistCostDetails(id: number) { + return http.Post('/teamapi/order/amountDetails', {id}) } \ No newline at end of file diff --git a/src/api/user.ts b/src/api/user.ts index 96946fc..6024486 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -45,18 +45,18 @@ export function getUserInfo() { export interface IGetUserTransactionDetailsParams { page: number size: number - end_time: string + times: string } export function getUserTransactionDetails(data: IGetUserTransactionDetailsParams) { - return http.Post('/storeapi/user/balanceLogList', data) + return http.Post('/teamapi/user/checkAccountList', data) } /** * 获取流水明细详情(账单明细) */ export function getUserTransactionDetailsInfo(id: number) { - return http.Post('/storeapi/user/balanceLogDetails', { id }) + return http.Post('/teamapi/user/balanceLogDetails', { id }) } /** diff --git a/src/bundle/wallet/wallet.vue b/src/bundle/wallet/wallet.vue index 667967f..14392f4 100644 --- a/src/bundle/wallet/wallet.vue +++ b/src/bundle/wallet/wallet.vue @@ -36,7 +36,7 @@ - 不可提现金额200 + 不可提现金额{{ userInfo.no_reflect_amount }} @@ -44,7 +44,7 @@ 可提现金额 - + 提现 @@ -54,10 +54,10 @@ - + - 提现明细 + 流水明细 @@ -101,7 +101,7 @@ - {{ item.change_type == 3 ? '-' : '+' }} + {{ item.action === 2 ? '-' : '+' }} @@ -135,6 +135,20 @@ // 消息提示框 const message = useMessage('wd-message-box-slot') + // 用户信息 + const userInfo = ref({ + avatar: '', + nickname: '', + account: '', + user_money: 0, + no_reflect_amount: 0, + work: '', + address: '', + work_time: '', + is_mileage: 0, + cert_id: 0, + }) + /* mescroll */ const { mescrollInit, downCallback, getMescroll } = useMescroll(onPageScroll, onReachBottom) // 调用mescroll的hook const downOption = { @@ -149,7 +163,7 @@ const selectTime = ref('') onShow(() => { - + Wallet.handleGetUserInfo() }) const Wallet = { @@ -161,7 +175,7 @@ const filter = { page: mescroll.num, size: mescroll.size, - end_time: selectTime.value + times: selectTime.value } getUserTransactionDetails(filter).then((res) => { @@ -174,6 +188,14 @@ }) }, + /** + * 获取个人信息 + */ + handleGetUserInfo: async () => { + const res = await getUserInfo() + userInfo.value = res + }, + /** * 日期筛选 * @param date @@ -209,7 +231,7 @@ * @param id */ handleToBillDetail: (item: {id: number, change_type: number}) => { - // change_type: 1包间预定 2包间续订 3提现 4团购核销 + // change_type: 1.预定2.续时3.续茶4.退款5.提现 if (item.change_type === 3) { router.navigateTo(`/bundle/parten/pages/withdraw/progress?id=${item.id}`) return @@ -224,10 +246,11 @@ */ handleMapTransactionType: (type: number) => { const typeMap: Record = { - 1: '包间预定', - 2: '包间续费', - 3: '提现', - 4: '团购核销' + 1: '茶艺师预约', + 2: '加钟续费', + 3: '续茶', + 4: '退款', + 5: '提现' } return typeMap[type] || '其他' }, @@ -238,7 +261,7 @@ handleShowPrompt: () => { message.alert({ title: '温馨提示', - msg: '为保障您与平台的合作权益,我们将暂扣200元作为合作押金,感谢您的理解与支持。', + msg: `为保障您与平台的合作权益,我们将暂扣${userInfo.value.no_reflect_amount}作为合作押金,感谢您的理解与支持。`, confirmButtonText: '我知道了', confirmButtonProps: { customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx', diff --git a/src/hooks/useOrder.ts b/src/hooks/useOrder.ts index a6018cc..f923538 100644 --- a/src/hooks/useOrder.ts +++ b/src/hooks/useOrder.ts @@ -1,5 +1,11 @@ import { router } from '@/utils/tools' -import { acceptTeaSpecialistOrder, departTeaSpecialistOrder, arriveTeaSpecialistOrder } from '@/api/tes-specialist' +import { + acceptTeaSpecialistOrder, + departTeaSpecialistOrder, + arriveTeaSpecialistOrder, + checkInTeaSpecialistOrder, + completeTeaSpecialistOrder, + deleteTeaSpecialistOrder } from '@/api/tes-specialist' import { l } from 'vite/dist/node/types.d-aGj9QkWt' @@ -20,6 +26,7 @@ export async function handleReleaseOrderHooks(id: number) { /** * 茶艺师出发 + * @param id 订单ID */ export async function handleDepartOrderHooks(id: number) { try { @@ -33,6 +40,7 @@ export async function handleDepartOrderHooks(id: number) { /** * 茶艺师已到达 + * @param data 订单ID和经纬度等参数 */ export async function handleArriveOrderHooks(data: {id: number, longitude: number, latitude: number}) { try { @@ -43,3 +51,46 @@ export async function handleArriveOrderHooks(data: {id: number, longitude: numbe return false } } + +/** + * 茶艺师打卡 + * @param id 订单ID + * @param img 图片 + */ +export async function handleTeaSpecialistClockInHooks(id: number, img: string) { + try { + await checkInTeaSpecialistOrder(id, img) + return true + } + catch (error) { + return false + } +} + +/** + * 完成订单 + * @param id 订单ID + */ +export async function handleCompleteOrderHooks(id: number) { + try { + await completeTeaSpecialistOrder(id) + return true + } + catch (error) { + return false + } +} + +/** + * 删除订单 + * @param id 订单ID + */ +export async function handleDeleteOrderHooks(id: number) { + try { + await deleteTeaSpecialistOrder(id) + return true + } + catch (error) { + return false + } +} \ No newline at end of file diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 65e303b..cf7526c 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -89,6 +89,7 @@ 今日行程 + 查看更多 @@ -103,46 +104,39 @@ class="schedule-item-wrapper"> 预约单 - {{ order.status || '待服务' }} + {{ TeaSpecialistManageStatusTextValue[order.order_status].title }} - + - {{ formatDate(order.date, 'day') }} - {{ formatDate(order.date, 'month') }}月 + {{ day }} + {{ month }}月 - {{ order.location || order.store_name - }} + {{ order.title }} - {{ order.service_type || '到店服务' - }} + {{ order.server_type == 1 ? '到店服务' : '上门服务'}} - {{ order.start_time }}-{{ order.end_time - }} + {{ order.start_time }}-{{ order.end_time }} - {{ order.address || order.store_address - }} + {{ order.address }} - + - @@ -158,8 +152,8 @@