Files
pad-nl-three-uni/pages/home/home.vue

217 lines
5.2 KiB
Vue
Raw Normal View History

2024-02-20 16:29:38 +08:00
<template>
2024-02-23 18:03:59 +08:00
<view class="home_content">
<view class="zd-row header">
2025-10-10 09:40:30 +08:00
<view class="zd-col-8 logo"></view>
2024-02-23 18:03:59 +08:00
<view class="zd-col-8 home_title">首页</view>
<view class="zd-col-8 zd-row jcflexend home_userinfo">
2025-10-10 09:40:30 +08:00
<uni-icons type="person" size="24" color="#666"></uni-icons>
<view class="user_name">{{userName}}</view>
<view class="exit_text" @tap="Quit">退出</view>
2024-02-20 16:29:38 +08:00
</view>
</view>
<view class="welcome_text_wraper">
<view class="welcome_text">{{userName}}, 欢迎进入诺力三期平板系统</view>
2024-02-20 16:29:38 +08:00
</view>
<view class="zd_wrapper">
<view class="zd-row menu-wrap">
<view class="menu-item" v-for="(e, i) in menuList" :key="i" @tap="toPage(e)">
2025-10-10 09:40:30 +08:00
<view class="menu_name_bg" :style="{backgroundImage: `url('/static/images/theme/menu/${e.djlx}.png')`}" :class="`bg_${e.ywlx}`">
<view class="menu-name">{{e.name}}</view>
2024-03-01 15:39:56 +08:00
<view v-show="Number(e.counts) > 0" class="bill_count">{{e.counts}}</view>
2024-02-20 16:29:38 +08:00
</view>
</view>
2024-11-13 19:13:11 +08:00
<view class="menu-item" @tap="toPage1('/pages/management/move-inventory')">
2025-10-10 09:40:30 +08:00
<view class="menu_name_bg bg_YC">
2024-11-13 19:13:11 +08:00
<view class="menu-name">移库</view>
</view>
</view>
<view class="menu-item" @tap="toPage1('/pages/management/check')">
2025-10-10 09:40:30 +08:00
<view class="menu_name_bg bg_PD">
2024-11-13 19:13:11 +08:00
<view class="menu-name">盘点</view>
</view>
</view>
2024-02-20 16:29:38 +08:00
</view>
</view>
</view>
</template>
<script>
2024-05-09 10:58:57 +08:00
import {getBillsCount} from '@/utils/getData2.js'
2024-02-20 16:29:38 +08:00
export default {
data() {
return {
2024-03-07 10:17:05 +08:00
intervalId: null,
2024-06-07 10:08:09 +08:00
// interTime: this.$store.getters.setTime,
interTime: 60000,
2024-06-05 18:44:15 +08:00
userName: this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).person_name : '',
menuList: []
2024-02-20 16:29:38 +08:00
};
},
2024-07-09 10:57:24 +08:00
onLoad () {
2024-02-23 18:03:59 +08:00
this._getBillsCount()
2024-11-18 15:28:38 +08:00
this.timerFun(this._getBillsCount, this.interTime)()
2024-03-07 10:17:05 +08:00
},
beforeDestroy () {
2024-11-18 15:28:38 +08:00
if (this.intervalId !== null) {
clearTimeout(this.intervalId)
this.intervalId = null
}
2024-02-20 16:29:38 +08:00
},
methods: {
2024-11-18 15:28:38 +08:00
timerFun(f, time) {
let _this = this
return function backFun() {
clearTimeout(_this.intervalId)
_this.intervalId = setTimeout(function () {
f()
backFun()
}, time)
}
},
2024-05-09 10:58:57 +08:00
async _getBillsCount () {
let res = await getBillsCount()
if (res.code === 1) {
this.menuList = [...res.result]
} else {
uni.showToast({
title: res.desc,
icon: 'none'
})
}
2024-02-20 16:29:38 +08:00
},
toPage (e) {
let url = ''
2024-05-29 09:41:09 +08:00
if (e.ywlx === 'DB') {
2025-04-15 09:53:57 +08:00
url = '/pages/management/alloc-maintenance_new?type=' + e.ywlx
2024-05-29 09:41:09 +08:00
} else if (e.ywlx === 'SH') {
2025-04-15 09:53:57 +08:00
url = '/pages/management/receive-confirm_new?type=' + e.ywlx
2024-05-29 09:41:09 +08:00
} else {
2024-12-17 14:29:57 +08:00
if (e.djlx === 'LLCKD') {
url = '/pages/management/in-storage_LLCKD?id=' + e.djlx + '&name=' + e.name + '&type=' + e.ywlx
} else {
url = '/pages/management/in-storage_new?id=' + e.djlx + '&name=' + e.name + '&type=' + e.ywlx
}
2024-05-29 09:41:09 +08:00
}
2024-05-09 10:58:57 +08:00
uni.redirectTo({
2024-02-20 16:29:38 +08:00
url: url
})
2024-02-20 16:29:38 +08:00
},
2024-11-13 19:13:11 +08:00
toPage1 (e) {
uni.redirectTo({
url: e
})
},
2024-02-20 16:29:38 +08:00
Quit () {
2024-05-09 10:58:57 +08:00
this.$store.dispatch('delUserInfo', '')
uni.redirectTo({
url: '/pages/login/login'
})
2024-02-20 16:29:38 +08:00
}
}
}
</script>
2025-10-10 09:40:30 +08:00
<style lang="stylus" scoped>
2024-02-20 16:29:38 +08:00
@import '../../common/style/mixin.styl';
2024-02-23 18:03:59 +08:00
.home_content
position relative
2024-12-13 14:46:20 +08:00
_wh(100%, 100vh)
2025-10-10 09:40:30 +08:00
background-color #f3f3f3
2024-02-20 16:29:38 +08:00
.header
2025-10-10 09:40:30 +08:00
height 40px
2024-03-04 15:15:15 +08:00
padding 0 15px
2025-10-10 09:40:30 +08:00
margin-bottom 10px
justify-content space-between
background: #fff
.logo
height 40px
2024-02-23 18:03:59 +08:00
.home_title
2025-10-10 09:40:30 +08:00
_font(24px,35px,#0f0f0f,,center)
.home_userinfo
2024-03-04 15:15:15 +08:00
height 35px
.user_icon
2024-03-04 15:15:15 +08:00
_wh(25px, 25px)
margin-right 5px
_bis(,'../../static/images/user_icon.png', 100%, 100%,center)
.user_name
2025-10-10 09:40:30 +08:00
_font(17px,17px,#666,,center)
2024-03-04 15:15:15 +08:00
padding-right 5px
margin 9px 10px 9px 0
.exit_text
2025-10-10 09:40:30 +08:00
height 22px
_font(14px,22px,#fff,,center)
padding 0 20px
2024-03-04 15:15:15 +08:00
margin 2.5px 0
2025-10-10 09:40:30 +08:00
background-color #fc4300
border-radius 20px
.welcome_text_wraper
2024-12-19 15:28:28 +08:00
height 40px
2025-10-10 09:40:30 +08:00
margin 0 15px
.welcome_text
2025-10-10 09:40:30 +08:00
_font(22px, 40px, #373737,,)
2024-03-04 15:15:15 +08:00
padding-left 20px
font-family: YouSheBiaoTiHei
2024-02-20 16:29:38 +08:00
.zd_wrapper
2025-10-10 09:40:30 +08:00
_wh(calc(100% - 30px),calc(100% - 100px))
margin 0px 15px
padding 20px 16px
background-color #fff
border 1px solid #ebebeb
2024-02-20 16:29:38 +08:00
.menu-wrap
flex-wrap wrap
justify-content flex-start
align-content center
2024-02-20 16:29:38 +08:00
height 100%
.menu-item
2025-10-10 09:40:30 +08:00
position relative
width calc(20% - 16px)
margin-right 20px
margin-top 15px
&:nth-child(5n)
margin-right 0
&:nth-child(-n+5)
margin-top 0
.menu_name_bg
position relative
2025-10-10 09:40:30 +08:00
_wh(100%, 90px)
2024-02-20 16:29:38 +08:00
margin 0 auto
2024-05-29 09:41:09 +08:00
border-radius 10px
2025-10-10 09:40:30 +08:00
background-repeat no-repeat
background-size: auto calc(100% - 25px);
background-position top center
.bg_OUT
background-color #ebfcf4
.bg_IN
background-color #fff6ef
.bg_DB, .bg_SH
background-color #eff3fe
.menu-name
2025-10-10 09:40:30 +08:00
position absolute
bottom 5px
_wh(100%, 25px)
_font(18px, 25px, #0f0f0f,400,center)
.bill_count
position absolute
2024-03-04 15:15:15 +08:00
top -10px
2025-10-10 09:40:30 +08:00
right -13px
_wh(40px, 22px)
background-color $red
2025-10-10 09:40:30 +08:00
border-radius 14px
_font(14px, 22px, #fff,bold,center)
.left_bg
position absolute
left 0
top 0
2024-03-04 15:15:15 +08:00
_wh(25px, 100%)
_bis(,'../../static/images/hud_left.png', 100%, ,center)
.right_bg
left auto
right 0
background-image url('../../static/images/hud_right.png')
2025-10-10 09:40:30 +08:00
.bg_YC
background-image: url('../../static/images/theme/menu/YC.png')
background-color: #fff0ee
.bg_PD
background-image: url('../../static/images/theme/menu/PD.png')
background-color: #fff0ee
</style>