08335 / hivui-platform-template
hivui平台项目模板
Newer
Older
hivui-platform-template / project / hivuiMain / views / personalCenter / components / UserCard.vue
<template>
  <el-card style="margin-bottom:20px;">
    <div class="user-profile">
      <div class="account-center-avatarHolder">
          <div class="avatar">
            <img :src="avatar || userPic"/>
          </div>
          <div class="username">{{ user.fusername }}</div>
          <div class="bio">{{ user.fuserid }}</div>
        </div>
      <div class="account-center-detail">
        <p>
          <i class="el-icon-s-custom"></i>{{ user.fbzname }}
        </p>
        <p>
          <i class="iconfont icon-tree"></i>{{ `${user.forgname} - ${user.fdeptname} - ${user.frolename}` }}
        </p>
        <p>
          <i class="el-icon-phone-outline"></i><span>{{ user.FMBPHONE || user.fmbphone}}</span><span></span>
        </p>
      </div>
      <el-divider />
    </div>
    <div class="user-bio">
      <div class="user-education user-bio-section">
        <div class="user-bio-section-header"><svg-icon icon-class="education" /><span>{{ $t("hivuiMain_app_orgbz")}}</span></div>
        <div class="user-bio-section-body" v-for="item in bzList">
          <p>
            <i class="el-icon-s-custom"></i><span>{{ item.fbzname}}</span><i class="el-icon-star-on" title="主岗" v-if="item.fdefaultbz"></i><span class="bzid">{{ item.fbzid}}</span><span></span>
          </p>
        </div>
      </div>
    </div>
  </el-card>
</template>

<script>
import userPic from "@main/assets/user.png"
export default {
  props: {
    user: {
      type: Object,
      default: () => {
        return {
          name: '',
          email: '',
          avatar: '',
          role: ''
        }
      }
    },
    avatar:{
      type: String,
      default: ""
    }
  },
  data(){
    return{
      userPic: userPic,
      bzList:[]
    }
  },
  methods:{
    
  }
}
</script>

<style lang="scss" scoped>
.box-center {
  margin: 0 auto;
  display: table;
}

.text-muted {
  color: #777;
}

.user-profile {
  .user-name {
    font-weight: bold;
  }

  .box-center {
    padding-top: 10px;
  }

  .user-role {
    padding-top: 10px;
    font-weight: 400;
    font-size: 14px;
  }

  .box-social {
    padding-top: 30px;

    .el-table {
      border-top: 1px solid #dfe6ec;
    }
  }

  .user-follow {
    padding-top: 20px;
  }
}
.account-center-avatarHolder {
  text-align: center;
  margin-bottom: 24px;

  & > .avatar {
    margin: 0 auto;
    width: 104px;
    height: 104px;
    margin-bottom: 20px;
    border-radius: 50%;
    overflow: hidden;
    img {
      height: 100%;
      width: 100%;
    }
  }

  .username {
    color: rgba(0, 0, 0, 0.85);
    font-size: 20px;
    line-height: 28px;
    font-weight: 500;
    margin-bottom: 4px;
  }
}
.account-center-detail {

  p {
    margin-bottom: 8px;
    padding-left: 26px;
    position: relative;
  }

  i {
    position: absolute;
    height: 14px;
    width: 14px;
    left: 0;
    top: 4px;
    // background: url(https://gw.alipayobjects.com/zos/rmsportal/pBjWzVAHnOOtAUvZmZfy.svg)
  }

  .title {
    background-position: 0 0;
  }
  .group {
    background-position: 0 -22px;
  }
  .address {
    background-position: 0 -44px;
  }
}
.user-bio {
  margin-top: 20px;
  color: #606266;

  span {
    padding-left: 4px;
  }
  .user-bio-section-body{
    .bzid{
      float: right;
      color: #000;
    }
    .el-icon-star-on{
      color: #06c;
    }
  }

  .user-bio-section {
    font-size: 14px;
    padding: 15px 0;

    .user-bio-section-header {
      border-bottom: 1px solid #dfe6ec;
      padding-bottom: 10px;
      margin-bottom: 10px;
      font-weight: bold;
    }
  }
}
</style>