From 602c6b6b82170465a1063c4aae41c35652964088 Mon Sep 17 00:00:00 2001 From: dzq Date: Wed, 2 Jul 2025 16:23:09 +0800 Subject: [PATCH] =?UTF-8?q?feat(rental):=20=E6=B7=BB=E5=8A=A0=E9=80=80?= =?UTF-8?q?=E8=BF=98=E6=A0=BC=E5=8F=A3=E5=8A=9F=E8=83=BD=E5=B9=B6=E6=89=A9?= =?UTF-8?q?=E5=B1=95=E6=A0=BC=E5=8F=A3=E5=AE=9E=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在租赁页面添加退还格口按钮及处理函数 - 扩展 RetingCellEntity 接口添加 orderId 和 orderGoodsId 字段 - 更新 LockerItem 接口和格口列表映射逻辑 --- src/common/apis/cabinet/type.ts | 7 ++++++- src/pages/rental/index.vue | 22 +++++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/common/apis/cabinet/type.ts b/src/common/apis/cabinet/type.ts index 4c57c07..20a3842 100644 --- a/src/common/apis/cabinet/type.ts +++ b/src/common/apis/cabinet/type.ts @@ -14,7 +14,12 @@ export interface RentingCabinetDetailDTO { /** 锁控编号 */ lockControlNo: number /** 柜格列表 */ - cells: CabinetCellEntity[] + cells: RetingCellEntity[] +} + +export interface RetingCellEntity extends CabinetCellEntity { + orderId: number; + orderGoodsId: number; } /** 智能柜格口实体类 */ diff --git a/src/pages/rental/index.vue b/src/pages/rental/index.vue index 1e45115..6552ae1 100644 --- a/src/pages/rental/index.vue +++ b/src/pages/rental/index.vue @@ -28,6 +28,10 @@
+ + 退还格口 + 开启格口 @@ -51,6 +55,7 @@ import { publicPath } from "@/common/utils/path"; import { showDialog, showToast } from 'vant'; import { useAb98UserStore } from '@/pinia/stores/ab98-user'; +const router = useRouter(); const wxStore = useWxStore(); const { userid: userid, qyUserId: qyUserId, name: qyName, corpid, ab98User } = storeToRefs(wxStore); @@ -79,6 +84,8 @@ interface LockerItem { goodsName?: string price?: number coverImg?: string + orderId: number; + orderGoodsId: number; } // 获取用户租用的机柜列表 @@ -116,7 +123,9 @@ const updateLockerList = (cabinet: RentingCabinetDetailDTO) => { // 这里假设商品信息可能在其他字段中,根据实际情况调整 goodsName: '', price: cell.cellPrice, - coverImg: `${publicPath}img/product-image.svg` + coverImg: `${publicPath}img/product-image.svg`, + orderId: cell.orderId, + orderGoodsId: cell.orderGoodsId, })) } @@ -147,6 +156,17 @@ const handleOpenLocker = async (locker: LockerItem) => { } } +const handleRefund = (orderId: number, orderGoodsId: number) => { + router.push({ + path: '/approval/submit', + query: { + orderGoodsId, + orderId, + } + }) +} + + // 初始化方法 const init = async () => { await loadUserRentedCabinetDetail();