<template>
  <view class="ss-p-x-30 ss-p-y-30">
		<uni-easyinput type="textarea" v-model="journal" clearable maxlength="500" autoHeight placeholder="请输入要记录的内容" />
		<view class="f-horizon-center">
      <button
				v-if="editId"
				size="default"
				class="delete-button commonBtnStyle" 
				:disabled="deleteDisabled"
				@click="handleDelete"
			>删 除</button>
      <button 
        size="default" 
        :class="{'save-button': editId, 'commonBtnStyle': editId, 'send-button': !editId}" 
        @click="handleSubmit"
        :disabled="disabled"
       >保 存</button>
    </view>
  </view>
</template>

<script setup>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'

const editId = ref(null)
const journal = ref(null)
const disabled = ref(false)
const deleteDisabled = ref(false)

onLoad((options) => {
  editId.value = options?.id || null
  journal.value = options?.text || null
})

const handleDelete = () => {}

const handleSubmit = async () => {
}
</script>

<style lang="scss" scoped>
</style>