index.vue 3.4 KB

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