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 @@