<template>
    <main>
        <header>
            <router-link :to="{path:'/UpDateIntroduce',query:{Skill:UserData.Skill,Introduction:UserData.Introduction}}">
                <div>
                    <van-image width="1.27rem" height="1.27rem" v-if="UserData && UserData.HeadImg" :src="UserData.HeadImg">
                        <template v-slot:loading>
                            <van-loading type="spinner" size="20" />
                        </template>
                    </van-image>
                </div>
                <p>
                    {{UserData.DoctorName}}
                    <span>医生</span>
                </p>
                <span style="color: #ccc;font-size: .22rem;">
          修改介绍
          <van-icon name="arrow" />
        </span>
            </router-link>
        </header>
        <div>
            <div class="option">
                <router-link to="/Appointments">
                    <span class="Icon1"></span>
                    <p>预约记录</p>
                    <van-icon name="arrow" />
                </router-link>
                <router-link to="/DoctorInfo">
                    <span class="Icon2"></span>
                    <p>认证信息</p>
                    <van-icon name="arrow" />
                </router-link>
                <router-link to="/UploadVideo">
                    <span class="Icon2"></span>
                    <p>上传视频</p>
                    <van-icon name="arrow" />
                </router-link>
                <router-link to="/MyProfitIndex">
                    <span class="Icon2"></span>
                    <p>我的收益</p>
                    <van-icon name="arrow" />
                </router-link>
            </div>
        </div>
    </main>
</template>

<script>
    export default {
        name: "user",
        data() {
            return {
                UserData:'',
            };
        },
        created(){
            this.GetDoctorInfo();
        },
        methods:{
            GetDoctorInfo(){
                this.$http.GetDoctorInfo().then(res=>{
                    if(res.data.IsSuccess){
                        this.UserData = res.data.ResultObject;
                    }else{
                        this.$toast(res.data.ResultMsg);
                    }
                })
            }
        }
    };
</script>

<style scoped lang="less">
    main i {
        font-size: 0.3rem;
        color: #cccccc;
        vertical-align: sub;
    }
    main {
        box-sizing: border-box;
        padding: 0.25rem;
        width: 100vw;
        height: 100vh;
        background-color: #fff;
        header {
            height: 1.8rem;
            width: 100%;
            box-shadow: 0 0 14px 5px #e4e4e4;
            border-radius: 6px;
            box-sizing: border-box;
            padding: 0 0.3rem;
            a {
                display: flex;
                justify-content: space-between;
                align-items: center;
                width: 100%;
                height: 100%;
                > div {
                    display: inline-block;
                    width: 1.27rem;
                    min-width: 1.27rem;
                    height: 1.27rem;
                    min-height: 1.27rem;
                    border-radius: 50%;
                    overflow: hidden;
                    img {
                        object-fit: cover;
                        width: 100%;
                        height: 100%;
                    }
                }
                p {
                    width: 55%;
                    text-align: left;
                    box-sizing: border-box;
                    padding-left: 0.2rem;
                    font-size: 0.28rem;
                    color: #333333;
                    span {
                        display: inline-block;
                        width: 0.74rem;
                        height: 0.3rem;
                        line-height: 0.3rem;
                        background-color: #fd5b5b;
                        color: #fff;
                        font-size: 0.18rem;
                        text-align: center;
                        line-height: 0.3rem;
                        border-radius: 3px;
                        margin-left: 0.2rem;
                        vertical-align: middle;
                    }
                }
            }
        }
    }
    .option {
        box-shadow: 0 0 14px 5px #e4e4e4;
        border-radius: 6px;
        width: 100%;
        margin-top: 0.3rem;
        box-sizing: border-box;
        padding: 0 0.3rem;
        > a {
            display: inline-block;
            height: 1.2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            span {
                display: inline-block;
                min-width: 1rem;
                min-height: 0.97rem;
                width: 1rem;
                height: 0.97rem;
                -webkit-background-size: 4.16rem 5.88rem;
                background-size: 4.16rem 5.88rem;
            }
            p {
                width: 100%;
                text-align: left;
                box-sizing: border-box;
                padding-left: 0.2rem;
                font-size: 0.28rem;
                color: #333333;
            }
        }
    }

    .Icon1 {
        background: url("../../assets/Spirit.png") no-repeat 0 -1.01rem;
    }
    .Icon2 {
        background: url("../../assets/Spirit.png") no-repeat 0 -3.09rem;
    }
</style>
