index.vue 18 KB

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