index.vue 26 KB

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