<template>
  <view class="page">
    <view class="text">
      <u--textarea :height="300" :maxlength="255" v-model="value" placeholder="请输入内容" count></u--textarea>
    </view>
    <view class="btn-box">
      <button class="save-btn" type="default" @click="save">确定</button>
    </view>
  </view>
</template>

<script>

export default {
  onLoad() {
    // this.value = options.remark;
    const that = this
    const eventChannel = this.getOpenerEventChannel();
    eventChannel.on('remark', function (data) {
      // console.log(data, data.extend.remark)
      that.value = data.extend.remark
    })
  },
  data() {
    return {
      value: '1'
    };
  },
  methods: {
    save() {
      let pages = getCurrentPages()
      let prevPage = pages[pages.length - 2]
      console.log('prevPage',prevPage);
      prevPage.$vm.setRebackValue(this.value)
      uni.navigateBack({
        delta: 1,
      });
    }
  },

};
</script>

<style lang="scss" scoped>
.page {
  background: #FFFFFF;
  min-height: 100vh;
  padding-top: 20rpx;

  .text {
    margin: 20rpx 20rpx;
  }

  .btn-box {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    padding: 20rpx 0 40rpx;

    .save-btn {
      margin: 0 auto;
      width: 690rpx;
      height: 80rpx;
      line-height: 80rpx;
      border-radius: 40rpx;
      background: $uni-color-primary;
      color: #fff;
    }
  }
}

::v-deep .u-textarea {
  background-color: #FAFAFA !important;
  border: none;

  .u-textarea__count {
    background-color: transparent !important;
  }
}
</style>
