From 4fd68cf89dfc480d64ab57d0d5c85b953edf05cb Mon Sep 17 00:00:00 2001 From: weiwei Date: Wed, 23 Apr 2025 19:07:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=AF=E7=94=B1=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 5 +- src/App.vue | 158 +-- src/pages.json | 230 ++-- src/pages/integrated/visitor/index.vue | 1667 ++++++++++++------------ src/pages/tabbar/my.vue | 45 +- 5 files changed, 1001 insertions(+), 1104 deletions(-) diff --git a/.env b/.env index f5ea089..c38ef8b 100644 --- a/.env +++ b/.env @@ -29,10 +29,9 @@ VITE_OAUTH2_APP_CLIENT='mini:mini' #VITE_APP_DEV_SERVICE = http://59.202.170.152:81/api # 信创线上 #VITE_APP_DEV_SERVICE = https://stgl.pj.gov.cn/api # VITE_APP_DEV_SERVICE = http://192.168.101.64:9999 # 邓-本地 - VITE_APP_DEV_SERVICE = http://127.0.0.1:9999 -# VITE_APP_DEV_SERVICE = http://123.156.230.15:8089/api/ # 线上 +# VITE_APP_DEV_SERVICE = http://127.0.0.1:9999 +VITE_APP_DEV_SERVICE = http://123.156.230.15:8089/api/ # 访客线上 # VITE_APP_DEV_SERVICE = http://220.191.229.171:8090/api # 线上 -# VITE_APP_DEV_SERVICE = http://localhost:9999 # ******************** end 开发环境 end ******************** # ******************** start 生产环境 start **************** diff --git a/src/App.vue b/src/App.vue index 55e3905..2f3028f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -64,46 +64,6 @@ const tabbar: TabbarItem[] = [ // launchParam: [], // auth: ["merchant"], // }, - { - pagePath: "pages/integrated/visitor/index", - text: "访客申请", - iconPath: "/static/tabbar/my.png", - selectedIconPath: "/static/tabbar/my-select.png", - launchParam: ["canteen", "selfMerchant"], - auth: ["user",], - }, - { - pagePath: "pages/integrated/visitor/myvisitor", - text: "申请记录", - iconPath: "/static/tabbar/my.png", - selectedIconPath: "/static/tabbar/my-select.png", - launchParam: ["canteen", "selfMerchant"], - auth: ["user",], - }, - { - pagePath: "pages/integrated/visitor/myyyvisitor", - text: "主动邀约", - iconPath: "/static/tabbar/my.png", - selectedIconPath: "/static/tabbar/my-select.png", - launchParam: ["canteen", "selfMerchant"], - auth: ["user",], - }, - { - pagePath: "pages/integrated/visitor/myyyvisitorlist", - text: "邀约记录", - iconPath: "/static/tabbar/my.png", - selectedIconPath: "/static/tabbar/my-select.png", - launchParam: ["canteen", "selfMerchant"], - auth: ["user",], - }, - { - pagePath: "pages/tabbar/my", - text: "我的", - iconPath: "/static/tabbar/my.png", - selectedIconPath: "/static/tabbar/my-select.png", - launchParam: ["canteen", "selfMerchant"], - auth: ["user", "merchant"], - }, ] // 获取启动参数 @@ -141,76 +101,68 @@ const setTabbarByUserRole = (role: string) => { export default { async onLaunch() { - if (isDevEnv()) return - - uni.setNavigationBarTitle({ title: "" }) - // 环境判断 - const res = await (window as any).CP2.getAppInfo() - if (res.code == 0) { - // 不是诗画环境 - const launchParam = getLaunchParam() - - console.log("app launch 启动路径参数", launchParam) - - switch (launchParam) { - case "canteen": - uni.switchTab({ url: "/pages/tabbar/canteen" }) - break - case "selfMerchant": - uni.switchTab({ url: "/pages/tabbar/selfMerchant" }) - break - default: - break - } - } else { - // 是诗画环境 - const userRole = uni.getStorageSync("userRole") - if (!userRole) return uni.redirectTo({ url: "/pages/user/userRole" }) - if (userRole === "user") return uni.switchTab({ url: "/pages/tabbar/coopMerchant" }) - if (userRole === "merchant") return uni.switchTab({ url: "/pages/tabbar/individualOrder" }) - } + // const res = await (window as any).CP2.getAppInfo() + // if (res.code == 0) { + // // 不是诗画环境 + // const launchParam = getLaunchParam() + // console.log("app launch 启动路径参数", launchParam) + // switch (launchParam) { + // case "canteen": + // uni.switchTab({ url: "/pages/tabbar/canteen" }) + // break + // case "selfMerchant": + // uni.switchTab({ url: "/pages/tabbar/selfMerchant" }) + // break + // default: + // break + // } + // } else { + // // 是诗画环境 + // const userRole = uni.getStorageSync("userRole") + // if (!userRole) return uni.redirectTo({ url: "/pages/user/userRole" }) + // if (userRole === "user") return uni.switchTab({ url: "/pages/tabbar/coopMerchant" }) + // if (userRole === "merchant") return uni.switchTab({ url: "/pages/tabbar/individualOrder" }) + // } }, onShow() {}, onHide() {}, methods: { async _initTabbar() { - if (isDevEnv()) { - tabbar.forEach((item, index) => { - setTabbarItem(index, item, true) - }) - return - } - - const launchParam = getLaunchParam() - console.log("tabbar launch 启动路径参数", launchParam) - - const res = await (window as any).CP2.getAppInfo() - if (res.code == 0) { - // 不是诗画环境 - if (launchParam) { - setTabbarByLaunchParam(launchParam) - } else { - uni.hideTabBar() - uni.showToast({ title: "启动参数不合法", icon: "none" }) - } - } else { - // 是诗画环境 - const userRole = uni.getStorageSync("userRole") - switch (userRole) { - case "user": - setTabbarByUserRole("user") - break - case "merchant": - setTabbarByUserRole("merchant") - break - default: - uni.hideTabBar() - uni.showToast({ title: "用户身份未确认", icon: "none" }) - break - } - } + // if (isDevEnv()) { + // tabbar.forEach((item, index) => { + // setTabbarItem(index, item, true) + // }) + // return + // } + // const launchParam = getLaunchParam() + // console.log("tabbar launch 启动路径参数", launchParam) + // const res = await (window as any).CP2.getAppInfo() + // if (res.code == 0) { + // // 不是诗画环境 + // if (launchParam) { + // setTabbarByLaunchParam(launchParam) + // } else { + // uni.hideTabBar() + // uni.showToast({ title: "启动参数不合法", icon: "none" }) + // } + // } else { + // // 是诗画环境 + // const userRole = uni.getStorageSync("userRole") + // switch (userRole) { + // case "user": + // setTabbarByUserRole("user") + // break + // case "merchant": + // setTabbarByUserRole("merchant") + // break + // default: + // uni.hideTabBar() + // uni.showToast({ title: "用户身份未确认", icon: "none" }) + // break + // } + // } }, }, } diff --git a/src/pages.json b/src/pages.json index df12b47..9129d45 100644 --- a/src/pages.json +++ b/src/pages.json @@ -9,67 +9,61 @@ } }, "pages": [ -// { -// "path": "pages/tabbar/canteen", -// "style": { -// "navigationBarTitleText": "食堂", -// "disableScroll": true -// } -// }, -// { -// "path": "pages/tabbar/selfMerchant", -// "style": { -// "navigationBarTitleText": "自营商家", -// "disableScroll": true -// } -// }, -// { -// "path": "pages/tabbar/coopMerchant", -// "style": { -// "navigationBarTitleText": "合作商家", -// "disableScroll": true -// } -// }, -// { -// "path": "pages/tabbar/order", -// "style": { -// "navigationBarTitleText": "订单", -// "disableScroll": true -// } -// }, -// { -// "path": "pages/tabbar/flowStatistics", -// "style": { -// "navigationBarTitleText": "流水统计", -// "disableScroll": true -// } -// }, -// { -// "path": "pages/tabbar/individualOrder", -// "style": { -// "navigationBarTitleText": "订单", -// "disableScroll": true -// } -// }, -// { -// "path": "pages/integrated/visitor/myvisitor", -// "style": { -// "navigationBarTitleText": "访客", -// "disableScroll": true -// } -// }, + // { + // "path": "pages/tabbar/canteen", + // "style": { + // "navigationBarTitleText": "食堂", + // "disableScroll": true + // } + // }, + // { + // "path": "pages/tabbar/selfMerchant", + // "style": { + // "navigationBarTitleText": "自营商家", + // "disableScroll": true + // } + // }, + // { + // "path": "pages/tabbar/coopMerchant", + // "style": { + // "navigationBarTitleText": "合作商家", + // "disableScroll": true + // } + // }, + // { + // "path": "pages/tabbar/order", + // "style": { + // "navigationBarTitleText": "订单", + // "disableScroll": true + // } + // }, + // { + // "path": "pages/tabbar/flowStatistics", + // "style": { + // "navigationBarTitleText": "流水统计", + // "disableScroll": true + // } + // }, + // { + // "path": "pages/tabbar/individualOrder", + // "style": { + // "navigationBarTitleText": "订单", + // "disableScroll": true + // } + // }, + // { + // "path": "pages/integrated/visitor/myvisitor", + // "style": { + // "navigationBarTitleText": "访客", + // "disableScroll": true + // } + // }, { "path": "pages/tabbar/my", "style": { "navigationBarTitleText": "我的", "disableScroll": true } - }, - { - "path": "pages/integrated/visitor/verify", - "style": { - "navigationStyle": "custom" - } } ], "subPackages": [ @@ -402,7 +396,7 @@ ], "globalStyle": { "navigationBarTextStyle": "black", - "navigationBarTitleText": "浦江小程序", + "navigationBarTitleText": "小程序", "navigationBarBackgroundColor": "#1777FF", "backgroundColor": "#ecf4f9", "navigationStyle": "custom" @@ -412,75 +406,82 @@ { "pagePath": "pages/integrated/visitor/index", "text": "访客申请", - "iconPath": "", - "selectedIconPath": "" + "iconPath": "/static/tabbar/my.png", + "selectedIconPath": "/static/tabbar/my-select.png" }, { "pagePath": "pages/integrated/visitor/myvisitor", "text": "申请记录", - "iconPath": "", - "selectedIconPath": "" + "iconPath": "/static/tabbar/my.png", + "selectedIconPath": "/static/tabbar/my-select.png" }, + { "pagePath": "pages/integrated/visitor/myyyvisitor", "text": "访客邀约", - "iconPath": "", - "selectedIconPath": "" + "iconPath": "/static/tabbar/my.png", + "selectedIconPath": "/static/tabbar/my-select.png" }, { "pagePath": "pages/integrated/visitor/myyyvisitorlist", "text": "邀约记录", - "iconPath": "", - "selectedIconPath": "" + "iconPath": "/static/tabbar/my.png", + "selectedIconPath": "/static/tabbar/my-select.png" }, { "pagePath": "pages/integrated/visitor/verify", "text": "核销", - "iconPath": "", - "selectedIconPath": "" + "iconPath": "/static/tabbar/my.png", + "selectedIconPath": "/static/tabbar/my-select.png" }, -// { -// "pagePath": "pages/tabbar/canteen", -// "text": "", -// "iconPath": "", -// "selectedIconPath": "" -// }, -// { -// "pagePath": "pages/tabbar/selfMerchant", -// "text": "", -// "iconPath": "", -// "selectedIconPath": "" -// }, -// { -// "pagePath": "pages/tabbar/coopMerchant", -// "text": "", -// "iconPath": "", -// "selectedIconPath": "" -// }, -// { -// "pagePath": "pages/tabbar/order", -// "text": "", -// "iconPath": "", -// "selectedIconPath": "" -// }, -// { -// "pagePath": "pages/tabbar/flowStatistics", -// "text": "", -// "iconPath": "", -// "selectedIconPath": "" -// }, -// { -// "pagePath": "pages/tabbar/individualOrder", -// "text": "", -// "iconPath": "", -// "selectedIconPath": "" -// }, -// { -// "pagePath": "pages/tabbar/my", -// "text": "", -// "iconPath": "", -// "selectedIconPath": "" -// } + { + "pagePath": "pages/tabbar/my", + "text": "我的", + "iconPath": "/static/tabbar/my.png", + "selectedIconPath": "/static/tabbar/my-select.png" + } + // { + // "pagePath": "pages/tabbar/canteen", + // "text": "", + // "iconPath": "", + // "selectedIconPath": "" + // }, + // { + // "pagePath": "pages/tabbar/selfMerchant", + // "text": "", + // "iconPath": "", + // "selectedIconPath": "" + // }, + // { + // "pagePath": "pages/tabbar/coopMerchant", + // "text": "", + // "iconPath": "", + // "selectedIconPath": "" + // }, + // { + // "pagePath": "pages/tabbar/order", + // "text": "", + // "iconPath": "", + // "selectedIconPath": "" + // }, + // { + // "pagePath": "pages/tabbar/flowStatistics", + // "text": "", + // "iconPath": "", + // "selectedIconPath": "" + // }, + // { + // "pagePath": "pages/tabbar/individualOrder", + // "text": "", + // "iconPath": "", + // "selectedIconPath": "" + // }, + // { + // "pagePath": "pages/tabbar/my", + // "text": "", + // "iconPath": "", + // "selectedIconPath": "" + // } // { // "pagePath": "pages/tabbar/canteen", // "text": "食堂", @@ -517,13 +518,12 @@ // "iconPath": "static/tabbar/order.png", // "selectedIconPath": "static/tabbar/order-select.png" // }, - { - "pagePath": "pages/tabbar/my", - "text": "我的", - "iconPath": "static/tabbar/my.png", - "selectedIconPath": "static/tabbar/my-select.png" - } - + // { + // "pagePath": "pages/tabbar/my", + // "text": "我的", + // "iconPath": "static/tabbar/my.png", + // "selectedIconPath": "static/tabbar/my-select.png" + // } ] } } diff --git a/src/pages/integrated/visitor/index.vue b/src/pages/integrated/visitor/index.vue index faa999c..febf505 100644 --- a/src/pages/integrated/visitor/index.vue +++ b/src/pages/integrated/visitor/index.vue @@ -1,324 +1,267 @@ diff --git a/src/pages/tabbar/my.vue b/src/pages/tabbar/my.vue index ca6598d..543b15b 100644 --- a/src/pages/tabbar/my.vue +++ b/src/pages/tabbar/my.vue @@ -32,7 +32,7 @@ - + @@ -76,13 +76,13 @@ const state = reactive<{ // { text: "外来人员就餐", icon: "/static/icon/service_1.png", router: "/pages/apply/foreign-list" }, // { text: "跨单位就餐", icon: "/static/icon/service_1.png", router: "/pages/apply/stride-list" }, { text: "人脸管理", icon: "/static/icon/service_5.png", router: "/pages/human-face/list" }, - // { text: "访客", icon: "/static/icon/service_5.png", router: "/pages/integrated/visitor/index" }, - // { text: "访客记录", icon: "/static/icon/service_5.png", router: "/pages/integrated/visitor/myvisitor" }, - // { text: "访客邀约", icon: "/static/icon/service_5.png", router: "/pages/integrated/visitor/myyyvisitor" }, - // { text: "邀约记录", icon: "/static/icon/service_5.png", router: "/pages/integrated/visitor/myyyvisitorlist" }, - // { text: "访客核销", icon: "/static/icon/service_5.png", router: "/pages/integrated/visitor/verify" }, + // { text: "访客", icon: "/static/icon/service_5.png", router: "/pages/integrated/visitor/index" }, + // { text: "访客记录", icon: "/static/icon/service_5.png", router: "/pages/integrated/visitor/myvisitor" }, + // { text: "访客邀约", icon: "/static/icon/service_5.png", router: "/pages/integrated/visitor/myyyvisitor" }, + // { text: "邀约记录", icon: "/static/icon/service_5.png", router: "/pages/integrated/visitor/myyyvisitorlist" }, + // { text: "访客核销", icon: "/static/icon/service_5.png", router: "/pages/integrated/visitor/verify" }, - // { text: "意见反馈", icon: "/static/icon/service_5.png", router: "/pages/integrated/feedback/index" } + // { text: "意见反馈", icon: "/static/icon/service_5.png", router: "/pages/integrated/feedback/index" } ], appInfo: "", }) @@ -326,7 +326,8 @@ const scanCode = { }, } -const onTabLogin = () => (isDevEnv() ? router.jump("/pages/test/login") : login.checkAppInfo()) +// const onTabLogin = () => (isDevEnv() ? router.jump("/pages/test/login") : login.checkAppInfo()) +const onTabLogin = () => router.jump("/pages/test/login") const onTabMenu = async (item: any, index: number) => { if (index == state.menuList.length - 1) { @@ -356,18 +357,18 @@ const doChangeRole = () => { // 初始化配置菜单 const initMenuConfig = () => { - if (isDevEnv()) { - state.menuList.push({ - text: "测试-登录", - icon: "/static/icon/login.png", - router: "/pages/test/login", - }) - state.menuList.push({ - text: "测试-角色选择", - icon: "/static/icon/login.png", - router: "/pages/user/userRole", - }) - } + // if (isDevEnv()) { + // state.menuList.push({ + // text: "测试-登录", + // icon: "/static/icon/login.png", + // router: "/pages/test/login", + // }) + // state.menuList.push({ + // text: "测试-角色选择", + // icon: "/static/icon/login.png", + // router: "/pages/user/userRole", + // }) + // } } onLoad(async () => { @@ -378,7 +379,7 @@ onLoad(async () => { initMenuConfig() // 获取应用信息 - state.appInfo = await getAppInfo() + // state.appInfo = await getAppInfo() }) onShow(() => {