<template>
  <div class="sendScoped">
    <div class="item" v-for="(item,index) in checkList" :key="index" @click="checkBtn(item)">
      <div>{{ item.name }}</div>
      <div>
        <icon type="success" size="16" v-if="item.checked"/>
        <icon type="circle" size="18" v-else />
      </div>
    </div>

    <div class="btn">
      <div class="cancelBtn">取消</div>
      <div class="submitBtn">确定</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'sendScoped',
  data() {
    return {
      value: '',
      checkList: [
        { name: '全部居民群', checked: false },
        { name: '按部门选择', checked: false },
        { name: '按网格选择', checked: false }
      ],
      checked: true
    }
  },
  methods: {
    checkBtn(e) {
      // console.log(e);
      this.checkList.forEach(v=> v.checked = false)
      e.checked = true
    }
  },
  onLoad(o) {
    console.log(o);
    document.title = "选择发送范围"
  },
}
</script>
<style lang="scss" scoped>
.sendScoped {
  background: #FFF;

  .item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #DDD;
    padding: 26px 32px;
    box-sizing: border-box;

  }


  .btn {
    position: fixed;
    bottom: 0;
    left: 0;
    background: #FFF;
    display: flex;
    width: 100%;
    height: 128px;
    padding: 24px 32px;
    box-sizing: border-box;

    .cancelBtn,
    .submitBtn {
      flex: 1;
      height: 80px;
      line-height: 80px;
      text-align: center;
      border-radius: 8px;
      border: 2px solid #CCCCCC;
    }
    .submitBtn {
      background: #1365DD;
      color: #FFF;
      margin-left: 16px;
      border: none;
    }
  }
}
</style>