quality-resources.vue 22 KB

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