edit.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <page-meta root-font-size="system" />
  3. <view>
  4. <uni-nav-bar :title="date" right-text="确定" @clickRight="dialog"></uni-nav-bar>
  5. <view class="diary_content">
  6. <uni-list>
  7. <uni-list-item>
  8. <template v-slot:header>
  9. <view class="date">任务</view>
  10. </template>
  11. <template v-slot:footer>
  12. <view class="content">
  13. <uni-easyinput type="textarea" v-model="TODO" :maxlength="-1" :autoHeight="true"
  14. placeholder="请输入内容"></uni-easyinput>
  15. </view>
  16. </template>
  17. </uni-list-item>
  18. <uni-list-item>
  19. <template v-slot:header>
  20. <view class="date">完成</view>
  21. </template>
  22. <template v-slot:footer>
  23. <view class="content">
  24. <uni-easyinput type="textarea" v-model="DONE" :maxlength="-1" :autoHeight="true"
  25. placeholder="请输入内容"></uni-easyinput>
  26. </view>
  27. </template>
  28. </uni-list-item>
  29. <uni-list-item>
  30. <template v-slot:header>
  31. <view class="date">反馈</view>
  32. </template>
  33. <template v-slot:footer>
  34. <view class="content">
  35. <uni-easyinput type="textarea" v-model="BUG" :maxlength="-1" :autoHeight="true"
  36. placeholder="请输入内容"></uni-easyinput>
  37. </view>
  38. </template>
  39. </uni-list-item>
  40. <uni-list-item>
  41. <template v-slot:header>
  42. <view class="date">备注</view>
  43. </template>
  44. <template v-slot:footer>
  45. <view class="content">
  46. <uni-easyinput type="textarea" v-model="remark" :maxlength="-1" :autoHeight="true"
  47. placeholder="请输入内容"></uni-easyinput>
  48. </view>
  49. </template>
  50. </uni-list-item>
  51. <uni-list-item>
  52. <template v-slot:footer>
  53. <view class="content">
  54. <button @click="dialog" type="primary">提交</button>
  55. </view>
  56. </template>
  57. </uni-list-item>
  58. </uni-list>
  59. </view>
  60. <!-- 确认提交弹出层 -->
  61. <view class="popup_container">
  62. <uni-popup ref="submitDialog" type="dialog">
  63. <uni-popup-dialog type="success" title="确认提交" @confirm="submit"></uni-popup-dialog>
  64. </uni-popup>
  65. </view>
  66. </view>
  67. </template>
  68. <script setup lang="ts">
  69. import { onMounted, ref } from 'vue'
  70. import { onLoad } from '@dcloudio/uni-app'
  71. import { useUserStore } from '@/store/user.js'
  72. const date = ref('')
  73. const TODO = ref('')
  74. const DONE = ref('')
  75. const BUG = ref('')
  76. const remark = ref('')
  77. const userStore = useUserStore()
  78. onMounted(() => {
  79. console.log('diaryOnMounted', userStore.user);
  80. })
  81. onLoad((option) => {
  82. if (isNaN(Number(option.day))) {
  83. date.value = "11/12 周" + option.day
  84. } else {
  85. date.value = "第 " + option.day + " 周"
  86. }
  87. })
  88. const submitDialog = ref(null)
  89. function dialog() {
  90. submitDialog.value.open()
  91. }
  92. function submit() {
  93. console.log('submit');
  94. console.log('TODO', JSON.stringify(TODO.value));
  95. console.log('DONE', JSON.stringify(DONE.value));
  96. console.log('BUG', JSON.stringify(BUG.value));
  97. console.log('remark', JSON.stringify(remark.value));
  98. }
  99. </script>
  100. <style lang="scss">
  101. .diary_content {
  102. .date {
  103. text-align: center;
  104. width: 20%;
  105. margin: auto 0;
  106. }
  107. .content {
  108. width: 100%;
  109. textarea {
  110. height: 15vh !important;
  111. }
  112. }
  113. }
  114. </style>