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

423 lines
11 KiB

4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
  1. <template>
  2. <view class="activity-detail">
  3. <!-- 轮播图 -->
  4. <view class="banner-container">
  5. <swiper class="banner-swiper" height="450rpx" :indicator-dots="true" :autoplay="true" :interval="3000" :duration="500">
  6. <swiper-item v-for="(image, index) in activityData.image.split(',')" :key="index">
  7. <image class="banner-image" :src="image" mode="aspectFill"></image>
  8. </swiper-item>
  9. </swiper>
  10. </view>
  11. <!-- 活动信息 -->
  12. <view class="activity-info">
  13. <!-- 活动标题和标签 -->
  14. <view class="title-section">
  15. <view class="activity-badge">
  16. <text class="badge-text">{{ activityData.score }}</text>
  17. </view>
  18. <text class="activity-title">{{ activityData.title }}</text>
  19. </view>
  20. <!-- 活动详细信息 -->
  21. <view class="info-section">
  22. <view class="info-item">
  23. <uv-icon name="calendar" size="16" color="#666"></uv-icon>
  24. <text class="info-label">活动时间</text>
  25. <text class="info-value">{{ activityData.activityTime }}</text>
  26. </view>
  27. <view class="info-item">
  28. <uv-icon name="clock" size="16" color="#666"></uv-icon>
  29. <text class="info-label">报名时间</text>
  30. <text class="info-value">{{ activityData.startTime }}</text>
  31. </view>
  32. <view class="info-item">
  33. <uv-icon name="account-fill" size="16" color="#666"></uv-icon>
  34. <text class="info-label">联系人</text>
  35. <text class="info-value">{{ activityData.contact }}</text>
  36. </view>
  37. <view class="info-item">
  38. <uv-icon name="phone" size="16" color="#666"></uv-icon>
  39. <text class="info-label">取消规则</text>
  40. <text class="info-value">{{ activityData.rule }}</text>
  41. </view>
  42. <view class="info-item">
  43. <uv-icon name="map-fill" size="16" color="#666"></uv-icon>
  44. <text class="info-label">活动地点</text>
  45. <text class="info-value">{{ activityData.address }}</text>
  46. </view>
  47. </view>
  48. <!-- 活动详情 -->
  49. <view class="detail-section">
  50. <view class="section-title">
  51. <text class="title-text">活动详情</text>
  52. </view>
  53. <view class="detail-content">
  54. <!-- <text class="detail-text"> -->
  55. <rich-text :nodes="activityData.details"></rich-text>
  56. <!-- </text> -->
  57. </view>
  58. </view>
  59. <!-- 活动图集 -->
  60. <view class="gallery-section">
  61. <view class="section-title">
  62. <text class="title-text">活动图集</text>
  63. </view>
  64. <view class="gallery-grid">
  65. <image
  66. v-for="(image, index) in activityData.atlas.split(',')"
  67. :key="index"
  68. class="gallery-image"
  69. :src="image"
  70. mode="aspectFill"
  71. @click="previewImage(image, activityData.atlas.split(','))"
  72. ></image>
  73. <!-- <uv-album :urls="activityData.gallery"></uv-album> -->
  74. </view>
  75. </view>
  76. </view>
  77. <!-- 固定底部操作栏 -->
  78. <view class="bottom-action">
  79. <view class="action-left">
  80. <view class="action-item" @click="shareActivity">
  81. <uv-icon name="share" size="24" color="#000"></uv-icon>
  82. <text class="action-text">分享</text>
  83. </view>
  84. <view class="action-item" @click="collectActivity">
  85. <uv-icon name="heart-fill" size="24" :color="activityData.isCollection === 1 ? '#ff4757' : '#999'"></uv-icon>
  86. <text class="action-text">收藏</text>
  87. </view>
  88. <view class="action-item">
  89. <text class="participants-count">
  90. <text :style="{'color': activityData.numActivity >= activityData.numLimit ? '#999' : '#1488DB'}">{{ activityData.numActivity }}</text>
  91. /{{ activityData.numLimit }}</text>
  92. <text class="action-text">已报名</text>
  93. </view>
  94. </view>
  95. <view class="action-right">
  96. <uv-button
  97. type="primary"
  98. size="normal"
  99. text="我要报名"
  100. shape="circle"
  101. @click="signUpActivity"
  102. :disabled="activityData.numActivity >= activityData.numLimit || activityData.isApply === 1 "
  103. ></uv-button>
  104. </view>
  105. </view>
  106. <SignUpForm
  107. ref="signUpFormRef"
  108. @close="onSignUpFormClose"
  109. @submit="onSignUpFormSubmit"
  110. />
  111. </view>
  112. <!-- 报名表单弹窗 -->
  113. </template>
  114. <script>
  115. import SignUpForm from '@/subPages/index/components/SignUpForm.vue'
  116. export default {
  117. components: {
  118. SignUpForm
  119. },
  120. data() {
  121. return {
  122. // isCollected: false,
  123. showSignUpForm: false,
  124. activityData: {
  125. title: '关爱自闭症儿童活动',
  126. duration: '30积分',
  127. time: '2025-06-12 14:30',
  128. registrationTime: '2025-06-01 14:30——2025-09-01 14:30',
  129. contact: '柳老师 (13256484512)',
  130. cancelRule: '报名随时可取消',
  131. location: '长沙市雨花区时代阳光大夏国际大厅2145',
  132. registeredCount: 9,
  133. maxCount: 30,
  134. details: [
  135. '身体健康,热爱志愿服务工作,富有责任感和奉献精神',
  136. '遵纪守法,思想上进,作风正派,服从安排',
  137. '年龄在60岁以下,具备广告宣传理能力'
  138. ],
  139. gallery: [
  140. '/static/bannerImage.png',
  141. '/static/bannerImage.png',
  142. '/static/bannerImage.png',
  143. '/static/bannerImage.png'
  144. ]
  145. },
  146. activityId: null
  147. }
  148. },
  149. onLoad(options) {
  150. if (options.id) {
  151. this.activityId = options.id
  152. this.loadActivityDetail(options.id)
  153. }else {
  154. uni.showToast({
  155. title: '没有给活动id',
  156. icon: 'none'
  157. })
  158. }
  159. },
  160. methods: {
  161. async loadActivityDetail(id) {
  162. // 根据ID加载活动详情
  163. const res = await this.$api.activity.queryActivityById({
  164. activityId: id
  165. })
  166. this.activityData = res.result
  167. },
  168. previewImage(current, urls) {
  169. uni.previewImage({
  170. current: current,
  171. urls: urls
  172. })
  173. },
  174. shareActivity() {
  175. uni.showToast({
  176. title: '分享功能',
  177. icon: 'none'
  178. })
  179. },
  180. async collectActivity() {
  181. const res = await this.$api.activity.collectionActivity({
  182. activityId: this.activityId
  183. })
  184. await this.loadActivityDetail(this.activityId)
  185. uni.showToast({
  186. title: `${res.message}`,
  187. icon: 'none'
  188. })
  189. },
  190. signUpActivity() {
  191. if (this.activityData.numActivity >= this.activityData.numLimit) {
  192. uni.showToast({
  193. title: '报名人数已满',
  194. icon: 'none'
  195. })
  196. return
  197. }
  198. this.$refs.signUpFormRef.open()
  199. },
  200. onSignUpFormClose() {
  201. this.$refs.signUpFormRef.close()
  202. },
  203. async onSignUpFormSubmit(formData) {
  204. console.log('报名表单数据:', formData)
  205. // 这里可以调用API提交报名数据
  206. const res = await this.$api.activity.applyActivity({
  207. activityId: this.activityId,
  208. ...formData
  209. })
  210. if (res.code === 200) {
  211. uni.showToast({
  212. title: `${res.message}`,
  213. icon: 'success'
  214. })
  215. // 更新状态
  216. this.loadActivityDetail(this.activityId)
  217. }
  218. }
  219. },
  220. async onPullDownRefresh() {
  221. await this.loadActivityDetail(this.activityId)
  222. uni.stopPullDownRefresh()
  223. }
  224. }
  225. </script>
  226. <style lang="scss" scoped>
  227. .activity-detail {
  228. min-height: 100vh;
  229. background: #f8f8f8;
  230. padding-bottom: 120rpx;
  231. .banner-container {
  232. width: 100%;
  233. height: 450rpx;
  234. .banner-swiper {
  235. width: 100%;
  236. height: 100%;
  237. .banner-image {
  238. width: 100%;
  239. height: 100%;
  240. }
  241. }
  242. }
  243. .activity-info {
  244. background: #ffffff;
  245. // border: 1rpx dashed #F3F7F8;
  246. margin: 20rpx;
  247. border-radius: 16rpx;
  248. padding: 30rpx;
  249. .title-section {
  250. display: flex;
  251. align-items: center;
  252. margin-bottom: 30rpx;
  253. .activity-badge {
  254. background: #218CDD;
  255. border-radius: 8rpx;
  256. padding: 4rpx 10rpx;
  257. margin-right: 16rpx;
  258. .badge-text {
  259. color: #ffffff;
  260. font-size: 24rpx;
  261. font-weight: 500;
  262. }
  263. }
  264. .activity-title {
  265. font-size: 36rpx;
  266. font-weight: bold;
  267. color: #333333;
  268. flex: 1;
  269. }
  270. }
  271. .info-section {
  272. background: #F3F7F8;
  273. margin-bottom: 40rpx;
  274. // 虚线属性
  275. border: 2rpx dashed #F3F7F8;
  276. .info-item {
  277. display: flex;
  278. align-items: center;
  279. margin-bottom: 20rpx;
  280. &:last-child {
  281. margin-bottom: 0;
  282. }
  283. .info-label {
  284. font-size: 28rpx;
  285. color: #999999;
  286. margin-left: 12rpx;
  287. margin-right: 8rpx;
  288. }
  289. .info-value {
  290. font-size: 28rpx;
  291. color: #999999;
  292. flex: 1;
  293. }
  294. }
  295. }
  296. .detail-section {
  297. margin-bottom: 40rpx;
  298. .section-title {
  299. margin-bottom: 20rpx;
  300. .title-text {
  301. font-size: 32rpx;
  302. font-weight: bold;
  303. color: #333333;
  304. }
  305. }
  306. .detail-content {
  307. .detail-text {
  308. display: block;
  309. font-size: 28rpx;
  310. color: #666666;
  311. line-height: 1.6;
  312. margin-bottom: 16rpx;
  313. &:last-child {
  314. margin-bottom: 0;
  315. }
  316. }
  317. }
  318. }
  319. .gallery-section {
  320. .section-title {
  321. margin-bottom: 20rpx;
  322. .title-text {
  323. font-size: 32rpx;
  324. font-weight: bold;
  325. color: #333333;
  326. }
  327. }
  328. .gallery-grid {
  329. display: grid;
  330. grid-template-columns: repeat(2, 1fr);
  331. gap: 16rpx;
  332. .gallery-image {
  333. width: 100%;
  334. height: 200rpx;
  335. border-radius: 12rpx;
  336. }
  337. }
  338. }
  339. }
  340. .bottom-action {
  341. position: fixed;
  342. bottom: 0;
  343. left: 0;
  344. right: 0;
  345. background: #ffffff;
  346. padding: 20rpx 30rpx;
  347. border-top: 1rpx solid #eeeeee;
  348. display: flex;
  349. align-items: center;
  350. justify-content: space-between;
  351. z-index: 100;
  352. .action-left {
  353. display: flex;
  354. align-items: center;
  355. gap: 100rpx;
  356. .action-item {
  357. display: flex;
  358. flex-direction: column;
  359. align-items: center;
  360. gap: 8rpx;
  361. .action-text {
  362. font-size: 22rpx;
  363. color: #000;
  364. }
  365. .participants-count {
  366. font-size: 24rpx;
  367. color: #333333;
  368. // font-weight: bold;
  369. }
  370. }
  371. }
  372. .action-right {
  373. flex-shrink: 0;
  374. }
  375. }
  376. }
  377. </style>