edit.vue 3.1 KB

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