noteBox.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view>
  3. <view v-if="noteList.length == 0" style="text-align: center">暂无笔记</view>
  4. <view v-for="(item, index) in noteList" :key="index">
  5. <view class="dateBox">{{ $method.timestampToTime(item.dateNote) }}</view>
  6. <view class="noteBox">
  7. <view
  8. v-for="(item1, index1) in item.userNotes"
  9. :key="index1"
  10. style="margin-top: 30rpx"
  11. @click="jumpNote(item1)"
  12. >
  13. <view style="display: flex">
  14. <view class="left_ti">
  15. <view>
  16. <image
  17. src="/static/icon/note2.png"
  18. v-if="noteId != item1.noteId"
  19. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  20. ></image>
  21. <image
  22. src="/static/icon/note1.png"
  23. v-if="noteId == item1.noteId"
  24. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  25. ></image>
  26. </view>
  27. <view
  28. class="title"
  29. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  30. >{{ $method.secondToDate(item1.noteSecond) }}</view
  31. >
  32. </view>
  33. <view style="margin-left: 10rpx">
  34. <view class="t2Content leftPadding">{{ item1.sectionName }}</view>
  35. <view class="tBox2">{{ item1.noteText }}</view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. import { mapGetters } from "vuex";
  45. export default {
  46. name: "SaasMiniprogramNoteBox",
  47. props: {
  48. params: {
  49. type: Object,
  50. defaule: {},
  51. },
  52. },
  53. data() {
  54. return {
  55. noteList: [],
  56. noteId: 0,
  57. };
  58. },
  59. mounted() {
  60. this.getNoteList();
  61. },
  62. methods: {
  63. getNoteList() {
  64. this.$api
  65. .noteList({ ...this.param, ...{ sectionId: this.playSectionId } })
  66. .then((res) => {
  67. if (res.data.code == 200) {
  68. this.noteList = res.data.rows;
  69. console.log(this.noteList, 789);
  70. }
  71. });
  72. },
  73. jumpNote(item) {
  74. this.noteId = item.noteId;
  75. this.$emit('jumpNote', item);
  76. },
  77. },
  78. computed: {
  79. ...mapGetters(["playSectionId"]),
  80. },
  81. };
  82. </script>
  83. <style lang="scss" scoped>
  84. .leftPadding {
  85. margin-left: 8rpx;
  86. }
  87. .dateBox {
  88. width: 216rpx;
  89. height: 48rpx;
  90. background: #ffffff;
  91. border-radius: 24rpx;
  92. font-size: 24rpx;
  93. color: #666666;
  94. text-align: center;
  95. line-height: 48rpx;
  96. margin: 16rpx 0rpx 8rpx;
  97. }
  98. .noteBox {
  99. width: 100%;
  100. background: #ffffff;
  101. padding: 0rpx 10rpx 20rpx;
  102. border-radius: 16rpx;
  103. overflow: hidden;
  104. .left_ti {
  105. padding-top: 14rpx;
  106. .title {
  107. font-size: 24rpx;
  108. color: #999999;
  109. }
  110. }
  111. }
  112. .t2Content {
  113. font-size: 24rpx;
  114. font-family: PingFang SC;
  115. font-weight: bold;
  116. color: #999999;
  117. line-height: 48rpx;
  118. }
  119. .tBox2 {
  120. display: flex;
  121. padding-top: 10rpx;
  122. color: #333333;
  123. font-size: 30rpx;
  124. font-weight: 400;
  125. }
  126. </style>