<template>
  <div class="Reject">
    <div class="text-area">
      <div class="title"><span style="color:#FF4466;">*</span>不通过理由</div>
      <textarea placeholder="请输入" maxlength="200" v-model="value"></textarea>
      <div style="color:#999;text-align:right;">{{value.length}}/200</div>
    </div>
    <div class="footer" @click="submit">
      <div class="btn">保存</div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Reject",
  data() {
    return {
      value: '',
      id: '',
      pass: '',  // 0 驳回发布信息  1 驳回发布评论
      flag: '',  // 0 驳回信息  1 驳回评论
    };
  },
  onShow() {
    document.title = '评论审核'
  },
  onLoad(o) {
    this.id = o.id
    this.pass = o.pass
    this.flag = o.flag
  },
  methods: {
    submit() {
      if(!this.value) {
        return this.$u.toast('请输入不通过理由')
      }
      let url = ['/app/appvillagercircleinfo/examine','/app/appvillagercirclecomment/examine']
      this.$http.post(url[this.flag],null, {
          params: {
            id: this.id,
            pass: this.pass,
            opinion: this.value
          }
          }).then(() => {
          this.$u.toast('保存成功')
          uni.$emit('update')
          setTimeout(()=>{
            uni.navigateBack({delta: 2})
          },600)
        })
    }
  },
};
</script>

<style scoped lang="scss">
.Reject {
  .text-area{
    padding: 34px 32px;
    background-color: #fff;
    .title{
      font-size: 32px;
      font-family: PingFangSC-Regular, PingFang SC;
      color: #333;
      line-height: 44px;
      margin-bottom: 32px;
    }
    textarea{
      width: 100%;
      height: 500px;
      word-break: break-all;
    }
  }
  .footer {
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
  }
  .btn {
    width: 100%;
    height: 112px;
    line-height: 112px;
    text-align: center;
    background: #3975C6;
    font-size: 32px;
    font-family: PingFangSC-Medium, PingFang SC;
    font-weight: 500;
    color: #FFF;
  }
  .line-bg {
    width: 100%;
    height: 16px;
    background: #F5F5F5;
  }
}
</style>
