constellation.vue 25 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129
  1. <template>
  2. <view class="constellation-page">
  3. <view class="status-bar-placeholder" :style="{height: statusBarHeight + 'px', backgroundColor: '#FFFFFF'}"></view>
  4. <!-- 自定义导航栏 -->
  5. <view class="custom-nav">
  6. <view class="nav-left" @click="goBack">
  7. <text class="back-icon">←</text>
  8. </view>
  9. <view class="nav-title">星座卡片</view>
  10. <view class="nav-right"></view>
  11. </view>
  12. <!-- 生日选择区域 -->
  13. <view class="birthday-selection-section" v-if="!hasResult">
  14. <view class="selection-card">
  15. <view class="card-title">✨ 星座运势测算</view>
  16. <view class="card-subtitle">选择你的生日,查看专属星座运势</view>
  17. <!-- 生日选择器 -->
  18. <view class="birthday-picker-wrapper">
  19. <view class="picker-label">选择生日</view>
  20. <picker mode="date" :value="birthday" @change="onBirthdayChange" :start="startDate" :end="endDate">
  21. <view class="birthday-display">
  22. <text class="birthday-icon">📅</text>
  23. <text class="birthday-text">{{ birthdayDisplay }}</text>
  24. </view>
  25. </picker>
  26. </view>
  27. <!-- 星座显示 -->
  28. <view class="constellation-preview" v-if="currentConstellation">
  29. <view class="constellation-info">
  30. <text class="constellation-emoji">{{ currentConstellation.emoji }}</text>
  31. <text class="constellation-name">{{ currentConstellation.name }}</text>
  32. </view>
  33. <text class="constellation-desc">{{ currentConstellation.description }}</text>
  34. </view>
  35. <button class="submit-btn" @click="handleSubmit" :disabled="!birthday">
  36. 查看运势
  37. </button>
  38. </view>
  39. <!-- 装饰性星座图标 -->
  40. <view class="constellation-icons">
  41. <text class="constellation-icon" v-for="(constellation, index) in allConstellations" :key="index">
  42. {{ constellation.emoji }}
  43. </text>
  44. </view>
  45. </view>
  46. <!-- 运势结果 -->
  47. <view class="result-section" v-if="hasResult">
  48. <!-- 星座标题卡片 -->
  49. <view class="constellation-title-card">
  50. <view class="constellation-header">
  51. <view class="constellation-main">
  52. <text class="constellation-emoji-large">{{ currentConstellation.emoji }}</text>
  53. <view class="constellation-info-main">
  54. <text class="constellation-name-large">{{ currentConstellation.name }}</text>
  55. <text class="constellation-period">{{ currentConstellation.period }}</text>
  56. </view>
  57. </view>
  58. <view class="constellation-traits">
  59. <view class="trait-tag" v-for="(trait, index) in currentConstellation.traits" :key="index">
  60. {{ trait }}
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. <!-- 今日运势 -->
  66. <view class="fortune-section">
  67. <view class="section-title">🔮 今日运势</view>
  68. <view class="fortune-card">
  69. <view class="fortune-summary">
  70. <view class="fortune-score-wrapper">
  71. <text class="fortune-score">{{ todayFortune.overallScore }}</text>
  72. <text class="fortune-unit">分</text>
  73. </view>
  74. <view class="fortune-level" :style="{background: todayFortune.levelColor}">
  75. {{ todayFortune.level }}
  76. </view>
  77. </view>
  78. <view class="fortune-details">
  79. <view class="fortune-item" v-for="(item, index) in todayFortune.details" :key="index">
  80. <view class="fortune-item-header">
  81. <text class="fortune-item-icon">{{ item.icon }}</text>
  82. <text class="fortune-item-label">{{ item.label }}</text>
  83. </view>
  84. <view class="fortune-score-bar">
  85. <view class="score-bar">
  86. <view class="score-fill" :style="{width: item.score + '%', background: item.color}"></view>
  87. </view>
  88. <text class="score-text">{{ item.score }}%</text>
  89. </view>
  90. </view>
  91. </view>
  92. <view class="fortune-advice">
  93. <text class="advice-label">💡 今日建议</text>
  94. <text class="advice-content">{{ todayFortune.advice }}</text>
  95. </view>
  96. </view>
  97. </view>
  98. <!-- 星座匹配 -->
  99. <view class="match-section">
  100. <view class="section-title">💕 星座匹配</view>
  101. <view class="match-card">
  102. <view class="match-best">
  103. <text class="match-category-title">最佳匹配</text>
  104. <view class="match-constellation-list">
  105. <view class="match-constellation-item best" v-for="(match, index) in constellationMatch.best" :key="index">
  106. <text class="match-emoji">{{ match.emoji }}</text>
  107. <text class="match-name">{{ match.name }}</text>
  108. <text class="match-score">{{ match.score }}%</text>
  109. </view>
  110. </view>
  111. </view>
  112. <view class="match-good">
  113. <text class="match-category-title">不错匹配</text>
  114. <view class="match-constellation-list">
  115. <view class="match-constellation-item good" v-for="(match, index) in constellationMatch.good" :key="index">
  116. <text class="match-emoji">{{ match.emoji }}</text>
  117. <text class="match-name">{{ match.name }}</text>
  118. <text class="match-score">{{ match.score }}%</text>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. </view>
  124. <!-- 幸运元素 -->
  125. <view class="lucky-section">
  126. <view class="section-title">🍀 今日幸运</view>
  127. <view class="lucky-grid">
  128. <view class="lucky-item" v-for="(item, index) in luckyElements" :key="index">
  129. <view class="lucky-icon-wrapper" :style="{background: item.bgColor}">
  130. <text class="lucky-icon">{{ item.icon }}</text>
  131. </view>
  132. <text class="lucky-label">{{ item.label }}</text>
  133. <text class="lucky-value">{{ item.value }}</text>
  134. </view>
  135. </view>
  136. </view>
  137. <!-- 星座特质详解 -->
  138. <view class="traits-section">
  139. <view class="section-title">🌟 星座特质</view>
  140. <view class="traits-card">
  141. <view class="trait-detail" v-for="(trait, index) in constellationTraits" :key="index">
  142. <view class="trait-header">
  143. <text class="trait-icon">{{ trait.icon }}</text>
  144. <text class="trait-title">{{ trait.title }}</text>
  145. </view>
  146. <text class="trait-content">{{ trait.content }}</text>
  147. </view>
  148. </view>
  149. </view>
  150. <!-- 重新测算 -->
  151. <view class="retest-btn" @click="handleRetest">
  152. 重新测算
  153. </view>
  154. <!-- 数据来源说明 -->
  155. <view class="data-source" :class="{'api-source': isAPIData}">
  156. <text class="source-icon">{{ isAPIData ? '✓' : 'ℹ️' }}</text>
  157. <view class="source-content">
  158. <text class="source-text">数据来源:{{ dataSourceText }}</text>
  159. <text class="source-time">更新时间:{{ updateTime }}</text>
  160. </view>
  161. </view>
  162. <!-- 免责声明 -->
  163. <view class="disclaimer">
  164. <view class="disclaimer-title">⚠️ 免责声明</view>
  165. <view class="disclaimer-text">
  166. 本星座运势基于占星学理论和统计数据分析,仅供娱乐参考,不作为人生决策依据。
  167. 个人运势受多种因素影响,建议理性对待星座内容。
  168. 真正的幸福需要自己努力争取和创造。
  169. </view>
  170. </view>
  171. </view>
  172. <!-- 底部占位 -->
  173. <view class="bottom-placeholder"></view>
  174. </view>
  175. </template>
  176. <script>
  177. import { getConstellation } from '@/utils/util.js'
  178. import constellationUtil from '@/utils/constellation.js'
  179. export default {
  180. data() {
  181. return {
  182. statusBarHeight: 0,
  183. // 生日相关
  184. birthday: uni.getStorageSync("userInfo").birthDate,
  185. birthdayDisplay: '请选择生日',
  186. startDate: '1950-01-01',
  187. endDate: '2010-12-31',
  188. // 星座相关
  189. currentConstellation: null,
  190. hasResult: false,
  191. updateTime: '',
  192. // 运势数据
  193. todayFortune: null,
  194. constellationMatch: null,
  195. luckyElements: [],
  196. constellationTraits: [],
  197. // 所有星座数据
  198. allConstellations: constellationUtil.getAllConstellations()
  199. }
  200. },
  201. computed: {
  202. // 是否使用API数据
  203. isAPIData() {
  204. return this.todayFortune?.source === 'tianapi'
  205. },
  206. // 数据来源文本
  207. dataSourceText() {
  208. if (this.isAPIData) {
  209. return '天行数据专业API'
  210. }
  211. return '星座占星学理论'
  212. }
  213. },
  214. onLoad() {
  215. this.initData()
  216. // 获取状态栏高度
  217. const systemInfo = uni.getSystemInfoSync()
  218. this.statusBarHeight = systemInfo.statusBarHeight
  219. },
  220. methods: {
  221. initData() {
  222. // 设置更新时间
  223. const date = new Date()
  224. const year = date.getFullYear()
  225. const month = parseInt(date.getMonth() + 1)
  226. const day = parseInt(date.getDate())
  227. this.updateTime = `${year}年${month}月${day}日`
  228. },
  229. // 生日选择
  230. onBirthdayChange(e) {
  231. this.birthday = e.detail.value
  232. this.birthdayDisplay = this.formatBirthday(this.birthday)
  233. // 实时计算星座
  234. const constellationName = getConstellation(this.birthday)
  235. this.currentConstellation = this.allConstellations.find(c => c.name === constellationName)
  236. },
  237. // 格式化生日显示
  238. formatBirthday(birthday) {
  239. if (!birthday) return '请选择生日'
  240. const date = new Date(birthday)
  241. const month = date.getMonth() + 1
  242. const day = date.getDate()
  243. return `${month}月${day}日`
  244. },
  245. // 提交查看运势
  246. async handleSubmit() {
  247. if (!this.birthday) {
  248. uni.showToast({
  249. title: '请选择生日',
  250. icon: 'none'
  251. })
  252. return
  253. }
  254. // 显示加载中
  255. uni.showLoading({
  256. title: '运势分析中...',
  257. mask: true
  258. })
  259. try {
  260. // 生成运势数据
  261. await this.generateFortuneData()
  262. this.hasResult = true
  263. // 保存到本地存储
  264. uni.setStorageSync('constellationFortune', {
  265. birthday: this.birthday,
  266. constellation: this.currentConstellation,
  267. fortune: this.todayFortune,
  268. lastUpdate: new Date().getTime()
  269. })
  270. } catch (error) {
  271. uni.showToast({
  272. title: '分析异常,请重试',
  273. icon: 'none',
  274. duration: 2000
  275. })
  276. } finally {
  277. uni.hideLoading()
  278. }
  279. },
  280. // 生成运势数据
  281. async generateFortuneData() {
  282. try {
  283. // 获取星座运势(优先API,失败时使用本地数据)
  284. const fortuneData = await constellationUtil.getConstellationFortune(this.currentConstellation.name)
  285. // 转换数据格式为页面需要的格式
  286. this.todayFortune = {
  287. overallScore: fortuneData.overall || 80,
  288. level: fortuneData.level || '良好',
  289. levelColor: fortuneData.levelColor || 'linear-gradient(135deg, #2196F3 0%, #64B5F6 100%)',
  290. details: [
  291. {
  292. label: '爱情运',
  293. icon: '💕',
  294. score: fortuneData.love || 75,
  295. color: 'linear-gradient(135deg, #E91E63 0%, #FF6B9D 100%)'
  296. },
  297. {
  298. label: '事业运',
  299. icon: '💼',
  300. score: fortuneData.career || 78,
  301. color: 'linear-gradient(135deg, #2196F3 0%, #64B5F6 100%)'
  302. },
  303. {
  304. label: '财运',
  305. icon: '💰',
  306. score: fortuneData.wealth || 72,
  307. color: 'linear-gradient(135deg, #FF9800 0%, #FFB74D 100%)'
  308. },
  309. {
  310. label: '健康运',
  311. icon: '🌿',
  312. score: fortuneData.health || 80,
  313. color: 'linear-gradient(135deg, #4CAF50 0%, #81C784 100%)'
  314. }
  315. ],
  316. advice: fortuneData.advice || '今天是美好的一天,保持积极心态!',
  317. source: fortuneData.source || 'local'
  318. }
  319. // 生成星座匹配
  320. this.constellationMatch = constellationUtil.generateConstellationMatch(this.currentConstellation.name)
  321. // 生成幸运元素
  322. this.luckyElements = constellationUtil.generateLuckyElements(this.currentConstellation.name)
  323. // 生成星座特质
  324. this.constellationTraits = constellationUtil.generateConstellationTraits(this.currentConstellation.name)
  325. } catch (error) {
  326. this.todayFortune = this.generateDefaultFortune()
  327. this.constellationMatch = { best: [], good: [] }
  328. this.luckyElements = []
  329. this.constellationTraits = []
  330. }
  331. },
  332. // 生成默认运势数据(异常情况下使用)
  333. generateDefaultFortune() {
  334. const scores = {
  335. overall: Math.floor(Math.random() * 30) + 70,
  336. love: Math.floor(Math.random() * 40) + 60,
  337. career: Math.floor(Math.random() * 40) + 60,
  338. wealth: Math.floor(Math.random() * 40) + 60,
  339. health: Math.floor(Math.random() * 40) + 60
  340. }
  341. const levels = ['一般', '良好', '极佳', '超棒']
  342. const levelColors = [
  343. 'linear-gradient(135deg, #9E9E9E 0%, #BDBDBD 100%)',
  344. 'linear-gradient(135deg, #2196F3 0%, #64B5F6 100%)',
  345. 'linear-gradient(135deg, #4CAF50 0%, #81C784 100%)',
  346. 'linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%)'
  347. ]
  348. const levelIndex = Math.floor(scores.overall / 25)
  349. const level = levels[Math.min(levelIndex, levels.length - 1)]
  350. const levelColor = levelColors[Math.min(levelIndex, levelColors.length - 1)]
  351. const advices = [
  352. '今天是展现个人魅力的好时机,保持积极心态!',
  353. '适合与他人合作,团队协作能带来意想不到的收获。',
  354. '财运不错,但要理性消费,避免冲动购买。',
  355. '健康运势平稳,适量运动有助提升整体状态。',
  356. '感情方面有新的进展,单身者有机会遇到心仪对象。'
  357. ]
  358. return {
  359. overallScore: scores.overall,
  360. level: level,
  361. levelColor: levelColor,
  362. details: [
  363. {
  364. label: '爱情运',
  365. icon: '💕',
  366. score: scores.love,
  367. color: 'linear-gradient(135deg, #E91E63 0%, #FF6B9D 100%)'
  368. },
  369. {
  370. label: '事业运',
  371. icon: '💼',
  372. score: scores.career,
  373. color: 'linear-gradient(135deg, #2196F3 0%, #64B5F6 100%)'
  374. },
  375. {
  376. label: '财运',
  377. icon: '💰',
  378. score: scores.wealth,
  379. color: 'linear-gradient(135deg, #FF9800 0%, #FFB74D 100%)'
  380. },
  381. {
  382. label: '健康运',
  383. icon: '🌿',
  384. score: scores.health,
  385. color: 'linear-gradient(135deg, #4CAF50 0%, #81C784 100%)'
  386. }
  387. ],
  388. advice: advices[Math.floor(Math.random() * advices.length)],
  389. source: 'local'
  390. }
  391. },
  392. // 重新测算
  393. handleRetest() {
  394. this.hasResult = false
  395. this.birthday = ''
  396. this.birthdayDisplay = '请选择生日'
  397. this.currentConstellation = null
  398. this.todayFortune = null
  399. this.constellationMatch = null
  400. this.luckyElements = []
  401. this.constellationTraits = []
  402. },
  403. // 返回
  404. goBack() {
  405. uni.navigateBack({
  406. delta: 1
  407. })
  408. }
  409. }
  410. }
  411. </script>
  412. <style lang="scss" scoped>
  413. .constellation-page {
  414. min-height: 100vh;
  415. background: linear-gradient(180deg, #FFF9F9 0%, #FFFFFF 50%);
  416. padding-bottom: 40rpx;
  417. // padding-top: v-bind(statusBarHeight + 'px');
  418. }
  419. /* 自定义导航栏 */
  420. .custom-nav {
  421. position: relative;
  422. display: flex;
  423. align-items: center;
  424. justify-content: space-between;
  425. height: 88rpx;
  426. // height: auto;
  427. padding: 0 30rpx;
  428. // padding: v-bind(statusBarHeight + 'px') 30rpx 30rpx;
  429. // padding: 0 30rpx 20rpx;
  430. background-color: #FFFFFF;
  431. border-bottom: 1rpx solid #F0F0F0;
  432. .nav-left {
  433. width: 80rpx;
  434. .back-icon {
  435. font-size: 40rpx;
  436. color: #333333;
  437. }
  438. }
  439. .nav-title {
  440. position: absolute;
  441. left: 50%;
  442. transform: translateX(-50%);
  443. font-size: 34rpx;
  444. font-weight: 600;
  445. color: #333333;
  446. }
  447. .nav-right {
  448. width: 80rpx;
  449. }
  450. }
  451. /* 生日选择区域 */
  452. .birthday-selection-section {
  453. padding: 60rpx 30rpx;
  454. display: flex;
  455. flex-direction: column;
  456. align-items: center;
  457. .selection-card {
  458. width: 100%;
  459. background-color: #FFFFFF;
  460. border-radius: 30rpx;
  461. padding: 60rpx 40rpx;
  462. box-shadow: 0 8rpx 30rpx rgba(156, 39, 176, 0.1);
  463. text-align: center;
  464. .card-title {
  465. font-size: 40rpx;
  466. font-weight: bold;
  467. color: #333333;
  468. margin-bottom: 15rpx;
  469. }
  470. .card-subtitle {
  471. font-size: 26rpx;
  472. color: #999999;
  473. margin-bottom: 50rpx;
  474. }
  475. .birthday-picker-wrapper {
  476. margin-bottom: 30rpx;
  477. text-align: left;
  478. .picker-label {
  479. font-size: 28rpx;
  480. color: #666666;
  481. margin-bottom: 15rpx;
  482. }
  483. .birthday-display {
  484. display: flex;
  485. align-items: center;
  486. justify-content: center;
  487. background-color: #F8F8F8;
  488. border-radius: 20rpx;
  489. padding: 25rpx 30rpx;
  490. border: 2rpx solid #9C27B0;
  491. transition: all 0.3s;
  492. .birthday-icon {
  493. font-size: 40rpx;
  494. margin-right: 15rpx;
  495. }
  496. .birthday-text {
  497. font-size: 32rpx;
  498. color: #333333;
  499. font-weight: 500;
  500. }
  501. }
  502. &:active .birthday-display {
  503. background-color: #F3E5F5;
  504. transform: scale(0.98);
  505. }
  506. }
  507. .constellation-preview {
  508. background: linear-gradient(135deg, #F3E5F5 0%, #E1BEE7 100%);
  509. border-radius: 20rpx;
  510. padding: 30rpx;
  511. margin-bottom: 30rpx;
  512. text-align: center;
  513. .constellation-info {
  514. display: flex;
  515. align-items: center;
  516. justify-content: center;
  517. margin-bottom: 15rpx;
  518. .constellation-emoji {
  519. font-size: 60rpx;
  520. margin-right: 15rpx;
  521. }
  522. .constellation-name {
  523. font-size: 36rpx;
  524. color: #9C27B0;
  525. font-weight: 600;
  526. }
  527. }
  528. .constellation-desc {
  529. font-size: 24rpx;
  530. color: #666666;
  531. }
  532. }
  533. .submit-btn {
  534. width: 100%;
  535. height: 90rpx;
  536. background: linear-gradient(135deg, #9C27B0 0%, #E1BEE7 100%);
  537. color: #FFFFFF;
  538. font-size: 32rpx;
  539. font-weight: 600;
  540. border-radius: 45rpx;
  541. border: none;
  542. box-shadow: 0 8rpx 20rpx rgba(156, 39, 176, 0.3);
  543. &:disabled {
  544. opacity: 0.5;
  545. }
  546. &:active:not(:disabled) {
  547. opacity: 0.9;
  548. }
  549. }
  550. }
  551. .constellation-icons {
  552. display: flex;
  553. flex-wrap: wrap;
  554. justify-content: center;
  555. gap: 20rpx;
  556. margin-top: 50rpx;
  557. opacity: 0.3;
  558. .constellation-icon {
  559. font-size: 48rpx;
  560. animation: float 3s ease-in-out infinite;
  561. &:nth-child(2n) {
  562. animation-delay: 0.5s;
  563. }
  564. &:nth-child(3n) {
  565. animation-delay: 1s;
  566. }
  567. }
  568. }
  569. }
  570. @keyframes float {
  571. 0%, 100% {
  572. transform: translateY(0);
  573. }
  574. 50% {
  575. transform: translateY(-10rpx);
  576. }
  577. }
  578. /* 结果区域 */
  579. .result-section {
  580. padding: 30rpx 25rpx 40rpx 25rpx;
  581. }
  582. /* 星座标题卡片 */
  583. .constellation-title-card {
  584. background: linear-gradient(135deg, #9C27B0 0%, #E1BEE7 100%);
  585. border-radius: 32rpx;
  586. padding: 50rpx 40rpx;
  587. text-align: center;
  588. box-shadow: 0 12rpx 40rpx rgba(156, 39, 176, 0.25);
  589. margin-bottom: 40rpx;
  590. .constellation-header {
  591. .constellation-main {
  592. display: flex;
  593. align-items: center;
  594. justify-content: center;
  595. margin-bottom: 30rpx;
  596. .constellation-emoji-large {
  597. font-size: 120rpx;
  598. margin-right: 30rpx;
  599. }
  600. .constellation-info-main {
  601. display: flex;
  602. flex-direction: column;
  603. align-items: flex-start;
  604. .constellation-name-large {
  605. font-size: 42rpx;
  606. font-weight: bold;
  607. color: #FFFFFF;
  608. margin-bottom: 10rpx;
  609. }
  610. .constellation-period {
  611. font-size: 24rpx;
  612. color: rgba(255, 255, 255, 0.8);
  613. }
  614. }
  615. }
  616. .constellation-traits {
  617. display: flex;
  618. justify-content: center;
  619. gap: 15rpx;
  620. flex-wrap: wrap;
  621. .trait-tag {
  622. background-color: rgba(255, 255, 255, 0.2);
  623. color: #FFFFFF;
  624. font-size: 24rpx;
  625. padding: 8rpx 16rpx;
  626. border-radius: 20rpx;
  627. backdrop-filter: blur(10rpx);
  628. }
  629. }
  630. }
  631. }
  632. /* 通用标题 */
  633. .section-title {
  634. font-size: 36rpx;
  635. font-weight: 600;
  636. color: #333333;
  637. margin-bottom: 25rpx;
  638. padding: 0 10rpx;
  639. display: flex;
  640. align-items: center;
  641. justify-content: flex-start;
  642. }
  643. /* 今日运势 */
  644. .fortune-section {
  645. margin-bottom: 40rpx;
  646. .fortune-card {
  647. background-color: #FFFFFF;
  648. border-radius: 24rpx;
  649. padding: 40rpx 30rpx;
  650. box-shadow: 0 6rpx 24rpx rgba(0, 0, 0, 0.08);
  651. .fortune-summary {
  652. display: flex;
  653. justify-content: space-between;
  654. align-items: center;
  655. margin-bottom: 30rpx;
  656. padding-bottom: 25rpx;
  657. border-bottom: 1rpx solid #F0F0F0;
  658. .fortune-score-wrapper {
  659. display: flex;
  660. align-items: baseline;
  661. .fortune-score {
  662. font-size: 72rpx;
  663. font-weight: bold;
  664. color: #9C27B0;
  665. line-height: 1;
  666. }
  667. .fortune-unit {
  668. font-size: 28rpx;
  669. color: #666666;
  670. margin-left: 8rpx;
  671. }
  672. }
  673. .fortune-level {
  674. padding: 12rpx 30rpx;
  675. border-radius: 30rpx;
  676. font-size: 28rpx;
  677. color: #FFFFFF;
  678. font-weight: 600;
  679. }
  680. }
  681. .fortune-details {
  682. margin-bottom: 30rpx;
  683. .fortune-item {
  684. margin-bottom: 25rpx;
  685. &:last-child {
  686. margin-bottom: 0;
  687. }
  688. .fortune-item-header {
  689. display: flex;
  690. align-items: center;
  691. margin-bottom: 12rpx;
  692. .fortune-item-icon {
  693. font-size: 28rpx;
  694. margin-right: 12rpx;
  695. }
  696. .fortune-item-label {
  697. font-size: 28rpx;
  698. color: #333333;
  699. font-weight: 500;
  700. }
  701. }
  702. .fortune-score-bar {
  703. display: flex;
  704. align-items: center;
  705. .score-bar {
  706. flex: 1;
  707. height: 12rpx;
  708. background-color: #F0F0F0;
  709. border-radius: 6rpx;
  710. overflow: hidden;
  711. margin-right: 15rpx;
  712. .score-fill {
  713. height: 100%;
  714. border-radius: 6rpx;
  715. transition: width 0.6s ease;
  716. }
  717. }
  718. .score-text {
  719. font-size: 24rpx;
  720. color: #9C27B0;
  721. font-weight: 600;
  722. min-width: 50rpx;
  723. text-align: right;
  724. }
  725. }
  726. }
  727. }
  728. .fortune-advice {
  729. background: linear-gradient(135deg, #F3E5F5 0%, #FFEEF5 100%);
  730. border-radius: 15rpx;
  731. padding: 25rpx;
  732. .advice-label {
  733. font-size: 26rpx;
  734. color: #9C27B0;
  735. font-weight: 600;
  736. display: block;
  737. margin-bottom: 12rpx;
  738. }
  739. .advice-content {
  740. font-size: 28rpx;
  741. color: #333333;
  742. line-height: 1.6;
  743. }
  744. }
  745. }
  746. }
  747. /* 星座匹配 */
  748. .match-section {
  749. margin-bottom: 40rpx;
  750. .match-card {
  751. background-color: #FFFFFF;
  752. border-radius: 24rpx;
  753. padding: 30rpx;
  754. box-shadow: 0 6rpx 24rpx rgba(0, 0, 0, 0.08);
  755. .match-best, .match-good {
  756. margin-bottom: 30rpx;
  757. &:last-child {
  758. margin-bottom: 0;
  759. }
  760. .match-category-title {
  761. font-size: 30rpx;
  762. color: #333333;
  763. font-weight: 600;
  764. margin-bottom: 20rpx;
  765. display: block;
  766. }
  767. .match-constellation-list {
  768. display: flex;
  769. gap: 15rpx;
  770. flex-wrap: wrap;
  771. .match-constellation-item {
  772. display: flex;
  773. flex-direction: column;
  774. align-items: center;
  775. padding: 20rpx 15rpx;
  776. border-radius: 15rpx;
  777. min-width: 120rpx;
  778. &.best {
  779. background: linear-gradient(135deg, #FFE5EE 0%, #FFF0F5 100%);
  780. border: 2rpx solid #E91E63;
  781. }
  782. &.good {
  783. background: linear-gradient(135deg, #E3F2FD 0%, #F0F8FF 100%);
  784. border: 2rpx solid #2196F3;
  785. }
  786. .match-emoji {
  787. font-size: 36rpx;
  788. margin-bottom: 8rpx;
  789. }
  790. .match-name {
  791. font-size: 24rpx;
  792. color: #333333;
  793. margin-bottom: 5rpx;
  794. }
  795. .match-score {
  796. font-size: 22rpx;
  797. font-weight: 600;
  798. }
  799. &.best .match-score {
  800. color: #E91E63;
  801. }
  802. &.good .match-score {
  803. color: #2196F3;
  804. }
  805. }
  806. }
  807. }
  808. }
  809. }
  810. /* 幸运元素 */
  811. .lucky-section {
  812. margin-bottom: 40rpx;
  813. .lucky-grid {
  814. display: grid;
  815. grid-template-columns: repeat(2, 1fr);
  816. gap: 20rpx;
  817. .lucky-item {
  818. display: flex;
  819. flex-direction: column;
  820. align-items: center;
  821. background-color: #FFFFFF;
  822. border-radius: 15rpx;
  823. padding: 30rpx 20rpx;
  824. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.06);
  825. .lucky-icon-wrapper {
  826. width: 80rpx;
  827. height: 80rpx;
  828. border-radius: 50%;
  829. display: flex;
  830. align-items: center;
  831. justify-content: center;
  832. margin-bottom: 15rpx;
  833. .lucky-icon {
  834. font-size: 40rpx;
  835. }
  836. }
  837. .lucky-label {
  838. font-size: 24rpx;
  839. color: #999999;
  840. margin-bottom: 8rpx;
  841. }
  842. .lucky-value {
  843. font-size: 28rpx;
  844. color: #333333;
  845. font-weight: 600;
  846. }
  847. }
  848. }
  849. }
  850. /* 星座特质详解 */
  851. .traits-section {
  852. margin-bottom: 40rpx;
  853. .traits-card {
  854. background-color: #FFFFFF;
  855. border-radius: 24rpx;
  856. padding: 0;
  857. box-shadow: 0 6rpx 24rpx rgba(0, 0, 0, 0.08);
  858. overflow: hidden;
  859. .trait-detail {
  860. padding: 30rpx;
  861. border-bottom: 1rpx solid #F5F5F5;
  862. &:last-child {
  863. border-bottom: none;
  864. }
  865. .trait-header {
  866. display: flex;
  867. align-items: center;
  868. margin-bottom: 15rpx;
  869. .trait-icon {
  870. font-size: 32rpx;
  871. margin-right: 15rpx;
  872. }
  873. .trait-title {
  874. font-size: 30rpx;
  875. color: #9C27B0;
  876. font-weight: 600;
  877. }
  878. }
  879. .trait-content {
  880. font-size: 28rpx;
  881. color: #333333;
  882. line-height: 1.8;
  883. text-align: justify;
  884. }
  885. }
  886. }
  887. }
  888. /* 重新测算 */
  889. .retest-btn {
  890. text-align: center;
  891. padding: 30rpx 40rpx;
  892. font-size: 30rpx;
  893. color: #666666;
  894. background-color: #F8F8F8;
  895. border-radius: 25rpx;
  896. margin: 20rpx 20rpx 30rpx 20rpx;
  897. border: 2rpx solid #E0E0E0;
  898. &:active {
  899. color: #9C27B0;
  900. background-color: #F3E5F5;
  901. border-color: #9C27B0;
  902. }
  903. }
  904. /* 数据来源说明 */
  905. .data-source {
  906. display: flex;
  907. align-items: center;
  908. background-color: #E3F2FD;
  909. border-radius: 20rpx;
  910. padding: 25rpx 30rpx;
  911. margin-bottom: 30rpx;
  912. transition: all 0.3s;
  913. .source-icon {
  914. font-size: 32rpx;
  915. margin-right: 15rpx;
  916. }
  917. .source-content {
  918. flex: 1;
  919. display: flex;
  920. flex-direction: column;
  921. gap: 8rpx;
  922. .source-text {
  923. font-size: 28rpx;
  924. color: #1976D2;
  925. font-weight: 500;
  926. }
  927. .source-time {
  928. font-size: 24rpx;
  929. color: #64B5F6;
  930. }
  931. }
  932. // API数据特殊样式
  933. &.api-source {
  934. background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
  935. border-left: 6rpx solid #4CAF50;
  936. .source-icon {
  937. color: #4CAF50;
  938. }
  939. .source-text {
  940. color: #2E7D32;
  941. }
  942. .source-time {
  943. color: #66BB6A;
  944. }
  945. }
  946. }
  947. /* 免责声明 */
  948. .disclaimer {
  949. background-color: #FFF3E0;
  950. border-radius: 20rpx;
  951. padding: 30rpx;
  952. border-left: 6rpx solid #FF9800;
  953. margin: 0 10rpx;
  954. .disclaimer-title {
  955. font-size: 30rpx;
  956. font-weight: 600;
  957. color: #F57C00;
  958. margin-bottom: 20rpx;
  959. }
  960. .disclaimer-text {
  961. font-size: 26rpx;
  962. color: #666666;
  963. line-height: 2.0;
  964. text-align: justify;
  965. }
  966. }
  967. /* 底部占位 */
  968. .bottom-placeholder {
  969. height: 60rpx;
  970. }
  971. </style>