feat:基座页面

This commit is contained in:
dzc committed 2026-03-13 11:08:08 +08:00
1 parent 36a8665bae
commit 4b1e41b550
6 files changed
+86 -17

No files matched your search

+1 -2
View File
@@ -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 ------------------------------------
+39 -5
View File
@@ -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>
+1 -1
View File
@@ -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">
切换角色
+10
View File
@@ -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,
}),
}
+1
View File
@@ -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"
@@ -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)
}
</script>
<template>
<view class="navbar" :style="{ backgroundColor: bgColor, height: '44px' }">
<view class="navbar_left" v-if="showLeft && !isTabbar" @tap="doBackClick">
<text class="sicon-back icon" v-if="isHistiry" />
<text class="sicon-home icon" v-else />
<view class="navbar_left">
<view class="sicon-back icon" @tap="doBackClick" />
<view v-if="isDashboard" class="navbar_left_line" />
<view v-if="isDashboard" class="sicon-home icon" @tap="doToDashboard" />
</view>
<view class="navbar_title" :style="{ color: titleColor }">{{ props.title }}</view>
<view v-if="props.rightIcon" class="navbar_right" @tap="emit('rightClick')">
@@ -68,14 +82,25 @@ function doBackClick() {
&_left {
position: absolute;
left: 20rpx;
display: flex;
align-items: center;
height: 56rpx;
border-radius: 28rpx;
background: #fff;
box-shadow: 0px 0px 4rpx rgba(51, 51, 51, 0.08), 0px 4rpx 6rpx 2rpx rgba(102, 102, 102, 0.12);
border-radius: 28rpx;
width: 56rpx;
height: 56rpx;
display: flex;
justify-content: center;
align-items: center;
&_line {
width: 1rpx;
height: 25rpx;
background: #999;
}
&>.icon {
display: flex;
justify-content: center;
align-items: center;
width: 56rpx;
}
}
&_right {