activity-detail.vue 42 KB

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