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();