index.vue 24 KB

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