activity-detail.vue 43 KB

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