This commit is contained in:
zjf committed 2026-07-29 18:35:52 +08:00
1 parent a0eac3aabb
commit 98e2c198db
5 files changed
+103 -47

No files matched your search

+19
View File
@@ -1,5 +1,6 @@
<script setup lang="ts">
import { APPENV } from "@/sheep/constant"
import { INTEGRATED_ENTRIES, getIntegratedPageByLaunchParam } from "@/sheep/constant/integrated-entry"
import { getAppInfo, getLaunchParam, getUrlQueryParam, isDevEnv } from "@/sheep/utils/app"
import { onShow } from "@dcloudio/uni-app"
@@ -58,6 +59,12 @@ const moduleList = [
iconPath: "/static/tabbar/integrated-select.png",
launchParam: "integrated",
},
...INTEGRATED_ENTRIES.map((e) => ({
pagePath: e.pagePath,
text: e.text,
iconPath: e.iconPath,
launchParam: e.launchParam,
})),
]
onShow(() => {
@@ -68,6 +75,16 @@ onShow(() => {
jumpByParam()
})
async function jumpIntegratedSubPage(launchParam: string): Promise<boolean> {
const url = getIntegratedPageByLaunchParam(launchParam)
if (!url) return false
uni.setStorageSync("launchParam", launchParam)
const app = getApp() as { _initTabbar?: () => Promise<void> }
if (app?._initTabbar) await app._initTabbar()
uni.reLaunch({ url })
return true
}
const jumpByParam = async () => {
const appInfo = await getAppInfo() // 环境判断
const launchParam = getLaunchParam() // 获取启动参数
@@ -77,6 +94,7 @@ const jumpByParam = async () => {
const { tryZzdEntryLogin } = await import("@/sheep/utils/request")
const zzdR = await tryZzdEntryLogin()
if (zzdR !== "ok") return
if (await jumpIntegratedSubPage(launchParam)) return
switch (launchParam) {
case "thirdApp":
uni.setStorageSync("launchParam", launchParam)
@@ -156,6 +174,7 @@ const jumpByParam = async () => {
uni.setStorageSync("launchParam", launchParam)
return uni.reLaunch({ url: "/pages/tabbar/integrated" })
}
if (await jumpIntegratedSubPage(launchParam)) return
case "doorAdmin":
return uni.switchTab({ url: "/pages/tabbar/cabinet" })
default:
+7 -44
View File
@@ -31,54 +31,17 @@ import { onLoad } from "@dcloudio/uni-app"
import { ref, onMounted } from "vue"
import integratedApi from "@/sheep/api/integrated"
import { INTEGRATED_ENTRIES } from "@/sheep/constant/integrated-entry"
import { hooks } from "@@/index"
const todoCount = ref(0)
const services = [
{
name: "todo",
label: "工作待办",
icon: "/static/icon/todo.png",
url: "/pages/integrated/todo/index",
},
{
name: "meeting-booking",
label: "会议预定",
icon: "/static/icon/meeting-booking.png",
url: "/pages/integrated/meeting/index",
},
{
name: "lost-and-found",
label: "失物招领",
icon: "/static/icon/service_1.png",
url: "/pages/integrated/lostAndFound/index",
},
{
name: "feedback",
label: "意见反馈",
icon: "/static/icon/feedback.png",
url: "/pages/integrated/feedback/index",
},
{
name: "repair-report",
label: "物业维修",
icon: "/static/icon/service_2.png",
url: "/pages/integrated/repair/index",
},
{
name: "notice",
label: "通知公告",
icon: "/static/icon/service_3.png",
url: "/pages/integrated/notice/index",
},
{
name: "visitor",
label: "访客邀约",
icon: "/static/icon/visitor.png",
url: "/pages/integrated/visitor/invitation",
},
]
const services = INTEGRATED_ENTRIES.map((e) => ({
name: e.launchParam,
label: e.text,
icon: e.iconPath,
url: e.pagePath,
}))
// 获取待办数量
async function fetchTodoCount() {