FamilyTianpanCard.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788
  1. <template>
  2. <!-- 家庭天盘卡片 — 心维度专属 (#FF6B9D 火) -->
  3. <view class="tianpan-card" v-if="visible" :style="themeStyle">
  4. <!-- 卡片头部 -->
  5. <view class="tp-header">
  6. <view class="tp-header-left">
  7. <view class="tp-icon-badge">
  8. <text class="tp-icon-text">&#x2637;</text>
  9. </view>
  10. <view class="tp-header-info">
  11. <text class="tp-title">家庭天盘</text>
  12. <text class="tp-subtitle">五行能量 · 每日更新</text>
  13. </view>
  14. </view>
  15. <view class="tp-header-action" @click="goDetail">
  16. <text class="tp-action-text">&#x2192;</text>
  17. </view>
  18. </view>
  19. <!-- 三栏展示 -->
  20. <view class="tp-body">
  21. <!-- 今日运势 -->
  22. <view class="tp-col tp-col-fortune">
  23. <text class="tp-col-icon">&#x2B50;</text>
  24. <text class="tp-col-label">今日运势</text>
  25. <view class="tp-fortune-badge" :class="'fortune-level-' + fortuneLevel">
  26. <text class="tp-fortune-text">{{ fortuneText }}</text>
  27. </view>
  28. <text class="tp-fortune-desc">{{ fortuneDesc }}</text>
  29. </view>
  30. <!-- 今日心情 -->
  31. <view class="tp-col tp-col-mood">
  32. <text class="tp-col-icon">{{ moodEmoji }}</text>
  33. <text class="tp-col-label">今日心情</text>
  34. <text class="tp-mood-value">{{ moodText }}</text>
  35. <view class="tp-mood-bar-track">
  36. <view class="tp-mood-bar-fill" :style="{ width: moodPercent + '%' }"></view>
  37. </view>
  38. </view>
  39. <!-- 吉位 -->
  40. <view class="tp-col tp-col-direction">
  41. <text class="tp-col-icon">&#x1F9ED;</text>
  42. <text class="tp-col-label">今日吉位</text>
  43. <view class="tp-compass-wrap">
  44. <canvas
  45. canvas-id="tianpanCompass"
  46. id="tianpanCompass"
  47. type="2d"
  48. class="tp-compass-canvas"
  49. @touchstart="handleTouchStart"
  50. ></canvas>
  51. </view>
  52. <text class="tp-direction-value">{{ luckyDirection }}</text>
  53. </view>
  54. </view>
  55. <!-- 底部周报提示 -->
  56. <view class="tp-footer" v-if="weeklyTip">
  57. <text class="tp-footer-icon">&#x1F4A1;</text>
  58. <text class="tp-footer-text">{{ weeklyTip }}</text>
  59. </view>
  60. <!-- 今日宜忌提示 -->
  61. <view class="tp-advice-section">
  62. <view class="tp-advice-item">
  63. <text class="tp-advice-icon">♦</text>
  64. <text class="tp-advice-label">宜:</text>
  65. <text class="tp-advice-text">{{ getAdvice(true) }}</text>
  66. </view>
  67. <view class="tp-advice-item">
  68. <text class="tp-advice-icon">✖</text>
  69. <text class="tp-advice-label">忌:</text>
  70. <text class="tp-advice-text">{{ getAdvice(false) }}</text>
  71. </view>
  72. </view>
  73. <!-- 查看详情入口 -->
  74. <view class="tp-detail-btn" @click="goDetail">
  75. <text class="tp-detail-text">查看家庭天盘详情 &#x2192;</text>
  76. </view>
  77. </view>
  78. </template>
  79. <script>
  80. /**
  81. * FamilyTianpanCard — 家庭天盘概览卡片(嵌入心维度页面)
  82. *
  83. * Props:
  84. * fortune — { level: 0-4, text, description }
  85. * mood — { emoji, text, score: 0-100 }
  86. * dominantElement — 'wood'|'fire'|'earth'|'metal'|'water'
  87. * weeklyTip — string 本周提示
  88. * visible — boolean 是否显示
  89. *
  90. * 吉位 Canvas 绘制五元素罗盘,高亮吉位方向。
  91. */
  92. export default {
  93. name: 'FamilyTianpanCard',
  94. props: {
  95. fortune: {
  96. type: Object,
  97. default: function() { return null }
  98. },
  99. mood: {
  100. type: Object,
  101. default: function() { return null }
  102. },
  103. dominantElement: {
  104. type: String,
  105. default: ''
  106. },
  107. weeklyTip: {
  108. type: String,
  109. default: ''
  110. },
  111. visible: {
  112. type: Boolean,
  113. default: true
  114. }
  115. },
  116. data: function() {
  117. return {
  118. canvasCtx: null,
  119. canvasReady: false,
  120. _compassW: 0,
  121. _compassH: 0,
  122. themeColor: '#FF6B9D', // 默认火维度颜色
  123. _animFrameId: null,
  124. _clickableAreas: [],
  125. // 五行 → 方位映射
  126. elementDirMap: {
  127. wood: '东',
  128. fire: '南',
  129. earth: '中',
  130. metal: '西',
  131. water: '北'
  132. },
  133. // 方位 → 颜色映射
  134. dirColorMap: {
  135. '东': '#10B981',
  136. '南': '#FF6B9D',
  137. '中': '#FF8C42',
  138. '西': '#6366F1',
  139. '北': '#3B82F6'
  140. },
  141. // 方位 → 角度(从北顺时针,Canvas 默认从右/东开始)
  142. dirAngleMap: {
  143. '东': Math.PI / 2,
  144. '南': Math.PI,
  145. '中': 0,
  146. '西': -Math.PI / 2,
  147. '北': 0
  148. }
  149. }
  150. },
  151. computed: {
  152. fortuneLevel: function() {
  153. if (!this.fortune) return 2
  154. return this.fortune.level !== undefined ? this.fortune.level : 2
  155. },
  156. fortuneText: function() {
  157. if (!this.fortune || !this.fortune.text) return '平'
  158. return this.fortune.text
  159. },
  160. fortuneDesc: function() {
  161. if (!this.fortune || !this.fortune.description) return '今日宜静心养性'
  162. return this.fortune.description
  163. },
  164. moodEmoji: function() {
  165. if (this.mood && this.mood.emoji) return this.mood.emoji
  166. return '\u{1F60A}' // 默认笑脸
  167. },
  168. moodText: function() {
  169. if (this.mood && this.mood.text) return this.mood.text
  170. return '平静'
  171. },
  172. moodPercent: function() {
  173. if (this.mood && this.mood.score !== undefined) return this.mood.score
  174. return 60
  175. },
  176. luckyDirection: function() {
  177. if (this.dominantElement && this.elementDirMap[this.dominantElement]) {
  178. return this.elementDirMap[this.dominantElement] + '方'
  179. }
  180. return '东方'
  181. },
  182. luckyElementColor: function() {
  183. var dir = this.luckyDirection
  184. return this.dirColorMap[dir] || '#FF6B9D'
  185. },
  186. themeStyle: function() {
  187. var color = this.themeColor || '#FF6B9D'
  188. var lighter = color + '15'
  189. var borderColor = color + '20'
  190. var shadowColor = color + '25'
  191. return {
  192. '--theme-color': color,
  193. '--theme-lighter': lighter,
  194. '--theme-border': borderColor,
  195. '--theme-shadow': shadowColor,
  196. '--theme-gradient': 'linear-gradient(135deg, ' + color + ', ' + color + 'CC)'
  197. }
  198. },
  199. isChild: function() {
  200. try {
  201. return this.$store && this.$store.state && this.$store.state.role === 'child'
  202. } catch (e) {
  203. return false
  204. }
  205. }
  206. },
  207. watch: {
  208. visible: function(val) {
  209. if (val) {
  210. var self = this
  211. setTimeout(function() {
  212. self.initCanvas()
  213. }, 300)
  214. }
  215. },
  216. dominantElement: function() {
  217. if (this.canvasReady) {
  218. this.drawCompass()
  219. }
  220. }
  221. },
  222. mounted: function() {
  223. if (this.visible) {
  224. var self = this
  225. setTimeout(function() {
  226. self.initCanvas()
  227. }, 500)
  228. }
  229. },
  230. methods: {
  231. goDetail: function() {
  232. uni.navigateTo({
  233. url: '/pages/mind-detail/family-dashboard'
  234. })
  235. },
  236. /**
  237. * 获取当日宜忌建议
  238. * @param {boolean} isGood - 是否获取宜(true)或忌(false)
  239. */
  240. getAdvice: function(isGood) {
  241. const advice = {
  242. 木: {
  243. good: '植树种花、亲近自然,交友聚会增进感情,制定计划规划未来',
  244. bad: '冲动消费、盲目扩张,长期熬夜、透支健康,与人争执失和气'
  245. },
  246. 火: {
  247. good: '社交活动、表达感想,旅行出游、放松心情,运动健身、增强活力',
  248. bad: '过度劳累、身体透支,情绪激动、失去理智,暴饮暴食、饮酒无度'
  249. },
  250. 土: {
  251. good: '规律作息、健康管理,家务整理、创造舒适,学习充电、稳固提升',
  252. bad: '情绪压抑、独自忍耐,忽视身体、健康警讯,盲目保守、错失机会'
  253. },
  254. 金: {
  255. good: '整理环境、创造秩序,专注工作、提升效率,投资理财、稳健收益',
  256. bad: '过度拘谨、缺乏变通,忽略情感、人情冷漠,欲望过多、贪求不满'
  257. },
  258. 水: {
  259. good: '阅读思考、拓展思维,社交活动、增进人脉,创意思考、寻找机遇',
  260. bad: '犹豫不决、错过良机,过度幻想、缺乏行动,沉迷游戏、浪费时光'
  261. }
  262. }
  263. // 默认值(如果五行未知或未提供)
  264. if (!this.fortune || !this.fortune.dominantElement) {
  265. return isGood ? '保持心情愉悦,积极面对每一天' : '避免负面情绪,不过度劳累'
  266. }
  267. const element = this.fortune.dominantElement
  268. return advice[element][isGood ? 'good' : 'bad']
  269. },
  270. initCanvas: function() {
  271. var self = this
  272. var query = uni.createSelectorQuery().in(self)
  273. query.select('#tianpanCompass')
  274. .fields({ node: true, size: true })
  275. .exec(function(res) {
  276. if (!res || !res[0] || !res[0].node) return
  277. var ctx = res[0].node.getContext('2d')
  278. var dpr = uni.getSystemInfoSync().pixelRatio || 2
  279. var w = res[0].width
  280. var h = res[0].height
  281. // 高分辨率适配
  282. res[0].node.width = w * dpr
  283. res[0].node.height = h * dpr
  284. ctx.scale(dpr, dpr)
  285. self.canvasCtx = ctx
  286. self.canvasReady = true
  287. self._compassW = w
  288. self._compassH = h
  289. // 设置初始主题色(火维度)
  290. self.themeColor = '#FF6B9D'
  291. if (self.fortune && self.fortune.dominantElement) {
  292. var elementColors = {
  293. 木: '#10B981', 火: '#FF6B9D', 土: '#FF8C42', 金: '#6366F1', 水: '#3B82F6'
  294. }
  295. self.themeColor = elementColors[self.fortune.dominantElement]
  296. }
  297. // 启动动画
  298. self.startAnimation()
  299. })
  300. },
  301. handleTouchStart: function(e) {
  302. // 儿童模式交互
  303. if (this.$store.state.role === 'child') {
  304. this.handleCompassClick(e)
  305. }
  306. },
  307. clearCanvas: function() {
  308. if (!this.canvasReady || !this.canvasCtx) return
  309. var ctx = this.canvasCtx
  310. var width = this._compassW
  311. var height = this._compassH
  312. ctx.clearRect(0, 0, width, height)
  313. },
  314. startAnimation: function() {
  315. var self = this
  316. if (this._animFrameId) {
  317. clearTimeout(this._animFrameId)
  318. this._animFrameId = null
  319. }
  320. var lastTime = 0
  321. var fps = 30 // 小程序 Canvas 30fps 即可保证流畅
  322. var interval = 1000 / fps
  323. function animationLoop() {
  324. if (!self.canvasCtx || !self.canvasReady) {
  325. self._animFrameId = null
  326. return
  327. }
  328. var now = Date.now()
  329. if (now - lastTime < interval) {
  330. self._animFrameId = setTimeout(animationLoop, 16)
  331. return
  332. }
  333. lastTime = now
  334. self.clearCanvas()
  335. self.drawCompassWithAnimation(now)
  336. self._animFrameId = setTimeout(animationLoop, 16)
  337. }
  338. animationLoop()
  339. },
  340. drawCompass: function() {
  341. // 兼容旧调用
  342. this.drawCompassWithAnimation(0)
  343. },
  344. drawCompassWithAnimation: function(timestamp) {
  345. var ctx = this.canvasCtx
  346. if (!ctx) return
  347. var w = this._compassW || 100
  348. var h = this._compassH || 100
  349. var cx = w / 2
  350. var cy = h / 2
  351. var outerR = Math.min(cx, cy) - 4
  352. // 清空
  353. ctx.clearRect(0, 0, w, h)
  354. // 五个方位: 北(上), 东(右), 南(下), 西(左), 中(中心)
  355. var directions = [
  356. { label: '北', element: 'water', angle: -Math.PI / 2 },
  357. { label: '东', element: 'wood', angle: 0 },
  358. { label: '南', element: 'fire', angle: Math.PI / 2 },
  359. { label: '西', element: 'metal', angle: Math.PI },
  360. { label: '中', element: 'earth', angle: null }
  361. ]
  362. var elementColors = {
  363. wood: '#10B981',
  364. fire: '#FF6B9D',
  365. earth: '#FF8C42',
  366. metal: '#6366F1',
  367. water: '#3B82F6'
  368. }
  369. var luckyDir = this.luckyDirection.replace('方', '')
  370. var luckyColor = this.luckyElementColor
  371. // hex转rgba辅助
  372. function hexToRgba(hex, alpha) {
  373. var r = parseInt(hex.slice(1, 3), 16)
  374. var g = parseInt(hex.slice(3, 5), 16)
  375. var b = parseInt(hex.slice(5, 7), 16)
  376. return 'rgba(' + r + ',' + g + ',' + b + ',' + alpha + ')'
  377. }
  378. // 外圈背景
  379. ctx.beginPath()
  380. ctx.arc(cx, cy, outerR, 0, Math.PI * 2)
  381. ctx.fillStyle = '#FFF5F7'
  382. ctx.fill()
  383. ctx.strokeStyle = hexToRgba(luckyColor, 0.25)
  384. ctx.lineWidth = 1.5
  385. ctx.stroke()
  386. // 绘制四个方位的扇区
  387. for (var i = 0; i < 4; i++) {
  388. var d = directions[i]
  389. var color = elementColors[d.element]
  390. // 扇区线
  391. ctx.beginPath()
  392. ctx.moveTo(cx, cy)
  393. var ex = cx + outerR * Math.cos(d.angle)
  394. var ey = cy + outerR * Math.sin(d.angle)
  395. ctx.lineTo(ex, ey)
  396. ctx.strokeStyle = hexToRgba(color, 0.19)
  397. ctx.lineWidth = 1
  398. ctx.stroke()
  399. // 方位标签
  400. var labelR = outerR * 0.7
  401. var lx = cx + labelR * Math.cos(d.angle)
  402. var ly = cy + labelR * Math.sin(d.angle)
  403. var isLucky = d.label === luckyDir
  404. if (isLucky) {
  405. // 吉位高亮圆
  406. ctx.beginPath()
  407. ctx.arc(lx, ly, 12, 0, Math.PI * 2)
  408. ctx.fillStyle = hexToRgba(luckyColor, 0.13)
  409. ctx.fill()
  410. ctx.strokeStyle = luckyColor
  411. ctx.lineWidth = 1.5
  412. ctx.stroke()
  413. }
  414. ctx.fillStyle = isLucky ? luckyColor : '#9CA3AF'
  415. ctx.font = (isLucky ? 'bold ' : '') + '10px sans-serif'
  416. ctx.textAlign = 'center'
  417. ctx.textBaseline = 'middle'
  418. ctx.fillText(d.label, lx, ly)
  419. }
  420. // 中心点
  421. ctx.beginPath()
  422. ctx.arc(cx, cy, 5, 0, Math.PI * 2)
  423. ctx.fillStyle = luckyColor
  424. ctx.fill()
  425. ctx.strokeStyle = '#FFFFFF'
  426. ctx.lineWidth = 1.5
  427. ctx.stroke()
  428. },
  429. handleCompassClick: function(e) {
  430. if (!this.isChild || !this.fortune) return
  431. var touch = e.touches && e.touches[0]
  432. if (!touch) return
  433. var self = this
  434. uni.createSelectorQuery().in(this).select('#tianpanCompass').boundingClientRect(function(rect) {
  435. if (!rect) return
  436. var touchX = touch.clientX - rect.left
  437. var touchY = touch.clientY - rect.top
  438. var cx = self._compassW / 2
  439. var cy = self._compassH / 2
  440. var radius = Math.min(cx, cy) - 4
  441. // 判断点击区域
  442. var elements = [
  443. { label: '东', description: '家庭成长力', name: '木' },
  444. { label: '南', description: '温馨家庭情', name: '火' },
  445. { label: '西', description: '和谐人际关系', name: '金' },
  446. { label: '北', description: '智慧与理性', name: '水' },
  447. { label: '中', description: '稳固与安定', name: '土' }
  448. ]
  449. for (var i = 0; i < elements.length; i++) {
  450. var elem = elements[i]
  451. var angle = elem.label === '东' ? 0 : elem.label === '南' ? Math.PI / 2 : elem.label === '西' ? Math.PI : elem.label === '北' ? -Math.PI / 2 : null
  452. if (angle === null) continue
  453. var labelR = radius * 0.7
  454. var lx = cx + labelR * Math.cos(angle)
  455. var ly = cy + labelR * Math.sin(angle)
  456. var dist = Math.sqrt(Math.pow(touchX - lx, 2) + Math.pow(touchY - ly, 2))
  457. if (dist <= 20) {
  458. uni.showModal({
  459. title: elem.name + '·' + elem.label + '方',
  460. content: '这里是家里' + elem.name + '能量最旺的方向!\n' + elem.description + ',记得多在这个方向活动哦~',
  461. confirmText: '知道啦',
  462. showCancel: false,
  463. confirmColor: self.themeColor || '#FF6B9D'
  464. })
  465. break
  466. }
  467. }
  468. }).exec()
  469. }
  470. },
  471. }
  472. </script>
  473. <style scoped>
  474. .tianpan-card {
  475. margin: 20rpx 30rpx;
  476. background: #FFFFFF;
  477. border-radius: 24rpx;
  478. padding: 28rpx 24rpx;
  479. /* 动态主题阴影 */
  480. box-shadow: 0 4rpx 16rpx var(--theme-shadow, rgba(255, 107, 157, 0.12)),
  481. 0 2rpx 4rpx rgba(0, 0, 0, 0.04);
  482. border: 1rpx solid var(--theme-border, rgba(255, 107, 157, 0.08));
  483. overflow: hidden;
  484. }
  485. /* ===== 头部 ===== */
  486. .tp-header {
  487. display: flex;
  488. flex-direction: row;
  489. align-items: center;
  490. justify-content: space-between;
  491. margin-bottom: 24rpx;
  492. padding-bottom: 20rpx;
  493. border-bottom: 1rpx solid var(--theme-border, rgba(255, 107, 157, 0.10));
  494. }
  495. .tp-header-left {
  496. display: flex;
  497. flex-direction: row;
  498. align-items: center;
  499. }
  500. .tp-icon-badge {
  501. width: 64rpx;
  502. height: 64rpx;
  503. border-radius: 20rpx;
  504. background: var(--theme-gradient, linear-gradient(135deg, #FF6B9D, #FF8FB1));
  505. display: flex;
  506. align-items: center;
  507. justify-content: center;
  508. margin-right: 16rpx;
  509. box-shadow: 0 4rpx 12rpx var(--theme-shadow, rgba(255, 107, 157, 0.30));
  510. }
  511. .tp-icon-text {
  512. font-size: 32rpx;
  513. color: #FFFFFF;
  514. }
  515. .tp-header-info {
  516. display: flex;
  517. flex-direction: column;
  518. }
  519. .tp-title {
  520. font-size: 30rpx;
  521. font-weight: 700;
  522. color: #1E293B;
  523. }
  524. .tp-subtitle {
  525. font-size: 22rpx;
  526. color: #94A3B8;
  527. margin-top: 2rpx;
  528. }
  529. .tp-header-action {
  530. width: 56rpx;
  531. height: 56rpx;
  532. border-radius: 28rpx;
  533. background: var(--theme-lighter, #FFF0F3);
  534. display: flex;
  535. align-items: center;
  536. justify-content: center;
  537. }
  538. .tp-action-text {
  539. font-size: 28rpx;
  540. color: var(--theme-color, #FF6B9D);
  541. font-weight: 600;
  542. }
  543. .tp-header-action:active {
  544. opacity: 0.7;
  545. }
  546. /* ===== 三栏 body ===== */
  547. .tp-body {
  548. display: flex;
  549. flex-direction: row;
  550. justify-content: space-between;
  551. }
  552. .tp-col {
  553. flex: 1;
  554. display: flex;
  555. flex-direction: column;
  556. align-items: center;
  557. padding: 16rpx 8rpx;
  558. border-radius: 20rpx;
  559. background: #FAFBFC;
  560. }
  561. .tp-col-fortune {
  562. margin-right: 12rpx;
  563. }
  564. .tp-col-mood {
  565. margin-left: 6rpx;
  566. margin-right: 6rpx;
  567. }
  568. .tp-col-direction {
  569. margin-left: 12rpx;
  570. }
  571. /* 列通用 */
  572. .tp-col-icon {
  573. font-size: 36rpx;
  574. margin-bottom: 8rpx;
  575. }
  576. .tp-col-label {
  577. font-size: 22rpx;
  578. color: #94A3B8;
  579. margin-bottom: 12rpx;
  580. font-weight: 500;
  581. }
  582. /* 运势 */
  583. .tp-fortune-badge {
  584. padding: 6rpx 20rpx;
  585. border-radius: 20rpx;
  586. margin-bottom: 8rpx;
  587. }
  588. .fortune-level-0 {
  589. background: #FFEBEE;
  590. }
  591. .fortune-level-0 .tp-fortune-text {
  592. color: #D32F2F;
  593. }
  594. .fortune-level-1 {
  595. background: #FFF3E0;
  596. }
  597. .fortune-level-1 .tp-fortune-text {
  598. color: #E65100;
  599. }
  600. .fortune-level-2 {
  601. background: #FFFDE7;
  602. }
  603. .fortune-level-2 .tp-fortune-text {
  604. color: #F9A825;
  605. }
  606. .fortune-level-3 {
  607. background: #F3E5F5;
  608. }
  609. .fortune-level-3 .tp-fortune-text {
  610. color: #7B1FA2;
  611. }
  612. .fortune-level-4 {
  613. background: #FFCDD2;
  614. }
  615. .fortune-level-4 .tp-fortune-text {
  616. color: #B71C1C;
  617. }
  618. .tp-fortune-text {
  619. font-size: 26rpx;
  620. font-weight: 700;
  621. }
  622. .tp-fortune-desc {
  623. font-size: 20rpx;
  624. color: #94A3B8;
  625. text-align: center;
  626. line-height: 1.4;
  627. }
  628. /* 心情 */
  629. .tp-mood-value {
  630. font-size: 26rpx;
  631. font-weight: 600;
  632. color: #1E293B;
  633. margin-bottom: 10rpx;
  634. }
  635. .tp-mood-bar-track {
  636. width: 100%;
  637. height: 10rpx;
  638. background: #E2E8F0;
  639. border-radius: 5rpx;
  640. overflow: hidden;
  641. }
  642. .tp-mood-bar-fill {
  643. height: 100%;
  644. background: var(--theme-gradient, linear-gradient(90deg, #FF6B9D, #FF8FB1));
  645. border-radius: 5rpx;
  646. transition: width 0.5s;
  647. }
  648. /* 吉位罗盘 */
  649. .tp-compass-wrap {
  650. width: 120rpx;
  651. height: 120rpx;
  652. margin-bottom: 8rpx;
  653. }
  654. .tp-compass-canvas {
  655. width: 120rpx;
  656. height: 120rpx;
  657. }
  658. .tp-direction-value {
  659. font-size: 24rpx;
  660. font-weight: 700;
  661. color: var(--theme-color, #FF6B9D);
  662. }
  663. /* ===== 底部提示 ===== */
  664. .tp-footer {
  665. display: flex;
  666. flex-direction: row;
  667. align-items: flex-start;
  668. margin-top: 20rpx;
  669. padding: 16rpx;
  670. background: var(--theme-lighter, #FFF5F0);
  671. border-radius: 14rpx;
  672. }
  673. .tp-footer-icon {
  674. font-size: 24rpx;
  675. margin-right: 8rpx;
  676. flex-shrink: 0;
  677. }
  678. .tp-footer-text {
  679. font-size: 22rpx;
  680. color: #8B6914;
  681. line-height: 1.5;
  682. flex: 1;
  683. }
  684. /* ===== 今日宜忌 ===== */
  685. .tp-advice-section {
  686. margin: 20rpx 0;
  687. padding: 16rpx;
  688. background-color: rgba(255, 255, 255, 0.7);
  689. border-radius: 16rpx;
  690. }
  691. .tp-advice-item {
  692. display: flex;
  693. flex-direction: row;
  694. align-items: center;
  695. margin-bottom: 10rpx;
  696. }
  697. .tp-advice-item:last-child {
  698. margin-bottom: 0;
  699. }
  700. .tp-advice-icon {
  701. font-size: 24rpx;
  702. color: var(--theme-color, #FF6B9D);
  703. margin-right: 12rpx;
  704. }
  705. .tp-advice-label {
  706. font-size: 22rpx;
  707. font-weight: 600;
  708. color: var(--theme-color, #FF6B9D);
  709. margin-right: 12rpx;
  710. min-width: 60rpx;
  711. }
  712. .tp-advice-text {
  713. font-size: 22rpx;
  714. color: #374151;
  715. flex: 1;
  716. line-height: 1.4;
  717. }
  718. /* ===== 查看详情按钮 ===== */
  719. .tp-detail-btn {
  720. margin-top: 16rpx;
  721. text-align: center;
  722. padding: 14rpx;
  723. background: var(--theme-lighter, linear-gradient(135deg, #FFF0F3, #FFE0E8));
  724. border-radius: 14rpx;
  725. }
  726. .tp-detail-btn:active {
  727. opacity: 0.7;
  728. }
  729. .tp-detail-text {
  730. font-size: 24rpx;
  731. color: var(--theme-color, #FF6B9D);
  732. font-weight: 600;
  733. }
  734. </style>