activity-detail.vue 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403
  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, getFamilyMemberList, 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. // 兼容旧分享链接:inviteCode 参数(shareMixin onLoad 也会处理,此处显式兜底)
  292. if (options && options.inviteCode) {
  293. this.autoBindInviteCode(options.inviteCode)
  294. }
  295. var aid = ''
  296. if (options && options.id) {
  297. aid = options.id
  298. } else if (options && options.scene) {
  299. // 扫码进入:getUnlimited 小程序码把参数放在 options.scene(URL编码)
  300. try {
  301. var sceneDecoded = decodeURIComponent(options.scene)
  302. var idMatch = sceneDecoded.match(/id=(\d+)/)
  303. if (idMatch && idMatch[1]) aid = idMatch[1]
  304. var refMatch = sceneDecoded.match(/ref=([^&]+)/)
  305. if (refMatch && refMatch[1]) this.autoBindInviteCode(refMatch[1])
  306. } catch (e) {}
  307. }
  308. if (aid) {
  309. this.activityId = aid
  310. this.loadDetail(aid)
  311. } else {
  312. this.error = true
  313. this.errorMsg = '缺少活动ID'
  314. }
  315. // 检查是否已经签到(从路由参数获取)
  316. if (options && options.checkinDone === '1') {
  317. this.checkinDone = true
  318. }
  319. this.checkMemberStatus()
  320. },
  321. methods: {
  322. // ===== 工具方法 =====
  323. getImageUrl: function(path) {
  324. if (!path) return ''
  325. if (path.indexOf('http://') === 0 || path.indexOf('https://') === 0) return path
  326. return config.API_BASE_URL + path
  327. },
  328. checkMemberStatus: function() {
  329. var that = this
  330. getMyMembership().then(function(res) {
  331. if (res.data && res.data.memberLevel) {
  332. that.isMember = res.data.memberLevel !== 'FREE'
  333. }
  334. }).catch(function() {})
  335. },
  336. goUpgrade: function() {
  337. uni.navigateTo({ url: '/pages/membership/upgrade' })
  338. },
  339. formatDate: function(dateStr) {
  340. if (!dateStr) return ''
  341. var d = parseDate(dateStr)
  342. if (!d) return dateStr
  343. var year = d.getFullYear()
  344. var month = d.getMonth() + 1
  345. var day = d.getDate()
  346. var hour = d.getHours()
  347. var minute = d.getMinutes()
  348. var ampm = hour < 12 ? '上午' : '下午'
  349. var h12 = hour % 12
  350. if (h12 === 0) h12 = 12
  351. var minStr = minute < 10 ? '0' + minute : minute
  352. return year + '年' + month + '月' + day + '日 ' + ampm + h12 + ':' + minStr
  353. },
  354. // 费用双价展示:非会员价 / 会员价(元)
  355. feeText: function(regularFee, memberFee) {
  356. var regular = (regularFee || 0) / 100
  357. var member = (memberFee || 0) / 100
  358. if (member > 0 && member < regular) {
  359. return member.toFixed(2) + '(会员) / ' + regular.toFixed(2)
  360. }
  361. if (regular === 0 && member === 0) return '0.00'
  362. if (regular === 0) return '会员免费'
  363. return regular.toFixed(2)
  364. },
  365. loadDetail: function(id) {
  366. var self = this
  367. self.loading = true
  368. self.error = false
  369. getActivityDetail(id).then(function(res) {
  370. self.loading = false
  371. if (res && res.code === 200 && res.data) {
  372. self.activity = res.data
  373. self.setShareInfo('推荐活动: ' + (res.data.title || ''), '/pages/activity/activity-detail/activity-detail?id=' + id)
  374. self.parseFeedbackDimensions()
  375. self.loadFeedbackStatus()
  376. // registrationStatus 已由后端按当前用户计算返回
  377. self.registrationStatus = res.data.registrationStatus || null
  378. } else {
  379. self.error = true
  380. self.errorMsg = (res && res.message) || '加载失败'
  381. }
  382. }).catch(function(err) {
  383. self.loading = false
  384. self.error = true
  385. self.errorMsg = '网络异常,请稍后重试'
  386. })
  387. },
  388. statusText: function(status) {
  389. var map = { draft: '草稿', published: '进行中', ended: '已结束' }
  390. return map[status] || '未知'
  391. },
  392. onCheckin: function() {
  393. var self = this
  394. if (self.checkinLoading || self.checkinDone) return
  395. // 未登录则跳转登录
  396. if (!uni.getStorageSync('token')) {
  397. uni.navigateTo({ url: '/pages/login/login' })
  398. return
  399. }
  400. var memberId = uni.getStorageSync('currentChildId') || self.registrationChildId
  401. if (!memberId) {
  402. uni.showToast({ title: '请选择孩子身份', icon: 'none' })
  403. return
  404. }
  405. self.checkinLoading = true
  406. activityCheckin({ id: self.activity.id, memberId: memberId }).then(function(res) {
  407. self.checkinLoading = false
  408. if (res && res.code === 200 && res.data) {
  409. self.loadFeedbackStatus()
  410. // 检查是否有能量扣减
  411. if (res.data.energyPenalty) {
  412. self.penaltyAmount = res.data.energyPenalty
  413. self.showPenaltyModal = true
  414. self.checkinDone = true
  415. return
  416. }
  417. if (res.data.alreadyCompleted) {
  418. self.checkinDone = true
  419. uni.showToast({ title: '已签到', icon: 'success' })
  420. } else if (res.data.pointsEarned && res.data.pointsEarned > 0) {
  421. self.checkinDone = true
  422. self.checkinPoints = res.data.pointsEarned
  423. uni.showToast({ title: '签到成功 +' + res.data.pointsEarned + '积分', icon: 'success' })
  424. } else {
  425. self.checkinDone = true
  426. uni.showToast({ title: '签到成功', icon: 'success' })
  427. }
  428. } else {
  429. var msg = (res && res.message) || '签到失败'
  430. // 如果是报名待审核,提示用户
  431. if (msg.indexOf('报名') !== -1 || msg.indexOf('审核') !== -1) {
  432. uni.showModal({ title: '提示', content: msg, showCancel: false })
  433. } else {
  434. uni.showToast({ title: msg, icon: 'none' })
  435. }
  436. }
  437. }).catch(function(err) {
  438. self.checkinLoading = false
  439. uni.showToast({ title: '网络异常', icon: 'none' })
  440. })
  441. },
  442. onRegister: function() {
  443. var self = this
  444. // 未登录则跳转登录
  445. if (!uni.getStorageSync('token')) {
  446. uni.navigateTo({ url: '/pages/login/login' })
  447. return
  448. }
  449. // Open registration form modal
  450. self.showRegModal = true
  451. self.registrants = []
  452. self.loadFamilyMembers()
  453. },
  454. onCancelRegistration: function() {
  455. var self = this
  456. // 未登录则跳转登录
  457. if (!uni.getStorageSync('token')) {
  458. uni.navigateTo({ url: '/pages/login/login' })
  459. return
  460. }
  461. uni.showModal({
  462. title: '提示',
  463. content: '确定要取消报名吗?',
  464. success: function(res) {
  465. if (res.confirm) {
  466. var memberId = uni.getStorageSync('currentChildId')
  467. self.registrationLoading = true
  468. cancelActivityRegistration({ id: self.activity.id, memberId: memberId }).then(function(res) {
  469. self.registrationLoading = false
  470. if (res && res.code === 200) {
  471. self.registrationStatus = null
  472. uni.showToast({ title: '已取消报名', icon: 'success' })
  473. } else {
  474. uni.showToast({ title: (res && res.message) || '取消失败', icon: 'none' })
  475. }
  476. }).catch(function() {
  477. self.registrationLoading = false
  478. uni.showToast({ title: '网络异常', icon: 'none' })
  479. })
  480. }
  481. }
  482. })
  483. },
  484. // ===== 活动评价 =====
  485. parseFeedbackDimensions: function() {
  486. var dims = ['组织形式', '会场气氛', '主持人', '专家']
  487. if (this.activity.feedbackDimensions) {
  488. try {
  489. var parsed = JSON.parse(this.activity.feedbackDimensions)
  490. if (parsed && parsed.length > 0) {
  491. dims = parsed
  492. }
  493. } catch(e) {}
  494. }
  495. this.feedbackDimensions = dims
  496. this.initRatings()
  497. },
  498. initRatings: function() {
  499. var r = {}
  500. for (var i = 0; i < this.feedbackDimensions.length; i++) {
  501. r[this.feedbackDimensions[i]] = 0
  502. }
  503. this.feedbackRatings = r
  504. },
  505. loadFeedbackStatus: function() {
  506. var self = this
  507. var memberId = uni.getStorageSync('currentChildId')
  508. if (!memberId || !self.activity || !self.activity.id) return
  509. getMyActivityFeedback({ activityId: self.activity.id, memberId: memberId }).then(function(res) {
  510. if (res && res.code === 200 && res.data) {
  511. self.submittedFeedback = res.data
  512. }
  513. }).catch(function() {})
  514. },
  515. openFeedbackModal: function() {
  516. this.showFeedbackModal = true
  517. },
  518. submitFeedback: function() {
  519. var self = this
  520. // Validate at least one rating
  521. var hasRating = false
  522. for (var key in self.feedbackRatings) {
  523. if (self.feedbackRatings[key] > 0) { hasRating = true; break }
  524. }
  525. if (!hasRating) {
  526. uni.showToast({ title: '请至少评价一项', icon: 'none' })
  527. return
  528. }
  529. self.feedbackSubmitting = true
  530. var memberId = uni.getStorageSync('currentChildId')
  531. submitActivityFeedback({
  532. activityId: self.activity.id,
  533. memberId: memberId,
  534. ratings: JSON.stringify(self.feedbackRatings),
  535. comment: self.feedbackComment
  536. }).then(function(res) {
  537. self.feedbackSubmitting = false
  538. if (res && res.code === 200) {
  539. self.showFeedbackModal = false
  540. self.loadFeedbackStatus()
  541. uni.showToast({ title: '评价成功', icon: 'success' })
  542. } else {
  543. uni.showToast({ title: (res && res.message) || '提交失败', icon: 'none' })
  544. }
  545. }).catch(function() {
  546. self.feedbackSubmitting = false
  547. uni.showToast({ title: '网络异常', icon: 'none' })
  548. })
  549. },
  550. getStarDisplay: function(val) {
  551. var full = parseInt(val) || 0
  552. var empty = 5 - full
  553. return '★'.repeat(full) + '☆'.repeat(empty)
  554. },
  555. // ===== 报名表单 =====
  556. loadFamilyMembers: function() {
  557. var self = this
  558. getFamilyMemberList({ visibleOnly: true }).then(function(res) {
  559. if (res && res.code === 200 && res.data) {
  560. var list = []
  561. var members = res.data
  562. // members: flat List<FamilyMemberVO>,source='parent' 为家长(users表),其余为孩子/成员(family_members表)
  563. for (var i = 0; i < members.length; i++) {
  564. var m = members[i]
  565. if (m.source === 'parent') {
  566. list.push({
  567. id: 'p_' + m.id,
  568. name: m.nickname || m.name || '',
  569. phone: m.phone || '',
  570. relation: '家长',
  571. memberId: m.id,
  572. source: 'parent',
  573. targetType: 'user'
  574. })
  575. } else {
  576. list.push({
  577. id: 'c_' + m.id,
  578. name: m.nickname || m.name || '',
  579. phone: m.phone || '',
  580. relation: '孩子',
  581. memberId: m.userId || m.id,
  582. source: 'child',
  583. targetType: 'member'
  584. })
  585. }
  586. }
  587. self.familyMembers = list
  588. }
  589. }).catch(function() {})
  590. },
  591. isMemberSelected: function(member) {
  592. for (var i = 0; i < this.registrants.length; i++) {
  593. if (this.registrants[i].memberId === member.id) return true
  594. }
  595. return false
  596. },
  597. toggleFamilyMember: function(member) {
  598. for (var i = 0; i < this.registrants.length; i++) {
  599. if (this.registrants[i].memberId === member.id) {
  600. this.registrants.splice(i, 1)
  601. return
  602. }
  603. }
  604. this.registrants.push({
  605. memberId: member.id,
  606. name: member.name,
  607. phone: member.phone,
  608. childId: member.childId,
  609. targetType: member.targetType,
  610. prevPhone: member.phone
  611. })
  612. },
  613. addManualEntry: function() {
  614. this.registrants.push({
  615. memberId: null,
  616. name: '',
  617. phone: '',
  618. memberId: null
  619. })
  620. },
  621. removeRegistrant: function(idx) {
  622. this.registrants.splice(idx, 1)
  623. },
  624. closeRegModal: function() {
  625. this.showRegModal = false
  626. this.registrants = []
  627. this.familyMembers = []
  628. },
  629. // ===== 分享海报 =====
  630. async generatePoster() {
  631. if (!this.activity || !this.activity.id) return
  632. // 未登录则跳转登录
  633. if (!uni.getStorageSync('token')) {
  634. uni.navigateTo({ url: '/pages/login/login' })
  635. return
  636. }
  637. uni.showLoading({ title: '生成海报中...' })
  638. try {
  639. if (!this.referralCode) {
  640. await this.loadReferralCode()
  641. }
  642. var scene = 'id=' + this.activity.id + (this.referralCode ? '&ref=' + this.referralCode : '')
  643. if (scene.length > 32) {
  644. scene = scene.substring(0, 32)
  645. }
  646. var res = await getShareQrCode('pages/activity/activity-detail/activity-detail', scene)
  647. if (res && res.data) {
  648. this.posterQrCode = res.data.qrCodeBase64 || ''
  649. this.posterSummary = this.buildPosterSummary()
  650. this.posterPriceText = this.activity.price > 0 ? '¥' + this.activity.price : '免费'
  651. this.posterInviteText = '「' + (uni.getStorageSync('nickname') || '好友') + '」邀请你一起参加这个活动'
  652. this.showPoster = true
  653. }
  654. } catch (e) {
  655. uni.showToast({ title: '生成失败', icon: 'none' })
  656. } finally {
  657. uni.hideLoading()
  658. }
  659. },
  660. buildPosterSummary: function() {
  661. var desc = (this.activity && this.activity.description) || ''
  662. desc = desc.replace(/<[^>]+>/g, ' ').replace(/&nbsp;/g, ' ').replace(/\s+/g, ' ').trim()
  663. return desc.length > 60 ? desc.substring(0, 60) + '...' : desc
  664. },
  665. closePoster: function() {
  666. this.showPoster = false
  667. },
  668. submitRegistration: function() {
  669. var self = this
  670. // Validate
  671. if (self.registrants.length === 0) {
  672. uni.showToast({ title: '请至少添加一个报名人', icon: 'none' })
  673. return
  674. }
  675. for (var i = 0; i < self.registrants.length; i++) {
  676. var entry = self.registrants[i]
  677. if (!entry.name || entry.name.trim() === '') {
  678. uni.showToast({ title: '请输入第 ' + (i + 1) + ' 个报名人的姓名', icon: 'none' })
  679. return
  680. }
  681. var phone = (entry.phone || '').trim()
  682. if (phone !== '' && !/^1[3-9]\d{9}$/.test(phone)) {
  683. uni.showToast({ title: '请输入第 ' + (i + 1) + ' 个报名人的正确手机号', icon: 'none' })
  684. return
  685. }
  686. }
  687. // 就地补充的手机号自动回写(仅家庭成员;外部报名人 memberId=null 不回写)
  688. var backfillTasks = []
  689. for (var b = 0; b < self.registrants.length; b++) {
  690. var entryB = self.registrants[b]
  691. if (!entryB.memberId) continue
  692. var phoneB = (entryB.phone || '').trim()
  693. if (phoneB === '') continue
  694. var rawId = String(entryB.memberId)
  695. var realId = rawId.indexOf('_') >= 0 ? rawId.substring(2) : rawId
  696. backfillTasks.push(backfillProfile({
  697. targetType: entryB.targetType,
  698. targetId: realId,
  699. fields: { phone: phoneB },
  700. scene: 'activity-signup',
  701. prevValues: { phone: entryB.prevPhone }
  702. }))
  703. }
  704. // 回写失败不阻塞报名主流程,仅静默记录
  705. if (backfillTasks.length > 0) {
  706. Promise.all(backfillTasks).catch(function(err) {
  707. console.warn('[backfill] 活动报名信息回写失败', err)
  708. })
  709. }
  710. // 付费活动 → 先确认支付
  711. if (self.hasFee && self.registrantsTotal > 0) {
  712. uni.showModal({
  713. title: '确认报名',
  714. content: '共 ' + self.registrants.length + ' 人,需支付 ¥' + self.registrantsTotal + ',报名成功后不支持退费。是否继续?',
  715. confirmText: '确认支付',
  716. cancelText: '再想想',
  717. success: function(confirmRes) {
  718. if (confirmRes.confirm) {
  719. self.doCreateOrder()
  720. }
  721. }
  722. })
  723. } else {
  724. self.doCreateOrder()
  725. }
  726. },
  727. doCreateOrder: function() {
  728. var self = this
  729. self.regSubmitting = true
  730. var registrantsData = []
  731. for (var i = 0; i < self.registrants.length; i++) {
  732. var entry = self.registrants[i]
  733. // memberId 可能带 p_/c_ 前缀(仅回写用),下单需去掉前缀的纯数字
  734. var orderMemberId = entry.memberId
  735. if (orderMemberId !== null && orderMemberId !== undefined) {
  736. var midStr = String(orderMemberId)
  737. if (midStr.indexOf('_') >= 0) orderMemberId = midStr.substring(2)
  738. }
  739. registrantsData.push({
  740. name: entry.name.trim(),
  741. phone: entry.phone || '',
  742. memberId: orderMemberId
  743. })
  744. }
  745. createActivityOrder({ activityId: self.activity.id, registrants: registrantsData }).then(function(res) {
  746. self.regSubmitting = false
  747. if (res && res.code === 200) {
  748. var data = res.data || {}
  749. if (data.free) {
  750. // 免费活动直接报名成功
  751. self.closeRegModal()
  752. self.registrationStatus = 'registered'
  753. uni.showToast({ title: '报名成功', icon: 'success' })
  754. self.loadDetail(self.activity.id)
  755. } else if (data.requiresPayment && data.orderNo) {
  756. // 付费活动 → 跳转支付页
  757. self.closeRegModal()
  758. uni.navigateTo({
  759. url: '/pages/activity/order-pay/order-pay?orderNo=' + data.orderNo + '&totalAmount=' + data.totalAmount + '&activityId=' + self.activity.id
  760. })
  761. } else {
  762. uni.showToast({ title: '报名失败', icon: 'none' })
  763. }
  764. } else {
  765. uni.showToast({ title: (res && res.message) || '报名失败', icon: 'none' })
  766. }
  767. }).catch(function() {
  768. self.regSubmitting = false
  769. uni.showToast({ title: '网络异常', icon: 'none' })
  770. })
  771. }
  772. },
  773. computed: {
  774. parsedSubmittedRatings: function() {
  775. if (!this.submittedFeedback || !this.submittedFeedback.ratings) return {}
  776. try {
  777. return JSON.parse(this.submittedFeedback.ratings)
  778. } catch(e) {
  779. return {}
  780. }
  781. },
  782. // 4 个费用字段是否存在(任一项 > 0 即为付费活动)
  783. hasFee: function() {
  784. var a = this.activity || {}
  785. return (a.childFee > 0) || (a.childMemberFee > 0) || (a.parentFee > 0) || (a.parentMemberFee > 0)
  786. },
  787. // 是否存在会员专享价(用于非会员引导)
  788. hasMemberPrice: function() {
  789. var a = this.activity || {}
  790. return (a.childMemberFee > 0) || (a.parentMemberFee > 0)
  791. },
  792. // 报名按钮可用:需报名 + 未报名 + 展示状态为报名中
  793. canRegister: function() {
  794. var a = this.activity || {}
  795. if (a.requireRegistration !== 1) return false
  796. if (a.displayStatus !== 'open') return false
  797. var st = this.registrationStatus
  798. return !st || st === 'not_registered' || st === 'cancelled' || st === 'rejected'
  799. },
  800. // 报名弹窗内合计(按当前用户会员价估算,实际以订单为准)
  801. registrantsTotal: function() {
  802. var a = this.activity || {}
  803. var total = 0
  804. for (var i = 0; i < this.registrants.length; i++) {
  805. if (this.registrants[i].memberId) {
  806. total += (a.childFee > 0 ? a.childFee : a.childMemberFee) || 0
  807. } else {
  808. total += (a.parentFee > 0 ? a.parentFee : a.parentMemberFee) || 0
  809. }
  810. }
  811. return (total / 100).toFixed(2)
  812. },
  813. // 报名按钮起步价文案
  814. minFeeText: function() {
  815. var a = this.activity || {}
  816. var fees = [a.childFee, a.childMemberFee, a.parentFee, a.parentMemberFee]
  817. var min = 0
  818. for (var i = 0; i < fees.length; i++) {
  819. if (fees[i] > 0 && (min === 0 || fees[i] < min)) min = fees[i]
  820. }
  821. return (min / 100).toFixed(2)
  822. }
  823. }
  824. }
  825. </script>
  826. <style scoped>
  827. .container {
  828. min-height: 100vh;
  829. background: #FFF7ED;
  830. }
  831. /* 加载 / 错误 / 空状态 */
  832. .loading-wrap,
  833. .error-wrap,
  834. .empty-wrap {
  835. display: flex;
  836. flex-direction: column;
  837. align-items: center;
  838. justify-content: center;
  839. padding: 120rpx 40rpx;
  840. }
  841. .loading-spinner {
  842. width: 60rpx;
  843. height: 60rpx;
  844. border: 4rpx solid #FDE68A;
  845. border-top-color: #F97316;
  846. border-radius: 50%;
  847. animation: spin 0.8s linear infinite;
  848. margin-bottom: 20rpx;
  849. }
  850. @keyframes spin {
  851. to { transform: rotate(360deg); }
  852. }
  853. .loading-text,
  854. .error-text,
  855. .empty-text {
  856. font-size: 28rpx;
  857. color: #999;
  858. margin-bottom: 20rpx;
  859. }
  860. .error-icon {
  861. font-size: 60rpx;
  862. margin-bottom: 16rpx;
  863. }
  864. .retry-btn {
  865. background: #F97316;
  866. color: #fff;
  867. border: none;
  868. border-radius: 40rpx;
  869. padding: 12rpx 40rpx;
  870. font-size: 26rpx;
  871. line-height: 1.5;
  872. }
  873. /* 内容区 */
  874. .content {
  875. height: 100vh;
  876. padding-bottom: 120rpx;
  877. }
  878. .cover {
  879. width: 100%;
  880. display: block;
  881. }
  882. .placeholder-cover {
  883. height: 400rpx;
  884. background: #f0f0f0;
  885. }
  886. /* 信息区 */
  887. .info-section {
  888. padding: 30rpx;
  889. }
  890. .activity-title {
  891. font-size: 36rpx;
  892. font-weight: bold;
  893. color: #1f2937;
  894. line-height: 1.4;
  895. }
  896. .status-row {
  897. margin-top: 16rpx;
  898. }
  899. .status-tag {
  900. display: inline-block;
  901. font-size: 22rpx;
  902. padding: 4rpx 16rpx;
  903. border-radius: 8rpx;
  904. }
  905. .status-draft { background: #F5F5F5; color: #999; }
  906. .status-published { background: #F0FDF4; color: #22C55E; }
  907. .status-ended { background: #F5F5F5; color: #999; }
  908. .status-upcoming { background: #FFF7ED; color: #F97316; }
  909. /* 元信息列表 */
  910. .meta-list {
  911. margin-top: 24rpx;
  912. background: #fff;
  913. border-radius: 16rpx;
  914. padding: 24rpx;
  915. }
  916. .meta-item {
  917. display: flex;
  918. flex-direction: row;
  919. align-items: center;
  920. margin-bottom: 16rpx;
  921. }
  922. .meta-item:last-child {
  923. margin-bottom: 0;
  924. }
  925. .meta-icon {
  926. font-size: 28rpx;
  927. margin-right: 12rpx;
  928. width: 32rpx;
  929. text-align: center;
  930. }
  931. .meta-text {
  932. font-size: 26rpx;
  933. color: #4b5563;
  934. flex: 1;
  935. line-height: 1.4;
  936. }
  937. .fee-line {
  938. display: block;
  939. }
  940. .member-fee-link {
  941. color: #F97316;
  942. font-weight: 500;
  943. text-decoration: underline;
  944. margin-top: 4rpx;
  945. }
  946. /* 活动介绍 */
  947. .desc-section {
  948. margin-top: 30rpx;
  949. background: #fff;
  950. border-radius: 16rpx;
  951. padding: 24rpx;
  952. }
  953. .section-title {
  954. font-size: 28rpx;
  955. font-weight: 600;
  956. color: #1f2937;
  957. display: block;
  958. margin-bottom: 12rpx;
  959. }
  960. .desc-text {
  961. font-size: 26rpx;
  962. color: #4b5563;
  963. line-height: 1.6;
  964. }
  965. /* 付费不退费说明 */
  966. .refund-notice {
  967. margin-top: 20rpx;
  968. margin-left: 30rpx;
  969. margin-right: 30rpx;
  970. margin-bottom: 10rpx;
  971. background: #FEF2F2;
  972. border: 2rpx solid #FECACA;
  973. border-radius: 12rpx;
  974. padding: 16rpx 20rpx;
  975. display: flex;
  976. flex-direction: row;
  977. align-items: center;
  978. }
  979. .refund-notice-icon {
  980. font-size: 24rpx;
  981. margin-right: 10rpx;
  982. flex-shrink: 0;
  983. }
  984. .refund-notice-text {
  985. font-size: 24rpx;
  986. color: #DC2626;
  987. line-height: 1.4;
  988. }
  989. /* 底部操作栏 */
  990. .bottom-bar {
  991. position: fixed;
  992. left: 0;
  993. right: 0;
  994. bottom: 0;
  995. background: #fff;
  996. padding: 20rpx 30rpx;
  997. padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  998. display: flex;
  999. flex-direction: row;
  1000. align-items: center;
  1001. justify-content: space-between;
  1002. box-shadow: 0 -2rpx 12rpx rgba(0,0,0,0.06);
  1003. }
  1004. .price-info {
  1005. display: flex;
  1006. flex-direction: column;
  1007. }
  1008. .bottom-type {
  1009. font-size: 22rpx;
  1010. color: #999;
  1011. }
  1012. .bottom-vendor {
  1013. font-size: 22rpx;
  1014. color: #999;
  1015. margin-top: 4rpx;
  1016. }
  1017. .action-btns {
  1018. display: flex;
  1019. flex-direction: row;
  1020. gap: 16rpx;
  1021. }
  1022. .btn-checkin {
  1023. background: linear-gradient(135deg, #F97316, #FB923C);
  1024. color: #fff;
  1025. border: none;
  1026. border-radius: 40rpx;
  1027. padding: 16rpx 48rpx;
  1028. font-size: 28rpx;
  1029. font-weight: 600;
  1030. line-height: 1.5;
  1031. min-width: 160rpx;
  1032. text-align: center;
  1033. }
  1034. .btn-checkin:active {
  1035. opacity: 0.85;
  1036. }
  1037. .btn-checkin-done {
  1038. background: #22C55E;
  1039. }
  1040. .btn-checkin-loading {
  1041. opacity: 0.7;
  1042. }
  1043. /* 报名按钮 */
  1044. .btn-register {
  1045. background: linear-gradient(135deg, #10B981, #34D399);
  1046. color: #fff;
  1047. border: none;
  1048. border-radius: 40rpx;
  1049. padding: 16rpx 32rpx;
  1050. font-size: 26rpx;
  1051. font-weight: 600;
  1052. line-height: 1.5;
  1053. min-width: 140rpx;
  1054. text-align: center;
  1055. }
  1056. .btn-register:active { opacity: 0.85; }
  1057. .btn-register-loading { opacity: 0.7; }
  1058. .btn-register-done {
  1059. background: #F5F5F5;
  1060. color: #999;
  1061. border: none;
  1062. border-radius: 40rpx;
  1063. padding: 16rpx 32rpx;
  1064. font-size: 26rpx;
  1065. line-height: 1.5;
  1066. min-width: 140rpx;
  1067. text-align: center;
  1068. }
  1069. .btn-cancel {
  1070. background: #fff;
  1071. color: #999;
  1072. border: 2rpx solid #ddd;
  1073. border-radius: 40rpx;
  1074. padding: 14rpx 28rpx;
  1075. font-size: 24rpx;
  1076. line-height: 1.5;
  1077. min-width: 120rpx;
  1078. text-align: center;
  1079. }
  1080. .btn-cancel:active { opacity: 0.7; }
  1081. /* 能量扣减弹窗 */
  1082. .penalty-modal {
  1083. position: fixed;
  1084. top: 0;
  1085. left: 0;
  1086. right: 0;
  1087. bottom: 0;
  1088. background: rgba(0,0,0,0.5);
  1089. display: flex;
  1090. align-items: center;
  1091. justify-content: center;
  1092. z-index: 999;
  1093. }
  1094. .penalty-content {
  1095. background: #fff;
  1096. border-radius: 24rpx;
  1097. padding: 48rpx 40rpx;
  1098. width: 560rpx;
  1099. text-align: center;
  1100. }
  1101. .penalty-title {
  1102. font-size: 32rpx;
  1103. font-weight: bold;
  1104. color: #EF4444;
  1105. display: block;
  1106. margin-bottom: 20rpx;
  1107. }
  1108. .penalty-desc {
  1109. font-size: 26rpx;
  1110. color: #666;
  1111. display: block;
  1112. margin-bottom: 40rpx;
  1113. line-height: 1.6;
  1114. }
  1115. .penalty-btn {
  1116. background: #F97316;
  1117. color: #fff;
  1118. border: none;
  1119. border-radius: 40rpx;
  1120. padding: 16rpx 60rpx;
  1121. font-size: 28rpx;
  1122. }
  1123. /* 活动评价 */
  1124. .feedback-section {
  1125. padding: 30rpx;
  1126. margin: 20rpx;
  1127. background: #fff;
  1128. border-radius: 16rpx;
  1129. }
  1130. .feedback-header { margin-bottom: 20rpx; }
  1131. .feedback-title { font-size: 32rpx; font-weight: bold; color: #333; }
  1132. .feedback-btn {
  1133. background: #F97316; color: #fff; border: none;
  1134. border-radius: 40rpx; padding: 20rpx 40rpx; font-size: 28rpx;
  1135. text-align: center;
  1136. }
  1137. .feedback-submitted { padding: 10rpx 0; }
  1138. .feedback-ratings-display { margin-bottom: 16rpx; }
  1139. .fr-row { display: flex; justify-content: space-between; padding: 8rpx 0; }
  1140. .fr-label { font-size: 28rpx; color: #333; }
  1141. .fr-stars { font-size: 28rpx; color: #F97316; }
  1142. .feedback-comment-text { font-size: 26rpx; color: #666; margin: 10rpx 0; line-height: 1.5; }
  1143. .feedback-thanks { font-size: 24rpx; color: #999; text-align: center; margin-top: 16rpx; }
  1144. .feedback-modal-overlay {
  1145. position: fixed;
  1146. top: 0;
  1147. left: 0;
  1148. right: 0;
  1149. bottom: 0;
  1150. background: rgba(0,0,0,0.5);
  1151. display: flex;
  1152. align-items: center;
  1153. justify-content: center;
  1154. z-index: 999;
  1155. }
  1156. .feedback-modal {
  1157. background: #fff; border-radius: 20rpx; padding: 40rpx;
  1158. width: 80%; max-width: 600rpx;
  1159. }
  1160. .feedback-modal-title {
  1161. font-size: 34rpx; font-weight: bold; color: #333;
  1162. text-align: center; margin-bottom: 30rpx;
  1163. }
  1164. .rating-row {
  1165. display: flex; justify-content: space-between; align-items: center;
  1166. padding: 16rpx 0;
  1167. }
  1168. .rating-label { font-size: 28rpx; color: #333; min-width: 120rpx; }
  1169. .stars { display: flex; }
  1170. .star-icon { font-size: 40rpx; color: #ddd; padding: 0 6rpx; }
  1171. .star-active { color: #F97316; }
  1172. .feedback-textarea {
  1173. width: 100%; height: 160rpx; margin-top: 20rpx;
  1174. border: 1rpx solid #eee; border-radius: 12rpx;
  1175. padding: 16rpx; font-size: 26rpx; box-sizing: border-box;
  1176. }
  1177. .feedback-modal-actions {
  1178. display: flex; justify-content: space-between; margin-top: 30rpx;
  1179. }
  1180. .feedback-cancel-btn {
  1181. flex: 1; background: #f5f5f5; color: #666; border: none;
  1182. border-radius: 40rpx; padding: 20rpx; font-size: 28rpx;
  1183. text-align: center; margin-right: 20rpx;
  1184. }
  1185. .feedback-submit-btn {
  1186. flex: 1; background: #F97316; color: #fff; border: none;
  1187. border-radius: 40rpx; padding: 20rpx; font-size: 28rpx;
  1188. text-align: center;
  1189. }
  1190. .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; }
  1191. .share-btn::after { border: none; }
  1192. .share-btn-icon { font-size: 28rpx; margin-right: 4rpx; }
  1193. .share-btn-text { font-size: 24rpx; }
  1194. /* 报名表单弹窗 */
  1195. .reg-modal-overlay {
  1196. position: fixed;
  1197. top: 0;
  1198. left: 0;
  1199. right: 0;
  1200. bottom: 0;
  1201. background: rgba(0,0,0,0.5);
  1202. display: flex;
  1203. align-items: center;
  1204. justify-content: center;
  1205. z-index: 999;
  1206. }
  1207. .reg-modal {
  1208. background: #fff;
  1209. border-radius: 24rpx;
  1210. padding: 40rpx;
  1211. width: 85%;
  1212. max-height: 80vh;
  1213. overflow-y: auto;
  1214. }
  1215. .reg-modal-title {
  1216. font-size: 34rpx;
  1217. font-weight: bold;
  1218. color: #333;
  1219. text-align: center;
  1220. display: block;
  1221. margin-bottom: 30rpx;
  1222. }
  1223. .reg-section-label {
  1224. font-size: 28rpx;
  1225. font-weight: 600;
  1226. color: #555;
  1227. display: block;
  1228. margin-bottom: 16rpx;
  1229. }
  1230. .reg-family-section {
  1231. margin-bottom: 24rpx;
  1232. }
  1233. .reg-family-list {
  1234. max-height: 300rpx;
  1235. overflow-y: auto;
  1236. }
  1237. .reg-family-item {
  1238. display: flex;
  1239. flex-direction: row;
  1240. align-items: center;
  1241. justify-content: space-between;
  1242. padding: 16rpx 20rpx;
  1243. background: #f9f9f9;
  1244. border-radius: 12rpx;
  1245. margin-bottom: 10rpx;
  1246. }
  1247. .reg-family-item-selected {
  1248. background: #FFF7ED;
  1249. border: 2rpx solid #F97316;
  1250. }
  1251. .reg-family-info {
  1252. display: flex;
  1253. flex-direction: row;
  1254. align-items: center;
  1255. }
  1256. .reg-family-name {
  1257. font-size: 28rpx;
  1258. color: #333;
  1259. margin-right: 12rpx;
  1260. }
  1261. .reg-family-relation {
  1262. font-size: 22rpx;
  1263. color: #999;
  1264. background: #eee;
  1265. padding: 2rpx 12rpx;
  1266. border-radius: 8rpx;
  1267. }
  1268. .reg-checkmark {
  1269. color: #F97316;
  1270. font-size: 32rpx;
  1271. font-weight: bold;
  1272. }
  1273. .reg-list {
  1274. margin-bottom: 20rpx;
  1275. }
  1276. .reg-entry {
  1277. display: flex;
  1278. flex-direction: row;
  1279. align-items: center;
  1280. margin-bottom: 12rpx;
  1281. gap: 10rpx;
  1282. }
  1283. .reg-input {
  1284. flex: 1;
  1285. background: #f5f5f5;
  1286. border: none;
  1287. border-radius: 12rpx;
  1288. padding: 16rpx 20rpx;
  1289. font-size: 26rpx;
  1290. color: #333;
  1291. }
  1292. .reg-input-name {
  1293. flex: 2;
  1294. }
  1295. .reg-input-phone {
  1296. flex: 3;
  1297. }
  1298. .reg-remove {
  1299. color: #EF4444;
  1300. font-size: 28rpx;
  1301. padding: 10rpx;
  1302. flex-shrink: 0;
  1303. }
  1304. .reg-add-btn {
  1305. background: none;
  1306. border: 2rpx dashed #ddd;
  1307. border-radius: 12rpx;
  1308. padding: 16rpx;
  1309. font-size: 26rpx;
  1310. color: #F97316;
  1311. text-align: center;
  1312. width: 100%;
  1313. margin-top: 6rpx;
  1314. }
  1315. .reg-total {
  1316. text-align: center;
  1317. font-size: 30rpx;
  1318. font-weight: bold;
  1319. color: #F97316;
  1320. margin-bottom: 24rpx;
  1321. padding: 16rpx;
  1322. background: #FFF7ED;
  1323. border-radius: 12rpx;
  1324. }
  1325. .reg-actions {
  1326. display: flex;
  1327. flex-direction: row;
  1328. justify-content: space-between;
  1329. gap: 20rpx;
  1330. }
  1331. .reg-cancel {
  1332. flex: 1;
  1333. background: #f5f5f5;
  1334. color: #666;
  1335. border: none;
  1336. border-radius: 40rpx;
  1337. padding: 20rpx;
  1338. font-size: 28rpx;
  1339. text-align: center;
  1340. }
  1341. .reg-submit {
  1342. flex: 1;
  1343. background: linear-gradient(135deg, #10B981, #34D399);
  1344. color: #fff;
  1345. border: none;
  1346. border-radius: 40rpx;
  1347. padding: 20rpx;
  1348. font-size: 28rpx;
  1349. font-weight: 600;
  1350. text-align: center;
  1351. }
  1352. .reg-submit:active { opacity: 0.85; }
  1353. .reg-submit[disabled] { opacity: 0.5; }
  1354. </style>