index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933
  1. <template>
  2. <view class="matchmaker-workbench">
  3. <!-- 顶部导航栏 -->
  4. <view class="header">
  5. <text class="header-title">红娘工作台</text>
  6. <view class="header-right">
  7. <view class="search-icon" @click="handleSearch"></view>
  8. <!-- 返回用户端按钮 - 修改为与"前往红娘工作台"一致的样式 -->
  9. <view class="back-to-user-btn" @click="openExitPopup">
  10. <text class="btn-text">返回用户端</text>
  11. </view>
  12. </view>
  13. </view>
  14. <scroll-view scroll-y class="content">
  15. <!-- 欢迎卡片 -->
  16. <view class="welcome-card">
  17. <view class="welcome-text">
  18. <text class="welcome-title">欢迎回来</text>
  19. <text class="heart-icon">❤️</text>
  20. <text class="matchmaker-name">{{ matchmakerInfo.realName || makerName }}</text>
  21. </view>
  22. <image class="avatar" :src="matchmakerInfo.avatarUrl || '/static/default-avatar.svg'" mode="aspectFill"></image>
  23. </view>
  24. <!-- 统计卡片 -->
  25. <view class="stats-cards">
  26. <view class="stats-card success">
  27. <view class="stats-row">
  28. <text class="stats-number">{{ matchmakerInfo.successCouples || 0 }}</text>
  29. <text class="stats-tag orange">撮合达人</text>
  30. </view>
  31. <text class="stats-label">成功撮合</text>
  32. <text class="stats-subtitle">匹配数</text>
  33. </view>
  34. <view class="stats-card points">
  35. <view class="stats-row">
  36. <text class="stats-number">{{ matchmakerInfo.points || 0 }}</text>
  37. <text class="stats-tag purple">积分可兑礼</text>
  38. </view>
  39. <text class="stats-label">我的积分</text>
  40. <text class="stats-subtitle">可兑换</text>
  41. </view>
  42. </view>
  43. <!-- 公告卡片 -->
  44. <view class="announcement-card" @click="handleAnnouncement" v-if="currentAnnouncement">
  45. <text class="announcement-tag">公告</text>
  46. <text class="announcement-content">{{ currentAnnouncement.content }}</text>
  47. <view class="arrow-right"></view>
  48. </view>
  49. <view class="announcement-card" v-else>
  50. <text class="announcement-tag">公告</text>
  51. <text class="announcement-content">暂无公告</text>
  52. </view>
  53. <!-- 核心功能入口 -->
  54. <view class="function-grid">
  55. <view class="grid-item"
  56. v-for="item in functionList"
  57. :key="item.id"
  58. @click="navigateToFunction(item)">
  59. <view class="grid-icon-wrapper" :style="{ background: item.gradient || item.bgColor || '#FFE5F1' }">
  60. <text class="grid-icon" :style="{ color: item.iconColor || '#333333' }">{{ item.icon }}</text>
  61. </view>
  62. <text class="grid-text">{{ item.name }}</text>
  63. </view>
  64. </view>
  65. <!-- 本周最佳红娘 -->
  66. <view class="best-matchmaker-section">
  67. <view class="section-header">
  68. <text class="section-title">
  69. <text class="crown-icon">👑</text>
  70. 本周最佳红娘
  71. </text>
  72. <text class="section-more" @click="navigateToRanking">排行榜 ></text>
  73. </view>
  74. <view class="best-matchmaker-list">
  75. <view class="best-matchmaker-item" v-for="(item, index) in bestMatchmakers" :key="item.matchmaker_id || index"
  76. @click="goToMatchmakerDetail(item)">
  77. <text class="rank-number" :class="'rank-' + (index + 1)">{{ index + 1 }}</text>
  78. <image class="avatar-small" :src="item.avatar_url || '/static/default-avatar.svg'"
  79. mode="aspectFill"></image>
  80. <view class="matchmaker-info">
  81. <text class="matchmaker-name-small">{{ item.real_name || '红娘' }}</text>
  82. <text class="success-count">成功人数: {{ item.success_couples || 0 }}</text>
  83. </view>
  84. <view class="likes-info">
  85. <text class="heart-small">❤️</text>
  86. <text class="like-count">{{ item.likes || 0 }}</text>
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. </scroll-view>
  92. <!-- 底部导航 -->
  93. <view class="tabbar">
  94. <view class="tabbar-item active home" @click="navigateToWorkbench">
  95. <view class="tabbar-icon"></view>
  96. <text class="tabbar-text">工作台</text>
  97. </view>
  98. <view class="tabbar-item resources" @click="navigateToMyResources">
  99. <view class="tabbar-icon"></view>
  100. <text class="tabbar-text">我的资源</text>
  101. </view>
  102. <view class="tabbar-item trophy" @click="navigateToRanking">
  103. <view class="tabbar-icon"></view>
  104. <text class="tabbar-text">排行榜</text>
  105. </view>
  106. <!-- <view class="tabbar-item message" @click="navigateToMessage">
  107. <view class="tabbar-icon">
  108. <view v-if="unreadCount > 0" class="badge">{{ unreadCount }}</view>
  109. </view>
  110. <text class="tabbar-text">消息</text>
  111. </view> -->
  112. <view class="tabbar-item mine" @click="navigateToMine">
  113. <view class="tabbar-icon"></view>
  114. <text class="tabbar-text">我的</text>
  115. </view>
  116. </view>
  117. </view>
  118. </template>
  119. <script>
  120. import api from '@/utils/api.js'
  121. export default {
  122. data() {
  123. return {
  124. bestMatchmakers: [],
  125. announcements: [],
  126. currentAnnouncementIndex: 0,
  127. makerName: uni.getStorageSync("userInfo").nickname,
  128. matchmakerInfo: {
  129. realName: '',
  130. avatarUrl: '',
  131. successCouples: 0,
  132. points: 0
  133. },
  134. // 金刚区功能列表(从数据库获取)
  135. functionList: []
  136. }
  137. },
  138. computed: {
  139. currentAnnouncement() {
  140. return this.announcements.length > 0 ? this.announcements[this.currentAnnouncementIndex] : null
  141. },
  142. // 全局未读消息数(来自用户端已配置的 Vuex)
  143. unreadCount() {
  144. return this.$store.getters.getTotalUnread || 0
  145. }
  146. },
  147. onLoad() {
  148. this.loadMatchmakerInfo()
  149. this.loadRankingData()
  150. this.loadAnnouncements()
  151. this.loadFunctionGridData()
  152. },
  153. methods: {
  154. // 加载当前登录红娘信息
  155. async loadMatchmakerInfo() {
  156. try {
  157. const userInfo = uni.getStorageSync('userInfo')
  158. if (!userInfo || !userInfo.userId) {
  159. return
  160. }
  161. // 根据userId获取红娘信息
  162. const res = await api.matchmaker.getByUserId(userInfo.userId)
  163. // 解析返回数据(可能被包装在data字段中)
  164. let matchmaker = res
  165. if (res && res.data) {
  166. matchmaker = res.data
  167. }
  168. if (matchmaker && (matchmaker.matchmakerId || matchmaker.matchmaker_id)) {
  169. // 获取红娘ID
  170. const matchmakerId = matchmaker.matchmakerId || matchmaker.matchmaker_id
  171. this.matchmakerInfo = {
  172. realName: matchmaker.realName || matchmaker.real_name || userInfo.nickname,
  173. avatarUrl: matchmaker.avatarUrl || matchmaker.avatar_url || userInfo.avatarUrl,
  174. successCouples: matchmaker.successCouples || matchmaker.success_couples || 0,
  175. points: matchmaker.points || 0
  176. }
  177. // 将matchmakerId保存到userInfo中,供其他页面使用
  178. userInfo.matchmakerId = matchmakerId
  179. uni.setStorageSync('userInfo', userInfo)
  180. }
  181. } catch (e) {
  182. }
  183. },
  184. // 加载排行榜数据(取前3名)
  185. async loadRankingData() {
  186. try {
  187. const res = await api.matchmaker.getRankingData({ limit: 20 })
  188. let list = []
  189. if (res && Array.isArray(res)) {
  190. list = res
  191. } else if (res && res.data && Array.isArray(res.data)) {
  192. list = res.data
  193. }
  194. // 只取前3名显示
  195. this.bestMatchmakers = list.slice(0, 3)
  196. } catch (e) {
  197. }
  198. },
  199. // 加载公告数据
  200. async loadAnnouncements() {
  201. try {
  202. const res = await api.home.getNotices()
  203. if (res && Array.isArray(res)) {
  204. this.announcements = res
  205. } else if (res && res.data && Array.isArray(res.data)) {
  206. this.announcements = res.data
  207. }
  208. // 如果有多条公告,自动轮播
  209. if (this.announcements.length > 1) {
  210. this.startAnnouncementCarousel()
  211. }
  212. } catch (e) {
  213. }
  214. },
  215. // 加载金刚区功能数据
  216. async loadFunctionGridData() {
  217. try {
  218. // 获取红娘端金刚区功能列表
  219. const res = await api.home.getFunctionGridByType('matchmaker')
  220. // 由于api.js中的request函数已经处理了响应,res直接是res.data.data或res.data
  221. if (Array.isArray(res)) {
  222. this.functionList = res
  223. } else if (res && res.code === 200 && Array.isArray(res.data)) {
  224. this.functionList = res.data
  225. } else {
  226. this.functionList = []
  227. }
  228. } catch (e) {
  229. c
  230. this.functionList = []
  231. }
  232. },
  233. // 公告轮播
  234. startAnnouncementCarousel() {
  235. setInterval(() => {
  236. this.currentAnnouncementIndex = (this.currentAnnouncementIndex + 1) % this.announcements.length
  237. }, 5000)
  238. },
  239. // 公告点击
  240. handleAnnouncement() {
  241. if (this.currentAnnouncement) {
  242. uni.navigateTo({
  243. url: '/pages/announcement/list'
  244. })
  245. }
  246. },
  247. // 导航到我的资源
  248. navigateToMyResources() {
  249. uni.navigateTo({
  250. url: '/pages/matchmaker-workbench/my-resources'
  251. })
  252. },
  253. // 导航到优质资源
  254. navigateToQualityResources() {
  255. uni.navigateTo({
  256. url: '/pages/matchmaker-workbench/quality-resources'
  257. })
  258. },
  259. // 导航到课程培训
  260. navigateToCourses() {
  261. uni.navigateTo({
  262. url: '/pages/courses/list'
  263. })
  264. },
  265. // 导航到积分商城
  266. navigateToPointsMall() {
  267. uni.navigateTo({
  268. url: '/pages/matchmaker-workbench/points-mall'
  269. })
  270. },
  271. // 导航到活动中心
  272. navigateToActivityCenter() {
  273. uni.navigateTo({
  274. url: '/pages/matchmaker-workbench/activities'
  275. })
  276. },
  277. // 通用功能导航方法
  278. navigateToFunction(item) {
  279. uni.navigateTo({
  280. url: item.path
  281. })
  282. },
  283. // 导航到排行榜
  284. navigateToRanking() {
  285. uni.navigateTo({
  286. url: '/pages/matchmaker-workbench/ranking'
  287. })
  288. },
  289. // 跳转到红娘详情
  290. goToMatchmakerDetail(item) {
  291. if (!item) return
  292. const id = item.matchmaker_id || item.matchmakerId
  293. if (id) {
  294. uni.navigateTo({
  295. url: `/pages/matchmakers/detail?id=${id}`
  296. })
  297. }
  298. },
  299. // 导航到工作台
  300. navigateToWorkbench() {
  301. // 已在工作台,无需跳转
  302. },
  303. // 导航到消息
  304. navigateToMessage() {
  305. uni.navigateTo({
  306. url: '/pages/matchmaker-workbench/message'
  307. })
  308. },
  309. // 导航到我的
  310. navigateToMine() {
  311. uni.navigateTo({
  312. url: '/pages/matchmaker-workbench/mine'
  313. })
  314. },
  315. // 返回用户端首页
  316. openExitPopup() {
  317. uni.navigateTo({
  318. url: '/pages/index/index'
  319. })
  320. },
  321. // 搜索
  322. handleSearch() {
  323. }
  324. }
  325. }
  326. </script>
  327. <style lang="scss" scoped>
  328. .matchmaker-workbench {
  329. min-height: 100vh;
  330. background: #FFF9F9;
  331. display: flex;
  332. flex-direction: column;
  333. }
  334. /* 顶部导航栏 */
  335. .header {
  336. display: flex;
  337. align-items: center;
  338. justify-content: space-between;
  339. padding: 25rpx 30rpx;
  340. padding-top: calc(25rpx + env(safe-area-inset-top));
  341. background: #FFF9F9;
  342. border-bottom: 1rpx solid #F0F0F0;
  343. .header-title {
  344. font-size: 38rpx;
  345. font-weight: bold;
  346. color: #9C27B0;
  347. }
  348. .header-right {
  349. display: flex;
  350. align-items: center;
  351. gap: 20rpx;
  352. .search-icon,
  353. .settings-icon {
  354. width: 33rpx;
  355. height: 33rpx;
  356. background-size: contain;
  357. background-repeat: no-repeat;
  358. background-position: center;
  359. }
  360. .search-icon {
  361. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>');
  362. }
  363. .settings-icon {
  364. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"/></svg>');
  365. }
  366. /* 返回用户端按钮 - 与"前往红娘工作台"按钮样式一致 */
  367. .back-to-user-btn {
  368. height: 60rpx;
  369. padding: 0 24rpx;
  370. background: linear-gradient(135deg, #FF8A9B 0%, #FF6B8A 100%);
  371. border-radius: 30rpx;
  372. display: flex;
  373. align-items: center;
  374. justify-content: center;
  375. box-shadow: 0 4rpx 12rpx rgba(255, 107, 138, 0.3);
  376. transition: all 0.3s ease;
  377. &:active {
  378. transform: scale(0.95);
  379. box-shadow: 0 2rpx 8rpx rgba(255, 107, 138, 0.3);
  380. }
  381. .btn-text {
  382. font-size: 26rpx;
  383. color: #FFFFFF;
  384. font-weight: bold;
  385. white-space: nowrap;
  386. }
  387. }
  388. }
  389. }
  390. .content {
  391. flex: 1;
  392. padding: 20rpx 20rpx 120rpx;
  393. display: flex;
  394. flex-direction: column;
  395. }
  396. /* 欢迎卡片 + 统计卡片合并 */
  397. .welcome-card {
  398. display: flex;
  399. justify-content: space-between;
  400. align-items: center;
  401. padding: 30rpx;
  402. background: linear-gradient(135deg, #FCE4EC 0%, #F8BBD0 100%);
  403. border-radius: 20rpx;
  404. margin-bottom: 20rpx;
  405. .welcome-text {
  406. display: flex;
  407. align-items: center;
  408. gap: 10rpx;
  409. .welcome-title {
  410. font-size: 38rpx;
  411. color: #333;
  412. }
  413. .heart-icon {
  414. font-size: 32rpx;
  415. }
  416. .matchmaker-name {
  417. font-size: 40rpx;
  418. font-weight: bold;
  419. color: #333;
  420. }
  421. }
  422. .avatar {
  423. width: 100rpx;
  424. height: 100rpx;
  425. border-radius: 50%;
  426. background: rgba(255, 255, 255, 0.3);
  427. }
  428. }
  429. /* 统计卡片 */
  430. .stats-cards {
  431. display: flex;
  432. gap: 20rpx;
  433. margin-bottom: 20rpx;
  434. .stats-card {
  435. flex: 1;
  436. padding: 25rpx;
  437. border-radius: 15rpx;
  438. background: #FFFFFF;
  439. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  440. .stats-row {
  441. display: flex;
  442. align-items: center;
  443. gap: 10rpx;
  444. margin-bottom: 8rpx;
  445. }
  446. .stats-number {
  447. font-size: 48rpx;
  448. font-weight: bold;
  449. }
  450. .stats-tag {
  451. font-size: 20rpx;
  452. padding: 4rpx 12rpx;
  453. border-radius: 6rpx;
  454. font-weight: 500;
  455. &.orange {
  456. color: #FF6B8A;
  457. border: 1rpx solid #FF6B8A;
  458. background: rgba(255, 107, 138, 0.1);
  459. }
  460. &.purple {
  461. color: #9C27B0;
  462. border: 1rpx solid #9C27B0;
  463. background: rgba(156, 39, 176, 0.1);
  464. }
  465. }
  466. .stats-label {
  467. display: block;
  468. font-size: 28rpx;
  469. margin-bottom: 8rpx;
  470. }
  471. .stats-subtitle {
  472. display: block;
  473. font-size: 24rpx;
  474. color: #999;
  475. }
  476. .stats-extra {
  477. display: block;
  478. font-size: 22rpx;
  479. color: #999;
  480. margin-top: 8rpx;
  481. }
  482. &.success {
  483. .stats-number {
  484. color: #FF6B8A;
  485. }
  486. .stats-label {
  487. color: #333;
  488. }
  489. }
  490. &.points {
  491. .stats-number {
  492. color: #9C27B0;
  493. }
  494. .stats-label {
  495. color: #333;
  496. }
  497. }
  498. }
  499. }
  500. /* 公告卡片 */
  501. .announcement-card {
  502. display: flex;
  503. align-items: center;
  504. justify-content: space-between;
  505. padding: 35rpx 30rpx;
  506. min-height: 80rpx;
  507. background: #FFFFFF;
  508. border-radius: 20rpx;
  509. margin-bottom: 20rpx;
  510. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  511. position: relative;
  512. .announcement-tag {
  513. display: inline-block;
  514. background: #FF9800;
  515. color: #FFFFFF;
  516. font-size: 22rpx;
  517. padding: 6rpx 16rpx;
  518. border-radius: 12rpx;
  519. margin-right: 15rpx;
  520. font-weight: bold;
  521. }
  522. .announcement-content {
  523. flex: 1;
  524. font-size: 26rpx;
  525. color: #333;
  526. line-height: 1.4;
  527. }
  528. .arrow-right {
  529. width: 24rpx;
  530. height: 24rpx;
  531. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"/></svg>');
  532. background-size: contain;
  533. background-repeat: no-repeat;
  534. background-position: center;
  535. margin-left: 15rpx;
  536. }
  537. }
  538. /* 核心功能入口 */
  539. .function-grid {
  540. display: flex;
  541. flex-wrap: nowrap;
  542. gap: 20rpx;
  543. margin: 20rpx 10rpx;
  544. padding: 25rpx 15rpx;
  545. background: #fefeff;
  546. border-radius: 20rpx;
  547. border: 2rpx solid #f0f0f5;
  548. box-shadow: 0 4rpx 16rpx rgba(220, 220, 240, 0.2);
  549. box-sizing: border-box;
  550. }
  551. .grid-item {
  552. display: flex;
  553. flex-direction: column;
  554. align-items: center;
  555. justify-content: center;
  556. gap: 12rpx;
  557. padding: 15rpx 8rpx;
  558. transition: all 0.3s ease;
  559. border-radius: 16rpx;
  560. background: linear-gradient(180deg, #fff 0%, #fdfdff 100%);
  561. box-shadow: 0 2rpx 8rpx rgba(220, 220, 240, 0.15);
  562. flex: 1;
  563. min-width: 0;
  564. box-sizing: border-box;
  565. &:hover,
  566. &:active {
  567. transform: translateY(-4rpx) scale(0.98);
  568. background: linear-gradient(180deg, #fff 0%, #f8f8ff 100%);
  569. box-shadow: 0 6rpx 18rpx rgba(200, 200, 230, 0.25);
  570. }
  571. }
  572. /* 为不同功能定制图标容器底色(贴合功能主题) */
  573. .grid-item:nth-child(1) .grid-icon-wrapper {
  574. background: linear-gradient(135deg, #ff85a2 0%, #ff5d8f 100%);
  575. }
  576. .grid-item:nth-child(2) .grid-icon-wrapper {
  577. background: linear-gradient(135deg, #85cfff 0%, #5daaff 100%);
  578. }
  579. .grid-item:nth-child(3) .grid-icon-wrapper {
  580. background: linear-gradient(135deg, #ffc885 0%, #ffaa5d 100%);
  581. }
  582. .grid-item:nth-child(4) .grid-icon-wrapper {
  583. background: linear-gradient(135deg, #ff85d2 0%, #ff5daa 100%);
  584. }
  585. .grid-icon-wrapper {
  586. width: 120rpx;
  587. height: 120rpx;
  588. display: flex;
  589. align-items: center;
  590. justify-content: center;
  591. border-radius: 20rpx;
  592. position: relative;
  593. overflow: hidden;
  594. box-shadow: inset 0 3rpx 10rpx rgba(255, 255, 255, 0.4),
  595. 0 8rpx 24rpx rgba(0, 0, 0, 0.12);
  596. transition: all 0.3s ease;
  597. }
  598. .grid-icon-wrapper::before {
  599. content: '';
  600. position: absolute;
  601. top: -50%;
  602. left: -50%;
  603. width: 200%;
  604. height: 200%;
  605. background: linear-gradient(135deg,
  606. rgba(255, 255, 255, 0.7) 0%,
  607. rgba(255, 255, 255, 0.3) 40%,
  608. transparent 80%);
  609. transform: rotate(45deg);
  610. pointer-events: none;
  611. z-index: 1;
  612. }
  613. .grid-icon {
  614. font-size: 80rpx;
  615. color: #fff;
  616. position: relative;
  617. z-index: 2;
  618. filter: drop-shadow(0 4rpx 8rpx rgba(0, 0, 0, 0.15));
  619. }
  620. .grid-text {
  621. font-size: 22rpx;
  622. font-weight: 600;
  623. color: #2d2d46;
  624. text-align: center;
  625. line-height: 1.2;
  626. text-shadow: 0 1rpx 3rpx rgba(0, 0, 0, 0.05);
  627. overflow: hidden;
  628. text-overflow: ellipsis;
  629. display: -webkit-box;
  630. -webkit-line-clamp: 1;
  631. -webkit-box-orient: vertical;
  632. max-width: 100%;
  633. }
  634. /* 响应式适配:小屏自动改为2列 */
  635. @media (max-width: 600rpx) {
  636. .grid-item {
  637. min-width: calc(50% - 15rpx);
  638. max-width: calc(50% - 15rpx);
  639. }
  640. }
  641. /* 本周最佳红娘 */
  642. .best-matchmaker-section {
  643. flex: 1;
  644. min-height: 400rpx;
  645. padding: 30rpx;
  646. background: #FFFFFF;
  647. border-radius: 20rpx;
  648. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  649. display: flex;
  650. flex-direction: column;
  651. margin-bottom: 20rpx;
  652. .section-header {
  653. display: flex;
  654. justify-content: space-between;
  655. align-items: center;
  656. margin-bottom: 20rpx;
  657. .section-title {
  658. display: flex;
  659. align-items: center;
  660. font-size: 30rpx;
  661. font-weight: bold;
  662. color: red;
  663. .crown-icon {
  664. font-size: 32rpx;
  665. margin-right: 10rpx;
  666. }
  667. }
  668. .section-more {
  669. font-size: 24rpx;
  670. color: #9C27B0;
  671. }
  672. }
  673. .best-matchmaker-list {
  674. flex: 1;
  675. display: flex;
  676. flex-direction: column;
  677. gap: 20rpx;
  678. .best-matchmaker-item {
  679. display: flex;
  680. align-items: center;
  681. gap: 20rpx;
  682. padding: 30rpx 25rpx;
  683. background: #FAFAFA;
  684. border-radius: 15rpx;
  685. min-height: 100rpx;
  686. .rank-number {
  687. width: 45rpx;
  688. height: 45rpx;
  689. display: flex;
  690. align-items: center;
  691. justify-content: center;
  692. font-size: 28rpx;
  693. font-weight: bold;
  694. color: #FFF;
  695. border-radius: 50%;
  696. background: #FFD700;
  697. &.rank-1 {
  698. background: #FFD700;
  699. }
  700. &.rank-2 {
  701. background: #C0C0C0;
  702. }
  703. &.rank-3 {
  704. background: #CD7F32;
  705. }
  706. }
  707. .avatar-small {
  708. width: 80rpx;
  709. height: 80rpx;
  710. border-radius: 50%;
  711. background: #F0F0F0;
  712. }
  713. .matchmaker-info {
  714. flex: 1;
  715. .matchmaker-name-small {
  716. display: block;
  717. font-size: 32rpx;
  718. font-weight: bold;
  719. color: #333;
  720. margin-bottom: 8rpx;
  721. }
  722. .success-count {
  723. display: block;
  724. font-size: 26rpx;
  725. color: #999;
  726. }
  727. }
  728. .likes-info {
  729. display: flex;
  730. align-items: center;
  731. gap: 10rpx;
  732. .heart-small {
  733. font-size: 28rpx;
  734. }
  735. .like-count {
  736. font-size: 28rpx;
  737. color: #E91E63;
  738. font-weight: bold;
  739. }
  740. }
  741. }
  742. }
  743. }
  744. /* 底部导航 */
  745. .tabbar {
  746. position: fixed;
  747. bottom: 0;
  748. left: 0;
  749. right: 0;
  750. height: 100rpx;
  751. background: #FFFFFF;
  752. border-top: 1rpx solid #F0F0F0;
  753. display: flex;
  754. justify-content: space-around;
  755. align-items: center;
  756. padding-bottom: env(safe-area-inset-bottom);
  757. .tabbar-item {
  758. display: flex;
  759. flex-direction: column;
  760. align-items: center;
  761. gap: 8rpx;
  762. padding: 10rpx 0;
  763. .tabbar-icon {
  764. width: 44rpx;
  765. height: 44rpx;
  766. background-size: contain;
  767. background-repeat: no-repeat;
  768. background-position: center;
  769. position: relative;
  770. .badge {
  771. position: absolute;
  772. top: -8rpx;
  773. right: -8rpx;
  774. background: #FF4444;
  775. color: #FFFFFF;
  776. font-size: 20rpx;
  777. font-weight: bold;
  778. width: 32rpx;
  779. height: 32rpx;
  780. display: flex;
  781. align-items: center;
  782. justify-content: center;
  783. border-radius: 16rpx;
  784. }
  785. }
  786. .tabbar-text {
  787. font-size: 20rpx;
  788. color: #999;
  789. }
  790. &.active {
  791. .tabbar-text {
  792. color: #9C27B0;
  793. font-weight: bold;
  794. }
  795. }
  796. &.home .tabbar-icon {
  797. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>');
  798. }
  799. &.resources .tabbar-icon {
  800. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></svg>');
  801. }
  802. &.active.resources .tabbar-icon {
  803. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></svg>');
  804. }
  805. &.trophy .tabbar-icon {
  806. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M19 5h-2V3H7v2H5c-1.1 0-2 .9-2 2v1c0 2.55 1.92 4.63 4.39 4.94.63 1.5 1.98 2.63 3.61 2.96V19H7v2h10v-2h-4v-3.1c1.63-.33 2.98-1.46 3.61-2.96C19.08 12.63 21 10.55 21 8V7c0-1.1-.9-2-2-2zM5 8V7h2v3.82C5.84 10.4 5 9.3 5 8zm14 0c0 1.3-.84 2.4-2 2.82V7h2v1z"/></svg>');
  807. }
  808. &.active.trophy .tabbar-icon {
  809. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M19 5h-2V3H7v2H5c-1.1 0-2 .9-2 2v1c0 2.55 1.92 4.63 4.39 4.94.63 1.5 1.98 2.63 3.61 2.96V19H7v2h10v-2h-4v-3.1c1.63-.33 2.98-1.46 3.61-2.96C19.08 12.63 21 10.55 21 8V7c0-1.1-.9-2-2-2zM5 8V7h2v3.82C5.84 10.4 5 9.3 5 8zm14 0c0 1.3-.84 2.4-2 2.82V7h2v1z"/></svg>');
  810. }
  811. &.message .tabbar-icon {
  812. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"/></svg>');
  813. }
  814. &.active.message .tabbar-icon {
  815. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"/></svg>');
  816. }
  817. &.mine .tabbar-icon {
  818. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
  819. }
  820. &.active.mine .tabbar-icon {
  821. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
  822. }
  823. }
  824. }
  825. </style>