index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889
  1. <template>
  2. <view class="activity-container">
  3. <!-- Nav bar with title "活动中心" -->
  4. <view class="nav-bar">
  5. <text class="nav-title">活动中心</text>
  6. </view>
  7. <!-- Tab bar (3 tabs) -->
  8. <view class="tab-bar">
  9. <view
  10. class="tab-item"
  11. :class="{ active: currentTab === tab.key }"
  12. v-for="tab in tabs"
  13. :key="tab.key"
  14. @click="onTabChange(tab.key)"
  15. >
  16. <text class="tab-label">{{ tab.label }}</text>
  17. </view>
  18. </view>
  19. <!-- ScrollView content area -->
  20. <scroll-view
  21. class="content-scroll"
  22. scroll-y
  23. :refresher-enabled="true"
  24. :refresher-triggered="isRefreshing"
  25. @refresherrefresh="onRefresh"
  26. @scrolltolower="onLoadMore"
  27. >
  28. <!-- Tab 1: mine -->
  29. <view v-if="currentTab === 'mine'">
  30. <!-- Filter chips -->
  31. <scroll-view class="filter-scroll" scroll-x enable-flex>
  32. <view class="filter-chips">
  33. <view
  34. class="filter-chip"
  35. :class="{ active: currentMineFilter === filter.value }"
  36. v-for="filter in mineFilters"
  37. :key="filter.value"
  38. @click="onMineFilterChange(filter.value)"
  39. >
  40. <text class="filter-label">{{ filter.label }}</text>
  41. </view>
  42. </view>
  43. </scroll-view>
  44. <!-- Activity cards -->
  45. <view class="card-list" v-if="myActivities.length > 0">
  46. <view
  47. class="activity-card"
  48. v-for="act in myActivities"
  49. :key="act.id"
  50. @click="goDetail(act)"
  51. >
  52. <image
  53. class="card-cover"
  54. :src="act.coverImage || '/static/default-activity.png'"
  55. mode="aspectFill"
  56. />
  57. <view class="card-info">
  58. <text class="card-title">{{ act.title }}</text>
  59. <text class="card-meta">{{ act.startTime }}</text>
  60. <text class="card-meta" v-if="act.location">📍 {{ act.location }}</text>
  61. <view class="card-bottom">
  62. <text class="card-status" :class="'status-' + (act._cls || 'upcoming')">
  63. {{ act._txt || '待开始' }}
  64. </text>
  65. <text class="card-price" v-if="act.price > 0">¥{{ formatPrice(act.price) }}</text>
  66. <text class="card-price free" v-else>免费</text>
  67. </view>
  68. <!-- Action buttons for approved status -->
  69. <view
  70. v-if="act.status === 'approved'"
  71. class="card-actions"
  72. >
  73. <button class="btn-cancel" @click.stop="onCancel(act)">取消报名</button>
  74. <button class="btn-checkin" @click.stop="onCheckin(act)">签到</button>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. <!-- Empty state for mine -->
  80. <view class="empty-state" v-else-if="!mineLoading">
  81. <text class="empty-icon">📋</text>
  82. <text class="empty-title">暂无报名的活动</text>
  83. <text class="empty-desc">去发现页探索精彩活动吧</text>
  84. <button class="empty-btn" @click="switchToDiscover">去发现活动</button>
  85. </view>
  86. <!-- Loading state -->
  87. <view class="loading-state" v-if="mineLoading">
  88. <view class="loading-spinner"></view>
  89. <text class="loading-text">加载中...</text>
  90. </view>
  91. <!-- Load more tip -->
  92. <view class="load-more-tip" v-if="myActivities.length > 0 && !hasMore && currentTab === 'mine'">
  93. <text class="load-more-text">没有更多了</text>
  94. </view>
  95. </view>
  96. <!-- Tab 2: discover -->
  97. <view v-if="currentTab === 'discover'">
  98. <!-- Filter chips (dimension) -->
  99. <scroll-view class="filter-scroll" scroll-x enable-flex>
  100. <view class="filter-chips">
  101. <view
  102. class="filter-chip"
  103. :class="{ active: currentDimension === filter.value }"
  104. v-for="filter in dimensionFilters"
  105. :key="filter.value"
  106. @click="onDimensionChange(filter.value)"
  107. >
  108. <text class="filter-label">{{ filter.label }}</text>
  109. </view>
  110. </view>
  111. </scroll-view>
  112. <!-- Activity cards -->
  113. <view class="card-list" v-if="discoverActivities.length > 0">
  114. <view
  115. class="activity-card"
  116. v-for="act in discoverActivities"
  117. :key="act.id"
  118. @click="goDetail(act)"
  119. >
  120. <image
  121. class="card-cover"
  122. :src="act.coverImage || '/static/default-activity.png'"
  123. mode="aspectFill"
  124. />
  125. <view class="card-info">
  126. <text class="card-title">{{ act.title }}</text>
  127. <text class="card-meta">{{ act.startTime }}</text>
  128. <text class="card-meta" v-if="act.location">📍 {{ act.location }}</text>
  129. <view class="card-bottom">
  130. <text class="card-status status-published">进行中</text>
  131. <text class="card-price" v-if="act.price > 0">¥{{ formatPrice(act.price) }}</text>
  132. <text class="card-price free" v-else>免费</text>
  133. </view>
  134. </view>
  135. </view>
  136. </view>
  137. <!-- Empty state for discover -->
  138. <view class="empty-state" v-else-if="!discoverLoading">
  139. <text class="empty-icon">🔍</text>
  140. <text class="empty-title">暂无活动</text>
  141. <text class="empty-desc">稍后再来看看吧</text>
  142. </view>
  143. <!-- Loading state -->
  144. <view class="loading-state" v-if="discoverLoading">
  145. <view class="loading-spinner"></view>
  146. <text class="loading-text">加载中...</text>
  147. </view>
  148. <!-- Load more tip -->
  149. <view class="load-more-tip" v-if="discoverActivities.length > 0 && !hasMore && currentTab === 'discover'">
  150. <text class="load-more-text">没有更多了</text>
  151. </view>
  152. </view>
  153. <!-- Tab 3: history -->
  154. <view v-if="currentTab === 'history'">
  155. <!-- Filter chips (same as mine) -->
  156. <scroll-view class="filter-scroll" scroll-x enable-flex>
  157. <view class="filter-chips">
  158. <view
  159. class="filter-chip"
  160. :class="{ active: currentMineFilter === filter.value }"
  161. v-for="filter in mineFilters"
  162. :key="filter.value"
  163. @click="onMineFilterChange(filter.value)"
  164. >
  165. <text class="filter-label">{{ filter.label }}</text>
  166. </view>
  167. </view>
  168. </scroll-view>
  169. <!-- Activity cards -->
  170. <view class="card-list" v-if="historyActivities.length > 0">
  171. <view
  172. class="activity-card"
  173. v-for="act in historyActivities"
  174. :key="act.id"
  175. @click="goDetail(act)"
  176. >
  177. <image
  178. class="card-cover"
  179. :src="act.coverImage || '/static/default-activity.png'"
  180. mode="aspectFill"
  181. />
  182. <view class="card-info">
  183. <text class="card-title">{{ act.title }}</text>
  184. <text class="card-meta">{{ act.startTime }}</text>
  185. <text class="card-meta" v-if="act.location">📍 {{ act.location }}</text>
  186. <view class="card-bottom">
  187. <text class="card-status status-ended">已结束</text>
  188. <text class="card-price" v-if="act.price > 0">¥{{ formatPrice(act.price) }}</text>
  189. <text class="card-price free" v-else>免费</text>
  190. </view>
  191. </view>
  192. </view>
  193. </view>
  194. <!-- Empty state for history -->
  195. <view class="empty-state" v-else-if="!historyLoading">
  196. <text class="empty-icon">📜</text>
  197. <text class="empty-title">暂无历史活动</text>
  198. <text class="empty-desc">参加过的活动会显示在这里</text>
  199. </view>
  200. <!-- Loading state -->
  201. <view class="loading-state" v-if="historyLoading">
  202. <view class="loading-spinner"></view>
  203. <text class="loading-text">加载中...</text>
  204. </view>
  205. <!-- Load more tip -->
  206. <view class="load-more-tip" v-if="historyActivities.length > 0 && !hasMore && currentTab === 'history'">
  207. <text class="load-more-text">没有更多了</text>
  208. </view>
  209. </view>
  210. </scroll-view>
  211. </view>
  212. </template>
  213. <script>
  214. import { getActivityList, getMyActivityRegistrations, activityCheckin, cancelActivityRegistration } from '@/utils/api.js'
  215. export default {
  216. data() {
  217. return {
  218. tabs: [
  219. { key: 'mine', label: '我的活动' },
  220. { key: 'discover', label: '发现活动' },
  221. { key: 'history', label: '历史记录' }
  222. ],
  223. currentTab: 'mine',
  224. mineFilters: [
  225. { label: '全部', value: '' },
  226. { label: '待开始', value: 'upcoming' },
  227. { label: '待审核', value: 'pending' },
  228. { label: '已签到', value: 'checked_in' }
  229. ],
  230. dimensionFilters: [
  231. { label: '全部', value: '' },
  232. { label: '身', value: 'body' },
  233. { label: '心', value: 'mind' },
  234. { label: '智', value: 'wisdom' },
  235. { label: '行', value: 'action' },
  236. { label: '富', value: 'wealth' }
  237. ],
  238. currentMineFilter: '',
  239. currentDimension: '',
  240. myActivities: [],
  241. discoverActivities: [],
  242. historyActivities: [],
  243. mineLoading: false,
  244. discoverLoading: false,
  245. historyLoading: false,
  246. minePage: 1,
  247. discoverPage: 1,
  248. historyPage: 1,
  249. pageSize: 10,
  250. hasMore: true,
  251. isRefreshing: false
  252. }
  253. },
  254. onLoad: function(options) {
  255. if (options && options.tab) {
  256. this.currentTab = options.tab
  257. this.loadData()
  258. }
  259. },
  260. onShow: function() {
  261. if (this.currentTab === 'mine') {
  262. this.loadMyActivities(true)
  263. }
  264. },
  265. methods: {
  266. onTabChange: function(key) {
  267. this.currentTab = key
  268. this.hasMore = true
  269. if (key === 'mine') {
  270. this.minePage = 1
  271. this.myActivities = []
  272. } else if (key === 'discover') {
  273. this.discoverPage = 1
  274. this.discoverActivities = []
  275. } else if (key === 'history') {
  276. this.historyPage = 1
  277. this.historyActivities = []
  278. }
  279. this.loadData()
  280. },
  281. loadData: function() {
  282. if (this.currentTab === 'mine') {
  283. this.loadMyActivities()
  284. } else if (this.currentTab === 'discover') {
  285. this.loadDiscoverActivities()
  286. } else if (this.currentTab === 'history') {
  287. this.loadHistoryActivities()
  288. }
  289. },
  290. loadMyActivities: function(refresh) {
  291. var self = this
  292. if (refresh) {
  293. this.minePage = 1
  294. this.myActivities = []
  295. }
  296. this.mineLoading = true
  297. var childId = uni.getStorageSync('currentChildId')
  298. if (!childId) {
  299. this.mineLoading = false
  300. return
  301. }
  302. var params = {
  303. childId: childId,
  304. page: this.minePage,
  305. size: this.pageSize
  306. }
  307. if (this.currentMineFilter && this.currentMineFilter !== 'upcoming') {
  308. params.status = this.currentMineFilter
  309. }
  310. getMyActivityRegistrations(params).then(function(res) {
  311. self.mineLoading = false
  312. if (res && res.code === 200 && res.data) {
  313. var records = res.data.records || []
  314. if (self.currentMineFilter === 'upcoming') {
  315. var now = new Date()
  316. var filtered = []
  317. for (var i = 0; i < records.length; i++) {
  318. var act = records[i]
  319. if (act.startTime) {
  320. var startTime = new Date(act.startTime.replace(/-/g, '/'))
  321. if (startTime > now && act.status === 'approved') {
  322. filtered.push(act)
  323. }
  324. }
  325. }
  326. records = filtered
  327. }
  328. for (var di = 0; di < records.length; di++) {
  329. self.decorateActivity(records[di])
  330. }
  331. if (refresh) {
  332. self.myActivities = records
  333. } else {
  334. self.myActivities = self.myActivities.concat(records)
  335. }
  336. self.hasMore = records.length >= self.pageSize
  337. }
  338. }).catch(function() {
  339. self.mineLoading = false
  340. })
  341. },
  342. loadDiscoverActivities: function(refresh) {
  343. var self = this
  344. if (refresh) {
  345. this.discoverPage = 1
  346. this.discoverActivities = []
  347. }
  348. this.discoverLoading = true
  349. var params = {
  350. page: this.discoverPage,
  351. size: this.pageSize
  352. }
  353. if (this.currentDimension) {
  354. params.dimensionCode = this.currentDimension
  355. }
  356. getActivityList(params).then(function(res) {
  357. self.discoverLoading = false
  358. if (res && res.code === 200 && res.data) {
  359. var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
  360. if (refresh) {
  361. self.discoverActivities = list
  362. } else {
  363. self.discoverActivities = self.discoverActivities.concat(list)
  364. }
  365. self.hasMore = list.length >= self.pageSize
  366. }
  367. }).catch(function() {
  368. self.discoverLoading = false
  369. })
  370. },
  371. loadHistoryActivities: function(refresh) {
  372. var self = this
  373. if (refresh) {
  374. this.historyPage = 1
  375. this.historyActivities = []
  376. }
  377. this.historyLoading = true
  378. var childId = uni.getStorageSync('currentChildId')
  379. if (!childId) {
  380. this.historyLoading = false
  381. return
  382. }
  383. var params = {
  384. childId: childId,
  385. page: this.historyPage,
  386. size: this.pageSize
  387. }
  388. getMyActivityRegistrations(params).then(function(res) {
  389. self.historyLoading = false
  390. if (res && res.code === 200 && res.data) {
  391. var records = res.data.records || []
  392. var now = new Date()
  393. var ended = []
  394. for (var i = 0; i < records.length; i++) {
  395. var act = records[i]
  396. if (act.endTime) {
  397. var endTime = new Date(act.endTime.replace(/-/g, '/'))
  398. if (endTime < now || act.status === 'cancelled' || act.status === 'rejected') {
  399. ended.push(act)
  400. }
  401. } else {
  402. ended.push(act)
  403. }
  404. }
  405. if (refresh) {
  406. self.historyActivities = ended
  407. } else {
  408. self.historyActivities = self.historyActivities.concat(ended)
  409. }
  410. self.hasMore = records.length >= self.pageSize
  411. }
  412. }).catch(function() {
  413. self.historyLoading = false
  414. })
  415. },
  416. onMineFilterChange: function(value) {
  417. this.currentMineFilter = value
  418. this.minePage = 1
  419. this.myActivities = []
  420. this.hasMore = true
  421. if (this.currentTab === 'mine') {
  422. this.loadMyActivities()
  423. } else if (this.currentTab === 'history') {
  424. this.loadHistoryActivities()
  425. }
  426. },
  427. onDimensionChange: function(value) {
  428. this.currentDimension = value
  429. this.discoverPage = 1
  430. this.discoverActivities = []
  431. this.hasMore = true
  432. this.loadDiscoverActivities()
  433. },
  434. onLoadMore: function() {
  435. if (!this.hasMore) return
  436. if (this.currentTab === 'mine' && !this.mineLoading) {
  437. this.minePage++
  438. this.loadMyActivities()
  439. } else if (this.currentTab === 'discover' && !this.discoverLoading) {
  440. this.discoverPage++
  441. this.loadDiscoverActivities()
  442. } else if (this.currentTab === 'history' && !this.historyLoading) {
  443. this.historyPage++
  444. this.loadHistoryActivities()
  445. }
  446. },
  447. onRefresh: function() {
  448. var self = this
  449. this.isRefreshing = true
  450. if (this.currentTab === 'mine') {
  451. this.loadMyActivities(true).finally(function() {
  452. self.isRefreshing = false
  453. })
  454. } else if (this.currentTab === 'discover') {
  455. this.loadDiscoverActivities(true).finally(function() {
  456. self.isRefreshing = false
  457. })
  458. } else if (this.currentTab === 'history') {
  459. this.loadHistoryActivities(true).finally(function() {
  460. self.isRefreshing = false
  461. })
  462. } else {
  463. this.isRefreshing = false
  464. }
  465. },
  466. goDetail: function(act) {
  467. uni.navigateTo({ url: '/pages/discover-detail/activity-detail/activity-detail?id=' + act.id })
  468. },
  469. switchToDiscover: function() {
  470. this.currentTab = 'discover'
  471. this.loadData()
  472. },
  473. getStatusClass: function(act) {
  474. if (!act.status) {
  475. if (act.endTime) {
  476. var endTime = new Date(act.endTime.replace(/-/g, '/'))
  477. if (endTime < new Date()) {
  478. return 'status-ended'
  479. }
  480. }
  481. return 'status-upcoming'
  482. }
  483. return 'status-' + act.status
  484. },
  485. getStatusText: function(act) {
  486. var statusMap = {
  487. pending: '待审核',
  488. approved: '报名成功',
  489. rejected: '已拒绝',
  490. cancelled: '已取消',
  491. checked_in: '已签到'
  492. }
  493. if (!act.status) {
  494. if (act.endTime) {
  495. var endTime = new Date(act.endTime.replace(/-/g, '/'))
  496. if (endTime < new Date()) {
  497. return '已结束'
  498. }
  499. }
  500. return '待开始'
  501. }
  502. return statusMap[act.status] || act.status
  503. },
  504. formatPrice: function(price) {
  505. return (price / 100).toFixed(2)
  506. },
  507. // Pre-compute display properties for WXML compatibility (no method calls in :class)
  508. decorateActivity: function(act) {
  509. if (act.status) {
  510. act._cls = act.status
  511. var map = { pending: '待审核', approved: '报名成功', rejected: '已拒绝', cancelled: '已取消', checked_in: '已签到' }
  512. act._txt = map[act.status] || act.status
  513. } else {
  514. if (act.endTime) {
  515. var endTime = new Date(act.endTime.replace(/-/g, '/'))
  516. if (endTime < new Date()) {
  517. act._cls = 'ended'
  518. act._txt = '已结束'
  519. return act
  520. }
  521. }
  522. act._cls = 'upcoming'
  523. act._txt = '待开始'
  524. }
  525. return act
  526. },
  527. onCheckin: function(act) {
  528. var self = this
  529. var childId = uni.getStorageSync('currentChildId')
  530. if (!childId) {
  531. uni.showToast({ title: '请先选择孩子身份', icon: 'none' })
  532. return
  533. }
  534. activityCheckin({ id: act.activityId || act.id, childId: childId }).then(function(res) {
  535. if (res && res.code === 200) {
  536. uni.showToast({ title: '签到成功', icon: 'success' })
  537. self.loadMyActivities(true)
  538. } else {
  539. uni.showToast({ title: (res && res.message) || '签到失败', icon: 'none' })
  540. }
  541. }).catch(function() {
  542. uni.showToast({ title: '网络异常', icon: 'none' })
  543. })
  544. },
  545. onCancel: function(act) {
  546. var self = this
  547. uni.showModal({
  548. title: '提示',
  549. content: '确定要取消报名吗?',
  550. success: function(res) {
  551. if (res.confirm) {
  552. var childId = uni.getStorageSync('currentChildId')
  553. if (!childId) {
  554. uni.showToast({ title: '请先选择孩子身份', icon: 'none' })
  555. return
  556. }
  557. cancelActivityRegistration({ id: act.activityId || act.id, childId: childId }).then(function(res) {
  558. if (res && res.code === 200) {
  559. uni.showToast({ title: '已取消报名', icon: 'success' })
  560. self.loadMyActivities(true)
  561. } else {
  562. uni.showToast({ title: (res && res.message) || '取消失败', icon: 'none' })
  563. }
  564. }).catch(function() {
  565. uni.showToast({ title: '网络异常', icon: 'none' })
  566. })
  567. }
  568. }
  569. })
  570. }
  571. }
  572. }
  573. </script>
  574. <style scoped>
  575. .activity-container {
  576. min-height: 100vh;
  577. background: #F5F5F5;
  578. display: flex;
  579. flex-direction: column;
  580. }
  581. .nav-bar {
  582. background: #1A0F00;
  583. padding: 20rpx 0;
  584. text-align: center;
  585. }
  586. .nav-title {
  587. color: #fff;
  588. font-size: 32rpx;
  589. font-weight: 600;
  590. }
  591. .tab-bar {
  592. background: #fff;
  593. display: flex;
  594. flex-direction: row;
  595. border-bottom: 1rpx solid #eee;
  596. }
  597. .tab-item {
  598. flex: 1;
  599. padding: 24rpx 0;
  600. text-align: center;
  601. border-bottom: 4rpx solid transparent;
  602. }
  603. .tab-item.active {
  604. border-bottom-color: #F97316;
  605. }
  606. .tab-label {
  607. font-size: 28rpx;
  608. color: #666;
  609. }
  610. .tab-item.active .tab-label {
  611. color: #F97316;
  612. font-weight: 600;
  613. }
  614. .content-scroll {
  615. flex: 1;
  616. height: calc(100vh - 200rpx);
  617. }
  618. .filter-scroll {
  619. padding: 20rpx 24rpx;
  620. background: #fff;
  621. }
  622. .filter-chips {
  623. display: flex;
  624. flex-direction: row;
  625. gap: 16rpx;
  626. }
  627. .filter-chip {
  628. padding: 12rpx 24rpx;
  629. border-radius: 16px;
  630. background: #fff;
  631. border: 1rpx solid #ddd;
  632. flex-shrink: 0;
  633. }
  634. .filter-chip.active {
  635. background: #FFF7ED;
  636. border-color: #F97316;
  637. }
  638. .filter-label {
  639. font-size: 24rpx;
  640. color: #666;
  641. }
  642. .filter-chip.active .filter-label {
  643. color: #F97316;
  644. font-weight: 500;
  645. }
  646. .card-list {
  647. padding: 0 24rpx 24rpx;
  648. display: flex;
  649. flex-direction: column;
  650. gap: 20rpx;
  651. }
  652. .activity-card {
  653. background: #fff;
  654. border-radius: 12rpx;
  655. padding: 20rpx;
  656. display: flex;
  657. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
  658. }
  659. .card-cover {
  660. width: 144rpx;
  661. height: 144rpx;
  662. border-radius: 8rpx;
  663. flex-shrink: 0;
  664. background: #f0f0f0;
  665. }
  666. .card-info {
  667. flex: 1;
  668. margin-left: 20rpx;
  669. display: flex;
  670. flex-direction: column;
  671. }
  672. .card-title {
  673. font-size: 28rpx;
  674. font-weight: 600;
  675. color: #333;
  676. line-height: 1.4;
  677. overflow: hidden;
  678. text-overflow: ellipsis;
  679. white-space: nowrap;
  680. }
  681. .card-meta {
  682. font-size: 24rpx;
  683. color: #999;
  684. margin-top: 8rpx;
  685. }
  686. .card-bottom {
  687. display: flex;
  688. flex-direction: row;
  689. align-items: center;
  690. justify-content: space-between;
  691. margin-top: auto;
  692. padding-top: 12rpx;
  693. }
  694. .card-status {
  695. font-size: 22rpx;
  696. padding: 4rpx 12rpx;
  697. border-radius: 6rpx;
  698. }
  699. .status-pending {
  700. background: #FFF7ED;
  701. color: #F97316;
  702. }
  703. .status-approved {
  704. background: #F0FDF4;
  705. color: #22C55E;
  706. }
  707. .status-rejected {
  708. background: #FEF2F2;
  709. color: #EF4444;
  710. }
  711. .status-cancelled {
  712. background: #F5F5F5;
  713. color: #999;
  714. }
  715. .status-checked_in {
  716. background: #DBEAFE;
  717. color: #3B82F6;
  718. }
  719. .status-upcoming {
  720. background: #FFF7ED;
  721. color: #F97316;
  722. }
  723. .status-ended {
  724. background: #F5F5F5;
  725. color: #999;
  726. }
  727. .status-published {
  728. background: #F0FDF4;
  729. color: #22C55E;
  730. }
  731. .card-price {
  732. font-size: 28rpx;
  733. color: #F97316;
  734. font-weight: 600;
  735. }
  736. .card-price.free {
  737. color: #22C55E;
  738. }
  739. .card-actions {
  740. display: flex;
  741. flex-direction: row;
  742. gap: 12rpx;
  743. margin-top: 12rpx;
  744. }
  745. .btn-cancel {
  746. padding: 8rpx 20rpx;
  747. font-size: 22rpx;
  748. color: #999;
  749. background: #fff;
  750. border: 1rpx solid #ddd;
  751. border-radius: 20rpx;
  752. line-height: 1.5;
  753. }
  754. .btn-checkin {
  755. padding: 8rpx 20rpx;
  756. font-size: 22rpx;
  757. color: #fff;
  758. background: linear-gradient(135deg, #F97316, #FB923C);
  759. border: none;
  760. border-radius: 20rpx;
  761. line-height: 1.5;
  762. }
  763. .empty-state {
  764. display: flex;
  765. flex-direction: column;
  766. align-items: center;
  767. justify-content: center;
  768. padding: 120rpx 40rpx;
  769. }
  770. .empty-icon {
  771. font-size: 80rpx;
  772. margin-bottom: 20rpx;
  773. }
  774. .empty-title {
  775. font-size: 32rpx;
  776. font-weight: 600;
  777. color: #333;
  778. margin-bottom: 12rpx;
  779. }
  780. .empty-desc {
  781. font-size: 26rpx;
  782. color: #999;
  783. margin-bottom: 40rpx;
  784. }
  785. .empty-btn {
  786. padding: 16rpx 48rpx;
  787. font-size: 28rpx;
  788. color: #fff;
  789. background: linear-gradient(135deg, #F97316, #FB923C);
  790. border: none;
  791. border-radius: 40rpx;
  792. }
  793. .loading-state {
  794. display: flex;
  795. flex-direction: column;
  796. align-items: center;
  797. justify-content: center;
  798. padding: 80rpx 40rpx;
  799. }
  800. .loading-spinner {
  801. width: 60rpx;
  802. height: 60rpx;
  803. border: 4rpx solid #FDE68A;
  804. border-top-color: #F97316;
  805. border-radius: 50%;
  806. animation: spin 0.8s linear infinite;
  807. margin-bottom: 20rpx;
  808. }
  809. @keyframes spin {
  810. to { transform: rotate(360deg); }
  811. }
  812. .loading-text {
  813. font-size: 26rpx;
  814. color: #999;
  815. }
  816. .load-more-tip {
  817. text-align: center;
  818. padding: 30rpx;
  819. }
  820. .load-more-text {
  821. font-size: 24rpx;
  822. color: #999;
  823. }
  824. </style>