<template>
	<view class="content">
		<view class="zdyNav">
		  <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
		  <view class="nav">
			首页
		  </view>
		</view>
		<view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
		<view style="height: 44px;"></view>
		<!-- 我的待办 -->
		<view class="modular">
			<view class="modularTitle">我的待办</view>
			<view class="modularCont">
				<view class="modularLine" @click="goRouter('../upcoming/upcoming')">
					<image src="../../static/img/home_icon_1.png" mode="" class="modularImg"></image>
					<view class="subscript" v-if="count">{{count}}</view>
					<view class="modularName">待办事项</view>
				</view>
			</view>
		</view>
		<!--录入报告  -->
		<view class="modular" v-if="permissionList.indexOf('N001')!=-1||permissionList.indexOf('N002')!=-1">
			<view class="modularTitle">录入报告</view>
			<view class="modularCont" >
				<view class="modularLine" @click="goRouter('../entryReport/entryReport')" v-if="permissionList.indexOf('N001')!=-1">
					<image src="../../static/img/home_icon_2.png" mode="" class="modularImg"></image>
					<view class="modularName">录入报告</view>
				</view>
				<view class="modularLine" @click="goRouter('../reportManage/reportManage')" v-if="permissionList.indexOf('N002')!=-1">
					<image src="../../static/img/home_icon_3.png" mode="" class="modularImg"></image>
					<view class="modularName">报告管理</view>
				</view>
			</view>
		</view>
		<!--团队管理  -->
		<view class="modular" v-if="permissionList.indexOf('N004')!=-1||permissionList.indexOf('N003')!=-1">
			<view class="modularTitle">团队管理</view>
			<view class="modularCont">
				<view class="modularLine" @click="goRouter('../team/myTeam')" v-if="permissionList.indexOf('N003')!=-1">
					<image src="../../static/img/home_icon_4.png" mode="" class="modularImg"></image>
					<view class="modularName">我的团队</view>
				</view>
				<view class="modularLine" @click="goRouter('../teamStore/teamStore')" v-if="permissionList.indexOf('N004')!=-1">
					<image src="../../static/img/home_icon_5.png" mode="" class="modularImg"></image>
					<view class="modularName">团队门店</view>
				</view>
			</view>
		</view>
		<!--其他设置  -->
		<view class="modular">
			<view class="modularTitle">其他设置</view>
			<view class="modularCont">
				<view class="modularLine" @click="goRouter('../accountSet/accountSet')">
					<image src="../../static/img/home_icon_6.png" mode="" class="modularImg"></image>
					<view class="modularName">账号设置</view>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				uid: '',
				count: '',
				permissionList:'',
				iStatusBarHeight:'',
			}
		},
		onLoad() {
			//页面加载初始化生命周期函数
             this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
		},
		onShow() {
			this.uid = uni.getStorageSync("logInData").uid;
			this.permissionList=uni.getStorageSync("logInData").permissionList;
			if(!this.permissionList){
				this.permissionList=[]
			}
			//this.permissionList=['N001']
			console.log(this.uid);
			if (this.uid) {
				this.getData()
			}
		},
		methods: {
			getData() {
				uni.showLoading({
					title: '加载中'
				})
				let url = 'accompany/SuperAccounts/listMyTodoPage',
					params = {
						page: 1,
						limit: 20,

					}
				this.$http(url, params, 'GET').then(res => {

					this.count = res.data.TotalSize
				

				})
			},
			//自己定义的方法函数
			goRouter(url) {
				console.log(url)
				//uni.navigateTo  路由跳转 url 是地址 路由还分为uni.redirectTo switchTab navigateBackreLaunch
				//this.$common.isUserId()

				uni.navigateTo({
					url: url
				})
			}
		}
	}
</script>

<style scoped>
	.content {
		background: #F4F5F7;
		min-height: 100vh;
		padding: 24rpx 20rpx;
	}

	/* #ifdef H5 */
	.content {
		background: #F4F5F7;
		
		padding: 24rpx 20rpx;
	}

	/* #endif */
	.modular {
		background: #FFFFFF;
		border-radius: 16rpx;
		padding: 30rpx 20rpx;
		margin-bottom: 20rpx;
	}

	.modularTitle {
		font-size: 32rpx;
		font-weight: 600;
		color: #3C3C3C;
	}

	.modularImg {
		width: 80rpx;
		height: 80rpx;
	}

	.modularCont {
		display: flex;
	}

	.modularLine {
		width: 25%;
		text-align: center;
		padding-top: 33rpx;
		position: relative;
	}

	.modularName {
		font-size: 24rpx;
		padding-top: 5rpx;
		color: #666666;
	}

	.subscript {
		width: 32rpx;
		height: 32rpx;
		border-radius: 16rpx;
		text-align: center;
		line-height: 32rpx;
		background-color: #F03B3B;
		color: #FFFFFF;
		font-size: 20rpx;

		z-index: 99;
		position: absolute;
		right: 32rpx;
		top: 16rpx;

	}
	.zdyNav{
		position: fixed;
		left: 0;
		top: 0;
		background: #FFFFFF;
		z-index: 11;
	}
	.nav{
		width: 100vw;
		height: 44px;
		background: #FFFFFF;
		text-align: center;
		font-size: 34rpx;
		line-height: 44px;
	}
	.status_bar{
		background: #FFFFFF;
	}
</style>
