mailMessage.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <view class="page">
  3. <view class="mainBody">
  4. <scroll-view class="scroll-view_H" scroll-x="true" @scroll="scroll" scroll-left="0">
  5. <!-- <view class="item" :class="{'active':tab===0}" @click="checkTab(0)">
  6. <text class="left">全部</text>
  7. <view class="line"></view>
  8. </view> -->
  9. <view class="item" :class="{'active':tab===item.id}" @click="checkTab(item.id)"
  10. v-for="(item,index) in cate" :key="index">
  11. <text class="left">{{item.name}}</text>
  12. <view class="line"></view>
  13. </view>
  14. </scroll-view>
  15. </view>
  16. <view class="list_info" v-if="tab === 2">
  17. <block v-for="(item,index) in list" :key="index">
  18. <view class="item" @click="goDetail(item)">
  19. <view class="avator">
  20. <image class="icon" :src="item.image" mode="aspectFill"></image>
  21. </view>
  22. <view class="content">
  23. <view class="tit">
  24. <view class="name">{{item.name}}</view>
  25. <view class="time">{{item.time}}</view>
  26. <view class="desc">{{item.desc}}</view>
  27. </view>
  28. <view class="thumbnail">
  29. <image :src="item.thumbnail" mode="aspectFill"></image>
  30. </view>
  31. </view>
  32. </view>
  33. </block>
  34. <view class="blankHeight"></view>
  35. </view>
  36. <view class="list_article" v-if="tab === 1">
  37. <block v-for="(item,index) in list2" :key="index">
  38. <view class="item" @click="goDetail(item)">
  39. <view class="thumbnail">
  40. <image :src="item.thumbnail" mode="aspectFill"></image>
  41. </view>
  42. <view class="title">{{item.title}}</view>
  43. <view class="content">{{item.content}}</view>
  44. <view class="divider"></view>
  45. <view class="time">{{item.time}}</view>
  46. </view>
  47. </block>
  48. <view class="blankHeight"></view>
  49. </view>
  50. <DialogBox ref="DialogBox"></DialogBox>
  51. <ToastW3 ref="ToastW3"></ToastW3>
  52. <tabbar-view :tabbars="tabbars" :currentIndex="3" ref="tabbar"></tabbar-view>
  53. </view>
  54. </template>
  55. <script>
  56. import tabbarView from "@/components/tabbar/tabbar.vue";
  57. import tabbar from "@/mixins/tabbar";
  58. export default {
  59. components: {
  60. tabbarView,
  61. },
  62. mixins: [tabbar],
  63. data() {
  64. return {
  65. tab: 1,
  66. scrollTop: 0,
  67. old: {
  68. scrollTop: 0
  69. },
  70. list: [{
  71. image: '/static/images/avatar.png',
  72. name: '张三',
  73. time: '2024-03-20 12:30',
  74. desc: '给你点赞了一下作品',
  75. thumbnail: '/static/images/thumb1.png'
  76. }, {
  77. image: '/static/images/avatar2.png',
  78. name: '李四',
  79. time: '2024-03-19 15:45',
  80. desc: '评论了你的作品:真不错!',
  81. thumbnail: '/static/images/thumb2.png'
  82. }],
  83. list2: [{
  84. thumbnail: '/static/images/article1.png',
  85. title: '2024年最新艺术设计趋势',
  86. content: '近期艺术设计领域出现了许多新的趋势,本文将为您详细解析这些新趋势带来的机遇与挑战...',
  87. time: '2024-03-20 10:00'
  88. }, {
  89. thumbnail: '/static/images/article2.png',
  90. title: '如何提升作品质量',
  91. content: '作品质量是艺术创作中最重要的环节,本文将分享一些实用的技巧和方法...',
  92. time: '2024-03-19 14:30'
  93. }],
  94. cate: [{"name": "消息",id: 1},{"name": "点赞和评论",id: 2}],
  95. }
  96. },
  97. onLoad() {},
  98. onShow() {
  99. this.loadData();
  100. },
  101. onNavigationBarButtonTap(e) {
  102. if (e.index === 0) {
  103. // uni.navigateTo({
  104. // url: '/pages/my/wishList'
  105. // });
  106. }
  107. },
  108. methods: {
  109. onBack() {},
  110. checkTab(tab) {
  111. this.tab = tab;
  112. this.loadData();
  113. },
  114. scroll: function(e) {
  115. console.log(e)
  116. this.old.scrollTop = e.detail.scrollTop
  117. },
  118. goDetail(item) {
  119. },
  120. loadData() {
  121. },
  122. }
  123. }
  124. </script>
  125. <style scoped lang="scss">
  126. @import 'mailMessage.scss';
  127. </style>