<script setup>
import { postWorkDataEvaluateApi } from '@/api/elevator'

const content = ref('')

const submit = async () => {
  console.log('提交')
  const { id: workId } = options.value
  await postWorkDataEvaluateApi({
    workId,
    operationContent: content.value
  })
  uni.$u.toast('评价成功')
  setTimeout(() => {
    uni.navigateBack()
  }, 1500)
}

const options = ref({})
onLoad(async (e) => {
  options.value = e
})
</script>

<template>
  <view px-28 mt-20>
    <up-textarea
      v-model="content"
      placeholder="请输入..."
      maxlength="300"
      count
      height="150"
    />
  </view>

  <view position="fixed" w-full bottom-36 f-c-c>
    <up-button
      type="primary"
      text="完成"
      :custom-style="{
        width: '650rpx'
      }"
      @click="submit"
    />
  </view>
</template>
