<template>
  <div class="sell-box">
    <div class="top">
      <div class="h">
         <template v-if="CurrentUserInfo.RB_Group_id==2">
            <img :src="champion.employeeImg" :onerror="defaultHeadImg" />
         </template>
         <template v-else>
            <img src="../../assets/img/default_head_img.jpg" :onerror="defaultHeadImg" />
         </template>
      </div>
      <img class="caidai" src="../../assets/img/persion/caidai.png" />
      <div class="money" v-if="CurrentUserInfo.RB_Group_id==2">
          ¥<span class="big">{{champion.weekTotalIncome}}</span>
      </div>
    </div>
    <div class="bottom" v-if="CurrentUserInfo.RB_Group_id==2">
      <div class="t">
        <div class="l">
          <img :src="champion.employeeImg" />
          <div class="content">
            <div class="name-box">
              {{champion.employeeName}}
            </div>
            <div class="last-msg">{{champion.branchName}} · {{champion.deptName}}</div>
          </div>
        </div>
        <div class="r">
          <div class="count">{{champion.rankTopCount}}</div>
          <div class="txt">周冠次数</div>
        </div>
      </div>
      <div class="remark">
        {{champion.employeeName}}在本期的排名中取得了{{champion.weekTotalIncome}}的业绩,领先第二名{{champion.differencePrice.toFixed(2)}},这是他第{{champion.rankTopCount}}次获得销售周冠的称号,想看他的成功秘笈?戳下面的按钮查看吧!
      </div>
      <div class="more-btn" @click="openRank">立即查看</div>
    </div>
  </div>
</template>
<script>
export default {
  props:{
    champion:{
      type:Object,
      default:{}
    }
  },
  data() {
    return {
      CurrentUserInfo:{},
      defaultHeadImg:
        'this.src="' + require("../../assets/img/default_head_img.jpg") + '"',
    }
  },
  mounted() {
    this.CurrentUserInfo = this.getLocalStorage();
  },
  methods: {
    openRank(){
      this.MsgBus.$emit("showCareer",this.champion.employeeId)
    }
  },
}
</script>

<style>
.sell-box {
}
.sell-box .top {
  height: 248px;
  background: url("../../assets/img/persion/sell.png") #8eafec;
  background-size: 100% 100%;
  position: relative;
}
.sell-box .top .h {
  text-align: center;
  position: absolute;
  top: -23px;
  width: 136px;
  height: 136px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.3);
  left: 167px;
  border-radius: 50%;
}
.sell-box .top .h img {
  width: 126px;
  height: 126px;
  border-radius: 50%;
}
.sell-box .top .caidai {
  position: absolute;
  top: 75px;
  left: 115px;
  width: 240px;
  height: 57px;
  z-index: 2;
}
.sell-box .top .money {
  position: absolute;
  top: 132px;
  left: 0;
  right: 0;
  height: 30px;
  z-index: 2;
  text-shadow: 0px 4px 5px rgba(0, 63, 163, 1);
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  color: #FFF;
}
.sell-box .top .money .big {
  font-family: pingfangR;
  font-weight: unset;
  font-size: 36px;
}
.sell-box .bottom{
  padding: 25px;
}
.sell-box .bottom .t{
  display: flex;
  align-items: center;
}
.sell-box .bottom .t .l{
  
  flex: 1;
  display: flex;
}
.sell-box .bottom .t .l img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  margin-right: 14px;
}
.sell-box .bottom .t .l .content {
  flex: 1;
}
.sell-box .bottom .t .l .content .name-box {
  font-size: 18px;
  font-family: pingfangR;
  color: #6c7293;
}
.sell-box .bottom .t .l .content .last-msg {
  font-size: 14px;
  color: #a7abc3;
  width: 100%;
  height: 20px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: pingfangR;
}
.sell-box .bottom .t .r{
  font-size: 12px;
  color:#2c3343;
  width: 80px;
  text-align: right;
}
.sell-box .bottom .t .r .count {
  font-size: 20px;
  font-family: pingfangR;
  color: #5d78ff !important;
  text-align: center
}
.sell-box .bottom .t .r .txt {
  font-size: 12px;
  color: #a7abc3;
  text-align: center
}
.sell-box .bottom .remark{
  margin-top: 25px;
  font-size: 12px;
  color: #a7abc3;
  font-family: pingfangR;
}
.sell-box .bottom .more-btn{
  margin-top: 25px;
  font-size: 12px;
  font-family: pingfangR;
  width:100px;
  height: 33px;
  line-height: 33px;
  text-align: center;
  background-color: rgba(93, 120, 255, 0.1);
  color: #5d78ff;
  cursor: pointer;
}
.sell-box .bottom .more-btn:hover{
  background-color:#5d78ff;
  color: #FFF;
  border-radius: 4px;
}
</style>