index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. onLoad(options) {
  45. console.log(options,'onLoad')
  46. },
  47. data() {
  48. return {
  49. activityList: [],
  50. activityParams: {
  51. page: 1,
  52. page_size: 999,
  53. keyword: '',
  54. },
  55. activityListLoading: false,
  56. activityListLastPage: 1,
  57. mettingDesc: '',
  58. meetingInfo: {}
  59. }
  60. },
  61. created() {
  62. this.getMettingDesc()
  63. this.getList()
  64. uni.$on('refreshData', (val) => {
  65. if (val === 'activity') {
  66. this.getList()
  67. }
  68. })
  69. },
  70. methods: {
  71. getList() {
  72. this.showLoading()
  73. this.activityListLoading = true
  74. mettingList(this.activityParams).then(res => {
  75. if (res.data.data) {
  76. if (this.activityParams.page > 1) {
  77. this.activityList = [...this.activityList, ...res.data.data]
  78. } else {
  79. this.activityList = res.data.data
  80. this.activityListLastPage = res.data.last_page
  81. }
  82. } else {
  83. this.showToast('系统繁忙,稍候再试')
  84. }
  85. this.activityListLoading = false
  86. this.hideLoading()
  87. })
  88. },
  89. updateItemValue(e) {
  90. this.activityList.forEach((item) => {
  91. if (item.id === e.id) {
  92. item[e.key] = e.value
  93. }
  94. })
  95. },
  96. getMettingDesc() {
  97. getMeetingHeader().then(res => {
  98. this.meetingInfo = res.data
  99. })
  100. }
  101. }
  102. }
  103. </script>
  104. <style lang="scss">
  105. .activity-head {
  106. color: #333333;
  107. .activity-head-title {
  108. font-weight: bold;
  109. font-size: $fontSize6;
  110. line-height: 49rpx;
  111. }
  112. .activity-head-desc {
  113. margin-top: 20rpx;
  114. font-size: $fontSize3;
  115. line-height: 40rpx;
  116. }
  117. .activity-favourites-text {
  118. white-space: nowrap;
  119. }
  120. }
  121. .activity-list {
  122. display: grid;
  123. grid-template-columns: 1fr;
  124. grid-row-gap: 30rpx;
  125. margin-top: 40rpx;
  126. color: #333333;
  127. }
  128. </style>