activity-detail.vue 44 KB

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