index.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769
  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">高红娘</text>
  24. </view>
  25. <view class="avatar"></view>
  26. </view>
  27. <!-- 统计卡片 -->
  28. <view class="stats-cards">
  29. <view class="stats-card success">
  30. <text class="stats-number">520</text>
  31. <text class="stats-label">成功撮合</text>
  32. <text class="stats-subtitle">匹配数</text>
  33. </view>
  34. <view class="stats-card points">
  35. <text class="stats-number">23</text>
  36. <text class="stats-label">积分可兑礼</text>
  37. <text class="stats-subtitle">我的积分</text>
  38. <text class="stats-extra">可兑换</text>
  39. </view>
  40. </view>
  41. <!-- 公告卡片 -->
  42. <view class="announcement-card" @click="handleAnnouncement">
  43. <text class="announcement-tag">公告</text>
  44. <text class="announcement-content">恭喜高红娘成功助力丁先生和贾女士牵手成功!</text>
  45. <view class="arrow-right"></view>
  46. </view>
  47. <!-- 功能菜单 -->
  48. <view class="menu-grid">
  49. <view class="menu-item" @click="navigateToMyResources">
  50. <view class="menu-icon resources"></view>
  51. <text class="menu-text">我的资源</text>
  52. </view>
  53. <view class="menu-item" @click="navigateToQualityResources">
  54. <view class="menu-icon quality"></view>
  55. <text class="menu-text">优质资源</text>
  56. </view>
  57. <view class="menu-item" @click="navigateToCourses">
  58. <view class="menu-icon courses"></view>
  59. <text class="menu-text">课程培训</text>
  60. </view>
  61. <view class="menu-item" @click="navigateToPointsMall">
  62. <view class="menu-icon mall"></view>
  63. <text class="menu-text">积分商城</text>
  64. </view>
  65. <view class="menu-item" @click="navigateToActivityCenter">
  66. <view class="menu-icon activity"></view>
  67. <text class="menu-text">活动中心</text>
  68. </view>
  69. </view>
  70. <!-- 本周最佳红娘 -->
  71. <view class="best-matchmaker-section">
  72. <view class="section-header">
  73. <text class="section-title">
  74. <text class="crown-icon">👑</text>
  75. 本周最佳红娘
  76. </text>
  77. <text class="section-more" @click="navigateToRanking">排行榜 ></text>
  78. </view>
  79. <view class="best-matchmaker-list">
  80. <view class="best-matchmaker-item" v-for="(item, index) in bestMatchmakers" :key="index">
  81. <text class="rank-number">{{ item.rank }}</text>
  82. <view class="avatar-small"></view>
  83. <view class="matchmaker-info">
  84. <text class="matchmaker-name-small">{{ item.name }}</text>
  85. <text class="success-count">成功人数: {{ item.successCount }}</text>
  86. </view>
  87. <view class="likes-info">
  88. <text class="heart-small">❤️</text>
  89. <text class="like-count">{{ item.likes }}</text>
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. </scroll-view>
  95. <!-- 退出红娘工作台弹框 -->
  96. <uni-popup ref="exitPopup" type="dialog">
  97. <uni-popup-dialog
  98. type="confirm"
  99. title="退出工作台"
  100. content="确定要退出红娘工作台吗?"
  101. confirmText="确定"
  102. cancelText="取消"
  103. @confirm="exitWorkbench"
  104. @cancel="closeExitPopup">
  105. </uni-popup-dialog>
  106. </uni-popup>
  107. <!-- 底部导航 -->
  108. <view class="tabbar">
  109. <view class="tabbar-item active" @click="navigateToWorkbench">
  110. <view class="tabbar-icon home"></view>
  111. <text class="tabbar-text">工作台</text>
  112. </view>
  113. <view class="tabbar-item" @click="navigateToMyResources">
  114. <view class="tabbar-icon resources"></view>
  115. <text class="tabbar-text">我的资源</text>
  116. </view>
  117. <view class="tabbar-item" @click="navigateToRanking">
  118. <view class="tabbar-icon trophy"></view>
  119. <text class="tabbar-text">排行榜</text>
  120. </view>
  121. <view class="tabbar-item" @click="navigateToMessage">
  122. <view class="tabbar-icon message">
  123. <view class="badge">3</view>
  124. </view>
  125. <text class="tabbar-text">消息</text>
  126. </view>
  127. <view class="tabbar-item" @click="navigateToMine">
  128. <view class="tabbar-icon mine"></view>
  129. <text class="tabbar-text">我的</text>
  130. </view>
  131. </view>
  132. </view>
  133. </template>
  134. <script>
  135. import api from '@/utils/api.js'
  136. export default {
  137. data() {
  138. return {
  139. bestMatchmakers: [
  140. { rank: 1, name: '小超超', successCount: 12, likes: 28 },
  141. { rank: 2, name: '小颖颖', successCount: 11, likes: 25 },
  142. { rank: 3, name: '小魏魏', successCount: 10, likes: 22 }
  143. ]
  144. }
  145. },
  146. onLoad() {
  147. // 加载工作台数据
  148. this.loadWorkbenchData()
  149. },
  150. methods: {
  151. // 加载工作台数据
  152. async loadWorkbenchData() {
  153. try {
  154. const res = await api.matchmaker.getWorkbenchData()
  155. // 处理返回数据
  156. } catch (e) {
  157. console.error('加载工作台数据失败:', e)
  158. }
  159. },
  160. // 搜索
  161. handleSearch() {
  162. // 实现搜索功能
  163. },
  164. // 打开退出工作台弹框
  165. openExitPopup() {
  166. if (this.$refs.exitPopup) {
  167. this.$refs.exitPopup.open()
  168. }
  169. },
  170. // 关闭退出工作台弹框
  171. closeExitPopup() {
  172. if (this.$refs.exitPopup) {
  173. this.$refs.exitPopup.close()
  174. }
  175. },
  176. // 退出红娘工作台
  177. exitWorkbench() {
  178. if (this.$refs.exitPopup) {
  179. this.$refs.exitPopup.close()
  180. }
  181. // 返回用户首页
  182. uni.redirectTo({
  183. url: '/pages/index/index'
  184. })
  185. },
  186. // 公告点击
  187. handleAnnouncement() {
  188. // 跳转到公告详情
  189. },
  190. // 导航到我的资源
  191. navigateToMyResources() {
  192. uni.navigateTo({
  193. url: '/pages/matchmaker-workbench/my-resources'
  194. })
  195. },
  196. // 导航到优质资源
  197. navigateToQualityResources() {
  198. uni.navigateTo({
  199. url: '/pages/matchmaker-workbench/quality-resources'
  200. })
  201. },
  202. // 导航到课程培训
  203. navigateToCourses() {
  204. uni.navigateTo({
  205. url: '/pages/courses/list'
  206. })
  207. },
  208. // 导航到积分商城
  209. navigateToPointsMall() {
  210. uni.navigateTo({
  211. url: '/pages/matchmaker-workbench/points-mall'
  212. })
  213. },
  214. // 导航到活动中心
  215. navigateToActivityCenter() {
  216. uni.navigateTo({
  217. url: '/pages/activities/list'
  218. })
  219. },
  220. // 导航到排行榜
  221. navigateToRanking() {
  222. uni.navigateTo({
  223. url: '/pages/matchmaker-workbench/ranking'
  224. })
  225. },
  226. // 导航到工作台
  227. navigateToWorkbench() {
  228. // 已在工作台,无需跳转
  229. },
  230. // 导航到消息
  231. navigateToMessage() {
  232. uni.navigateTo({
  233. url: '/pages/matchmaker-workbench/message'
  234. })
  235. },
  236. // 导航到我的
  237. navigateToMine() {
  238. uni.navigateTo({
  239. url: '/pages/matchmaker-workbench/mine'
  240. })
  241. }
  242. }
  243. }
  244. </script>
  245. <style lang="scss" scoped>
  246. .matchmaker-workbench {
  247. min-height: 100vh;
  248. background: #FFF9F9;
  249. display: flex;
  250. flex-direction: column;
  251. }
  252. /* 顶部导航栏 */
  253. .header {
  254. display: flex;
  255. align-items: center;
  256. justify-content: space-between;
  257. padding: 25rpx 30rpx;
  258. padding-top: calc(25rpx + env(safe-area-inset-top));
  259. background: #FFF9F9;
  260. border-bottom: 1rpx solid #F0F0F0;
  261. .header-title {
  262. font-size: 38rpx;
  263. font-weight: bold;
  264. color: #9C27B0;
  265. }
  266. .header-right {
  267. display: flex;
  268. align-items: center;
  269. gap: 20rpx;
  270. .search-icon,
  271. .exit-workbench-btn {
  272. width: 68rpx;
  273. height: 68rpx;
  274. display: flex;
  275. align-items: center;
  276. justify-content: center;
  277. }
  278. .search-icon {
  279. 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>');
  280. background-size: 44rpx 44rpx;
  281. background-repeat: no-repeat;
  282. background-position: center;
  283. }
  284. /* 退出工作台按钮样式 */
  285. .exit-workbench-btn {
  286. background: transparent;
  287. border-radius: 4rpx;
  288. transition: all 0.2s ease;
  289. &:active {
  290. opacity: 0.6;
  291. transform: scale(0.95);
  292. }
  293. .arrow-container {
  294. display: flex;
  295. flex-direction: column;
  296. align-items: center;
  297. gap: 4rpx;
  298. width: 60rpx;
  299. }
  300. .arrow {
  301. position: relative;
  302. width: 64rpx;
  303. height: 22rpx;
  304. }
  305. .arrow::before,
  306. .arrow::after {
  307. content: '';
  308. position: absolute;
  309. transition: all 0.2s ease;
  310. }
  311. /* 上方箭头 - 向右 */
  312. .arrow-top::before {
  313. top: 8rpx;
  314. left: 0;
  315. width: 40rpx;
  316. height: 6rpx;
  317. background: #333;
  318. }
  319. .arrow-top::after {
  320. top: 0;
  321. right: 0;
  322. width: 0;
  323. height: 0;
  324. border-top: 11rpx solid transparent;
  325. border-bottom: 11rpx solid transparent;
  326. border-left: 24rpx solid #333;
  327. }
  328. /* 下方箭头 - 向左 */
  329. .arrow-bottom::before {
  330. top: 8rpx;
  331. right: 0;
  332. width: 40rpx;
  333. height: 6rpx;
  334. background: #333;
  335. }
  336. .arrow-bottom::after {
  337. top: 0;
  338. left: 0;
  339. width: 0;
  340. height: 0;
  341. border-top: 11rpx solid transparent;
  342. border-bottom: 11rpx solid transparent;
  343. border-right: 24rpx solid #333;
  344. }
  345. }
  346. }
  347. }
  348. .content {
  349. flex: 1;
  350. padding-bottom: 120rpx;
  351. }
  352. /* 欢迎卡片 */
  353. .welcome-card {
  354. display: flex;
  355. justify-content: space-between;
  356. align-items: center;
  357. padding: 30rpx;
  358. background: linear-gradient(135deg, #FCE4EC 0%, #F8BBD0 100%);
  359. border-radius: 20rpx;
  360. margin: 20rpx;
  361. .welcome-text {
  362. display: flex;
  363. align-items: center;
  364. gap: 10rpx;
  365. .welcome-title {
  366. font-size: 32rpx;
  367. color: #333;
  368. }
  369. .heart-icon {
  370. font-size: 28rpx;
  371. }
  372. .matchmaker-name {
  373. font-size: 34rpx;
  374. font-weight: bold;
  375. color: #333;
  376. }
  377. }
  378. .avatar {
  379. width: 100rpx;
  380. height: 100rpx;
  381. border-radius: 50%;
  382. background: rgba(255, 255, 255, 0.3);
  383. }
  384. }
  385. /* 统计卡片 */
  386. .stats-cards {
  387. display: flex;
  388. gap: 20rpx;
  389. padding: 0 20rpx;
  390. margin-bottom: 20rpx;
  391. .stats-card {
  392. flex: 1;
  393. padding: 25rpx;
  394. border-radius: 15rpx;
  395. background: #FFFFFF;
  396. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  397. .stats-number {
  398. display: block;
  399. font-size: 48rpx;
  400. font-weight: bold;
  401. margin-bottom: 8rpx;
  402. }
  403. .stats-label {
  404. display: block;
  405. font-size: 28rpx;
  406. margin-bottom: 8rpx;
  407. }
  408. .stats-subtitle {
  409. display: block;
  410. font-size: 24rpx;
  411. color: #999;
  412. }
  413. .stats-extra {
  414. display: block;
  415. font-size: 22rpx;
  416. color: #999;
  417. margin-top: 8rpx;
  418. }
  419. &.success {
  420. .stats-number {
  421. color: #FF6B8A;
  422. }
  423. .stats-label {
  424. color: #333;
  425. }
  426. }
  427. &.points {
  428. .stats-number {
  429. color: #9C27B0;
  430. }
  431. .stats-label {
  432. color: #333;
  433. }
  434. }
  435. }
  436. }
  437. /* 公告卡片 */
  438. .announcement-card {
  439. display: flex;
  440. align-items: center;
  441. justify-content: space-between;
  442. padding: 25rpx;
  443. background: #FFF3E0;
  444. border-radius: 15rpx;
  445. margin: 0 20rpx 20rpx;
  446. position: relative;
  447. .announcement-tag {
  448. display: inline-block;
  449. background: #FF9800;
  450. color: #FFFFFF;
  451. font-size: 22rpx;
  452. padding: 6rpx 16rpx;
  453. border-radius: 12rpx;
  454. margin-right: 15rpx;
  455. font-weight: bold;
  456. }
  457. .announcement-content {
  458. flex: 1;
  459. font-size: 26rpx;
  460. color: #333;
  461. line-height: 1.4;
  462. }
  463. .arrow-right {
  464. width: 24rpx;
  465. height: 24rpx;
  466. 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>');
  467. background-size: contain;
  468. background-repeat: no-repeat;
  469. background-position: center;
  470. margin-left: 15rpx;
  471. }
  472. }
  473. /* 功能菜单 */
  474. .menu-grid {
  475. display: grid;
  476. grid-template-columns: repeat(5, 1fr);
  477. gap: 20rpx;
  478. padding: 20rpx;
  479. background: #FFFFFF;
  480. border-radius: 15rpx;
  481. margin: 0 20rpx 20rpx;
  482. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  483. .menu-item {
  484. display: flex;
  485. flex-direction: column;
  486. align-items: center;
  487. gap: 12rpx;
  488. .menu-icon {
  489. width: 64rpx;
  490. height: 64rpx;
  491. border-radius: 50%;
  492. background-size: 40rpx 40rpx;
  493. background-repeat: no-repeat;
  494. background-position: center;
  495. }
  496. .menu-text {
  497. font-size: 24rpx;
  498. color: #333;
  499. }
  500. &.resources .menu-icon {
  501. background-color: #E8F5E8;
  502. background-image: url('data:image/svg+xml;utf8,<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>');
  503. }
  504. &.quality .menu-icon {
  505. background-color: #FFF3E0;
  506. background-image: url('data:image/svg+xml;utf8,<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>');
  507. }
  508. &.courses .menu-icon {
  509. background-color: #E3F2FD;
  510. background-image: url('data:image/svg+xml;utf8,<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-2zm-4 14H7v-2h8v2zm3-4H7v-2h11v2zm0-4H7V7h11v2z"/></svg>');
  511. }
  512. &.mall .menu-icon {
  513. background-color: #F3E5F5;
  514. 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="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>');
  515. }
  516. &.activity .menu-icon {
  517. background-color: #FFEBEE;
  518. background-image: url('data:image/svg+xml;utf8,<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>');
  519. }
  520. }
  521. }
  522. /* 本周最佳红娘 */
  523. .best-matchmaker-section {
  524. padding: 20rpx;
  525. background: #FFFFFF;
  526. border-radius: 15rpx;
  527. margin: 0 20rpx 20rpx;
  528. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  529. .section-header {
  530. display: flex;
  531. justify-content: space-between;
  532. align-items: center;
  533. margin-bottom: 25rpx;
  534. .section-title {
  535. display: flex;
  536. align-items: center;
  537. font-size: 30rpx;
  538. font-weight: bold;
  539. color: #333;
  540. .crown-icon {
  541. font-size: 32rpx;
  542. margin-right: 10rpx;
  543. }
  544. }
  545. .section-more {
  546. font-size: 24rpx;
  547. color: #9C27B0;
  548. }
  549. }
  550. .best-matchmaker-list {
  551. .display: flex;
  552. flex-direction: column;
  553. gap: 20rpx;
  554. .best-matchmaker-item {
  555. display: flex;
  556. align-items: center;
  557. gap: 20rpx;
  558. .rank-number {
  559. width: 40rpx;
  560. height: 40rpx;
  561. display: flex;
  562. align-items: center;
  563. justify-content: center;
  564. font-size: 24rpx;
  565. font-weight: bold;
  566. color: #FFF;
  567. border-radius: 50%;
  568. background: #FFD700;
  569. }
  570. .avatar-small {
  571. width: 60rpx;
  572. height: 60rpx;
  573. border-radius: 50%;
  574. background: #F0F0F0;
  575. }
  576. .matchmaker-info {
  577. flex: 1;
  578. .matchmaker-name-small {
  579. display: block;
  580. font-size: 28rpx;
  581. font-weight: bold;
  582. color: #333;
  583. margin-bottom: 4rpx;
  584. }
  585. .success-count {
  586. display: block;
  587. font-size: 22rpx;
  588. color: #999;
  589. }
  590. }
  591. .likes-info {
  592. display: flex;
  593. align-items: center;
  594. gap: 8rpx;
  595. .heart-small {
  596. font-size: 24rpx;
  597. }
  598. .like-count {
  599. font-size: 24rpx;
  600. color: #333;
  601. }
  602. }
  603. }
  604. }
  605. }
  606. /* 底部导航 */
  607. .tabbar {
  608. position: fixed;
  609. bottom: 0;
  610. left: 0;
  611. right: 0;
  612. height: 100rpx;
  613. background: #FFFFFF;
  614. border-top: 1rpx solid #F0F0F0;
  615. display: flex;
  616. justify-content: space-around;
  617. align-items: center;
  618. padding-bottom: env(safe-area-inset-bottom);
  619. .tabbar-item {
  620. display: flex;
  621. flex-direction: column;
  622. align-items: center;
  623. gap: 8rpx;
  624. padding: 10rpx 0;
  625. .tabbar-icon {
  626. width: 44rpx;
  627. height: 44rpx;
  628. background-size: contain;
  629. background-repeat: no-repeat;
  630. background-position: center;
  631. position: relative;
  632. .badge {
  633. position: absolute;
  634. top: -8rpx;
  635. right: -8rpx;
  636. background: #FF4444;
  637. color: #FFFFFF;
  638. font-size: 20rpx;
  639. font-weight: bold;
  640. width: 32rpx;
  641. height: 32rpx;
  642. display: flex;
  643. align-items: center;
  644. justify-content: center;
  645. border-radius: 16rpx;
  646. }
  647. }
  648. .tabbar-text {
  649. font-size: 20rpx;
  650. color: #999;
  651. }
  652. &.active {
  653. .tabbar-text {
  654. color: #9C27B0;
  655. font-weight: bold;
  656. }
  657. }
  658. &.home .tabbar-icon {
  659. 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>');
  660. }
  661. &.resources .tabbar-icon {
  662. 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>');
  663. }
  664. &.active.resources .tabbar-icon {
  665. 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>');
  666. }
  667. &.trophy .tabbar-icon {
  668. 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="M18 6l-1.42 1.42-1.59-1.59L13 8.17l-1.42-1.42L9 8.17l-1.59-1.59L6 6l3 3V18c0 1.1.9 2 2 2h4c1.1 0 2-.9 2-2V9l3-3zm-4 12H8v-7.5l4-4 4 4V18z"/></svg>');
  669. }
  670. &.active.trophy .tabbar-icon {
  671. 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="M18 6l-1.42 1.42-1.59-1.59L13 8.17l-1.42-1.42L9 8.17l-1.59-1.59L6 6l3 3V18c0 1.1.9 2 2 2h4c1.1 0 2-.9 2-2V9l3-3zm-4 12H8v-7.5l4-4 4 4V18z"/></svg>');
  672. }
  673. &.message .tabbar-icon {
  674. 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>');
  675. }
  676. &.active.message .tabbar-icon {
  677. 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>');
  678. }
  679. &.mine .tabbar-icon {
  680. 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>');
  681. }
  682. &.active.mine .tabbar-icon {
  683. 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>');
  684. }
  685. }
  686. }
  687. </style>