activity-detail.vue 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379
  1. <template>
  2. <view class="container">
  3. <!-- 加载状态 -->
  4. <view v-if="loading" class="loading-wrap">
  5. <view class="loading-spinner"></view>
  6. <text class="loading-text">加载中...</text>
  7. </view>
  8. <!-- 错误状态 -->
  9. <view v-else-if="error" class="error-wrap">
  10. <text class="error-icon">📋</text>
  11. <text class="error-text">{{ errorMsg }}</text>
  12. <button class="retry-btn" @click="loadDetail(activityId)">重新加载</button>
  13. </view>
  14. <!-- 活动内容 -->
  15. <scroll-view v-else-if="activity.id" scroll-y class="content">
  16. <!-- 封面图 -->
  17. <image
  18. v-if="activity.coverImage"
  19. class="cover"
  20. :src="getImageUrl(activity.coverImage)"
  21. mode="widthFix"
  22. />
  23. <image v-else class="cover placeholder-cover" src="/static/default-activity.png" mode="aspectFill" />
  24. <view class="info-section">
  25. <text class="activity-title">{{ activity.title }}</text>
  26. <!-- 活动状态标签 -->
  27. <view class="status-row">
  28. <text class="status-tag" :class="'status-' + (activity.displayStatus || activity.status || 'upcoming')">{{ activity.displayLabel || statusText(activity.status) }}</text>
  29. </view>
  30. <!-- 活动元信息 -->
  31. <view class="meta-list">
  32. <view class="meta-item" v-if="activity.startTime">
  33. <text class="meta-icon">🕐</text>
  34. <text class="meta-text">{{ formatDate(activity.startTime) }}{{ activity.endTime ? ' ~ ' + formatDate(activity.endTime) : '' }}</text>
  35. </view>
  36. <view class="meta-item" v-if="activity.registrationDeadline && activity.requireRegistration === 1">
  37. <text class="meta-icon">⏰</text>
  38. <text class="meta-text">报名截止: {{ formatDate(activity.registrationDeadline) }}</text>
  39. </view>
  40. <view class="meta-item" v-if="activity.location">
  41. <text class="meta-icon">📍</text>
  42. <text class="meta-text">{{ activity.location }}</text>
  43. </view>
  44. <view class="meta-item" v-if="activity.maxParticipants">
  45. <text class="meta-icon">👥</text>
  46. <text class="meta-text">{{ activity.currentParticipants || 0 }} / {{ activity.maxParticipants }} 人</text>
  47. </view>
  48. <view class="meta-item" v-if="hasFee">
  49. <text class="meta-icon">💰</text>
  50. <view class="meta-text">
  51. <text class="fee-line">孩子:¥{{ feeText(activity.childFee, activity.childMemberFee) }}</text>
  52. <text class="fee-line">家长:¥{{ feeText(activity.parentFee, activity.parentMemberFee) }}</text>
  53. <text class="fee-line member-fee-link" v-if="!isMember && hasMemberPrice" @click.stop="goUpgrade">开通会员享会员价 ›</text>
  54. </view>
  55. </view>
  56. <view class="meta-item" v-else>
  57. <text class="meta-icon">💰</text>
  58. <text class="meta-text">免费</text>
  59. </view>
  60. </view>
  61. <!-- 活动简介 -->
  62. <view class="desc-section" v-if="activity.description">
  63. <text class="section-title">活动介绍</text>
  64. <mp-html :content="activity.description" />
  65. </view>
  66. <!-- 付费不退费说明 -->
  67. <view class="refund-notice" v-if="hasFee">
  68. <text class="refund-notice-icon">⚠️</text>
  69. <text class="refund-notice-text">本活动为付费活动,报名成功后不支持退费</text>
  70. </view>
  71. </view>
  72. </scroll-view>
  73. <!-- 底部操作栏:必须与 scroll-view 平级,否则 iOS 上 position: fixed 在 scroll-view 内不生效(按钮不显示) -->
  74. <view class="bottom-bar" v-if="!loading && activity.id">
  75. <view class="price-info">
  76. <text class="bottom-type">活动</text>
  77. <text class="bottom-vendor" v-if="activity.vendorName">{{ activity.vendorName }}</text>
  78. </view>
  79. <view class="action-btns">
  80. <button class="share-btn" @click="generatePoster">
  81. <text class="share-btn-icon">📤</text>
  82. <text class="share-btn-text">分享</text>
  83. </button>
  84. <!-- 报名按钮(仅报名中/未报名时显示) -->
  85. <button
  86. v-if="canRegister"
  87. class="btn-register"
  88. @click="onRegister"
  89. >
  90. <text v-if="hasFee">¥{{ minFeeText }} 立即报名</text>
  91. <text v-else>立即报名</text>
  92. </button>
  93. <!-- 已报名待审核 -->
  94. <button
  95. v-if="activity.requireRegistration === 1 && registrationStatus === 'pending'"
  96. class="btn-register-done"
  97. disabled
  98. >
  99. <text>报名待审核</text>
  100. </button>
  101. <!-- 已报名可取消 -->
  102. <button
  103. v-if="activity.requireRegistration === 1 && (registrationStatus === 'approved' || registrationStatus === 'registered')"
  104. class="btn-cancel"
  105. :disabled="registrationLoading"
  106. @click="onCancelRegistration"
  107. >
  108. <text>取消报名</text>
  109. </button>
  110. <!-- 签到按钮(仅进行中时显示) -->
  111. <button
  112. v-if="activity.displayStatus === 'ongoing'"
  113. class="btn-checkin"
  114. :class="{ 'btn-checkin-done': checkinDone, 'btn-checkin-loading': checkinLoading }"
  115. :disabled="checkinLoading || checkinDone"
  116. @click="onCheckin"
  117. >
  118. <text v-if="checkinLoading">签到中...</text>
  119. <text v-else-if="checkinDone && activity.requireCheckinReview === 1">已签到待审核</text>
  120. <text v-else-if="checkinDone">已签到 ✓</text>
  121. <text v-else>签到</text>
  122. </button>
  123. <text v-if="activity.requireCheckinReview === 1 && !checkinDone && activity.displayStatus === 'ongoing'" class="checkin-review-hint">签到需要管理员审核</text>
  124. </view>
  125. </view>
  126. <!-- 空状态 -->
  127. <view v-else class="empty-wrap">
  128. <text class="empty-text">活动不存在或已下架</text>
  129. </view>
  130. <!-- 能量扣减提示弹窗:必须与 scroll-view 平级,否则 iOS 上 position: fixed 在 scroll-view 内不生效(按钮不显示) -->
  131. <modal v-if="showPenaltyModal" class="penalty-modal" :show="showPenaltyModal" @close="showPenaltyModal = false">
  132. <view class="penalty-content">
  133. <text class="penalty-title">签到成功但已扣能量</text>
  134. <text class="penalty-desc">您未报名参加此活动,已被扣除 {{ penaltyAmount }} 点能量值</text>
  135. <button class="penalty-btn" @click="showPenaltyModal = false">我知道了</button>
  136. </view>
  137. </modal>
  138. <!-- 活动评价 -->
  139. <view class="feedback-section" v-if="activity.status === 'ended' && checkinDone">
  140. <view class="feedback-header">
  141. <text class="feedback-title">活动评价</text>
  142. </view>
  143. <!-- Already submitted feedback -->
  144. <view v-if="submittedFeedback" class="feedback-submitted">
  145. <view class="feedback-ratings-display">
  146. <view class="fr-row" v-for="(val, key) in parsedSubmittedRatings" :key="key">
  147. <text class="fr-label">{{ key }}</text>
  148. <text class="fr-stars">{{ getStarDisplay(val) }}</text>
  149. </view>
  150. </view>
  151. <text class="feedback-comment-text" v-if="submittedFeedback.comment">{{ submittedFeedback.comment }}</text>
  152. <text class="feedback-thanks">感谢您的评价!</text>
  153. </view>
  154. <!-- Submit feedback button -->
  155. <button v-else class="feedback-btn" @click="openFeedbackModal">
  156. <text>提交活动评价</text>
  157. </button>
  158. </view>
  159. <!-- 评价弹窗:必须与 scroll-view 平级,否则 iOS 上 position: fixed 在 scroll-view 内不生效(按钮不显示) -->
  160. <modal v-if="showFeedbackModal" class="feedback-modal-overlay" :show="showFeedbackModal" @close="showFeedbackModal = false">
  161. <view class="feedback-modal">
  162. <text class="feedback-modal-title">活动评价</text>
  163. <view class="rating-row" v-for="(dim, dimIdx) in feedbackDimensions" :key="dimIdx">
  164. <text class="rating-label">{{ dim }}</text>
  165. <view class="stars">
  166. <text v-for="star in 5" :key="star"
  167. class="star-icon"
  168. :class="{'star-active': star <= (feedbackRatings[dim] || 0)}"
  169. @click="feedbackRatings[dim] = star">★</text>
  170. </view>
  171. </view>
  172. <textarea class="feedback-textarea" v-model="feedbackComment" placeholder="说说您的体验..." maxlength="500" />
  173. <view class="feedback-modal-actions">
  174. <button class="feedback-cancel-btn" @click="showFeedbackModal = false">取消</button>
  175. <button class="feedback-submit-btn" :disabled="feedbackSubmitting" @click="submitFeedback">
  176. <text v-if="feedbackSubmitting">提交中...</text>
  177. <text v-else>提交评价</text>
  178. </button>
  179. </view>
  180. </view>
  181. </modal>
  182. <!-- 报名表单弹窗:必须与 scroll-view 平级,否则 iOS 上 position: fixed 在 scroll-view 内不生效(按钮不显示) -->
  183. <view v-if="showRegModal" class="reg-modal-overlay" @click="closeRegModal">
  184. <view class="reg-modal" @click.stop>
  185. <text class="reg-modal-title">活动报名</text>
  186. <!-- 家庭成员选择 -->
  187. <view class="reg-family-section" v-if="familyMembers.length > 0">
  188. <text class="reg-section-label">从家庭成员中选择</text>
  189. <view class="reg-family-list">
  190. <view
  191. class="reg-family-item"
  192. v-for="member in familyMembers"
  193. :key="member.id"
  194. :class="{'reg-family-item-selected': isMemberSelected(member)}"
  195. @click="toggleFamilyMember(member)"
  196. >
  197. <view class="reg-family-info">
  198. <text class="reg-family-name">{{ member.name }}</text>
  199. <text class="reg-family-relation">{{ member.relation }}</text>
  200. </view>
  201. <text class="reg-checkmark" v-if="isMemberSelected(member)">✓</text>
  202. </view>
  203. </view>
  204. </view>
  205. <!-- 报名人列表 -->
  206. <view class="reg-list">
  207. <text class="reg-section-label">报名人</text>
  208. <view class="reg-entry" v-for="(entry, idx) in registrants" :key="idx">
  209. <input class="reg-input reg-input-name" v-model="entry.name" placeholder="姓名" />
  210. <input class="reg-input reg-input-phone" v-model="entry.phone" placeholder="手机号" type="number" maxlength="11" />
  211. <text class="reg-remove" @click="removeRegistrant(idx)">✕</text>
  212. </view>
  213. <button class="reg-add-btn" @click="addManualEntry">+ 添加报名人</button>
  214. </view>
  215. <!-- 合计 -->
  216. <view class="reg-total" v-if="hasFee">
  217. <text>共 {{ registrants.length }} 人 · 合计 ¥{{ registrantsTotal }}</text>
  218. </view>
  219. <!-- 操作按钮 -->
  220. <view class="reg-actions">
  221. <button class="reg-cancel" @click="closeRegModal">取消</button>
  222. <button class="reg-submit" :disabled="regSubmitting || registrants.length === 0" @click="submitRegistration">
  223. <text v-if="regSubmitting">提交中...</text>
  224. <text v-else>确认报名</text>
  225. </button>
  226. </view>
  227. </view>
  228. </view>
  229. <!-- 分享海报 -->
  230. <ContentSharePoster
  231. :show="showPoster"
  232. :title="(activity && activity.title) || ''"
  233. :coverImage="(activity && getImageUrl(activity.coverImage)) || ''"
  234. :qrCodeBase64="posterQrCode || ''"
  235. typeLabel="活动推荐"
  236. :dimensionCode="(activity && activity.dimensionCode) || ''"
  237. :summary="posterSummary || ''"
  238. :priceText="posterPriceText || ''"
  239. :inviteText="posterInviteText || ''"
  240. @close="closePoster"
  241. />
  242. </view>
  243. </template>
  244. <script>
  245. import { getActivityDetail, activityCheckin, cancelActivityRegistration, createActivityOrder, submitActivityFeedback, getActivityFeedbackList, getMyActivityFeedback, getFamilyMembers, getShareQrCode, getMyMembership } from '@/utils/api.js'
  246. import config from '@/config.js'
  247. import shareMixin from '../../../components/share-mixin.js'
  248. import MpHtml from '@/components/mp-html/mp-html.vue'
  249. import ContentSharePoster from '@/components/ContentSharePoster.vue'
  250. import { backfillProfile } from '../../../utils/profile-backfill.js'
  251. import { parseDate } from '@/utils/format.js'
  252. export default {
  253. mixins: [shareMixin],
  254. components: { MpHtml, ContentSharePoster },
  255. data() {
  256. return {
  257. activityId: null,
  258. activity: {},
  259. loading: false,
  260. error: false,
  261. errorMsg: '',
  262. checkinLoading: false,
  263. checkinDone: false,
  264. checkinPoints: 0,
  265. registrationStatus: null,
  266. registrationLoading: false,
  267. isMember: false,
  268. showPenaltyModal: false,
  269. penaltyAmount: 0,
  270. showFeedbackModal: false,
  271. feedbackDimensions: [],
  272. feedbackRatings: {},
  273. feedbackComment: '',
  274. submittedFeedback: null,
  275. feedbackSubmitting: false,
  276. feedbackList: [],
  277. // registration form modal
  278. showRegModal: false,
  279. familyMembers: [],
  280. registrants: [],
  281. regSubmitting: false,
  282. // 分享海报
  283. showPoster: false,
  284. posterQrCode: '',
  285. posterSummary: '',
  286. posterPriceText: '',
  287. posterInviteText: ''
  288. }
  289. },
  290. onLoad: function(options) {
  291. if (options && options.id) {
  292. this.activityId = options.id
  293. this.loadDetail(options.id)
  294. } else {
  295. this.error = true
  296. this.errorMsg = '缺少活动ID'
  297. }
  298. // 检查是否已经签到(从路由参数获取)
  299. if (options && options.checkinDone === '1') {
  300. this.checkinDone = true
  301. }
  302. this.checkMemberStatus()
  303. },
  304. methods: {
  305. // ===== 工具方法 =====
  306. getImageUrl: function(path) {
  307. if (!path) return ''
  308. if (path.indexOf('http://') === 0 || path.indexOf('https://') === 0) return path
  309. return config.API_BASE_URL + path
  310. },
  311. checkMemberStatus: function() {
  312. var that = this
  313. getMyMembership().then(function(res) {
  314. if (res.data && res.data.memberLevel) {
  315. that.isMember = res.data.memberLevel !== 'FREE'
  316. }
  317. }).catch(function() {})
  318. },
  319. goUpgrade: function() {
  320. uni.navigateTo({ url: '/pages/membership/upgrade' })
  321. },
  322. formatDate: function(dateStr) {
  323. if (!dateStr) return ''
  324. var d = parseDate(dateStr)
  325. if (!d) return dateStr
  326. var year = d.getFullYear()
  327. var month = d.getMonth() + 1
  328. var day = d.getDate()
  329. var hour = d.getHours()
  330. var minute = d.getMinutes()
  331. var ampm = hour < 12 ? '上午' : '下午'
  332. var h12 = hour % 12
  333. if (h12 === 0) h12 = 12
  334. var minStr = minute < 10 ? '0' + minute : minute
  335. return year + '年' + month + '月' + day + '日 ' + ampm + h12 + ':' + minStr
  336. },
  337. // 费用双价展示:非会员价 / 会员价(元)
  338. feeText: function(regularFee, memberFee) {
  339. var regular = (regularFee || 0) / 100
  340. var member = (memberFee || 0) / 100
  341. if (member > 0 && member < regular) {
  342. return member.toFixed(2) + '(会员) / ' + regular.toFixed(2)
  343. }
  344. if (regular === 0 && member === 0) return '0.00'
  345. if (regular === 0) return '会员免费'
  346. return regular.toFixed(2)
  347. },
  348. loadDetail: function(id) {
  349. var self = this
  350. self.loading = true
  351. self.error = false
  352. getActivityDetail(id).then(function(res) {
  353. self.loading = false
  354. if (res && res.code === 200 && res.data) {
  355. self.activity = res.data
  356. self.setShareInfo('推荐活动: ' + (res.data.title || ''), '/pages/activity/activity-detail/activity-detail?id=' + id)
  357. self.parseFeedbackDimensions()
  358. self.loadFeedbackStatus()
  359. // registrationStatus 已由后端按当前用户计算返回
  360. self.registrationStatus = res.data.registrationStatus || null
  361. } else {
  362. self.error = true
  363. self.errorMsg = (res && res.message) || '加载失败'
  364. }
  365. }).catch(function(err) {
  366. self.loading = false
  367. self.error = true
  368. self.errorMsg = '网络异常,请稍后重试'
  369. })
  370. },
  371. statusText: function(status) {
  372. var map = { draft: '草稿', published: '进行中', ended: '已结束' }
  373. return map[status] || '未知'
  374. },
  375. onCheckin: function() {
  376. var self = this
  377. if (self.checkinLoading || self.checkinDone) return
  378. // 未登录则跳转登录
  379. if (!uni.getStorageSync('token')) {
  380. uni.navigateTo({ url: '/pages/login/login' })
  381. return
  382. }
  383. var memberId = uni.getStorageSync('currentChildId') || self.registrationChildId
  384. if (!memberId) {
  385. uni.showToast({ title: '请选择孩子身份', icon: 'none' })
  386. return
  387. }
  388. self.checkinLoading = true
  389. activityCheckin({ id: self.activity.id, memberId: memberId }).then(function(res) {
  390. self.checkinLoading = false
  391. if (res && res.code === 200 && res.data) {
  392. self.loadFeedbackStatus()
  393. // 检查是否有能量扣减
  394. if (res.data.energyPenalty) {
  395. self.penaltyAmount = res.data.energyPenalty
  396. self.showPenaltyModal = true
  397. self.checkinDone = true
  398. return
  399. }
  400. if (res.data.alreadyCompleted) {
  401. self.checkinDone = true
  402. uni.showToast({ title: '已签到', icon: 'success' })
  403. } else if (res.data.pointsEarned && res.data.pointsEarned > 0) {
  404. self.checkinDone = true
  405. self.checkinPoints = res.data.pointsEarned
  406. uni.showToast({ title: '签到成功 +' + res.data.pointsEarned + '积分', icon: 'success' })
  407. } else {
  408. self.checkinDone = true
  409. uni.showToast({ title: '签到成功', icon: 'success' })
  410. }
  411. } else {
  412. var msg = (res && res.message) || '签到失败'
  413. // 如果是报名待审核,提示用户
  414. if (msg.indexOf('报名') !== -1 || msg.indexOf('审核') !== -1) {
  415. uni.showModal({ title: '提示', content: msg, showCancel: false })
  416. } else {
  417. uni.showToast({ title: msg, icon: 'none' })
  418. }
  419. }
  420. }).catch(function(err) {
  421. self.checkinLoading = false
  422. uni.showToast({ title: '网络异常', icon: 'none' })
  423. })
  424. },
  425. onRegister: function() {
  426. var self = this
  427. // 未登录则跳转登录
  428. if (!uni.getStorageSync('token')) {
  429. uni.navigateTo({ url: '/pages/login/login' })
  430. return
  431. }
  432. // Open registration form modal
  433. self.showRegModal = true
  434. self.registrants = []
  435. self.loadFamilyMembers()
  436. },
  437. onCancelRegistration: function() {
  438. var self = this
  439. // 未登录则跳转登录
  440. if (!uni.getStorageSync('token')) {
  441. uni.navigateTo({ url: '/pages/login/login' })
  442. return
  443. }
  444. uni.showModal({
  445. title: '提示',
  446. content: '确定要取消报名吗?',
  447. success: function(res) {
  448. if (res.confirm) {
  449. var memberId = uni.getStorageSync('currentChildId')
  450. self.registrationLoading = true
  451. cancelActivityRegistration({ id: self.activity.id, memberId: memberId }).then(function(res) {
  452. self.registrationLoading = false
  453. if (res && res.code === 200) {
  454. self.registrationStatus = null
  455. uni.showToast({ title: '已取消报名', icon: 'success' })
  456. } else {
  457. uni.showToast({ title: (res && res.message) || '取消失败', icon: 'none' })
  458. }
  459. }).catch(function() {
  460. self.registrationLoading = false
  461. uni.showToast({ title: '网络异常', icon: 'none' })
  462. })
  463. }
  464. }
  465. })
  466. },
  467. // ===== 活动评价 =====
  468. parseFeedbackDimensions: function() {
  469. var dims = ['组织形式', '会场气氛', '主持人', '专家']
  470. if (this.activity.feedbackDimensions) {
  471. try {
  472. var parsed = JSON.parse(this.activity.feedbackDimensions)
  473. if (parsed && parsed.length > 0) {
  474. dims = parsed
  475. }
  476. } catch(e) {}
  477. }
  478. this.feedbackDimensions = dims
  479. this.initRatings()
  480. },
  481. initRatings: function() {
  482. var r = {}
  483. for (var i = 0; i < this.feedbackDimensions.length; i++) {
  484. r[this.feedbackDimensions[i]] = 0
  485. }
  486. this.feedbackRatings = r
  487. },
  488. loadFeedbackStatus: function() {
  489. var self = this
  490. var memberId = uni.getStorageSync('currentChildId')
  491. if (!memberId || !self.activity || !self.activity.id) return
  492. getMyActivityFeedback({ activityId: self.activity.id, memberId: memberId }).then(function(res) {
  493. if (res && res.code === 200 && res.data) {
  494. self.submittedFeedback = res.data
  495. }
  496. }).catch(function() {})
  497. },
  498. openFeedbackModal: function() {
  499. this.showFeedbackModal = true
  500. },
  501. submitFeedback: function() {
  502. var self = this
  503. // Validate at least one rating
  504. var hasRating = false
  505. for (var key in self.feedbackRatings) {
  506. if (self.feedbackRatings[key] > 0) { hasRating = true; break }
  507. }
  508. if (!hasRating) {
  509. uni.showToast({ title: '请至少评价一项', icon: 'none' })
  510. return
  511. }
  512. self.feedbackSubmitting = true
  513. var memberId = uni.getStorageSync('currentChildId')
  514. submitActivityFeedback({
  515. activityId: self.activity.id,
  516. memberId: memberId,
  517. ratings: JSON.stringify(self.feedbackRatings),
  518. comment: self.feedbackComment
  519. }).then(function(res) {
  520. self.feedbackSubmitting = false
  521. if (res && res.code === 200) {
  522. self.showFeedbackModal = false
  523. self.loadFeedbackStatus()
  524. uni.showToast({ title: '评价成功', icon: 'success' })
  525. } else {
  526. uni.showToast({ title: (res && res.message) || '提交失败', icon: 'none' })
  527. }
  528. }).catch(function() {
  529. self.feedbackSubmitting = false
  530. uni.showToast({ title: '网络异常', icon: 'none' })
  531. })
  532. },
  533. getStarDisplay: function(val) {
  534. var full = parseInt(val) || 0
  535. var empty = 5 - full
  536. return '★'.repeat(full) + '☆'.repeat(empty)
  537. },
  538. // ===== 报名表单 =====
  539. loadFamilyMembers: function() {
  540. var self = this
  541. getFamilyMembers().then(function(res) {
  542. if (res && res.code === 200 && res.data) {
  543. var list = []
  544. // parents
  545. var parents = res.data.parents || []
  546. for (var i = 0; i < parents.length; i++) {
  547. list.push({
  548. id: 'p_' + parents[i].id,
  549. name: parents[i].nickname || parents[i].name || '',
  550. phone: parents[i].phone || '',
  551. relation: '家长',
  552. memberId: parents[i].id,
  553. source: 'parent',
  554. targetType: 'user'
  555. })
  556. }
  557. // children
  558. var children = res.data.children || []
  559. for (var j = 0; j < children.length; j++) {
  560. list.push({
  561. id: 'c_' + children[j].id,
  562. name: children[j].nickname || children[j].name || '',
  563. phone: children[j].phone || '',
  564. relation: '孩子',
  565. memberId: children[j].userId || children[j].id,
  566. source: 'child',
  567. targetType: 'member'
  568. })
  569. }
  570. self.familyMembers = list
  571. }
  572. }).catch(function() {})
  573. },
  574. isMemberSelected: function(member) {
  575. for (var i = 0; i < this.registrants.length; i++) {
  576. if (this.registrants[i].memberId === member.id) return true
  577. }
  578. return false
  579. },
  580. toggleFamilyMember: function(member) {
  581. for (var i = 0; i < this.registrants.length; i++) {
  582. if (this.registrants[i].memberId === member.id) {
  583. this.registrants.splice(i, 1)
  584. return
  585. }
  586. }
  587. this.registrants.push({
  588. memberId: member.id,
  589. name: member.name,
  590. phone: member.phone,
  591. childId: member.childId,
  592. targetType: member.targetType,
  593. prevPhone: member.phone
  594. })
  595. },
  596. addManualEntry: function() {
  597. this.registrants.push({
  598. memberId: null,
  599. name: '',
  600. phone: '',
  601. memberId: null
  602. })
  603. },
  604. removeRegistrant: function(idx) {
  605. this.registrants.splice(idx, 1)
  606. },
  607. closeRegModal: function() {
  608. this.showRegModal = false
  609. this.registrants = []
  610. this.familyMembers = []
  611. },
  612. // ===== 分享海报 =====
  613. async generatePoster() {
  614. if (!this.activity || !this.activity.id) return
  615. // 未登录则跳转登录
  616. if (!uni.getStorageSync('token')) {
  617. uni.navigateTo({ url: '/pages/login/login' })
  618. return
  619. }
  620. uni.showLoading({ title: '生成海报中...' })
  621. try {
  622. var res = await getShareQrCode('pages/activity/activity-detail/activity-detail', 'id=' + this.activity.id)
  623. if (res && res.data) {
  624. this.posterQrCode = res.data.qrCodeBase64 || ''
  625. this.posterSummary = this.buildPosterSummary()
  626. this.posterPriceText = this.activity.price > 0 ? '¥' + this.activity.price : '免费'
  627. this.posterInviteText = '「' + (uni.getStorageSync('nickname') || '好友') + '」邀请你一起参加这个活动'
  628. this.showPoster = true
  629. }
  630. } catch (e) {
  631. uni.showToast({ title: '生成失败', icon: 'none' })
  632. } finally {
  633. uni.hideLoading()
  634. }
  635. },
  636. buildPosterSummary: function() {
  637. var desc = (this.activity && this.activity.description) || ''
  638. desc = desc.replace(/<[^>]+>/g, ' ').replace(/&nbsp;/g, ' ').replace(/\s+/g, ' ').trim()
  639. return desc.length > 60 ? desc.substring(0, 60) + '...' : desc
  640. },
  641. closePoster: function() {
  642. this.showPoster = false
  643. },
  644. submitRegistration: function() {
  645. var self = this
  646. // Validate
  647. if (self.registrants.length === 0) {
  648. uni.showToast({ title: '请至少添加一个报名人', icon: 'none' })
  649. return
  650. }
  651. for (var i = 0; i < self.registrants.length; i++) {
  652. var entry = self.registrants[i]
  653. if (!entry.name || entry.name.trim() === '') {
  654. uni.showToast({ title: '请输入第 ' + (i + 1) + ' 个报名人的姓名', icon: 'none' })
  655. return
  656. }
  657. var phone = (entry.phone || '').trim()
  658. if (phone !== '' && !/^1[3-9]\d{9}$/.test(phone)) {
  659. uni.showToast({ title: '请输入第 ' + (i + 1) + ' 个报名人的正确手机号', icon: 'none' })
  660. return
  661. }
  662. }
  663. // 就地补充的手机号自动回写(仅家庭成员;外部报名人 memberId=null 不回写)
  664. var backfillTasks = []
  665. for (var b = 0; b < self.registrants.length; b++) {
  666. var entryB = self.registrants[b]
  667. if (!entryB.memberId) continue
  668. var phoneB = (entryB.phone || '').trim()
  669. if (phoneB === '') continue
  670. var rawId = String(entryB.memberId)
  671. var realId = rawId.indexOf('_') >= 0 ? rawId.substring(2) : rawId
  672. backfillTasks.push(backfillProfile({
  673. targetType: entryB.targetType,
  674. targetId: realId,
  675. fields: { phone: phoneB },
  676. scene: 'activity-signup',
  677. prevValues: { phone: entryB.prevPhone }
  678. }))
  679. }
  680. // 回写失败不阻塞报名主流程,仅静默记录
  681. if (backfillTasks.length > 0) {
  682. Promise.all(backfillTasks).catch(function(err) {
  683. console.warn('[backfill] 活动报名信息回写失败', err)
  684. })
  685. }
  686. // 付费活动 → 先确认支付
  687. if (self.hasFee && self.registrantsTotal > 0) {
  688. uni.showModal({
  689. title: '确认报名',
  690. content: '共 ' + self.registrants.length + ' 人,需支付 ¥' + self.registrantsTotal + ',报名成功后不支持退费。是否继续?',
  691. confirmText: '确认支付',
  692. cancelText: '再想想',
  693. success: function(confirmRes) {
  694. if (confirmRes.confirm) {
  695. self.doCreateOrder()
  696. }
  697. }
  698. })
  699. } else {
  700. self.doCreateOrder()
  701. }
  702. },
  703. doCreateOrder: function() {
  704. var self = this
  705. self.regSubmitting = true
  706. var registrantsData = []
  707. for (var i = 0; i < self.registrants.length; i++) {
  708. var entry = self.registrants[i]
  709. // memberId 可能带 p_/c_ 前缀(仅回写用),下单需去掉前缀的纯数字
  710. var orderMemberId = entry.memberId
  711. if (orderMemberId !== null && orderMemberId !== undefined) {
  712. var midStr = String(orderMemberId)
  713. if (midStr.indexOf('_') >= 0) orderMemberId = midStr.substring(2)
  714. }
  715. registrantsData.push({
  716. name: entry.name.trim(),
  717. phone: entry.phone || '',
  718. memberId: orderMemberId
  719. })
  720. }
  721. createActivityOrder({ activityId: self.activity.id, registrants: registrantsData }).then(function(res) {
  722. self.regSubmitting = false
  723. if (res && res.code === 200) {
  724. var data = res.data || {}
  725. if (data.free) {
  726. // 免费活动直接报名成功
  727. self.closeRegModal()
  728. self.registrationStatus = 'registered'
  729. uni.showToast({ title: '报名成功', icon: 'success' })
  730. self.loadDetail(self.activity.id)
  731. } else if (data.requiresPayment && data.orderNo) {
  732. // 付费活动 → 跳转支付页
  733. self.closeRegModal()
  734. uni.navigateTo({
  735. url: '/pages/activity/order-pay/order-pay?orderNo=' + data.orderNo + '&totalAmount=' + data.totalAmount + '&activityId=' + self.activity.id
  736. })
  737. } else {
  738. uni.showToast({ title: '报名失败', icon: 'none' })
  739. }
  740. } else {
  741. uni.showToast({ title: (res && res.message) || '报名失败', icon: 'none' })
  742. }
  743. }).catch(function() {
  744. self.regSubmitting = false
  745. uni.showToast({ title: '网络异常', icon: 'none' })
  746. })
  747. }
  748. },
  749. computed: {
  750. parsedSubmittedRatings: function() {
  751. if (!this.submittedFeedback || !this.submittedFeedback.ratings) return {}
  752. try {
  753. return JSON.parse(this.submittedFeedback.ratings)
  754. } catch(e) {
  755. return {}
  756. }
  757. },
  758. // 4 个费用字段是否存在(任一项 > 0 即为付费活动)
  759. hasFee: function() {
  760. var a = this.activity || {}
  761. return (a.childFee > 0) || (a.childMemberFee > 0) || (a.parentFee > 0) || (a.parentMemberFee > 0)
  762. },
  763. // 是否存在会员专享价(用于非会员引导)
  764. hasMemberPrice: function() {
  765. var a = this.activity || {}
  766. return (a.childMemberFee > 0) || (a.parentMemberFee > 0)
  767. },
  768. // 报名按钮可用:需报名 + 未报名 + 展示状态为报名中
  769. canRegister: function() {
  770. var a = this.activity || {}
  771. if (a.requireRegistration !== 1) return false
  772. if (a.displayStatus !== 'open') return false
  773. var st = this.registrationStatus
  774. return !st || st === 'not_registered' || st === 'cancelled' || st === 'rejected'
  775. },
  776. // 报名弹窗内合计(按当前用户会员价估算,实际以订单为准)
  777. registrantsTotal: function() {
  778. var a = this.activity || {}
  779. var total = 0
  780. for (var i = 0; i < this.registrants.length; i++) {
  781. if (this.registrants[i].memberId) {
  782. total += (a.childFee > 0 ? a.childFee : a.childMemberFee) || 0
  783. } else {
  784. total += (a.parentFee > 0 ? a.parentFee : a.parentMemberFee) || 0
  785. }
  786. }
  787. return (total / 100).toFixed(2)
  788. },
  789. // 报名按钮起步价文案
  790. minFeeText: function() {
  791. var a = this.activity || {}
  792. var fees = [a.childFee, a.childMemberFee, a.parentFee, a.parentMemberFee]
  793. var min = 0
  794. for (var i = 0; i < fees.length; i++) {
  795. if (fees[i] > 0 && (min === 0 || fees[i] < min)) min = fees[i]
  796. }
  797. return (min / 100).toFixed(2)
  798. }
  799. }
  800. }
  801. </script>
  802. <style scoped>
  803. .container {
  804. min-height: 100vh;
  805. background: #FFF7ED;
  806. }
  807. /* 加载 / 错误 / 空状态 */
  808. .loading-wrap,
  809. .error-wrap,
  810. .empty-wrap {
  811. display: flex;
  812. flex-direction: column;
  813. align-items: center;
  814. justify-content: center;
  815. padding: 120rpx 40rpx;
  816. }
  817. .loading-spinner {
  818. width: 60rpx;
  819. height: 60rpx;
  820. border: 4rpx solid #FDE68A;
  821. border-top-color: #F97316;
  822. border-radius: 50%;
  823. animation: spin 0.8s linear infinite;
  824. margin-bottom: 20rpx;
  825. }
  826. @keyframes spin {
  827. to { transform: rotate(360deg); }
  828. }
  829. .loading-text,
  830. .error-text,
  831. .empty-text {
  832. font-size: 28rpx;
  833. color: #999;
  834. margin-bottom: 20rpx;
  835. }
  836. .error-icon {
  837. font-size: 60rpx;
  838. margin-bottom: 16rpx;
  839. }
  840. .retry-btn {
  841. background: #F97316;
  842. color: #fff;
  843. border: none;
  844. border-radius: 40rpx;
  845. padding: 12rpx 40rpx;
  846. font-size: 26rpx;
  847. line-height: 1.5;
  848. }
  849. /* 内容区 */
  850. .content {
  851. height: 100vh;
  852. padding-bottom: 120rpx;
  853. }
  854. .cover {
  855. width: 100%;
  856. display: block;
  857. }
  858. .placeholder-cover {
  859. height: 400rpx;
  860. background: #f0f0f0;
  861. }
  862. /* 信息区 */
  863. .info-section {
  864. padding: 30rpx;
  865. }
  866. .activity-title {
  867. font-size: 36rpx;
  868. font-weight: bold;
  869. color: #1f2937;
  870. line-height: 1.4;
  871. }
  872. .status-row {
  873. margin-top: 16rpx;
  874. }
  875. .status-tag {
  876. display: inline-block;
  877. font-size: 22rpx;
  878. padding: 4rpx 16rpx;
  879. border-radius: 8rpx;
  880. }
  881. .status-draft { background: #F5F5F5; color: #999; }
  882. .status-published { background: #F0FDF4; color: #22C55E; }
  883. .status-ended { background: #F5F5F5; color: #999; }
  884. .status-upcoming { background: #FFF7ED; color: #F97316; }
  885. /* 元信息列表 */
  886. .meta-list {
  887. margin-top: 24rpx;
  888. background: #fff;
  889. border-radius: 16rpx;
  890. padding: 24rpx;
  891. }
  892. .meta-item {
  893. display: flex;
  894. flex-direction: row;
  895. align-items: center;
  896. margin-bottom: 16rpx;
  897. }
  898. .meta-item:last-child {
  899. margin-bottom: 0;
  900. }
  901. .meta-icon {
  902. font-size: 28rpx;
  903. margin-right: 12rpx;
  904. width: 32rpx;
  905. text-align: center;
  906. }
  907. .meta-text {
  908. font-size: 26rpx;
  909. color: #4b5563;
  910. flex: 1;
  911. line-height: 1.4;
  912. }
  913. .fee-line {
  914. display: block;
  915. }
  916. .member-fee-link {
  917. color: #F97316;
  918. font-weight: 500;
  919. text-decoration: underline;
  920. margin-top: 4rpx;
  921. }
  922. /* 活动介绍 */
  923. .desc-section {
  924. margin-top: 30rpx;
  925. background: #fff;
  926. border-radius: 16rpx;
  927. padding: 24rpx;
  928. }
  929. .section-title {
  930. font-size: 28rpx;
  931. font-weight: 600;
  932. color: #1f2937;
  933. display: block;
  934. margin-bottom: 12rpx;
  935. }
  936. .desc-text {
  937. font-size: 26rpx;
  938. color: #4b5563;
  939. line-height: 1.6;
  940. }
  941. /* 付费不退费说明 */
  942. .refund-notice {
  943. margin-top: 20rpx;
  944. margin-left: 30rpx;
  945. margin-right: 30rpx;
  946. margin-bottom: 10rpx;
  947. background: #FEF2F2;
  948. border: 2rpx solid #FECACA;
  949. border-radius: 12rpx;
  950. padding: 16rpx 20rpx;
  951. display: flex;
  952. flex-direction: row;
  953. align-items: center;
  954. }
  955. .refund-notice-icon {
  956. font-size: 24rpx;
  957. margin-right: 10rpx;
  958. flex-shrink: 0;
  959. }
  960. .refund-notice-text {
  961. font-size: 24rpx;
  962. color: #DC2626;
  963. line-height: 1.4;
  964. }
  965. /* 底部操作栏 */
  966. .bottom-bar {
  967. position: fixed;
  968. left: 0;
  969. right: 0;
  970. bottom: 0;
  971. background: #fff;
  972. padding: 20rpx 30rpx;
  973. padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  974. display: flex;
  975. flex-direction: row;
  976. align-items: center;
  977. justify-content: space-between;
  978. box-shadow: 0 -2rpx 12rpx rgba(0,0,0,0.06);
  979. }
  980. .price-info {
  981. display: flex;
  982. flex-direction: column;
  983. }
  984. .bottom-type {
  985. font-size: 22rpx;
  986. color: #999;
  987. }
  988. .bottom-vendor {
  989. font-size: 22rpx;
  990. color: #999;
  991. margin-top: 4rpx;
  992. }
  993. .action-btns {
  994. display: flex;
  995. flex-direction: row;
  996. gap: 16rpx;
  997. }
  998. .btn-checkin {
  999. background: linear-gradient(135deg, #F97316, #FB923C);
  1000. color: #fff;
  1001. border: none;
  1002. border-radius: 40rpx;
  1003. padding: 16rpx 48rpx;
  1004. font-size: 28rpx;
  1005. font-weight: 600;
  1006. line-height: 1.5;
  1007. min-width: 160rpx;
  1008. text-align: center;
  1009. }
  1010. .btn-checkin:active {
  1011. opacity: 0.85;
  1012. }
  1013. .btn-checkin-done {
  1014. background: #22C55E;
  1015. }
  1016. .btn-checkin-loading {
  1017. opacity: 0.7;
  1018. }
  1019. /* 报名按钮 */
  1020. .btn-register {
  1021. background: linear-gradient(135deg, #10B981, #34D399);
  1022. color: #fff;
  1023. border: none;
  1024. border-radius: 40rpx;
  1025. padding: 16rpx 32rpx;
  1026. font-size: 26rpx;
  1027. font-weight: 600;
  1028. line-height: 1.5;
  1029. min-width: 140rpx;
  1030. text-align: center;
  1031. }
  1032. .btn-register:active { opacity: 0.85; }
  1033. .btn-register-loading { opacity: 0.7; }
  1034. .btn-register-done {
  1035. background: #F5F5F5;
  1036. color: #999;
  1037. border: none;
  1038. border-radius: 40rpx;
  1039. padding: 16rpx 32rpx;
  1040. font-size: 26rpx;
  1041. line-height: 1.5;
  1042. min-width: 140rpx;
  1043. text-align: center;
  1044. }
  1045. .btn-cancel {
  1046. background: #fff;
  1047. color: #999;
  1048. border: 2rpx solid #ddd;
  1049. border-radius: 40rpx;
  1050. padding: 14rpx 28rpx;
  1051. font-size: 24rpx;
  1052. line-height: 1.5;
  1053. min-width: 120rpx;
  1054. text-align: center;
  1055. }
  1056. .btn-cancel:active { opacity: 0.7; }
  1057. /* 能量扣减弹窗 */
  1058. .penalty-modal {
  1059. position: fixed;
  1060. top: 0;
  1061. left: 0;
  1062. right: 0;
  1063. bottom: 0;
  1064. background: rgba(0,0,0,0.5);
  1065. display: flex;
  1066. align-items: center;
  1067. justify-content: center;
  1068. z-index: 999;
  1069. }
  1070. .penalty-content {
  1071. background: #fff;
  1072. border-radius: 24rpx;
  1073. padding: 48rpx 40rpx;
  1074. width: 560rpx;
  1075. text-align: center;
  1076. }
  1077. .penalty-title {
  1078. font-size: 32rpx;
  1079. font-weight: bold;
  1080. color: #EF4444;
  1081. display: block;
  1082. margin-bottom: 20rpx;
  1083. }
  1084. .penalty-desc {
  1085. font-size: 26rpx;
  1086. color: #666;
  1087. display: block;
  1088. margin-bottom: 40rpx;
  1089. line-height: 1.6;
  1090. }
  1091. .penalty-btn {
  1092. background: #F97316;
  1093. color: #fff;
  1094. border: none;
  1095. border-radius: 40rpx;
  1096. padding: 16rpx 60rpx;
  1097. font-size: 28rpx;
  1098. }
  1099. /* 活动评价 */
  1100. .feedback-section {
  1101. padding: 30rpx;
  1102. margin: 20rpx;
  1103. background: #fff;
  1104. border-radius: 16rpx;
  1105. }
  1106. .feedback-header { margin-bottom: 20rpx; }
  1107. .feedback-title { font-size: 32rpx; font-weight: bold; color: #333; }
  1108. .feedback-btn {
  1109. background: #F97316; color: #fff; border: none;
  1110. border-radius: 40rpx; padding: 20rpx 40rpx; font-size: 28rpx;
  1111. text-align: center;
  1112. }
  1113. .feedback-submitted { padding: 10rpx 0; }
  1114. .feedback-ratings-display { margin-bottom: 16rpx; }
  1115. .fr-row { display: flex; justify-content: space-between; padding: 8rpx 0; }
  1116. .fr-label { font-size: 28rpx; color: #333; }
  1117. .fr-stars { font-size: 28rpx; color: #F97316; }
  1118. .feedback-comment-text { font-size: 26rpx; color: #666; margin: 10rpx 0; line-height: 1.5; }
  1119. .feedback-thanks { font-size: 24rpx; color: #999; text-align: center; margin-top: 16rpx; }
  1120. .feedback-modal-overlay {
  1121. position: fixed;
  1122. top: 0;
  1123. left: 0;
  1124. right: 0;
  1125. bottom: 0;
  1126. background: rgba(0,0,0,0.5);
  1127. display: flex;
  1128. align-items: center;
  1129. justify-content: center;
  1130. z-index: 999;
  1131. }
  1132. .feedback-modal {
  1133. background: #fff; border-radius: 20rpx; padding: 40rpx;
  1134. width: 80%; max-width: 600rpx;
  1135. }
  1136. .feedback-modal-title {
  1137. font-size: 34rpx; font-weight: bold; color: #333;
  1138. text-align: center; margin-bottom: 30rpx;
  1139. }
  1140. .rating-row {
  1141. display: flex; justify-content: space-between; align-items: center;
  1142. padding: 16rpx 0;
  1143. }
  1144. .rating-label { font-size: 28rpx; color: #333; min-width: 120rpx; }
  1145. .stars { display: flex; }
  1146. .star-icon { font-size: 40rpx; color: #ddd; padding: 0 6rpx; }
  1147. .star-active { color: #F97316; }
  1148. .feedback-textarea {
  1149. width: 100%; height: 160rpx; margin-top: 20rpx;
  1150. border: 1rpx solid #eee; border-radius: 12rpx;
  1151. padding: 16rpx; font-size: 26rpx; box-sizing: border-box;
  1152. }
  1153. .feedback-modal-actions {
  1154. display: flex; justify-content: space-between; margin-top: 30rpx;
  1155. }
  1156. .feedback-cancel-btn {
  1157. flex: 1; background: #f5f5f5; color: #666; border: none;
  1158. border-radius: 40rpx; padding: 20rpx; font-size: 28rpx;
  1159. text-align: center; margin-right: 20rpx;
  1160. }
  1161. .feedback-submit-btn {
  1162. flex: 1; background: #F97316; color: #fff; border: none;
  1163. border-radius: 40rpx; padding: 20rpx; font-size: 28rpx;
  1164. text-align: center;
  1165. }
  1166. .share-btn { height: 64rpx; line-height: 64rpx; background: #f5f5f5; color: #666; font-size: 24rpx; border-radius: 32rpx; padding: 0 20rpx; display: flex; align-items: center; border: none; flex-shrink: 0; }
  1167. .share-btn::after { border: none; }
  1168. .share-btn-icon { font-size: 28rpx; margin-right: 4rpx; }
  1169. .share-btn-text { font-size: 24rpx; }
  1170. /* 报名表单弹窗 */
  1171. .reg-modal-overlay {
  1172. position: fixed;
  1173. top: 0;
  1174. left: 0;
  1175. right: 0;
  1176. bottom: 0;
  1177. background: rgba(0,0,0,0.5);
  1178. display: flex;
  1179. align-items: center;
  1180. justify-content: center;
  1181. z-index: 999;
  1182. }
  1183. .reg-modal {
  1184. background: #fff;
  1185. border-radius: 24rpx;
  1186. padding: 40rpx;
  1187. width: 85%;
  1188. max-height: 80vh;
  1189. overflow-y: auto;
  1190. }
  1191. .reg-modal-title {
  1192. font-size: 34rpx;
  1193. font-weight: bold;
  1194. color: #333;
  1195. text-align: center;
  1196. display: block;
  1197. margin-bottom: 30rpx;
  1198. }
  1199. .reg-section-label {
  1200. font-size: 28rpx;
  1201. font-weight: 600;
  1202. color: #555;
  1203. display: block;
  1204. margin-bottom: 16rpx;
  1205. }
  1206. .reg-family-section {
  1207. margin-bottom: 24rpx;
  1208. }
  1209. .reg-family-list {
  1210. max-height: 300rpx;
  1211. overflow-y: auto;
  1212. }
  1213. .reg-family-item {
  1214. display: flex;
  1215. flex-direction: row;
  1216. align-items: center;
  1217. justify-content: space-between;
  1218. padding: 16rpx 20rpx;
  1219. background: #f9f9f9;
  1220. border-radius: 12rpx;
  1221. margin-bottom: 10rpx;
  1222. }
  1223. .reg-family-item-selected {
  1224. background: #FFF7ED;
  1225. border: 2rpx solid #F97316;
  1226. }
  1227. .reg-family-info {
  1228. display: flex;
  1229. flex-direction: row;
  1230. align-items: center;
  1231. }
  1232. .reg-family-name {
  1233. font-size: 28rpx;
  1234. color: #333;
  1235. margin-right: 12rpx;
  1236. }
  1237. .reg-family-relation {
  1238. font-size: 22rpx;
  1239. color: #999;
  1240. background: #eee;
  1241. padding: 2rpx 12rpx;
  1242. border-radius: 8rpx;
  1243. }
  1244. .reg-checkmark {
  1245. color: #F97316;
  1246. font-size: 32rpx;
  1247. font-weight: bold;
  1248. }
  1249. .reg-list {
  1250. margin-bottom: 20rpx;
  1251. }
  1252. .reg-entry {
  1253. display: flex;
  1254. flex-direction: row;
  1255. align-items: center;
  1256. margin-bottom: 12rpx;
  1257. gap: 10rpx;
  1258. }
  1259. .reg-input {
  1260. flex: 1;
  1261. background: #f5f5f5;
  1262. border: none;
  1263. border-radius: 12rpx;
  1264. padding: 16rpx 20rpx;
  1265. font-size: 26rpx;
  1266. color: #333;
  1267. }
  1268. .reg-input-name {
  1269. flex: 2;
  1270. }
  1271. .reg-input-phone {
  1272. flex: 3;
  1273. }
  1274. .reg-remove {
  1275. color: #EF4444;
  1276. font-size: 28rpx;
  1277. padding: 10rpx;
  1278. flex-shrink: 0;
  1279. }
  1280. .reg-add-btn {
  1281. background: none;
  1282. border: 2rpx dashed #ddd;
  1283. border-radius: 12rpx;
  1284. padding: 16rpx;
  1285. font-size: 26rpx;
  1286. color: #F97316;
  1287. text-align: center;
  1288. width: 100%;
  1289. margin-top: 6rpx;
  1290. }
  1291. .reg-total {
  1292. text-align: center;
  1293. font-size: 30rpx;
  1294. font-weight: bold;
  1295. color: #F97316;
  1296. margin-bottom: 24rpx;
  1297. padding: 16rpx;
  1298. background: #FFF7ED;
  1299. border-radius: 12rpx;
  1300. }
  1301. .reg-actions {
  1302. display: flex;
  1303. flex-direction: row;
  1304. justify-content: space-between;
  1305. gap: 20rpx;
  1306. }
  1307. .reg-cancel {
  1308. flex: 1;
  1309. background: #f5f5f5;
  1310. color: #666;
  1311. border: none;
  1312. border-radius: 40rpx;
  1313. padding: 20rpx;
  1314. font-size: 28rpx;
  1315. text-align: center;
  1316. }
  1317. .reg-submit {
  1318. flex: 1;
  1319. background: linear-gradient(135deg, #10B981, #34D399);
  1320. color: #fff;
  1321. border: none;
  1322. border-radius: 40rpx;
  1323. padding: 20rpx;
  1324. font-size: 28rpx;
  1325. font-weight: 600;
  1326. text-align: center;
  1327. }
  1328. .reg-submit:active { opacity: 0.85; }
  1329. .reg-submit[disabled] { opacity: 0.5; }
  1330. </style>