<template>
  <div class="comments_score">
    <div class="comments_score-left">
      <span v-text="data.score"></span>
    </div>
    <div class="comments_score-center">
      <p class="comment-full_score">满分5分</p>
      <div class="comment-total_rata">
        <el-rate
          :colors="['#e69232', '#e69232', '#e69232']"
          :value="data.score"
          disabled
        >
        </el-rate>
      </div>
      <p class="commen-total_count" v-text="'共' + data.total + '个评分'"></p>
    </div>
    <ul class="comments_score-right">
      <li
        class="comments_score_item"
        v-for="(item, index) in data.starInfo"
        :key="'star_info_' + index"
      >
        <el-rate
          class="comments_score_item-rate"
          :colors="['#8890a7', '#8890a7', '#8890a7']"
          :value="item.star"
          disabled
          disabled-void-color="transparent"
        >
        </el-rate>
        <el-progress
          class="comments_score_item-progress"
          :percentage="item.percent"
          :show-text="false"
          color="#ea7d19"
        ></el-progress>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: {
    data: {
      type: Object,
      required: true,
    },
  },
  data: () => ({}),
  methods: {},
  created() {},
};
</script>

<style scoped>
.comments_score {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 35px;
}
.comments_score-left {
  flex-shrink: 0;
  width: 96px;
  height: 110px;
  background-image: url(../assets/imgs/score_bg.png);
  background-size: 100% 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-family: Arial;
  font-size: 50px;
  font-weight: bold;
  margin-right: 25px;
}
.comments_score-center {
  flex-shrink: 0;
  padding-right: 48px;
  border-right: 2px solid #f4f7fc;
  margin-right: 48px;
}
.comments_score-center > .comment-full_score {
  padding-left: 5px;
  font-size: 14px;
  line-height: 25px;
  color: #a9aec0;
}
.comments_score-center > .comment-total_rata {
  margin-top: 10px;
}
.comments_score-center > .commen-total_count {
  padding-left: 5px;
  font-size: 14px;
  line-height: 25px;
  color: #3f4f9c;
  margin-top: 2px;
}
.comments_score-right {
  flex-grow: 1;
}
.comments_score_item {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
.comments_score_item-rate {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-start;
  align-items: center;
}
.comments_score_item-progress {
  flex-grow: 1;
  max-width: 200px;
  margin-left: 10px;
}
</style>

<style>
.comments_score-center > .comment-total_rata .el-rate {
  height: 30px;
}
.comments_score-center > .comment-total_rata .el-rate__icon {
  font-size: 30px;
  margin-right: 0;
}
.comments_score_item-rate .el-rate {
  height: 14px;
}
.comments_score_item-rate .el-rate__icon {
  font-size: 14px;
  margin-right: 0;
}
.comments_score_item-progress .el-progress-bar__outer {
  background: #e2e3ed;
}
</style>
