diff --git a/src/store/modules/carts.ts b/src/store/modules/carts.ts index d820769..c9647f4 100644 --- a/src/store/modules/carts.ts +++ b/src/store/modules/carts.ts @@ -226,9 +226,27 @@ export const useCartsStore = defineStore("carts", () => { const isLinkFinshed = ref(false); // 当前购物车数据(现在 getAllGoodsList 能直接访问) - const list = useStorage("carts", []); - // 历史订单数据(现在 getAllGoodsList 能直接访问),不从本地缓存获取,改为从接口获取 - const oldOrder = ref({ + const list = useStorage( + "carts", + [], + localStorage, + { + serializer: { + read: (rawValue) => { + // 没有值时直接返回默认空数组 + if (!rawValue) return [] + try { + return JSON.parse(rawValue) + } catch { + return [] + } + }, + write: (value) => JSON.stringify(value), + }, + } + ) + // 历史订单数据(现在 getAllGoodsList 能直接访问) + const oldOrder = useStorage("Instead_olold_order", { detailMap: [], originAmount: 0 }); diff --git a/src/views/shop/config/components/shopInfo.vue b/src/views/shop/config/components/shopInfo.vue index 5f0a243..9346aa5 100644 --- a/src/views/shop/config/components/shopInfo.vue +++ b/src/views/shop/config/components/shopInfo.vue @@ -3,14 +3,25 @@
- + - +
- +
- + - + - + - +
- +
开启后,用户只能在店铺附近xx公里内点餐
- +
+
- +
起菜到上菜的时间间隔,开启后会有超时提示
- + @@ -208,11 +304,24 @@
- - + + 点击上传