From e9bde6e00c47a335006cf9980fecb801858ab8c1 Mon Sep 17 00:00:00 2001 From: dzq Date: Fri, 13 Jun 2025 11:51:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A010=E6=A0=BC=E6=9F=9C?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=B9=B6=E4=BC=98=E5=8C=96=E6=99=BA=E8=83=BD?= =?UTF-8?q?=E6=9F=9C=E8=AF=A6=E6=83=85=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在cabinetImgMap中添加10格柜的图片和名称配置 - 新增获取商店详情的API接口 - 将运行模式相关逻辑从智能柜模块移至商店模块 - 智能柜详情页增加商店信息获取和展示 - 优化商品配置前的商店信息校验 --- src/api/cabinet/smart-cabinet.ts | 26 ++++-------- src/api/shop/shop.ts | 5 +++ src/utils/cabinetImgMap.ts | 4 ++ .../cabinet/smart-cabinet-card/detail.vue | 41 +++++++++++++++---- .../cabinet/smart-cabinet-card/index.vue | 3 +- .../cabinet/smart-cabinet/ShopConfigModal.vue | 4 +- 6 files changed, 52 insertions(+), 31 deletions(-) diff --git a/src/api/cabinet/smart-cabinet.ts b/src/api/cabinet/smart-cabinet.ts index 0646a20..3a0507d 100644 --- a/src/api/cabinet/smart-cabinet.ts +++ b/src/api/cabinet/smart-cabinet.ts @@ -120,6 +120,13 @@ export const getSmartCabinetList = (params?: SmartCabinetQuery) => { }); }; + +export const getSmartCabinetListQuery = (params?: SmartCabinetQuery) => { + return http.request>('get', '/cabinet/smartCabinet/list', { + params + }); +}; + export const addSmartCabinet = (data: AddSmartCabinetCommand) => { return http.request>('post', '/cabinet/smartCabinet', { data @@ -149,25 +156,6 @@ export const getSmartCabinetDetailApi = (cabinetId: number) => { }; -/** - * 获取运行模式文字描述 - * @param mode 运行模式数字 - */ -export const getModeText = (mode?: number) => { - switch (mode) { - case 0: - return '支付模式'; - case 1: - return '审批模式'; - case 2: - return '借还模式'; - case 3: - return '会员模式'; - default: - return '未知模式'; - } -}; - /** * 获取借呗支付状态文字描述 * @param balanceEnable 借呗支付状态数字 diff --git a/src/api/shop/shop.ts b/src/api/shop/shop.ts index 33548ed..f7ec002 100644 --- a/src/api/shop/shop.ts +++ b/src/api/shop/shop.ts @@ -96,6 +96,11 @@ export const getShopList = (params?: ShopQuery) => { }); }; +/** 获取商店详情 */ +export const getShopById = (id: number) => { + return http.request>('get', `/shop/shops/${id}`); +}; + /** 新增商店 */ export const addShop = (data: AddShopCommand) => { return http.request>('post', '/shop/shops', { diff --git a/src/utils/cabinetImgMap.ts b/src/utils/cabinetImgMap.ts index 639bfac..17264c0 100644 --- a/src/utils/cabinetImgMap.ts +++ b/src/utils/cabinetImgMap.ts @@ -35,4 +35,8 @@ export const CabinetImgMap = { img: "cabinet_4.jpg", name: "4格柜", }, + 10: { + img: "cabinet_16.jpg", + name: "10格柜", + }, } \ No newline at end of file diff --git a/src/views/cabinet/smart-cabinet-card/detail.vue b/src/views/cabinet/smart-cabinet-card/detail.vue index a70cbc1..e349035 100644 --- a/src/views/cabinet/smart-cabinet-card/detail.vue +++ b/src/views/cabinet/smart-cabinet-card/detail.vue @@ -1,7 +1,7 @@