activity-detail.vue 44 KB

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