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

180 lines
4.4 KiB
Vue
Raw Normal View History

2023-09-04 15:34:15 +08:00
<template>
<view class="zd_content">
<view class="header">首页</view>
<view class="userInfo-wrap">
<view class="userInfo">
<text class="p1">{{userName}}</text>
2023-09-05 09:40:19 +08:00
<text class="p2">欢迎进入海亮智能一线扩产LMS手持系统</text>
2023-09-04 15:34:15 +08:00
</view>
<view class="exit" @tap="Quit">
<view class="icon-exit"></view>
<view class="exit-text">退出</view>
</view>
</view>
<view class="zd_wrapper">
<view class="menu-wrap">
<view class="menu-item" v-for="(e, i) in menuList" :key="i" @tap="toPage1(e)">
<image class="menu-img" :src="require('../../static/image/menu/' + e.icon + '.png')" alt="">
<view class="menu-name">{{e.name}}</view>
</view>
</view>
</view>
<view v-if="show === true" class="sec_menu_wraper">
<view class="sec_menu_w">
<view class="menu-item" v-for="(e, i) in secM" :key="i" @click="toPage2(e)">
<view class="sec_menu-col_inner">
<view class="menu-name menu-name_inner">{{e.name}}</view>
</view>
</view>
</view>
<view class="cancel">
<view class="iconfont cancel_icon" @tap="show = false"></view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
userName: this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).username : '',
2023-09-08 09:42:08 +08:00
menuList: [
{menu_id: '1', icon: 'RF06', name: '仓储管理', sonTree: [
{menu_id: '1', name: '原辅料收料', path: '/pages/warehouse/RawmaterialRevice'},
{menu_id: '2', name: '半成品入库', path: '/pages/warehouse/SemifinishedInStore'},
{menu_id: '3', name: '半成品出库', path: '/pages/warehouse/SemifinishedOutStore'},
{menu_id: '4', name: '空箱出库', path: '/pages/warehouse/EmptyOutStore'}
]},
{menu_id: '2', icon: 'RF01', name: '设备管理', sonTree: [
{menu_id: '1', name: '设备作业管理', path: '/pages/device/WorkManage'},
{menu_id: '2', name: '设备维修作业', path: '/pages/device/RepairWork'},
2023-09-11 14:19:59 +08:00
{menu_id: '3', name: '设备点检作业', path: '/pages/modules/CheckWork'},
{menu_id: '4', name: '设备润滑作业', path: '/pages/modules/LubricateWork'},
{menu_id: '5', name: '设备保养作业', path: '/pages/modules/MaintainWork'}
2023-09-08 09:42:08 +08:00
]}
],
2023-09-04 15:34:15 +08:00
show: false,
secM: []
};
},
created () {
2023-09-08 13:22:19 +08:00
this.$store.dispatch('setPublicObj', '')
2023-09-04 15:34:15 +08:00
},
methods: {
toPage1 (e) {
if (e.sonTree.length > 0) {
this.show = true
this.secM = e.sonTree
}
},
toPage2 (e) {
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';
.zd_content
padding-top 0
.header
height 86rpx
_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
margin-bottom 20rpx
.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
.menu-wrap
_fj(flex-start,flex-start,,wrap)
align-content: flex-start
.menu-item
_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)
.sec_menu_wraper
position fixed
top 0
left 0
_wh(100%, 100%)
background-color rgba(0, 0, 0, .9)
z-index 2017
flex-direction column
.sec_menu_w
_fj()
_wh(100%, calc(100% - 100rpx))
padding 0 24rpx
flex-wrap wrap
align-content center
&::after
content ''
display block
_wh(30%,0)
.sec_menu-col
background-color transparent
border none
height auto
.sec_menu-col_inner
_fj(center)
_wh(160rpx, 160rpx)
border-radius 50%
background-color $yellow
margin 0 auto
.menu-name_inner
color #fff
padding 0 20rpx
.cancel
_wh(100%, 100rpx)
padding 0 24rpx
overflow hidden
background-color rgba(255, 255, 255, .3)
box-shadow 0 1rpx 4rpx 0 rgba(160,160,160,0.9)
</style>