checkin.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. <template>
  2. <!-- iOS 修复:scroll-view 内部的 position:fixed 元素在 iOS 上不生效,
  3. 需将 fixed 元素(.dialog-mask / .energy-animation)移出 scroll-view,
  4. 作为 scroll-view 的同级兄弟节点,参考 cart.vue / product-detail.vue 布局 -->
  5. <view class="page" :style="{ '--font-scale': fontScale }">
  6. <scroll-view class="container" scroll-y>
  7. <!-- 顶部能量提示 -->
  8. <view class="energy-tip">
  9. <text class="energy-tip-text">⚡ 每次打卡可获得 5 财富能量</text>
  10. <text class="energy-tip-sub">坚持打卡,养成理财好习惯</text>
  11. </view>
  12. <!-- 当月日历打卡 -->
  13. <view class="calendar-card">
  14. <view class="calendar-header">
  15. <text class="calendar-title">{{ currentYear }}年{{ currentMonth }}月</text>
  16. <view class="calendar-nav">
  17. <text class="nav-btn" @click="changeMonth(-1)">‹</text>
  18. <text class="nav-btn" @click="changeMonth(1)">›</text>
  19. </view>
  20. </view>
  21. <view class="calendar-weekdays">
  22. <text class="weekday" v-for="(w, i) in weekdays" :key="i">{{ w }}</text>
  23. </view>
  24. <view class="calendar-days">
  25. <view class="day-cell empty" v-for="(e, i) in emptyDays" :key="getEmptyKey(i)"></view>
  26. <view
  27. v-for="(day, i) in daysInMonth"
  28. :key="i"
  29. class="day-cell"
  30. :class="{
  31. checked: checkinDates[day],
  32. today: day === currentDay && currentMonth === realMonth && currentYear === realYear
  33. }"
  34. @click="onDayClick(day)">
  35. <text class="day-num">{{ day }}</text>
  36. <text class="day-dot" v-if="checkinDates[day]">●</text>
  37. </view>
  38. </view>
  39. <view class="calendar-stats">
  40. <text>本月打卡 <text class="stat-highlight">{{ checkinDaysThisMonth }}</text> 天</text>
  41. <text>连续 <text class="stat-highlight">{{ streakDays }}</text> 天</text>
  42. </view>
  43. </view>
  44. <!-- 快速打卡 -->
  45. <view class="quick-checkin">
  46. <view class="section-title-row">
  47. <text class="section-title">快速打卡</text>
  48. <text class="section-subtitle">今日已打卡 {{ todayCount }} 次</text>
  49. </view>
  50. <view class="checkin-types">
  51. <view
  52. v-for="(item, index) in checkinTypes"
  53. :key="index"
  54. class="checkin-btn"
  55. :class="{ disabled: item.disabled }"
  56. @click="showCheckinDialog(item.type)">
  57. <text class="checkin-icon">{{ item.icon }}</text>
  58. <text class="checkin-label">{{ item.label }}</text>
  59. </view>
  60. </view>
  61. </view>
  62. <!-- 统计卡片 -->
  63. <view class="stats-card">
  64. <view class="stat-item">
  65. <text class="stat-value">{{ stats.totalCheckins || 0 }}</text>
  66. <text class="stat-label">总打卡</text>
  67. </view>
  68. <view class="stat-divider"></view>
  69. <view class="stat-item">
  70. <text class="stat-value">{{ stats.totalEnergy || 0 }}</text>
  71. <text class="stat-label">总能量</text>
  72. </view>
  73. <view class="stat-divider"></view>
  74. <view class="stat-item">
  75. <text class="stat-value">{{ stats.dailyPlanCount || 0 }}</text>
  76. <text class="stat-label">规划</text>
  77. </view>
  78. <view class="stat-divider"></view>
  79. <view class="stat-item">
  80. <text class="stat-value">{{ stats.savingCount || 0 }}</text>
  81. <text class="stat-label">储蓄</text>
  82. </view>
  83. </view>
  84. <!-- 打卡记录 -->
  85. <view class="record-section">
  86. <view class="section-title-row">
  87. <text class="section-title">打卡记录</text>
  88. <text class="section-subtitle" @click="toggleRecords">
  89. {{ showAllRecords ? '收起' : '查看全部' }}
  90. </text>
  91. </view>
  92. <view v-if="displayRecords.length === 0" class="empty-state">
  93. <text class="empty-icon">📝</text>
  94. <text class="empty-text">暂无打卡记录,开始打卡吧!</text>
  95. </view>
  96. <view
  97. v-for="(item, index) in displayRecords"
  98. :key="index"
  99. class="record-item"
  100. @longpress="confirmDelete(item)">
  101. <view class="record-left">
  102. <text class="record-icon">{{ getTypeIcon(item.checkinType) }}</text>
  103. <view class="record-info">
  104. <text class="record-type">{{ getTypeLabel(item.checkinType) }}</text>
  105. <text class="record-date">{{ formatDate(item.createdAt) }}</text>
  106. <text class="record-note" v-if="item.note">{{ item.note }}</text>
  107. </view>
  108. </view>
  109. <view class="record-right">
  110. <text class="record-energy">+{{ item.earnedEnergy || 5 }}</text>
  111. <text class="record-mood" v-if="item.mood">{{ item.mood }}</text>
  112. </view>
  113. </view>
  114. </view>
  115. </scroll-view>
  116. <!-- 打卡弹窗 -->
  117. <view class="dialog-mask" v-if="showDialog" @click="closeDialog">
  118. <view class="dialog-card" @click.stop>
  119. <text class="dialog-title">{{ dialogType ? getTypeLabel(dialogType) : '' }}打卡</text>
  120. <view class="dialog-form">
  121. <view class="form-item">
  122. <text class="form-label">金额(选填)</text>
  123. <input class="form-input" type="digit" v-model="formAmount" placeholder="输入金额" />
  124. </view>
  125. <view class="form-item">
  126. <text class="form-label">分类</text>
  127. <picker class="form-picker" mode="selector" :range="categoryOptions" @change="onCategoryChange">
  128. <text class="picker-text">{{ formCategory || '选择分类' }}</text>
  129. </picker>
  130. </view>
  131. <view class="form-item">
  132. <text class="form-label">备注</text>
  133. <input class="form-input" type="text" v-model="formNote" placeholder="备注信息" />
  134. </view>
  135. <view class="form-item">
  136. <text class="form-label">心情</text>
  137. <view class="mood-picker">
  138. <text
  139. v-for="(m, i) in moodOptions"
  140. :key="i"
  141. class="mood-item"
  142. :class="{ selected: formMood === m.value }"
  143. @click="selectMood(m.value)">{{ m.icon }}</text>
  144. </view>
  145. </view>
  146. </view>
  147. <view class="dialog-actions">
  148. <button class="dialog-btn cancel" @click="closeDialog">取消</button>
  149. <button class="dialog-btn confirm" @click="doCheckin">确认打卡</button>
  150. </view>
  151. </view>
  152. </view>
  153. <!-- 能量奖励动画 -->
  154. <view class="energy-animation" v-if="showEnergyAnim">
  155. <text class="energy-anim-text">+{{ earnedEnergy }} ⚡</text>
  156. </view>
  157. </view>
  158. </template>
  159. <script>
  160. import { getCheckinList, getCheckinStats, createCheckin, deleteCheckin } from '../../utils/api'
  161. import { parseDate } from '../../utils/format'
  162. import fontScaleMixin from '@/mixins/font-scale.js'
  163. export default {
  164. mixins: [fontScaleMixin],
  165. data() {
  166. return {
  167. checkinTypes: [
  168. { type: 'daily_plan', label: '记账规划', icon: '📋' },
  169. { type: 'saving', label: '储蓄记录', icon: '💰' },
  170. { type: 'expense', label: '消费记录', icon: '🛒' },
  171. { type: 'review', label: '财务回顾', icon: '📊' }
  172. ],
  173. checkins: [],
  174. stats: {},
  175. todayCount: 0,
  176. todayTimer: null,
  177. // 日历
  178. currentYear: 0,
  179. currentMonth: 0,
  180. realMonth: 0,
  181. realYear: 0,
  182. currentDay: 0,
  183. weekdays: ['日', '一', '二', '三', '四', '五', '六'],
  184. checkinDates: {},
  185. streakDays: 0,
  186. // 弹窗
  187. showDialog: false,
  188. dialogType: '',
  189. formAmount: '',
  190. formCategory: '',
  191. formNote: '',
  192. formMood: '',
  193. categoryOptions: ['日常', '餐饮', '交通', '购物', '娱乐', '教育', '医疗', '其他'],
  194. moodOptions: [
  195. { icon: '😊', value: 'happy' },
  196. { icon: '😐', value: 'neutral' },
  197. { icon: '😔', value: 'sad' },
  198. { icon: '😤', value: 'angry' },
  199. { icon: '🎉', value: 'excited' }
  200. ],
  201. // 能量动画
  202. showEnergyAnim: false,
  203. earnedEnergy: 5,
  204. showAllRecords: false,
  205. memberId: null
  206. }
  207. },
  208. computed: {
  209. daysInMonth: function() {
  210. return new Date(this.currentYear, this.currentMonth, 0).getDate()
  211. },
  212. emptyDays: function() {
  213. var firstDay = new Date(this.currentYear, this.currentMonth - 1, 1).getDay()
  214. return firstDay
  215. },
  216. checkinDaysThisMonth: function() {
  217. return Object.keys(this.checkinDates).length
  218. },
  219. displayRecords: function() {
  220. if (this.showAllRecords) return this.checkins
  221. return this.checkins.slice(0, 10)
  222. }
  223. },
  224. onShow() {
  225. var now = new Date()
  226. this.currentYear = now.getFullYear()
  227. this.currentMonth = now.getMonth() + 1
  228. this.realMonth = this.currentMonth
  229. this.realYear = this.currentYear
  230. this.currentDay = now.getDate()
  231. this.memberId = this.$route && this.$route.query && this.$route.query.memberId
  232. this.loadData()
  233. this.loadCalendarData()
  234. },
  235. methods: {
  236. async loadData() {
  237. try {
  238. var params = {}
  239. if (this.memberId) params.memberId = this.memberId
  240. var res = await getCheckinList(params)
  241. if (res && res.code === 200) {
  242. this.checkins = res.data || []
  243. }
  244. var statsRes = await getCheckinStats(params)
  245. if (statsRes && statsRes.code === 200) {
  246. this.stats = statsRes.data || {}
  247. }
  248. this.calcTodayCount()
  249. } catch (e) {
  250. console.error('加载打卡数据失败', e)
  251. }
  252. },
  253. async loadCalendarData() {
  254. try {
  255. var ym = this.currentYear + '-' + (this.currentMonth < 10 ? '0' : '') + this.currentMonth
  256. var params = { yearMonth: ym }
  257. if (this.memberId) params.memberId = this.memberId
  258. var res = await getCheckinList(params)
  259. if (res && res.code === 200) {
  260. var list = res.data || []
  261. var dates = {}
  262. for (var i = 0; i < list.length; i++) {
  263. var d = list[i]
  264. if (d.checkinDate) {
  265. var day = parseInt(d.checkinDate.substring(8, 10))
  266. dates[day] = true
  267. }
  268. }
  269. this.checkinDates = dates
  270. this.calcStreak(list)
  271. }
  272. } catch (e) {
  273. console.error('加载日历数据失败', e)
  274. }
  275. },
  276. calcStreak: function(list) {
  277. if (!list || list.length === 0) { this.streakDays = 0; return }
  278. var dates = []
  279. for (var i = 0; i < list.length; i++) {
  280. if (list[i].checkinDate) dates.push(list[i].checkinDate)
  281. }
  282. dates.sort().reverse()
  283. var streak = 0
  284. var today = new Date()
  285. var checkDate = new Date(today.getFullYear(), today.getMonth(), today.getDate())
  286. for (var j = 0; j < dates.length; j++) {
  287. var d = parseDate(dates[j])
  288. if (!d) continue
  289. var diff = Math.round((checkDate - d) / 86400000)
  290. if (diff === streak) {
  291. streak++
  292. } else if (diff > streak) {
  293. break
  294. }
  295. }
  296. this.streakDays = streak
  297. },
  298. calcTodayCount: function() {
  299. var today = new Date()
  300. var todayStr = today.toISOString().split('T')[0]
  301. this.todayCount = this.checkins.filter(function(c) {
  302. if (!c.createdAt) return false
  303. return c.createdAt.indexOf(todayStr) === 0
  304. }).length
  305. },
  306. changeMonth: function(delta) {
  307. this.currentMonth += delta
  308. if (this.currentMonth > 12) { this.currentMonth = 1; this.currentYear++ }
  309. if (this.currentMonth < 1) { this.currentMonth = 12; this.currentYear-- }
  310. this.loadCalendarData()
  311. },
  312. onDayClick: function(day) {
  313. // 点击日期跳转到当天或者查看记录
  314. },
  315. toggleRecords: function() {
  316. this.showAllRecords = !this.showAllRecords
  317. },
  318. selectMood: function(value) {
  319. this.formMood = value
  320. },
  321. closeDialog: function() {
  322. this.showDialog = false
  323. },
  324. showCheckinDialog: function(type) {
  325. this.dialogType = type
  326. this.formAmount = ''
  327. this.formCategory = ''
  328. this.formNote = ''
  329. this.formMood = ''
  330. this.showDialog = true
  331. },
  332. onCategoryChange: function(e) {
  333. this.formCategory = this.categoryOptions[e.detail.value]
  334. },
  335. async doCheckin() {
  336. if (this.todayTimer) {
  337. uni.showToast({ title: '操作太频繁,请稍后', icon: 'none' })
  338. return
  339. }
  340. this.todayTimer = setTimeout(function() { this.todayTimer = null }.bind(this), 3000)
  341. var params = {
  342. checkinType: this.dialogType,
  343. checkinDate: new Date().toISOString().split('T')[0],
  344. earnedEnergy: 5
  345. }
  346. if (this.memberId) params.memberId = this.memberId
  347. if (this.formAmount) params.amount = parseInt(this.formAmount)
  348. if (this.formCategory) params.category = this.formCategory
  349. if (this.formNote) params.note = this.formNote
  350. if (this.formMood) params.mood = this.formMood
  351. try {
  352. var res = await createCheckin(params)
  353. if (res && res.code === 200) {
  354. this.showDialog = false
  355. this.earnedEnergy = 5
  356. this.showEnergyAnim = true
  357. setTimeout(function() { this.showEnergyAnim = false }.bind(this), 1500)
  358. uni.showToast({ title: '打卡成功!+5能量', icon: 'success' })
  359. this.loadData()
  360. this.loadCalendarData()
  361. } else {
  362. uni.showToast({ title: res && res.message || '打卡失败', icon: 'none' })
  363. }
  364. } catch (e) {
  365. uni.showToast({ title: '网络错误', icon: 'none' })
  366. }
  367. },
  368. confirmDelete: function(item) {
  369. var self = this
  370. uni.showModal({
  371. title: '提示',
  372. content: '确定删除此打卡记录?',
  373. success: function(res) {
  374. if (res.confirm) self.deleteRecord(item)
  375. }
  376. })
  377. },
  378. async deleteRecord(item) {
  379. try {
  380. var res = await deleteCheckin(item.id)
  381. if (res && res.code === 200) {
  382. uni.showToast({ title: '已删除', icon: 'success' })
  383. this.loadData()
  384. this.loadCalendarData()
  385. }
  386. } catch (e) {
  387. console.error('删除失败', e)
  388. }
  389. },
  390. getTypeIcon: function(type) {
  391. var map = { daily_plan: '📋', saving: '💰', expense: '🛒', review: '📊' }
  392. return map[type] || '📌'
  393. },
  394. getTypeLabel: function(type) {
  395. var map = { daily_plan: '记账规划', saving: '储蓄记录', expense: '消费记录', review: '财务回顾' }
  396. return map[type] || type
  397. },
  398. formatDate: function(dateStr) {
  399. if (!dateStr) return ''
  400. return dateStr.substring(0, 16).replace('T', ' ')
  401. },
  402. getEmptyKey: function(i) {
  403. return 'e' + i
  404. }
  405. }
  406. }
  407. </script>
  408. <style lang="scss">
  409. .container { min-height: 100vh; background: $app-bg; padding: 20rpx $uni-space-page 120rpx; width: 100%; box-sizing: border-box; overflow-x: hidden; }
  410. /* 能量提示 */
  411. .energy-tip {
  412. background: linear-gradient(135deg, $dim-wealth, $brand-primary);
  413. border-radius: 24rpx; padding: 24rpx $uni-space-page; margin-bottom: 24rpx;
  414. }
  415. .energy-tip-text { color: $app-surface; font-size: calc(28rpx * var(--font-scale, 1)); font-weight: 600; }
  416. .energy-tip-sub { color: rgba(255,255,255,0.8); font-size: calc(22rpx * var(--font-scale, 1)); margin-top: 6rpx; }
  417. /* 日历 */
  418. .calendar-card {
  419. background: $app-surface; border-radius: 24rpx; padding: 24rpx; margin-bottom: 24rpx;
  420. }
  421. .calendar-header {
  422. display: flex; justify-content: space-between; align-items: center; margin-bottom: 20rpx;
  423. }
  424. .calendar-title { font-size: calc(32rpx * var(--font-scale, 1)); font-weight: 700; color: $facade-text-strong; }
  425. .nav-btn { font-size: calc(40rpx * var(--font-scale, 1)); color: $brand-primary; padding: 0 16rpx; }
  426. .calendar-weekdays {
  427. display: flex; flex-direction: row; margin-bottom: 12rpx;
  428. }
  429. .weekday { width: 14.28%; text-align: center; font-size: calc(24rpx * var(--font-scale, 1)); color: $facade-text-muted; }
  430. .calendar-days { display: flex; flex-direction: row; flex-wrap: wrap; }
  431. .day-cell {
  432. width: 14.28%; height: 72rpx; display: flex; flex-direction: column;
  433. align-items: center; justify-content: center; position: relative;
  434. }
  435. .day-cell.today .day-num {
  436. background: $brand-primary; color: $app-surface; border-radius: 50%;
  437. width: 48rpx; height: 48rpx; text-align: center; line-height: 48rpx;
  438. }
  439. .day-num { font-size: calc(26rpx * var(--font-scale, 1)); color: $facade-text-strong; }
  440. .day-dot { font-size: calc(16rpx * var(--font-scale, 1)); color: $brand-primary; position: absolute; bottom: 4rpx; }
  441. .day-cell.empty { height: 72rpx; }
  442. .calendar-stats {
  443. display: flex; justify-content: space-between; margin-top: 16rpx;
  444. padding-top: 16rpx; border-top: 2rpx solid $facade-fill-2;
  445. font-size: calc(24rpx * var(--font-scale, 1)); color: $facade-text-muted;
  446. }
  447. .stat-highlight { color: $brand-primary; font-weight: 700; font-size: calc(28rpx * var(--font-scale, 1)); }
  448. /* 快速打卡 */
  449. .quick-checkin { background: $app-surface; border-radius: 24rpx; padding: 24rpx; margin-bottom: 24rpx; }
  450. .section-title-row {
  451. display: flex; justify-content: space-between; align-items: center; margin-bottom: 20rpx;
  452. }
  453. .section-title { font-size: calc(30rpx * var(--font-scale, 1)); font-weight: 700; color: $facade-text-strong; }
  454. .section-subtitle { font-size: calc(22rpx * var(--font-scale, 1)); color: $facade-text-muted; }
  455. .checkin-types { display: flex; flex-direction: row; justify-content: space-between; }
  456. .checkin-btn {
  457. display: flex; flex-direction: column; align-items: center; justify-content: center;
  458. width: 150rpx; height: 130rpx; background: $dim-wealth-tint; border-radius: 16rpx;
  459. border: 2rpx solid $status-warning-light;
  460. }
  461. .checkin-btn:active { background: $status-warning-soft; }
  462. .checkin-btn.disabled { opacity: 0.5; }
  463. .checkin-icon { font-size: calc(44rpx * var(--font-scale, 1)); margin-bottom: 8rpx; }
  464. .checkin-label { font-size: calc(24rpx * var(--font-scale, 1)); color: $status-warning-strong; font-weight: 500; }
  465. /* 统计 */
  466. .stats-card {
  467. background: $app-surface; border-radius: 24rpx; padding: 24rpx;
  468. display: flex; flex-direction: row; justify-content: space-around;
  469. align-items: center; margin-bottom: 24rpx;
  470. }
  471. .stat-item { display: flex; flex-direction: column; align-items: center; }
  472. .stat-value { font-size: calc(38rpx * var(--font-scale, 1)); font-weight: 700; color: $dim-wealth; }
  473. .stat-label { font-size: calc(22rpx * var(--font-scale, 1)); color: $facade-text-muted; margin-top: 4rpx; }
  474. .stat-divider { width: 2rpx; height: 60rpx; background: $facade-hairline-2; }
  475. /* 记录 */
  476. .record-section { background: $app-surface; border-radius: 24rpx; padding: 24rpx; }
  477. .empty-state { text-align: center; padding: 48rpx 0; }
  478. .empty-icon { font-size: calc(48rpx * var(--font-scale, 1)); }
  479. .empty-text { color: $facade-text-muted; font-size: calc(26rpx * var(--font-scale, 1)); margin-top: 12rpx; }
  480. .record-item {
  481. display: flex; flex-direction: row; justify-content: space-between;
  482. align-items: center; padding: 20rpx 0; border-bottom: 2rpx solid $facade-fill-2;
  483. }
  484. .record-item:last-child { border-bottom: none; }
  485. .record-left { display: flex; flex-direction: row; align-items: center; flex: 1; }
  486. .record-icon { font-size: calc(36rpx * var(--font-scale, 1)); margin-right: 16rpx; }
  487. .record-info { display: flex; flex-direction: column; }
  488. .record-type { font-size: calc(28rpx * var(--font-scale, 1)); color: $facade-text-strong; font-weight: 500; }
  489. .record-date { font-size: calc(22rpx * var(--font-scale, 1)); color: $facade-text-muted; margin-top: 2rpx; }
  490. .record-note { font-size: calc(22rpx * var(--font-scale, 1)); color: $facade-text-body; margin-top: 2rpx; max-width: 300rpx; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  491. .record-right { display: flex; flex-direction: column; align-items: flex-end; }
  492. .record-energy { font-size: calc(28rpx * var(--font-scale, 1)); color: $dim-wealth; font-weight: 700; }
  493. .record-mood { font-size: calc(28rpx * var(--font-scale, 1)); margin-top: 4rpx; }
  494. /* 打卡弹窗 */
  495. .dialog-mask {
  496. position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  497. background: rgba(0,0,0,0.5); z-index: 999; display: flex;
  498. align-items: center; justify-content: center;
  499. }
  500. .dialog-card {
  501. background: $app-surface; border-radius: 24rpx; width: 620rpx; padding: 32rpx;
  502. }
  503. .dialog-title { font-size: calc(34rpx * var(--font-scale, 1)); font-weight: 700; color: $facade-text-strong; text-align: center; margin-bottom: 28rpx; }
  504. .form-item { margin-bottom: 24rpx; }
  505. .form-label { font-size: calc(26rpx * var(--font-scale, 1)); color: $facade-text-body; margin-bottom: 8rpx; display: block; }
  506. .form-input {
  507. border: 2rpx solid $facade-gray-200; border-radius: 16rpx; padding: 28rpx 20rpx;
  508. font-size: calc(28rpx * var(--font-scale, 1)); width: 100%; box-sizing: border-box; min-height: 80rpx;
  509. }
  510. .form-picker {
  511. border: 2rpx solid $facade-gray-200; border-radius: 16rpx; padding: 28rpx 20rpx;
  512. font-size: calc(26rpx * var(--font-scale, 1)); color: $facade-text-strong; min-height: 80rpx; display: flex; align-items: center;
  513. }
  514. .picker-text { color: $facade-text-strong; }
  515. .mood-picker { display: flex; flex-direction: row; gap: 16rpx; }
  516. .mood-item { font-size: calc(44rpx * var(--font-scale, 1)); padding: 8rpx; border-radius: 16rpx; border: 2rpx solid transparent; }
  517. .mood-item.selected { border-color: $dim-wealth; background: $dim-wealth-tint; }
  518. .dialog-actions { display: flex; flex-direction: row; gap: 20rpx; margin-top: 32rpx; }
  519. .dialog-btn { flex: 1; padding: 20rpx; border-radius: 16rpx; font-size: calc(28rpx * var(--font-scale, 1)); text-align: center; }
  520. .dialog-btn.cancel { background: $facade-fill-2; color: $facade-text-body; }
  521. .dialog-btn.confirm { background: linear-gradient(135deg, $dim-wealth, $brand-primary); color: $app-surface; }
  522. /* 能量动画 */
  523. .energy-animation {
  524. position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  525. z-index: 1000; pointer-events: none;
  526. }
  527. .energy-anim-text {
  528. font-size: calc($uni-font-size-5xl * var(--font-scale, 1)); font-weight: $uni-font-weight-black-extra; color: $dim-wealth;
  529. text-shadow: 0 4rpx 20rpx rgba(245,158,11,0.5);
  530. animation: floatUp 1.5s ease-out forwards;
  531. }
  532. @keyframes floatUp {
  533. 0% { opacity: 1; transform: scale(0.5); }
  534. 50% { opacity: 1; transform: scale(1.2); }
  535. 100% { opacity: 0; transform: translateY(-200rpx) scale(1); }
  536. }
  537. </style>