<template>
  <div class="groupSendResident">
    <AiTopFixed>
      <div class="search">
        <div class="searchBox">
          <u-search placeholder="请输入任务名称" v-model="name" :show-action="false"></u-search>
        </div>
        <div class="filterBtn"><img src="./images/shaixuan.png" alt="">筛选</div>
      </div>
    </AiTopFixed>
    <div class="resident_list">
      <div class="card" @click="toDetail" v-for="(item,index) in list" :key="index">
        <div class="card_title">
          <div class="card_left">{{ item.content }}</div>
          <div class="card_right"><span></span>进行中</div>
        </div>
        <div>创建时间：<span>{{ item.createTime }}</span></div>
        <div>共需<span class="num">56</span>名成员完成群发，目前已完成<span class="num">65%</span></div>
        <div>创建部门：<span>{{ item.createUserDept }}</span></div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      current: 1,
      name: '',
      list: [],
    }
  },
  methods: {
    toDetail() {
      uni.navigateTo({url: `./groupSendDetail`})
    },
    getList() {
      this.$http.post(`/app/appmasssendingtask/list`, null, {
        params: {
          current: this.current,

        }
      }).then(res=> {
        if(res?.data) {
          this.list = this.current == 1?  res.data.records : [...res.data.records, ...this.list]
        }
        console.log(res);
      })
    }
  },
  onShow() {
    document.title = '群发居民群'
    this.getList()
  },
  onReachBottom() {
    this.current ++
  },
}
</script>

<style lang="scss" scoped>
.groupSendResident {
  .search {
    display: flex;
    height: 80px;
    align-items: center;
    justify-content: space-between;

    .searchBox {
      width: 562px;
    }
    .filterBtn {
      img {
        width: 28px;
        height: 28px;
      }
    }
  }
  .resident_list {
    padding: 24px 32px 20px 32px;
    box-sizing: border-box;
    .card {
      background: #FFF;
      border-radius: 16px;
      padding: 30px;
      margin-bottom: 24px;
      & > div {
        padding: 10px 0;
      }
      .num {
        color: #3AA0FF;
      }
      .card_title {
        display: flex;
        justify-content: space-between;
        .card_left {
          font-size: 32px;
          color: #000000;
          font-weight: 600;
        }
        .card_right {
          span {
            display: inline-block;
            width: 16px;
            height: 16px;
            background: #3399FF;
            border-radius: 50%;
            margin-right: 10px;
          }
        }
      }
    }
  }
}
</style>