index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939
  1. <template>
  2. <view class="matchmaker-workbench">
  3. <view class="status-bar-placeholder" :style="{height: statusBarHeight + 'px', backgroundColor: '#FFF9F9'}"></view>
  4. <!-- 顶部导航栏 -->
  5. <view class="header">
  6. <text class="header-title">红娘工作台</text>
  7. <view class="header-right">
  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. statusBarHeight: 0,
  125. bestMatchmakers: [],
  126. announcements: [],
  127. currentAnnouncementIndex: 0,
  128. makerName: uni.getStorageSync("userInfo").nickname,
  129. matchmakerInfo: {
  130. realName: '',
  131. avatarUrl: '',
  132. successCouples: 0,
  133. points: 0
  134. },
  135. // 金刚区功能列表(从数据库获取)
  136. functionList: []
  137. }
  138. },
  139. computed: {
  140. currentAnnouncement() {
  141. return this.announcements.length > 0 ? this.announcements[this.currentAnnouncementIndex] : null
  142. },
  143. // 全局未读消息数(来自用户端已配置的 Vuex)
  144. unreadCount() {
  145. return this.$store.getters.getTotalUnread || 0
  146. }
  147. },
  148. onLoad() {
  149. this.loadMatchmakerInfo()
  150. this.loadRankingData()
  151. this.loadAnnouncements()
  152. this.loadFunctionGridData()
  153. //获取状态栏高度
  154. const systemInfo = uni.getSystemInfoSync()
  155. this.statusBarHeight = systemInfo.statusBarHeight
  156. },
  157. methods: {
  158. // 加载当前登录红娘信息
  159. async loadMatchmakerInfo() {
  160. try {
  161. const userInfo = uni.getStorageSync('userInfo')
  162. if (!userInfo || !userInfo.userId) {
  163. return
  164. }
  165. // 根据userId获取红娘信息
  166. const res = await api.matchmaker.getByUserId(userInfo.userId)
  167. // 解析返回数据(可能被包装在data字段中)
  168. let matchmaker = res
  169. if (res && res.data) {
  170. matchmaker = res.data
  171. }
  172. if (matchmaker && (matchmaker.matchmakerId || matchmaker.matchmaker_id)) {
  173. // 获取红娘ID
  174. const matchmakerId = matchmaker.matchmakerId || matchmaker.matchmaker_id
  175. this.matchmakerInfo = {
  176. realName: matchmaker.realName || matchmaker.real_name || userInfo.nickname,
  177. avatarUrl: matchmaker.avatarUrl || matchmaker.avatar_url || userInfo.avatarUrl,
  178. successCouples: matchmaker.successCouples || matchmaker.success_couples || 0,
  179. points: matchmaker.points || 0
  180. }
  181. // 将matchmakerId保存到userInfo中,供其他页面使用
  182. userInfo.matchmakerId = matchmakerId
  183. uni.setStorageSync('userInfo', userInfo)
  184. }
  185. } catch (e) {
  186. }
  187. },
  188. // 加载排行榜数据(取前3名)
  189. async loadRankingData() {
  190. try {
  191. const res = await api.matchmaker.getRankingData({ limit: 20 })
  192. let list = []
  193. if (res && Array.isArray(res)) {
  194. list = res
  195. } else if (res && res.data && Array.isArray(res.data)) {
  196. list = res.data
  197. }
  198. // 只取前3名显示
  199. this.bestMatchmakers = list.slice(0, 3)
  200. } catch (e) {
  201. }
  202. },
  203. // 加载公告数据
  204. async loadAnnouncements() {
  205. try {
  206. const res = await api.home.getNotices()
  207. if (res && Array.isArray(res)) {
  208. this.announcements = res
  209. } else if (res && res.data && Array.isArray(res.data)) {
  210. this.announcements = res.data
  211. }
  212. // 如果有多条公告,自动轮播
  213. if (this.announcements.length > 1) {
  214. this.startAnnouncementCarousel()
  215. }
  216. } catch (e) {
  217. }
  218. },
  219. // 加载金刚区功能数据
  220. async loadFunctionGridData() {
  221. try {
  222. // 获取红娘端金刚区功能列表
  223. const res = await api.home.getFunctionGridByType('matchmaker')
  224. // 由于api.js中的request函数已经处理了响应,res直接是res.data.data或res.data
  225. if (Array.isArray(res)) {
  226. this.functionList = res
  227. } else if (res && res.code === 200 && Array.isArray(res.data)) {
  228. this.functionList = res.data
  229. } else {
  230. this.functionList = []
  231. }
  232. } catch (e) {
  233. c
  234. this.functionList = []
  235. }
  236. },
  237. // 公告轮播
  238. startAnnouncementCarousel() {
  239. setInterval(() => {
  240. this.currentAnnouncementIndex = (this.currentAnnouncementIndex + 1) % this.announcements.length
  241. }, 5000)
  242. },
  243. // 公告点击
  244. handleAnnouncement() {
  245. if (this.currentAnnouncement) {
  246. uni.navigateTo({
  247. url: '/pages/announcement/list'
  248. })
  249. }
  250. },
  251. // 导航到我的资源
  252. navigateToMyResources() {
  253. uni.navigateTo({
  254. url: '/pages/matchmaker-workbench/my-resources'
  255. })
  256. },
  257. // 导航到优质资源
  258. navigateToQualityResources() {
  259. uni.navigateTo({
  260. url: '/pages/matchmaker-workbench/quality-resources'
  261. })
  262. },
  263. // 导航到课程培训
  264. navigateToCourses() {
  265. uni.navigateTo({
  266. url: '/pages/courses/list'
  267. })
  268. },
  269. // 导航到积分商城
  270. navigateToPointsMall() {
  271. uni.navigateTo({
  272. url: '/pages/matchmaker-workbench/points-mall'
  273. })
  274. },
  275. // 导航到活动中心
  276. navigateToActivityCenter() {
  277. uni.navigateTo({
  278. url: '/pages/matchmaker-workbench/activities'
  279. })
  280. },
  281. // 通用功能导航方法
  282. navigateToFunction(item) {
  283. uni.navigateTo({
  284. url: item.path
  285. })
  286. },
  287. // 导航到排行榜
  288. navigateToRanking() {
  289. uni.navigateTo({
  290. url: '/pages/matchmaker-workbench/ranking'
  291. })
  292. },
  293. // 跳转到红娘详情
  294. goToMatchmakerDetail(item) {
  295. if (!item) return
  296. const id = item.matchmaker_id || item.matchmakerId
  297. if (id) {
  298. uni.navigateTo({
  299. url: `/pages/matchmakers/detail?id=${id}`
  300. })
  301. }
  302. },
  303. // 导航到工作台
  304. navigateToWorkbench() {
  305. // 已在工作台,无需跳转
  306. },
  307. // 导航到消息
  308. navigateToMessage() {
  309. uni.navigateTo({
  310. url: '/pages/matchmaker-workbench/message'
  311. })
  312. },
  313. // 导航到我的
  314. navigateToMine() {
  315. uni.navigateTo({
  316. url: '/pages/matchmaker-workbench/mine'
  317. })
  318. },
  319. // 返回用户端首页
  320. openExitPopup() {
  321. uni.navigateTo({
  322. url: '/pages/index/index'
  323. })
  324. },
  325. // 搜索
  326. handleSearch() {
  327. }
  328. }
  329. }
  330. </script>
  331. <style lang="scss" scoped>
  332. .matchmaker-workbench {
  333. min-height: 100vh;
  334. background: #FFF9F9;
  335. display: flex;
  336. flex-direction: column;
  337. }
  338. /* 顶部导航栏 */
  339. .header {
  340. display: flex;
  341. align-items: center;
  342. justify-content: space-between;
  343. padding: 25rpx 30rpx;
  344. // padding-top: calc(25rpx + env(safe-area-inset-top));
  345. padding: 25rpx 30rpx;
  346. background: #FFF9F9;
  347. border-bottom: 1rpx solid #F0F0F0;
  348. .header-title {
  349. font-size: 38rpx;
  350. font-weight: bold;
  351. color: #9C27B0;
  352. }
  353. .header-right {
  354. display: flex;
  355. align-items: center;
  356. gap: 20rpx;
  357. .search-icon,
  358. .settings-icon {
  359. width: 33rpx;
  360. height: 33rpx;
  361. background-size: contain;
  362. background-repeat: no-repeat;
  363. background-position: center;
  364. }
  365. .search-icon {
  366. 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>');
  367. }
  368. .settings-icon {
  369. 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>');
  370. }
  371. /* 返回用户端按钮 - 与"前往红娘工作台"按钮样式一致 */
  372. .back-to-user-btn {
  373. height: 60rpx;
  374. padding: 0 24rpx;
  375. background: linear-gradient(135deg, #FF8A9B 0%, #FF6B8A 100%);
  376. border-radius: 30rpx;
  377. display: flex;
  378. align-items: center;
  379. justify-content: center;
  380. box-shadow: 0 4rpx 12rpx rgba(255, 107, 138, 0.3);
  381. transition: all 0.3s ease;
  382. margin-right: 80px;
  383. &:active {
  384. transform: scale(0.95);
  385. box-shadow: 0 2rpx 8rpx rgba(255, 107, 138, 0.3);
  386. }
  387. .btn-text {
  388. font-size: 26rpx;
  389. color: #FFFFFF;
  390. font-weight: bold;
  391. white-space: nowrap;
  392. }
  393. }
  394. }
  395. }
  396. .content {
  397. flex: 1;
  398. padding: 20rpx 20rpx 120rpx;
  399. display: flex;
  400. flex-direction: column;
  401. }
  402. /* 欢迎卡片 + 统计卡片合并 */
  403. .welcome-card {
  404. display: flex;
  405. justify-content: space-between;
  406. align-items: center;
  407. padding: 30rpx;
  408. background: linear-gradient(135deg, #FCE4EC 0%, #F8BBD0 100%);
  409. border-radius: 20rpx;
  410. margin-bottom: 20rpx;
  411. .welcome-text {
  412. display: flex;
  413. align-items: center;
  414. gap: 10rpx;
  415. .welcome-title {
  416. font-size: 38rpx;
  417. color: #333;
  418. }
  419. .heart-icon {
  420. font-size: 32rpx;
  421. }
  422. .matchmaker-name {
  423. font-size: 40rpx;
  424. font-weight: bold;
  425. color: #333;
  426. }
  427. }
  428. .avatar {
  429. width: 100rpx;
  430. height: 100rpx;
  431. border-radius: 50%;
  432. background: rgba(255, 255, 255, 0.3);
  433. }
  434. }
  435. /* 统计卡片 */
  436. .stats-cards {
  437. display: flex;
  438. gap: 20rpx;
  439. margin-bottom: 20rpx;
  440. .stats-card {
  441. flex: 1;
  442. padding: 25rpx;
  443. border-radius: 15rpx;
  444. background: #FFFFFF;
  445. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  446. .stats-row {
  447. display: flex;
  448. align-items: center;
  449. gap: 10rpx;
  450. margin-bottom: 8rpx;
  451. }
  452. .stats-number {
  453. font-size: 48rpx;
  454. font-weight: bold;
  455. }
  456. .stats-tag {
  457. font-size: 20rpx;
  458. padding: 4rpx 12rpx;
  459. border-radius: 6rpx;
  460. font-weight: 500;
  461. &.orange {
  462. color: #FF6B8A;
  463. border: 1rpx solid #FF6B8A;
  464. background: rgba(255, 107, 138, 0.1);
  465. }
  466. &.purple {
  467. color: #9C27B0;
  468. border: 1rpx solid #9C27B0;
  469. background: rgba(156, 39, 176, 0.1);
  470. }
  471. }
  472. .stats-label {
  473. display: block;
  474. font-size: 28rpx;
  475. margin-bottom: 8rpx;
  476. }
  477. .stats-subtitle {
  478. display: block;
  479. font-size: 24rpx;
  480. color: #999;
  481. }
  482. .stats-extra {
  483. display: block;
  484. font-size: 22rpx;
  485. color: #999;
  486. margin-top: 8rpx;
  487. }
  488. &.success {
  489. .stats-number {
  490. color: #FF6B8A;
  491. }
  492. .stats-label {
  493. color: #333;
  494. }
  495. }
  496. &.points {
  497. .stats-number {
  498. color: #9C27B0;
  499. }
  500. .stats-label {
  501. color: #333;
  502. }
  503. }
  504. }
  505. }
  506. /* 公告卡片 */
  507. .announcement-card {
  508. display: flex;
  509. align-items: center;
  510. justify-content: space-between;
  511. padding: 35rpx 30rpx;
  512. min-height: 80rpx;
  513. background: #FFFFFF;
  514. border-radius: 20rpx;
  515. margin-bottom: 20rpx;
  516. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  517. position: relative;
  518. .announcement-tag {
  519. display: inline-block;
  520. background: #FF9800;
  521. color: #FFFFFF;
  522. font-size: 22rpx;
  523. padding: 6rpx 16rpx;
  524. border-radius: 12rpx;
  525. margin-right: 15rpx;
  526. font-weight: bold;
  527. }
  528. .announcement-content {
  529. flex: 1;
  530. font-size: 26rpx;
  531. color: #333;
  532. line-height: 1.4;
  533. }
  534. .arrow-right {
  535. width: 24rpx;
  536. height: 24rpx;
  537. 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>');
  538. background-size: contain;
  539. background-repeat: no-repeat;
  540. background-position: center;
  541. margin-left: 15rpx;
  542. }
  543. }
  544. /* 核心功能入口 */
  545. .function-grid {
  546. display: flex;
  547. flex-wrap: nowrap;
  548. gap: 20rpx;
  549. margin: 20rpx 10rpx;
  550. padding: 25rpx 15rpx;
  551. background: #fefeff;
  552. border-radius: 20rpx;
  553. border: 2rpx solid #f0f0f5;
  554. box-shadow: 0 4rpx 16rpx rgba(220, 220, 240, 0.2);
  555. box-sizing: border-box;
  556. }
  557. .grid-item {
  558. display: flex;
  559. flex-direction: column;
  560. align-items: center;
  561. justify-content: center;
  562. gap: 12rpx;
  563. padding: 15rpx 8rpx;
  564. transition: all 0.3s ease;
  565. border-radius: 16rpx;
  566. background: linear-gradient(180deg, #fff 0%, #fdfdff 100%);
  567. box-shadow: 0 2rpx 8rpx rgba(220, 220, 240, 0.15);
  568. flex: 1;
  569. min-width: 0;
  570. box-sizing: border-box;
  571. &:hover,
  572. &:active {
  573. transform: translateY(-4rpx) scale(0.98);
  574. background: linear-gradient(180deg, #fff 0%, #f8f8ff 100%);
  575. box-shadow: 0 6rpx 18rpx rgba(200, 200, 230, 0.25);
  576. }
  577. }
  578. /* 为不同功能定制图标容器底色(贴合功能主题) */
  579. .grid-item:nth-child(1) .grid-icon-wrapper {
  580. background: linear-gradient(135deg, #ff85a2 0%, #ff5d8f 100%);
  581. }
  582. .grid-item:nth-child(2) .grid-icon-wrapper {
  583. background: linear-gradient(135deg, #85cfff 0%, #5daaff 100%);
  584. }
  585. .grid-item:nth-child(3) .grid-icon-wrapper {
  586. background: linear-gradient(135deg, #ffc885 0%, #ffaa5d 100%);
  587. }
  588. .grid-item:nth-child(4) .grid-icon-wrapper {
  589. background: linear-gradient(135deg, #ff85d2 0%, #ff5daa 100%);
  590. }
  591. .grid-icon-wrapper {
  592. width: 120rpx;
  593. height: 120rpx;
  594. display: flex;
  595. align-items: center;
  596. justify-content: center;
  597. border-radius: 20rpx;
  598. position: relative;
  599. overflow: hidden;
  600. box-shadow: inset 0 3rpx 10rpx rgba(255, 255, 255, 0.4),
  601. 0 8rpx 24rpx rgba(0, 0, 0, 0.12);
  602. transition: all 0.3s ease;
  603. }
  604. .grid-icon-wrapper::before {
  605. content: '';
  606. position: absolute;
  607. top: -50%;
  608. left: -50%;
  609. width: 200%;
  610. height: 200%;
  611. background: linear-gradient(135deg,
  612. rgba(255, 255, 255, 0.7) 0%,
  613. rgba(255, 255, 255, 0.3) 40%,
  614. transparent 80%);
  615. transform: rotate(45deg);
  616. pointer-events: none;
  617. z-index: 1;
  618. }
  619. .grid-icon {
  620. font-size: 80rpx;
  621. color: #fff;
  622. position: relative;
  623. z-index: 2;
  624. filter: drop-shadow(0 4rpx 8rpx rgba(0, 0, 0, 0.15));
  625. }
  626. .grid-text {
  627. font-size: 22rpx;
  628. font-weight: 600;
  629. color: #2d2d46;
  630. text-align: center;
  631. line-height: 1.2;
  632. text-shadow: 0 1rpx 3rpx rgba(0, 0, 0, 0.05);
  633. overflow: hidden;
  634. text-overflow: ellipsis;
  635. display: -webkit-box;
  636. -webkit-line-clamp: 1;
  637. -webkit-box-orient: vertical;
  638. max-width: 100%;
  639. }
  640. /* 响应式适配:小屏自动改为2列 */
  641. @media (max-width: 600rpx) {
  642. .grid-item {
  643. min-width: calc(50% - 15rpx);
  644. max-width: calc(50% - 15rpx);
  645. }
  646. }
  647. /* 本周最佳红娘 */
  648. .best-matchmaker-section {
  649. flex: 1;
  650. min-height: 400rpx;
  651. padding: 30rpx;
  652. background: #FFFFFF;
  653. border-radius: 20rpx;
  654. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  655. display: flex;
  656. flex-direction: column;
  657. margin-bottom: 20rpx;
  658. .section-header {
  659. display: flex;
  660. justify-content: space-between;
  661. align-items: center;
  662. margin-bottom: 20rpx;
  663. .section-title {
  664. display: flex;
  665. align-items: center;
  666. font-size: 30rpx;
  667. font-weight: bold;
  668. color: red;
  669. .crown-icon {
  670. font-size: 32rpx;
  671. margin-right: 10rpx;
  672. }
  673. }
  674. .section-more {
  675. font-size: 24rpx;
  676. color: #9C27B0;
  677. }
  678. }
  679. .best-matchmaker-list {
  680. flex: 1;
  681. display: flex;
  682. flex-direction: column;
  683. gap: 20rpx;
  684. .best-matchmaker-item {
  685. display: flex;
  686. align-items: center;
  687. gap: 20rpx;
  688. padding: 30rpx 25rpx;
  689. background: #FAFAFA;
  690. border-radius: 15rpx;
  691. min-height: 100rpx;
  692. .rank-number {
  693. width: 45rpx;
  694. height: 45rpx;
  695. display: flex;
  696. align-items: center;
  697. justify-content: center;
  698. font-size: 28rpx;
  699. font-weight: bold;
  700. color: #FFF;
  701. border-radius: 50%;
  702. background: #FFD700;
  703. &.rank-1 {
  704. background: #FFD700;
  705. }
  706. &.rank-2 {
  707. background: #C0C0C0;
  708. }
  709. &.rank-3 {
  710. background: #CD7F32;
  711. }
  712. }
  713. .avatar-small {
  714. width: 80rpx;
  715. height: 80rpx;
  716. border-radius: 50%;
  717. background: #F0F0F0;
  718. }
  719. .matchmaker-info {
  720. flex: 1;
  721. .matchmaker-name-small {
  722. display: block;
  723. font-size: 32rpx;
  724. font-weight: bold;
  725. color: #333;
  726. margin-bottom: 8rpx;
  727. }
  728. .success-count {
  729. display: block;
  730. font-size: 26rpx;
  731. color: #999;
  732. }
  733. }
  734. .likes-info {
  735. display: flex;
  736. align-items: center;
  737. gap: 10rpx;
  738. .heart-small {
  739. font-size: 28rpx;
  740. }
  741. .like-count {
  742. font-size: 28rpx;
  743. color: #E91E63;
  744. font-weight: bold;
  745. }
  746. }
  747. }
  748. }
  749. }
  750. /* 底部导航 */
  751. .tabbar {
  752. position: fixed;
  753. bottom: 0;
  754. left: 0;
  755. right: 0;
  756. height: 100rpx;
  757. background: #FFFFFF;
  758. border-top: 1rpx solid #F0F0F0;
  759. display: flex;
  760. justify-content: space-around;
  761. align-items: center;
  762. padding-bottom: env(safe-area-inset-bottom);
  763. .tabbar-item {
  764. display: flex;
  765. flex-direction: column;
  766. align-items: center;
  767. gap: 8rpx;
  768. padding: 10rpx 0;
  769. .tabbar-icon {
  770. width: 44rpx;
  771. height: 44rpx;
  772. background-size: contain;
  773. background-repeat: no-repeat;
  774. background-position: center;
  775. position: relative;
  776. .badge {
  777. position: absolute;
  778. top: -8rpx;
  779. right: -8rpx;
  780. background: #FF4444;
  781. color: #FFFFFF;
  782. font-size: 20rpx;
  783. font-weight: bold;
  784. width: 32rpx;
  785. height: 32rpx;
  786. display: flex;
  787. align-items: center;
  788. justify-content: center;
  789. border-radius: 16rpx;
  790. }
  791. }
  792. .tabbar-text {
  793. font-size: 20rpx;
  794. color: #999;
  795. }
  796. &.active {
  797. .tabbar-text {
  798. color: #9C27B0;
  799. font-weight: bold;
  800. }
  801. }
  802. &.home .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="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>');
  804. }
  805. &.resources .tabbar-icon {
  806. 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>');
  807. }
  808. &.active.resources .tabbar-icon {
  809. 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>');
  810. }
  811. &.trophy .tabbar-icon {
  812. 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>');
  813. }
  814. &.active.trophy .tabbar-icon {
  815. 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>');
  816. }
  817. &.message .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="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>');
  819. }
  820. &.active.message .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="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>');
  822. }
  823. &.mine .tabbar-icon {
  824. 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>');
  825. }
  826. &.active.mine .tabbar-icon {
  827. 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>');
  828. }
  829. }
  830. }
  831. </style>