<template>
	<view class="content">
		<view v-if="hasLogin" class="hello">
			<view class="title">
				您好 {{GLOBALUTIL.user.username}}，您已成功登录。
			</view>
			<view class="ul">
				<view>这是 简易功能入口。</view>
				<view>在 “我的” 中点击 “退出” 可以 “注销当前账户”</view>
			</view>
		</view>
		<view>
			<button hover-class="submithover"  @click="clickSubmit" class="submit-button">
				<text class="submittext">整改项提交</text>
			</button>
			<button hover-class="submithover"  @click="clickSafe" class="submit-button">
				<text class="submittext">安全检查</text>
			</button>
			<button hover-class="submithover"  @click="clickQuery" class="submit-button">
				<text class="submittext">整改项查询</text>
			</button>
		</view>
	</view>
</template>

<script>
	// import {
	// 	mapState
	// } from 'vuex'

	export default {
		// computed: mapState(['forcedLogin', 'hasLogin', 'userName']),
		onLoad() {
			if (JSON.stringify(this.GLOBALUTIL.user) == "{}") {
				uni.showModal({
					title: '未登录', 
					content: '您未登录，需要登录后才能继续',
					/**
					 * 如果需要强制登录，不显示取消按钮
					 */
					showCancel: false,
					success: (res) => {
						if (res.confirm) {
							uni.navigateTo({
								url: '../login/index'
							});
						}
					}
				});
			}
		},
		methods:{
			clickSubmit(){
				uni.navigateTo({
					url:"../Security-Submit/index"
				})
			},
			clickSafe(){
				uni.navigateTo({
					url:"../Security-Check/security-task-list"
				})
			},
			clickQuery(){
				uni.navigateTo({
					url:"../Rectification-Item/list"
				})
			}
		}
	}
</script>

<style>
	.hello {
		display: flex;
		flex: 1;
		flex-direction: column;
	}

	.title {
		color: #8f8f94;
		margin-top: 25px;
	}

	.ul {
		font-size: 15px;
		color: #8f8f94;
		margin-top: 25px;
	}

	.ul>view {
		line-height: 25px;
	}
</style>
