index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <page-layout class="activity-index">
  3. <nav-bar title="同期活动" @init="onInitNavbar"></nav-bar>
  4. <u-scroll-view :tabbar-conflict="true">
  5. <view class="main-container">
  6. <view class="activity-head">
  7. <view class="activity-head-title">同期活动</view>
  8. <view class="activity-head-desc">{{ mettingDesc }}</view>
  9. </view>
  10. <van-empty v-if="activityList.length === 0" description="暂无数据"/>
  11. <view v-else class="activity-list">
  12. <template v-for="(item, index) in activityList">
  13. <activity-item :item="item" :key="index" platform="metting" @updateItemValue="updateItemValue()"/>
  14. </template>
  15. </view>
  16. <!-- <disclaimer-text></disclaimer-text> -->
  17. </view>
  18. </u-scroll-view>
  19. <float-button></float-button>
  20. </page-layout>
  21. </template>
  22. <script>
  23. import NavBar from '@/components/layout/nav-bar'
  24. import UScrollView from '@/components/common/u-scroll-view'
  25. import ActivityItem from '@/pages/activity/components/activity-item.vue'
  26. import DisclaimerText from '@/components/disclaimer-text/index.vue'
  27. import {mettingList, mettingDesc} from '@/api/exhibitor'
  28. import floatButton from "@/components/layout/float-button";
  29. import PageLayout from "@/components/layout/page-layout";
  30. export default {
  31. options: {
  32. styleIsolation: 'shared'
  33. },
  34. components: {
  35. PageLayout,
  36. NavBar,
  37. UScrollView,
  38. ActivityItem,
  39. DisclaimerText,
  40. floatButton },
  41. data() {
  42. return {
  43. activityList: [],
  44. activityParams: {
  45. page: 1,
  46. page_size: 10,
  47. keyword: '',
  48. },
  49. activityListLoading: false,
  50. activityListLastPage: 1,
  51. mettingDesc: ''
  52. }
  53. },
  54. created() {
  55. this.getMettingDesc()
  56. this.getList()
  57. uni.$on('refreshData', (val) => {
  58. if (val === 'activity') {
  59. this.getList()
  60. }
  61. })
  62. },
  63. methods: {
  64. getList() {
  65. this.activityListLoading = true
  66. mettingList(this.activityParams).then(res => {
  67. if (res.data.data) {
  68. if (this.activityParams.page > 1) {
  69. this.activityList = [...this.activityList, ...res.data.data]
  70. } else {
  71. this.activityList = res.data.data
  72. this.activityListLastPage = res.data.last_page
  73. }
  74. } else {
  75. this.showToast('系统繁忙,稍候再试')
  76. }
  77. this.activityListLoading = false
  78. })
  79. },
  80. updateItemValue(e) {
  81. this.activityList.forEach((item) => {
  82. if (item.id === e.id) {
  83. item[e.key] = e.value
  84. }
  85. })
  86. },
  87. getMettingDesc() {
  88. mettingDesc().then(res => {
  89. this.mettingDesc = res.data
  90. })
  91. }
  92. }
  93. }
  94. </script>
  95. <style lang="scss">
  96. .activity-head {
  97. color: #333333;
  98. .activity-head-title {
  99. font-weight: bold;
  100. font-size: $fontSize6;
  101. line-height: 49rpx;
  102. }
  103. .activity-head-desc {
  104. margin-top: 20rpx;
  105. font-size: $fontSize3;
  106. line-height: 40rpx;
  107. }
  108. .activity-favourites-text {
  109. white-space: nowrap;
  110. }
  111. }
  112. .activity-list {
  113. display: grid;
  114. grid-template-columns: 1fr;
  115. grid-row-gap: 30rpx;
  116. margin-top: 40rpx;
  117. color: #333333;
  118. }
  119. </style>