quality-resources.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920
  1. <template>
  2. <view class="quality-resources">
  3. <!-- 顶部导航栏 -->
  4. <view class="header">
  5. <view class="back-icon" @click="handleBack"></view>
  6. <text class="header-title">优质资源</text>
  7. <view class="filter-icon" @click="handleFilter"></view>
  8. </view>
  9. <!-- 搜索栏 -->
  10. <view class="search-bar">
  11. <view class="search-input-wrapper">
  12. <view class="search-icon-small"></view>
  13. <input type="text" class="search-input" placeholder="请输入搜索关键词" placeholder-style="color: #999;" v-model="searchKeyword" @input="handleSearch" />
  14. </view>
  15. </view>
  16. <!-- 资源列表 -->
  17. <scroll-view scroll-y class="content" @scrolltolower="loadMore" :scroll-with-animation="true">
  18. <view v-if="loading" class="loading-wrapper">
  19. <text class="loading-text">加载中...</text>
  20. </view>
  21. <view v-else-if="resources.length === 0" class="empty-wrapper">
  22. <text class="empty-text">暂无优质资源</text>
  23. </view>
  24. <view class="resource-item" v-for="(resource, index) in resources" :key="getResourceKey(resource, index)" @click="handleResourceClick(index)">
  25. <view class="resource-header">
  26. <image
  27. :src="getAvatarUrl(resource) || '/static/default-avatar.svg'"
  28. mode="aspectFill"
  29. class="avatar"
  30. @error="handleImageError(index)"
  31. ></image>
  32. <view class="resource-info">
  33. <view class="name-gender">
  34. <text class="name">{{ resource.name }}</text>
  35. <text class="gender">{{ resource.gender === 1 ? '男' : '女' }}</text>
  36. </view>
  37. <view class="status-tag-wrapper">
  38. <text class="status-tag register-tag registered">已注册</text>
  39. <text class="status-tag match-tag" :class="{ 'matched': getIsMatch(resource) === 1, 'unmatched': getIsMatch(resource) === 0 || !getIsMatch(resource) }">
  40. {{ getIsMatch(resource) === 1 ? '已匹配' : '未匹配' }}
  41. </text>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="resource-details">
  46. <view class="labels" v-if="resource.tags && resource.tags.length > 0">
  47. <text class="label" v-for="(tag, tagIndex) in resource.tags" :key="tagIndex">{{ tag }}</text>
  48. </view>
  49. <view class="requirement-box">
  50. <text class="requirement-label">择偶要求:</text>
  51. <text class="requirement-content">{{ getMateSelectionCriteria(resource) || '暂无' }}</text>
  52. </view>
  53. <view class="contact-box">
  54. <text class="contact-label">联系方式:</text>
  55. <text class="contact-number">{{ getMaskedPhone(resource.phone) || '暂无' }}</text>
  56. <text class="copy-btn" @click.stop="handleCopy(resource.phone)">复制</text>
  57. </view>
  58. <view class="action-buttons">
  59. <view class="action-btn add-resource-btn" @click.stop="handleAddToMyResources(index)">添加到我的资源</view>
  60. <view class="action-btn chat-btn" @click.stop="handleChat(resource)">牵线聊聊</view>
  61. </view>
  62. </view>
  63. </view>
  64. <view v-if="hasMore && !loading" class="load-more-wrapper">
  65. <text class="load-more-text">上拉加载更多</text>
  66. </view>
  67. <view v-if="!hasMore && resources.length > 0" class="no-more-wrapper">
  68. <text class="no-more-text">没有更多数据了</text>
  69. </view>
  70. </scroll-view>
  71. </view>
  72. </template>
  73. <script>
  74. export default {
  75. name: 'quality-resources',
  76. data() {
  77. return {
  78. resources: [],
  79. searchKeyword: '',
  80. pageNum: 1,
  81. pageSize: 10,
  82. loading: false,
  83. hasMore: true,
  84. currentUserId: null // 当前登录用户的用户ID
  85. }
  86. },
  87. onLoad() {
  88. // 获取当前登录用户的ID
  89. const userId = uni.getStorageSync('userId')
  90. if (userId) {
  91. const rawUserId = parseInt(userId)
  92. if (!isNaN(rawUserId) && rawUserId > 0) {
  93. this.currentUserId = rawUserId
  94. }
  95. }
  96. this.loadResources()
  97. },
  98. methods: {
  99. // 返回上一页
  100. handleBack() {
  101. uni.navigateBack()
  102. },
  103. // 筛选
  104. handleFilter() {
  105. // 实现筛选功能
  106. },
  107. // 搜索
  108. handleSearch() {
  109. this.pageNum = 1
  110. this.resources = []
  111. this.hasMore = true
  112. this.loadResources()
  113. },
  114. // 加载资源列表
  115. async loadResources() {
  116. if (this.loading) return
  117. try {
  118. this.loading = true
  119. const baseUrl = process.env.NODE_ENV === 'development'
  120. ? 'https://api.zhongruanke.cn/api' // 开发环境 - 通过网关
  121. : 'https://your-domain.com/api' // 生产环境
  122. // 构建请求参数
  123. const requestData = {
  124. tagName: '优质资源',
  125. keyword: this.searchKeyword || '',
  126. pageNum: this.pageNum,
  127. pageSize: this.pageSize
  128. }
  129. // 如果已登录,传递currentUserId,用于排除该红娘已拥有的资源
  130. if (this.currentUserId) {
  131. requestData.currentUserId = this.currentUserId
  132. }
  133. const [error, res] = await uni.request({
  134. url: `${baseUrl}/my-resource/list-by-tag`,
  135. method: 'GET',
  136. data: requestData,
  137. timeout: 10000
  138. })
  139. if (error) {
  140. uni.showToast({
  141. title: '加载失败',
  142. icon: 'none'
  143. })
  144. return
  145. }
  146. if (res.statusCode === 200 && res.data && res.data.code === 200) {
  147. const pageData = res.data.data
  148. if (pageData && pageData.records) {
  149. // 调试:打印第一条数据的详细信息
  150. if (pageData.records.length > 0) {
  151. const firstRecord = pageData.records[0]
  152. }
  153. if (this.pageNum === 1) {
  154. this.resources = pageData.records
  155. } else {
  156. this.resources = this.resources.concat(pageData.records)
  157. }
  158. // 判断是否还有更多数据
  159. this.hasMore = pageData.records && pageData.records.length >= this.pageSize
  160. }
  161. } else {
  162. uni.showToast({
  163. title: res.data.message || '加载失败',
  164. icon: 'none'
  165. })
  166. }
  167. } catch (e) {
  168. uni.showToast({
  169. title: '加载异常',
  170. icon: 'none'
  171. })
  172. } finally {
  173. this.loading = false
  174. }
  175. },
  176. // 加载更多
  177. loadMore() {
  178. if (this.hasMore && !this.loading) {
  179. this.pageNum++
  180. this.loadResources()
  181. }
  182. },
  183. // 图片加载错误处理
  184. handleImageError(index) {
  185. if (this.resources[index]) {
  186. // 设置头像为空,让CSS默认背景显示
  187. // 支持下划线和驼峰两种格式
  188. this.resources[index].avatarUrl = ''
  189. this.resources[index].avatar_url = ''
  190. this.resources[index].avatar = ''
  191. }
  192. },
  193. // 复制联系方式
  194. handleCopy(contact) {
  195. if (!contact) {
  196. uni.showToast({
  197. title: '联系方式为空',
  198. icon: 'none'
  199. })
  200. return
  201. }
  202. uni.setClipboardData({
  203. data: contact,
  204. success: () => {
  205. uni.showToast({
  206. title: '复制成功',
  207. icon: 'success'
  208. })
  209. }
  210. })
  211. },
  212. // 牵线聊聊
  213. handleChat(resource) {
  214. // 验证 resource 对象是否存在
  215. if (!resource) {
  216. uni.showToast({
  217. title: '资源信息为空',
  218. icon: 'none'
  219. })
  220. return
  221. }
  222. // 检查用户是否已注册(只有已注册用户才能聊天)
  223. // 支持下划线和驼峰两种格式
  224. const isUser = resource.isUser !== undefined ? resource.isUser :
  225. (resource.is_user !== undefined ? resource.is_user : 0)
  226. if (isUser !== 1 && isUser !== '1') {
  227. uni.showToast({
  228. title: '该用户尚未注册,无法聊天',
  229. icon: 'none',
  230. duration: 3000
  231. })
  232. return
  233. }
  234. // 尝试多种方式获取用户ID
  235. let targetUserId = null
  236. // 方式1: 使用 userId 字段(驼峰格式)
  237. if (resource.userId !== null && resource.userId !== undefined && resource.userId !== '') {
  238. targetUserId = String(resource.userId)
  239. }
  240. // 方式2: 使用 user_id 字段(下划线格式)
  241. else if (resource.user_id !== null && resource.user_id !== undefined && resource.user_id !== '') {
  242. targetUserId = String(resource.user_id)
  243. }
  244. // 方式3: 使用 id 字段
  245. else if (resource.id !== null && resource.id !== undefined && resource.id !== '') {
  246. targetUserId = String(resource.id)
  247. }
  248. // 如果仍然没有获取到用户ID
  249. if (!targetUserId || targetUserId === 'null' || targetUserId === 'undefined' || targetUserId === '') {
  250. uni.showToast({
  251. title: '无法获取用户ID,请刷新重试',
  252. icon: 'none',
  253. duration: 3000
  254. })
  255. return
  256. }
  257. // 获取其他必要信息(支持下划线和驼峰格式)
  258. const targetUserName = resource.name || '用户'
  259. const targetUserAvatar = resource.avatarUrl || resource.avatar_url || resource.avatar || '/static/default-avatar.svg'
  260. // 跳转到聊天页面
  261. // 注意:fromMatchmaker=1 表示来自红娘工作台,会跳过消息限制和审核
  262. uni.navigateTo({
  263. url: `/pages/message/chat?targetUserId=${targetUserId}&targetUserName=${encodeURIComponent(targetUserName)}&targetUserAvatar=${encodeURIComponent(targetUserAvatar)}&fromMatchmaker=1`,
  264. success: () => {
  265. },
  266. fail: (err) => {
  267. uni.showToast({
  268. title: '跳转失败,请重试',
  269. icon: 'none'
  270. })
  271. }
  272. })
  273. },
  274. // 获取资源项的key(用于v-for)
  275. getResourceKey(resource, index) {
  276. if (!resource) return `resource-${index}`
  277. // 支持下划线和驼峰两种格式
  278. const resourceId = resource.resourceId || resource.resource_id
  279. if (resourceId !== null && resourceId !== undefined && resourceId !== '') {
  280. return `resource-${resourceId}`
  281. }
  282. return `resource-${index}`
  283. },
  284. // 点击资源项
  285. handleResourceClick(index) {
  286. // 检查index是否有效
  287. if (index === undefined || index === null || index < 0 || index >= this.resources.length) {
  288. uni.showToast({
  289. title: '资源索引无效',
  290. icon: 'none'
  291. })
  292. return
  293. }
  294. // 从数组中获取resource对象
  295. const resource = this.resources[index]
  296. if (!resource) {
  297. uni.showToast({
  298. title: '资源信息为空',
  299. icon: 'none'
  300. })
  301. return
  302. }
  303. // 支持下划线和驼峰两种格式
  304. const resourceId = resource.resourceId || resource.resource_id
  305. const isUser = resource.isUser !== undefined ? resource.isUser :
  306. (resource.is_user !== undefined ? resource.is_user : 0)
  307. // 检查resourceId是否有效
  308. if (!resourceId || resourceId === null || resourceId === undefined || resourceId === '') {
  309. uni.showToast({
  310. title: '资源ID无效,无法查看详情',
  311. icon: 'none'
  312. })
  313. return
  314. }
  315. // 判断是否为已注册用户
  316. if (isUser === 1 || isUser === '1') {
  317. uni.navigateTo({
  318. url: `/pages/matchmaker-workbench/client-detail?resourceId=${resourceId}&fromQualityResources=1`,
  319. success: () => {
  320. },
  321. fail: (err) => {
  322. uni.showToast({
  323. title: '跳转失败,请重试',
  324. icon: 'none'
  325. })
  326. }
  327. })
  328. } else {
  329. // 未注册,提示用户(虽然后端已经过滤了,但为了容错仍然保留)
  330. uni.showToast({
  331. title: '该用户还未注册用户端',
  332. icon: 'none',
  333. duration: 2000
  334. })
  335. }
  336. },
  337. // 添加到我的资源
  338. async handleAddToMyResources(index) {
  339. // 检查index是否有效
  340. if (index === undefined || index === null || index < 0 || index >= this.resources.length) {
  341. uni.showToast({
  342. title: '资源索引无效',
  343. icon: 'none'
  344. })
  345. return
  346. }
  347. // 从数组中获取resource对象
  348. const resource = this.resources[index]
  349. if (!resource) {
  350. uni.showToast({
  351. title: '资源信息为空',
  352. icon: 'none'
  353. })
  354. return
  355. }
  356. // 检查是否已登录
  357. if (!this.currentUserId) {
  358. uni.showToast({
  359. title: '请先登录',
  360. icon: 'none'
  361. })
  362. return
  363. }
  364. try {
  365. uni.showLoading({
  366. title: '添加中...'
  367. })
  368. const baseUrl = process.env.NODE_ENV === 'development'
  369. ? 'https://api.zhongruanke.cn/api' // 开发环境 - 通过网关
  370. : 'https://api.zhongruanke.cn/api' // 生产环境
  371. // 构建要添加的资源数据(复制原资源的所有信息,但使用当前红娘的matchmaker_id)
  372. const resourceData = {
  373. name: resource.name,
  374. age: resource.age,
  375. gender: resource.gender,
  376. constellation: resource.constellation,
  377. height: resource.height,
  378. weight: resource.weight,
  379. marrStatus: resource.marrStatus || resource.marr_status,
  380. diploma: resource.diploma,
  381. income: resource.income,
  382. address: resource.address,
  383. domicile: resource.domicile,
  384. occupation: resource.occupation,
  385. house: resource.house,
  386. phone: resource.phone,
  387. backupPhone: resource.backupPhone || resource.backup_phone,
  388. car: resource.car,
  389. mateSelectionCriteria: resource.mateSelectionCriteria || resource.mate_selection_criteria,
  390. isUser: resource.isUser || resource.is_user || 1,
  391. userId: resource.userId || resource.user_id
  392. }
  393. // 获取标签ID列表
  394. let tagIds = []
  395. // 方法1: 如果resource有resourceId,直接根据resourceId获取标签ID
  396. const resourceId = resource.resourceId || resource.resource_id
  397. if (resourceId) {
  398. try {
  399. const [tagError, tagRes] = await uni.request({
  400. url: `${baseUrl}/my-resource/tag-ids/${resourceId}`,
  401. method: 'GET'
  402. })
  403. if (!tagError && tagRes.statusCode === 200 && tagRes.data && tagRes.data.code === 200) {
  404. tagIds = tagRes.data.data || []
  405. }
  406. } catch (e) {
  407. }
  408. }
  409. // 方法2: 如果方法1失败或没有resourceId,根据标签名称查询标签ID
  410. if (tagIds.length === 0 && resource.tags && resource.tags.length > 0) {
  411. try {
  412. // 获取所有标签列表
  413. const [tagListError, tagListRes] = await uni.request({
  414. url: `${baseUrl}/tag/list`,
  415. method: 'GET'
  416. })
  417. if (!tagListError && tagListRes.statusCode === 200 && tagListRes.data && tagListRes.data.code === 200) {
  418. const allTags = tagListRes.data.data || []
  419. // 根据标签名称匹配标签ID
  420. for (const tagName of resource.tags) {
  421. const matchedTag = allTags.find(tag => {
  422. const tagNameField = tag.name || tag.tag_name || tag.tagName
  423. return tagNameField === tagName
  424. })
  425. if (matchedTag) {
  426. const tagId = matchedTag.id || matchedTag.tag_id
  427. if (tagId && !tagIds.includes(tagId)) {
  428. tagIds.push(tagId)
  429. }
  430. }
  431. }
  432. }
  433. } catch (e) {
  434. }
  435. }
  436. // 确保tagIds是整数数组
  437. tagIds = tagIds.map(id => parseInt(id)).filter(id => !isNaN(id) && id > 0)
  438. // 调用后端API添加资源
  439. const url = `${baseUrl}/my-resource/add?currentUserId=${this.currentUserId}`
  440. const [error, res] = await uni.request({
  441. url: url,
  442. method: 'POST',
  443. data: {
  444. ...resourceData,
  445. tagIds: tagIds
  446. },
  447. header: {
  448. 'Content-Type': 'application/json'
  449. }
  450. })
  451. uni.hideLoading()
  452. if (error) {
  453. uni.showToast({
  454. title: '添加失败,请重试',
  455. icon: 'none'
  456. })
  457. return
  458. }
  459. if (res.statusCode === 200 && res.data && res.data.code === 200) {
  460. uni.showToast({
  461. title: '添加成功',
  462. icon: 'success'
  463. })
  464. // 发送刷新事件,通知我的资源页面刷新列表
  465. uni.$emit('refreshResourceList')
  466. } else {
  467. uni.showToast({
  468. title: res.data.message || '添加失败',
  469. icon: 'none',
  470. duration: 2000
  471. })
  472. }
  473. } catch (e) {
  474. uni.hideLoading()
  475. uni.showToast({
  476. title: '添加异常,请稍后重试',
  477. icon: 'none'
  478. })
  479. }
  480. },
  481. // 获取头像URL(支持驼峰和下划线格式)
  482. getAvatarUrl(resource) {
  483. if (!resource) return ''
  484. // 优先使用 avatarUrl(驼峰),如果没有则使用 avatar_url(下划线),最后使用 avatar
  485. return resource.avatarUrl || resource.avatar_url || resource.avatar || ''
  486. },
  487. // 获取匹配状态(支持驼峰和下划线格式)
  488. getIsMatch(resource) {
  489. if (!resource) return 0
  490. // 支持 isMatch(驼峰)和 is_match(下划线)两种格式
  491. return resource.isMatch !== undefined ? resource.isMatch :
  492. (resource.is_match !== undefined ? resource.is_match : 0)
  493. },
  494. // 获取择偶要求(支持驼峰和下划线格式)
  495. getMateSelectionCriteria(resource) {
  496. if (!resource) {
  497. return ''
  498. }
  499. // 支持 mateSelectionCriteria(驼峰)和 mate_selection_criteria(下划线)两种格式
  500. let criteria = resource.mateSelectionCriteria || resource.mate_selection_criteria || ''
  501. // 如果为空,直接返回
  502. if (!criteria || criteria.trim() === '') {
  503. return ''
  504. }
  505. // 去除首尾空格
  506. criteria = criteria.trim()
  507. // 如果获取到的是电话号码格式(11位数字或脱敏后的格式),则返回空字符串,让模板显示"暂无"
  508. // 检查是否是纯数字(11位)或包含****的脱敏格式
  509. const phonePattern = /^(\d{3}\*{4}\d{4}|\d{11})$/
  510. if (phonePattern.test(criteria)) {
  511. return ''
  512. }
  513. // 如果择偶要求等于电话号码(未脱敏),也返回空
  514. if (criteria === resource.phone || criteria === (resource.phone || '').replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')) {
  515. return ''
  516. }
  517. return criteria
  518. },
  519. // 获取脱敏手机号
  520. getMaskedPhone(phone) {
  521. if (!phone) return ''
  522. // 手机号脱敏:显示前3位和后4位,中间用****代替
  523. return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')
  524. }
  525. }
  526. }
  527. </script>
  528. <style lang="scss" scoped>
  529. .quality-resources {
  530. min-height: 100vh;
  531. background: #FFF9F9;
  532. display: flex;
  533. flex-direction: column;
  534. }
  535. /* 顶部导航栏 */
  536. .header {
  537. display: flex;
  538. align-items: center;
  539. justify-content: space-between;
  540. padding: 25rpx 30rpx;
  541. padding-top: calc(25rpx + env(safe-area-inset-top));
  542. background: #FFF9F9;
  543. border-bottom: 1rpx solid #F0F0F0;
  544. .back-icon {
  545. width: 44rpx;
  546. height: 44rpx;
  547. 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 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>');
  548. background-size: contain;
  549. background-repeat: no-repeat;
  550. background-position: center;
  551. }
  552. .header-title {
  553. font-size: 38rpx;
  554. font-weight: bold;
  555. color: #9C27B0;
  556. }
  557. .filter-icon {
  558. width: 44rpx;
  559. height: 44rpx;
  560. 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 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"/></svg>');
  561. background-size: contain;
  562. background-repeat: no-repeat;
  563. background-position: center;
  564. }
  565. }
  566. /* 搜索栏 */
  567. .search-bar {
  568. padding: 20rpx 30rpx;
  569. background: #FFF9F9;
  570. .search-input-wrapper {
  571. display: flex;
  572. align-items: center;
  573. background: #FFFFFF;
  574. border-radius: 25rpx;
  575. padding: 15rpx 20rpx;
  576. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  577. .search-icon-small {
  578. width: 32rpx;
  579. height: 32rpx;
  580. 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>');
  581. background-size: contain;
  582. background-repeat: no-repeat;
  583. background-position: center;
  584. margin-right: 15rpx;
  585. }
  586. .search-input {
  587. flex: 1;
  588. font-size: 28rpx;
  589. color: #333;
  590. placeholder-color: #999;
  591. }
  592. }
  593. }
  594. /* 内容区域 */
  595. .content {
  596. flex: 1;
  597. padding: 0 30rpx 20rpx;
  598. }
  599. /* 资源列表项 */
  600. .resource-item {
  601. background: #FFFFFF;
  602. border-radius: 20rpx;
  603. padding: 25rpx;
  604. margin-bottom: 20rpx;
  605. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  606. }
  607. .resource-header {
  608. display: flex;
  609. align-items: flex-start;
  610. margin-bottom: 20rpx;
  611. .avatar {
  612. width: 100rpx;
  613. height: 100rpx;
  614. border-radius: 50%;
  615. background: #F0F0F0;
  616. margin-right: 20rpx;
  617. flex-shrink: 0;
  618. }
  619. .resource-info {
  620. flex: 1;
  621. .name-gender {
  622. display: flex;
  623. align-items: center;
  624. gap: 15rpx;
  625. margin-bottom: 10rpx;
  626. .name {
  627. font-size: 32rpx;
  628. font-weight: bold;
  629. color: #333;
  630. }
  631. .gender {
  632. font-size: 24rpx;
  633. color: #999;
  634. padding: 4rpx 12rpx;
  635. background: #F5F5F5;
  636. border-radius: 12rpx;
  637. }
  638. }
  639. .status-tag-wrapper {
  640. display: flex;
  641. align-items: center;
  642. gap: 10rpx;
  643. margin-bottom: 10rpx;
  644. .status-tag {
  645. font-size: 22rpx;
  646. padding: 6rpx 14rpx;
  647. border-radius: 12rpx;
  648. font-weight: 500;
  649. &.register-tag {
  650. &.registered {
  651. color: #4CAF50;
  652. background: #E8F5E9;
  653. border: 1rpx solid #C8E6C9;
  654. }
  655. }
  656. &.match-tag {
  657. &.matched {
  658. color: #2196F3;
  659. background: #E3F2FD;
  660. border: 1rpx solid #BBDEFB;
  661. }
  662. &.unmatched {
  663. color: #FF9800;
  664. background: #FFF3E0;
  665. border: 1rpx solid #FFE0B2;
  666. }
  667. }
  668. }
  669. }
  670. }
  671. }
  672. .resource-details {
  673. .labels {
  674. display: flex;
  675. flex-wrap: wrap;
  676. gap: 10rpx;
  677. margin-bottom: 15rpx;
  678. .label {
  679. display: inline-block;
  680. padding: 6rpx 14rpx;
  681. background: #F3E5F5;
  682. color: #9C27B0;
  683. border-radius: 15rpx;
  684. font-size: 22rpx;
  685. font-weight: 500;
  686. }
  687. }
  688. .requirement-box {
  689. background: #F3E5F5;
  690. border-radius: 12rpx;
  691. padding: 16rpx 20rpx;
  692. margin-bottom: 15rpx;
  693. display: flex;
  694. align-items: center;
  695. flex-wrap: wrap;
  696. .requirement-label {
  697. font-size: 28rpx;
  698. color: #7B1FA2;
  699. font-weight: 500;
  700. margin-right: 8rpx;
  701. white-space: nowrap;
  702. }
  703. .requirement-content {
  704. font-size: 28rpx;
  705. color: #7B1FA2;
  706. font-weight: 400;
  707. }
  708. }
  709. .contact-box {
  710. margin-bottom: 20rpx;
  711. display: flex;
  712. align-items: center;
  713. flex-wrap: wrap;
  714. .contact-label {
  715. font-size: 26rpx;
  716. color: #333;
  717. font-weight: 500;
  718. margin-right: 10rpx;
  719. white-space: nowrap;
  720. }
  721. .contact-number {
  722. flex: 1;
  723. font-size: 26rpx;
  724. color: #333;
  725. font-weight: 400;
  726. min-width: 0;
  727. }
  728. .copy-btn {
  729. font-size: 24rpx;
  730. color: #9C27B0;
  731. font-weight: 500;
  732. margin-left: 15rpx;
  733. white-space: nowrap;
  734. cursor: pointer;
  735. }
  736. }
  737. .action-buttons {
  738. display: flex;
  739. justify-content: flex-end;
  740. align-items: center;
  741. gap: 15rpx;
  742. .action-btn {
  743. padding: 14rpx 30rpx;
  744. border-radius: 25rpx;
  745. font-size: 26rpx;
  746. font-weight: 500;
  747. text-align: center;
  748. &.add-resource-btn {
  749. background: #FF9800;
  750. color: #FFFFFF;
  751. }
  752. &.chat-btn {
  753. background: linear-gradient(135deg, #9C27B0 0%, #BA68C8 100%);
  754. color: #FFFFFF;
  755. }
  756. }
  757. }
  758. }
  759. .loading-wrapper,
  760. .empty-wrapper,
  761. .load-more-wrapper,
  762. .no-more-wrapper {
  763. display: flex;
  764. justify-content: center;
  765. align-items: center;
  766. padding: 40rpx 0;
  767. .loading-text,
  768. .empty-text,
  769. .load-more-text,
  770. .no-more-text {
  771. font-size: 26rpx;
  772. color: #999;
  773. }
  774. }
  775. .empty-text {
  776. color: #666;
  777. }
  778. .no-more-text {
  779. color: #999;
  780. }
  781. </style>