<template>
    <div class='personal-index'>
        <div class="plr15 ptb10 bgc-fff">
            <div class="kitbox">
                <div class="photo">
                    <van-image
                        width="80"
                        height="80"
                        round
                        :src="setImgUrl(user.photo)"
                    />
                </div>
                <div class="pl15 lh20 kitbox box-v-middle">
                    <div>
                        <div class="fs-16 c-333">{{user.name}}</div>
                        <div class="fs-14 c-666 pt5">
                            <div>{{user.mobile}}</div>
                            <div>{{user.curRoleName}}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="mt10">
            <van-cell @click="gotoUrl('/personal/changePassword')" title="修改密码" is-link/>
            <!-- <van-cell title="帮助反馈" is-link/>
            <van-cell title="切换账号" is-link/> -->
        </div>
        

        <div class="mt20 plr15 bot-btn">
            <van-button color="#ff5e6c" round class='logoutBtn' @click='logout' block type="primary">退出当前账号</van-button>
        </div>
    </div>
</template>
<script>
export default{
    name: 'meIndex',
    data(){
        return {
            fileList: [],
            screenWidth: document.body.clientWidth,
            family:[],
            patient:{},
            file: '',
            filename: '',
            defaultImg: '',
            members:[],
        }
    },
    methods:{
        async logout(){
            await this.$store.dispatch('LogOut')
            console.log(this.$store.getters.user)
            this.gotoUrl('/login')
        },
    },
}
</script>
<style lang='scss' scoped>
.personal-index{
    .bot-btn{
        position: absolute;
        bottom: 60px;
        width: 100%;
    }
    .van-image{
        display: block;
    }
}
</style>
<style lang='scss'>
@supports(bottom: env(safe-area-inset-bottom)){
    .personal-index{
        .bot-btn{
            padding-bottom: env(safe-area-inset-bottom);
        }
    }
}
</style>