<template>
  <div class="m-container">
    <p class="title">福袋统计</p>
    <van-cell-group>
      <van-cell title="总收入"
                :value="totalMoney" />
      <van-cell title="总笔数"
                :value="totalNum" />
    </van-cell-group>
    <div class="tableWrap">
      <div class="item">
        <span>分部名</span>
        <span>总笔数</span>
        <span>总收入</span>
      </div>
      <div class="item"
           v-for='(item,index) in orangeList'
           :key="index">
        <span>{{  item.organName}}</span>
        <span>{{ item.nums}}</span>
        <span>{{ item.money}}</span>
      </div>
    </div>
  </div>
</template>
<script>
import { getFortuneBag } from '@/api/teacher'
export default {
  name: 'FortuneBag',
  data () {
    return {
      totalNum: null,
      totalMoney: null,
      orangeList: []
    }
  },
  mounted () {
    getFortuneBag().then(res => {
      if (res.data.code == 200) {
        this.totalNum = res.data.data.totalNum + ' 笔'
        this.totalMoney = res.data.data.totalMoney + ' 元'
        this.orangeList = res.data.data.orderStatisDtoList
      }
    })
  }
}
</script>
<style lang="less">
.m-container {
  background-color: #fff;
}
.title {
  height: 0.4rem;
  line-height: 0.4rem;
  text-align: center;
  background-color: #14928a;
  color: #fff;
}
.tableWrap {
  .item {
    padding: 0 15px;
    height: 44px;
    line-height: 44px;
    background-color: #fff;
    border-bottom: 1px solid #ebedf0;
    font-size: 14px;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    &:nth-child(1) {
      background-color: #ebedf0;
    }
    span {
      display: inline-block;
      width: 33%;
      text-align: center;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }
}
</style>