Commit 06340042 by pangchong

feat: 首页样式调整

parent a75b6822
...@@ -25,5 +25,6 @@ declare module 'vue' { ...@@ -25,5 +25,6 @@ declare module 'vue' {
GlobalUpload: typeof import('./src/mocp/components/global-upload/global-upload.vue')['default'] GlobalUpload: typeof import('./src/mocp/components/global-upload/global-upload.vue')['default']
// 自定义组件 // 自定义组件
CustomScore: typeof import('./src/mocp/components/widget/custom-score.vue')['default'] CustomScore: typeof import('./src/mocp/components/widget/custom-score.vue')['default']
CustomTabbar: typeof import('./src/mocp/components/widget/custom-tabbar.vue')['default']
} }
} }
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<view :style="{ height: safeAreaInsets?.top + 'px' }" v-if="custom"></view> <view :style="{ height: safeAreaInsets?.top + 'px' }" v-if="custom"></view>
<!-- 自定义导航栏 --> <!-- 自定义导航栏 -->
<global-navbar :title="title" v-if="showNavbar"> <global-navbar :title="title" v-if="showNavbar">
<template #left v-if="pages.length > 1"> <template #left v-if="pages.length > 1 && showNavLeft">
<up-icon v-if="navLeftType == 'icon'" :name="navLeftIcon" size="16" @tap="handleLeftClick"></up-icon> <up-icon v-if="navLeftType == 'icon'" :name="navLeftIcon" size="16" @tap="handleLeftClick"></up-icon>
<view v-if="navLeftType == 'text'" class="cancel" @tap="handleLeftClick">{{ navLeftText }}</view> <view v-if="navLeftType == 'text'" class="cancel" @tap="handleLeftClick">{{ navLeftText }}</view>
</template> </template>
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
<global-button type="primary" size="large" @tap="handleFooterClick">{{ footerBtnText }}</global-button> <global-button type="primary" size="large" @tap="handleFooterClick">{{ footerBtnText }}</global-button>
</view> </view>
<slot name="bottom"></slot> <slot name="bottom"></slot>
<custom-tabbar :tabbarValue="tabbarValue"></custom-tabbar>
</template> </template>
</z-paging> </z-paging>
</template> </template>
...@@ -71,6 +72,16 @@ const ps = defineProps({ ...@@ -71,6 +72,16 @@ const ps = defineProps({
type: [String, Number], type: [String, Number],
default: 0 default: 0
}, },
//是否显示底部导航
showTabbar: {
type: Boolean,
default: false
},
//底部导航选中的下标
tabbarValue: {
type: [Number, String],
default: 1
},
//是否自动加载 //是否自动加载
auto: { auto: {
type: Boolean, type: Boolean,
...@@ -81,6 +92,11 @@ const ps = defineProps({ ...@@ -81,6 +92,11 @@ const ps = defineProps({
type: Boolean, type: Boolean,
default: true default: true
}, },
//是否显示nav左边插槽
showNavLeft: {
type: Boolean,
default: true
},
//nav左边插槽类型:icon,text //nav左边插槽类型:icon,text
navLeftType: { navLeftType: {
type: String, type: String,
......
<template>
<up-tabbar :value="tabbarValue" :fixed="false" :placeholder="false" :safeAreaInsetBottom="true" activeColor="#165dff" inactiveColor="#4e5969">
<template v-for="item in list" :key="item.name">
<up-tabbar-item :text="item.text" @click="handleClickTabbar">
<template #active-icon>
<image class="u-page__item__slot-icon" :src="item.selectedIconPath" mode="widthFix"></image>
</template>
<template #inactive-icon>
<image class="u-page__item__slot-icon" :src="item.iconPath" mode="widthFix"></image>
</template>
</up-tabbar-item>
</template>
</up-tabbar>
</template>
<script setup>
import { ref } from 'vue'
const ps = defineProps({
tabbarValue: {
type: [Number, String],
default: 1
}
})
const list = ref([
{
pagePath: '/home/index',
text: '首页',
iconPath: '/static/mocp/image/menu/home.png',
selectedIconPath: '/static/mocp/image/menu/home-select.png'
},
{
pagePath: '/panel/index',
text: '工作台',
iconPath: '/static/mocp/image/menu/panel.png',
selectedIconPath: '/static/mocp/image/menu/panel-select.png'
},
{
pagePath: '/chat/index',
text: '沟通',
iconPath: '/static/mocp/image/menu/chat.png',
selectedIconPath: '/static/mocp/image/menu/chat-select.png'
}
])
const handleClickTabbar = (index) => {
if (ps.tabbarValue != index) {
uni.$mocpJump.reLaunch(list.value[index].pagePath)
}
}
</script>
<style lang="scss" scoped>
.u-page__item__slot-icon {
width: 48rpx;
height: 48rpx;
}
</style>
...@@ -4,6 +4,7 @@ import { defineStore } from 'pinia' ...@@ -4,6 +4,7 @@ import { defineStore } from 'pinia'
const useBaseStore = defineStore('base', { const useBaseStore = defineStore('base', {
state: () => { state: () => {
return { return {
isloading: false, //是否加载
selectList: { selectList: {
deviceNumSelect: [] //机号 deviceNumSelect: [] //机号
}, },
...@@ -13,6 +14,7 @@ const useBaseStore = defineStore('base', { ...@@ -13,6 +14,7 @@ const useBaseStore = defineStore('base', {
getters: {}, getters: {},
actions: { actions: {
async initSysData() { async initSysData() {
if (this.isloading) return
uni.showLoading({ uni.showLoading({
title: '正在加载系统所有基本参数中,请稍后!', title: '正在加载系统所有基本参数中,请稍后!',
mask: true mask: true
...@@ -21,6 +23,7 @@ const useBaseStore = defineStore('base', { ...@@ -21,6 +23,7 @@ const useBaseStore = defineStore('base', {
await this.getAircraftNumbers() await this.getAircraftNumbers()
await this.getBasicParamsList() await this.getBasicParamsList()
uni.hideLoading() uni.hideLoading()
this.isloading = true
} catch (error) { } catch (error) {
uni.hideLoading() uni.hideLoading()
} }
......
...@@ -69,7 +69,7 @@ const useUserStore = defineStore('user', { ...@@ -69,7 +69,7 @@ const useUserStore = defineStore('user', {
}) })
} }
//跳转工作台 //跳转工作台
uni.$mocpJump.navigateTo('/panel/index') uni.$mocpJump.redirectTo('/panel/index')
}, },
//退出登录 //退出登录
handleLogOut() { handleLogOut() {
......
...@@ -42,15 +42,9 @@ ...@@ -42,15 +42,9 @@
} }
}, },
{ {
"path": "pages/modules/mocp/mine/index", "path": "pages/modules/mocp/home/index",
"style": { "style": {
"navigationBarTitleText": "个人中心" "navigationBarTitleText": "首页"
}
},
{
"path": "pages/modules/mocp/experience/index",
"style": {
"navigationBarTitleText": "经验库"
} }
}, },
{ {
......
<template> <template>
<global-page title="沟通"></global-page> <global-page title="沟通" :showNavLeft="false" showTabbar :tabbarValue="2"></global-page>
</template> </template>
<script setup></script> <script setup></script>
......
<template>经验库</template>
<script setup></script>
<style lang="scss"></style>
<template> <template>
<global-page title="个人中心"> <global-page title="首页" :showNavLeft="false" showTabbar :tabbarValue="0">
<template #bottom> <template #bottom>
<global-button size="large" type="primary" @tap="handleLogOut">退出登录</global-button> <global-button size="large" type="primary" @tap="handleLogOut">退出登录</global-button>
</template> </template>
......
<template> <template>
<view class="content" :style="{ height: `calc(100vh - 386rpx - ${safeAreaInsets?.top + 'px'})` }"> <view class="content" :style="{ height: `calc(100vh - 344rpx - ${safeAreaInsets?.top + 'px'} - ${safeAreaInsets?.bottom + 'px'} - 50px)` }">
<view class="tab-nav"> <view class="tab-nav">
<global-tabs :list="tabNav" @handleClick="handleClick"></global-tabs> <global-tabs :list="tabNav" @handleClick="handleClick"></global-tabs>
</view> </view>
......
...@@ -14,22 +14,20 @@ ...@@ -14,22 +14,20 @@
</view> </view>
<view class="navbar-bottom-list"> <view class="navbar-bottom-list">
<view class="list-item"> <view class="list-item">
<image class="list-item-image" src="/static/mocp/image/panel/wdrw.png" /> <image class="list-item-image" src="/static/mocp/image/panel/wdxx.png" />
<view class="list-item-title">我的任务</view> <view class="list-item-msg">
<view class="list-item-txt">24</view> <view class="list-item-title">我的待办</view>
<view class="list-item-txt">24</view>
</view>
</view> </view>
<view class="list-item-line"></view> <view class="list-item-line"></view>
<view class="list-item"> <view class="list-item">
<image class="list-item-image" src="/static/mocp/image/panel/gjrw.png" /> <image class="list-item-image" src="/static/mocp/image/panel/wdxx.png" />
<view class="list-item-title">跟机任务</view> <view class="list-item-msg">
<view class="list-item-txt">24</view> <view class="list-item-title">我的消息</view>
<view class="list-item-txt">24</view>
</view>
</view> </view>
<!-- <view class="list-item-line"></view>
<view class="list-item">
<image class="list-item-image" src="static/mocp/image/mocp/panel/AOGrw.png" />
<view class="list-item-title">AOG任务</view>
<view class="list-item-txt">24</view>
</view> -->
</view> </view>
</view> </view>
</template> </template>
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
height: 80rpx; height: 80rpx;
} }
.info { .info {
color: #fff;
.place { .place {
font-size: 28rpx; font-size: 28rpx;
} }
...@@ -42,27 +43,26 @@ ...@@ -42,27 +43,26 @@
align-items: center; align-items: center;
margin: 0 32rpx; margin: 0 32rpx;
border-radius: 16rpx; border-radius: 16rpx;
padding: 12rpx 128rpx 12rpx 128rpx; padding: 24rpx 44rpx 40rpx 28rpx;
.list-item { .list-item {
text-align: center; display: flex;
&-image { &-image {
width: 84rpx; width: 132rpx;
height: 84rpx; height: 132rpx;
} }
&-title { &-msg {
font-size: 24rpx; text-align: center;
color: $mocp-text-4; font-size: 28rpx;
color: $mocp-text-5;
margin-top: 36rpx;
} }
&-txt { &-txt {
font-weight: bold; font-weight: bold;
font-size: 40rpx;
color: $mocp-text-5;
line-height: 56rpx;
} }
&-line { &-line {
width: 2rpx; width: 2rpx;
height: 58rpx; height: 58rpx;
background: #e4f1ff; background: #e6f0fe;
} }
} }
} }
......
<template> <template>
<global-page :showNavbar="false"> <global-page :showNavbar="false" showTabbar :tabbarValue="1">
<!-- 导航栏 --> <!-- 导航栏 -->
<template #top> <template #top>
<image class="page-bg" src="/static/mocp/image/panel/page-bg.png" /> <image class="page-bg" src="/static/mocp/image/panel/page-bg.png" />
......
src/static/mocp/image/panel/logo.png

18.5 KB | W: | H:

src/static/mocp/image/panel/logo.png

7.44 KB | W: | H:

src/static/mocp/image/panel/logo.png
src/static/mocp/image/panel/logo.png
src/static/mocp/image/panel/logo.png
src/static/mocp/image/panel/logo.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment