<template>
  <div>
    <div class="divBox">
      <el-row :gutter="24" class="baseInfo">
        <el-col :xs="12" :sm="12" :lg="4" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div slot="header" class="acea-row row-between-wrapper">
              <span>会员总数</span>
            </div>
            <div class="contentA" v-if="count">
              <span class="content-number spBlock mb15"><count-to :start-val="0" :end-val="count.userNum" :duration="2600" class="card-panel-num" /></span>
              <div class="acea-row row-between-wrapper" style="margin-top: 15px;">
                <span class="content-time">今日新增会员</span>
                <span style="float: right">{{ count.todayUserNum }} 人</span>
              </div>
            </div>
          </el-card>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="4" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div slot="header" class="acea-row row-between-wrapper">
              <span>问诊订单总数</span>
            </div>
            <div class="contentA" v-if="count">
              <span class="content-number spBlock mb15"><count-to :start-val="0" :end-val="count.allInquiryOrderNum" :duration="3000" class="card-panel-num" /></span>
              <div class="acea-row row-between-wrapper" style="margin-top: 15px;">
                <span class="content-time">今日新增问诊订单</span>
                <span style="float: right">{{ count.todayInquiryOrderNum }} 单</span>
              </div>
            </div>
          </el-card>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="4" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div slot="header" class="acea-row row-between-wrapper">
              <span>药品订单总数</span>
            </div>
            <div class="contentA" v-if="count">
              <span class="content-number spBlock mb15"><count-to :start-val="0" :end-val="count.allOrderNum" :duration="3200" class="card-panel-num" /></span>
              <div class="acea-row row-between-wrapper" style="margin-top: 15px;">
                <span class="content-time">今日新增药品订单</span>
                <span style="float: right">{{ count.todayOrderNum }} 单</span>
              </div>
            </div>
          </el-card>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="4" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div slot="header" class="acea-row row-between-wrapper">
              <span>商品总数</span>
            </div>
            <div class="contentA" v-if="count">
              <span class="content-number spBlock mb15"><count-to :start-val="0" :end-val="count.storeProdNum" :duration="3200" class="card-panel-num" /></span>
              <div class="acea-row row-between-wrapper" style="margin-top: 15px;">
                <span class="content-time">今日新增商品</span>
                <span style="float: right">{{ count.todayStoreProdNum }} 个</span>
              </div>
            </div>
          </el-card>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="4" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div slot="header" class="acea-row row-between-wrapper">
              <span>医生总数</span>
            </div>
            <div class="contentA" v-if="count">
              <span class="content-number spBlock mb15"><count-to :start-val="0" :end-val="count.doctor" :duration="3200" class="card-panel-num" /></span>
              <div class="acea-row row-between-wrapper" style="margin-top: 15px;">
                <span class="content-time">今日新增医生</span>
                <span style="float: right">{{ count.todayDoctor }} 人</span>
              </div>
            </div>
          </el-card>
        </el-col>
        <el-col :xs="12" :sm="12" :lg="4" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div slot="header" class="acea-row row-between-wrapper">
              <span>药师总数</span>
            </div>
            <div class="contentA" v-if="count">
              <span class="content-number spBlock mb15"><count-to :start-val="0" :end-val="count.medicinePe" :duration="3200" class="card-panel-num" /></span>
              <div class="acea-row row-between-wrapper" style="margin-top: 15px;">
                <span class="content-time">今日新增药师</span>
                <span style="float: right">{{ count.todayMedicinePe }} 人</span>
              </div>
            </div>
          </el-card>
        </el-col>
        <!-- <el-col :xs="12" :sm="12" :lg="4" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div slot="header" class="acea-row row-between-wrapper" >
              <span>总人数:{{count.pe}}</span>
            </div>
            <div class="content" v-if="count">
            <div class="acea-row row-between-wrapper" style="margin-top: 4px; ">
                <span class="content-time">医生人数：</span>
                <span>{{ count.doctor }} </span>
              </div>
              <div class="acea-row row-between-wrapper" style="margin-top: 4px;">
                <span class="content-time">患者人数：</span>
                <span>{{ count.patient }} </span>
              </div>
              <div class="acea-row row-between-wrapper" style="margin-top: 4px;">
                <span class="content-time">药师人数：</span>
                <span>{{ count.medicinePe }} </span>
              </div>
            </div>
          </el-card>
        </el-col> -->
      </el-row>
    </div>
  </div>
</template>
<script>
import CountTo from "vue-count-to";
import { getPeData } from "@/api/his/index";

export default {
  components: {
    CountTo,
  },
  data() {
    return {
      count: {
        allOrderNum: 0,
        todayOrderNum: 0,
        allOrderMoney: 0,
        todayOrderMoney: 0,
        todayInquiryOrderNum: 0,
        AllInquiryOrderNum: 0,
        doctor: 0,
        medicinePe: 0,
        patient:0,
        pe:0,
        storeProdNum:0,
        todayStoreProdNum:0,
        todayDoctor:0,
        todayMedicinePe:0,
      },
    };
  },
  mounted() {
      getPeData().then(response => {
        this.count = response.data;
      });
  },
};
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.panel-group {
  margin-top: 18px;

  .card-panel-col {
    margin-bottom: 32px;
  }

  .card-panel {
    height: 108px;
    cursor: pointer;
    font-size: 12px;
    position: relative;
    overflow: hidden;
    color: #666;
    background: #fff;
    box-shadow: 4px 4px 40px rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.05);

    .icon-people {
      color: #40c9c6;
    }

    .icon-message {
      color: #36a3f7;
    }

    .icon-money {
      color: #f4516c;
    }

    .icon-shopping {
      color: #34bfa3;
    }

    .card-panel-icon-wrapper {
      float: left;
      margin: 14px 0 0 14px;
      padding: 16px;
      transition: all 0.38s ease-out;
      border-radius: 6px;
    }

    .card-panel-icon {
      float: left;
      font-size: 48px;
    }

    .card-panel-description {
      float: right;
      font-weight: bold;
      margin: 26px;
      margin-left: 0px;

      .card-panel-text {
        line-height: 18px;
        color: rgba(0, 0, 0, 0.45);
        font-size: 16px;
        margin-bottom: 12px;
      }

      .card-panel-num {
        font-size: 20px;
      }
    }
  }
}

@media (max-width: 550px) {
  .card-panel-description {
    display: none;
  }

  .card-panel-icon-wrapper {
    float: none !important;
    width: 100%;
    height: 100%;
    margin: 0 !important;

    .svg-icon {
      display: block;
      margin: 14px auto !important;
      float: none !important;
    }
  }
}
.baseInfo {
  ::v-deep .el-card__header {
    padding: 15px 20px !important;
  }
}

.ivu-mb {
  margin-bottom: 10px;
  font-size: 12px!important;
}
.up,
.el-icon-caret-top {
  color: #f5222d;
  font-size: 12px;
  opacity: 1 !important;
}

.down,
.el-icon-caret-bottom {
  color: #39c15b;
  font-size: 12px;
  /*opacity: 100% !important;*/
}

.content {
  &-number {
    font-size: 30px;
  }
  &-time {
    font-size: 14px;
    /*color: #8C8C8C;*/
  }
}
.spBlock {
  display: block;
}
</style>
