expandedGoldContent.vue 3.43 KB
<template>
  <div class='expande-wrap'>
    <order-info />

    <div class='rank-wrap'>
      <order-rank
        :analysisList='topLeftList'
        :title='topLeftTitle'
        :domId="'orderNumFiveDom'"
        :labelName='topLeftLabel'
        :revese='true'></order-rank>
      <order-rank
        :analysisList='topRightList'
        :title='topRightTitle'
        :domId="'discountCouponFiveDom'"
        :labelName='topRightLabel'
        :revese='true'></order-rank>
    </div>
    <div class='rank-wrap'>
      <order-rank
        :analysisList='top10LeftList'
        :title='top10LeftTitle'
        :domId="'orderNumTenDom'"
        :labelName='top10LeftLabel'
        :revese='true'></order-rank>
      <order-rank
        :analysisList='top10RightList'
        :title='top10RightTitle'
        :domId="'discountCouponTenDom'"
        :labelName='top10RightLabel'
        :revese='true'></order-rank>
    </div>

    <monthly-trend class='monthly-trend' :boxHeight="'20vh'"></monthly-trend>
  </div>
</template>

<script>
import OrderInfo from 'views/sassPlus/conversionPlus/orderInfo'
import OrderRank from 'views/sassPlus/expandedGold/orderRank'
import data from 'utils/data'
import MonthlyTrend from 'views/sassPlus/conversionPlus/monthlyTrend'

export default {
  name: 'ExpandedGoldContent',
  components: { MonthlyTrend, OrderRank, OrderInfo },
  data() {
    return {
      topLeftList: [],
      topRightList: [],
      topLeftTitle: '',
      topRightTitle: '',
      topLeftLabel: '',
      topRightLabel: '',

      top10LeftList: [],
      top10RightList: [],
      top10LeftTitle: '',
      top10RightTitle: '',
      top10LeftLabel: '',
      top10RightLabel: ''
    }
  },
  mounted() {

    this.$bus.$on('topFiveRankingTopLeft', data => {
      const { list, bussinessType } = data
      this.topLeftList = list
      this.topLeftTitle = bussinessType == 'expandedGold' ? '月订单量排名前五的活动' : '每月商品订单排名前5'
      this.topLeftLabel = bussinessType == 'expandedGold' ? 'activityName' : 'goodsName'
    })

    this.$bus.$on('topFiveRankingTopRight', data => {
      const { list, bussinessType } = data
      this.topRightList = list
      this.topRightTitle = bussinessType == 'expandedGold' ? '月优惠订单排名前5' : '每月各车型订单排名前5'
      this.topRightLabel = bussinessType == 'expandedGold' ? 'couponName' : 'vehicleBrand'
    })

    this.$bus.$on('Top10Right', data => {
      const { list, bussinessType } = data
      this.top10RightList = list
      this.top10RightTitle = bussinessType == 'expandedGold' ? '优惠券订单量排名前10' : '各车型订单排名前10'
      this.top10RightLabel = bussinessType == 'expandedGold' ? 'couponName' : 'vehicleBrand'
    })

    this.$bus.$on('Top10Left', data => {
      const { list, bussinessType } = data
      this.top10LeftList = list
      this.top10LeftTitle = bussinessType == 'expandedGold' ? '订单量排名前10的活动' : '商品订单排名前10'
      this.top10LeftLabel = bussinessType == 'expandedGold' ? 'activityName' : 'goodsName'
    })
  }
}
</script>

<style lang='scss' scoped>
.expande-wrap {
  height: 85vh;
  background-image: url('./../../../assets/images/bg-1.png');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  overflow: hidden;
  padding: 0 16px;

  .rank-wrap {
    display: grid;
    grid-template-columns: 50% 50%;
    //justify-content: space-between;
  }

  .monthly-trend {
    margin-top: 3vh;
  }
}


</style>