index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <view 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">今年慕尼黑上海电子生产设备展将围绕四大行业主题开展共计9场同期论坛,论坛围绕工业机器人、柔性制造、储能与新能源、汽车线束、智能座舱、智能制造、TGV先进材料、封装、胶粘剂、新能源汽车等热门话题展开更多探讨与交流。</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" />
  14. </template>
  15. </view>
  16. </view>
  17. </u-scroll-view>
  18. </view>
  19. </template>
  20. <script>
  21. import NavBar from '@/components/layout/nav-bar'
  22. import UScrollView from '@/components/common/u-scroll-view'
  23. import ActivityItem from '@/pages/activity/components/activity-item.vue'
  24. import { mettingList } from '@/api/exhibitor'
  25. export default {
  26. options: {
  27. styleIsolation: 'shared'
  28. },
  29. components: {
  30. NavBar,
  31. UScrollView,
  32. ActivityItem
  33. },
  34. data() {
  35. return {
  36. activityList: [{ favourited: true }, {}, {}],
  37. activityParams: {
  38. page: 1,
  39. page_size: 10,
  40. keyword: '',
  41. },
  42. activityListLoading: false,
  43. activityListLastPage: 1,
  44. }
  45. },
  46. created() {
  47. this.getList()
  48. },
  49. methods: {
  50. getList() {
  51. this.activityListLoading = true
  52. mettingList(this.activityParams).then(res => {
  53. if (res.data.data) {
  54. if (this.activityParams.page > 1) {
  55. this.activityList = [...this.activityList, ...res.data.data]
  56. } else {
  57. this.activityList = res.data.data
  58. this.activityListLastPage = res.data.last_page
  59. }
  60. } else {
  61. this.showToast('系统繁忙,稍候再试')
  62. }
  63. this.activityListLoading = false
  64. })
  65. },
  66. }
  67. }
  68. </script>
  69. <style lang="scss">
  70. .activity-head{
  71. color: #333333;
  72. .activity-head-title{
  73. font-weight: bold;
  74. font-size: $fontSize6;
  75. line-height: 49rpx;
  76. }
  77. .activity-head-desc{
  78. margin-top: 20rpx;
  79. font-size: $fontSize3;
  80. line-height: 40rpx;
  81. }
  82. .activity-favourites-text{
  83. white-space: nowrap;
  84. }
  85. }
  86. .activity-list{
  87. display: grid;
  88. grid-template-columns: 1fr;
  89. grid-row-gap: 30rpx;
  90. margin-top: 40rpx;
  91. color: #333333;
  92. }
  93. </style>