index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862
  1. <template>
  2. <view class="match-container">
  3. <!-- 顶部导航栏 -->
  4. <view class="custom-navbar">
  5. <view class="navbar-back" @click="goBack">
  6. <text class="back-icon">←</text>
  7. <text class="back-text">返回</text>
  8. </view>
  9. <view class="navbar-title">智能匹配</view>
  10. <view class="navbar-placeholder"></view>
  11. </view>
  12. <!-- 顶部提示 -->
  13. <view class="tip-box">
  14. <text class="tip-icon">⚡</text>
  15. <text class="tip-text">智能匹配系统正在为您寻找最合适的TA</text>
  16. </view>
  17. <!-- 匹配动画区域 -->
  18. <view class="match-animation">
  19. <view class="heart-container" v-if="isMatching">
  20. <text class="heart">❤️</text>
  21. <text class="heart">❤️</text>
  22. </view>
  23. <text class="match-status">{{ matchStatus }}</text>
  24. </view>
  25. <!-- 匹配方式选择 -->
  26. <view class="match-modes">
  27. <view
  28. class="mode-item"
  29. :class="{ 'mode-item-active': selectedMode === 'smart' }"
  30. @tap="selectMode('smart')"
  31. >
  32. <view class="mode-icon">🎯</view>
  33. <view class="mode-title">智能算法</view>
  34. <view class="mode-desc">基于兴趣爱好、性格特征智能匹配</view>
  35. <view v-if="selectedMode === 'smart'" class="mode-selected">✓ 已选择</view>
  36. </view>
  37. <view
  38. class="mode-item"
  39. :class="{ 'mode-item-active': selectedMode === 'precise' }"
  40. @tap="selectMode('precise')"
  41. >
  42. <view class="mode-icon">💎</view>
  43. <view class="mode-title">精准推荐</view>
  44. <view class="mode-desc">根据您的偏好推荐最合适的对象</view>
  45. <view v-if="selectedMode === 'precise'" class="mode-selected">✓ 已选择</view>
  46. </view>
  47. </view>
  48. <!-- 开始匹配按钮 -->
  49. <view class="match-button-container" v-if="!isMatching">
  50. <button class="start-match-btn" @click="startMatch">
  51. <text class="btn-text">开始匹配</text>
  52. </button>
  53. </view>
  54. <!-- 取消匹配按钮 -->
  55. <view class="match-button-container" v-else>
  56. <button class="cancel-match-btn" @click="cancelMatch">
  57. <text class="btn-text">取消匹配</text>
  58. </button>
  59. </view>
  60. <!-- 匹配成功弹窗 -->
  61. <uni-popup ref="matchSuccessPopup" type="center">
  62. <view class="success-popup">
  63. <view class="success-icon">🎉</view>
  64. <view class="success-title">匹配成功!</view>
  65. <view class="success-score">匹配度:{{ matchScore }}%</view>
  66. <view class="matched-user-info">
  67. <image class="user-avatar" :src="matchedUser.avatarUrl || 'http://115.190.125.125:9001/static-images/default-avatar.svg'" mode="aspectFill"></image>
  68. <view class="user-name">{{ matchedUser.nickname }}</view>
  69. <view class="user-detail">{{ matchedUser.age }}岁 | {{ matchedUser.city }}</view>
  70. <view class="user-interests">
  71. <text class="interest-tag" v-for="(interest, index) in matchedUser.interests" :key="index">
  72. {{ interest }}
  73. </text>
  74. </view>
  75. </view>
  76. <view class="popup-buttons">
  77. <button class="btn-like" @click="likeMatchedUser">喜欢</button>
  78. <button class="btn-continue" @click="continueMatch">继续匹配</button>
  79. </view>
  80. </view>
  81. </uni-popup>
  82. </view>
  83. </template>
  84. <script>
  85. import MATCH_API_CONFIG from '@/config/match-config.js'
  86. export default {
  87. data() {
  88. return {
  89. isMatching: false,
  90. matchStatus: '点击下方按钮开始匹配',
  91. selectedMode: 'smart',
  92. matchScore: 0,
  93. matchedUser: {},
  94. userInfo: {},
  95. pollingTimer: null,
  96. isLiked: false
  97. }
  98. },
  99. onLoad() {
  100. this.loadUserInfo();
  101. },
  102. onUnload() {
  103. // 页面卸载时停止匹配
  104. if (this.isMatching) {
  105. this.cancelMatch();
  106. }
  107. if (this.pollingTimer) {
  108. clearInterval(this.pollingTimer);
  109. }
  110. },
  111. methods: {
  112. // 加载用户信息
  113. loadUserInfo() {
  114. // 从本地存储获取用户信息
  115. const userInfo = uni.getStorageSync('userInfo');
  116. if (userInfo) {
  117. this.userInfo = userInfo;
  118. } else {
  119. uni.showToast({
  120. title: '请先登录',
  121. icon: 'none'
  122. });
  123. setTimeout(() => {
  124. uni.navigateBack();
  125. }, 1500);
  126. }
  127. },
  128. // 选择匹配模式
  129. selectMode(mode) {
  130. this.selectedMode = mode;
  131. const modeNames = {
  132. 'smart': '智能算法',
  133. 'online': '实时在线',
  134. 'precise': '精准推荐'
  135. };
  136. uni.showToast({
  137. title: `已选择:${modeNames[mode] || mode}`,
  138. icon: 'none',
  139. duration: 1500
  140. });
  141. },
  142. // 开始匹配
  143. async startMatch() {
  144. if (!this.userInfo.userId) {
  145. uni.showToast({
  146. title: '用户信息不完整',
  147. icon: 'none'
  148. });
  149. return;
  150. }
  151. this.isMatching = true;
  152. this.matchStatus = '正在匹配中...';
  153. try {
  154. // 构建匹配数据
  155. const matchData = {
  156. userId: String(this.userInfo.userId),
  157. nickname: this.userInfo.nickname || '用户',
  158. gender: this.userInfo.gender || 1,
  159. age: this.userInfo.age || 25,
  160. avatarUrl: this.userInfo.avatarUrl || '',
  161. interests: this.userInfo.interests || ['旅游', '美食'],
  162. city: this.userInfo.city || '未知',
  163. introduction: this.userInfo.introduction || '',
  164. latitude: this.userInfo.latitude || null,
  165. longitude: this.userInfo.longitude || null,
  166. matchMode: this.selectedMode || 'smart' // 添加匹配模式
  167. };
  168. // 调用匹配接口 - 使用配置文件中的地址
  169. const baseUrl = MATCH_API_CONFIG.BASE_URL;
  170. const url = `${baseUrl}${MATCH_API_CONFIG.ENDPOINTS.START_MATCH}`;
  171. const [error, res] = await uni.request({
  172. url: url,
  173. method: 'POST',
  174. header: {
  175. 'Content-Type': 'application/json'
  176. },
  177. data: matchData,
  178. timeout: 10000
  179. });
  180. // 检查是否有错误或响应无效
  181. if (error || !res || !res.data) {
  182. this.isMatching = false;
  183. this.matchStatus = '点击下方按钮开始匹配';
  184. uni.showToast({
  185. title: '服务器连接失败,请确保后端服务已启动',
  186. icon: 'none',
  187. duration: 3000
  188. });
  189. return;
  190. }
  191. // 检查 HTTP 状态码
  192. if (res.statusCode !== 200) {
  193. this.isMatching = false;
  194. this.matchStatus = '点击下方按钮开始匹配';
  195. uni.showToast({
  196. title: `服务器错误 (${res.statusCode}),请联系管理员`,
  197. icon: 'none',
  198. duration: 3000
  199. });
  200. return;
  201. }
  202. if (res.data.code === 200) {
  203. if (res.data.status === 'success') {
  204. // 立即匹配成功
  205. const matchData = res.data.data;
  206. if (!matchData) {
  207. this.isMatching = false;
  208. this.matchStatus = '点击下方按钮开始匹配';
  209. uni.showToast({
  210. title: '匹配数据异常,请重试',
  211. icon: 'none'
  212. });
  213. return;
  214. }
  215. this.handleMatchSuccess(matchData);
  216. } else if (res.data.status === 'waiting') {
  217. // 等待匹配,开始轮询
  218. this.matchStatus = '正在寻找合适的对象...';
  219. this.startPolling();
  220. } else {
  221. this.isMatching = false;
  222. this.matchStatus = '点击下方按钮开始匹配';
  223. uni.showToast({
  224. title: res.data.msg || '匹配失败',
  225. icon: 'none'
  226. });
  227. }
  228. } else {
  229. this.isMatching = false;
  230. this.matchStatus = '点击下方按钮开始匹配';
  231. uni.showToast({
  232. title: res.data.msg || '匹配失败',
  233. icon: 'none'
  234. });
  235. }
  236. } catch (error) {
  237. this.isMatching = false;
  238. this.matchStatus = '点击下方按钮开始匹配';
  239. uni.showToast({
  240. title: '网络错误,请重试',
  241. icon: 'none'
  242. });
  243. }
  244. },
  245. // 开始轮询匹配状态
  246. startPolling() {
  247. let pollCount = 0;
  248. const maxPolls = 15; // 最多轮询15次(30秒)
  249. // 每2秒检查一次匹配状态
  250. this.pollingTimer = setInterval(async () => {
  251. pollCount++;
  252. // 如果超过最大轮询次数,停止匹配
  253. if (pollCount >= maxPolls) {
  254. if (this.isMatching) {
  255. // 轮询超时,不显示取消匹配的提示,而是显示更合适的提示
  256. this.cancelMatch(false);
  257. uni.showToast({
  258. title: '暂无合适的匹配对象,请稍后再试',
  259. icon: 'none',
  260. duration: 2000
  261. });
  262. }
  263. return;
  264. }
  265. // 尝试查询匹配状态(如果后端有状态查询接口)
  266. try {
  267. const baseUrl = MATCH_API_CONFIG.BASE_URL;
  268. const userId = String(this.userInfo.userId);
  269. } catch (error) {
  270. }
  271. }, MATCH_API_CONFIG.CONFIG.POLLING_INTERVAL);
  272. },
  273. // 取消匹配
  274. // @param showToast 是否显示取消匹配的提示(默认true,轮询超时时传入false)
  275. async cancelMatch(showToast = true) {
  276. try {
  277. const baseUrl = MATCH_API_CONFIG.BASE_URL;
  278. const userId = String(this.userInfo.userId);
  279. const url = `${baseUrl}${MATCH_API_CONFIG.ENDPOINTS.CANCEL_MATCH}?userId=${userId}`;
  280. const [error, res] = await uni.request({
  281. url: url,
  282. method: 'POST',
  283. timeout: 5000
  284. });
  285. if (error) {
  286. if (showToast) {
  287. uni.showToast({
  288. title: '取消匹配失败',
  289. icon: 'none'
  290. });
  291. }
  292. } else {
  293. // 只有在需要显示提示时才显示
  294. if (showToast && res.data && res.data.code === 200) {
  295. uni.showToast({
  296. title: res.data.msg || '已取消匹配',
  297. icon: 'none'
  298. });
  299. }
  300. }
  301. } catch (error) {
  302. if (showToast) {
  303. uni.showToast({
  304. title: '取消匹配失败',
  305. icon: 'none'
  306. });
  307. }
  308. }
  309. this.isMatching = false;
  310. this.matchStatus = '点击下方按钮开始匹配';
  311. if (this.pollingTimer) {
  312. clearInterval(this.pollingTimer);
  313. this.pollingTimer = null;
  314. }
  315. },
  316. // 处理匹配成功
  317. handleMatchSuccess(data) {
  318. if (!data || typeof data !== 'object') {
  319. this.isMatching = false;
  320. this.matchStatus = '点击下方按钮开始匹配';
  321. uni.showToast({
  322. title: '匹配数据异常',
  323. icon: 'none'
  324. });
  325. return;
  326. }
  327. this.isMatching = false;
  328. this.matchStatus = '匹配成功!';
  329. if (this.pollingTimer) {
  330. clearInterval(this.pollingTimer);
  331. this.pollingTimer = null;
  332. }
  333. // 解析匹配数据 - 兼容不同的数据结构
  334. this.matchScore = Math.round(data.matchScore || (data.roomId ? 50 : 0));
  335. // 尝试多种可能的数据结构
  336. let matchedUserInfo = null;
  337. // 方式1: data.user2Info
  338. if (data.user2Info && typeof data.user2Info === 'object') {
  339. matchedUserInfo = data.user2Info;
  340. }
  341. // 方式2: data.matchedUser
  342. else if (data.matchedUser && typeof data.matchedUser === 'object') {
  343. matchedUserInfo = data.matchedUser;
  344. }
  345. // 方式3: data直接包含用户信息
  346. else if (data.userId || data.nickname) {
  347. matchedUserInfo = data;
  348. }
  349. // 方式4: 嵌套在matchPair中
  350. else if (data.matchPair) {
  351. matchedUserInfo = data.matchPair.matchedUser || data.matchPair.user2Info || data.matchPair;
  352. }
  353. // 设置匹配用户数据
  354. if (matchedUserInfo) {
  355. this.matchedUser = {
  356. userId: matchedUserInfo.userId || matchedUserInfo.user_id || '',
  357. nickname: matchedUserInfo.nickname || matchedUserInfo.name || '匹配用户',
  358. age: matchedUserInfo.age || 0,
  359. city: matchedUserInfo.city || '未知',
  360. avatarUrl: matchedUserInfo.avatarUrl || matchedUserInfo.avatar_url || 'http://115.190.125.125:9001/static-images/default-avatar.svg',
  361. interests: matchedUserInfo.interests || []
  362. };
  363. } else {
  364. // 如果完全无法提取,使用默认值
  365. this.matchedUser = {
  366. userId: '',
  367. nickname: '匹配用户',
  368. age: 0,
  369. city: '未知',
  370. avatarUrl: 'http://115.190.125.125:9001/static-images/default-avatar.svg',
  371. interests: []
  372. };
  373. }
  374. // 显示匹配成功弹窗
  375. this.$refs.matchSuccessPopup.open();
  376. },
  377. // 喜欢匹配的用户
  378. async likeMatchedUser() {
  379. if (!this.matchedUser || !this.matchedUser.userId) {
  380. uni.showToast({
  381. title: '用户信息错误',
  382. icon: 'none'
  383. });
  384. return;
  385. }
  386. const uid = parseInt(uni.getStorageSync('userId') || 1);
  387. const targetUserId = this.matchedUser.userId;
  388. try {
  389. // 导入 api 模块
  390. const api = require('@/utils/api.js').default;
  391. // 调用喜欢接口
  392. await api.recommend.feedback({
  393. userId: uid,
  394. targetUserId: targetUserId,
  395. type: 'like'
  396. });
  397. this.isLiked = true;
  398. uni.showToast({
  399. title: '已喜欢',
  400. icon: 'success'
  401. });
  402. // 延迟关闭弹窗
  403. setTimeout(() => {
  404. this.$refs.matchSuccessPopup.close();
  405. this.matchStatus = '点击下方按钮开始匹配';
  406. this.matchedUser = {};
  407. this.isLiked = false;
  408. }, 1000);
  409. } catch(e) {
  410. console.error('喜欢失败', e);
  411. uni.showToast({
  412. title: '操作失败,请重试',
  413. icon: 'none'
  414. });
  415. }
  416. },
  417. // 继续匹配
  418. continueMatch() {
  419. this.$refs.matchSuccessPopup.close();
  420. this.matchStatus = '点击下方按钮开始匹配';
  421. this.matchedUser = {};
  422. },
  423. // 返回上一页
  424. goBack() {
  425. // 如果正在匹配中,先取消匹配
  426. if (this.isMatching) {
  427. uni.showModal({
  428. title: '提示',
  429. content: '正在匹配中,确定要退出吗?',
  430. success: (res) => {
  431. if (res.confirm) {
  432. this.cancelMatch();
  433. setTimeout(() => {
  434. uni.navigateBack();
  435. }, 500);
  436. }
  437. }
  438. });
  439. } else {
  440. uni.navigateBack();
  441. }
  442. }
  443. }
  444. }
  445. </script>
  446. <style scoped>
  447. .match-container {
  448. min-height: 100vh;
  449. background: linear-gradient(180deg, #FFF5F7 0%, #FFFFFF 100%);
  450. padding: 0;
  451. padding-top: calc(env(safe-area-inset-top) + 40rpx);
  452. }
  453. /* 自定义导航栏 */
  454. .custom-navbar {
  455. height: 88rpx;
  456. background: white;
  457. display: flex;
  458. align-items: center;
  459. justify-content: space-between;
  460. padding: 0 20rpx;
  461. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
  462. position: relative;
  463. z-index: 999;
  464. margin-bottom: 10rpx;
  465. }
  466. .navbar-back {
  467. display: flex;
  468. align-items: center;
  469. padding: 10rpx 20rpx;
  470. cursor: pointer;
  471. }
  472. .navbar-back:active {
  473. opacity: 0.7;
  474. }
  475. .back-icon {
  476. font-size: 40rpx;
  477. color: #E91E63;
  478. font-weight: bold;
  479. margin-right: 8rpx;
  480. }
  481. .back-text {
  482. font-size: 28rpx;
  483. color: #333;
  484. }
  485. .navbar-title {
  486. font-size: 32rpx;
  487. font-weight: bold;
  488. color: #333;
  489. position: absolute;
  490. left: 50%;
  491. transform: translateX(-50%);
  492. }
  493. .navbar-placeholder {
  494. width: 120rpx;
  495. }
  496. .tip-box {
  497. background: linear-gradient(135deg, #E3F2FD 0%, #F3E5F5 100%);
  498. border-left: 6rpx solid #2196F3;
  499. padding: 28rpx 24rpx;
  500. margin: 10rpx 20rpx 24rpx 20rpx;
  501. border-radius: 16rpx;
  502. display: flex;
  503. align-items: center;
  504. box-shadow: 0 2rpx 12rpx rgba(33, 150, 243, 0.1);
  505. }
  506. .tip-icon {
  507. font-size: 36rpx;
  508. margin-right: 16rpx;
  509. }
  510. .tip-text {
  511. font-size: 28rpx;
  512. color: #1976D2;
  513. flex: 1;
  514. }
  515. .match-animation {
  516. height: 320rpx;
  517. display: flex;
  518. flex-direction: column;
  519. justify-content: center;
  520. align-items: center;
  521. margin: 20rpx 0 30rpx 0;
  522. }
  523. .heart-container {
  524. position: relative;
  525. width: 200rpx;
  526. height: 200rpx;
  527. animation: pulse 1.5s ease-in-out infinite;
  528. }
  529. .heart {
  530. font-size: 100rpx;
  531. position: absolute;
  532. top: 50%;
  533. left: 50%;
  534. transform: translate(-50%, -50%);
  535. }
  536. .heart:nth-child(1) {
  537. animation: heart-beat 1.5s ease-in-out infinite;
  538. }
  539. .heart:nth-child(2) {
  540. animation: heart-beat 1.5s ease-in-out 0.75s infinite;
  541. opacity: 0.6;
  542. }
  543. .match-status {
  544. margin-top: 40rpx;
  545. font-size: 30rpx;
  546. color: #E91E63;
  547. font-weight: bold;
  548. text-align: center;
  549. padding: 0 40rpx;
  550. }
  551. .match-modes {
  552. margin: 20rpx 20rpx 180rpx 20rpx;
  553. padding-bottom: 20rpx;
  554. }
  555. .mode-item {
  556. background: white;
  557. border-radius: 20rpx;
  558. padding: 40rpx 32rpx;
  559. margin-bottom: 20rpx;
  560. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
  561. transition: all 0.3s;
  562. position: relative;
  563. cursor: pointer;
  564. -webkit-tap-highlight-color: transparent;
  565. border: 2rpx solid transparent;
  566. }
  567. .mode-item:active {
  568. transform: scale(0.98);
  569. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  570. }
  571. .mode-item-active {
  572. background: linear-gradient(135deg, #FFF5F7 0%, #FFFFFF 100%);
  573. border: 3rpx solid #E91E63;
  574. box-shadow: 0 8rpx 24rpx rgba(233, 30, 99, 0.25);
  575. transform: translateY(-4rpx);
  576. }
  577. .mode-selected {
  578. position: absolute;
  579. top: 16rpx;
  580. right: 16rpx;
  581. background: #E91E63;
  582. color: white;
  583. padding: 8rpx 16rpx;
  584. border-radius: 20rpx;
  585. font-size: 24rpx;
  586. font-weight: bold;
  587. }
  588. .mode-icon {
  589. font-size: 72rpx;
  590. text-align: center;
  591. margin-bottom: 20rpx;
  592. }
  593. .mode-title {
  594. font-size: 34rpx;
  595. font-weight: bold;
  596. color: #333;
  597. text-align: center;
  598. margin-bottom: 16rpx;
  599. }
  600. .mode-desc {
  601. font-size: 26rpx;
  602. color: #999;
  603. text-align: center;
  604. line-height: 40rpx;
  605. padding: 0 20rpx;
  606. }
  607. .match-button-container {
  608. position: fixed;
  609. bottom: calc(env(safe-area-inset-bottom) + 40rpx);
  610. left: 30rpx;
  611. right: 30rpx;
  612. z-index: 100;
  613. }
  614. .start-match-btn {
  615. background: linear-gradient(135deg, #E91E63 0%, #C2185B 100%);
  616. color: white;
  617. border: none;
  618. border-radius: 50rpx;
  619. height: 100rpx;
  620. line-height: 100rpx;
  621. font-size: 36rpx;
  622. font-weight: bold;
  623. box-shadow: 0 8rpx 24rpx rgba(233, 30, 99, 0.4);
  624. }
  625. .start-match-btn:active {
  626. background: linear-gradient(135deg, #C2185B 0%, #AD1457 100%);
  627. }
  628. .cancel-match-btn {
  629. background: #FF9800;
  630. color: white;
  631. border: none;
  632. border-radius: 50rpx;
  633. height: 100rpx;
  634. line-height: 100rpx;
  635. font-size: 36rpx;
  636. font-weight: bold;
  637. box-shadow: 0 8rpx 24rpx rgba(255, 152, 0, 0.4);
  638. }
  639. .btn-text {
  640. color: white;
  641. }
  642. /* 匹配成功弹窗 */
  643. .success-popup {
  644. width: 600rpx;
  645. background: white;
  646. border-radius: 24rpx;
  647. padding: 60rpx 40rpx;
  648. text-align: center;
  649. }
  650. .success-icon {
  651. font-size: 120rpx;
  652. margin-bottom: 20rpx;
  653. }
  654. .success-title {
  655. font-size: 40rpx;
  656. font-weight: bold;
  657. color: #E91E63;
  658. margin-bottom: 16rpx;
  659. }
  660. .success-score {
  661. font-size: 28rpx;
  662. color: #666;
  663. margin-bottom: 40rpx;
  664. }
  665. .matched-user-info {
  666. background: #F5F5F5;
  667. border-radius: 16rpx;
  668. padding: 32rpx;
  669. margin-bottom: 40rpx;
  670. }
  671. .user-avatar {
  672. width: 120rpx;
  673. height: 120rpx;
  674. border-radius: 60rpx;
  675. margin: 0 auto 20rpx;
  676. display: block;
  677. }
  678. .user-name {
  679. font-size: 36rpx;
  680. font-weight: bold;
  681. color: #333;
  682. margin-bottom: 12rpx;
  683. }
  684. .user-detail {
  685. font-size: 28rpx;
  686. color: #999;
  687. margin-bottom: 20rpx;
  688. }
  689. .user-interests {
  690. display: flex;
  691. flex-wrap: wrap;
  692. justify-content: center;
  693. gap: 12rpx;
  694. }
  695. .interest-tag {
  696. background: #E91E63;
  697. color: white;
  698. padding: 8rpx 20rpx;
  699. border-radius: 20rpx;
  700. font-size: 24rpx;
  701. }
  702. .popup-buttons {
  703. display: flex;
  704. gap: 20rpx;
  705. }
  706. .btn-like,
  707. .btn-continue {
  708. flex: 1;
  709. height: 80rpx;
  710. line-height: 80rpx;
  711. border-radius: 40rpx;
  712. font-size: 28rpx;
  713. border: none;
  714. }
  715. .btn-like {
  716. background: #E91E63;
  717. color: white;
  718. }
  719. .btn-continue {
  720. background: white;
  721. color: #E91E63;
  722. border: 2rpx solid #E91E63 !important;
  723. }
  724. /* 动画 */
  725. @keyframes pulse {
  726. 0%, 100% {
  727. transform: scale(1);
  728. }
  729. 50% {
  730. transform: scale(1.1);
  731. }
  732. }
  733. @keyframes heart-beat {
  734. 0%, 100% {
  735. transform: translate(-50%, -50%) scale(1);
  736. opacity: 1;
  737. }
  738. 50% {
  739. transform: translate(-50%, -50%) scale(1.2);
  740. opacity: 0.8;
  741. }
  742. }
  743. </style>