Files
pad-nl-three-uni/pages/home/home.vue
2024-11-18 15:28:38 +08:00

243 lines
7.5 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="home_content">
<view class="zd-row header">
<view class="zd-col-8 home_title">首页</view>
<view class="zd-col-8 zd-row jcflexend home_userinfo">
<view class="user_icon"></view>
<view class="user_name">{{userName}}</view>
<view class="exit_text" @tap="Quit">退出</view>
</view>
</view>
<view class="welcome_text_wraper">
<view class="welcome_text">{{userName}}, 欢迎进入诺力三期平板系统</view>
</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)">
<!-- <view class="menu_name_bg" :class="'bg_texture_' + i"> -->
<view class="menu_name_bg" :class="'bg_texture_' + e.ywlx">
<view class="menu-name">{{e.name}}</view>
<view v-show="Number(e.counts) > 0" class="bill_count">{{e.counts}}</view>
</view>
</view>
<view class="menu-item" @tap="toPage1('/pages/management/move-inventory')">
<view class="menu_name_bg bg_texture_YC">
<view class="menu-name">移库</view>
</view>
</view>
<view class="menu-item" @tap="toPage1('/pages/management/check')">
<view class="menu_name_bg bg_texture_PD">
<view class="menu-name">盘点</view>
</view>
</view>
</view>
</view>
<view class="left_bg"></view>
<view class="left_bg right_bg"></view>
</view>
</template>
<script>
import {getBillsCount} from '@/utils/getData2.js'
export default {
data() {
return {
intervalId: null,
// interTime: this.$store.getters.setTime,
interTime: 60000,
userName: this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).person_name : '',
menuList: []
};
},
onLoad () {
this._getBillsCount()
this.timerFun(this._getBillsCount, this.interTime)()
},
beforeDestroy () {
if (this.intervalId !== null) {
clearTimeout(this.intervalId)
this.intervalId = null
}
},
methods: {
timerFun(f, time) {
let _this = this
return function backFun() {
clearTimeout(_this.intervalId)
_this.intervalId = setTimeout(function () {
f()
backFun()
}, time)
}
},
async _getBillsCount () {
let res = await getBillsCount()
if (res.code === 1) {
this.menuList = [...res.result]
} else {
uni.showToast({
title: res.desc,
icon: 'none'
})
}
},
toPage (e) {
let url = ''
if (e.ywlx === 'DB') {
url = '/pages/management/alloc-maintenance_new'
} else if (e.ywlx === 'SH') {
url = '/pages/management/receive-confirm_new'
} else {
url = '/pages/management/in-storage_new?id=' + e.djlx + '&name=' + e.name + '&type=' + e.ywlx
}
uni.redirectTo({
url: url
})
},
toPage1 (e) {
uni.redirectTo({
url: e
})
},
Quit () {
this.$store.dispatch('delUserInfo', '')
uni.redirectTo({
url: '/pages/login/login'
})
}
}
}
</script>
<style lang="stylus">
@import '../../common/style/mixin.styl';
.home_content
position relative
_wh(100%, 100%)
_bis(,'../../static/images/home_bg.jpg', 100%, 100%,bottom)
.header
height 60px
padding 0 15px
align-items flex-start
justify-content flex-end
_bis(,'../../static/images/header_bg.png', 100%, 100%,bottom)
.home_title
_font(25px,35px,#F6F9FE,,center)
font-family: YouSheBiaoTiHei;
.home_userinfo
height 35px
.user_icon
_wh(25px, 25px)
margin-right 5px
_bis(,'../../static/images/user_icon.png', 100%, 100%,center)
.user_name
_font(17px,17px,#fff,,center)
padding-right 5px
margin 9px 10px 9px 0
border-right 1px solid #AECAF5
.exit_text
height 30px
_font(14px,30px,#fff,,center)
padding 0 10px
margin 2.5px 0
_bis(,'../../static/images/state-item_bg.png', 100%, 100%,center)
.welcome_text_wraper
height 70px
margin 0 50px
.welcome_text
_font(26px, 70px, #F6F9FE,,)
padding-left 20px
font-family: YouSheBiaoTiHei
background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(49,190,255,0.9) 0%, rgba(239,252,254,1) 40%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
.zd_wrapper
_wh(calc(100% - 100px),calc(100% - 180px)) /** 120rpx + 200rpx + 130rpx */
margin 0px 50px 0 50px
_bis(,'../../static/images/bg-task-r2.png', 100%, 100%,center)
.menu-wrap
flex-wrap wrap
justify-content flex-start
align-content center
height 100%
.menu-item
width 20%
margin 10px 0
.menu_name_bg
position relative
_wh(100px, 80px)
margin 0 auto
border-radius 10px
background-image: radial-gradient( ellipse farthest-corner at 11px 11px , #afafb9, #afafb9 50%, #ffffff 50%);
background-size: 11px 11px;
.bg_texture_1, .bg_texture_7
background: repeating-linear-gradient( -45deg, #afafb9, #afafb9 5px, #ffffff 5px, #ffffff 8px );
.menu-name
background-color rgba(49, 95, 255, 0.8)
.bg_texture_3, .bg_texture_6
background-image: repeating-linear-gradient(45deg, #afafb9 25%, transparent 25%, transparent 75%, #afafb9 75%, #afafb9), repeating-linear-gradient(45deg, #afafb9 25%, #ffffff 25%, #ffffff 75%, #afafb9 75%, #afafb9);
background-position: 0 0, 11px 11px;
background-size: 22px 22px;
.menu-name
background-color rgba(0, 239, 48, 0.8)
.bg_texture_2, .bg_texture_5, .bg_texture_9
background: radial-gradient(circle, transparent 20%, #ffffff 20%, #ffffff 80%, transparent 80%, transparent), radial-gradient(circle, transparent 20%, #ffffff 20%, #ffffff 80%, transparent 80%, transparent) 13.5px 13.5px, linear-gradient(#afafb9 2px, transparent 2px) 0 -2px, linear-gradient(90deg, #afafb9 2px, #ffffff 2px) -2px 0;
background-size: 27.5px 27.5px, 27.5px 27.5px, 13.75px 13.75px, 13.75px 13.75px;
.menu-name
background-color rgba(255, 189, 45, 0.8)
.bg_texture_4
.menu-name
background-color rgba(255, 139, 69, 0.8)
.bg_texture_DB
background: repeating-linear-gradient( -45deg, #afafb9, #afafb9 5px, #ffffff 5px, #ffffff 8px );
.menu-name
background-color rgba(49, 95, 255, 0.8)
.bg_texture_IN
background-image: repeating-linear-gradient(45deg, #afafb9 25%, transparent 25%, transparent 75%, #afafb9 75%, #afafb9), repeating-linear-gradient(45deg, #afafb9 25%, #ffffff 25%, #ffffff 75%, #afafb9 75%, #afafb9);
background-position: 0 0, 11px 11px;
background-size: 22px 22px;
.menu-name
background-color rgba(0, 239, 48, 0.8)
.bg_texture_SH
background: radial-gradient(circle, transparent 20%, #ffffff 20%, #ffffff 80%, transparent 80%, transparent), radial-gradient(circle, transparent 20%, #ffffff 20%, #ffffff 80%, transparent 80%, transparent) 13.5px 13.5px, linear-gradient(#afafb9 2px, transparent 2px) 0 -2px, linear-gradient(90deg, #afafb9 2px, #ffffff 2px) -2px 0;
background-size: 27.5px 27.5px, 27.5px 27.5px, 13.75px 13.75px, 13.75px 13.75px;
.menu-name
background-color rgba(255, 189, 45, 0.8)
.menu-name
display flex
justify-content center
align-items center
_wh(100px, 80px)
padding 10px
border-radius 10px
_font(18px, 25px, #fff,bold,center)
background-color rgba(0,166,255,0.8)
.bill_count
position absolute
top -10px
right -10px
_wh(30px, 30px)
background-color $red
border-radius 50%
_font(16px, 30px, #fff,bold,center)
box-shadow 3px 3px 1px 1px rgba(0,0,0,.3)
.left_bg
position absolute
left 0
top 0
_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')
.bg_texture_YC
_bis(,'../../static/images/RF01.png', 100%, ,center)
.menu-name
background-color rgba(223, 131, 21, 80%)
.bg_texture_PD
_bis(,'../../static/images/RF02.png', 100%, ,center)
.menu-name
background-color rgba(223, 131, 21, 80%)
</style>