activity-detail.vue 44 KB

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