diff --git a/src/App.vue b/src/App.vue index 6fdcdf0..177aa22 100644 --- a/src/App.vue +++ b/src/App.vue @@ -255,6 +255,10 @@ html { color: #333; } +.el-divider__text { + white-space: nowrap; +} + .el-dialog__headerbtn { top: 10px !important; } diff --git a/src/api/table.js b/src/api/table.js index 414f43b..7c07964 100644 --- a/src/api/table.js +++ b/src/api/table.js @@ -1,27 +1,40 @@ -import request from "@/utils/request.js" +import request from "@/utils/request.js"; /** * 查询台桌分类 - * @param {*} params + * @param {*} params * @returns */ export function queryShopArea(params) { - return request({ - method: "get", - url: "shopInfo/queryShopArea", - params - }); + return request({ + method: "get", + url: "shopInfo/queryShopArea", + params, + }); } /** * 查询台桌信息 - * @param {*} params + * @param {*} params * @returns */ export function queryShopTable(params) { - return request({ - method: "get", - url: "shopInfo/queryShopTable", - params - }); -} \ No newline at end of file + return request({ + method: "get", + url: "shopInfo/queryShopTable", + params, + }); +} + +/** + * 清台 + * @param {*} params + * @returns + */ +export function clearTable(data) { + return request({ + method: "put", + url: "/shopInfo/clearTable", + data, + }); +} diff --git a/src/api/user.js b/src/api/user.js index 96c857c..c68c914 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -34,3 +34,19 @@ export function queryPwdInfo() { }, }); } + +/** + * 查询店铺信息 + * @param {*} params + * @returns + */ +export function queryShopInfo() { + let userInfo = JSON.parse(localStorage.getItem("userInfo")); + return request({ + method: "get", + url: "/shopInfo/queryShopInfo", + params: { + shopId: userInfo.shopId, + }, + }); +} diff --git a/src/store/shop.js b/src/store/shop.js new file mode 100644 index 0000000..462c358 --- /dev/null +++ b/src/store/shop.js @@ -0,0 +1,22 @@ +import { defineStore } from "pinia"; +import { queryShopInfo } from "@/api/user"; +import useStorage from "@/utils/useStorage"; + +export const useShop = defineStore({ + id: "shopInfo", + state: () => ({ + info: useStorage.get("shopInfo"), + }), + actions: { + // 获取店铺信息 + async queryShopInfo() { + try { + const res = await queryShopInfo(); + useStorage.set("shopInfo", res); + this.info = useStorage.get("shopInfo"); + } catch (error) { + console.log(error); + } + }, + }, +}); diff --git a/src/views/home/components/cartOperation.vue b/src/views/home/components/cartOperation.vue index 9d38e0d..495b628 100644 --- a/src/views/home/components/cartOperation.vue +++ b/src/views/home/components/cartOperation.vue @@ -83,6 +83,8 @@ function giftPackHandle(key) { // 加减修改数量 function numberChange(t) { + console.log(props.item); + if (!props.item.id) return switch (t) { case 'sub': diff --git a/src/views/home/components/settleAccount.vue b/src/views/home/components/settleAccount.vue index 5290e06..476d24a 100644 --- a/src/views/home/components/settleAccount.vue +++ b/src/views/home/components/settleAccount.vue @@ -26,7 +26,7 @@