RanKing.vue 1.78 KB
<!--
 * @Description: 
 * @Author: huyue
 * @Date: 2022-06-28 15:20:14
 * @LastEditors: huyue
 * @LastEditTime: 2022-07-08 19:03:36
-->
<template>
  <div class="ranking-container">
    <div class="ranking-title">{{ this.$store.state.app.reportParams.brand ? '门店' : '品牌' }}排名</div>
    <div class="ranking">
      <div class="brand flex" v-for="(item, index) in brandList" :key="index">
        <span class="brand-num">{{ index + 1 }}</span>
        <marquee class="marquee" :direction="directionTimer" :delay="delayTimer" :text="item" />
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'RanKing',
  props: {
    list: {
      type: Array,
      default: () => []
    }
  },
  watch: {
    list: {
      handler(newVal) {
        this.brandList = newVal
      }
    }
  },
  data() {
    return {
      delayTimer: 3000,
      directionTimer: 3000,
      brandList: this.list,
      isBrandName: false
    }
  }
}
</script>
<style lang="scss" scoped>
.ranking-container {
  flex: 1;
  margin-left: 0.6vw;
  box-sizing: border-box;
  height: 12.7vh;
  background: #262525;
  .ranking-title {
    background: rgba(53, 53, 53, 0.6);
    font-size: 0.694vw;
    color: #eb6001;
    font-weight: 400;
    padding: 0.4vh 0 0.4vh 20%;
    box-sizing: border-box;
  }
  .ranking {
    font-size: 0.694vw;
    color: #ffffff;
    letter-spacing: 0;
    font-weight: 400;
    padding: 0.2vh 0 0.3vh 8px;
    .brand {
      //   line-height: 1.9vh;
      height: 1.9vh;
      display: flex;
      align-items: center;
      .brand-num {
        color: #606266;
        margin-right: 0.6vw;
        display: inline-block;
        width: 0.3vw;
        text-align: center;
      }
      .marquee {
        width: 80%;
        height: 1.9vh;
        font-weight: 400;
      }
    }
  }
}
</style>