<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}}, 欢迎进入特科拉ACS系统！</view>
		</view>
		<view class="zd_wrapper">
			<view class="zd-row menu-wrap">
				<view class="menu-item" v-for="e in menuList" :key="e.id" @tap="toPage(e)">
					<image class="menu-img" :src="require('../../static/images/menu/' + e.icon + '.png')" alt="">
					<view class="menu-name">{{e.title}}</view>
				</view>
			</view>
		</view>
		<view class="left_bg"></view>
		<view class="left_bg right_bg"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userName: this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).person_name : '',
				menuList: [
					{id: 1, title: '指令管理', icon: 'RF01', path: '/pages/management/inst-manage'},
					{id: 2, title: '任务管理', icon: 'RF02', path: '/pages/management/task-manage'},
				]
			};
		},
		methods: {
			toPage (e) {
				let url = e.path + '?title=' + e.title
				uni.redirectTo({
					url: url
				})
			},
			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 5% 50px 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(80% - 130px))
	margin 0px 50px 0 50px 
	_bis(,'../../static/images/bg-task-r2.png', 100%, 100%,center)
.menu-wrap
	flex-wrap wrap
	justify-content center
	align-content center
	height 100%
.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')
.menu-item
	width 25%
::v-deep .menu-img
	_wh(100%, auto)
	img
		position relative
		opacity 1
		_wh(55%, auto)
		max-width 90px
		margin 0 auto
.menu-name
	_font(20px, 40px, #00a7ea, 700,center)
</style>
