国外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.

221 lines
4.7 KiB

2 days ago
2 days ago
2 days ago
2 days ago
2 days ago
  1. <template>
  2. <view class="page">
  3. <!-- 导航栏 -->
  4. <!-- 签到列表 -->
  5. <view class="content">
  6. <view v-if="checkinList.length > 0" class="list">
  7. <view v-for="item in checkinList" :key="item.id" class="activity-item" @click="viewActivityDetail(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.points }}</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.location }}</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.time }}</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.participants }}人已报名</text>
  27. </view>
  28. </view>
  29. <view class="activity-action">
  30. <uv-button
  31. type="primary"
  32. size="mini"
  33. text="签到码"
  34. @click.stop="checkinActivity(item)"
  35. ></uv-button>
  36. </view>
  37. </view>
  38. </view>
  39. <view v-else class="empty">
  40. <uv-empty mode="data" text="暂无可签到活动"></uv-empty>
  41. </view>
  42. </view>
  43. <!-- 操作菜单 -->
  44. <uv-action-sheet :show="showActionSheet" :actions="actions" @close="showActionSheet = false" @select="onActionSelect"></uv-action-sheet>
  45. </view>
  46. </template>
  47. <script>
  48. export default {
  49. data() {
  50. return {
  51. showActionSheet: false,
  52. actions: [
  53. { name: '刷新列表', color: '#218cdd' }
  54. ],
  55. checkinList: [
  56. {
  57. id: 1,
  58. title: '关爱自闭儿童活动',
  59. image: '/static/bannerImage.png',
  60. location: '七步沙社区文化中心',
  61. time: '2025-06-12 14:30',
  62. participants: 12,
  63. points: 30,
  64. status: 'pending' // pending: 待签到, checked: 已签到
  65. },
  66. {
  67. id: 2,
  68. title: '社区环保志愿活动',
  69. image: '/static/bannerImage.png',
  70. location: '绿园社区广场',
  71. time: '2025-06-13 09:00',
  72. participants: 25,
  73. points: 25,
  74. status: 'checked'
  75. },
  76. {
  77. id: 3,
  78. title: '老年人关爱服务',
  79. image: '/static/bannerImage.png',
  80. location: '夕阳红养老院',
  81. time: '2025-06-14 15:00',
  82. participants: 8,
  83. points: 35,
  84. status: 'pending'
  85. },
  86. {
  87. id: 4,
  88. title: '青少年心理健康讲座',
  89. image: '/static/bannerImage.png',
  90. location: '市图书馆报告厅',
  91. time: '2025-06-15 19:30',
  92. participants: 45,
  93. points: 20,
  94. status: 'pending'
  95. }
  96. ]
  97. }
  98. },
  99. methods: {
  100. // 查看活动详情
  101. viewActivityDetail(item) {
  102. uni.navigateTo({
  103. url: `/subPages/index/activityDetail?id=${item.id}`
  104. })
  105. },
  106. // 跳转到签到码界面
  107. checkinActivity(item) {
  108. uni.navigateTo({
  109. url: `/subPages/my/checkinCode?id=${item.id}&title=${item.title}&points=${item.points}`
  110. })
  111. },
  112. // 操作菜单选择
  113. onActionSelect(item) {
  114. if (item.name === '刷新列表') {
  115. uni.showToast({
  116. title: '刷新成功',
  117. icon: 'success'
  118. })
  119. }
  120. this.showActionSheet = false
  121. }
  122. }
  123. }
  124. </script>
  125. <style lang="scss" scoped>
  126. .page {
  127. background-color: #f5f5f5;
  128. min-height: 100vh;
  129. }
  130. .content {
  131. padding: 20rpx;
  132. }
  133. .list {
  134. display: flex;
  135. flex-direction: column;
  136. gap: 20rpx;
  137. }
  138. .activity-item {
  139. display: flex;
  140. margin-bottom: 30rpx;
  141. background: #fff;
  142. border-radius: 12rpx;
  143. padding: 20rpx;
  144. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
  145. }
  146. .activity-image {
  147. width: 180rpx;
  148. height: 180rpx;
  149. border-radius: 8rpx;
  150. margin-right: 20rpx;
  151. }
  152. .activity-info {
  153. flex: 1;
  154. display: flex;
  155. flex-direction: column;
  156. justify-content: space-between;
  157. }
  158. .title-row {
  159. display: flex;
  160. align-items: center;
  161. margin-bottom: 10rpx;
  162. }
  163. .activity-badge {
  164. width: 62rpx;
  165. height: 40rpx;
  166. background: #218cdd;
  167. border-radius: 7rpx;
  168. margin-right: 14rpx;
  169. display: flex;
  170. align-items: center;
  171. justify-content: center;
  172. }
  173. .badge-text {
  174. font-size: 18rpx;
  175. color: #fff;
  176. }
  177. .activity-title {
  178. font-size: 28rpx;
  179. font-weight: bold;
  180. color: #333;
  181. line-height: 1.4;
  182. display: -webkit-box;
  183. -webkit-box-orient: vertical;
  184. -webkit-line-clamp: 2;
  185. overflow: hidden;
  186. }
  187. .activity-location, .activity-time, .activity-participants {
  188. display: flex;
  189. align-items: center;
  190. margin-bottom: 6rpx;
  191. }
  192. .location-text, .time-text, .participants-text {
  193. font-size: 24rpx;
  194. color: #999;
  195. margin-left: 6rpx;
  196. }
  197. .activity-action {
  198. display: flex;
  199. align-items: flex-end;
  200. padding-bottom: 10rpx;
  201. }
  202. .empty {
  203. margin-top: 200rpx;
  204. }
  205. </style>