index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860
  1. <template>
  2. <view class="astrology-page">
  3. <!-- 自定义顶部导航栏 -->
  4. <view class="custom-nav">
  5. <view class="nav-left" @click="goBack">
  6. <text class="back-icon">←</text>
  7. </view>
  8. <view class="nav-title">星命运算</view>
  9. <view class="nav-right">
  10. <text class="menu-icon">⋯</text>
  11. </view>
  12. </view>
  13. <!-- 用户资料提示 -->
  14. <view class="profile-tip" v-if="!hasProfile" @click="goToProfile">
  15. <view class="tip-content">
  16. <text class="tip-icon">💫</text>
  17. <view class="tip-text-group">
  18. <text class="tip-title">完善资料,解锁专属运势</text>
  19. <text class="tip-desc">填写出生日期,获取更精准的运势分析</text>
  20. </view>
  21. <text class="tip-arrow">→</text>
  22. </view>
  23. </view>
  24. <!-- 用户信息卡片 -->
  25. <view class="user-profile-card" v-if="hasProfile" @click="goToProfile">
  26. <view class="user-avatar-wrapper">
  27. <image class="user-avatar" :src="userInfo.avatarUrl || userInfo.avatar || defaultAvatar" mode="aspectFill"></image>
  28. </view>
  29. <view class="user-info-content">
  30. <text class="user-nickname">{{ userInfo.nickname || '用户' }}</text>
  31. <view class="user-astro-tags">
  32. <view class="astro-tag" v-if="userConstellation">
  33. <text class="astro-icon">⭐</text>
  34. <text class="astro-text">{{ userConstellation }}</text>
  35. </view>
  36. <view class="astro-tag" v-if="userZodiac">
  37. <text class="astro-icon">🐲</text>
  38. <text class="astro-text">属{{ userZodiac }}</text>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="edit-icon">
  43. <text>›</text>
  44. </view>
  45. </view>
  46. <!-- 测算卡片区域 -->
  47. <view class="cards-section">
  48. <view class="card-item" v-for="(card, index) in cardList" :key="index" @click="handleCardClick(card)">
  49. <view class="card-icon">{{ card.icon }}</view>
  50. <view class="card-name">{{ card.name }}</view>
  51. </view>
  52. </view>
  53. <!-- 我的爱情运势 -->
  54. <view class="love-fortune">
  55. <view class="section-title">
  56. <text class="title-text">❤️ 我的爱情运势</text>
  57. <text class="title-date">{{ todayDate }}</text>
  58. </view>
  59. <view class="fortune-cards">
  60. <view class="fortune-card" v-for="(item, index) in loveFortune" :key="index">
  61. <view class="fortune-icon" :style="{background: item.color}">
  62. <text class="fortune-emoji">{{ item.icon }}</text>
  63. </view>
  64. <view class="fortune-info">
  65. <text class="fortune-label">{{ item.label }}</text>
  66. <view class="fortune-score">
  67. <view class="score-bar">
  68. <view class="score-fill" :style="{width: item.score + '%', background: item.color}"></view>
  69. </view>
  70. <text class="score-text">{{ item.score }}%</text>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. <!-- 本周脱单指数 -->
  77. <view class="single-index">
  78. <view class="section-title">
  79. <text class="title-text">📊 本周脱单指数</text>
  80. </view>
  81. <view class="index-card">
  82. <view class="index-header">
  83. <view class="index-score-wrapper">
  84. <text class="index-score">{{ singleIndex.score }}</text>
  85. <text class="index-unit">分</text>
  86. </view>
  87. <view class="index-level" :style="{background: singleIndex.levelColor}">
  88. {{ singleIndex.level }}
  89. </view>
  90. </view>
  91. <view class="index-tips">
  92. <view class="tip-item" v-for="(tip, index) in singleIndex.tips" :key="index">
  93. <text class="tip-icon">{{ tip.icon }}</text>
  94. <text class="tip-text">{{ tip.text }}</text>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. <!-- 每日幸运推荐 -->
  100. <view class="lucky-recommend">
  101. <view class="section-title">
  102. <text class="title-text">🎁 今日幸运推荐</text>
  103. </view>
  104. <view class="lucky-grid">
  105. <view class="lucky-item" v-for="(item, index) in luckyRecommend" :key="index">
  106. <view class="lucky-icon-wrapper" :style="{background: item.bgColor}">
  107. <text class="lucky-icon">{{ item.icon }}</text>
  108. </view>
  109. <text class="lucky-label">{{ item.label }}</text>
  110. <text class="lucky-value">{{ item.value }}</text>
  111. </view>
  112. </view>
  113. </view>
  114. <!-- 底部占位 -->
  115. <view class="bottom-placeholder"></view>
  116. </view>
  117. </template>
  118. <script>
  119. import fortuneUtil from '@/utils/fortune.js'
  120. import api from '@/utils/api.js'
  121. export default {
  122. data() {
  123. return {
  124. // 今日日期
  125. todayDate: '',
  126. // 用户信息
  127. userInfo: {},
  128. // 是否有完整资料
  129. hasProfile: false,
  130. // 用户星座和生肖
  131. userConstellation: '',
  132. userZodiac: '',
  133. // 默认头像
  134. defaultAvatar: 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI9FhqmIJtfQMh0LLicJxYS9xcd1u9YLnnvibALzycnOXLqm0JtmaNotzzSMyyibBtvBfzic6bg/0',
  135. // 测算卡片
  136. cardList: [
  137. { id: 1, name: '属相卡片', icon: '🐷', type: 'zodiac' },
  138. { id: 2, name: '星座卡片', icon: '♓', type: 'constellation' },
  139. { id: 3, name: '八字卡片', icon: '☯', type: 'bazi' },
  140. { id: 4, name: 'MBTI卡片', icon: '🧩', type: 'mbti' }
  141. ],
  142. // 我的爱情运势(动态计算)
  143. loveFortune: [],
  144. // 本周脱单指数(动态计算)
  145. singleIndex: {
  146. score: 75,
  147. level: '良好',
  148. levelColor: 'linear-gradient(135deg, #2196F3 0%, #03A9F4 100%)',
  149. tips: []
  150. },
  151. // 每日幸运推荐(动态计算)
  152. luckyRecommend: []
  153. }
  154. },
  155. onLoad() {
  156. this.initData()
  157. },
  158. onShow() {
  159. // 每次显示页面时重新加载用户信息和计算运势
  160. this.loadUserInfo()
  161. },
  162. methods: {
  163. // 初始化数据
  164. initData() {
  165. // 设置今日日期
  166. const date = new Date()
  167. const month = date.getMonth() + 1
  168. const day = date.getDate()
  169. const weekDays = ['日', '一', '二', '三', '四', '五', '六']
  170. const weekDay = weekDays[date.getDay()]
  171. this.todayDate = `${month}月${day}日 周${weekDay}`
  172. // 加载用户信息并计算运势
  173. this.loadUserInfo()
  174. },
  175. // 加载用户信息
  176. async loadUserInfo() {
  177. // 先从本地存储获取基础信息
  178. let userInfo = uni.getStorageSync('userInfo') || {}
  179. const userId = uni.getStorageSync('userId')
  180. // 如果有userId,从API获取最新用户信息
  181. if (userId) {
  182. try {
  183. const data = await api.user.getDetailInfo(userId)
  184. if (data) {
  185. // 合并API返回的数据
  186. userInfo = {
  187. ...userInfo,
  188. ...data,
  189. userId: userId
  190. }
  191. // 更新本地存储
  192. uni.setStorageSync('userInfo', userInfo)
  193. console.log('✅ 从API获取用户信息成功:', userInfo.nickname)
  194. }
  195. } catch (error) {
  196. console.error('❌ 获取用户信息失败:', error)
  197. }
  198. }
  199. this.userInfo = userInfo
  200. // 计算运势
  201. this.calculateFortune()
  202. },
  203. // 计算运势数据
  204. calculateFortune() {
  205. const fortuneData = fortuneUtil.getFullFortuneData(this.userInfo)
  206. this.hasProfile = fortuneData.hasProfile
  207. this.userConstellation = fortuneData.constellation || ''
  208. this.userZodiac = fortuneData.zodiac || ''
  209. this.loveFortune = fortuneData.loveFortune
  210. this.singleIndex = fortuneData.singleIndex
  211. this.luckyRecommend = fortuneData.luckyRecommend
  212. // 如果没有完整资料,显示提示
  213. if (!this.hasProfile) {
  214. console.log('用户资料不完整,显示默认运势数据')
  215. } else {
  216. console.log('根据用户资料计算运势:', {
  217. constellation: this.userConstellation,
  218. zodiac: this.userZodiac
  219. })
  220. }
  221. },
  222. // 返回上一页
  223. goBack() {
  224. // 检查页面栈
  225. const pages = getCurrentPages()
  226. if (pages.length > 1) {
  227. // 有上一页,正常返回
  228. uni.navigateBack({
  229. delta: 1
  230. })
  231. } else {
  232. // 没有上一页,跳转到首页
  233. uni.switchTab({
  234. url: '/pages/index/index'
  235. })
  236. }
  237. },
  238. // 卡片点击
  239. handleCardClick(card) {
  240. // 根据不同类型跳转到不同页面
  241. const pageMap = {
  242. 'zodiac': '/pages/astrology/zodiac',
  243. 'constellation': '/pages/astrology/constellation',
  244. 'bazi': '/pages/astrology/bazi',
  245. 'mbti': '/pages/astrology/mbti'
  246. }
  247. const page = pageMap[card.type]
  248. if (page) {
  249. uni.navigateTo({
  250. url: page
  251. })
  252. } else {
  253. uni.showToast({
  254. title: `${card.name}功能开发中`,
  255. icon: 'none'
  256. })
  257. }
  258. },
  259. // 跳转到个人资料页面
  260. goToProfile() {
  261. uni.navigateTo({
  262. url: '/pages/profile/index'
  263. })
  264. }
  265. }
  266. }
  267. </script>
  268. <style lang="scss" scoped>
  269. .astrology-page {
  270. min-height: 100vh;
  271. background: linear-gradient(180deg, #FFF9F9 0%, #FFFFFF 50%);
  272. padding-bottom: 40rpx;
  273. }
  274. /* 自定义导航栏 */
  275. .custom-nav {
  276. position: relative;
  277. display: flex;
  278. align-items: center;
  279. justify-content: space-between;
  280. height: 88rpx;
  281. padding: 0 30rpx;
  282. background-color: #FFFFFF;
  283. border-bottom: 1rpx solid #F0F0F0;
  284. .nav-left {
  285. width: 80rpx;
  286. .back-icon {
  287. font-size: 40rpx;
  288. color: #333333;
  289. }
  290. }
  291. .nav-title {
  292. position: absolute;
  293. left: 50%;
  294. transform: translateX(-50%);
  295. font-size: 34rpx;
  296. font-weight: 600;
  297. color: #333333;
  298. }
  299. .nav-right {
  300. width: 80rpx;
  301. text-align: right;
  302. .menu-icon {
  303. font-size: 40rpx;
  304. color: #333333;
  305. }
  306. }
  307. }
  308. /* 用户资料提示 */
  309. .profile-tip {
  310. margin: 20rpx 30rpx;
  311. background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
  312. border-radius: 16rpx;
  313. padding: 24rpx;
  314. box-shadow: 0 4rpx 12rpx rgba(255, 152, 0, 0.15);
  315. .tip-content {
  316. display: flex;
  317. align-items: center;
  318. .tip-icon {
  319. font-size: 40rpx;
  320. margin-right: 20rpx;
  321. }
  322. .tip-text-group {
  323. flex: 1;
  324. .tip-title {
  325. font-size: 28rpx;
  326. font-weight: 600;
  327. color: #E65100;
  328. display: block;
  329. margin-bottom: 6rpx;
  330. }
  331. .tip-desc {
  332. font-size: 24rpx;
  333. color: #FF8F00;
  334. }
  335. }
  336. .tip-arrow {
  337. font-size: 32rpx;
  338. color: #E65100;
  339. font-weight: bold;
  340. }
  341. }
  342. }
  343. /* 用户信息卡片 */
  344. .user-profile-card {
  345. display: flex;
  346. align-items: center;
  347. margin: 20rpx 30rpx;
  348. padding: 24rpx;
  349. background: linear-gradient(135deg, #FFFFFF 0%, #FFF9FB 100%);
  350. border-radius: 20rpx;
  351. box-shadow: 0 4rpx 16rpx rgba(233, 30, 99, 0.1);
  352. border: 1rpx solid rgba(233, 30, 99, 0.1);
  353. .user-avatar-wrapper {
  354. width: 100rpx;
  355. height: 100rpx;
  356. border-radius: 50%;
  357. overflow: hidden;
  358. margin-right: 24rpx;
  359. border: 4rpx solid #FFE4EC;
  360. box-shadow: 0 4rpx 12rpx rgba(233, 30, 99, 0.15);
  361. .user-avatar {
  362. width: 100%;
  363. height: 100%;
  364. }
  365. }
  366. .user-info-content {
  367. flex: 1;
  368. .user-nickname {
  369. font-size: 32rpx;
  370. font-weight: 600;
  371. color: #333333;
  372. display: block;
  373. margin-bottom: 12rpx;
  374. }
  375. .user-astro-tags {
  376. display: flex;
  377. gap: 16rpx;
  378. .astro-tag {
  379. display: flex;
  380. align-items: center;
  381. background: linear-gradient(135deg, #FCE4EC 0%, #F8BBD9 100%);
  382. padding: 8rpx 16rpx;
  383. border-radius: 20rpx;
  384. .astro-icon {
  385. font-size: 22rpx;
  386. margin-right: 6rpx;
  387. }
  388. .astro-text {
  389. font-size: 24rpx;
  390. color: #E91E63;
  391. font-weight: 500;
  392. }
  393. }
  394. }
  395. }
  396. .edit-icon {
  397. font-size: 40rpx;
  398. color: #CCCCCC;
  399. font-weight: 300;
  400. }
  401. }
  402. /* 测算卡片区域 */
  403. .cards-section {
  404. display: flex;
  405. justify-content: space-around;
  406. padding: 40rpx 30rpx 30rpx;
  407. background-color: #FFFFFF;
  408. .card-item {
  409. display: flex;
  410. flex-direction: column;
  411. align-items: center;
  412. width: 160rpx;
  413. transition: transform 0.2s;
  414. &:active {
  415. transform: scale(0.95);
  416. }
  417. .card-icon {
  418. width: 120rpx;
  419. height: 120rpx;
  420. display: flex;
  421. align-items: center;
  422. justify-content: center;
  423. background: linear-gradient(135deg, #F3E5F5 0%, #E1BEE7 100%);
  424. border-radius: 20rpx;
  425. font-size: 60rpx;
  426. margin-bottom: 15rpx;
  427. box-shadow: 0 4rpx 12rpx rgba(156, 39, 176, 0.15);
  428. }
  429. .card-name {
  430. font-size: 28rpx;
  431. color: #333333;
  432. font-weight: 500;
  433. }
  434. }
  435. }
  436. /* 通用标题样式 */
  437. .section-title {
  438. display: flex;
  439. justify-content: space-between;
  440. align-items: center;
  441. margin-bottom: 20rpx;
  442. .title-text {
  443. font-size: 32rpx;
  444. font-weight: 600;
  445. color: #333333;
  446. }
  447. .title-date {
  448. font-size: 24rpx;
  449. color: #999999;
  450. }
  451. .title-more {
  452. font-size: 24rpx;
  453. color: #E91E63;
  454. }
  455. }
  456. /* 缘分配对测试 */
  457. .match-test-banner {
  458. margin: 30rpx;
  459. background: linear-gradient(135deg, #FF6B9D 0%, #FFA5C6 100%);
  460. border-radius: 20rpx;
  461. padding: 30rpx;
  462. box-shadow: 0 8rpx 20rpx rgba(233, 30, 99, 0.25);
  463. transition: transform 0.2s;
  464. &:active {
  465. transform: scale(0.98);
  466. }
  467. .match-banner-content {
  468. display: flex;
  469. align-items: center;
  470. margin-bottom: 15rpx;
  471. .match-icon-group {
  472. width: 80rpx;
  473. height: 80rpx;
  474. background-color: rgba(255, 255, 255, 0.3);
  475. border-radius: 50%;
  476. display: flex;
  477. align-items: center;
  478. justify-content: center;
  479. margin-right: 20rpx;
  480. .match-icon {
  481. font-size: 48rpx;
  482. }
  483. }
  484. .match-text-group {
  485. flex: 1;
  486. .match-title {
  487. font-size: 32rpx;
  488. font-weight: 600;
  489. color: #FFFFFF;
  490. margin-bottom: 8rpx;
  491. }
  492. .match-subtitle {
  493. font-size: 24rpx;
  494. color: rgba(255, 255, 255, 0.9);
  495. }
  496. }
  497. .match-arrow {
  498. font-size: 40rpx;
  499. color: #FFFFFF;
  500. font-weight: bold;
  501. }
  502. }
  503. .match-stats {
  504. .match-stats-text {
  505. font-size: 22rpx;
  506. color: rgba(255, 255, 255, 0.85);
  507. }
  508. }
  509. }
  510. /* 我的爱情运势 */
  511. .love-fortune {
  512. margin: 30rpx;
  513. .fortune-cards {
  514. display: flex;
  515. flex-direction: column;
  516. gap: 15rpx;
  517. .fortune-card {
  518. display: flex;
  519. align-items: center;
  520. background-color: #FFFFFF;
  521. border-radius: 15rpx;
  522. padding: 25rpx;
  523. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.06);
  524. .fortune-icon {
  525. width: 70rpx;
  526. height: 70rpx;
  527. border-radius: 50%;
  528. display: flex;
  529. align-items: center;
  530. justify-content: center;
  531. margin-right: 20rpx;
  532. .fortune-emoji {
  533. font-size: 36rpx;
  534. }
  535. }
  536. .fortune-info {
  537. flex: 1;
  538. .fortune-label {
  539. font-size: 28rpx;
  540. color: #333333;
  541. font-weight: 500;
  542. margin-bottom: 12rpx;
  543. display: block;
  544. }
  545. .fortune-score {
  546. display: flex;
  547. align-items: center;
  548. .score-bar {
  549. flex: 1;
  550. height: 12rpx;
  551. background-color: #F0F0F0;
  552. border-radius: 6rpx;
  553. overflow: hidden;
  554. margin-right: 15rpx;
  555. .score-fill {
  556. height: 100%;
  557. border-radius: 6rpx;
  558. transition: width 0.6s ease;
  559. }
  560. }
  561. .score-text {
  562. font-size: 26rpx;
  563. color: #E91E63;
  564. font-weight: 600;
  565. min-width: 60rpx;
  566. text-align: right;
  567. }
  568. }
  569. }
  570. }
  571. }
  572. }
  573. /* 本周脱单指数 */
  574. .single-index {
  575. margin: 30rpx;
  576. .index-card {
  577. background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
  578. border-radius: 20rpx;
  579. padding: 30rpx;
  580. box-shadow: 0 4rpx 12rpx rgba(255, 152, 0, 0.15);
  581. .index-header {
  582. display: flex;
  583. justify-content: space-between;
  584. align-items: center;
  585. margin-bottom: 25rpx;
  586. .index-score-wrapper {
  587. display: flex;
  588. align-items: baseline;
  589. .index-score {
  590. font-size: 72rpx;
  591. font-weight: bold;
  592. color: #FF6B6B;
  593. line-height: 1;
  594. }
  595. .index-unit {
  596. font-size: 28rpx;
  597. color: #666666;
  598. margin-left: 8rpx;
  599. }
  600. }
  601. .index-level {
  602. padding: 10rpx 25rpx;
  603. border-radius: 30rpx;
  604. font-size: 28rpx;
  605. color: #FFFFFF;
  606. font-weight: 600;
  607. }
  608. }
  609. .index-tips {
  610. display: flex;
  611. flex-direction: column;
  612. gap: 12rpx;
  613. .tip-item {
  614. display: flex;
  615. align-items: center;
  616. background-color: rgba(255, 255, 255, 0.7);
  617. border-radius: 10rpx;
  618. padding: 15rpx 20rpx;
  619. .tip-icon {
  620. font-size: 28rpx;
  621. margin-right: 12rpx;
  622. }
  623. .tip-text {
  624. font-size: 26rpx;
  625. color: #333333;
  626. }
  627. }
  628. }
  629. }
  630. }
  631. /* 每日幸运推荐 */
  632. .lucky-recommend {
  633. margin: 30rpx;
  634. .lucky-grid {
  635. display: grid;
  636. grid-template-columns: repeat(4, 1fr);
  637. gap: 16rpx;
  638. .lucky-item {
  639. display: flex;
  640. flex-direction: column;
  641. align-items: center;
  642. background-color: #FFFFFF;
  643. border-radius: 12rpx;
  644. padding: 20rpx 10rpx;
  645. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.06);
  646. .lucky-icon-wrapper {
  647. width: 60rpx;
  648. height: 60rpx;
  649. border-radius: 50%;
  650. display: flex;
  651. align-items: center;
  652. justify-content: center;
  653. margin-bottom: 10rpx;
  654. .lucky-icon {
  655. font-size: 32rpx;
  656. }
  657. }
  658. .lucky-label {
  659. font-size: 22rpx;
  660. color: #999999;
  661. margin-bottom: 6rpx;
  662. }
  663. .lucky-value {
  664. font-size: 24rpx;
  665. color: #333333;
  666. font-weight: 600;
  667. text-align: center;
  668. word-break: break-all;
  669. }
  670. }
  671. }
  672. }
  673. /* 热门测试榜单 */
  674. .hot-tests {
  675. margin: 30rpx;
  676. .test-list {
  677. background-color: #FFFFFF;
  678. border-radius: 20rpx;
  679. overflow: hidden;
  680. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.06);
  681. .test-item {
  682. display: flex;
  683. align-items: center;
  684. padding: 25rpx 30rpx;
  685. border-bottom: 1rpx solid #F5F5F5;
  686. position: relative;
  687. transition: background-color 0.2s;
  688. &:last-child {
  689. border-bottom: none;
  690. }
  691. &:active {
  692. background-color: #F9F9F9;
  693. }
  694. .test-rank {
  695. width: 50rpx;
  696. height: 50rpx;
  697. background-color: #F0F0F0;
  698. border-radius: 10rpx;
  699. display: flex;
  700. align-items: center;
  701. justify-content: center;
  702. font-size: 26rpx;
  703. font-weight: bold;
  704. color: #666666;
  705. margin-right: 20rpx;
  706. &.top-rank {
  707. background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
  708. color: #FFFFFF;
  709. }
  710. }
  711. .test-info {
  712. flex: 1;
  713. .test-name {
  714. font-size: 28rpx;
  715. color: #333333;
  716. font-weight: 500;
  717. display: block;
  718. margin-bottom: 8rpx;
  719. }
  720. .test-count {
  721. font-size: 22rpx;
  722. color: #999999;
  723. }
  724. }
  725. .test-tag {
  726. position: absolute;
  727. top: 15rpx;
  728. right: 30rpx;
  729. padding: 4rpx 12rpx;
  730. background: linear-gradient(135deg, #E91E63 0%, #FF6B9D 100%);
  731. color: #FFFFFF;
  732. font-size: 20rpx;
  733. border-radius: 6rpx;
  734. font-weight: bold;
  735. }
  736. }
  737. }
  738. }
  739. /* 底部占位 */
  740. .bottom-placeholder {
  741. height: 40rpx;
  742. }
  743. </style>