feat:基座页面
This commit is contained in:
1 parent
36a8665bae
commit
4b1e41b550
6 files changed
+86
-17
No files matched your search
@@ -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<any>({
|
||||
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);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -106,6 +125,21 @@ const getNoticeList = async () => {
|
||||
class="container-title font-size-28rpx absolute top-0 left-0 color-white w-200rpx h-50rpx line-height-50rpx text-center rounded-lt-16rpx bg-gradient-to-r from-[#22b0ff] to-[#557bfa]">
|
||||
常用功能
|
||||
</view>
|
||||
<view class="w-full h-50rpx" />
|
||||
<view v-if="state?.appMenuList?.length > 0">
|
||||
<view class="grid grid-cols-3 h-full items-center gap-y-30rpx p-y-30rpx">
|
||||
<view class="flex flex-col items-center justify-center" v-for="(v, i) in state.appMenuList"
|
||||
:key="i">
|
||||
<view class="flex-col-center">
|
||||
<image class="size-100rpx" :src="filePath(v.icon)" mode="aspectFill" />
|
||||
<view class="m-t-10rpx sub-text-26">{{ v.title }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<empty text="暂无App" />
|
||||
</view>
|
||||
</view>
|
||||
</crud-layout>
|
||||
</template>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="h-30rpx" />
|
||||
<view class="flex-col-center mt-40rpx mx-30rpx">
|
||||
<view v-if="false" class="flex-col-center mt-40rpx mx-30rpx">
|
||||
<view class="w-full text-center sub-text-28 p-y-20rpx rounded-40rpx border-solid border-#0094ff"
|
||||
@tap="doChangeRole">
|
||||
切换角色
|
||||
|
||||
Reference in new issue
Block a user