国外MOSE官网
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

171 lines
3.8 KiB

2 days ago
19 hours ago
2 days ago
19 hours ago
2 days ago
19 hours ago
2 days ago
19 hours ago
2 days ago
19 hours ago
2 days ago
19 hours ago
2 days ago
19 hours ago
2 days ago
19 hours ago
2 days ago
19 hours ago
2 days ago
19 hours ago
2 days ago
19 hours ago
2 days ago
  1. <template>
  2. <view class="page">
  3. <!-- 收藏列表 -->
  4. <view class="content">
  5. <view v-if="favoritesList.length > 0" class="activity-list">
  6. <view class="activity-item" v-for="item in favoritesList" :key="item.id" @click="viewActivityDetail(item)">
  7. <image class="activity-image" :src="item.image" mode="aspectFill"></image>
  8. <view class="activity-info">
  9. <view class="title-row">
  10. <view class="activity-badge">
  11. <text class="badge-text">{{ item.score }}</text>
  12. </view>
  13. <text class="activity-title">{{ item.title }}</text>
  14. </view>
  15. <view class="activity-location">
  16. <uv-icon name="map-fill" size="14" color="#999"></uv-icon>
  17. <text class="location-text">{{ item.address || '线上活动' }}</text>
  18. </view>
  19. <view class="activity-time">
  20. <uv-icon name="calendar" size="14" color="#999"></uv-icon>
  21. <text class="time-text">{{ item.activityTime }}</text>
  22. </view>
  23. <view class="activity-participants">
  24. <uv-icon name="account-fill" size="14" ></uv-icon>
  25. <text class="participants-text">报名人数{{ item.numActivity + '/' + item.numLimit }}</text>
  26. </view>
  27. </view>
  28. <view class="activity-action">
  29. <uv-button type="primary" size="mini" text="查看详情" @click.stop="viewActivityDetail(item)"></uv-button>
  30. </view>
  31. </view>
  32. </view>
  33. <view v-else class="empty">
  34. <uv-empty mode="data" text="暂无收藏活动"></uv-empty>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. export default {
  41. data() {
  42. return {
  43. favoritesList: [],
  44. pageNo: 1,
  45. pageSize: 10
  46. }
  47. },
  48. methods: {
  49. // 查看活动详情
  50. viewActivityDetail(item) {
  51. uni.navigateTo({
  52. url: `/subPages/index/activityDetail?id=${item.id}`
  53. })
  54. },
  55. async getActivityCollectionList() {
  56. const res = await this.$api.activity.queryActivityCollectionList({
  57. pageNo: this.pageNo,
  58. pageSize: this.pageSize
  59. })
  60. if (!res.result.records.length) {
  61. uni.showToast({
  62. title: '没有更多数据了',
  63. icon: 'none'
  64. })
  65. return
  66. }
  67. this.favoritesList.push(...res.result.records.map(item => item.communityActivity))
  68. this.pageNo++
  69. }
  70. },
  71. async onShow() {
  72. await this.getActivityCollectionList()
  73. },
  74. onReachBottom() {
  75. this.getActivityCollectionList()
  76. },
  77. async onPullDownRefresh() {
  78. this.pageNo = 1
  79. this.favoritesList = []
  80. await this.getActivityCollectionList()
  81. uni.stopPullDownRefresh()
  82. }
  83. }
  84. </script>
  85. <style lang="scss" scoped>
  86. .page {
  87. background-color: #f5f5f5;
  88. min-height: 100vh;
  89. }
  90. .content {
  91. padding: 20rpx;
  92. }
  93. .activity-list {
  94. .activity-item {
  95. display: flex;
  96. margin-bottom: 30rpx;
  97. background: #fff;
  98. border-radius: 12rpx;
  99. padding: 20rpx;
  100. .activity-image {
  101. width: 180rpx;
  102. height: 180rpx;
  103. border-radius: 8rpx;
  104. margin-right: 20rpx;
  105. }
  106. .activity-info {
  107. flex: 1;
  108. display: flex;
  109. flex-direction: column;
  110. justify-content: space-between;
  111. .title-row {
  112. display: flex;
  113. align-items: center;
  114. margin-bottom: 10rpx;
  115. .activity-badge {
  116. width: 31px;
  117. height: 20px;
  118. background: #218cdd;
  119. border-radius: 3.5px;
  120. margin-right: 7rpx;
  121. display: flex;
  122. align-items: center;
  123. justify-content: center;
  124. .badge-text {
  125. font-size: 18rpx;
  126. color: #fff;
  127. }
  128. }
  129. }
  130. .activity-title {
  131. font-size: 28rpx;
  132. font-weight: bold;
  133. color: #333;
  134. }
  135. .activity-location, .activity-time, .activity-participants {
  136. display: flex;
  137. align-items: center;
  138. margin-bottom: 6rpx;
  139. .location-text, .time-text, .participants-text {
  140. font-size: 24rpx;
  141. color: #999;
  142. margin-left: 6rpx;
  143. }
  144. }
  145. }
  146. .activity-action {
  147. display: flex;
  148. align-items: flex-end;
  149. padding-bottom: 10rpx;
  150. }
  151. }
  152. }
  153. .empty {
  154. margin-top: 200rpx;
  155. }
  156. </style>