<template>
    <div class="surrounding">
      <van-tabs :active="active" @change="onChange">
        <van-tab title="新增发布" :name="0">
          <newRelease_com></newRelease_com>
        </van-tab>
        <van-tab title="发布记录" :name="1">
            <releaseRecord_com/>
        </van-tab>
      </van-tabs>
    </div>
</template>

<script>
import newRelease_com from "./components/newRelease_com.vue";
import releaseRecord_com from "./components/releaseRecord_com.vue";
export default {
  name: "index",
  components:{
    newRelease_com,
    releaseRecord_com
  },
  data(){
    return{
      active: 0,
      postData:{},
      checkList:[
        {name:'干洗',isCheck:true},
        {name:'维修',isCheck:false},
        {name:'家政服务',isCheck:false},
        {name:'桶装水',isCheck:false},
        {name:'其他',isCheck:false},
      ],
      checkedName:'干洗'
    }
  },
  methods:{
    onChange(e) {

    },
    clickCheck(item) {
      this.checkedName = item.name
    },
    deleteRYXXZP(event) {
      this.fileList.splice(event.detail.index, 1);
      this.$forceUpdate();
    },
    uploadRYXXZP(event) {
      console.log(event)
      let that = this;
      const { file } = event.detail;
      uni.uploadFile({
        url: that.$constant.BASE_URI + "/wx/fileController/upload",
        filePath: file.url,
        name: "file",
        formData: { user: "test" },
        success(res) {
          // 上传完成需要更新 fileList
          let data = JSON.parse(res.data);
          that.fileList.push({
            imgUrl: "/FileController/download/" + data.data[0],
            id: data.data[0],
            url:
                that.$constant.BASE_URI +
                "/FileController/download/" +
                data.data[0],
            isImage: true,
          });
        },
        fail(res) {},
      });
    },
  }
}
</script>

<style lang="scss">
.surrounding{
  .newRelease_com{
    .predetermineUl{
      margin: 24rpx 0;
      background: white;
      box-sizing: border-box;
      padding: 0 32rpx;
      .predetermineLi{
        padding: 32rpx 0;
        border-bottom: 1px solid rgba(230, 230, 230, 1);
        display: flex;
        justify-content: space-between;
      }
      .predetermineLi2{
        padding: 32rpx 0;
        border-bottom: 1px solid rgba(230, 230, 230, 1);
        display: flex;
        flex-direction: column;
      }
      .van-cell {
        background: #F5F7FA !important;
        border-radius: 8rpx;
        font-size: 28rpx;
        margin-top: 16rpx;
      }
      .liName{
        color: rgba(51, 51, 51, 1);
        font-size: 32rpx;
      }
      .liIpt{
        color: rgba(102, 102, 102, 1);
        font-size: 32rpx;
        text-align: right;
      }
      .detailLi{
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 32rpx 0;
        border-bottom: 2rpx solid #E6E6E6;
        .liInfo{
          display: inline-block;
          text-align: right;
          max-width: 428rpx;
          color: rgba(102, 102, 102, 1);
          font-size: 32rpx;
          line-height: 38rpx;
          .radio{
            margin-left: 64rpx;
          }
        }
      }
      .detailLi2{
        display: flex;
        flex-direction: column;
        padding: 32rpx 0;
        border-bottom: 2rpx solid #E6E6E6;
        .detailLi2BoxTop{
          display: flex;
          flex-wrap: wrap;
          justify-content: space-between;
          margin: 12rpx 0;
          .checkItem{
            width: 128rpx;
            height: 64rpx;
            font-size: 28rpx;
            color: #666666;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #F5F7FA;
            border-radius: 8rpx;
            margin: 12rpx 0;
          }
          .checked{
            background: #0365F9;
            color: white;
          }
        }
      }
    }
    .titleBox{
        display: flex;
        align-items: center;
        .titleName{
          color: rgba(24, 23, 42, 1);
          font-size: 32rpx;
          font-weight: 600;
          margin-right: 16rpx;
        }
        .tips{
          font-size: 28rpx;
          color: rgba(179, 179, 179, 1);
        }
      }
    .buttonBox{
      display: flex;
      justify-content: center;
      .btn{
        width: 240rpx;
        height: 80rpx;
        display: flex;
        border-radius: 8rpx;
        align-items: center;
        justify-content: center;
        margin: 48rpx 16rpx 150rpx 16rpx;
        color: white;
        letter-spacing: 2rpx;
        text-indent: 2rpx;
      }
      .zcBtn{
        background: #FE8643;
      }
      .tjBtn{
        background: #0365F9;
      }
    }
  }
}
</style>
