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

224 lines
5.1 KiB

6 days ago
  1. <template>
  2. <view class="recommended-activities">
  3. <view class="activities-header">
  4. <view class="header-left">
  5. <image class="header-icon" src="/static/推荐活动.png" mode="aspectFit"></image>
  6. <!-- <text class="header-title">推荐活动</text> -->
  7. </view>
  8. <view class="more" @click="goToMoreActivities">
  9. <text class="more-text">更多</text>
  10. <uv-icon name="arrow-right" color="#999" size="12"></uv-icon>
  11. </view>
  12. </view>
  13. <view class="activity-list">
  14. <view class="activity-item" v-for="(item, index) in activityList" :key="index" @click="viewActivityDetail(item)">
  15. <image class="activity-image" :src="item.image" mode="aspectFill"></image>
  16. <view class="activity-info">
  17. <view class="title-row">
  18. <view class="activity-badge">
  19. <text class="badge-text">30</text>
  20. </view>
  21. <text class="activity-title">{{item.title}}</text>
  22. </view>
  23. <view class="activity-location">
  24. <uv-icon name="map-fill" size="14" color="#999"></uv-icon>
  25. <text class="location-text">{{item.location}}</text>
  26. </view>
  27. <view class="activity-time">
  28. <uv-icon name="calendar" size="14" color="#999"></uv-icon>
  29. <text class="time-text">{{item.time}}</text>
  30. </view>
  31. <view class="activity-participants">
  32. <uv-icon name="account-fill" size="14" color="#999"></uv-icon>
  33. <text class="participants-text">{{item.participants}}人已报名</text>
  34. </view>
  35. </view>
  36. <view class="activity-action">
  37. <uv-button type="primary" size="mini" text="报名中" @click.stop="signUpActivity(item)"></uv-button>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. export default {
  45. name: 'RecommendedActivities',
  46. data() {
  47. return {
  48. activityList: [
  49. {
  50. id: 1,
  51. title: '关爱自闭儿童活动',
  52. image: '/static/bannerImage.png',
  53. location: '七步沙社区文化中心',
  54. time: '2025-06-12 14:30',
  55. participants: 12
  56. },
  57. {
  58. id: 1,
  59. title: '关爱自闭儿童活动',
  60. image: '/static/bannerImage.png',
  61. location: '七步沙社区文化中心',
  62. time: '2025-06-12 14:30',
  63. participants: 12
  64. },
  65. {
  66. id: 1,
  67. title: '关爱自闭儿童活动',
  68. image: '/static/bannerImage.png',
  69. location: '七步沙社区文化中心',
  70. time: '2025-06-12 14:30',
  71. participants: 12
  72. },
  73. {
  74. id: 1,
  75. title: '关爱自闭儿童活动',
  76. image: '/static/bannerImage.png',
  77. location: '七步沙社区文化中心',
  78. time: '2025-06-12 14:30',
  79. participants: 12
  80. },
  81. ]
  82. }
  83. },
  84. methods: {
  85. goToMoreActivities() {
  86. // 跳转到更多活动页面
  87. uni.navigateTo({
  88. url: '/subPages/index/activities'
  89. })
  90. },
  91. viewActivityDetail(activity) {
  92. // 查看活动详情
  93. uni.navigateTo({
  94. url: `/subPages/index/activityDetail?id=${activity.id}`
  95. })
  96. },
  97. signUpActivity(activity) {
  98. // 报名活动
  99. uni.navigateTo({
  100. url: `/subPages/index/activityDetail?id=${activity.id}`
  101. })
  102. }
  103. }
  104. }
  105. </script>
  106. <style lang="scss" scoped>
  107. .recommended-activities {
  108. margin: 20rpx;
  109. // background-color: #fff;
  110. border-radius: 12rpx;
  111. // padding: 20rpx;
  112. .activities-header {
  113. display: flex;
  114. justify-content: space-between;
  115. align-items: center;
  116. margin-bottom: 10rpx;
  117. padding-left: 20rpx;
  118. .header-left {
  119. display: flex;
  120. align-items: center;
  121. .header-icon {
  122. width: 158rpx;
  123. height: 50rpx;
  124. margin-right: 10rpx;
  125. }
  126. .header-title {
  127. font-size: 30rpx;
  128. font-weight: bold;
  129. color: $uni-text-color;
  130. }
  131. }
  132. .more {
  133. display: flex;
  134. align-items: center;
  135. .more-text {
  136. font-size: 24rpx;
  137. color: $uni-text-color-grey;
  138. margin-right: 4rpx;
  139. }
  140. }
  141. }
  142. .activity-list {
  143. .activity-item {
  144. display: flex;
  145. margin-bottom: 30rpx;
  146. background: #fff;
  147. border-radius: 12rpx;
  148. padding: 20rpx;
  149. .activity-image {
  150. width: 180rpx;
  151. height: 180rpx;
  152. border-radius: 8rpx;
  153. margin-right: 20rpx;
  154. }
  155. .activity-info {
  156. flex: 1;
  157. display: flex;
  158. flex-direction: column;
  159. justify-content: space-between;
  160. .title-row {
  161. display: flex;
  162. align-items: center;
  163. margin-bottom: 10rpx;
  164. .activity-badge {
  165. width: 31px;
  166. height: 20px;
  167. background: #218cdd;
  168. border-radius: 3.5px;
  169. margin-right: 7rpx;
  170. display: flex;
  171. align-items: center;
  172. justify-content: center;
  173. .badge-text {
  174. font-size: 18rpx;
  175. color: #fff;
  176. // font-weight: bold;
  177. }
  178. }
  179. }
  180. }
  181. .activity-title {
  182. font-size: 28rpx;
  183. font-weight: bold;
  184. color: $uni-text-color;
  185. }
  186. .activity-location, .activity-time, .activity-participants {
  187. display: flex;
  188. align-items: center;
  189. margin-bottom: 6rpx;
  190. .location-text, .time-text, .participants-text {
  191. font-size: 24rpx;
  192. color: $uni-text-color-grey;
  193. margin-left: 6rpx;
  194. }
  195. }
  196. }
  197. .activity-action {
  198. display: flex;
  199. align-items: flex-end;
  200. padding-bottom: 10rpx;
  201. }
  202. }
  203. }
  204. </style>