From bab4a4383baf3353a990d457a3855a5883ac2544 Mon Sep 17 00:00:00 2001 From: weiwei Date: Thu, 5 Jun 2025 16:12:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E5=95=86=E5=9F=8E=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 23 ++- src/pages.json | 15 +- src/pages/canteen/detail.vue | 2 +- .../{product-car.vue => product-cart.vue} | 14 +- src/pages/shop/components/product-total.vue | 48 ++--- src/pages/shop/detail.vue | 165 ++++++++---------- src/pages/tabbar/onlineShop.vue | 82 +++++++++ src/sheep/utils/app.ts | 4 +- src/static/tabbar/online-shop-select.png | Bin 0 -> 5113 bytes src/static/tabbar/online-shop.png | Bin 0 -> 4996 bytes 10 files changed, 211 insertions(+), 142 deletions(-) rename src/pages/shop/components/{product-car.vue => product-cart.vue} (83%) create mode 100644 src/pages/tabbar/onlineShop.vue create mode 100644 src/static/tabbar/online-shop-select.png create mode 100644 src/static/tabbar/online-shop.png diff --git a/src/App.vue b/src/App.vue index ac5b9d9..f314ac1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,11 +2,6 @@ import { isDevEnv, getLaunchParam } from "@/sheep/utils/app" import { getAppInfo } from "@@/utils/app" -// import { onLaunch, onShow, onHide } from "@dcloudio/uni-app" -// onLaunch(() => {}) -// onShow(() => {}) -// onHide(() => {}) - interface TabbarItem { pagePath: string text: string @@ -33,6 +28,14 @@ const tabbar: TabbarItem[] = [ launchParam: ["selfMerchant"], auth: ["user"], }, + { + pagePath: "pages/tabbar/onlineShop", + text: "在线商城", + iconPath: "/static/tabbar/online-shop.png", + selectedIconPath: "/static/tabbar/online-shop-select.png", + launchParam: ["onlineShop"], + auth: ["user"], + }, { pagePath: "pages/tabbar/coopMerchant", text: "合作商家", @@ -54,7 +57,7 @@ const tabbar: TabbarItem[] = [ text: "订单", iconPath: "/static/tabbar/order.png", selectedIconPath: "/static/tabbar/order-select.png", - launchParam: ["canteen", "selfMerchant", "coopMerchant"], + launchParam: ["canteen", "selfMerchant", "onlineShop", "coopMerchant"], auth: ["user"], }, { @@ -94,7 +97,7 @@ const tabbar: TabbarItem[] = [ text: "我的", iconPath: "/static/tabbar/my.png", selectedIconPath: "/static/tabbar/my-select.png", - launchParam: ["canteen", "selfMerchant", "coopMerchant"], + launchParam: ["canteen", "selfMerchant", "onlineShop", "coopMerchant"], auth: ["user", "merchant", "doorAdmin"], }, ] @@ -149,6 +152,9 @@ export default { case "selfMerchant": uni.switchTab({ url: "/pages/tabbar/selfMerchant" }) break + case "onlineShop": + uni.switchTab({ url: "/pages/tabbar/onlineShop" }) + break case "coopMerchant": uni.switchTab({ url: "/pages/tabbar/coopMerchant" }) break @@ -169,6 +175,7 @@ export default { return uni.switchTab({ url: "/pages/tabbar/individualOrder" }) case "user": if (launchParam === "selfMerchant") return uni.switchTab({ url: "/pages/tabbar/selfMerchant" }) + if (launchParam === "onlineShop") return uni.reLaunch({ url: "/pages/tabbar/onlineShop" }) if (launchParam === "coopMerchant") return uni.reLaunch({ url: "/pages/tabbar/coopMerchant" }) return case "doorAdmin": @@ -179,8 +186,6 @@ export default { } } }, - onShow() {}, - onHide() {}, methods: { async _initTabbar() { diff --git a/src/pages.json b/src/pages.json index df22365..669c84a 100644 --- a/src/pages.json +++ b/src/pages.json @@ -23,6 +23,13 @@ "disableScroll": true } }, + { + "path": "pages/tabbar/onlineShop", + "style": { + "navigationBarTitleText": "在线商城", + "disableScroll": true + } + }, { "path": "pages/tabbar/coopMerchant", "style": { @@ -483,6 +490,12 @@ "iconPath": "", "selectedIconPath": "" }, + { + "pagePath": "pages/tabbar/onlineShop", + "text": "", + "iconPath": "", + "selectedIconPath": "" + }, { "pagePath": "pages/tabbar/coopMerchant", "text": "", @@ -521,7 +534,7 @@ }, { "pagePath": "pages/tabbar/message", - "text": "通知公告", + "text": "", "iconPath": "", "selectedIconPath": "" }, diff --git a/src/pages/canteen/detail.vue b/src/pages/canteen/detail.vue index 01b2f3f..496d130 100644 --- a/src/pages/canteen/detail.vue +++ b/src/pages/canteen/detail.vue @@ -156,7 +156,7 @@ const updateFoodCart = async () => { } // 打开购物车 -const doVisibleCart = async () => (state.showCartDialog = true) +const doVisibleCart = () => (state.showCartDialog = true) // 购买 打开预订时间段选择对话框 const doBuy = async () => { diff --git a/src/pages/shop/components/product-car.vue b/src/pages/shop/components/product-cart.vue similarity index 83% rename from src/pages/shop/components/product-car.vue rename to src/pages/shop/components/product-cart.vue index d75f2fb..8873087 100644 --- a/src/pages/shop/components/product-car.vue +++ b/src/pages/shop/components/product-cart.vue @@ -1,13 +1,5 @@