index.vue 3.3 KB

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