Files
hht-hl-three-uni/pages/home/home.vue

158 lines
3.7 KiB
Vue
Raw Normal View History

2023-08-29 15:11:11 +08:00
<template>
2024-01-16 18:20:39 +08:00
<view class="home_wraper">
<view class="zd_content">
<view class="header">首页</view>
<view class="userInfo-wrap">
<view class="userInfo">
<text v-if="userName !== ''" class="p1">{{userName}}</text>
<text class="p2">欢迎进入海亮三线LMS系统</text>
</view>
<view class="exit" @tap="Quit">
<view class="icon-exit"></view>
<view class="exit-text">退出</view>
2023-08-29 15:11:11 +08:00
</view>
</view>
2024-01-16 18:20:39 +08:00
<view class="zd_home_wrapper">
<view class="menus_wrap" v-for="(e, i) in menuList" :key="e.id">
<view class="fir_menu_wrap">
<view class="fir_menu_tip"></view>
<view class="fir_menu_title">{{e.name}}</view>
</view>
<view class="sec_menu_wrap">
<view class="sec_menu-item" v-for="(el, i) in e.sonTree" :key="e.menu_id" @tap="toPage(el)">
<image class="menu-img" :src="require('../../static/image/menu/' + el.icon + '.png')" alt="">
<view class="menu-name">{{el.name}}</view>
</view>
2023-08-29 15:11:11 +08:00
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
2023-09-12 13:33:43 +08:00
userName: '',
2023-09-08 13:15:03 +08:00
menuList: [
2024-01-16 18:20:39 +08:00
{id: '1', name: '仓储管理', sonTree: [
{menu_id: '1', icon: 'RF01', name: '半成品入库', path: '/pages/modules/SemifinishedInStore'},
{menu_id: '2', icon: 'RF02', name: '半成品出库', path: '/pages/modules/SemifinishedOutStore'},
{menu_id: '3', icon: 'RF03', name: '空箱出库', path: '/pages/modules/EmptyOutStore'}
]}
],
2023-08-29 15:11:11 +08:00
show: false,
secM: []
};
},
created () {
2023-09-08 13:15:03 +08:00
this.$store.dispatch('setPublicObj', '')
2023-09-12 13:33:43 +08:00
if (this.$store.getters.userInfo) {
this.userName = JSON.parse(this.$store.getters.userInfo).username
}
2023-08-29 15:11:11 +08:00
},
methods: {
async _authority () {
let res = await authority()
this.menuList = [...res.sonTree]
},
2024-01-16 18:20:39 +08:00
toPage (e) {
2023-08-29 15:11:11 +08:00
let url = e.path
uni.redirectTo({
url: url
})
},
Quit () {
this.$store.dispatch('delUserInfo')
uni.redirectTo({
url: '/pages/login/login'
})
}
}
}
</script>
<style lang="stylus">
@import '../../common/style/mixin.styl';
2024-01-16 18:20:39 +08:00
.home_wraper
_wh(100%, 100%)
2023-08-29 15:11:11 +08:00
.zd_content
2024-01-16 18:20:39 +08:00
padding 0 24rpx
height 100%
padding-top calc(var(--status-bar-height) + 86rpx)
background linear-gradient(to bottom, #f8e6db 0%, #f6f6f6 30%, #f6f6f6 100%)
2023-08-29 15:11:11 +08:00
.header
2024-01-16 18:20:39 +08:00
position fixed
left 0
top 0
padding-top var(--status-bar-height)
z-index 100
_wh(100%, calc(var(--status-bar-height) + 86rpx))
background-color #f8e6db
2023-08-29 15:11:11 +08:00
_font(36rpx,86rpx,#333,,center)
.userInfo-wrap
_fj()
_wh(100%,160rpx)
padding 0 30rpx
background-color $red
_bis('../../static/image/info_bg.png',auto,100%,right,bottom)
border-radius 12rpx
2024-01-16 18:20:39 +08:00
margin-bottom 24rpx
2023-08-29 15:11:11 +08:00
.userInfo
_fj(,flex-start,column)
.p1
_font(34rpx,1,#fff)
padding-bottom 18rpx
.p2
_font(26rpx,1,#fff)
.exit
_fj()
height 47rpx
padding 0 15rpx
border 1px solid #FF967C
border-radius 20rpx
.icon-exit
_wh(22rpx, 22rpx)
_bis('../../static/image/exit.png',22rpx)
.exit-text
_font(24rpx,47rpx,#fff,,right)
padding-left 10rpx
2024-01-16 18:20:39 +08:00
.zd_home_wrapper
_wh(100%, calc(100% - 208rpx))
background-color #fff
border-radius: 12rpx;
padding: 14rpx;
margin-bottom: 24rpx;
overflow-y auto
.menus_wrap
width 100%
margin-bottom 24rpx
.fir_menu_wrap
_wh(100%, 98rpx)
.fir_menu_title
_font(32rpx, 98rpx, #333, bold,)
.sec_menu_wrap
2023-08-29 15:11:11 +08:00
_fj(flex-start,flex-start,,wrap)
align-content: flex-start
2024-01-16 18:20:39 +08:00
.sec_menu-item
2023-08-29 15:11:11 +08:00
_fj()
flex-direction column
_wh(30%, auto)
margin-bottom 40rpx
_font(26rpx, 60rpx,#e74f1a,,center)
&:nth-child(3n+2)
margin-left 5%
margin-right 5%
::v-deep .menu-img
_wh(100%, auto)
img
position relative
opacity 1
_wh(55%, auto)
margin 0 auto 0.2rpx
.menu-name
_font(28rpx, 38rpx, #444,,center)
</style>