From 8239ed657f90fe7f13c26ffa125a9d175eca00ac Mon Sep 17 00:00:00 2001 From: dzq Date: Fri, 19 Dec 2025 11:14:02 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=99=BA=E8=83=BD=E6=9F=9C):=20=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=E7=89=A9=E5=93=81=E5=AD=98=E5=8F=96=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=8F=8A=E5=AF=86=E7=A0=81=E9=AA=8C=E8=AF=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加格口分配、密码验证和状态重置的API接口 重构storage-cells-summary组件,实现完整的存入取出流程 添加密码生成、验证和格口操作的用户交互 --- src/api/cabinet/index.ts | 17 +- src/api/cabinet/types.ts | 24 ++ .../storage-cells-summary/index.vue | 217 +++++++++++++++++- src/pages/index/index.vue | 21 +- 4 files changed, 266 insertions(+), 13 deletions(-) diff --git a/src/api/cabinet/index.ts b/src/api/cabinet/index.ts index a417ee4..25015fe 100644 --- a/src/api/cabinet/index.ts +++ b/src/api/cabinet/index.ts @@ -1,5 +1,5 @@ import { http } from "@/http/http"; -import type { AvailableStorageCellDTO, CabinetDetailDTO, RentingCabinetDetailDTO } from './types'; +import type { AvailableStorageCellDTO, CabinetCellEntity, CabinetDetailDTO, RentingCabinetDetailDTO, StoreItemToCellCommand, OpenCellByPasswordCommand, ResetCellByPasswordCommand } from './types'; import type { OpenCabinetApiData } from '@/api/shop/types'; /** 获取智能柜详情接口 */ @@ -36,4 +36,19 @@ export async function changeGoodsCellsStock(cellId: number, stock: number) { export async function clearGoodsCells(cellId: number) { return await http.put(`/cabinet/clearGoodsCells/${cellId}`); +} + +/** 存入物品分配格口 */ +export async function storeItemApi(command: StoreItemToCellCommand) { + return await http.post('cabinet/storeItem', command); +} + +/** 根据密码开启格口接口 */ +export async function openByPassword(command: OpenCellByPasswordCommand) { + return await http.post("cabinet/openByPassword", command); +} + +/** 重置格口状态接口 */ +export async function resetByPassword(command: ResetCellByPasswordCommand) { + return await http.post("cabinet/resetByPassword", command); } \ No newline at end of file diff --git a/src/api/cabinet/types.ts b/src/api/cabinet/types.ts index 57650a4..b92415f 100644 --- a/src/api/cabinet/types.ts +++ b/src/api/cabinet/types.ts @@ -103,4 +103,28 @@ export interface AvailableStorageCellDTO { price: number /** 封面图URL */ coverImg: string +} + +/** 存入物品分配格口请求参数 */ +export interface StoreItemToCellCommand { + /** 店铺ID */ + shopId: number + /** 格口类型(1小格 2中格 3大格 4超大格) */ + cellType: number +} + +/** 根据密码开启格口请求参数 */ +export interface OpenCellByPasswordCommand { + /** 店铺ID */ + shopId: number; + /** 格口密码 */ + password: string; +} + +/** 重置格口状态请求参数 */ +export interface ResetCellByPasswordCommand { + /** 店铺ID */ + shopId: number; + /** 格口密码 */ + password: string; } \ No newline at end of file diff --git a/src/components/storage-cells-summary/index.vue b/src/components/storage-cells-summary/index.vue index dc79986..787b5a9 100644 --- a/src/components/storage-cells-summary/index.vue +++ b/src/components/storage-cells-summary/index.vue @@ -1,7 +1,8 @@