journal.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <view class="ss-p-x-30 ss-p-y-30">
  3. <uni-easyinput type="textarea" v-model="journal" clearable maxlength="500" autoHeight placeholder="请输入要记录的内容" />
  4. <view style="text-align: end;" class="ss-m-t-10 color-999">{{ journal?.length || 0 }}/500</view>
  5. <view class="f-horizon-center">
  6. <button
  7. v-if="editId"
  8. size="default"
  9. class="delete-button commonBtnStyle"
  10. :disabled="deleteDisabled"
  11. @click="handleDelete"
  12. >删 除</button>
  13. <button
  14. size="default"
  15. :class="{'save-button': editId, 'commonBtnStyle': editId, 'send-button': !editId}"
  16. @click="handleSubmit"
  17. :disabled="disabled"
  18. >保 存</button>
  19. </view>
  20. </view>
  21. </template>
  22. <script setup>
  23. import { ref } from 'vue'
  24. import { onLoad } from '@dcloudio/uni-app'
  25. const editId = ref(null)
  26. const journal = ref(null)
  27. const disabled = ref(false)
  28. const deleteDisabled = ref(false)
  29. onLoad((options) => {
  30. editId.value = options?.id || null
  31. journal.value = options?.text || null
  32. })
  33. const handleDelete = () => {}
  34. const handleSubmit = async () => {
  35. }
  36. </script>
  37. <style lang="scss" scoped>
  38. </style>