<template>
	<div>
		<common @asynCallBack="asynCallBack"></common>

		<div class="mui-content margin49">
			<div class="vongi-icon-gear">
				<router-link id="icon-gear" :to="{name:'MasterMineConfig'}" class="mui-icon mui-icon-gear"></router-link>
			</div>
			<div class="vongi-me">
				<div class="vongi-me-name">
					<div class="vongi-me-top">
						<div class="flew-items">
							<div class="mui-media-object mui-pull-left">
								<img :src="person_data.faceImageUrl" />
							</div>
							<h2>{{wellcomme}}{{person_data.name}}</h2>
						</div>
						<h4>{{person_data.phone}}<span>编号:{{person_data.id}}</span></h4>
					</div>
					<button type="button" class="mui-btn mui-btn-primary mui-btn-outlined" @click="editInfo">
						编辑资料
					</button>
				</div>
				<div class="vongi-me-card">
					<h2 v-text="person_popedom.companyName"></h2>
					<h4 v-text="person_popedom.deptName"></h4>
				</div>
			</div>
			<div class="vongi-me-list">
				<ul class="mui-table-view mui-table-view-chevron vongi-news">
					<li class="mui-table-view-cell">

						<router-link :to="{name:'MasterMineBillList'}" class="mui-navigate-right">

                        							<img src="~$project/assets/img/cicon32.png" width="18" /> 我的账单
                        </router-link >
					</li>
					<li class="mui-table-view-cell">
						<a class="mui-navigate-right">
							<img src="~$project/assets/img/cicon07.png" width="18" /> 我的订单
						</a>
					</li>
				</ul>
				<ul class="mui-table-view mui-table-view-chevron vongi-news">
					<li class="mui-table-view-cell">
						<a href="../home/#/register?project=business&exchange=1" class="mui-navigate-right jump">
							<img src="~$project/assets/img/zhuce.png" width="18" /> 注册新身份
						</a>
					</li>
				</ul>
				<ul class="mui-table-view mui-table-view-chevron vongi-news">
					<li class="mui-table-view-cell">
						<router-link :to="{name:'MasterMineFeedback'}" class="mui-navigate-right">
							<img src="~$project/assets/img/set.png" width="18" /> 问题反馈
						</router-link>
					</li>
					<li class="mui-table-view-cell">
						<a href="tel:4008899619" class="">
							<img src="~$project/assets/img/cicon33.png" width="18" /> 客服热线
							<span>400-8899-619</span>
							<span class="mui-icon mui-icon-phone"></span>
						</a>
					</li>
				</ul>
			</div>
		</div>

		<nav-menu :router="[{name:'Master'},{name:'MasterMineMessage'},{name:'MasterMineCenter'}]"></nav-menu>

		<loading :visible="isLoading"></loading>
	</div>
</template>

<script>
	import Common from "$project/components/Common.vue";
	import Loading from "$project/components/Loading.vue";
	import TopHeader from "$project/components/TopHeader.vue";
	import NavMenu from "@/components/NavMenu.vue";
	import {
		mapGetters,
		mapMutations
	} from "vuex";
	export default {
		name: "MasterMineCenter",
		components: {
			Common,
			Loading,
			TopHeader,
			NavMenu,
		},
		data() {
			return {
				pageTitle: "个人中心",

				isLoading: false,
			};
		},
		created() {
			//如果不存在则跳转到注册页面
			if (!this.person_data) {
				window.location.href = "../home/#/user/login";
			}
		},
		methods: {
			//修改个人信息
			editInfo() {
				this.$router.push({
					name: "MasterMineEditInfo",
					query: {},
				});
			},
			asynCallBack() {},
		},
		mounted() {},
		destroyed() {},
		computed: {
			wellcomme: {
				// getter
				get: function() {
					let now = new Date(),
						hour = now.getHours();
					if (hour < 6) {
						return "凌晨好！";
					} else if (hour < 9) {
						return "早上好！";
					} else if (hour < 12) {
						return "上午好";
					} else if (hour < 14) {
						return "中午好！";
					} else if (hour < 17) {
						return "下午好！";
					} else if (hour < 19) {
						return "傍晚好！";
					} else if (hour < 22) {
						return "晚上好！";
					} else {
						return "夜里好！";
					}
				},
				// setter
				set: function(newValue) {
					console.log(newValue);
				},
			},
			...mapGetters({
				openId: "wx_openid",
				token: "token",
				person_data: "person_data",
				person_popedom: "person_popedom",
			}),
		},
	};
</script>


<style scoped src="$project/assets/css/xpgj.css"></style>
<style src="$project/assets/css/iconfont.css"></style>
<style scoped>
</style>
