index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861
  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. }
  452. /* 自定义导航栏 */
  453. .custom-navbar {
  454. height: 88rpx;
  455. background: white;
  456. display: flex;
  457. align-items: center;
  458. justify-content: space-between;
  459. padding: 0 20rpx;
  460. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
  461. position: sticky;
  462. top: 0;
  463. z-index: 999;
  464. }
  465. .navbar-back {
  466. display: flex;
  467. align-items: center;
  468. padding: 10rpx 20rpx;
  469. cursor: pointer;
  470. }
  471. .navbar-back:active {
  472. opacity: 0.7;
  473. }
  474. .back-icon {
  475. font-size: 40rpx;
  476. color: #E91E63;
  477. font-weight: bold;
  478. margin-right: 8rpx;
  479. }
  480. .back-text {
  481. font-size: 28rpx;
  482. color: #333;
  483. }
  484. .navbar-title {
  485. font-size: 32rpx;
  486. font-weight: bold;
  487. color: #333;
  488. position: absolute;
  489. left: 50%;
  490. transform: translateX(-50%);
  491. }
  492. .navbar-placeholder {
  493. width: 120rpx;
  494. }
  495. .tip-box {
  496. background: linear-gradient(135deg, #E3F2FD 0%, #F3E5F5 100%);
  497. border-left: 6rpx solid #2196F3;
  498. padding: 28rpx 24rpx;
  499. margin: 24rpx 20rpx;
  500. border-radius: 16rpx;
  501. display: flex;
  502. align-items: center;
  503. box-shadow: 0 2rpx 12rpx rgba(33, 150, 243, 0.1);
  504. }
  505. .tip-icon {
  506. font-size: 36rpx;
  507. margin-right: 16rpx;
  508. }
  509. .tip-text {
  510. font-size: 28rpx;
  511. color: #1976D2;
  512. flex: 1;
  513. }
  514. .match-animation {
  515. height: 320rpx;
  516. display: flex;
  517. flex-direction: column;
  518. justify-content: center;
  519. align-items: center;
  520. margin: 20rpx 0 30rpx 0;
  521. }
  522. .heart-container {
  523. position: relative;
  524. width: 200rpx;
  525. height: 200rpx;
  526. animation: pulse 1.5s ease-in-out infinite;
  527. }
  528. .heart {
  529. font-size: 100rpx;
  530. position: absolute;
  531. top: 50%;
  532. left: 50%;
  533. transform: translate(-50%, -50%);
  534. }
  535. .heart:nth-child(1) {
  536. animation: heart-beat 1.5s ease-in-out infinite;
  537. }
  538. .heart:nth-child(2) {
  539. animation: heart-beat 1.5s ease-in-out 0.75s infinite;
  540. opacity: 0.6;
  541. }
  542. .match-status {
  543. margin-top: 40rpx;
  544. font-size: 30rpx;
  545. color: #E91E63;
  546. font-weight: bold;
  547. text-align: center;
  548. padding: 0 40rpx;
  549. }
  550. .match-modes {
  551. margin: 20rpx 20rpx 180rpx 20rpx;
  552. padding-bottom: 20rpx;
  553. }
  554. .mode-item {
  555. background: white;
  556. border-radius: 20rpx;
  557. padding: 40rpx 32rpx;
  558. margin-bottom: 20rpx;
  559. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
  560. transition: all 0.3s;
  561. position: relative;
  562. cursor: pointer;
  563. -webkit-tap-highlight-color: transparent;
  564. border: 2rpx solid transparent;
  565. }
  566. .mode-item:active {
  567. transform: scale(0.98);
  568. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  569. }
  570. .mode-item-active {
  571. background: linear-gradient(135deg, #FFF5F7 0%, #FFFFFF 100%);
  572. border: 3rpx solid #E91E63;
  573. box-shadow: 0 8rpx 24rpx rgba(233, 30, 99, 0.25);
  574. transform: translateY(-4rpx);
  575. }
  576. .mode-selected {
  577. position: absolute;
  578. top: 16rpx;
  579. right: 16rpx;
  580. background: #E91E63;
  581. color: white;
  582. padding: 8rpx 16rpx;
  583. border-radius: 20rpx;
  584. font-size: 24rpx;
  585. font-weight: bold;
  586. }
  587. .mode-icon {
  588. font-size: 72rpx;
  589. text-align: center;
  590. margin-bottom: 20rpx;
  591. }
  592. .mode-title {
  593. font-size: 34rpx;
  594. font-weight: bold;
  595. color: #333;
  596. text-align: center;
  597. margin-bottom: 16rpx;
  598. }
  599. .mode-desc {
  600. font-size: 26rpx;
  601. color: #999;
  602. text-align: center;
  603. line-height: 40rpx;
  604. padding: 0 20rpx;
  605. }
  606. .match-button-container {
  607. position: fixed;
  608. bottom: 80rpx;
  609. left: 30rpx;
  610. right: 30rpx;
  611. z-index: 100;
  612. }
  613. .start-match-btn {
  614. background: linear-gradient(135deg, #E91E63 0%, #C2185B 100%);
  615. color: white;
  616. border: none;
  617. border-radius: 50rpx;
  618. height: 100rpx;
  619. line-height: 100rpx;
  620. font-size: 36rpx;
  621. font-weight: bold;
  622. box-shadow: 0 8rpx 24rpx rgba(233, 30, 99, 0.4);
  623. }
  624. .start-match-btn:active {
  625. background: linear-gradient(135deg, #C2185B 0%, #AD1457 100%);
  626. }
  627. .cancel-match-btn {
  628. background: #FF9800;
  629. color: white;
  630. border: none;
  631. border-radius: 50rpx;
  632. height: 100rpx;
  633. line-height: 100rpx;
  634. font-size: 36rpx;
  635. font-weight: bold;
  636. box-shadow: 0 8rpx 24rpx rgba(255, 152, 0, 0.4);
  637. }
  638. .btn-text {
  639. color: white;
  640. }
  641. /* 匹配成功弹窗 */
  642. .success-popup {
  643. width: 600rpx;
  644. background: white;
  645. border-radius: 24rpx;
  646. padding: 60rpx 40rpx;
  647. text-align: center;
  648. }
  649. .success-icon {
  650. font-size: 120rpx;
  651. margin-bottom: 20rpx;
  652. }
  653. .success-title {
  654. font-size: 40rpx;
  655. font-weight: bold;
  656. color: #E91E63;
  657. margin-bottom: 16rpx;
  658. }
  659. .success-score {
  660. font-size: 28rpx;
  661. color: #666;
  662. margin-bottom: 40rpx;
  663. }
  664. .matched-user-info {
  665. background: #F5F5F5;
  666. border-radius: 16rpx;
  667. padding: 32rpx;
  668. margin-bottom: 40rpx;
  669. }
  670. .user-avatar {
  671. width: 120rpx;
  672. height: 120rpx;
  673. border-radius: 60rpx;
  674. margin: 0 auto 20rpx;
  675. display: block;
  676. }
  677. .user-name {
  678. font-size: 36rpx;
  679. font-weight: bold;
  680. color: #333;
  681. margin-bottom: 12rpx;
  682. }
  683. .user-detail {
  684. font-size: 28rpx;
  685. color: #999;
  686. margin-bottom: 20rpx;
  687. }
  688. .user-interests {
  689. display: flex;
  690. flex-wrap: wrap;
  691. justify-content: center;
  692. gap: 12rpx;
  693. }
  694. .interest-tag {
  695. background: #E91E63;
  696. color: white;
  697. padding: 8rpx 20rpx;
  698. border-radius: 20rpx;
  699. font-size: 24rpx;
  700. }
  701. .popup-buttons {
  702. display: flex;
  703. gap: 20rpx;
  704. }
  705. .btn-like,
  706. .btn-continue {
  707. flex: 1;
  708. height: 80rpx;
  709. line-height: 80rpx;
  710. border-radius: 40rpx;
  711. font-size: 28rpx;
  712. border: none;
  713. }
  714. .btn-like {
  715. background: #E91E63;
  716. color: white;
  717. }
  718. .btn-continue {
  719. background: white;
  720. color: #E91E63;
  721. border: 2rpx solid #E91E63 !important;
  722. }
  723. /* 动画 */
  724. @keyframes pulse {
  725. 0%, 100% {
  726. transform: scale(1);
  727. }
  728. 50% {
  729. transform: scale(1.1);
  730. }
  731. }
  732. @keyframes heart-beat {
  733. 0%, 100% {
  734. transform: translate(-50%, -50%) scale(1);
  735. opacity: 1;
  736. }
  737. 50% {
  738. transform: translate(-50%, -50%) scale(1.2);
  739. opacity: 0.8;
  740. }
  741. }
  742. </style>