my-resources.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110
  1. <template>
  2. <view class="my-resources" :class="{ 'dark-mode': isDarkTheme }">
  3. <!-- 顶部导航栏 -->
  4. <view class="header">
  5. <text class="header-title">我的资源</text>
  6. <view class="header-right">
  7. <text class="dropdown-arrow">▼</text>
  8. <text class="dropdown-icon">▼</text>
  9. </view>
  10. </view>
  11. <!-- 搜索栏 -->
  12. <view class="search-bar">
  13. <view class="search-input-wrapper">
  14. <text class="search-icon">🔍</text>
  15. <input type="text" class="search-input" placeholder="请输入人搜索关键词" v-model="searchKeyword" @input="handleSearch" />
  16. </view>
  17. </view>
  18. <scroll-view scroll-y class="content">
  19. <!-- 资源列表 -->
  20. <view class="resource-item" v-for="(item, index) in resources" :key="index" @click="handleViewUserDetail(item)">
  21. <!-- 优质资源标签 -->
  22. <view class="quality-tag" v-if="item.isQuality">
  23. <text class="quality-star">★</text>
  24. <text class="quality-text">优质资源</text>
  25. </view>
  26. <!-- 头部:头像 + 名字/性别 + 审核状态 -->
  27. <view class="resource-header">
  28. <image
  29. v-if="item.avatar"
  30. :src="item.avatar"
  31. mode="aspectFill"
  32. class="resource-avatar"
  33. @error="handleImageError(index)"
  34. @load="handleImageLoad(index)"
  35. :lazy-load="true"
  36. ></image>
  37. <view v-else class="resource-avatar-placeholder"></view>
  38. <view class="resource-info">
  39. <view class="name-gender-row">
  40. <text class="resource-name">{{ item.name }}</text>
  41. <text class="resource-gender">{{ item.gender }}</text>
  42. <text class="status-tag" :class="{ 'approved': item.status === '已审核', 'pending': item.status === '待审核' }">{{ item.status }}</text>
  43. </view>
  44. </view>
  45. <!-- 右侧点赞/加号 -->
  46. <view class="right-action" v-if="item.isPlus">
  47. <text class="heart-icon">💗</text>
  48. </view>
  49. </view>
  50. <!-- 标签 -->
  51. <view class="labels-section">
  52. <text class="label" v-for="(label, idx) in item.labels" :key="idx">{{ label }}</text>
  53. </view>
  54. <!-- 择偶要求 -->
  55. <view class="requirement-box">
  56. <text class="requirement-label">择偶要求:</text>
  57. <text class="requirement-content">{{ item.requirement }}</text>
  58. </view>
  59. <!-- 联系方式 -->
  60. <view class="contact-box">
  61. <text class="contact-label">联系方式:</text>
  62. <text class="contact-number">{{ item.contact }}</text>
  63. <text class="copy-btn" @click.stop="handleCopy(item.contact)">复制</text>
  64. </view>
  65. <!-- 底部按钮 -->
  66. <view class="action-buttons">
  67. <view class="delete-btn" @click.stop="handleDelete(item.id)">删除</view>
  68. <view class="match-btn" @click.stop="handleMatch(item.id)">精准匹配</view>
  69. </view>
  70. </view>
  71. </scroll-view>
  72. <!-- 底部优质资源按钮 -->
  73. <view class="quality-resources-section fixed-bottom">
  74. <view class="quality-resources-btn" @click="navigateToQualityResources">
  75. <text class="btn-icon">⭐</text>
  76. <text class="btn-text">优质资源</text>
  77. </view>
  78. </view>
  79. <!-- 底部添加按钮 -->
  80. <view class="add-button" @click="handleAdd">
  81. <text class="add-button-icon">+</text>
  82. </view>
  83. <!-- 底部导航 -->
  84. <view class="tabbar">
  85. <view class="tabbar-item home" @click="navigateToWorkbench">
  86. <view class="tabbar-icon"></view>
  87. <text class="tabbar-text">工作台</text>
  88. </view>
  89. <view class="tabbar-item resources active" @click="navigateToMyResources">
  90. <view class="tabbar-icon"></view>
  91. <text class="tabbar-text">我的资源</text>
  92. </view>
  93. <view class="tabbar-item trophy" @click="navigateToRanking">
  94. <view class="tabbar-icon"></view>
  95. <text class="tabbar-text">排行榜</text>
  96. </view>
  97. <view class="tabbar-item message" @click="navigateToMessage">
  98. <view class="tabbar-icon">
  99. <view class="badge" v-if="unreadCount > 0">{{ unreadCount }}</view>
  100. </view>
  101. <text class="tabbar-text">消息</text>
  102. </view>
  103. <view class="tabbar-item mine" @click="navigateToMine">
  104. <view class="tabbar-icon"></view>
  105. <text class="tabbar-text">我的</text>
  106. </view>
  107. </view>
  108. </view>
  109. </template>
  110. <script>
  111. import api from '@/utils/api.js'
  112. export default {
  113. data() {
  114. return {
  115. searchKeyword: '',
  116. unreadCount: 3,
  117. isDarkTheme: false,
  118. resources: [
  119. {
  120. id: 1,
  121. avatar: '',
  122. name: '小高',
  123. gender: '男',
  124. status: '已审核',
  125. isPlus: false,
  126. labels: ['气质男', '小清新'],
  127. requirement: '165+ 本科',
  128. contact: '123****8912',
  129. isQuality: false
  130. },
  131. {
  132. id: 2,
  133. avatar: '',
  134. name: '小美',
  135. gender: '女',
  136. status: '已审核',
  137. isPlus: true,
  138. labels: ['温柔', '知性', '爱读书'],
  139. requirement: '175+ 硕士 有房',
  140. contact: '138****6543',
  141. isQuality: false
  142. },
  143. {
  144. id: 3,
  145. avatar: '',
  146. name: '阿强',
  147. gender: '男',
  148. status: '待审核',
  149. isPlus: false,
  150. labels: ['阳光', '运动型'],
  151. requirement: '160+ 大专以上',
  152. contact: '159****2234',
  153. isQuality: true
  154. }
  155. ]
  156. }
  157. },
  158. onShow() {
  159. const stored = uni.getStorageSync('matchmakerDarkMode')
  160. if (stored === true || stored === false) {
  161. this.isDarkTheme = stored
  162. }
  163. },
  164. onLoad() {
  165. // 加载我的资源数据
  166. this.loadMyResources()
  167. },
  168. methods: {
  169. // 加载我的资源数据
  170. async loadMyResources() {
  171. try {
  172. // 获取当前登录用户ID
  173. const userInfo = uni.getStorageSync('userInfo') || {}
  174. const userId = uni.getStorageSync('userId')
  175. const currentUserId = userInfo.userId || userId || null
  176. if (!currentUserId) {
  177. console.error('无法获取当前登录用户ID')
  178. uni.showToast({
  179. title: '请先登录',
  180. icon: 'none'
  181. })
  182. return
  183. }
  184. // 调用后端接口,传递当前用户ID作为matchmakerId
  185. const baseUrl = process.env.NODE_ENV === 'development'
  186. ? 'http://localhost:8083/api' // 开发环境 - 通过网关
  187. : 'https://your-domain.com/api' // 生产环境
  188. // 构建查询参数
  189. let url = `${baseUrl}/my-resource/list?currentUserId=${currentUserId}&pageNum=1&pageSize=100`
  190. if (this.searchKeyword && this.searchKeyword.trim()) {
  191. url += `&keyword=${encodeURIComponent(this.searchKeyword.trim())}`
  192. }
  193. const [error, res] = await uni.request({
  194. url: url,
  195. method: 'GET'
  196. })
  197. if (error) {
  198. console.error('加载资源数据失败:', error)
  199. return
  200. }
  201. if (res.statusCode === 200 && res.data && res.data.code === 200) {
  202. // 处理返回的数据
  203. const pageData = res.data.data
  204. console.log('=== 后端返回的完整数据 ===')
  205. console.log('pageData:', JSON.stringify(pageData, null, 2))
  206. if (pageData && pageData.records) {
  207. console.log('records数量:', pageData.records.length)
  208. if (pageData.records.length > 0) {
  209. console.log('第一条记录的完整数据:', JSON.stringify(pageData.records[0], null, 2))
  210. }
  211. // 将后端数据转换为前端需要的格式
  212. this.resources = pageData.records.map(item => {
  213. // 构建择偶要求字符串
  214. let requirement = ''
  215. if (item.height) {
  216. requirement += item.height + '+'
  217. }
  218. if (item.diploma) {
  219. requirement += item.diploma
  220. }
  221. if (item.house === 1) {
  222. requirement += ' 有房'
  223. }
  224. // 处理标签(可以根据实际需求扩展)
  225. const labels = []
  226. if (item.constellation) {
  227. labels.push(item.constellation)
  228. }
  229. if (item.occupation) {
  230. labels.push(item.occupation)
  231. }
  232. // 处理头像URL:确保使用完整的URL
  233. // 尝试多种可能的字段名
  234. let avatarUrl = item.avatarUrl || item.avatar_url || item.avatar || ''
  235. console.log('=== 头像URL处理 ===')
  236. console.log('资源ID:', item.resourceId, '姓名:', item.name)
  237. console.log('原始数据字段:', {
  238. avatarUrl: item.avatarUrl,
  239. avatar_url: item.avatar_url,
  240. avatar: item.avatar,
  241. 'item完整对象': item
  242. })
  243. console.log('提取的avatarUrl值:', avatarUrl, '类型:', typeof avatarUrl, '是否为空:', !avatarUrl)
  244. // 如果头像URL为空或null,设置为空字符串(让CSS背景图显示)
  245. if (!avatarUrl || avatarUrl.trim() === '' || avatarUrl === 'null' || avatarUrl === null || avatarUrl === undefined) {
  246. avatarUrl = '' // 设置为空,让CSS默认背景显示
  247. console.log('⚠️ 头像URL为空,设置为空字符串,将显示CSS默认背景')
  248. } else {
  249. // 确保URL是完整的(如果已经是完整URL则直接使用)
  250. avatarUrl = avatarUrl.trim()
  251. // 如果URL不是以http开头,可能需要拼接基础URL(根据实际情况调整)
  252. if (!avatarUrl.startsWith('http://') && !avatarUrl.startsWith('https://')) {
  253. console.warn('⚠️ 头像URL不是完整URL,可能需要拼接:', avatarUrl)
  254. // 如果是相对路径,可以尝试拼接MinIO基础URL
  255. // avatarUrl = 'http://115.190.125.125:9000/' + avatarUrl
  256. }
  257. // 确保MinIO URL可以正常访问(可能需要处理跨域)
  258. // 如果MinIO配置了公共访问,直接使用URL即可
  259. console.log('✅ 使用用户头像URL:', avatarUrl)
  260. // 验证URL格式
  261. if (avatarUrl.includes('115.190.125.125:9000')) {
  262. console.log('✅ 检测到MinIO URL,URL格式:', avatarUrl)
  263. }
  264. }
  265. console.log('最终设置的avatarUrl:', avatarUrl)
  266. console.log('=== 头像URL处理结束 ===')
  267. return {
  268. id: item.resourceId,
  269. avatar: avatarUrl, // 使用处理后的头像URL
  270. name: item.name || '',
  271. gender: item.gender === 1 ? '男' : item.gender === 2 ? '女' : '未知',
  272. status: '已审核', // 可以根据实际字段判断
  273. isPlus: false,
  274. labels: labels,
  275. requirement: requirement || '暂无要求',
  276. contact: item.phone ? item.phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2') : '',
  277. isQuality: false
  278. }
  279. })
  280. console.log('处理后的资源列表:', this.resources)
  281. }
  282. }
  283. } catch (e) {
  284. console.error('加载资源数据失败:', e)
  285. }
  286. },
  287. // 搜索
  288. async handleSearch() {
  289. // 重新加载资源数据,包含搜索关键词
  290. await this.loadMyResources()
  291. },
  292. // 复制联系方式
  293. handleCopy(contact) {
  294. uni.setClipboardData({
  295. data: contact.replace(/\*+/g, ''),
  296. success: () => {
  297. uni.showToast({
  298. title: '复制成功',
  299. icon: 'success'
  300. })
  301. }
  302. })
  303. },
  304. // 删除资源
  305. handleDelete(id) {
  306. uni.showModal({
  307. title: '删除确认',
  308. content: '确定要删除该资源吗?',
  309. success: (res) => {
  310. if (res.confirm) {
  311. // 实现删除功能
  312. console.log('删除资源:', id)
  313. uni.showToast({
  314. title: '删除成功',
  315. icon: 'success'
  316. })
  317. }
  318. }
  319. })
  320. },
  321. // 精准匹配
  322. handleMatch(id) {
  323. // 实现精准匹配功能
  324. console.log('精准匹配:', id)
  325. uni.navigateTo({
  326. url: `/pages/matchmaker-workbench/precise-match?id=${id}`
  327. })
  328. },
  329. // 添加资源
  330. handleAdd() {
  331. // 跳转到信息录入页面
  332. uni.navigateTo({
  333. url: '/pages/matchmaker-workbench/resource-input',
  334. success: () => {
  335. console.log('跳转到信息录入页面成功')
  336. },
  337. fail: (err) => {
  338. console.error('跳转失败:', err)
  339. uni.showToast({
  340. title: '页面跳转失败',
  341. icon: 'none'
  342. })
  343. }
  344. })
  345. },
  346. // 导航到工作台
  347. navigateToWorkbench() {
  348. uni.navigateTo({
  349. url: '/pages/matchmaker-workbench/index'
  350. })
  351. },
  352. // 导航到我的资源
  353. navigateToMyResources() {
  354. // 已在我的资源页面,无需跳转
  355. },
  356. // 导航到排行榜
  357. navigateToRanking() {
  358. uni.navigateTo({
  359. url: '/pages/matchmaker-workbench/ranking'
  360. })
  361. },
  362. // 导航到消息
  363. navigateToMessage() {
  364. uni.navigateTo({
  365. url: '/pages/matchmaker-workbench/message'
  366. })
  367. },
  368. // 导航到我的
  369. navigateToMine() {
  370. uni.navigateTo({
  371. url: '/pages/matchmaker-workbench/mine'
  372. })
  373. },
  374. // 导航到优质资源
  375. navigateToQualityResources() {
  376. uni.navigateTo({
  377. url: '/pages/matchmaker-workbench/quality-resources'
  378. })
  379. },
  380. // 查看用户详情
  381. handleViewUserDetail(item) {
  382. // 跳转到客户详情页面,传递用户ID
  383. uni.navigateTo({
  384. url: `/pages/matchmaker-workbench/client-detail?id=${item.id}`
  385. })
  386. },
  387. // 图片加载错误处理
  388. handleImageError(index) {
  389. try {
  390. const resource = this.resources && this.resources[index]
  391. if (!resource) {
  392. console.warn('图片加载失败:资源不存在,index:', index)
  393. return
  394. }
  395. const originalUrl = resource.avatar
  396. console.error('❌ 图片加载失败:', {
  397. index: index,
  398. resourceName: resource.name,
  399. resourceId: resource.id,
  400. originalAvatarUrl: originalUrl,
  401. 'URL类型': typeof originalUrl,
  402. 'URL长度': originalUrl ? originalUrl.length : 0,
  403. '是否包含placeholder': originalUrl && originalUrl.includes('placeholder'),
  404. '完整resource对象': resource
  405. })
  406. // 如果图片加载失败,且不是已经设置的默认占位图,则设置为空(显示CSS背景)
  407. // 避免重复设置导致循环
  408. if (originalUrl &&
  409. originalUrl.trim() !== '' &&
  410. !originalUrl.includes('placeholder') &&
  411. !originalUrl.includes('default') &&
  412. !originalUrl.includes('via.placeholder')) {
  413. // 设置为空字符串,让CSS默认背景显示
  414. console.log('图片加载失败,将URL设置为空,显示CSS默认背景')
  415. this.$set(this.resources[index], 'avatar', '')
  416. } else {
  417. console.log('图片加载失败,但URL已经是占位图或空,无需处理')
  418. console.log('当前URL:', originalUrl)
  419. }
  420. } catch (e) {
  421. console.error('处理图片错误时发生异常:', e)
  422. }
  423. },
  424. // 图片加载成功处理
  425. handleImageLoad(index) {
  426. try {
  427. if (this.resources && this.resources[index]) {
  428. console.log('图片加载成功:', {
  429. index: index,
  430. resource: this.resources[index]?.name,
  431. avatarUrl: this.resources[index]?.avatar
  432. })
  433. }
  434. } catch (e) {
  435. console.error('处理图片加载成功时发生异常:', e)
  436. }
  437. }
  438. }
  439. }
  440. </script>
  441. <style lang="scss" scoped>
  442. .my-resources {
  443. min-height: 100vh;
  444. background: #FFF9F9;
  445. display: flex;
  446. flex-direction: column;
  447. }
  448. .my-resources {
  449. min-height: 100vh;
  450. background: #F5F5F5;
  451. display: flex;
  452. flex-direction: column;
  453. }
  454. /* 顶部导航栏 */
  455. .header {
  456. display: flex;
  457. align-items: center;
  458. justify-content: space-between;
  459. padding: 20rpx 30rpx;
  460. padding-top: calc(20rpx + env(safe-area-inset-top));
  461. background: #FFF9F9;
  462. /* 顶部导航栏 */
  463. .header {
  464. display: flex;
  465. align-items: center;
  466. justify-content: space-between;
  467. padding: 20rpx 30rpx;
  468. padding-top: calc(20rpx + env(safe-area-inset-top));
  469. background: #FFFFFF;
  470. border-bottom: 1rpx solid #F0F0F0;
  471. .header-title {
  472. font-size: 36rpx;
  473. font-weight: bold;
  474. color: #9C27B0;
  475. }
  476. .header-title {
  477. font-size: 36rpx;
  478. font-weight: bold;
  479. color: #9C27B0;
  480. }
  481. .header-right {
  482. .dropdown-arrow {
  483. font-size: 24rpx;
  484. color: #9C27B0;
  485. font-weight: normal;
  486. }
  487. }
  488. }
  489. .header-right {
  490. .dropdown-icon {
  491. font-size: 24rpx;
  492. color: #9C27B0;
  493. }
  494. }
  495. }
  496. /* 搜索栏 */
  497. .search-bar {
  498. padding: 20rpx;
  499. background: #F5F5F5;
  500. /* 搜索栏 */
  501. .search-bar {
  502. padding: 15rpx 20rpx;
  503. background: #FFF9F9;
  504. .search-input-wrapper {
  505. display: flex;
  506. align-items: center;
  507. background: #FFFFFF;
  508. border-radius: 30rpx;
  509. padding: 12rpx 20rpx;
  510. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.03);
  511. .search-input-wrapper {
  512. display: flex;
  513. align-items: center;
  514. background: #FFFFFF;
  515. border-radius: 25rpx;
  516. padding: 12rpx 20rpx;
  517. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
  518. .search-icon {
  519. font-size: 28rpx;
  520. margin-right: 12rpx;
  521. }
  522. .search-input {
  523. flex: 1;
  524. font-size: 26rpx;
  525. color: #333;
  526. border: none;
  527. outline: none;
  528. background: transparent;
  529. &::placeholder {
  530. color: #999;
  531. }
  532. }
  533. }
  534. }
  535. .content {
  536. flex: 1;
  537. overflow-y: auto;
  538. padding: 15rpx 20rpx 20rpx;
  539. }
  540. /* 优质资源按钮(紧贴加号按钮上方,稍微缩小) */
  541. .quality-resources-section {
  542. position: fixed;
  543. right: 30rpx; /* 与加号按钮右边对齐 */
  544. bottom: 240rpx; /* 在加号按钮正上方留一点间距 */
  545. z-index: 999;
  546. .quality-resources-btn {
  547. display: flex;
  548. align-items: center;
  549. justify-content: center;
  550. gap: 8rpx;
  551. padding: 14rpx 22rpx; /* 比之前的 20rpx 略小 */
  552. background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
  553. border-radius: 18rpx;
  554. border: 2rpx solid #FFB74D;
  555. .btn-icon {
  556. font-size: 28rpx; /* 略小 */
  557. }
  558. .btn-text {
  559. font-size: 24rpx; /* 略小 */
  560. font-weight: bold;
  561. color: #FF9800;
  562. }
  563. }
  564. }
  565. /* 资源卡片 */
  566. .resource-item {
  567. background: #FFFFFF;
  568. border-radius: 16rpx;
  569. margin-bottom: 15rpx;
  570. padding: 20rpx;
  571. position: relative;
  572. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
  573. /* 右上角选中图标 */
  574. .select-icon {
  575. position: absolute;
  576. top: 20rpx;
  577. right: 20rpx;
  578. width: 40rpx;
  579. height: 40rpx;
  580. background: #FF4444;
  581. color: #FFFFFF;
  582. border-radius: 50%;
  583. display: flex;
  584. align-items: center;
  585. justify-content: center;
  586. font-size: 24rpx;
  587. font-weight: bold;
  588. z-index: 10;
  589. }
  590. .resource-header {
  591. display: flex;
  592. align-items: flex-start;
  593. margin-bottom: 20rpx;
  594. padding-right: 50rpx;
  595. /* 优质资源标签 */
  596. .quality-tag {
  597. position: absolute;
  598. top: 15rpx;
  599. right: 15rpx;
  600. background: linear-gradient(135deg, #FFD700 0%, #FFA000 100%);
  601. color: #FFFFFF;
  602. font-size: 20rpx;
  603. font-weight: bold;
  604. padding: 6rpx 14rpx;
  605. border-radius: 12rpx;
  606. }
  607. /* 头部:头像 + 名字/性别 + 审核状态 */
  608. .resource-header {
  609. display: flex;
  610. align-items: center;
  611. margin-bottom: 15rpx;
  612. gap: 15rpx;
  613. .resource-avatar {
  614. width: 80rpx;
  615. height: 80rpx;
  616. border-radius: 50%;
  617. flex-shrink: 0;
  618. background: #E8E8E8;
  619. }
  620. .resource-avatar-placeholder {
  621. width: 80rpx;
  622. height: 80rpx;
  623. border-radius: 50%;
  624. flex-shrink: 0;
  625. background: linear-gradient(135deg, #E0E0E0, #BDBDBD);
  626. }
  627. .resource-avatar {
  628. width: 100rpx;
  629. height: 100rpx;
  630. border-radius: 8rpx;
  631. margin-right: 20rpx;
  632. flex-shrink: 0;
  633. background-color: #F5F5F5;
  634. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23CCCCCC"><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>');
  635. background-size: 60% 60%;
  636. background-position: center;
  637. background-repeat: no-repeat;
  638. }
  639. .resource-info {
  640. flex: 1;
  641. .resource-basic-info {
  642. flex: 1;
  643. min-width: 0;
  644. .name-gender {
  645. display: flex;
  646. align-items: center;
  647. gap: 10rpx;
  648. margin-bottom: 12rpx;
  649. .name-gender-row {
  650. display: flex;
  651. align-items: center;
  652. gap: 10rpx;
  653. .resource-name {
  654. font-size: 30rpx;
  655. font-weight: bold;
  656. color: #333;
  657. }
  658. .resource-name {
  659. font-size: 28rpx;
  660. font-weight: bold;
  661. color: #333;
  662. }
  663. .resource-gender {
  664. font-size: 24rpx;
  665. color: #666;
  666. }
  667. .status-tag {
  668. display: inline-block;
  669. padding: 4rpx 12rpx;
  670. border-radius: 12rpx;
  671. font-size: 20rpx;
  672. font-weight: bold;
  673. .status-tag-wrapper {
  674. display: flex;
  675. align-items: center;
  676. .status-tag {
  677. display: inline-block;
  678. padding: 4rpx 12rpx;
  679. border-radius: 12rpx;
  680. font-size: 22rpx;
  681. font-weight: 500;
  682. &.approved {
  683. background: #E8F5E8;
  684. color: #4CAF50;
  685. }
  686. &.approved {
  687. background: #E3F2FD;
  688. color: #2196F3;
  689. }
  690. &.pending {
  691. background: #FFF3E0;
  692. color: #FF9800;
  693. }
  694. }
  695. }
  696. }
  697. .right-action {
  698. .heart-icon {
  699. font-size: 28rpx;
  700. &.pending {
  701. background: #FFF3E0;
  702. color: #FF9800;
  703. }
  704. }
  705. }
  706. }
  707. }
  708. }
  709. /* 标签 */
  710. .labels-section {
  711. display: flex;
  712. flex-wrap: wrap;
  713. gap: 8rpx;
  714. margin-bottom: 12rpx;
  715. .label {
  716. display: inline-block;
  717. padding: 5rpx 14rpx;
  718. background: #F5F5F5;
  719. color: #666;
  720. border-radius: 12rpx;
  721. font-size: 22rpx;
  722. }
  723. }
  724. /* 择偶要求 */
  725. .requirement-section {
  726. margin-bottom: 12rpx;
  727. .requirement-text {
  728. font-size: 24rpx;
  729. color: #666;
  730. line-height: 1.4;
  731. }
  732. }
  733. .label {
  734. display: inline-block;
  735. padding: 6rpx 14rpx;
  736. background: #F3E5F5;
  737. color: #9C27B0;
  738. border-radius: 15rpx;
  739. font-size: 22rpx;
  740. font-weight: 500;
  741. }
  742. }
  743. .requirement-box {
  744. background: #F3E5F5;
  745. border-radius: 12rpx;
  746. padding: 16rpx 20rpx;
  747. margin-bottom: 15rpx;
  748. display: flex;
  749. align-items: center;
  750. flex-wrap: wrap;
  751. .requirement-label {
  752. font-size: 26rpx;
  753. color: #7B1FA2;
  754. font-weight: 500;
  755. margin-right: 10rpx;
  756. white-space: nowrap;
  757. }
  758. .requirement-content {
  759. font-size: 26rpx;
  760. color: #7B1FA2;
  761. font-weight: 500;
  762. }
  763. }
  764. /* 联系方式 */
  765. .contact-section {
  766. display: flex;
  767. align-items: center;
  768. margin-bottom: 15rpx;
  769. gap: 8rpx;
  770. .contact-box {
  771. background: #F3E5F5;
  772. border-radius: 12rpx;
  773. padding: 16rpx 20rpx;
  774. margin-bottom: 20rpx;
  775. display: flex;
  776. align-items: center;
  777. flex-wrap: wrap;
  778. .contact-label {
  779. font-size: 24rpx;
  780. color: #333;
  781. font-weight: bold;
  782. }
  783. .contact-label {
  784. font-size: 26rpx;
  785. color: #7B1FA2;
  786. font-weight: 500;
  787. margin-right: 10rpx;
  788. white-space: nowrap;
  789. }
  790. .contact-number {
  791. flex: 1;
  792. font-size: 24rpx;
  793. color: #9C27B0;
  794. }
  795. .contact-number {
  796. flex: 1;
  797. font-size: 26rpx;
  798. color: #7B1FA2;
  799. font-weight: 500;
  800. min-width: 0;
  801. }
  802. .copy-btn {
  803. font-size: 22rpx;
  804. color: #9C27B0;
  805. font-weight: bold;
  806. }
  807. }
  808. .copy-btn {
  809. font-size: 24rpx;
  810. color: #9C27B0;
  811. font-weight: 600;
  812. margin-left: 15rpx;
  813. white-space: nowrap;
  814. }
  815. }
  816. .action-buttons {
  817. display: flex;
  818. justify-content: space-between;
  819. align-items: center;
  820. gap: 15rpx;
  821. /* 底部按钮 */
  822. .action-buttons {
  823. display: flex;
  824. justify-content: space-between;
  825. gap: 12rpx;
  826. .delete-btn {
  827. flex: 1;
  828. padding: 14rpx 0;
  829. background: #FFEBEE;
  830. color: #E91E63;
  831. border-radius: 25rpx;
  832. font-size: 26rpx;
  833. font-weight: 500;
  834. text-align: center;
  835. }
  836. .delete-btn {
  837. flex: 1;
  838. padding: 10rpx 20rpx;
  839. background: #FFEBEE;
  840. color: #E91E63;
  841. border-radius: 20rpx;
  842. font-size: 24rpx;
  843. font-weight: bold;
  844. text-align: center;
  845. }
  846. .match-btn {
  847. flex: 1.5;
  848. padding: 14rpx 0;
  849. background: linear-gradient(135deg, #9C27B0 0%, #BA68C8 100%);
  850. color: #FFFFFF;
  851. border-radius: 25rpx;
  852. font-size: 26rpx;
  853. font-weight: 500;
  854. text-align: center;
  855. }
  856. }
  857. .match-btn {
  858. flex: 1;
  859. padding: 10rpx 20rpx;
  860. background: linear-gradient(135deg, #9C27B0 0%, #BA68C8 100%);
  861. color: #FFFFFF;
  862. border-radius: 20rpx;
  863. font-size: 24rpx;
  864. font-weight: bold;
  865. text-align: center;
  866. }
  867. /* 优质资源标签 */
  868. .quality-tag {
  869. position: absolute;
  870. top: 80rpx;
  871. right: 20rpx;
  872. background: linear-gradient(135deg, #9C27B0 0%, #BA68C8 100%);
  873. color: #FFFFFF;
  874. font-size: 22rpx;
  875. font-weight: bold;
  876. padding: 8rpx 16rpx;
  877. border-radius: 20rpx;
  878. display: flex;
  879. align-items: center;
  880. gap: 4rpx;
  881. box-shadow: 0 2rpx 8rpx rgba(156, 39, 176, 0.3);
  882. z-index: 5;
  883. .quality-star {
  884. font-size: 20rpx;
  885. }
  886. .quality-text {
  887. font-size: 22rpx;
  888. }
  889. }
  890. }
  891. }
  892. }
  893. /* 添加按钮 */
  894. .add-button {
  895. position: fixed;
  896. bottom: 130rpx;
  897. right: 30rpx;
  898. width: 90rpx;
  899. height: 90rpx;
  900. border-radius: 50%;
  901. background: linear-gradient(135deg, #9C27B0 0%, #BA68C8 100%);
  902. display: flex;
  903. align-items: center;
  904. justify-content: center;
  905. box-shadow: 0 4rpx 16rpx rgba(156, 39, 176, 0.3);
  906. z-index: 1000;
  907. .add-button-icon {
  908. font-size: 50rpx;
  909. color: #FFFFFF;
  910. line-height: 1;
  911. font-weight: bold;
  912. }
  913. }
  914. /* 底部导航 */
  915. .tabbar {
  916. position: fixed;
  917. bottom: 0;
  918. left: 0;
  919. right: 0;
  920. height: 100rpx;
  921. background: #FFFFFF;
  922. border-top: 1rpx solid #F0F0F0;
  923. display: flex;
  924. justify-content: space-around;
  925. align-items: center;
  926. padding-bottom: env(safe-area-inset-bottom);
  927. .tabbar-item {
  928. display: flex;
  929. flex-direction: column;
  930. align-items: center;
  931. gap: 8rpx;
  932. padding: 10rpx 0;
  933. .tabbar-icon {
  934. width: 44rpx;
  935. height: 44rpx;
  936. background-size: contain;
  937. background-repeat: no-repeat;
  938. background-position: center;
  939. position: relative;
  940. .badge {
  941. position: absolute;
  942. top: -8rpx;
  943. right: -8rpx;
  944. background: #FF4444;
  945. color: #FFFFFF;
  946. font-size: 20rpx;
  947. font-weight: bold;
  948. width: 32rpx;
  949. height: 32rpx;
  950. display: flex;
  951. align-items: center;
  952. justify-content: center;
  953. border-radius: 16rpx;
  954. }
  955. }
  956. .tabbar-text {
  957. font-size: 20rpx;
  958. color: #999;
  959. }
  960. &.active .tabbar-text {
  961. color: #9C27B0;
  962. font-weight: bold;
  963. }
  964. &.home .tabbar-icon {
  965. background-image: url('data:image/svg+xml,<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>');
  966. }
  967. &.home.active .tabbar-icon {
  968. background-image: url('data:image/svg+xml,<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>');
  969. }
  970. &.resources .tabbar-icon {
  971. background-image: url('data:image/svg+xml,<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>');
  972. }
  973. &.resources.active .tabbar-icon {
  974. background-image: url('data:image/svg+xml,<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>');
  975. }
  976. &.trophy .tabbar-icon {
  977. 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>');
  978. }
  979. &.trophy.active .tabbar-icon {
  980. 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>');
  981. }
  982. &.message .tabbar-icon {
  983. background-image: url('data:image/svg+xml,<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>');
  984. }
  985. &.message.active .tabbar-icon {
  986. background-image: url('data:image/svg+xml,<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>');
  987. }
  988. &.mine .tabbar-icon {
  989. background-image: url('data:image/svg+xml,<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>');
  990. }
  991. &.mine.active .tabbar-icon {
  992. background-image: url('data:image/svg+xml,<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>');
  993. }
  994. }
  995. }
  996. }
  997. }
  998. }
  999. </style>