<template>
  <div
    class="big-dataservice-box"
    style="border-color:#ffcdd2!important"
    :class="{ 'hide-border': shouType == '2' }"
  >
    <div class="tag-title" style="background:#ffcdd2!important">销售动态</div>
    <div class="row q-gutter-md">
      <q-card flat>
        <div class="data-title">新增语培订单</div>
        <div class="data-time">{{ formatDate.date }} {{ formatDate.week }}</div>
        <div class="wrapper">
          <div class="col">
            <div class="label">当日</div>
            <div class="value">
              {{ d.LangOrder.split(",")[0] }}
              <span class="unit">单</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当周</div>
            <div class="value samll">
              {{ d.LangOrder.split(",")[1] }}<span class="unit">单</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当月</div>
            <div class="value samll">
              {{ d.LangOrder.split(",")[2] }}<span class="unit">单</span>
            </div>
          </div>
        </div>
      </q-card>
      <q-card flat>
        <div class="data-title">语培订单交易金额</div>
        <div class="data-time">{{ formatDate.date }} {{ formatDate.week }}</div>
        <div class="wrapper">
          <div class="col">
            <div class="label">当日</div>
            <div class="value">
              {{ numberFormat(d.LangMoney.split(",")[0]).value }}
              <span class="unit">{{
                numberFormat(d.LangMoney.split(",")[0]).unit
              }}</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当周</div>
            <div class="value samll">
              {{ numberFormat(d.LangMoney.split(",")[1]).value
              }}<span class="unit">{{
                numberFormat(d.LangMoney.split(",")[1]).unit
              }}</span>
            </div>
          </div>
          <div>
            <div class="label big">当月</div>
            <div class="value samll">
              {{ numberFormat(d.LangMoney.split(",")[2]).value
              }}<span class="unit">{{
                numberFormat(d.LangMoney.split(",")[2]).unit
              }}</span>
            </div>
          </div>
        </div>
      </q-card>
      <q-card flat>
        <div class="data-title">语培订单人数</div>
        <div class="data-time">{{ formatDate.date }} {{ formatDate.week }}</div>
        <div class="wrapper">
          <div class="col">
            <div class="label">当日</div>
            <div class="value">
              {{ d.LangGuest.split(",")[0] }}
              <span class="unit">人</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当周</div>
            <div class="value samll">
              {{ d.LangGuest.split(",")[1] }}<span class="unit">人</span>
            </div>
          </div>
          <div>
            <div class="label big">当月</div>
            <div class="value samll">
              {{ d.LangGuest.split(",")[2] }}<span class="unit">人</span>
            </div>
          </div>
        </div>
      </q-card>
      <q-card flat>
        <div class="data-title">语培待收信息</div>
        <div class="data-time">{{ formatDate.date }} {{ formatDate.week }}</div>
        <div class="wrapper">
          <div class="col">
            <div class="label">待收订单数</div>
            <div class="value">
              {{ d.LangOutPayOrder }}
              <span class="unit">单</span>
            </div>
          </div>
          <div>
            <div class="label">待收订单金额</div>
            <div class="value">
              {{ numberFormat(d.LangOutPayMoney).value }}
              <span class="unit">{{
                numberFormat(d.LangOutPayMoney).unit
              }}</span>
            </div>
          </div>
        </div>
      </q-card>

      <q-card flat>
        <div class="data-title">新增留学订单</div>
        <div class="data-time">{{ formatDate.date }} {{ formatDate.week }}</div>
        <div class="wrapper">
          <div class="col">
            <div class="label">当日</div>
            <div class="value">
              {{ d.LiuOrder.split(",")[0] }}
              <span class="unit">单</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当周</div>
            <div class="value samll">
              {{ d.LiuOrder.split(",")[1] }}<span class="unit">单</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当月</div>
            <div class="value samll">
              {{ d.LiuOrder.split(",")[2] }}<span class="unit">单</span>
            </div>
          </div>
        </div>
      </q-card>
      <q-card flat>
        <div class="data-title">留学订单交易金额</div>
        <div class="data-time">{{ formatDate.date }} {{ formatDate.week }}</div>
        <div class="wrapper">
          <div class="col">
            <div class="label">当日</div>
            <div class="value">
              {{ numberFormat(d.LiuMoney.split(",")[0]).value }}
              <span class="unit">{{
                numberFormat(d.LiuMoney.split(",")[0]).unit
              }}</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当周</div>
            <div class="value samll">
              {{ numberFormat(d.LiuMoney.split(",")[1]).value
              }}<span class="unit">{{
                numberFormat(d.LiuMoney.split(",")[1]).unit
              }}</span>
            </div>
          </div>
          <div>
            <div class="label big">当月</div>
            <div class="value samll">
              {{ numberFormat(d.LiuMoney.split(",")[2]).value
              }}<span class="unit">{{
                numberFormat(d.LiuMoney.split(",")[2]).unit
              }}</span>
            </div>
          </div>
        </div>
      </q-card>
      <q-card flat>
        <div class="data-title">留学订单人数</div>
        <div class="data-time">{{ formatDate.date }} {{ formatDate.week }}</div>
        <div class="wrapper">
          <div class="col">
            <div class="label">当日</div>
            <div class="value">
              {{ d.LiuGuest.split(",")[0] }}
              <span class="unit">人</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当周</div>
            <div class="value samll">
              {{ d.LiuGuest.split(",")[1] }}<span class="unit">人</span>
            </div>
          </div>
          <div>
            <div class="label big">当月</div>
            <div class="value samll">
              {{ d.LiuGuest.split(",")[2] }}<span class="unit">人</span>
            </div>
          </div>
        </div>
      </q-card>
      <q-card flat>
        <div class="data-title">留学待收信息</div>
        <div class="data-time">{{ formatDate.date }} {{ formatDate.week }}</div>
        <div class="wrapper">
          <div class="col">
            <div class="label">待收订单数</div>
            <div class="value">
              {{ d.LiuOutPayOrder }}
              <span class="unit">单</span>
            </div>
          </div>
          <div>
            <div class="label">待收订单金额</div>
            <div class="value">
              {{ numberFormat(d.LiuOutPayMoney).value }}
              <span class="unit">{{
                numberFormat(d.LiuOutPayMoney).unit
              }}</span>
            </div>
          </div>
        </div>
      </q-card>

      <q-card flat>
        <div class="data-title">活动</div>
        <div class="data-time">{{ formatDate.date }} {{ formatDate.week }}</div>
        <div class="wrapper">
          <div class="col">
            <div class="label">当日</div>
            <div class="value">
              {{ d.Activity.split(",")[0] }}
              <span class="unit">个</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当周</div>
            <div class="value samll">
              {{ d.Activity.split(",")[1] }}<span class="unit">个</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当月</div>
            <div class="value samll">
              {{ d.Activity.split(",")[2] }}<span class="unit">个</span>
            </div>
          </div>
        </div>
      </q-card>
      <q-card flat>
        <div class="data-title">活动交易金额</div>
        <div class="data-time">{{ formatDate.date }} {{ formatDate.week }}</div>
        <div class="wrapper">
          <div class="col">
            <div class="label">当日</div>
            <div class="value">
              {{ numberFormat(d.ActivityMoney.split(",")[0]).value }}
              <span class="unit">{{
                numberFormat(d.ActivityMoney.split(",")[0]).unit
              }}</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当周</div>
            <div class="value samll">
              {{ numberFormat(d.ActivityMoney.split(",")[1]).value
              }}<span class="unit">{{
                numberFormat(d.ActivityMoney.split(",")[1]).unit
              }}</span>
            </div>
          </div>
          <div>
            <div class="label big">当月</div>
            <div class="value samll">
              {{ numberFormat(d.ActivityMoney.split(",")[2]).value
              }}<span class="unit">{{
                numberFormat(d.ActivityMoney.split(",")[2]).unit
              }}</span>
            </div>
          </div>
        </div>
      </q-card>
      <q-card flat>
        <div class="data-title">活动报名人数</div>
        <div class="data-time">{{ formatDate.date }} {{ formatDate.week }}</div>
        <div class="wrapper">
          <div class="col">
            <div class="label">当日</div>
            <div class="value">
              {{ d.ActivityGuest.split(",")[0] }}
              <span class="unit">人</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当周</div>
            <div class="value samll">
              {{ d.ActivityGuest.split(",")[1] }}<span class="unit">人</span>
            </div>
          </div>
          <div>
            <div class="label big">当月</div>
            <div class="value samll">
              {{ d.ActivityGuest.split(",")[2] }}<span class="unit">人</span>
            </div>
          </div>
        </div>
      </q-card>
      <q-card flat>
        <div class="data-title">活动待收信息</div>
        <div class="data-time">{{ formatDate.date }} {{ formatDate.week }}</div>
        <div class="wrapper">
          <div>
            <div class="label">待收订单金额</div>
            <div class="value">
              {{ numberFormat(d.ActivityOutPayMoney).value }}
              <span class="unit">{{
                numberFormat(d.ActivityOutPayMoney).unit
              }}</span>
            </div>
          </div>
        </div>
      </q-card>
    </div>
  </div>
</template>

<script>
export default {
  props: ["d", "formatDate", "shouType"],
  data() {
    return {};
  },
  methods: {
    numberFormat(value) {
      let param = {};
      let k = 10000;
      let sizes = ["元", "万", "亿", "万亿"];
      let i;
      if (value < k) {
        param.value = parseFloat(value).toFixed(2);
        param.unit = "元";
      } else {
        i = Math.floor(Math.log(value) / Math.log(k));
        param.value = (value / Math.pow(k, i)).toFixed(2);
        param.unit = sizes[i];
      }
      return param;
    }
  }
};
</script>

<style></style>
