index.vue 18 KB

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