<template>
	<div class="my">
        <div class="mybox userInfo">
            <div class="left">
                <img src="../../assets/image/userHead.png">
            </div>
            <div class="right">
                <div>
                    <span class="name">{{user.name}}</span>
                    <span class="phone">{{user.phone}}</span>
                </div>
                <div class="department">
                    {{user.deptName}}
                </div>
            </div>
        </div>
        <div class="mybox">
            <mt-cell title="我的消息" is-link v-on:click.native="jumpTo(1)"><mt-badge v-if="newNum!=0" size="small" type="error">{{newNum}}</mt-badge><img slot="icon" src="../../assets/image/my_message.png" width="24" height="24"></mt-cell>
            <mt-cell title="我的资产" is-link v-on:click.native="jumpTo(2)"><img slot="icon" src="../../assets/image/my_assets.png" width="24" height="24"></mt-cell>
            <mt-cell v-if="user.roles[0].rolename != '部门领导'" title="我的评分" is-link v-on:click.native="jumpTo(3)"><img slot="icon" src="../../assets/image/my_score.png" width="24" height="24"></mt-cell>
            <mt-cell v-if="user.roles[0].rolename != '部门领导'" title="我的建议" is-link v-on:click.native="jumpTo(4)"><img slot="icon" src="../../assets/image/my_sug.png" width="24" height="24"></mt-cell>
        </div>
        <div class="mybox">
            <mt-cell title="通讯录" is-link v-on:click.native="jumpTo(5)"><img slot="icon" src="../../assets/image/my_com.png" width="24" height="24"></mt-cell>
            <mt-cell title="管理制度" is-link v-on:click.native="jumpTo(6)"><img slot="icon" src="../../assets/image/my_sys.png" width="24" height="24"></mt-cell>
        </div>
    </div>
</template>

<script>
	export default {
		data() {
			return {
                user: JSON.parse(sessionStorage.getItem("user")),
                power: sessionStorage.getItem("power"),
                keyWord: "",
                list: [],
                labels: [],
                pageNum: 1,
                tagId: 0,
                popupVisible: false,
                newNum: sessionStorage.noRead,
			}
		},
		methods: {
            jumpTo(type) {
                switch(type){
                    case 1:
                        this.$router.push("/myMessage");
                        break;
                    case 2:
                        this.$router.push("/myAssets");
                        break;
                    case 3:
                        this.$router.push("/myScore");
                        break;
                    case 4:
                        this.$router.push("/mySuggest");
                        break;
                    case 5:
                        this.$router.push("/myAddress");
                        break;
                    case 6:
                        this.$router.push("/myInstitution");
                        break;
                    default:
                        return false
                        break;
                }
            }
        },
        created() {
        },
		mounted() {
		}
	}

</script>

<style scoped>
    .my {
        background: #EFEFEF;
    }

    .mybox {
        background: #fff;
        margin-bottom: 0.11rem;
    }

    .userInfo {
        padding: 0.22rem 0.2rem;
    }

    .left{
        float:left;
        margin-right: 0.15rem;
    }

    .left img {
        width: 0.6rem;
        height: 0.6rem;
        border-radius: 50%;
    }

    .right div{
        line-height: 0.3rem;
    }

    span.name {
        font-size: 0.16rem;
        font-weight: 600;
        margin: 0 0.15rem 0 0;
    }
    
    span.phone {
        font-size: 0.13rem;
        color: #9E9E9E;
    }

    div.department {
        font-size: 0.13rem;
        color: #9E9E9E;
    }

    span.arrow {
        float: right;
    }

    span.arrow img {
        transform: rotate(-90deg);
        -ms-transform: rotate(-90deg); /* IE 9 */
        -moz-transform: rotate(-90deg); /* Firefox */
        -webkit-transform: rotate(-90deg); /* Safari and Chrome */
        -o-transform: rotate(-90deg); /* Opera */
    }
</style>