| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914 |
- <template>
- <!-- 家庭天盘卡片 — 心维度专属 (#FF6B9D 火) -->
- <view class="tianpan-card" v-if="visible" :style="themeStyle">
- <!-- 卡片头部 -->
- <view class="tp-header">
- <view class="tp-header-left">
- <view class="tp-icon-badge">
- <text class="tp-icon-text">☷</text>
- </view>
- <view class="tp-header-info">
- <text class="tp-title">家庭天盘</text>
- <text class="tp-subtitle">五行能量 · 每日更新</text>
- </view>
- </view>
- <view class="tp-header-action" @click="goDetail">
- <text class="tp-action-text">→</text>
- </view>
- </view>
- <!-- 三栏展示 -->
- <view class="tp-body">
- <!-- 今日运势 -->
- <view class="tp-col tp-col-fortune">
- <text class="tp-col-icon">⭐</text>
- <text class="tp-col-label">今日运势</text>
- <view class="tp-fortune-badge" :class="'fortune-level-' + fortuneLevel">
- <text class="tp-fortune-text">{{ fortuneText }}</text>
- </view>
- <text class="tp-fortune-desc">{{ fortuneDesc }}</text>
- </view>
- <!-- 今日心情 -->
- <view class="tp-col tp-col-mood">
- <text class="tp-col-icon">{{ moodEmoji }}</text>
- <text class="tp-col-label">今日心情</text>
- <text class="tp-mood-value">{{ moodText }}</text>
- <view class="tp-mood-bar-track">
- <view class="tp-mood-bar-fill" :style="{ width: moodPercent + '%' }"></view>
- </view>
- </view>
- <!-- 吉位 -->
- <view class="tp-col tp-col-direction">
- <text class="tp-col-icon">🧭</text>
- <text class="tp-col-label">今日吉位</text>
- <view class="tp-compass-wrap">
- <canvas
- canvas-id="tianpanCompass"
- id="tianpanCompass"
- type="2d"
- class="tp-compass-canvas"
- @touchstart="handleTouchStart"
- ></canvas>
- </view>
- <text class="tp-direction-value">{{ luckyDirection }}</text>
- </view>
- </view>
- <!-- 传统文化信息(八字/五行/星座/灵数) -->
- <view class="tp-traditional" v-if="traditionalData">
- <!-- 八字四柱 -->
- <view class="tp-trad-row" v-if="traditionalData.eightCharacters">
- <view class="tp-trad-item" v-for="(val, key) in traditionalData.eightCharacters" :key="getBaziKey(key)">
- <text class="tp-trad-label">{{ pillarLabels[key] || key }}</text>
- <text class="tp-trad-value">{{ val }}</text>
- </view>
- </view>
- <!-- 五行能量 -->
- <view class="tp-trad-row" v-if="traditionalData.wuxingElements">
- <view class="tp-trad-item" v-for="wx in wuxingData" :key="getWuxingKey(wx)">
- <text class="tp-trad-label">{{ wx.label }}</text>
- <view class="tp-trad-bar-track">
- <view class="tp-trad-bar-fill" :style="{ width: wx.value + '%', background: wx.color }"></view>
- </view>
- <text class="tp-trad-val">{{ wx.value }}%</text>
- </view>
- </view>
- <!-- 星座 + 灵数 -->
- <view class="tp-trad-row tp-trad-row-split">
- <view class="tp-trad-tag" v-if="traditionalData.zodiac">
- <text class="tp-trad-tag-icon">☀</text>
- <text class="tp-trad-tag-text">{{ traditionalData.zodiac }}</text>
- </view>
- <view class="tp-trad-tag" v-if="traditionalData.lifeNumber">
- <text class="tp-trad-tag-icon">🔮</text>
- <text class="tp-trad-tag-text">灵数 {{ traditionalData.lifeNumber }}</text>
- </view>
- </view>
- </view>
- <!-- 底部周报提示 -->
- <view class="tp-footer" v-if="weeklyTip">
- <text class="tp-footer-icon">💡</text>
- <text class="tp-footer-text">{{ weeklyTip }}</text>
- </view>
- <!-- 今日宜忌提示 -->
- <view class="tp-advice-section">
- <view class="tp-advice-item">
- <text class="tp-advice-icon">♦</text>
- <text class="tp-advice-label">宜:</text>
- <text class="tp-advice-text">{{ getAdvice(true) }}</text>
- </view>
- <view class="tp-advice-item">
- <text class="tp-advice-icon">✖</text>
- <text class="tp-advice-label">忌:</text>
- <text class="tp-advice-text">{{ getAdvice(false) }}</text>
- </view>
- </view>
-
- <!-- 查看详情入口 -->
- <view class="tp-detail-btn" @click="goDetail">
- <text class="tp-detail-text">查看家庭天盘详情 →</text>
- </view>
- </view>
- </template>
- <script>
- /**
- * FamilyTianpanCard — 家庭天盘概览卡片(嵌入心维度页面)
- *
- * Props:
- * fortune — { level: 0-4, text, description }
- * mood — { emoji, text, score: 0-100 }
- * dominantElement — 'wood'|'fire'|'earth'|'metal'|'water'
- * weeklyTip — string 本周提示
- * visible — boolean 是否显示
- *
- * 吉位 Canvas 绘制五元素罗盘,高亮吉位方向。
- */
- export default {
- name: 'FamilyTianpanCard',
- props: {
- fortune: {
- type: Object,
- default: function() { return null }
- },
- mood: {
- type: Object,
- default: function() { return null }
- },
- dominantElement: {
- type: String,
- default: ''
- },
- weeklyTip: {
- type: String,
- default: ''
- },
- visible: {
- type: Boolean,
- default: true
- },
- traditionalData: {
- type: Object,
- default: function() { return null }
- }
- },
- data: function() {
- return {
- canvasCtx: null,
- canvasReady: false,
- _compassW: 0,
- _compassH: 0,
- themeColor: '#FF6B9D', // 默认火维度颜色
- _animFrameId: null,
- _clickableAreas: [],
- // 五行 → 方位映射
- elementDirMap: {
- wood: '东',
- fire: '南',
- earth: '中',
- metal: '西',
- water: '北'
- },
- // 方位 → 颜色映射
- dirColorMap: {
- '东': '#10B981',
- '南': '#FF6B9D',
- '中': '#FF8C42',
- '西': '#6366F1',
- '北': '#3B82F6'
- },
- // 方位 → 角度(从北顺时针,Canvas 默认从右/东开始)
- dirAngleMap: {
- '东': Math.PI / 2,
- '南': Math.PI,
- '中': 0,
- '西': -Math.PI / 2,
- '北': 0
- }
- }
- },
- computed: {
- fortuneLevel: function() {
- if (!this.fortune) return 2
- return this.fortune.level !== undefined ? this.fortune.level : 2
- },
- fortuneText: function() {
- if (!this.fortune || !this.fortune.text) return '平'
- return this.fortune.text
- },
- fortuneDesc: function() {
- if (!this.fortune || !this.fortune.description) return '今日宜静心养性'
- return this.fortune.description
- },
- moodEmoji: function() {
- if (this.mood && this.mood.emoji) return this.mood.emoji
- return '\u{1F60A}' // 默认笑脸
- },
- moodText: function() {
- if (this.mood && this.mood.text) return this.mood.text
- return '平静'
- },
- moodPercent: function() {
- if (this.mood && this.mood.score !== undefined) return this.mood.score
- return 60
- },
- luckyDirection: function() {
- if (this.dominantElement && this.elementDirMap[this.dominantElement]) {
- return this.elementDirMap[this.dominantElement] + '方'
- }
- return '东方'
- },
- luckyElementColor: function() {
- var dir = this.luckyDirection
- return this.dirColorMap[dir] || '#FF6B9D'
- },
- themeStyle: function() {
- var color = this.themeColor || '#FF6B9D'
- var lighter = color + '15'
- var borderColor = color + '20'
- var shadowColor = color + '25'
- return {
- '--theme-color': color,
- '--theme-lighter': lighter,
- '--theme-border': borderColor,
- '--theme-shadow': shadowColor,
- '--theme-gradient': 'linear-gradient(135deg, ' + color + ', ' + color + 'CC)'
- }
- },
- isChild: function() {
- try {
- return this.$store && this.$store.state && this.$store.state.role === 'child'
- } catch (e) {
- return false
- }
- },
- pillarLabels: function() {
- return { year: '年柱', month: '月柱', day: '日柱', hour: '时柱' }
- },
- wuxingData: function() {
- if (!this.traditionalData || !this.traditionalData.wuxingElements) return []
- var colorMap = { wood: '#10B981', fire: '#FF6B9D', earth: '#FF8C42', metal: '#6366F1', water: '#3B82F6' }
- var labelMap = { wood: '木', fire: '火', earth: '土', metal: '金', water: '水' }
- var elements = this.traditionalData.wuxingElements
- var result = []
- for (var key in elements) {
- if (elements.hasOwnProperty(key)) {
- result.push({
- key: key,
- label: labelMap[key] || key,
- value: elements[key] || 0,
- color: colorMap[key] || '#94A3B8'
- })
- }
- }
- return result
- }
- },
- watch: {
- visible: function(val) {
- if (val) {
- var self = this
- setTimeout(function() {
- self.initCanvas()
- }, 300)
- }
- },
- dominantElement: function() {
- if (this.canvasReady) {
- this.drawCompass()
- }
- }
- },
- mounted: function() {
- if (this.visible) {
- var self = this
- setTimeout(function() {
- self.initCanvas()
- }, 500)
- }
- },
- methods: {
- getBaziKey: function(key) { return 'bazi-' + key },
- getWuxingKey: function(wx) { return 'wx-' + wx.key },
- goDetail: function() {
- uni.navigateTo({
- url: '/pages/mind-detail/family-dashboard'
- })
- },
-
- /**
- * 获取当日宜忌建议
- * @param {boolean} isGood - 是否获取宜(true)或忌(false)
- */
- getAdvice: function(isGood) {
- const advice = {
- 木: {
- good: '植树种花、亲近自然,交友聚会增进感情,制定计划规划未来',
- bad: '冲动消费、盲目扩张,长期熬夜、透支健康,与人争执失和气'
- },
- 火: {
- good: '社交活动、表达感想,旅行出游、放松心情,运动健身、增强活力',
- bad: '过度劳累、身体透支,情绪激动、失去理智,暴饮暴食、饮酒无度'
- },
- 土: {
- good: '规律作息、健康管理,家务整理、创造舒适,学习充电、稳固提升',
- bad: '情绪压抑、独自忍耐,忽视身体、健康警讯,盲目保守、错失机会'
- },
- 金: {
- good: '整理环境、创造秩序,专注工作、提升效率,投资理财、稳健收益',
- bad: '过度拘谨、缺乏变通,忽略情感、人情冷漠,欲望过多、贪求不满'
- },
- 水: {
- good: '阅读思考、拓展思维,社交活动、增进人脉,创意思考、寻找机遇',
- bad: '犹豫不决、错过良机,过度幻想、缺乏行动,沉迷游戏、浪费时光'
- }
- }
-
- // 默认值(如果五行未知或未提供)
- if (!this.fortune || !this.fortune.dominantElement) {
- return isGood ? '保持心情愉悦,积极面对每一天' : '避免负面情绪,不过度劳累'
- }
-
- const element = this.fortune.dominantElement
- return advice[element][isGood ? 'good' : 'bad']
- },
- initCanvas: function() {
- var self = this
- var query = uni.createSelectorQuery().in(self)
- query.select('#tianpanCompass')
- .fields({ node: true, size: true })
- .exec(function(res) {
- if (!res || !res[0] || !res[0].node) return
- var ctx = res[0].node.getContext('2d')
- var dpr = uni.getWindowInfo().pixelRatio || 2
- var w = res[0].width
- var h = res[0].height
-
- // 高分辨率适配
- res[0].node.width = w * dpr
- res[0].node.height = h * dpr
- ctx.scale(dpr, dpr)
-
- self.canvasCtx = ctx
- self.canvasReady = true
- self._compassW = w
- self._compassH = h
-
- // 设置初始主题色(火维度)
- self.themeColor = '#FF6B9D'
- if (self.fortune && self.fortune.dominantElement) {
- var elementColors = {
- 木: '#10B981', 火: '#FF6B9D', 土: '#FF8C42', 金: '#6366F1', 水: '#3B82F6'
- }
- self.themeColor = elementColors[self.fortune.dominantElement]
- }
-
- // 启动动画
- self.startAnimation()
- })
- },
-
- handleTouchStart: function(e) {
- // 儿童模式交互
- if (this.$store.state.role === 'child') {
- this.handleCompassClick(e)
- }
- },
- clearCanvas: function() {
- if (!this.canvasReady || !this.canvasCtx) return
- var ctx = this.canvasCtx
- var width = this._compassW
- var height = this._compassH
- ctx.clearRect(0, 0, width, height)
- },
- startAnimation: function() {
- var self = this
- if (this._animFrameId) {
- clearTimeout(this._animFrameId)
- this._animFrameId = null
- }
-
- var lastTime = 0
- var fps = 30 // 小程序 Canvas 30fps 即可保证流畅
- var interval = 1000 / fps
-
- function animationLoop() {
- if (!self.canvasCtx || !self.canvasReady) {
- self._animFrameId = null
- return
- }
-
- var now = Date.now()
- if (now - lastTime < interval) {
- self._animFrameId = setTimeout(animationLoop, 16)
- return
- }
- lastTime = now
-
- self.clearCanvas()
- self.drawCompassWithAnimation(now)
- self._animFrameId = setTimeout(animationLoop, 16)
- }
-
- animationLoop()
- },
- drawCompass: function() {
- // 兼容旧调用
- this.drawCompassWithAnimation(0)
- },
- drawCompassWithAnimation: function(timestamp) {
- var ctx = this.canvasCtx
- if (!ctx) return
- var w = this._compassW || 100
- var h = this._compassH || 100
- var cx = w / 2
- var cy = h / 2
- var outerR = Math.min(cx, cy) - 4
- // 清空
- ctx.clearRect(0, 0, w, h)
- // 五个方位: 北(上), 东(右), 南(下), 西(左), 中(中心)
- var directions = [
- { label: '北', element: 'water', angle: -Math.PI / 2 },
- { label: '东', element: 'wood', angle: 0 },
- { label: '南', element: 'fire', angle: Math.PI / 2 },
- { label: '西', element: 'metal', angle: Math.PI },
- { label: '中', element: 'earth', angle: null }
- ]
- var elementColors = {
- wood: '#10B981',
- fire: '#FF6B9D',
- earth: '#FF8C42',
- metal: '#6366F1',
- water: '#3B82F6'
- }
- var luckyDir = this.luckyDirection.replace('方', '')
- var luckyColor = this.luckyElementColor
-
- // hex转rgba辅助
- function hexToRgba(hex, alpha) {
- var r = parseInt(hex.slice(1, 3), 16)
- var g = parseInt(hex.slice(3, 5), 16)
- var b = parseInt(hex.slice(5, 7), 16)
- return 'rgba(' + r + ',' + g + ',' + b + ',' + alpha + ')'
- }
- // 外圈背景
- ctx.beginPath()
- ctx.arc(cx, cy, outerR, 0, Math.PI * 2)
- ctx.fillStyle = '#FFF5F7'
- ctx.fill()
- ctx.strokeStyle = hexToRgba(luckyColor, 0.25)
- ctx.lineWidth = 1.5
- ctx.stroke()
- // 绘制四个方位的扇区
- for (var i = 0; i < 4; i++) {
- var d = directions[i]
- var color = elementColors[d.element]
- // 扇区线
- ctx.beginPath()
- ctx.moveTo(cx, cy)
- var ex = cx + outerR * Math.cos(d.angle)
- var ey = cy + outerR * Math.sin(d.angle)
- ctx.lineTo(ex, ey)
- ctx.strokeStyle = hexToRgba(color, 0.19)
- ctx.lineWidth = 1
- ctx.stroke()
- // 方位标签
- var labelR = outerR * 0.7
- var lx = cx + labelR * Math.cos(d.angle)
- var ly = cy + labelR * Math.sin(d.angle)
- var isLucky = d.label === luckyDir
- if (isLucky) {
- // 吉位高亮圆
- ctx.beginPath()
- ctx.arc(lx, ly, 12, 0, Math.PI * 2)
- ctx.fillStyle = hexToRgba(luckyColor, 0.13)
- ctx.fill()
- ctx.strokeStyle = luckyColor
- ctx.lineWidth = 1.5
- ctx.stroke()
- }
- ctx.fillStyle = isLucky ? luckyColor : '#9CA3AF'
- ctx.font = (isLucky ? 'bold ' : '') + '10px sans-serif'
- ctx.textAlign = 'center'
- ctx.textBaseline = 'middle'
- ctx.fillText(d.label, lx, ly)
- }
- // 中心点
- ctx.beginPath()
- ctx.arc(cx, cy, 5, 0, Math.PI * 2)
- ctx.fillStyle = luckyColor
- ctx.fill()
- ctx.strokeStyle = '#FFFFFF'
- ctx.lineWidth = 1.5
- ctx.stroke()
- },
- handleCompassClick: function(e) {
- if (!this.isChild || !this.fortune) return
-
- var touch = e.touches && e.touches[0]
- if (!touch) return
-
- var self = this
- uni.createSelectorQuery().in(this).select('#tianpanCompass').boundingClientRect(function(rect) {
- if (!rect) return
- var touchX = touch.clientX - rect.left
- var touchY = touch.clientY - rect.top
- var cx = self._compassW / 2
- var cy = self._compassH / 2
- var radius = Math.min(cx, cy) - 4
-
- // 判断点击区域
- var elements = [
- { label: '东', description: '家庭成长力', name: '木' },
- { label: '南', description: '温馨家庭情', name: '火' },
- { label: '西', description: '和谐人际关系', name: '金' },
- { label: '北', description: '智慧与理性', name: '水' },
- { label: '中', description: '稳固与安定', name: '土' }
- ]
-
- for (var i = 0; i < elements.length; i++) {
- var elem = elements[i]
- var angle = elem.label === '东' ? 0 : elem.label === '南' ? Math.PI / 2 : elem.label === '西' ? Math.PI : elem.label === '北' ? -Math.PI / 2 : null
- if (angle === null) continue
-
- var labelR = radius * 0.7
- var lx = cx + labelR * Math.cos(angle)
- var ly = cy + labelR * Math.sin(angle)
- var dist = Math.sqrt(Math.pow(touchX - lx, 2) + Math.pow(touchY - ly, 2))
-
- if (dist <= 20) {
- uni.showModal({
- title: elem.name + '·' + elem.label + '方',
- content: '这里是家里' + elem.name + '能量最旺的方向!\n' + elem.description + ',记得多在这个方向活动哦~',
- confirmText: '知道啦',
- showCancel: false,
- confirmColor: self.themeColor || '#FF6B9D'
- })
- break
- }
- }
- }).exec()
- }
- },
- }
- </script>
- <style scoped>
- .tianpan-card {
- margin: 20rpx 30rpx;
- background: #FFFFFF;
- border-radius: 24rpx;
- padding: 28rpx 24rpx;
- /* 动态主题阴影 */
- box-shadow: 0 4rpx 16rpx var(--theme-shadow, rgba(255, 107, 157, 0.12)),
- 0 2rpx 4rpx rgba(0, 0, 0, 0.04);
- border: 1rpx solid var(--theme-border, rgba(255, 107, 157, 0.08));
- overflow: hidden;
- }
- /* ===== 头部 ===== */
- .tp-header {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 24rpx;
- padding-bottom: 20rpx;
- border-bottom: 1rpx solid var(--theme-border, rgba(255, 107, 157, 0.10));
- }
- .tp-header-left {
- display: flex;
- flex-direction: row;
- align-items: center;
- }
- .tp-icon-badge {
- width: 64rpx;
- height: 64rpx;
- border-radius: 20rpx;
- background: var(--theme-gradient, linear-gradient(135deg, #FF6B9D, #FF8FB1));
- display: flex;
- align-items: center;
- justify-content: center;
- margin-right: 16rpx;
- box-shadow: 0 4rpx 12rpx var(--theme-shadow, rgba(255, 107, 157, 0.30));
- }
- .tp-icon-text {
- font-size: 32rpx;
- color: #FFFFFF;
- }
- .tp-header-info {
- display: flex;
- flex-direction: column;
- }
- .tp-title {
- font-size: 30rpx;
- font-weight: 700;
- color: #1E293B;
- }
- .tp-subtitle {
- font-size: 22rpx;
- color: #94A3B8;
- margin-top: 2rpx;
- }
- .tp-header-action {
- width: 56rpx;
- height: 56rpx;
- border-radius: 28rpx;
- background: var(--theme-lighter, #FFF0F3);
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .tp-action-text {
- font-size: 28rpx;
- color: var(--theme-color, #FF6B9D);
- font-weight: 600;
- }
- .tp-header-action:active {
- opacity: 0.7;
- }
- /* ===== 三栏 body ===== */
- .tp-body {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- }
- .tp-col {
- flex: 1;
- display: flex;
- flex-direction: column;
- align-items: center;
- padding: 16rpx 8rpx;
- border-radius: 20rpx;
- background: #FAFBFC;
- }
- .tp-col-fortune {
- margin-right: 12rpx;
- }
- .tp-col-mood {
- margin-left: 6rpx;
- margin-right: 6rpx;
- }
- .tp-col-direction {
- margin-left: 12rpx;
- }
- /* 列通用 */
- .tp-col-icon {
- font-size: 36rpx;
- margin-bottom: 8rpx;
- }
- .tp-col-label {
- font-size: 22rpx;
- color: #94A3B8;
- margin-bottom: 12rpx;
- font-weight: 500;
- }
- /* 运势 */
- .tp-fortune-badge {
- padding: 6rpx 20rpx;
- border-radius: 20rpx;
- margin-bottom: 8rpx;
- }
- .fortune-level-0 {
- background: #FFEBEE;
- }
- .fortune-level-0 .tp-fortune-text {
- color: #D32F2F;
- }
- .fortune-level-1 {
- background: #FFF3E0;
- }
- .fortune-level-1 .tp-fortune-text {
- color: #E65100;
- }
- .fortune-level-2 {
- background: #FFFDE7;
- }
- .fortune-level-2 .tp-fortune-text {
- color: #F9A825;
- }
- .fortune-level-3 {
- background: #F3E5F5;
- }
- .fortune-level-3 .tp-fortune-text {
- color: #7B1FA2;
- }
- .fortune-level-4 {
- background: #FFCDD2;
- }
- .fortune-level-4 .tp-fortune-text {
- color: #B71C1C;
- }
- .tp-fortune-text {
- font-size: 26rpx;
- font-weight: 700;
- }
- .tp-fortune-desc {
- font-size: 20rpx;
- color: #94A3B8;
- text-align: center;
- line-height: 1.4;
- }
- /* 心情 */
- .tp-mood-value {
- font-size: 26rpx;
- font-weight: 600;
- color: #1E293B;
- margin-bottom: 10rpx;
- }
- .tp-mood-bar-track {
- width: 100%;
- height: 10rpx;
- background: #E2E8F0;
- border-radius: 5rpx;
- overflow: hidden;
- }
- .tp-mood-bar-fill {
- height: 100%;
- background: var(--theme-gradient, linear-gradient(90deg, #FF6B9D, #FF8FB1));
- border-radius: 5rpx;
- transition: width 0.5s;
- }
- /* 吉位罗盘 */
- .tp-compass-wrap {
- width: 120rpx;
- height: 120rpx;
- margin-bottom: 8rpx;
- }
- .tp-compass-canvas {
- width: 120rpx;
- height: 120rpx;
- }
- .tp-direction-value {
- font-size: 24rpx;
- font-weight: 700;
- color: var(--theme-color, #FF6B9D);
- }
- /* ===== 底部提示 ===== */
- .tp-footer {
- display: flex;
- flex-direction: row;
- align-items: flex-start;
- margin-top: 20rpx;
- padding: 16rpx;
- background: var(--theme-lighter, #FFF5F0);
- border-radius: 14rpx;
- }
- .tp-footer-icon {
- font-size: 24rpx;
- margin-right: 8rpx;
- flex-shrink: 0;
- }
- .tp-footer-text {
- font-size: 22rpx;
- color: #8B6914;
- line-height: 1.5;
- flex: 1;
- }
- /* ===== 今日宜忌 ===== */
- .tp-advice-section {
- margin: 20rpx 0;
- padding: 16rpx;
- background-color: rgba(255, 255, 255, 0.7);
- border-radius: 16rpx;
- }
- .tp-advice-item {
- display: flex;
- flex-direction: row;
- align-items: center;
- margin-bottom: 10rpx;
- }
- .tp-advice-item:last-child {
- margin-bottom: 0;
- }
- .tp-advice-icon {
- font-size: 24rpx;
- color: var(--theme-color, #FF6B9D);
- margin-right: 12rpx;
- }
- .tp-advice-label {
- font-size: 22rpx;
- font-weight: 600;
- color: var(--theme-color, #FF6B9D);
- margin-right: 12rpx;
- min-width: 60rpx;
- }
- .tp-advice-text {
- font-size: 22rpx;
- color: #374151;
- flex: 1;
- line-height: 1.4;
- }
- /* ===== 查看详情按钮 ===== */
- .tp-detail-btn {
- margin-top: 16rpx;
- text-align: center;
- padding: 14rpx;
- background: var(--theme-lighter, linear-gradient(135deg, #FFF0F3, #FFE0E8));
- border-radius: 14rpx;
- }
- .tp-detail-btn:active {
- opacity: 0.7;
- }
- .tp-detail-text {
- font-size: 24rpx;
- color: var(--theme-color, #FF6B9D);
- font-weight: 600;
- }
- /* ===== 传统文化信息 ===== */
- .tp-traditional {
- margin-top: 20rpx;
- padding-top: 20rpx;
- border-top: 1rpx solid var(--theme-border, rgba(255, 107, 157, 0.10));
- }
- .tp-trad-row {
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- margin-bottom: 16rpx;
- }
- .tp-trad-item {
- display: flex;
- flex-direction: column;
- align-items: center;
- flex: 1;
- min-width: 120rpx;
- margin-bottom: 8rpx;
- }
- .tp-trad-label {
- font-size: 20rpx;
- color: #94A3B8;
- margin-bottom: 6rpx;
- }
- .tp-trad-value {
- font-size: 26rpx;
- font-weight: 600;
- color: var(--theme-color, #FF6B9D);
- }
- .tp-trad-bar-track {
- width: 80%;
- height: 8rpx;
- background: #E2E8F0;
- border-radius: 4rpx;
- overflow: hidden;
- margin-bottom: 4rpx;
- }
- .tp-trad-bar-fill {
- height: 100%;
- border-radius: 4rpx;
- }
- .tp-trad-val {
- font-size: 20rpx;
- color: #64748B;
- }
- .tp-trad-row-split {
- justify-content: space-around;
- }
- .tp-trad-tag {
- display: flex;
- flex-direction: row;
- align-items: center;
- background: var(--theme-lighter, #FFF0F3);
- padding: 8rpx 20rpx;
- border-radius: 20rpx;
- }
- .tp-trad-tag-icon {
- font-size: 24rpx;
- margin-right: 8rpx;
- }
- .tp-trad-tag-text {
- font-size: 24rpx;
- font-weight: 600;
- color: var(--theme-color, #FF6B9D);
- }
- </style>
|