precise-match.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812
  1. <template>
  2. <view class="precise-match">
  3. <!-- 顶部导航栏 -->
  4. <view class="header">
  5. <view class="back-icon" @click="handleBack"></view>
  6. <text class="header-title">精准匹配</text>
  7. <view class="header-right"></view>
  8. </view>
  9. <!-- 加载中 -->
  10. <view class="loading-container" v-if="loading">
  11. <text class="loading-text">正在匹配中...</text>
  12. </view>
  13. <!-- 匹配客户列表 -->
  14. <scroll-view scroll-y class="match-list" v-if="!loading">
  15. <view class="match-client" v-for="(client, index) in matchClients" :key="client.id || index">
  16. <!-- 匹配度标签 -->
  17. <view class="match-score-badge" v-if="client.matchScore">
  18. <text class="score-text">匹配度: {{ Math.round(client.matchScore) }}%</text>
  19. </view>
  20. <view class="client-info">
  21. <image :src="client.avatar" class="client-avatar" mode="aspectFill"></image>
  22. <view class="info-content">
  23. <view class="client-name">
  24. <text class="name-text">{{ client.name }}</text>
  25. <text class="client-gender">{{ client.gender }}</text>
  26. <text class="client-status">{{ client.status }}</text>
  27. </view>
  28. <view class="client-tags">
  29. <text class="tag" v-for="(tag, tagIndex) in client.tags" :key="tagIndex">{{ tag }}</text>
  30. </view>
  31. <view class="user-details" v-if="client.age || client.height || client.diploma">
  32. <text class="detail-item" v-if="client.age">{{ client.age }}岁</text>
  33. <text class="detail-item" v-if="client.height">{{ client.height }}cm</text>
  34. <text class="detail-item" v-if="client.diploma">{{ client.diploma }}</text>
  35. <text class="detail-item" v-if="client.income">{{ client.income }}</text>
  36. <text class="detail-item" v-if="client.occupation">{{ client.occupation }}</text>
  37. </view>
  38. <view class="requirement">
  39. <text class="requirement-label">择偶要求:</text>
  40. <text class="requirement-content">{{ client.requirement }}</text>
  41. </view>
  42. <view class="contact-info">
  43. <text class="contact-label">联系方式:</text>
  44. <text class="contact-number">{{ client.contact || '暂无' }}</text>
  45. <text class="copy-btn" @click="handleCopy(index)">复制</text>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="action-btn" @click="handleChat(index)">牵线聊聊</view>
  50. </view>
  51. </scroll-view>
  52. <!-- 底部导航 -->
  53. <view class="tabbar">
  54. <view class="tabbar-item" @click="handleHome">
  55. <view class="tabbar-icon home"></view>
  56. <text class="tabbar-text">工作台</text>
  57. </view>
  58. <view class="tabbar-item active" @click="handleMyResources">
  59. <view class="tabbar-icon resources"></view>
  60. <text class="tabbar-text">我的资源</text>
  61. </view>
  62. <view class="tabbar-item" @click="handleRanking">
  63. <view class="tabbar-icon trophy"></view>
  64. <text class="tabbar-text">排行榜</text>
  65. </view>
  66. <view class="tabbar-item" @click="handleMessage">
  67. <view class="tabbar-icon message">
  68. <text class="badge">3</text>
  69. </view>
  70. <text class="tabbar-text">消息</text>
  71. </view>
  72. <view class="tabbar-item" @click="handleMine">
  73. <view class="tabbar-icon mine"></view>
  74. <text class="tabbar-text">我的</text>
  75. </view>
  76. </view>
  77. </view>
  78. </template>
  79. <script>
  80. export default {
  81. name: 'precise-match',
  82. data() {
  83. return {
  84. resourceId: null,
  85. matchClients: [],
  86. loading: false
  87. }
  88. },
  89. onLoad(options) {
  90. // 从URL参数获取资源ID
  91. if (options.resourceId) {
  92. console.log('当前资源ID:', options.resourceId)
  93. this.loadMatchClients(options.resourceId)
  94. } else if (options.id) {
  95. // 兼容旧的参数名
  96. console.log('当前资源ID (兼容):', options.id)
  97. this.loadMatchClients(options.id)
  98. } else {
  99. uni.showToast({
  100. title: '缺少资源ID参数',
  101. icon: 'none'
  102. })
  103. setTimeout(() => {
  104. uni.navigateBack()
  105. }, 1500)
  106. }
  107. },
  108. methods: {
  109. // 返回上一页
  110. handleBack() {
  111. uni.navigateBack()
  112. },
  113. // 复制联系方式
  114. handleCopy(index) {
  115. console.log('=== 复制联系方式 ===')
  116. console.log('传入的index:', index)
  117. // 从matchClients数组中获取client对象
  118. if (index === undefined || index === null || index < 0 || index >= this.matchClients.length) {
  119. console.error('❌ index无效:', index)
  120. console.log('当前matchClients数组长度:', this.matchClients.length)
  121. uni.showToast({
  122. title: '数据错误',
  123. icon: 'none'
  124. })
  125. return
  126. }
  127. const client = this.matchClients[index]
  128. console.log('从数组获取的client:', client)
  129. if (!client) {
  130. console.error('❌ client对象为空')
  131. console.log('当前matchClients数组:', this.matchClients)
  132. uni.showToast({
  133. title: '数据错误',
  134. icon: 'none'
  135. })
  136. return
  137. }
  138. console.log('client.contact:', client.contact)
  139. console.log('client.originalPhone:', client.originalPhone)
  140. console.log('client.originalPhone类型:', typeof client.originalPhone)
  141. console.log('client的所有属性:', Object.keys(client))
  142. // 优先使用完整手机号(originalPhone),如果没有则使用脱敏的手机号
  143. let phoneToCopy = ''
  144. // 优先使用originalPhone(完整手机号)
  145. const originalPhone = client.originalPhone || client.original_phone || client.originalphone
  146. console.log('尝试获取originalPhone:', originalPhone)
  147. if (originalPhone && typeof originalPhone === 'string' && originalPhone.trim() !== '') {
  148. phoneToCopy = originalPhone.trim()
  149. console.log('✅ 使用originalPhone:', phoneToCopy.substring(0, 3) + '****')
  150. } else {
  151. console.log('❌ originalPhone为空或无效,尝试使用contact')
  152. // 如果没有originalPhone,尝试从脱敏的手机号中提取(但这样无法获取完整号码)
  153. if (client.contact) {
  154. try {
  155. const contactStr = String(client.contact || '')
  156. console.log('尝试从contact提取:', contactStr)
  157. if (contactStr && contactStr.trim() !== '') {
  158. // 去除星号(但这样只能得到部分号码,不是完整号码)
  159. const extracted = contactStr.replace(/\*+/g, '').trim()
  160. if (extracted.length >= 11) {
  161. phoneToCopy = extracted
  162. console.log('⚠️ 从脱敏号码提取:', phoneToCopy.substring(0, 3) + '****')
  163. } else {
  164. console.log('❌ 提取的号码长度不足:', extracted.length)
  165. }
  166. }
  167. } catch (e) {
  168. console.error('处理联系方式时出错:', e)
  169. }
  170. }
  171. }
  172. console.log('最终要复制的号码:', phoneToCopy ? phoneToCopy.substring(0, 3) + '****' : '空')
  173. // 检查是否为空
  174. if (!phoneToCopy || phoneToCopy === '') {
  175. console.error('❌ 联系方式为空,无法复制')
  176. uni.showToast({
  177. title: '联系方式为空',
  178. icon: 'none'
  179. })
  180. return
  181. }
  182. // 复制到剪贴板
  183. uni.setClipboardData({
  184. data: phoneToCopy,
  185. success: () => {
  186. console.log('✅ 复制成功:', phoneToCopy.substring(0, 3) + '****')
  187. uni.showToast({
  188. title: '复制成功',
  189. icon: 'success'
  190. })
  191. },
  192. fail: () => {
  193. console.error('❌ 复制失败')
  194. uni.showToast({
  195. title: '复制失败',
  196. icon: 'none'
  197. })
  198. }
  199. })
  200. },
  201. // 牵线聊聊
  202. handleChat(index) {
  203. console.log('=== 牵线聊聊 ===')
  204. console.log('传入的index:', index)
  205. console.log('matchClients数组长度:', this.matchClients.length)
  206. console.log('matchClients数组:', this.matchClients)
  207. // 验证 index 是否有效
  208. if (index === null || index === undefined || index < 0 || index >= this.matchClients.length) {
  209. console.error('❌ index无效:', index)
  210. uni.showToast({
  211. title: '数据索引错误',
  212. icon: 'none'
  213. })
  214. return
  215. }
  216. // 从数组中获取 client 对象
  217. const client = this.matchClients[index]
  218. console.log('从数组获取的client:', client)
  219. console.log('client类型:', typeof client)
  220. console.log('client是否为null:', client === null)
  221. console.log('client是否为undefined:', client === undefined)
  222. // 验证 client 对象是否存在
  223. if (!client) {
  224. console.error('❌ client对象为空')
  225. console.log('matchClients数组完整内容:', JSON.stringify(this.matchClients, null, 2))
  226. uni.showToast({
  227. title: '客户信息为空,请刷新重试',
  228. icon: 'none',
  229. duration: 3000
  230. })
  231. return
  232. }
  233. console.log('client对象的所有键:', Object.keys(client))
  234. // 尝试多种方式获取用户ID
  235. let targetUserId = null
  236. // 方式1: 使用 id 字段
  237. if (client.id !== null && client.id !== undefined && client.id !== '') {
  238. targetUserId = String(client.id)
  239. console.log('✅ 从 client.id 获取用户ID:', targetUserId)
  240. }
  241. // 方式2: 使用 userId 字段(后端原始字段)
  242. else if (client.userId !== null && client.userId !== undefined && client.userId !== '') {
  243. targetUserId = String(client.userId)
  244. console.log('✅ 从 client.userId 获取用户ID:', targetUserId)
  245. }
  246. // 方式3: 使用 user_id 字段(下划线格式)
  247. else if (client.user_id !== null && client.user_id !== undefined && client.user_id !== '') {
  248. targetUserId = String(client.user_id)
  249. console.log('✅ 从 client.user_id 获取用户ID:', targetUserId)
  250. }
  251. // 如果仍然没有获取到用户ID
  252. if (!targetUserId || targetUserId === 'null' || targetUserId === 'undefined' || targetUserId === '') {
  253. console.error('❌ 无法获取用户ID')
  254. console.log('client对象完整内容:', JSON.stringify(client, null, 2))
  255. uni.showToast({
  256. title: '无法获取用户ID,请刷新重试',
  257. icon: 'none',
  258. duration: 3000
  259. })
  260. return
  261. }
  262. // 获取其他必要信息
  263. const targetUserName = client.name || client.nickname || '用户'
  264. const targetUserAvatar = client.avatar || client.avatarUrl || '/static/default-avatar.svg'
  265. console.log('跳转参数:')
  266. console.log(' - targetUserId:', targetUserId)
  267. console.log(' - targetUserName:', targetUserName)
  268. console.log(' - targetUserAvatar:', targetUserAvatar)
  269. // 跳转到聊天页面
  270. // 注意:fromMatchmaker=1 表示来自红娘工作台,会跳过消息限制和审核
  271. uni.navigateTo({
  272. url: `/pages/message/chat?targetUserId=${targetUserId}&targetUserName=${encodeURIComponent(targetUserName)}&targetUserAvatar=${encodeURIComponent(targetUserAvatar)}&fromMatchmaker=1`,
  273. success: () => {
  274. console.log('✅ 跳转聊天页面成功')
  275. },
  276. fail: (err) => {
  277. console.error('❌ 跳转聊天页面失败:', err)
  278. uni.showToast({
  279. title: '跳转失败,请重试',
  280. icon: 'none'
  281. })
  282. }
  283. })
  284. },
  285. // 从API加载匹配客户信息
  286. async loadMatchClients(resourceId) {
  287. if (!resourceId) {
  288. console.error('资源ID为空')
  289. return
  290. }
  291. this.resourceId = resourceId
  292. this.loading = true
  293. try {
  294. const baseUrl = process.env.NODE_ENV === 'development'
  295. ? 'http://localhost:8083/api' // 开发环境 - 通过网关
  296. : 'https://your-domain.com/api' // 生产环境
  297. // 加载匹配结果
  298. const [matchError, matchRes] = await uni.request({
  299. url: `${baseUrl}/my-resource/precise-match/${resourceId}`,
  300. method: 'GET'
  301. })
  302. this.loading = false
  303. if (matchError) {
  304. console.error('加载匹配客户失败:', matchError)
  305. uni.showToast({
  306. title: '加载失败',
  307. icon: 'none'
  308. })
  309. return
  310. }
  311. if (matchRes.statusCode === 200 && matchRes.data && matchRes.data.code === 200) {
  312. const matchList = matchRes.data.data || []
  313. console.log('=== 后端返回的匹配列表 ===')
  314. console.log('匹配列表长度:', matchList.length)
  315. if (matchList.length > 0) {
  316. console.log('第一个匹配项原始数据:', JSON.stringify(matchList[0], null, 2))
  317. console.log('第一个匹配项的phone字段:', matchList[0].phone)
  318. console.log('第一个匹配项的originalPhone字段:', matchList[0].originalPhone)
  319. console.log('第一个匹配项的所有字段:', Object.keys(matchList[0]))
  320. }
  321. // 转换数据格式
  322. this.matchClients = matchList.map((item, index) => {
  323. // 确保 originalPhone 被正确映射
  324. let originalPhoneValue = ''
  325. if (item.originalPhone !== null && item.originalPhone !== undefined) {
  326. originalPhoneValue = String(item.originalPhone).trim()
  327. } else if (item.original_phone !== null && item.original_phone !== undefined) {
  328. originalPhoneValue = String(item.original_phone).trim()
  329. }
  330. // 获取用户ID,支持多种字段名
  331. let userId = null
  332. if (item.userId !== null && item.userId !== undefined) {
  333. userId = item.userId
  334. } else if (item.user_id !== null && item.user_id !== undefined) {
  335. userId = item.user_id
  336. } else if (item.id !== null && item.id !== undefined) {
  337. userId = item.id
  338. }
  339. const mappedItem = {
  340. id: userId, // 使用获取到的userId
  341. userId: userId, // 同时保留原始字段,方便容错
  342. name: item.nickname || item.name || '未知',
  343. nickname: item.nickname || item.name, // 保留原始字段
  344. gender: item.gender === 1 ? '男' : item.gender === 2 ? '女' : '未知',
  345. status: '未匹配',
  346. tags: item.tags || [],
  347. avatar: item.avatarUrl || item.avatar || 'https://via.placeholder.com/150',
  348. avatarUrl: item.avatarUrl || item.avatar, // 保留原始字段
  349. requirement: item.requirement || '暂无要求',
  350. contact: (item.phone && typeof item.phone === 'string') ? item.phone : (item.phone ? String(item.phone) : ''),
  351. originalPhone: originalPhoneValue,
  352. matchScore: item.matchScore || 0,
  353. age: item.age,
  354. height: item.height,
  355. diploma: item.diploma,
  356. income: item.income,
  357. occupation: item.occupation,
  358. address: item.address
  359. }
  360. if (index === 0) {
  361. console.log('=== 第一个匹配项映射后 ===')
  362. console.log('contact:', mappedItem.contact)
  363. console.log('originalPhone:', mappedItem.originalPhone)
  364. console.log('originalPhone类型:', typeof mappedItem.originalPhone)
  365. console.log('originalPhone是否为空:', !mappedItem.originalPhone || mappedItem.originalPhone === '')
  366. console.log('映射后的完整对象:', mappedItem)
  367. }
  368. return mappedItem
  369. })
  370. console.log('匹配结果:', this.matchClients)
  371. if (this.matchClients.length === 0) {
  372. uni.showToast({
  373. title: '未找到匹配的用户',
  374. icon: 'none'
  375. })
  376. }
  377. } else {
  378. const errorMsg = matchRes.data?.message || '加载失败'
  379. console.error('加载匹配客户失败:', errorMsg)
  380. uni.showToast({
  381. title: errorMsg,
  382. icon: 'none'
  383. })
  384. }
  385. } catch (e) {
  386. this.loading = false
  387. console.error('加载匹配客户异常:', e)
  388. uni.showToast({
  389. title: '加载失败,请稍后重试',
  390. icon: 'none'
  391. })
  392. }
  393. },
  394. // 底部导航 - 工作台
  395. handleHome() {
  396. uni.navigateTo({
  397. url: '/pages/matchmaker-workbench/index'
  398. })
  399. },
  400. // 底部导航 - 我的资源
  401. handleMyResources() {
  402. uni.navigateTo({
  403. url: '/pages/matchmaker-workbench/my-resources'
  404. })
  405. },
  406. // 底部导航 - 排行榜
  407. handleRanking() {
  408. uni.navigateTo({
  409. url: '/pages/matchmaker-workbench/ranking'
  410. })
  411. },
  412. // 底部导航 - 消息
  413. handleMessage() {
  414. uni.navigateTo({
  415. url: '/pages/matchmaker-workbench/message'
  416. })
  417. },
  418. // 底部导航 - 我的
  419. handleMine() {
  420. uni.navigateTo({
  421. url: '/pages/matchmaker-workbench/mine'
  422. })
  423. }
  424. }
  425. }
  426. </script>
  427. <style lang="scss" scoped>
  428. .precise-match {
  429. min-height: 100vh;
  430. background-color: #FFF9F9;
  431. padding-top: 90rpx;
  432. }
  433. /* 顶部导航栏 */
  434. .header {
  435. position: fixed;
  436. top: 0;
  437. left: 0;
  438. right: 0;
  439. height: 90rpx;
  440. display: flex;
  441. align-items: center;
  442. justify-content: space-between;
  443. padding: 0 20rpx;
  444. background: linear-gradient(135deg, #FCE4EC 0%, #F8BBD0 100%);
  445. z-index: 999;
  446. .back-icon {
  447. width: 44rpx;
  448. height: 44rpx;
  449. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23333"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>');
  450. background-size: contain;
  451. background-repeat: no-repeat;
  452. background-position: center;
  453. }
  454. .header-title {
  455. font-size: 38rpx;
  456. font-weight: bold;
  457. color: #333;
  458. }
  459. .header-right {
  460. width: 44rpx;
  461. }
  462. }
  463. /* 匹配客户列表 */
  464. .match-list {
  465. padding: 20rpx;
  466. padding-bottom: 120rpx;
  467. .match-client {
  468. background-color: #FFFFFF;
  469. border-radius: 20rpx;
  470. margin-bottom: 20rpx;
  471. padding: 25rpx;
  472. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
  473. .client-info {
  474. display: flex;
  475. align-items: flex-start;
  476. margin-bottom: 20rpx;
  477. .client-avatar {
  478. width: 120rpx;
  479. height: 120rpx;
  480. border-radius: 50%;
  481. margin-right: 20rpx;
  482. background-color: #F5F5F5;
  483. }
  484. .info-content {
  485. flex: 1;
  486. .client-name {
  487. display: flex;
  488. align-items: center;
  489. gap: 15rpx;
  490. margin-bottom: 10rpx;
  491. .name-text {
  492. font-size: 32rpx;
  493. font-weight: bold;
  494. color: #333;
  495. }
  496. .client-gender {
  497. font-size: 26rpx;
  498. color: #666;
  499. }
  500. .client-status {
  501. font-size: 24rpx;
  502. color: #FF6B8A;
  503. background-color: #FFF3F5;
  504. padding: 4rpx 12rpx;
  505. border-radius: 15rpx;
  506. }
  507. }
  508. .client-tags {
  509. display: flex;
  510. flex-wrap: wrap;
  511. gap: 10rpx;
  512. margin-bottom: 15rpx;
  513. .tag {
  514. padding: 6rpx 16rpx;
  515. background-color: #F3E5F5;
  516. color: #9C27B0;
  517. border-radius: 15rpx;
  518. font-size: 22rpx;
  519. }
  520. }
  521. .requirement {
  522. display: flex;
  523. margin-bottom: 15rpx;
  524. .requirement-label {
  525. font-size: 26rpx;
  526. color: #666;
  527. margin-right: 10rpx;
  528. }
  529. .requirement-content {
  530. font-size: 26rpx;
  531. color: #333;
  532. }
  533. }
  534. .user-details {
  535. display: flex;
  536. flex-wrap: wrap;
  537. gap: 10rpx;
  538. margin-bottom: 15rpx;
  539. font-size: 24rpx;
  540. color: #999;
  541. .detail-item {
  542. display: flex;
  543. align-items: center;
  544. &::after {
  545. content: '|';
  546. margin: 0 10rpx;
  547. color: #ddd;
  548. }
  549. &:last-child::after {
  550. display: none;
  551. }
  552. }
  553. }
  554. .contact-info {
  555. display: flex;
  556. align-items: center;
  557. .contact-label {
  558. font-size: 26rpx;
  559. color: #666;
  560. margin-right: 10rpx;
  561. }
  562. .contact-number {
  563. font-size: 26rpx;
  564. color: #333;
  565. margin-right: 15rpx;
  566. }
  567. .copy-btn {
  568. font-size: 24rpx;
  569. color: #9C27B0;
  570. padding: 6rpx 16rpx;
  571. background-color: #F3E5F5;
  572. border-radius: 15rpx;
  573. }
  574. }
  575. }
  576. }
  577. .action-btn {
  578. width: 200rpx;
  579. height: 60rpx;
  580. display: flex;
  581. align-items: center;
  582. justify-content: center;
  583. background-color: #9C27B0;
  584. color: #FFFFFF;
  585. border-radius: 30rpx;
  586. font-size: 28rpx;
  587. font-weight: bold;
  588. margin-left: auto;
  589. }
  590. .match-score-badge {
  591. position: absolute;
  592. top: 20rpx;
  593. right: 20rpx;
  594. background: linear-gradient(135deg, #FF6B8A 0%, #FF8E9B 100%);
  595. color: #FFFFFF;
  596. padding: 8rpx 16rpx;
  597. border-radius: 20rpx;
  598. font-size: 22rpx;
  599. font-weight: bold;
  600. z-index: 10;
  601. .score-text {
  602. color: #FFFFFF;
  603. }
  604. }
  605. }
  606. }
  607. /* 加载中 */
  608. .loading-container {
  609. display: flex;
  610. justify-content: center;
  611. align-items: center;
  612. padding: 100rpx 0;
  613. .loading-text {
  614. font-size: 28rpx;
  615. color: #999;
  616. }
  617. }
  618. /* 资源跟进状态区域 */
  619. .follow-status-section {
  620. background-color: #FFFFFF;
  621. margin: 20rpx;
  622. padding: 30rpx;
  623. border-radius: 20rpx;
  624. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
  625. display: flex;
  626. justify-content: space-around;
  627. align-items: center;
  628. }
  629. .follow-status-group {
  630. display: flex;
  631. flex-direction: column;
  632. align-items: center;
  633. gap: 12rpx;
  634. }
  635. .status-label {
  636. font-size: 26rpx;
  637. color: #666;
  638. font-weight: 500;
  639. }
  640. .status-tags {
  641. display: flex;
  642. gap: 10rpx;
  643. }
  644. .status-tag {
  645. padding: 8rpx 20rpx;
  646. border-radius: 20rpx;
  647. font-size: 24rpx;
  648. background-color: #FAF5FF;
  649. color: #9C27B0;
  650. border: 2rpx solid #E1BEE7;
  651. &.active {
  652. background-color: #F8BBD0;
  653. border-color: #F06292;
  654. color: #FFFFFF;
  655. }
  656. }
  657. /* 底部导航 */
  658. .tabbar {
  659. position: fixed;
  660. bottom: 0;
  661. left: 0;
  662. right: 0;
  663. height: 100rpx;
  664. background: #FFFFFF;
  665. border-top: 1rpx solid #F0F0F0;
  666. display: flex;
  667. justify-content: space-around;
  668. align-items: center;
  669. padding-bottom: env(safe-area-inset-bottom);
  670. .tabbar-item {
  671. display: flex;
  672. flex-direction: column;
  673. align-items: center;
  674. gap: 8rpx;
  675. padding: 10rpx 0;
  676. .tabbar-icon {
  677. width: 44rpx;
  678. height: 44rpx;
  679. background-size: contain;
  680. background-repeat: no-repeat;
  681. background-position: center;
  682. position: relative;
  683. .badge {
  684. position: absolute;
  685. top: -8rpx;
  686. right: -8rpx;
  687. width: 32rpx;
  688. height: 32rpx;
  689. display: flex;
  690. align-items: center;
  691. justify-content: center;
  692. background-color: #FF4444;
  693. color: #FFFFFF;
  694. font-size: 20rpx;
  695. font-weight: bold;
  696. border-radius: 50%;
  697. }
  698. }
  699. .tabbar-text {
  700. font-size: 20rpx;
  701. color: #999;
  702. }
  703. &.active {
  704. .tabbar-text {
  705. color: #9C27B0;
  706. font-weight: bold;
  707. }
  708. }
  709. &.home .tabbar-icon {
  710. 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="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>');
  711. }
  712. &.resources .tabbar-icon {
  713. 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>');
  714. }
  715. &.trophy .tabbar-icon {
  716. 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>');
  717. }
  718. &.message .tabbar-icon {
  719. 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>');
  720. }
  721. &.mine .tabbar-icon {
  722. 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>');
  723. }
  724. }
  725. }
  726. </style>