<template>
  <div class="add">
    <div class="tips">我承认本次申请帮扶情况属实，愿接受有关部门依法核实家庭资产信息，如存在虚报、伪造，造成社会资源浪费。本人资源承担相关惩戒措施。</div>
    <div class="user_info">
      <div class="item">
        <div class="left">
          <span>*</span><span>申请人姓名</span>
        </div>
        <input type="text" class="right__text" placeholder="请输入" maxlength="20"/>
      </div>
      <div class="item">
        <div class="left">
          <span>*</span><span>申请人身份证号</span>
        </div>
        <input type="text" class="right__text" placeholder="请输入" maxlength="20"/>
      </div>
      <div class="item">
        <div class="left">
          <span>*</span><span>联系方式</span>
        </div>
        <input type="number" class="right__text" placeholder="请输入" maxlength="11"/>
      </div>
    </div>

    <div class="family_info">
      <div class="item">
        <div class="left">
          <span>*</span><span>家庭人口数</span>
        </div>
        <input type="number" class="right__text" placeholder="请输入" maxlength="10"/>
      </div>
      <div class="item">
        <div class="left">
          <span>*</span><span>所在地区</span>
        </div>
        <!-- <AiAreaPicker class="ai-area" :areaId="$areaId" v-model="form.areaId" :fullName.sync="form.areaName">
              <div class="ai-area__wrapper">
                <span class="label" v-if="form.areaName">{{ form.areaName }}</span>
                <i v-else>请选择</i>
                <u-icon name="arrow-right" color="#ddd"/>
              </div>
            </AiAreaPicker> -->
        <AiAreaPicker v-model="areaId" class="right__text" :name.sync="areaName">
          <span :class="areaName == '' ? 'color-999' : 'color-333' ">{{ areaName || "请选择" }}</span>
          <u-icon name="arrow-right" color="#ddd" style="display: inline-block;"/>
        </AiAreaPicker>
      </div>
      <div class="items">
        <div class="left">
          <span>*</span><span>详细地址</span>
        </div>
        <input type="textarea" class="textarea" placeholder="请输入" maxlength="10"/>
      </div>
      <div class="items">
        <div class="left">
          <span>*</span><span>申请帮扶原因（最多2项）</span>
        </div>
        <div class="tags">
          <span v-for="(item,index) in list" :key="index" :class="item.checked? 'isCheck':''" @click="helpCheck(item)">{{ item }}</span>
        </div>
      </div>
      <div class="items">
        <div class="left">
          <span>*</span><span>返贫致贫风险说明</span>
        </div>
        <input type="text" class="text" placeholder="请简要说明返贫致贫风险说明" maxlength="200"/>
      </div>
      <div class="items">
        <div class="left">
          <span>*</span><span>上传佐证材料（最多9张）</span>
        </div>
        <div style="margin-top: 10px;">
          <AiUploader v-model="form.checkPhoto" :limit="9" multiple></AiUploader>
        </div>
      </div>
    </div>

    <div style="height: 60px;"></div>
    <div class="btn">
      <div @click="submit">提交</div>
    </div>

  </div>
</template>

<script>
export default {
  name: "add",
  appName: "自主申报",
  data() {
    return {
      form: {},
      areaName: '',
      list: ['张是','订单','电动蝶阀','斤斤计较','坎坎坷坷']
    }
  },
  onLoad() {
    this.$dict.load('')
  },
  methods: {
    helpCheck(e) {
      e.checked = !e.checked
    }
  },
}
</script>

<style lang="scss" scoped>
.add {
  .tips {
    padding: 32px;
    box-sizing: border-box;
    background: #FFF8F3;
    color: #FF883C;
    font-size: 30px;
  }

  .user_info,
  .family_info {
    background: #FFF;
    .item {
      display: flex;
      padding: 32px;
      box-sizing: border-box;
      border-bottom: 1px solid #DDDDDD;

      .left {
        width: 240px;
        span:first-child {
          color: #FF4466;
        }
      }
      
      .right__text {
        width: calc(100% - 240px);
        text-align: right;
      }

      .color-999 {
        color: #999;
      }
      .color-333 {
        color: #333;
      }
      
    }
    
    .item:last-child {
      border-bottom: none;
    }
    .items {
      padding: 32px;
      box-sizing: border-box;
      border-bottom: 1px solid #DDDDDD;
      .left {
        span:first-child {
          color: #FF4466;
        }
      }
      .text {
        margin-top: 20px;
      }
      .textarea {
        margin-top: 32px;
      }
      .tags {
        margin-top: 20px;
        span {
          display: inline-block;
          // padding: 10px 30px;
          width: 30%;
          height: 80px;
          line-height: 80px;
          text-align: center;
          box-sizing: border-box;
          border-radius: 16px;
          border: 1px solid #CCCCCC;
          margin-right: 20px;
          margin-bottom: 16px;
        }
        span:nth-child(3n) {
          margin-right: 0;
        }
      }
    }
  }
  
  .family_info {
    margin-top: 16px;
  }

  .btn {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    text-align: center;
    background: #FFF;
    padding: 16px 32px;
    box-sizing: border-box;
    div {
      width: 100%;
      height: 88px;
      line-height: 88px;
      background: #4181FF;
      border-radius: 16px;
      color: #FFF;
      font-size: 34px;
    }
  }
}
</style>