index.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <page title="消息" ref="pageRef" nav-color="transparent">
  3. <!-- <view v-if="tableData && tableData.length > 0" class="list"> -->
  4. <!-- <view v-for="item in tableData" class="cell">
  5. </view> -->
  6. <view v-for="(item, index) in tableData" :key="index" class="cell">
  7. <view class="flex-align">
  8. <view class="cuIcon-noticefill icon"></view>
  9. <view class="font4 bold color-1 flex1 marginL10">{{ item.title }}</view>
  10. <view class="font2 color-3">{{ item.createTime }}</view>
  11. </view>
  12. <view class="font4 paddingT8" style="color: #666666">{{ item.content }}</view>
  13. </view>
  14. <!-- </view> -->
  15. <empty v-if="isEmpty" :top="200" />
  16. </page>
  17. </template>
  18. <script>
  19. import pageMixin from './../../mixin/page'
  20. import empty from '@/components/empty'
  21. import loginMixin from '@/mixin/login'
  22. import resource from '@/utils/resource'
  23. export default {
  24. mixins: [pageMixin, loginMixin],
  25. components: { empty },
  26. data() {
  27. return { resource }
  28. },
  29. mounted() {
  30. this.refresh()
  31. },
  32. onPullDownRefresh() {
  33. this.refresh()
  34. },
  35. onReachBottom() {
  36. this.loadMore()
  37. },
  38. methods: {
  39. init() {
  40. this.refresh()
  41. },
  42. async loadData() {
  43. const res = await this.$service.base.message(this.pageNum, this.pageSize)
  44. return res
  45. }
  46. }
  47. }
  48. </script>
  49. <style lang="scss" scoped>
  50. .cell {
  51. margin: 20rpx 28rpx 0;
  52. background: #fff;
  53. border-radius: 20rpx;
  54. padding: 30rpx;
  55. .icon {
  56. font-size: 28rpx;
  57. background: #fec433;
  58. color: #000;
  59. padding: 8rpx;
  60. border-radius: 50%;
  61. }
  62. }
  63. </style>