<template>
  <view class="view">
    <u--textarea
      v-model="introduce"
      placeholder="请输入..."
      maxlength="500"
      count
      :autoHeight="true"
    ></u--textarea>
    <cs-bottom-wrapper>
      <view class="operation">
        <button class="btn green" @tap="submit">保存</button>
      </view>
    </cs-bottom-wrapper>
  </view>
</template>

<script>
export default {
  data() {
    return {
      introduce: ''
    }
  },
  onLoad(res) {
    this.introduce = res.introduce
  },
  methods: {
    submit() {
      if (!this.introduce) {
        uni.showToast({
          icon: 'none',
          title: '请填写介绍'
        })
        return
      }
      uni.$emit('enterpriseIntroduce', { introduce: this.introduce })
      uni.navigateBack()
    }
  }
}
</script>

<style lang="scss" scoped>
.view {
  background-color: #fff;
  padding: 12px;
  height: 100vh;
}
::v-deep .u-textarea {
  min-height: 400rpx;
  background-color: #f9f9f9 !important;
  border: 1px solid #f9f9f9;
  border-radius: 12px;
  .u-textarea__count {
    background-color: #f9f9f9 !important;
  }
}

.operation {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  .btn {
    flex: 1;
    border-radius: 8px;
    display: flex;
    padding: 12px 0;
    align-items: center;
    justify-content: center;
  }
  .green {
    background-color: $cs-color-main;
    color: #fff;
  }
}
</style>