feat:基座页面
This commit is contained in:
1 parent
36a8665bae
commit
4b1e41b550
6 files changed
+86
-17
No files matched your search
@@ -21,8 +21,7 @@ VITE_OAUTH2_APP_CLIENT='mini:mini'
|
|||||||
VITE_APP_DEV_SERVICE = http://localhost:9999
|
VITE_APP_DEV_SERVICE = http://localhost:9999
|
||||||
#VITE_APP_DEV_SERVICE = https://rj4jv5rwqs.by.takin.cc
|
#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
|
# VITE_IMAGE_DEV_PATH = https://rj4jv5rwqs.by.takin.cc
|
||||||
# ----------------------------- end 开发环境 end ------------------------------------
|
# ----------------------------- end 开发环境 end ------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ import { reactive, computed } from "vue"
|
|||||||
import { onHide, onShow } from "@dcloudio/uni-app"
|
import { onHide, onShow } from "@dcloudio/uni-app"
|
||||||
|
|
||||||
import { router } from "@@/index"
|
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"
|
import Empty from "@@/components/empty/empty.vue"
|
||||||
|
|
||||||
@@ -13,10 +15,8 @@ const state = reactive<any>({
|
|||||||
image: "/static/swiper/swiper-1.png"
|
image: "/static/swiper/swiper-1.png"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
noticeList: [
|
noticeList: [],
|
||||||
|
appMenuList: [],
|
||||||
],
|
|
||||||
appList: []
|
|
||||||
})
|
})
|
||||||
const groupSize = 3
|
const groupSize = 3
|
||||||
const shouldScroll = computed(() => state.noticeList.length > groupSize)
|
const shouldScroll = computed(() => state.noticeList.length > groupSize)
|
||||||
@@ -38,6 +38,7 @@ const groupedNoticeList = computed(() => {
|
|||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
getNoticeList()
|
getNoticeList()
|
||||||
|
getAppMenuList()
|
||||||
})
|
})
|
||||||
|
|
||||||
onHide(() => {
|
onHide(() => {
|
||||||
@@ -58,6 +59,24 @@ const getNoticeList = async () => {
|
|||||||
console.log("获取通知公告列表意外的错误error:", error);
|
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>
|
</script>
|
||||||
|
|
||||||
<template>
|
<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]">
|
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>
|
||||||
|
<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>
|
</view>
|
||||||
</crud-layout>
|
</crud-layout>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="h-30rpx" />
|
<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"
|
<view class="w-full text-center sub-text-28 p-y-20rpx rounded-40rpx border-solid border-#0094ff"
|
||||||
@tap="doChangeRole">
|
@tap="doChangeRole">
|
||||||
切换角色
|
切换角色
|
||||||
|
|||||||
@@ -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,
|
||||||
|
}),
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ export { default as actCouponApi } from "./act-coupon"
|
|||||||
export { default as actCancelApi } from "./act-cancel"
|
export { default as actCancelApi } from "./act-cancel"
|
||||||
export { default as applyApi } from "./apply"
|
export { default as applyApi } from "./apply"
|
||||||
export { default as adApi } from "./ad"
|
export { default as adApi } from "./ad"
|
||||||
|
export { default as appApi } from "./app"
|
||||||
export { default as boxesApi } from "./boxes"
|
export { default as boxesApi } from "./boxes"
|
||||||
export { default as faceApi } from "./face"
|
export { default as faceApi } from "./face"
|
||||||
export { default as feedbackApi } from "./feedback"
|
export { default as feedbackApi } from "./feedback"
|
||||||
|
|||||||
@@ -39,16 +39,30 @@ const isTabbar = computed(() => {
|
|||||||
return router.hasTabbar()
|
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() {
|
function doBackClick() {
|
||||||
router.back()
|
router.back()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function doToDashboard() {
|
||||||
|
router.jump("/pages/root/dashboard", {}, 3)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view class="navbar" :style="{ backgroundColor: bgColor, height: '44px' }">
|
<view class="navbar" :style="{ backgroundColor: bgColor, height: '44px' }">
|
||||||
<view class="navbar_left" v-if="showLeft && !isTabbar" @tap="doBackClick">
|
<view class="navbar_left">
|
||||||
<text class="sicon-back icon" v-if="isHistiry" />
|
<view class="sicon-back icon" @tap="doBackClick" />
|
||||||
<text class="sicon-home icon" v-else />
|
<view v-if="isDashboard" class="navbar_left_line" />
|
||||||
|
<view v-if="isDashboard" class="sicon-home icon" @tap="doToDashboard" />
|
||||||
</view>
|
</view>
|
||||||
<view class="navbar_title" :style="{ color: titleColor }">{{ props.title }}</view>
|
<view class="navbar_title" :style="{ color: titleColor }">{{ props.title }}</view>
|
||||||
<view v-if="props.rightIcon" class="navbar_right" @tap="emit('rightClick')">
|
<view v-if="props.rightIcon" class="navbar_right" @tap="emit('rightClick')">
|
||||||
@@ -68,14 +82,25 @@ function doBackClick() {
|
|||||||
&_left {
|
&_left {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 20rpx;
|
left: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
height: 56rpx;
|
||||||
|
border-radius: 28rpx;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
box-shadow: 0px 0px 4rpx rgba(51, 51, 51, 0.08), 0px 4rpx 6rpx 2rpx rgba(102, 102, 102, 0.12);
|
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;
|
&_line {
|
||||||
height: 56rpx;
|
width: 1rpx;
|
||||||
display: flex;
|
height: 25rpx;
|
||||||
justify-content: center;
|
background: #999;
|
||||||
align-items: center;
|
}
|
||||||
|
|
||||||
|
&>.icon {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 56rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&_right {
|
&_right {
|
||||||
|
|||||||
Reference in new issue
Block a user