<template>
	<view>
		<uni-nav-bar  fixed="true"  height="80px" dark color="#ffffff" backgroundColor="#1989fa" shadow left-text="退出"
			title="主页" @clickLeft="quitLogin()"/>
		<uni-grid :column="4" :highlight="true" :borderColor="borderColor">
			<uni-grid-item v-for="(item, index) in list" :index="index" :key="index">
				<view class="grid-item-box" style="background-color: #fff;margin-:20px;" @click="navClick(item)">						
					<image :src="item.srcUrl" style="height: 40px;width: 40px;"></image>
					<text class="text">{{item.text}}</text>
				</view>
			</uni-grid-item>
		</uni-grid>	
	</view>
	
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				dynamicList: [],
				borderColor:'#fff',
				list: [{
						url: '/pages/inspection/Plan',
						srcUrl:require("../../static/img/inspection_01.png"),
						text: '巡检计划'						
					},
					{
						url: '/pages/inspection/Point',
						srcUrl:require("../../static/img/inspection_02.png"),
						text: '巡更点'
					}							
				]
			}
		},
		methods:{
			navClick(item){
				uni.navigateTo({
					url:item.url
				})
			},
			quitLogin(){	
				console.log('before reomveToken:===='+uni.getStorageSync('token'))
				uni.removeStorageSync('token')				
				console.log('reomveToken:===='+uni.getStorageSync('token'))
				uni.showToast({
							icon: 'none',
							title: '退出成功'
						});
				uni.navigateTo({
					url:"/pages/index/login"
				})
			}
		},
		
	}
</script>

<style lang="scss">
	
	.image {
		width: 25px;
		height: 25px;
	}

	.text {
		font-size: 14px;
		margin-top: 5px;
	}

	

	.grid-dynamic-box {
		margin-bottom: 15px;
	}

	.grid-item-box {
		flex: 1;
		// position: relative;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 15px 0;
		
	}

	

	

	
</style>