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

162 lines
3.2 KiB

2 weeks ago
  1. <template>
  2. <view class="page">
  3. <!-- 导航栏 -->
  4. <!-- 签到列表 -->
  5. <view class="content">
  6. <view v-if="list.length > 0" class="list">
  7. <view v-for="item in list" :key="item.id" class="activity-item" @click="checkinActivity(item)">
  8. <image class="activity-image" :src="item.image" mode="aspectFill"></image>
  9. <view class="activity-info">
  10. <view class="title-row">
  11. <view class="activity-badge">
  12. <text class="badge-text">{{ item.score }}</text>
  13. </view>
  14. <text class="activity-title">{{ item.title }}</text>
  15. </view>
  16. <view class="activity-location">
  17. <uv-icon name="map-fill" size="14" color="#999"></uv-icon>
  18. <text class="location-text">{{ item.address }}</text>
  19. </view>
  20. <view class="activity-time">
  21. <uv-icon name="calendar" size="14" color="#999"></uv-icon>
  22. <text class="time-text">{{ item.activityTime }}</text>
  23. </view>
  24. <view class="activity-participants">
  25. <uv-icon name="account-fill" size="14" color="#999"></uv-icon>
  26. <text class="participants-text">{{ item.numActivity }}人已报名</text>
  27. </view>
  28. </view>
  29. <view class="activity-action">
  30. <uv-button
  31. type="primary"
  32. size="mini"
  33. text="签到码"
  34. ></uv-button>
  35. </view>
  36. </view>
  37. </view>
  38. <view v-else class="empty">
  39. <uv-empty mode="data" text="暂无可签到活动"></uv-empty>
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. import MixinList from '@/mixins/list'
  46. export default {
  47. mixins: [MixinList],
  48. data() {
  49. return {
  50. list: [],
  51. mixinListApi: 'activity.queryActivityList',
  52. }
  53. },
  54. methods: {
  55. // 跳转到签到码界面
  56. checkinActivity(item) {
  57. uni.navigateTo({
  58. url: `/subPages/my/checkinCode?id=${item.id}`
  59. })
  60. }
  61. }
  62. }
  63. </script>
  64. <style lang="scss" scoped>
  65. .page {
  66. background-color: #f5f5f5;
  67. min-height: 100vh;
  68. }
  69. .content {
  70. padding: 20rpx;
  71. }
  72. .list {
  73. display: flex;
  74. flex-direction: column;
  75. gap: 20rpx;
  76. }
  77. .activity-item {
  78. display: flex;
  79. margin-bottom: 30rpx;
  80. background: #fff;
  81. border-radius: 12rpx;
  82. padding: 20rpx;
  83. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
  84. }
  85. .activity-image {
  86. width: 180rpx;
  87. height: 180rpx;
  88. border-radius: 8rpx;
  89. margin-right: 20rpx;
  90. }
  91. .activity-info {
  92. flex: 1;
  93. display: flex;
  94. flex-direction: column;
  95. justify-content: space-between;
  96. }
  97. .title-row {
  98. display: flex;
  99. align-items: center;
  100. margin-bottom: 10rpx;
  101. }
  102. .activity-badge {
  103. width: 62rpx;
  104. height: 40rpx;
  105. background: #218cdd;
  106. border-radius: 7rpx;
  107. margin-right: 14rpx;
  108. display: flex;
  109. align-items: center;
  110. justify-content: center;
  111. }
  112. .badge-text {
  113. font-size: 18rpx;
  114. color: #fff;
  115. }
  116. .activity-title {
  117. font-size: 28rpx;
  118. font-weight: bold;
  119. color: #333;
  120. line-height: 1.4;
  121. display: -webkit-box;
  122. -webkit-box-orient: vertical;
  123. -webkit-line-clamp: 2;
  124. overflow: hidden;
  125. }
  126. .activity-location, .activity-time, .activity-participants {
  127. display: flex;
  128. align-items: center;
  129. margin-bottom: 6rpx;
  130. }
  131. .location-text, .time-text, .participants-text {
  132. font-size: 24rpx;
  133. color: #999;
  134. margin-left: 6rpx;
  135. }
  136. .activity-action {
  137. display: flex;
  138. align-items: flex-end;
  139. padding-bottom: 10rpx;
  140. }
  141. .empty {
  142. margin-top: 200rpx;
  143. }
  144. </style>