展品维保小程序前端代码接口
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.

144 lines
3.3 KiB

2 weeks ago
  1. <template>
  2. <view class="page">
  3. <!-- 收藏列表 -->
  4. <view class="content">
  5. <view v-if="list.length > 0" class="activity-list">
  6. <view class="activity-item" v-for="item in list" :key="item.id" @click="viewActivityDetail(item)">
  7. <image class="activity-image" :src="item.communityActivity.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.communityActivity.score }}</text>
  12. </view>
  13. <text class="activity-title">{{ item.communityActivity.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.communityActivity.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.communityActivity.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.communityActivity.numActivity + '/' + item.communityActivity.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. import MixinList from '@/mixins/list.js'
  41. export default {
  42. mixins: [MixinList],
  43. data() {
  44. return {
  45. mixinListApi: 'activity.queryActivityCollectionList',
  46. }
  47. },
  48. methods: {
  49. // 查看活动详情
  50. viewActivityDetail(item) {
  51. uni.navigateTo({
  52. url: `/subPages/index/activityDetail?id=${item.activityId}`
  53. })
  54. }
  55. }
  56. }
  57. </script>
  58. <style lang="scss" scoped>
  59. .page {
  60. background-color: #f5f5f5;
  61. min-height: 100vh;
  62. }
  63. .content {
  64. padding: 20rpx;
  65. }
  66. .activity-list {
  67. .activity-item {
  68. display: flex;
  69. margin-bottom: 30rpx;
  70. background: #fff;
  71. border-radius: 12rpx;
  72. padding: 20rpx;
  73. .activity-image {
  74. width: 180rpx;
  75. height: 180rpx;
  76. border-radius: 8rpx;
  77. margin-right: 20rpx;
  78. }
  79. .activity-info {
  80. flex: 1;
  81. display: flex;
  82. flex-direction: column;
  83. justify-content: space-between;
  84. .title-row {
  85. display: flex;
  86. align-items: center;
  87. margin-bottom: 10rpx;
  88. .activity-badge {
  89. width: 31px;
  90. height: 20px;
  91. background: #218cdd;
  92. border-radius: 3.5px;
  93. margin-right: 7rpx;
  94. display: flex;
  95. align-items: center;
  96. justify-content: center;
  97. .badge-text {
  98. font-size: 18rpx;
  99. color: #fff;
  100. }
  101. }
  102. }
  103. .activity-title {
  104. font-size: 28rpx;
  105. font-weight: bold;
  106. color: #333;
  107. }
  108. .activity-location, .activity-time, .activity-participants {
  109. display: flex;
  110. align-items: center;
  111. margin-bottom: 6rpx;
  112. .location-text, .time-text, .participants-text {
  113. font-size: 24rpx;
  114. color: #999;
  115. margin-left: 6rpx;
  116. }
  117. }
  118. }
  119. .activity-action {
  120. display: flex;
  121. align-items: flex-end;
  122. padding-bottom: 10rpx;
  123. }
  124. }
  125. }
  126. .empty {
  127. margin-top: 200rpx;
  128. }
  129. </style>