precise-match.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  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. <scroll-view scroll-y class="match-list">
  11. <view class="match-client" v-for="(client, index) in matchClients" :key="index">
  12. <view class="client-info">
  13. <image :src="client.avatar" class="client-avatar" mode="aspectFill"></image>
  14. <view class="info-content">
  15. <view class="client-name">
  16. <text class="name-text">{{ client.name }}</text>
  17. <text class="client-gender">{{ client.gender }}</text>
  18. <text class="client-status">{{ client.status }}</text>
  19. </view>
  20. <view class="client-tags">
  21. <text class="tag" v-for="(tag, tagIndex) in client.tags" :key="tagIndex">{{ tag }}</text>
  22. </view>
  23. <view class="requirement">
  24. <text class="requirement-label">择偶要求:</text>
  25. <text class="requirement-content">{{ client.requirement }}</text>
  26. </view>
  27. <view class="contact-info">
  28. <text class="contact-label">联系方式:</text>
  29. <text class="contact-number">{{ client.contact }}</text>
  30. <text class="copy-btn" @click="handleCopy(client.contact)">复制</text>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="action-btn" @click="handleChat(client)">牵线聊聊</view>
  35. </view>
  36. </scroll-view>
  37. <!-- 底部导航 -->
  38. <view class="tabbar">
  39. <view class="tabbar-item" @click="handleHome">
  40. <view class="tabbar-icon home"></view>
  41. <text class="tabbar-text">工作台</text>
  42. </view>
  43. <view class="tabbar-item active" @click="handleMyResources">
  44. <view class="tabbar-icon resources"></view>
  45. <text class="tabbar-text">我的资源</text>
  46. </view>
  47. <view class="tabbar-item" @click="handleRanking">
  48. <view class="tabbar-icon trophy"></view>
  49. <text class="tabbar-text">排行榜</text>
  50. </view>
  51. <view class="tabbar-item" @click="handleMessage">
  52. <view class="tabbar-icon message">
  53. <text class="badge">3</text>
  54. </view>
  55. <text class="tabbar-text">消息</text>
  56. </view>
  57. <view class="tabbar-item" @click="handleMine">
  58. <view class="tabbar-icon mine"></view>
  59. <text class="tabbar-text">我的</text>
  60. </view>
  61. </view>
  62. </view>
  63. </template>
  64. <script>
  65. export default {
  66. name: 'precise-match',
  67. data() {
  68. return {
  69. matchClients: [
  70. {
  71. id: 1,
  72. name: '小高',
  73. gender: '女',
  74. status: '未匹配',
  75. tags: ['气质男', '小清新'],
  76. avatar: 'https://images.unsplash.com/photo-1506744038136-46273834b3fb?ixlib=rb-1.2.1&auto=format&fit=crop&w=200&q=60',
  77. requirement: '165+ 本科',
  78. contact: '123****8912'
  79. },
  80. {
  81. id: 2,
  82. name: '小子',
  83. gender: '女',
  84. status: '未匹配',
  85. tags: ['周末有空'],
  86. avatar: 'https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&auto=format&fit=crop&w=200&q=60',
  87. requirement: '165+ 本科',
  88. contact: '123****8912'
  89. },
  90. {
  91. id: 3,
  92. name: '小博',
  93. gender: '女',
  94. status: '未匹配',
  95. tags: ['电话联系', '运动'],
  96. avatar: 'https://images.unsplash.com/photo-1516321318423-f06f85e504b3?ixlib=rb-1.2.1&auto=format&fit=crop&w=200&q=60',
  97. requirement: '180+ 本科',
  98. contact: '123****8912'
  99. }
  100. ]
  101. }
  102. },
  103. onLoad(options) {
  104. // 从URL参数获取客户ID
  105. if (options.id) {
  106. // 这里可以根据ID从API获取匹配客户信息
  107. console.log('当前客户ID:', options.id)
  108. // this.loadMatchClients(options.id)
  109. }
  110. },
  111. methods: {
  112. // 返回上一页
  113. handleBack() {
  114. uni.navigateBack()
  115. },
  116. // 复制联系方式
  117. handleCopy(contact) {
  118. uni.setClipboardData({
  119. data: contact.replace(/\*+/g, ''),
  120. success: () => {
  121. uni.showToast({
  122. title: '复制成功',
  123. icon: 'success'
  124. })
  125. }
  126. })
  127. },
  128. // 牵线聊聊
  129. handleChat(client) {
  130. // 跳转到聊天页面或打开聊天弹窗
  131. uni.showToast({
  132. title: '牵线成功',
  133. icon: 'success'
  134. })
  135. },
  136. // 从API加载匹配客户信息
  137. async loadMatchClients(id) {
  138. try {
  139. // 这里调用API获取匹配客户信息
  140. // const res = await api.matchmaker.getPreciseMatch(id)
  141. // this.matchClients = res.data
  142. } catch (e) {
  143. console.error('加载匹配客户失败:', e)
  144. uni.showToast({
  145. title: '加载失败',
  146. icon: 'none'
  147. })
  148. }
  149. },
  150. // 底部导航 - 工作台
  151. handleHome() {
  152. uni.navigateTo({
  153. url: '/pages/matchmaker-workbench/index'
  154. })
  155. },
  156. // 底部导航 - 我的资源
  157. handleMyResources() {
  158. uni.navigateTo({
  159. url: '/pages/matchmaker-workbench/my-resources'
  160. })
  161. },
  162. // 底部导航 - 排行榜
  163. handleRanking() {
  164. uni.navigateTo({
  165. url: '/pages/matchmaker-workbench/ranking'
  166. })
  167. },
  168. // 底部导航 - 消息
  169. handleMessage() {
  170. uni.navigateTo({
  171. url: '/pages/matchmaker-workbench/message'
  172. })
  173. },
  174. // 底部导航 - 我的
  175. handleMine() {
  176. uni.navigateTo({
  177. url: '/pages/matchmaker-workbench/mine'
  178. })
  179. }
  180. }
  181. }
  182. </script>
  183. <style lang="scss" scoped>
  184. .precise-match {
  185. min-height: 100vh;
  186. background-color: #FFF9F9;
  187. padding-top: 90rpx;
  188. }
  189. /* 顶部导航栏 */
  190. .header {
  191. position: fixed;
  192. top: 0;
  193. left: 0;
  194. right: 0;
  195. height: 90rpx;
  196. display: flex;
  197. align-items: center;
  198. justify-content: space-between;
  199. padding: 0 20rpx;
  200. background: linear-gradient(135deg, #FCE4EC 0%, #F8BBD0 100%);
  201. z-index: 999;
  202. .back-icon {
  203. width: 44rpx;
  204. height: 44rpx;
  205. 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>');
  206. background-size: contain;
  207. background-repeat: no-repeat;
  208. background-position: center;
  209. }
  210. .header-title {
  211. font-size: 38rpx;
  212. font-weight: bold;
  213. color: #333;
  214. }
  215. .header-right {
  216. width: 44rpx;
  217. }
  218. }
  219. /* 匹配客户列表 */
  220. .match-list {
  221. padding: 20rpx;
  222. padding-bottom: 120rpx;
  223. .match-client {
  224. background-color: #FFFFFF;
  225. border-radius: 20rpx;
  226. margin-bottom: 20rpx;
  227. padding: 25rpx;
  228. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
  229. .client-info {
  230. display: flex;
  231. align-items: flex-start;
  232. margin-bottom: 20rpx;
  233. .client-avatar {
  234. width: 120rpx;
  235. height: 120rpx;
  236. border-radius: 50%;
  237. margin-right: 20rpx;
  238. background-color: #F5F5F5;
  239. }
  240. .info-content {
  241. flex: 1;
  242. .client-name {
  243. display: flex;
  244. align-items: center;
  245. gap: 15rpx;
  246. margin-bottom: 10rpx;
  247. .name-text {
  248. font-size: 32rpx;
  249. font-weight: bold;
  250. color: #333;
  251. }
  252. .client-gender {
  253. font-size: 26rpx;
  254. color: #666;
  255. }
  256. .client-status {
  257. font-size: 24rpx;
  258. color: #FF6B8A;
  259. background-color: #FFF3F5;
  260. padding: 4rpx 12rpx;
  261. border-radius: 15rpx;
  262. }
  263. }
  264. .client-tags {
  265. display: flex;
  266. flex-wrap: wrap;
  267. gap: 10rpx;
  268. margin-bottom: 15rpx;
  269. .tag {
  270. padding: 6rpx 16rpx;
  271. background-color: #F3E5F5;
  272. color: #9C27B0;
  273. border-radius: 15rpx;
  274. font-size: 22rpx;
  275. }
  276. }
  277. .requirement {
  278. display: flex;
  279. margin-bottom: 15rpx;
  280. .requirement-label {
  281. font-size: 26rpx;
  282. color: #666;
  283. margin-right: 10rpx;
  284. }
  285. .requirement-content {
  286. font-size: 26rpx;
  287. color: #333;
  288. }
  289. }
  290. .contact-info {
  291. display: flex;
  292. align-items: center;
  293. .contact-label {
  294. font-size: 26rpx;
  295. color: #666;
  296. margin-right: 10rpx;
  297. }
  298. .contact-number {
  299. font-size: 26rpx;
  300. color: #333;
  301. margin-right: 15rpx;
  302. }
  303. .copy-btn {
  304. font-size: 24rpx;
  305. color: #9C27B0;
  306. padding: 6rpx 16rpx;
  307. background-color: #F3E5F5;
  308. border-radius: 15rpx;
  309. }
  310. }
  311. }
  312. }
  313. .action-btn {
  314. width: 200rpx;
  315. height: 60rpx;
  316. display: flex;
  317. align-items: center;
  318. justify-content: center;
  319. background-color: #9C27B0;
  320. color: #FFFFFF;
  321. border-radius: 30rpx;
  322. font-size: 28rpx;
  323. font-weight: bold;
  324. margin-left: auto;
  325. }
  326. }
  327. }
  328. /* 底部导航 */
  329. .tabbar {
  330. position: fixed;
  331. bottom: 0;
  332. left: 0;
  333. right: 0;
  334. height: 100rpx;
  335. background: #FFFFFF;
  336. border-top: 1rpx solid #F0F0F0;
  337. display: flex;
  338. justify-content: space-around;
  339. align-items: center;
  340. padding-bottom: env(safe-area-inset-bottom);
  341. .tabbar-item {
  342. display: flex;
  343. flex-direction: column;
  344. align-items: center;
  345. gap: 8rpx;
  346. padding: 10rpx 0;
  347. .tabbar-icon {
  348. width: 44rpx;
  349. height: 44rpx;
  350. background-size: contain;
  351. background-repeat: no-repeat;
  352. background-position: center;
  353. position: relative;
  354. .badge {
  355. position: absolute;
  356. top: -8rpx;
  357. right: -8rpx;
  358. width: 32rpx;
  359. height: 32rpx;
  360. display: flex;
  361. align-items: center;
  362. justify-content: center;
  363. background-color: #FF4444;
  364. color: #FFFFFF;
  365. font-size: 20rpx;
  366. font-weight: bold;
  367. border-radius: 50%;
  368. }
  369. }
  370. .tabbar-text {
  371. font-size: 20rpx;
  372. color: #999;
  373. }
  374. &.active {
  375. .tabbar-text {
  376. color: #9C27B0;
  377. font-weight: bold;
  378. }
  379. }
  380. &.home .tabbar-icon {
  381. 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>');
  382. }
  383. &.resources .tabbar-icon {
  384. 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>');
  385. }
  386. &.trophy .tabbar-icon {
  387. 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>');
  388. }
  389. &.message .tabbar-icon {
  390. 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>');
  391. }
  392. &.mine .tabbar-icon {
  393. 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>');
  394. }
  395. }
  396. }
  397. </style>