<template>
  <div class="Add">
    <div class="flex">
      <div class="label">
        <span class="tips">*</span>审核意见
      </div>
    </div>
    <div class="text-area">
      <u-input v-model="remark" type="textarea" :height="200" :auto-height="true" maxlength="500" placeholder="请输入审核意见" placeholder-style="font-size:16px;" />
      <div class="hint">{{ remark.length }}/200</div>
    </div>
    <div class="footer" @click="pass">
      <div class="btn">确认提交</div>
    </div>
  </div>
</template>

<script>
import {mapState} from "vuex";

export default {
  name: 'Add',
  data() {
    return {
      id: '',
      remark: ''
    }
  },
  computed: {
    ...mapState(['user']),
  },
  onLoad(option) {
    this.id = option.id
  },
  onShow() {
    document.title = '新增'
  },
  methods: {
    pass() {
      if(!this.remark) {
        return this.$u.toast('请输入审核意见')
      }
      this.$http.post(`/app/apppartyfourlinkage/auditById?id=${this.id}&status=0&remark=${this.remark}`).then((res) => {
        if (res.code == 0) {
          this.$u.toast('审核成功')
          uni.navigateBack({
            delta: 1
          })
          uni.$emit('reload')
        }
      })
    }
  },
}
</script>

<style lang="scss" scoped>
.Add {
  .flex{
    display: flex;
    justify-content: space-between;
    padding: 34px 32px 34px 12px;
    font-size: 32px;
    font-family: PingFangSC-Regular, PingFang SC;
    color: #333;
    line-height: 44px;
    background-color: #fff;
    .label{
      width: 150px;
      .tips{
        font-size: 32px;
        font-family: PingFangSC-Regular, PingFang SC;
        color: #F46;
      }
    }
    .value{
      span{
        display: inline-block;
        margin-right: 12px;
      }
      .color-999{
        color: #999;
      }
    }
  }
  .mar-b16{
    margin-bottom: 16px;
  }
  .text-area{
    width: 100%;
    padding: 0 32px 32px;
    background-color: #fff;
    box-sizing: border-box;
    .hint{
      width: 100%;
      color: #999;
      text-align: right;
    }
  }
  .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;
  }
}
</style>
