index.vue 18 KB

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