diff --git a/.env b/.env index de1a304..8a4ba1d 100644 --- a/.env +++ b/.env @@ -21,8 +21,7 @@ VITE_OAUTH2_APP_CLIENT='mini:mini' VITE_APP_DEV_SERVICE = http://localhost:9999 #VITE_APP_DEV_SERVICE = https://rj4jv5rwqs.by.takin.cc -VITE_IMAGE_DEV_PATH = https://www.zianxin.com/api -# VITE_IMAGE_DEV_PATH = http://localhost:9999 +VITE_IMAGE_DEV_PATH = http://localhost:9999 # VITE_IMAGE_DEV_PATH = https://rj4jv5rwqs.by.takin.cc # ----------------------------- end 开发环境 end ------------------------------------ diff --git a/src/pages/root/dashboard.vue b/src/pages/root/dashboard.vue index 9dedc33..96f6fa7 100644 --- a/src/pages/root/dashboard.vue +++ b/src/pages/root/dashboard.vue @@ -3,7 +3,9 @@ import { reactive, computed } from "vue" import { onHide, onShow } from "@dcloudio/uni-app" import { router } from "@@/index" -import { noticeApi } from "@@/api/index" +import { noticeApi, appApi } from "@@/api/index" +import { getAppInfo } from "@@/utils/app" +import { filePath } from "@@/utils/file" import Empty from "@@/components/empty/empty.vue" @@ -13,10 +15,8 @@ const state = reactive({ image: "/static/swiper/swiper-1.png" } ], - noticeList: [ - - ], - appList: [] + noticeList: [], + appMenuList: [], }) const groupSize = 3 const shouldScroll = computed(() => state.noticeList.length > groupSize) @@ -38,6 +38,7 @@ const groupedNoticeList = computed(() => { onShow(() => { getNoticeList() + getAppMenuList() }) onHide(() => { @@ -58,6 +59,24 @@ const getNoticeList = async () => { console.log("获取通知公告列表意外的错误error:", error); } } + +// 获取应用菜单列表 +const getAppMenuList = async () => { + const platform = await getAppInfo() + try { + const params = { + typeEnum: "DASHBOARD_TAB", + platformEnum: platform + } + const { data, code }: any = await appApi.appList(params) + if (code != 0) { + throw new Error() + } + state.appMenuList = data || [] + } catch (error) { + console.log("获取应用菜单列表意外的错误error:", error); + } +} diff --git a/src/pages/tabbar/my.vue b/src/pages/tabbar/my.vue index 7bde347..bc95d85 100644 --- a/src/pages/tabbar/my.vue +++ b/src/pages/tabbar/my.vue @@ -34,7 +34,7 @@ - + 切换角色 diff --git a/src/sheep/api/app.ts b/src/sheep/api/app.ts new file mode 100644 index 0000000..9ab228b --- /dev/null +++ b/src/sheep/api/app.ts @@ -0,0 +1,10 @@ +import request from "@/sheep/utils/request" + +export default { + appList: (params: any) => + request({ + url: "/app/app-menu/app/list", + method: "GET", + params, + }), +} diff --git a/src/sheep/api/index.ts b/src/sheep/api/index.ts index 8ef74b2..f3d36fb 100644 --- a/src/sheep/api/index.ts +++ b/src/sheep/api/index.ts @@ -5,6 +5,7 @@ export { default as actCouponApi } from "./act-coupon" export { default as actCancelApi } from "./act-cancel" export { default as applyApi } from "./apply" export { default as adApi } from "./ad" +export { default as appApi } from "./app" export { default as boxesApi } from "./boxes" export { default as faceApi } from "./face" export { default as feedbackApi } from "./feedback" diff --git a/src/sheep/components/base/base-nav/base-nav.vue b/src/sheep/components/base/base-nav/base-nav.vue index 8016639..6705753 100644 --- a/src/sheep/components/base/base-nav/base-nav.vue +++ b/src/sheep/components/base/base-nav/base-nav.vue @@ -39,16 +39,30 @@ const isTabbar = computed(() => { return router.hasTabbar() }) +const isDashboard = computed(() => { + const pages = getCurrentPages() + const currentPage = pages[pages.length - 1] + if (!currentPage) { + return true + } + return currentPage.route != "pages/root/dashboard" +}) + function doBackClick() { router.back() } + +function doToDashboard() { + router.jump("/pages/root/dashboard", {}, 3) +}