From 93402088cdaec9dd81d1b17f9f9a55aec1a1c04d Mon Sep 17 00:00:00 2001 From: zhang zhuo Date: Thu, 6 Mar 2025 21:20:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/ticket.ts | 2 +- pagesA/task_hall/detail.vue | 76 +++++++++++++++++++++++++++---------- pagesA/task_hall/list.vue | 8 ++++ 3 files changed, 65 insertions(+), 21 deletions(-) diff --git a/api/ticket.ts b/api/ticket.ts index 5c8c703..ea3ef0c 100644 --- a/api/ticket.ts +++ b/api/ticket.ts @@ -1,5 +1,5 @@ import { get, post, put, del } from '../utils/request'; export const ticketPoolList = (data : any = {}) => get('v1/ticket/pool/list', data); - +export const ticketPoolInfo = (data : any = {}) => get('v1/ticket/pool/info', data); // export const bannerList = (data : any = {}) => get('v2/banner/list', data); \ No newline at end of file diff --git a/pagesA/task_hall/detail.vue b/pagesA/task_hall/detail.vue index cda95ca..9dad4ad 100644 --- a/pagesA/task_hall/detail.vue +++ b/pagesA/task_hall/detail.vue @@ -22,14 +22,14 @@ - JD2424234324325 + {{ticketInfo.ticket_no}} - 创建时间: 2025-07-09 + 创建时间: {{ticketInfo.create_time}} - {{getStatusText(1)}} + :style="{ color: getStatusColor(ticketInfo.status), backgroundColor: getStatusBgColor(ticketInfo.status) }"> + {{getStatusText(ticketInfo.status)}} @@ -37,7 +37,7 @@ - {{getStatusText(1)}} + {{getStatusText(ticketInfo.status)}} 工单待处理,点击按钮确认接单 @@ -48,7 +48,7 @@ 业主姓名 - 邓大仙儿 + {{ticketInfo.order.name}} 联系方式 @@ -58,19 +58,41 @@ - 177****4485 + {{ticketInfo.order.mobile}} - + + 上门地址 + {{ticketInfo.order.region_name}}{{ticketInfo.order.cell_name}}{{ticketInfo.order.house_name}}{{ticketInfo.order.address}} + + + 预约时间 + {{ticketInfo.order.appoint_date}} {{ticketInfo.order.appoint_time}} + + + 建筑面积 + {{ticketInfo.order.building_area}} + + + 订单状态 + 已提交 + 已完成 + 已取消 + + + 上传照片 + {{ticketInfo.order.images}} + + 配送地址 中金北区17号楼一单元201室号 - + 商品备注 放在门口即可 - + 商品信息 燕京 8度U8 500ML*12瓶/箱*2 送燕京9度菊花听500ML*12听 @@ -88,6 +110,10 @@ + + 订单备注 + {{ticketInfo.order.remark}} + @@ -100,6 +126,7 @@ import { ref } from 'vue' import { onLoad } from '@dcloudio/uni-app' import { useNavigation } from '@/hooks/useNavigation' + import {ticketPoolInfo} from '@/api/ticket' // 使用导航 composable const { hasMultiplePages, // 是否有多个页面在路由栈中 @@ -113,10 +140,10 @@ // 状态颜色配置 const getStatusColor = (status : number) => { const colorMap = { - 1: '#ff9d00', // 待配送 + 0: '#ff9d00', // 待配送 + 1: '#37A5FF', // 未入库 2: '#00b42a', // 已完成 - 3: '#37A5FF', // 未入库 - 4: '#F42429' // 已取消 + 3: '#F42429' // 已取消 } return colorMap[status] || '#666666' } @@ -124,10 +151,10 @@ // 状态背景色配置 const getStatusBgColor = (status : number) => { const bgColorMap = { - 1: '#fff6e9', // 待配送 + 0: '#fff6e9', // 待配送 + 1: '#e8f4ff', // 未入库 2: '#e8ffea', // 已完成 - 3: '#e8f4ff', // 未入库 - 4: '#ffe8e8' // 已取消 + 3: '#ffe8e8' // 已取消 } return bgColorMap[status] || '#f5f5f5' } @@ -135,15 +162,15 @@ // 状态文字配置 const getStatusText = (status : number) => { const textMap = { - 1: '待配送', + 0: '待接单', + 1: '已派单', 2: '已完成', - 3: '未入库', - 4: '已取消' + 3: '已取消' } return textMap[status] || '未知状态' } - + var ticketInfo = ref() const toPages = (item : any) => { console.log(item); @@ -167,6 +194,15 @@ const handleAction = (action : string) => { console.log(action); } + + onLoad((q)=>{ + loadInfo(q.ticket_id) + }) + + const loadInfo = async (ticket_id: any) => { + const res = await ticketPoolInfo({ticket_id: ticket_id}) + ticketInfo.value = res.data + }