From c464060d4587cae82ae8ce881ffda2385906f7f8 Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Tue, 15 Apr 2025 18:40:09 +0800 Subject: [PATCH] =?UTF-8?q?refactor(myOrdersManage):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=AE=A1=E7=90=86=E6=A8=A1=E5=9D=97=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 重构了订单管理模块的代码结构,主要包括: 1. 将订单状态字段从 `type` 改为 `orderStatus`,提高代码可读性 2. 优化了宠物档案、服务档案等页面的数据获取逻辑,统一使用订单相关 API 3. 调整了页面导航逻辑,确保订单 ID 正确传递 4. 新增了宠物服务档案的展示逻辑,支持动态渲染服务信息 这些改动旨在提高代码的可维护性和一致性,减少重复代码,并确保数据获取和展示的准确性。 --- api/order/order.js | 49 +++- otherPages/myOrdersManage/clock/index.vue | 29 ++- otherPages/myOrdersManage/service/PetCare.java | 306 ++++++++++++++++++++++++ otherPages/myOrdersManage/service/detail.scss | 9 +- otherPages/myOrdersManage/service/detail.vue | 89 ++++--- otherPages/myOrdersManage/service/index.vue | 22 +- otherPages/orderTakingManage/detail/index.vue | 15 +- otherPages/orderTakingManage/pet/detail.vue | 76 ++++-- otherPages/orderTakingManage/pet/index.vue | 40 ++-- pages/myOrdersManage/components/systemOrder.vue | 27 ++- pages/myOrdersManage/index.vue | 2 +- 11 files changed, 554 insertions(+), 110 deletions(-) create mode 100644 otherPages/myOrdersManage/service/PetCare.java diff --git a/api/order/order.js b/api/order/order.js index b9070e8..d6abe86 100644 --- a/api/order/order.js +++ b/api/order/order.js @@ -12,6 +12,53 @@ export function getAppOrderList() { }) } +// 获取订单列表 +export function orderItemLogGetByOrderId(orderId) { + return request({ + headers: { + "isToken": true + }, + url: "/applet/orderItemLog/getByOrderId/" + orderId, + method: 'get' + }) +} + +// 获取订单中的宠物列表 +export function getOrderPetById(orderId) { + return request({ + headers: { + "isToken": true + }, + url: "/applet/order/getOrderPetById/" + orderId, + method: 'get' + }) +} +// 获取订单的宠物详情 +export function getPetById(petId) { + return request({ + headers: { + "isToken": true + }, + url: "/applet/order/getPetById/" + petId, + method: 'get' + }) +} + +// 获取宠物id获取服务档案详情 +export function getPetCareByPetId(petId) { + return request({ + headers: { + "isToken": true + }, + url: "/applet/order/getPetCareByPetId/" + petId, + method: 'get' + }) +} + export default { - getAppOrderList + getAppOrderList, + orderItemLogGetByOrderId, + getOrderPetById, + getPetById, + getPetCareByPetId, } \ No newline at end of file diff --git a/otherPages/myOrdersManage/clock/index.vue b/otherPages/myOrdersManage/clock/index.vue index ec47d9a..d239c32 100644 --- a/otherPages/myOrdersManage/clock/index.vue +++ b/otherPages/myOrdersManage/clock/index.vue @@ -196,12 +196,24 @@ import { onMounted, reactive, - ref + ref, } from "vue"; + import { + onLoad + } from '@dcloudio/uni-app' import { ossUpload } from '@/utils/oss-upload/oss/index.js' + + import { orderItemLogGetByOrderId } from '@/api/order/order.js' + onLoad((options) => { + orderId.value = options.id || null; + GetByOrderId() + }); + + const orderId = ref(0) + const fileList = reactive({ // glove: [],//手套 @@ -278,6 +290,20 @@ } + } + + function GetByOrderId(){ + orderItemLogGetByOrderId(orderId.value) + .then(res => { + if(res.code == 200){ + + } + }) + } + + + function saveDraft() { + } function msg(content) { @@ -286,6 +312,7 @@ icon: 'none' }) } +