路由调整
This commit is contained in:
1 parent
a0b9ac0f40
commit
4fd68cf89d
5 files changed
+1001
-1104
No files matched your search
@@ -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 ****************
|
||||
|
||||
+55
-103
@@ -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
|
||||
// }
|
||||
// }
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
+115
-115
@@ -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"
|
||||
// }
|
||||
]
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
+23
-22
@@ -32,7 +32,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="isDevEnv()" class="flex-col-center m-t-40rpx m-x-30rpx">
|
||||
<!-- <view v-if="isDevEnv()" class="flex-col-center m-t-40rpx m-x-30rpx">
|
||||
<view class="w-full text-center sub-text-28 p-y-20rpx rounded-40rpx border-solid border border-#0094ff" @tap="doLogout">
|
||||
退出登录
|
||||
</view>
|
||||
@@ -41,7 +41,7 @@
|
||||
<view class="w-full text-center sub-text-28 p-y-20rpx rounded-40rpx border-solid border border-#0094ff" @tap="doChangeRole">
|
||||
切换角色
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</crud-layout>
|
||||
</template>
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
Reference in new issue
Block a user