<template>
  <div class="PercentageDetail">
    <div class="header">
      <div class="left">
        <h2>小区管理</h2>
        <p>共21条，已办结18条</p>
      </div>
      <div class="right">
        <h4>86%</h4>
        <p>办结率</p>
      </div>
    </div>
    <div class="info-content">
      <div class="title">分类统计</div>
      <div class="percentage">
        <div class="item">
          <div class="mini-title">小区管理</div>
          <div class="info">
            <div class="line-bg"><div class="active-bg"></div></div>共11条 | 已办结9
          </div>
        </div>
        <div class="item">
          <div class="mini-title">小区管理</div>
          <div class="info">
            <div class="line-bg" style="width:44%;"><div class="active-bg"></div></div>共11条 | 已办结9
          </div>
        </div>
        <div class="item">
          <div class="mini-title">小区管理</div>
          <div class="info">
            <div class="line-bg" style="width:30%;"><div class="active-bg"></div></div>共11条 | 已办结9
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {},
  data() {
    return {
      contents: [
        {
          label: '待受理',
          num: 5
        },
        {
          label: '办理中',
          num: 5
        },
        {
          label: '今日上报',
          num: 5
        },
        {
          label: '今日办结',
          num: 5
        }
      ]
    }
  },
  onLoad() {
    
  },
  onShow() {},
  methods: {
    getList() {
      this.$http
        .post('/app/appvisitvondolence/list', null, {
          params: {
            size: this.size,
            current: this.current,
            createUserId: this.currentTabs == 1 ? this.user.id : '',
          },
        })
        .then((res) => {
          if (res.code == 0) {
            this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records
            this.pages = res.data.pages
          }
        })
    },

    goDetail(item) {
      uni.navigateTo({ url: `./Detail?id=${item.id}` })
    },

    change(index) {
      this.currentTabs = index
      this.getList()
    },
  },
  onReachBottom() {
    this.current = this.current + 1
    this.getList()
  },
}
</script>

<style scoped lang="scss">
.PercentageDetail {
  background-color: #F3F7F8;
  padding: 32px 30px 0;
  .header{
    width: 100%;
    background: #FFF;
    border-radius: 16px;
    margin-bottom: 30px;
    display: flex;
    padding: 32px 32px 38px 24px;
    box-sizing: border-box;
    .left{
      width: calc(100% - 112px);
      h2{
        font-size: 42px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #333;
        line-height: 48px;
        margin-bottom: 16px;
      }
      p{
        font-size: 30px;
        font-family: PingFangSC-Regular, PingFang SC;
        color: #999;
        line-height: 42px;
      }
    }
    .right{
      width: 112px;
      background: #E6FFF1;
      border-radius: 8px;
      text-align: center;
      color: #42D784;
      h4{
        font-size: 36px;
        font-family: DINAlternate-Bold, DINAlternate;
        font-weight: bold;
        line-height: 42px;
        padding: 8px 0 4px 0;
      }
      p{
        font-size: 24px;
        font-family: PingFangSC-Regular, PingFang SC;
        line-height: 34px;
      }
    }
  }
  .info-content{
    width: 100%;
    background: #FFF;
    border-radius: 16px;
    margin-bottom: 24px;
    .title{
      font-size: 32px;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: #333;
      line-height: 48px;
      padding: 24px 16px 24px 24px;
      img{
        float: right;
        width: 40px;
        height: 40px;
      }
    }
    .percentage{
      padding: 16px 0 0 26px;
      .item{
        width: 100%;
        padding-bottom: 32px;
        .mini-title{
          font-size: 30px;
          font-family: PingFangSC-Regular, PingFang SC;
          color: #333;
          line-height: 48px;
          margin-bottom: 14px;
        }
        .info{
          width: 100%;
          font-size: 28px;
          font-family: PingFangSC-Regular, PingFang SC;
          color: #999;
          line-height: 48px;
          .line-bg{
            display: inline-block;
            width: 56%;
            height: 14px;
            background: #D7D8D9;
            border-radius: 8px;
            margin-right: 12px;
            .active-bg{
              width: 80%;
              height: 100%;
              background: #257FF1;
              border-radius: 8px;
            }
          }
          img{
            width: 32px;
            height: 32px;
            vertical-align: middle;
          }
        }
      }
    }
  }
}
</style>
