index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857
  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="menu-grid">
  55. <view class="menu-item" @click="navigateToMyResources">
  56. <view class="menu-icon resources"></view>
  57. <text class="menu-text">我的资源</text>
  58. </view>
  59. <view class="menu-item" @click="navigateToQualityResources">
  60. <view class="menu-icon quality"></view>
  61. <text class="menu-text">优质资源</text>
  62. </view>
  63. <view class="menu-item" @click="navigateToCourses">
  64. <view class="menu-icon courses"></view>
  65. <text class="menu-text">课程培训</text>
  66. </view>
  67. <view class="menu-item" @click="navigateToPointsMall">
  68. <view class="menu-icon mall"></view>
  69. <text class="menu-text">积分商城</text>
  70. </view>
  71. <view class="menu-item" @click="navigateToActivityCenter">
  72. <view class="menu-icon activity"></view>
  73. <text class="menu-text">活动中心</text>
  74. </view>
  75. </view>
  76. <!-- 本周最佳红娘 -->
  77. <view class="best-matchmaker-section">
  78. <view class="section-header">
  79. <text class="section-title">
  80. <text class="crown-icon">👑</text>
  81. 本周最佳红娘
  82. </text>
  83. <text class="section-more" @click="navigateToRanking">排行榜 ></text>
  84. </view>
  85. <view class="best-matchmaker-list">
  86. <view class="best-matchmaker-item" v-for="(item, index) in bestMatchmakers" :key="item.matchmaker_id || index"
  87. @click="goToMatchmakerDetail(item)">
  88. <text class="rank-number" :class="'rank-' + (index + 1)">{{ index + 1 }}</text>
  89. <image class="avatar-small" :src="item.avatar_url || '/static/default-avatar.svg'"
  90. mode="aspectFill"></image>
  91. <view class="matchmaker-info">
  92. <text class="matchmaker-name-small">{{ item.real_name || '红娘' }}</text>
  93. <text class="success-count">成功人数: {{ item.success_couples || 0 }}</text>
  94. </view>
  95. <view class="likes-info">
  96. <text class="heart-small">❤️</text>
  97. <text class="like-count">{{ item.likes || 0 }}</text>
  98. </view>
  99. </view>
  100. </view>
  101. </view>
  102. </scroll-view>
  103. <!-- 底部导航 -->
  104. <view class="tabbar">
  105. <view class="tabbar-item active home" @click="navigateToWorkbench">
  106. <view class="tabbar-icon"></view>
  107. <text class="tabbar-text">工作台</text>
  108. </view>
  109. <view class="tabbar-item resources" @click="navigateToMyResources">
  110. <view class="tabbar-icon"></view>
  111. <text class="tabbar-text">我的资源</text>
  112. </view>
  113. <view class="tabbar-item trophy" @click="navigateToRanking">
  114. <view class="tabbar-icon"></view>
  115. <text class="tabbar-text">排行榜</text>
  116. </view>
  117. <view class="tabbar-item message" @click="navigateToMessage">
  118. <view class="tabbar-icon">
  119. <view v-if="unreadCount > 0" class="badge">{{ unreadCount }}</view>
  120. </view>
  121. <text class="tabbar-text">消息</text>
  122. </view>
  123. <view class="tabbar-item mine" @click="navigateToMine">
  124. <view class="tabbar-icon"></view>
  125. <text class="tabbar-text">我的</text>
  126. </view>
  127. </view>
  128. </view>
  129. </template>
  130. <script>
  131. import api from '@/utils/api.js'
  132. export default {
  133. data() {
  134. return {
  135. bestMatchmakers: [],
  136. announcements: [],
  137. currentAnnouncementIndex: 0,
  138. makerName: uni.getStorageSync("userInfo").nickname,
  139. matchmakerInfo: {
  140. realName: '',
  141. avatarUrl: '',
  142. successCouples: 0,
  143. points: 0
  144. }
  145. }
  146. },
  147. computed: {
  148. currentAnnouncement() {
  149. return this.announcements.length > 0 ? this.announcements[this.currentAnnouncementIndex] : null
  150. },
  151. // 全局未读消息数(来自用户端已配置的 Vuex)
  152. unreadCount() {
  153. return this.$store.getters.getTotalUnread || 0
  154. }
  155. },
  156. onLoad() {
  157. this.loadMatchmakerInfo()
  158. this.loadRankingData()
  159. this.loadAnnouncements()
  160. },
  161. methods: {
  162. // 加载当前登录红娘信息
  163. async loadMatchmakerInfo() {
  164. try {
  165. const userInfo = uni.getStorageSync('userInfo')
  166. if (!userInfo || !userInfo.userId) {
  167. console.log('未登录,无法获取红娘信息')
  168. return
  169. }
  170. // 根据userId获取红娘信息
  171. const res = await api.matchmaker.getByUserId(userInfo.userId)
  172. console.log('红娘信息原始返回:', res)
  173. // 解析返回数据(可能被包装在data字段中)
  174. let matchmaker = res
  175. if (res && res.data) {
  176. matchmaker = res.data
  177. }
  178. console.log('解析后红娘信息:', matchmaker)
  179. if (matchmaker && (matchmaker.matchmakerId || matchmaker.matchmaker_id)) {
  180. // 获取红娘ID
  181. const matchmakerId = matchmaker.matchmakerId || matchmaker.matchmaker_id
  182. this.matchmakerInfo = {
  183. realName: matchmaker.realName || matchmaker.real_name || userInfo.nickname,
  184. avatarUrl: matchmaker.avatarUrl || matchmaker.avatar_url || userInfo.avatarUrl,
  185. successCouples: matchmaker.successCouples || matchmaker.success_couples || 0,
  186. points: matchmaker.points || 0
  187. }
  188. // 将matchmakerId保存到userInfo中,供其他页面使用
  189. userInfo.matchmakerId = matchmakerId
  190. uni.setStorageSync('userInfo', userInfo)
  191. console.log('设置红娘信息:', this.matchmakerInfo, '红娘ID:', matchmakerId)
  192. } else {
  193. console.log('未找到红娘信息,使用默认值')
  194. }
  195. } catch (e) {
  196. console.error('加载红娘信息失败:', e)
  197. }
  198. },
  199. // 加载排行榜数据(取前3名)
  200. async loadRankingData() {
  201. try {
  202. const res = await api.matchmaker.getRankingData({limit: 20})
  203. let list = []
  204. if (res && Array.isArray(res)) {
  205. list = res
  206. } else if (res && res.data && Array.isArray(res.data)) {
  207. list = res.data
  208. }
  209. // 只取前3名显示
  210. this.bestMatchmakers = list.slice(0, 3)
  211. } catch (e) {
  212. console.error('加载排行榜数据失败:', e)
  213. }
  214. },
  215. // 加载公告数据
  216. async loadAnnouncements() {
  217. try {
  218. const res = await api.home.getNotices()
  219. if (res && Array.isArray(res)) {
  220. this.announcements = res
  221. } else if (res && res.data && Array.isArray(res.data)) {
  222. this.announcements = res.data
  223. }
  224. // 如果有多条公告,自动轮播
  225. if (this.announcements.length > 1) {
  226. this.startAnnouncementCarousel()
  227. }
  228. } catch (e) {
  229. console.error('加载公告失败:', e)
  230. }
  231. },
  232. // 公告轮播
  233. startAnnouncementCarousel() {
  234. setInterval(() => {
  235. this.currentAnnouncementIndex = (this.currentAnnouncementIndex + 1) % this.announcements.length
  236. }, 5000)
  237. },
  238. // 公告点击
  239. handleAnnouncement() {
  240. if (this.currentAnnouncement) {
  241. uni.navigateTo({
  242. url: '/pages/announcement/list'
  243. })
  244. }
  245. },
  246. // 导航到我的资源
  247. navigateToMyResources() {
  248. uni.navigateTo({
  249. url: '/pages/matchmaker-workbench/my-resources'
  250. })
  251. },
  252. // 导航到优质资源
  253. navigateToQualityResources() {
  254. uni.navigateTo({
  255. url: '/pages/matchmaker-workbench/quality-resources'
  256. })
  257. },
  258. // 导航到课程培训
  259. navigateToCourses() {
  260. uni.navigateTo({
  261. url: '/pages/courses/list'
  262. })
  263. },
  264. // 导航到积分商城
  265. navigateToPointsMall() {
  266. uni.navigateTo({
  267. url: '/pages/matchmaker-workbench/points-mall'
  268. })
  269. },
  270. // 导航到活动中心
  271. navigateToActivityCenter() {
  272. uni.navigateTo({
  273. url: '/pages/matchmaker-workbench/activities'
  274. })
  275. },
  276. // 导航到排行榜
  277. navigateToRanking() {
  278. uni.navigateTo({
  279. url: '/pages/matchmaker-workbench/ranking'
  280. })
  281. },
  282. // 跳转到红娘详情
  283. goToMatchmakerDetail(item) {
  284. if (!item) return
  285. const id = item.matchmaker_id || item.matchmakerId
  286. if (id) {
  287. uni.navigateTo({
  288. url: `/pages/matchmakers/detail?id=${id}`
  289. })
  290. }
  291. },
  292. // 导航到工作台
  293. navigateToWorkbench() {
  294. // 已在工作台,无需跳转
  295. },
  296. // 导航到消息
  297. navigateToMessage() {
  298. uni.navigateTo({
  299. url: '/pages/matchmaker-workbench/message'
  300. })
  301. },
  302. // 导航到我的
  303. navigateToMine() {
  304. uni.navigateTo({
  305. url: '/pages/matchmaker-workbench/mine'
  306. })
  307. },
  308. // 返回用户端首页
  309. openExitPopup() {
  310. uni.navigateTo({
  311. url: '/pages/index/index'
  312. })
  313. },
  314. // 搜索
  315. handleSearch() {
  316. console.log('搜索')
  317. }
  318. }
  319. }
  320. </script>
  321. <style lang="scss" scoped>
  322. .matchmaker-workbench {
  323. min-height: 100vh;
  324. background: #FFF9F9;
  325. display: flex;
  326. flex-direction: column;
  327. }
  328. /* 顶部导航栏 */
  329. .header {
  330. display: flex;
  331. align-items: center;
  332. justify-content: space-between;
  333. padding: 25rpx 30rpx;
  334. padding-top: calc(25rpx + env(safe-area-inset-top));
  335. background: #FFF9F9;
  336. border-bottom: 1rpx solid #F0F0F0;
  337. .header-title {
  338. font-size: 38rpx;
  339. font-weight: bold;
  340. color: #9C27B0;
  341. }
  342. .header-right {
  343. display: flex;
  344. align-items: center;
  345. gap: 20rpx;
  346. .search-icon,
  347. .settings-icon {
  348. width: 44rpx;
  349. height: 44rpx;
  350. background-size: contain;
  351. background-repeat: no-repeat;
  352. background-position: center;
  353. }
  354. .search-icon {
  355. 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>');
  356. }
  357. .settings-icon {
  358. 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>');
  359. }
  360. /* 返回用户端按钮 - 与"前往红娘工作台"按钮样式一致 */
  361. .back-to-user-btn {
  362. height: 60rpx;
  363. padding: 0 24rpx;
  364. background: linear-gradient(135deg, #FF8A9B 0%, #FF6B8A 100%);
  365. border-radius: 30rpx;
  366. display: flex;
  367. align-items: center;
  368. justify-content: center;
  369. box-shadow: 0 4rpx 12rpx rgba(255, 107, 138, 0.3);
  370. transition: all 0.3s ease;
  371. &:active {
  372. transform: scale(0.95);
  373. box-shadow: 0 2rpx 8rpx rgba(255, 107, 138, 0.3);
  374. }
  375. .btn-text {
  376. font-size: 26rpx;
  377. color: #FFFFFF;
  378. font-weight: bold;
  379. white-space: nowrap;
  380. }
  381. }
  382. }
  383. }
  384. .content {
  385. flex: 1;
  386. padding: 20rpx 20rpx 120rpx;
  387. display: flex;
  388. flex-direction: column;
  389. }
  390. /* 欢迎卡片 + 统计卡片合并 */
  391. .welcome-card {
  392. display: flex;
  393. justify-content: space-between;
  394. align-items: center;
  395. padding: 30rpx;
  396. background: linear-gradient(135deg, #FCE4EC 0%, #F8BBD0 100%);
  397. border-radius: 20rpx;
  398. margin-bottom: 20rpx;
  399. .welcome-text {
  400. display: flex;
  401. align-items: center;
  402. gap: 10rpx;
  403. .welcome-title {
  404. font-size: 38rpx;
  405. color: #333;
  406. }
  407. .heart-icon {
  408. font-size: 32rpx;
  409. }
  410. .matchmaker-name {
  411. font-size: 40rpx;
  412. font-weight: bold;
  413. color: #333;
  414. }
  415. }
  416. .avatar {
  417. width: 100rpx;
  418. height: 100rpx;
  419. border-radius: 50%;
  420. background: rgba(255, 255, 255, 0.3);
  421. }
  422. }
  423. /* 统计卡片 */
  424. .stats-cards {
  425. display: flex;
  426. gap: 20rpx;
  427. margin-bottom: 20rpx;
  428. .stats-card {
  429. flex: 1;
  430. padding: 25rpx;
  431. border-radius: 15rpx;
  432. background: #FFFFFF;
  433. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  434. .stats-row {
  435. display: flex;
  436. align-items: center;
  437. gap: 10rpx;
  438. margin-bottom: 8rpx;
  439. }
  440. .stats-number {
  441. font-size: 48rpx;
  442. font-weight: bold;
  443. }
  444. .stats-tag {
  445. font-size: 20rpx;
  446. padding: 4rpx 12rpx;
  447. border-radius: 6rpx;
  448. font-weight: 500;
  449. &.orange {
  450. color: #FF6B8A;
  451. border: 1rpx solid #FF6B8A;
  452. background: rgba(255, 107, 138, 0.1);
  453. }
  454. &.purple {
  455. color: #9C27B0;
  456. border: 1rpx solid #9C27B0;
  457. background: rgba(156, 39, 176, 0.1);
  458. }
  459. }
  460. .stats-label {
  461. display: block;
  462. font-size: 28rpx;
  463. margin-bottom: 8rpx;
  464. }
  465. .stats-subtitle {
  466. display: block;
  467. font-size: 24rpx;
  468. color: #999;
  469. }
  470. .stats-extra {
  471. display: block;
  472. font-size: 22rpx;
  473. color: #999;
  474. margin-top: 8rpx;
  475. }
  476. &.success {
  477. .stats-number {
  478. color: #FF6B8A;
  479. }
  480. .stats-label {
  481. color: #333;
  482. }
  483. }
  484. &.points {
  485. .stats-number {
  486. color: #9C27B0;
  487. }
  488. .stats-label {
  489. color: #333;
  490. }
  491. }
  492. }
  493. }
  494. /* 公告卡片 */
  495. .announcement-card {
  496. display: flex;
  497. align-items: center;
  498. justify-content: space-between;
  499. padding: 35rpx 30rpx;
  500. min-height: 80rpx;
  501. background: #FFFFFF;
  502. border-radius: 20rpx;
  503. margin-bottom: 20rpx;
  504. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  505. position: relative;
  506. .announcement-tag {
  507. display: inline-block;
  508. background: #FF9800;
  509. color: #FFFFFF;
  510. font-size: 22rpx;
  511. padding: 6rpx 16rpx;
  512. border-radius: 12rpx;
  513. margin-right: 15rpx;
  514. font-weight: bold;
  515. }
  516. .announcement-content {
  517. flex: 1;
  518. font-size: 26rpx;
  519. color: #333;
  520. line-height: 1.4;
  521. }
  522. .arrow-right {
  523. width: 24rpx;
  524. height: 24rpx;
  525. 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>');
  526. background-size: contain;
  527. background-repeat: no-repeat;
  528. background-position: center;
  529. margin-left: 15rpx;
  530. }
  531. }
  532. /* 功能菜单 */
  533. .menu-grid {
  534. display: grid;
  535. grid-template-columns: repeat(5, 1fr);
  536. gap: 25rpx;
  537. padding: 35rpx 20rpx;
  538. background: #FFFFFF;
  539. border-radius: 20rpx;
  540. margin-bottom: 20rpx;
  541. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  542. .menu-item {
  543. display: flex;
  544. flex-direction: column;
  545. align-items: center;
  546. gap: 15rpx;
  547. .menu-icon {
  548. width: 90rpx;
  549. height: 90rpx;
  550. border-radius: 50%;
  551. background-size: 50rpx 50rpx;
  552. background-repeat: no-repeat;
  553. background-position: center;
  554. &.resources {
  555. background-color: #E8F5E9;
  556. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%234CAF50"><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>');
  557. }
  558. &.quality {
  559. background-color: #FFF3E0;
  560. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23FF9800"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>');
  561. }
  562. &.courses {
  563. background-color: #E3F2FD;
  564. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%232196F3"><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 19h14v-2H5v2zm0-4h14v-2H5v2zm0-4h14v-2H5v2z"/></svg>');
  565. }
  566. &.mall {
  567. background-color: #F3E5F5;
  568. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2H1zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"/></svg>');
  569. }
  570. &.activity {
  571. background-color: #FFEBEE;
  572. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23F44336"><path d="M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-3 11h-4v4h-2v-4H7v-2h4V7h2v4h4v2z"/></svg>');
  573. }
  574. }
  575. .menu-text {
  576. font-size: 26rpx;
  577. color: #333;
  578. }
  579. }
  580. }
  581. /* 本周最佳红娘 */
  582. .best-matchmaker-section {
  583. flex: 1;
  584. min-height: 400rpx;
  585. padding: 30rpx;
  586. background: #FFFFFF;
  587. border-radius: 20rpx;
  588. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  589. display: flex;
  590. flex-direction: column;
  591. margin-bottom: 20rpx;
  592. .section-header {
  593. display: flex;
  594. justify-content: space-between;
  595. align-items: center;
  596. margin-bottom: 20rpx;
  597. .section-title {
  598. display: flex;
  599. align-items: center;
  600. font-size: 30rpx;
  601. font-weight: bold;
  602. color: red;
  603. .crown-icon {
  604. font-size: 32rpx;
  605. margin-right: 10rpx;
  606. }
  607. }
  608. .section-more {
  609. font-size: 24rpx;
  610. color: #9C27B0;
  611. }
  612. }
  613. .best-matchmaker-list {
  614. flex: 1;
  615. display: flex;
  616. flex-direction: column;
  617. gap: 20rpx;
  618. .best-matchmaker-item {
  619. display: flex;
  620. align-items: center;
  621. gap: 20rpx;
  622. padding: 30rpx 25rpx;
  623. background: #FAFAFA;
  624. border-radius: 15rpx;
  625. min-height: 100rpx;
  626. .rank-number {
  627. width: 45rpx;
  628. height: 45rpx;
  629. display: flex;
  630. align-items: center;
  631. justify-content: center;
  632. font-size: 28rpx;
  633. font-weight: bold;
  634. color: #FFF;
  635. border-radius: 50%;
  636. background: #FFD700;
  637. &.rank-1 {
  638. background: #FFD700;
  639. }
  640. &.rank-2 {
  641. background: #C0C0C0;
  642. }
  643. &.rank-3 {
  644. background: #CD7F32;
  645. }
  646. }
  647. .avatar-small {
  648. width: 80rpx;
  649. height: 80rpx;
  650. border-radius: 50%;
  651. background: #F0F0F0;
  652. }
  653. .matchmaker-info {
  654. flex: 1;
  655. .matchmaker-name-small {
  656. display: block;
  657. font-size: 32rpx;
  658. font-weight: bold;
  659. color: #333;
  660. margin-bottom: 8rpx;
  661. }
  662. .success-count {
  663. display: block;
  664. font-size: 26rpx;
  665. color: #999;
  666. }
  667. }
  668. .likes-info {
  669. display: flex;
  670. align-items: center;
  671. gap: 10rpx;
  672. .heart-small {
  673. font-size: 28rpx;
  674. }
  675. .like-count {
  676. font-size: 28rpx;
  677. color: #E91E63;
  678. font-weight: bold;
  679. }
  680. }
  681. }
  682. }
  683. }
  684. /* 底部导航 */
  685. .tabbar {
  686. position: fixed;
  687. bottom: 0;
  688. left: 0;
  689. right: 0;
  690. height: 100rpx;
  691. background: #FFFFFF;
  692. border-top: 1rpx solid #F0F0F0;
  693. display: flex;
  694. justify-content: space-around;
  695. align-items: center;
  696. padding-bottom: env(safe-area-inset-bottom);
  697. .tabbar-item {
  698. display: flex;
  699. flex-direction: column;
  700. align-items: center;
  701. gap: 8rpx;
  702. padding: 10rpx 0;
  703. .tabbar-icon {
  704. width: 44rpx;
  705. height: 44rpx;
  706. background-size: contain;
  707. background-repeat: no-repeat;
  708. background-position: center;
  709. position: relative;
  710. .badge {
  711. position: absolute;
  712. top: -8rpx;
  713. right: -8rpx;
  714. background: #FF4444;
  715. color: #FFFFFF;
  716. font-size: 20rpx;
  717. font-weight: bold;
  718. width: 32rpx;
  719. height: 32rpx;
  720. display: flex;
  721. align-items: center;
  722. justify-content: center;
  723. border-radius: 16rpx;
  724. }
  725. }
  726. .tabbar-text {
  727. font-size: 20rpx;
  728. color: #999;
  729. }
  730. &.active {
  731. .tabbar-text {
  732. color: #9C27B0;
  733. font-weight: bold;
  734. }
  735. }
  736. &.home .tabbar-icon {
  737. 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>');
  738. }
  739. &.resources .tabbar-icon {
  740. 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>');
  741. }
  742. &.active.resources .tabbar-icon {
  743. 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>');
  744. }
  745. &.trophy .tabbar-icon {
  746. 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>');
  747. }
  748. &.active.trophy .tabbar-icon {
  749. 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>');
  750. }
  751. &.message .tabbar-icon {
  752. 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>');
  753. }
  754. &.active.message .tabbar-icon {
  755. 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>');
  756. }
  757. &.mine .tabbar-icon {
  758. 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>');
  759. }
  760. &.active.mine .tabbar-icon {
  761. 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>');
  762. }
  763. }
  764. }
  765. </style>