You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2466 lines
62 KiB

5 months ago
2 days ago
2 days ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
1 week ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
2 days ago
5 months ago
5 months ago
2 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
  1. <script setup>
  2. // 导入
  3. import { ref, computed, onMounted, watch, nextTick, onUnmounted, h } from "vue";
  4. import { setHeight } from "../utils/setHeight";
  5. import {
  6. getUserCountAPI,
  7. showExchangeAPI,
  8. godExchangeAPI,
  9. exchangeAPI,
  10. getGoldCoinAPI,
  11. } from "../api/AIxiaocaishen";
  12. import { ElMessage } from "element-plus";
  13. import AIchat from "./AIchat.vue";
  14. import AIfind from "./AIfind.vue";
  15. import Feedback from "./Feedback.vue";
  16. import Announcement from "./Announcement.vue";
  17. import { useAppBridge } from "../assets/js/useAppBridge.js";
  18. import { useDataStore } from "@/store/dataList.js";
  19. import { useChatStore } from "../store/chat";
  20. import { useEmotionAudioStore } from "../store/emotionAudio";
  21. import { useAudioStore } from "../store/audio";
  22. import _ from "lodash";
  23. import logo from "../assets/img/homePage/logo.png";
  24. import madeInHL from "../assets/img/homePage/madeInHL.png";
  25. import getCountAll from "../assets/img/homePage/get-count-all.png";
  26. import announcementBtn from "../assets/img/homePage/announcement.png";
  27. import thinkActive from "../assets/img/homePage/tail/think-active.png";
  28. import thinkNoActive from "../assets/img/homePage/tail/think-no-active.png";
  29. import languageBtn from "../assets/img/homePage/tail/language.png";
  30. import dbqbButton01 from "../assets/img/AiEmotion/dbqb-button01.png";
  31. import dbqbButton02 from "../assets/img/AiEmotion/dbqb-button02.png";
  32. import emotionButton01 from "../assets/img/AiEmotion/emotion-button01.png";
  33. import emotionButton02 from "../assets/img/AiEmotion/emotion-button02.png";
  34. import voice from "../assets/img/homePage/tail/voice.png";
  35. import voiceNoActive from "../assets/img/homePage/tail/voice-no-active.png";
  36. import sendBtn from "../assets/img/homePage/tail/send.png";
  37. import msgBtn from "../assets/img/homePage/tail/msg.png";
  38. import feedbackBtn from "../assets/img/Feedback/feedbackBtn.png";
  39. import AiEmotion from "./AiEmotion.vue";
  40. import HistoryRecord from "./components/HistoryRecord.vue";
  41. // import VConsole from "vconsole";
  42. // const vConsole = new VConsole();
  43. const isMobile = ref(null);
  44. // 获取 AiEmotion 组件的 ref
  45. const aiEmotionRef = ref(null);
  46. // 获取历史记录组件的 ref
  47. const historyRecordRef = ref(null);
  48. // import { useUserStore } from "../store/userPessionCode.js";
  49. const { getQueryVariable, setActiveTabIndex, getUserInfo } = useDataStore();
  50. const dataStore = useDataStore();
  51. const chatStore = useChatStore();
  52. // 变量
  53. // 音频管理
  54. const emotionAudioStore = useEmotionAudioStore();
  55. const audioStore = useAudioStore();
  56. // 根据当前页面类型获取对应的音频store
  57. const getCurrentAudioStore = () => {
  58. return activeTab.value === "AiEmotion" ? emotionAudioStore : audioStore;
  59. };
  60. const isVoice = computed(() => {
  61. const currentStore = getCurrentAudioStore();
  62. return currentStore.isVoiceEnabled;
  63. });
  64. const toggleVoice = () => {
  65. const currentStore = getCurrentAudioStore();
  66. if (!currentStore.isVoiceEnabled) {
  67. // 如果语音功能关闭,先开启语音功能
  68. currentStore.toggleVoice();
  69. } else {
  70. // 如果语音功能开启,则切换播放/暂停状态
  71. if (currentStore.currentAudioUrl || currentStore.ttsUrl) {
  72. // 有音频时切换播放/暂停
  73. currentStore.togglePlayPause();
  74. } else {
  75. // 没有音频时关闭语音功能
  76. currentStore.toggleVoice();
  77. }
  78. }
  79. };
  80. // 将默认值改为从 sessionStorage 中获取,如果没有则使用默认值 'aifindCow'为第一个默认tab
  81. const activeTab = ref(sessionStorage.getItem("activeTabAI") || "AIchat");
  82. const activeIndex = ref(
  83. parseInt(sessionStorage.getItem("activeIndexAI") || "0")
  84. );
  85. const tabs = computed(() => [
  86. {
  87. name: "AIchat",
  88. label: "夺宝奇兵大模型",
  89. },
  90. // {
  91. // name: "AIfind",
  92. // label: "发现",
  93. // },
  94. {
  95. name: "AiEmotion",
  96. label: "AI情绪大模型",
  97. },
  98. ]);
  99. // 修改 setActiveTab 方法,添加一个可选参数 forceAIchat
  100. const setActiveTab = (tab, index, forceAIchat = false) => {
  101. isScrolling.value = false; //回复滚动到底部方法
  102. isAnnouncementVisible.value = false;
  103. // 重置输入框禁用状态,防止页面切换时状态残留
  104. console.log("tab", tab, "index", index);
  105. if (tab == "AIchat") {
  106. isInputDisabled.value = chatStore.chatInput;
  107. console.log("切换到AIchat页面,输入框状态为", isInputDisabled.value);
  108. } else if (tab == "AiEmotion") {
  109. isInputDisabled.value = chatStore.emotionInput;
  110. console.log("切换到AiEmotion页面,输入框状态为", isInputDisabled.value);
  111. } else {
  112. isInputDisabled.value = false;
  113. }
  114. if (forceAIchat && activeTab.value !== "AIchat") {
  115. activeTab.value = "AIchat";
  116. activeIndex.value = 0;
  117. sessionStorage.setItem("activeTabAI", "AIchat");
  118. sessionStorage.setItem("activeIndexAI", "0");
  119. } else {
  120. activeTab.value = tab;
  121. activeIndex.value = index;
  122. sessionStorage.setItem("activeTabAI", tab);
  123. sessionStorage.setItem("activeIndexAI", index.toString());
  124. }
  125. setActiveTabIndex(index);
  126. console.log(tab, index, "tab, index");
  127. setHeight(document.getElementById("testId")); // 给父组件发送窗口高度
  128. };
  129. // 修改 activeComponent 的计算逻辑
  130. const activeComponent = computed(() => {
  131. if (activeTab.value === "AIchat") {
  132. return AIchat;
  133. } else if (activeTab.value === "AIfind") {
  134. return AIfind;
  135. } else if (activeTab.value === "AiEmotion") {
  136. return AiEmotion; // 新增逻辑
  137. }
  138. });
  139. const activeTwoTab = computed(() => {
  140. if (isAnnouncementVisible.value) {
  141. return Announcement;
  142. } else {
  143. return Feedback;
  144. }
  145. });
  146. // 新增一个方法,调用时先判断是否处于 AIchat,若不在则跳转到 AIchat
  147. const ensureAIchat = () => {
  148. setActiveTab("AIchat", 0, true);
  149. };
  150. // 获取次数
  151. const UserCount = computed(() => chatStore.UserCount);
  152. const getCount = () => {
  153. console.log("点击了获取次数的按钮");
  154. };
  155. // 深度思考
  156. const isThinking = ref(true);
  157. const toggleThink = () => {
  158. isThinking.value = !isThinking.value;
  159. };
  160. // 发送消息
  161. const message = ref("");
  162. // 传输对象
  163. const messages = ref([]);
  164. // 信息加载状态
  165. const isLoading = computed(() => {
  166. chatStore.isLoading;
  167. });
  168. // 输入框禁用状态
  169. const isInputDisabled = ref(false);
  170. // 添加用户消息
  171. const updateMessage = (title) => {
  172. message.value = title;
  173. console.log("updateMessage 的值:", title);
  174. };
  175. watch(
  176. () => chatStore.announcementMsg,
  177. (newVal) => {
  178. console.log("监听到公告改变", chatStore.announcementMsg);
  179. if (chatStore.announcementMsg && !isInputDisabled.value) {
  180. message.value = chatStore.announcementMsg;
  181. chatStore.announcementMsg = null;
  182. }
  183. }
  184. );
  185. watch(
  186. () => dataStore.isFeedback,
  187. async (newVal) => {
  188. if (!dataStore.isFeedback) {
  189. // 重置公告页面显示状态
  190. isAnnouncementVisible.value = false;
  191. await nextTick();
  192. // 监听页面高度
  193. throttledHeightListener();
  194. }
  195. }
  196. );
  197. watch(
  198. () => chatStore.chatInput,
  199. async (newVal) => {
  200. if (activeTab.value == "AIchat") {
  201. isInputDisabled.value = chatStore.chatInput;
  202. }
  203. }
  204. );
  205. watch(
  206. () => chatStore.emotionInput,
  207. async (newVal) => {
  208. if (activeTab.value == "AiEmotion") {
  209. isInputDisabled.value = chatStore.emotionInput;
  210. }
  211. }
  212. );
  213. const sendMessage = async () => {
  214. if (
  215. localStorage.getItem("localToken") == null ||
  216. localStorage.getItem("localToken") == ""
  217. ) {
  218. ElMessage.error("请先登录");
  219. return;
  220. }
  221. // 检查输入内容是否为空
  222. if (!message.value || !message.value.trim()) {
  223. ElMessage.warning("输入内容不能为空");
  224. return;
  225. }
  226. isScrolling.value = false;
  227. // 注意:历史记录会在消息发送后自动更新,无需手动添加
  228. // 取消历史记录选中状态
  229. if (historyRecordRef) {
  230. historyRecordRef.value.selectedRecordId = null;
  231. }
  232. // 判断当前是否为 AiEmotion 组件
  233. if (activeTab.value === "AiEmotion") {
  234. // 禁用输入框
  235. isInputDisabled.value = true;
  236. chatStore.emotionInput = true;
  237. // 调用 AiEmotion 组件的 handleSendMessage 方法
  238. aiEmotionRef.value?.handleSendMessage(message.value, () => {
  239. // 打字机效果完成后的回调,重新启用输入框
  240. isInputDisabled.value = false;
  241. chatStore.emotionInput = false;
  242. });
  243. message.value = ""; // 清空输入框
  244. return;
  245. }
  246. // 调用 ensureAIchat 确保跳转到 AIchat 页面
  247. ensureAIchat();
  248. if (isInputDisabled.value) return;
  249. isInputDisabled.value = true;
  250. chatStore.chatInput = true;
  251. const messageContent = message.value;
  252. // 重置消息输入框
  253. message.value = "";
  254. setTimeout(() => {
  255. console.log("延时后添加消息", messageContent);
  256. // 发送消息时,设置 isLoading 为 true
  257. messages.value = [
  258. ...messages.value,
  259. {
  260. sender: "user",
  261. content: messageContent,
  262. audioArray: [],
  263. audioStatus: false,
  264. },
  265. ];
  266. console.log(messages.value, "messages.value");
  267. }, 200);
  268. };
  269. // 重新启用输入框的方法
  270. const enableInput = () => {
  271. console.log("解除禁用");
  272. isInputDisabled.value = false;
  273. };
  274. // 处理历史记录选择
  275. const handleHistorySelect = (stockData) => {
  276. console.log("接收到历史记录数据:", stockData);
  277. // 如果当前不在AiEmotion页面,切换到AiEmotion页面
  278. // if (activeTab.value !== 'AiEmotion') {
  279. // setActiveTab('AiEmotion', 1);
  280. // }
  281. // 等待组件渲染完成后调用addStock方法
  282. nextTick(() => {
  283. if (aiEmotionRef.value && aiEmotionRef.value.addStock) {
  284. aiEmotionRef.value.addStock(stockData);
  285. } else {
  286. console.error("AiEmotion组件或addStock方法不可用");
  287. }
  288. });
  289. };
  290. // 公告
  291. // 新增一个变量来控制是否显示公告页面
  292. const isAnnouncementVisible = ref(false);
  293. const showAnnouncement = async () => {
  294. console.log("打开公告");
  295. dataStore.isFeedback = true; // 显示用户反馈页面
  296. isScrolling.value = false; //回复滚动到底部方法
  297. isAnnouncementVisible.value = true; // 显示公告页面
  298. if (isMobile.value) {
  299. if (historyRecordRef) {
  300. historyRecordRef.value.isCollapsed = true;
  301. }
  302. }
  303. };
  304. // 跳转用户反馈
  305. const showFeedback = () => {
  306. console.log("打开用户反馈");
  307. dataStore.isFeedback = true; // 显示用户反馈页面
  308. isAnnouncementVisible.value = false; // 显示反馈页面
  309. if (isMobile.value) {
  310. if (historyRecordRef) {
  311. historyRecordRef.value.isCollapsed = true;
  312. }
  313. }
  314. };
  315. // 保证发送消息时,滚动屏在底部
  316. const tabContentAIchat = ref(null);
  317. const tabContentAiEmotion = ref(null);
  318. const isScrolling = ref(false); //判断用户是否在滚动
  319. // AiEmotion页面高度监听器相关变量
  320. const aiEmotionHeightObserver = ref(null);
  321. const isAiEmotionAutoScrollEnabled = ref(false);
  322. const isAiEmotionUserScrolling = ref(false); // 用户是否正在手动滚动
  323. const aiEmotionScrollTimer = ref(null); // 滚动检测定时器
  324. const isChartInteracting = ref(false); // 图表是否正在交互
  325. const chartInteractionTimer = ref(null); // 图表交互检测定时器
  326. // 获取当前活动页面的滚动容器
  327. const getCurrentScrollContainer = () => {
  328. if (activeTab.value === "AIchat") {
  329. return tabContentAIchat.value;
  330. } else if (activeTab.value === "AiEmotion") {
  331. return tabContentAiEmotion.value;
  332. }
  333. return null;
  334. };
  335. const smoothScrollToBottom = async () => {
  336. // console.log("调用滚动到底部的方法");
  337. // await nextTick();
  338. const container = getCurrentScrollContainer();
  339. // console.log(container, 'container')
  340. // console.log(isScrolling.value, 'isScrolling.value')
  341. if (!container) return;
  342. await nextTick(); // 确保在DOM更新后执行
  343. if (!isScrolling.value) {
  344. container.scrollTop = container.scrollHeight - container.offsetHeight;
  345. // container.scrollTop = container.scrollHeight;
  346. // container.scrollTop = container.offsetHeight;
  347. // container.scrollTop = container.scrollHeight + container.offsetHeight;
  348. // console.log(container.scrollHeight, container.offsetHeight, container.scrollHeight - container.offsetHeight, container.scrollTop, "总长度", "可视长度", "位置")
  349. }
  350. };
  351. const throttledSmoothScrollToBottom = _.throttle(smoothScrollToBottom, 300, {
  352. trailing: false,
  353. });
  354. // AiEmotion页面自动滚动到底部的防抖函数
  355. const debouncedAiEmotionScrollToBottom = _.debounce(() => {
  356. if (
  357. activeTab.value === "AiEmotion" &&
  358. isAiEmotionAutoScrollEnabled.value &&
  359. !isAiEmotionUserScrolling.value &&
  360. !isChartInteracting.value
  361. ) {
  362. const container = tabContentAiEmotion.value;
  363. if (container) {
  364. container.scrollTop = container.scrollHeight - container.offsetHeight;
  365. }
  366. }
  367. }, 150);
  368. // 启动AiEmotion页面高度监听器
  369. const startAiEmotionHeightObserver = () => {
  370. // 先停止之前的监听器
  371. stopAiEmotionHeightObserver();
  372. isAiEmotionAutoScrollEnabled.value = true;
  373. // 创建ResizeObserver监听页面内容变化
  374. aiEmotionHeightObserver.value = new ResizeObserver((entries) => {
  375. if (
  376. isAiEmotionAutoScrollEnabled.value &&
  377. activeTab.value === "AiEmotion" &&
  378. !isChartInteracting.value
  379. ) {
  380. debouncedAiEmotionScrollToBottom();
  381. }
  382. });
  383. // 监听document.body的尺寸变化
  384. if (document.body) {
  385. aiEmotionHeightObserver.value.observe(document.body);
  386. }
  387. // 创建MutationObserver监听DOM结构变化
  388. const mutationObserver = new MutationObserver((mutations) => {
  389. let shouldScroll = false;
  390. mutations.forEach((mutation) => {
  391. if (mutation.type === "childList" && mutation.addedNodes.length > 0) {
  392. // 检查新增的节点是否包含实际内容
  393. const hasContent = Array.from(mutation.addedNodes).some((node) => {
  394. if (node.nodeType === Node.ELEMENT_NODE) {
  395. return node.offsetHeight > 0 || node.scrollHeight > 0;
  396. }
  397. return (
  398. node.nodeType === Node.TEXT_NODE &&
  399. node.textContent.trim().length > 0
  400. );
  401. });
  402. if (hasContent) {
  403. shouldScroll = true;
  404. }
  405. }
  406. });
  407. if (
  408. shouldScroll &&
  409. isAiEmotionAutoScrollEnabled.value &&
  410. activeTab.value === "AiEmotion" &&
  411. !isChartInteracting.value
  412. ) {
  413. debouncedAiEmotionScrollToBottom();
  414. }
  415. });
  416. // 监听AiEmotion页面的主要内容区域的DOM变化
  417. const aiEmotionContainer = tabContentAiEmotion.value;
  418. if (aiEmotionContainer) {
  419. mutationObserver.observe(aiEmotionContainer, {
  420. childList: true,
  421. subtree: true,
  422. attributes: false,
  423. characterData: true,
  424. });
  425. }
  426. // 保存mutationObserver引用以便清理
  427. aiEmotionHeightObserver.value.mutationObserver = mutationObserver;
  428. // 为AiEmotion页面的滚动容器添加滚动事件监听器
  429. if (aiEmotionContainer) {
  430. aiEmotionContainer.addEventListener("scroll", handleAiEmotionUserScroll, {
  431. passive: true,
  432. });
  433. // 保存滚动事件监听器引用以便清理
  434. aiEmotionHeightObserver.value.scrollListener = handleAiEmotionUserScroll;
  435. }
  436. console.log("AiEmotion页面高度监听器已启动");
  437. };
  438. // AiEmotion页面用户滚动检测
  439. const handleAiEmotionUserScroll = () => {
  440. // 标记用户正在滚动
  441. isAiEmotionUserScrolling.value = true;
  442. // 清除之前的定时器
  443. if (aiEmotionScrollTimer.value) {
  444. clearTimeout(aiEmotionScrollTimer.value);
  445. }
  446. // 设置定时器,2秒后恢复自动滚动
  447. // aiEmotionScrollTimer.value = setTimeout(() => {
  448. // isAiEmotionUserScrolling.value = false;
  449. // console.log("AiEmotion页面用户滚动检测:恢复自动滚动");
  450. // }, 2000);
  451. };
  452. // 图表交互状态管理
  453. const handleChartInteractionStart = () => {
  454. console.log("图表交互开始,临时禁用自动滚动");
  455. isChartInteracting.value = true;
  456. // 清除之前的定时器
  457. if (chartInteractionTimer.value) {
  458. clearTimeout(chartInteractionTimer.value);
  459. }
  460. };
  461. const handleChartInteractionEnd = () => {
  462. // 清除之前的定时器
  463. if (chartInteractionTimer.value) {
  464. clearTimeout(chartInteractionTimer.value);
  465. }
  466. // 设置定时器,1秒后恢复自动滚动
  467. chartInteractionTimer.value = setTimeout(() => {
  468. isChartInteracting.value = false;
  469. console.log("图表交互结束,恢复自动滚动");
  470. }, 1000);
  471. };
  472. // 暴露图表交互管理函数给全局使用
  473. window.handleChartInteractionStart = handleChartInteractionStart;
  474. window.handleChartInteractionEnd = handleChartInteractionEnd;
  475. // 处理AiEmotion页面的滚动请求
  476. const handleAiEmotionScrollToBottom = () => {
  477. if (activeTab.value === "AiEmotion") {
  478. const container = tabContentAiEmotion.value;
  479. if (container) {
  480. // 使用nextTick确保DOM已更新
  481. nextTick(() => {
  482. container.scrollTop = container.scrollHeight - container.offsetHeight;
  483. console.log("AiEmotion页面:执行容器滚动到底部");
  484. });
  485. }
  486. }
  487. };
  488. // 停止AiEmotion页面高度监听器
  489. const stopAiEmotionHeightObserver = () => {
  490. isAiEmotionAutoScrollEnabled.value = false;
  491. isAiEmotionUserScrolling.value = false;
  492. // 清理滚动检测定时器
  493. if (aiEmotionScrollTimer.value) {
  494. clearTimeout(aiEmotionScrollTimer.value);
  495. aiEmotionScrollTimer.value = null;
  496. }
  497. if (aiEmotionHeightObserver.value) {
  498. // 清理ResizeObserver
  499. aiEmotionHeightObserver.value.disconnect();
  500. // 清理MutationObserver
  501. if (aiEmotionHeightObserver.value.mutationObserver) {
  502. aiEmotionHeightObserver.value.mutationObserver.disconnect();
  503. aiEmotionHeightObserver.value.mutationObserver = null;
  504. }
  505. // 清理滚动事件监听器
  506. if (
  507. aiEmotionHeightObserver.value.scrollListener &&
  508. tabContentAiEmotion.value
  509. ) {
  510. tabContentAiEmotion.value.removeEventListener(
  511. "scroll",
  512. aiEmotionHeightObserver.value.scrollListener
  513. );
  514. aiEmotionHeightObserver.value.scrollListener = null;
  515. }
  516. aiEmotionHeightObserver.value = null;
  517. }
  518. console.log("AiEmotion页面高度监听器已停止");
  519. };
  520. watch(
  521. () => chatStore.messages.length,
  522. () => {
  523. // console.log('messages变化了')
  524. // 只有在AIchat页面时才执行自动滚动
  525. if (activeTab.value === "AIchat") {
  526. throttledSmoothScrollToBottom();
  527. }
  528. // setTimeout(throttledSmoothScrollToBottom, 100);
  529. },
  530. { deep: false, immediate: true }
  531. );
  532. watch(
  533. () => chatStore.dbqbClickRecord,
  534. async (newValue, oldValue) => {
  535. const container = getCurrentScrollContainer();
  536. if (!container) return;
  537. await nextTick(); // 确保在DOM更新后执行
  538. container.scrollTop = 0;
  539. }
  540. );
  541. watch(
  542. activeTab,
  543. async () => {
  544. console.log("activeTab变化了", activeTab.value);
  545. if (activeTab.value == "AIchat" || activeTab.value == "AiEmotion") {
  546. if (historyRecordRef.value && historyRecordRef.value.getHistoryList) {
  547. const result = historyRecordRef.value.getHistoryList({
  548. model: activeTab.value == "AIchat" ? 1 : 2,
  549. token: localStorage.getItem("localToken"),
  550. });
  551. }
  552. }
  553. if (activeTab.value === "AIchat") {
  554. isScrolling.value = false; //回复滚动到底部方法
  555. // 停止AiEmotion页面的高度监听器
  556. stopAiEmotionHeightObserver();
  557. setTimeout(() => {
  558. // throttledSmoothScrollToBottom();
  559. }, 100);
  560. } else if (activeTab.value === "AiEmotion") {
  561. // 启动AiEmotion页面的高度监听器
  562. await nextTick(); // 确保DOM更新后启动监听器
  563. startAiEmotionHeightObserver();
  564. } else {
  565. // 其他页面时停止AiEmotion页面的高度监听器
  566. stopAiEmotionHeightObserver();
  567. }
  568. // AiEmotion页面不执行自动滚动,避免刷新后滚动到底部
  569. // setTimeout(throttledSmoothScrollToBottom, 100);
  570. },
  571. { deep: true, immediate: true }
  572. );
  573. // 获取token的核心函数
  574. const fnGetToken = () => {
  575. // console.log('进入fnGetToken')
  576. window.JWready = (ress) => {
  577. // console.log('进入JWready')
  578. try {
  579. ress = JSON.parse(ress);
  580. // console.log(ress, 'ress')
  581. } catch (error) {
  582. console.log(error, "fnGetToken error");
  583. } //platform为5是app端
  584. // platform.value = ress.data.platform
  585. // 处理平台判断
  586. console.log(ress.data.platform, "ress.data.platform");
  587. if (!ress.data.platform) {
  588. // 非App环境通过URL参数获取
  589. localStorage.setItem(
  590. "localToken",
  591. decodeURIComponent(String(getQueryVariable("token")))
  592. );
  593. // localStorage.setItem('localToken', "+SsksARQgUHIbIG3rRnnbZi0+fEeMx8pywnIlrmTxo5EOPR/wjWDV7w7+ZUseiBtf9kFa/atmNx6QfSpv5w")
  594. } else {
  595. // App环境通过桥接获取
  596. useAppBridge().packageFun(
  597. "JWgetStorage",
  598. (response) => {
  599. const res = JSON.parse(response); // 解析返回的结果
  600. localStorage.setItem("localToken", res.data);
  601. // localStorage.setItem('localToken', "+SsksARQgUHIbIG3rRnnbZi0+fEeMx8pywnIlrmTxo5EOPR/wjWDV7w7+ZUseiBtf9kFa/atmNx6QfSpv5w")
  602. },
  603. 5,
  604. {
  605. key: "token",
  606. }
  607. );
  608. }
  609. };
  610. // console.log('出来了')
  611. // 触发App桥接
  612. useAppBridge().packageFun("JWwebReady", () => {}, 5, {});
  613. };
  614. // 在setTimeout中延迟执行
  615. setTimeout(() => {
  616. fnGetToken();
  617. }, 800);
  618. const heightListener = () => {
  619. const tabContainer = getCurrentScrollContainer();
  620. if (!tabContainer) return;
  621. let befortop = 0;
  622. const scrollHandler = () => {
  623. const aftertop = tabContainer.scrollTop;
  624. // 新增底部判断逻辑
  625. const isBottom =
  626. aftertop + tabContainer.offsetHeight + 70 >= tabContainer.scrollHeight;
  627. if (activeTab.value === "AIchat") {
  628. if (aftertop - befortop > 0) {
  629. // console.log("向下滚动");
  630. isScrolling.value = true;
  631. } else {
  632. // console.log("向上滚动");
  633. isScrolling.value = true;
  634. }
  635. // 添加底部状态检测
  636. if (isBottom) {
  637. // console.log("滚动到底部");
  638. isScrolling.value = false;
  639. }
  640. }
  641. befortop = aftertop;
  642. };
  643. // console.log(isScrolling.value, 'isScrolling.value')
  644. tabContainer.addEventListener("scroll", scrollHandler);
  645. };
  646. const throttledHeightListener = _.throttle(heightListener, 500, {
  647. trailing: false,
  648. });
  649. // const goToRecharge = () => {
  650. // console.log("点击充值");
  651. // // http://39.101.133.168:8919/payment/recharge/index?
  652. // // url=http%3A%2F%2Flocalhost%3A8080%2FLiveActivity%2Fpck
  653. // // &platform=1
  654. // // &token=+S4h5QEE1hTIb4CxphrnbZi0+fEeMx8pywnIlrmTmo4QO6IolWnVWu5r+J4rKXMwK41UPfKqyIp+RvWmtM8
  655. // const userAgent = navigator.userAgent.toLowerCase();
  656. // const mobileKeywords = ["mobile", "android", "iphone", "ipad", "ipod"];
  657. // const isMobile = mobileKeywords.some((keyword) =>
  658. // userAgent.includes(keyword)
  659. // );
  660. // console.log(isMobile ? "手机" : "电脑");
  661. // const url = encodeURI("http://39.101.133.168:8857/aixiaocaishen/homePage");
  662. // console.log(url, "url");
  663. // const platform = isMobile ? 2 : 1;
  664. // const token = encodeURIComponent(localStorage.getItem("localToken"));
  665. // console.log(token, "token");
  666. // const rechargeUrl =
  667. // "http://39.101.133.168:8919/payment/recharge/index?" +
  668. // "url=" +
  669. // url +
  670. // "&platform=" +
  671. // platform +
  672. // "&token=" +
  673. // token;
  674. // console.log(rechargeUrl, "rechargeUrl");
  675. // window.location.href = rechargeUrl;
  676. // // window.open(rechargeUrl)
  677. // };
  678. const adjustFooterPosition = (height) => {
  679. const html = document.querySelector("html");
  680. const body = document.querySelector("body");
  681. const isAndroid = /Android/i.test(navigator.userAgent);
  682. if (isAndroid) {
  683. console.log("是安卓设备");
  684. console.log("window.visualViewport", window.visualViewport.height);
  685. const homePage = document.querySelector(".homepage");
  686. homePage.style.height = `${height}px`;
  687. // homePage.style.height = `460px`;
  688. html.scrollTop = 0;
  689. } else {
  690. console.log("非安卓设备");
  691. console.log("调整底部位置", height);
  692. const homePage = document.querySelector(".homepage");
  693. homePage.style.height = `${height}px`;
  694. html.scrollTop = 0;
  695. }
  696. setTimeout(() => {
  697. // 隐藏滚动条
  698. html.style.overflow = "hidden";
  699. body.style.overflow = "hidden";
  700. }, 200);
  701. };
  702. // 是否正在输入法组合
  703. const inputing = ref(false);
  704. const onFocus = function () {
  705. const visualViewport = window.visualViewport;
  706. // 获取可视区域高度
  707. setTimeout(() => {
  708. console.log("输入框聚焦");
  709. console.log(visualViewport.height, "visualViewport.height");
  710. const keyboardHeight = window.innerHeight - visualViewport.height;
  711. console.log(window.innerHeight, "window.innerHeight");
  712. console.log(keyboardHeight, "keyboardHeight");
  713. adjustFooterPosition(visualViewport.height);
  714. }, 200);
  715. };
  716. const onBlur = function () {
  717. inputing.value = false;
  718. const visualViewport = window.visualViewport;
  719. setTimeout(() => {
  720. console.log("输入框失焦");
  721. const keyboardHeight = window.innerHeight - visualViewport.height;
  722. console.log(window.innerHeight, "window.innerHeight");
  723. console.log(visualViewport.height, "visualViewport.height");
  724. console.log(keyboardHeight, "keyboardHeight");
  725. adjustFooterPosition(visualViewport.height);
  726. }, 200);
  727. };
  728. // window.addEventListener("resize", () => {
  729. // // 检测是否为iOS设备
  730. // const isIOS = /iPhone|iPad|iPod|ios/i.test(navigator.userAgent);
  731. // console.log("是否为iOS设备:", isIOS);
  732. // if (!isIOS) {
  733. // console.log("窗口大小变化");
  734. // const homePage = document.querySelector(".homepage");
  735. // homePage.style.height = `${window.innerHeight}px`;
  736. // }
  737. // });
  738. let touchmoveHandlerRef = null;
  739. const touchmoveHandler = (e) => {
  740. if (!dataStore.isFeedback) {
  741. if (historyRecordRef) {
  742. if (!historyRecordRef.value.isCollapsed) {
  743. return;
  744. }
  745. }
  746. // 判断触摸目标是否在当前活动页面的可滚动区域内
  747. const currentContainer = getCurrentScrollContainer();
  748. const isScrollableArea =
  749. currentContainer && currentContainer.contains(e.target);
  750. // 如果不在可滚动区域,则阻止滚动
  751. if (!isScrollableArea) {
  752. e.preventDefault();
  753. }
  754. }
  755. };
  756. const judgeDevice = async () => {
  757. // 延时300ms
  758. await new Promise((resolve) => setTimeout(resolve, 200));
  759. const userAgent = navigator.userAgent;
  760. isMobile.value =
  761. /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
  762. userAgent
  763. );
  764. console.log("当前设备为:", isMobile.value ? "移动端" : "PC端");
  765. };
  766. const throttledJudgeDevice = _.throttle(judgeDevice, 300, {
  767. trailing: false,
  768. });
  769. const expandHistory = () => {
  770. // if (activeTab.value == "AIchat" || activeTab.value == "AiEmotion") {
  771. // historyRecordRef.value.getHistoryList({
  772. // token: localStorage.getItem("localToken"),
  773. // model: activeTab.value == "AIchat" ? 1 : 2,
  774. // });
  775. // }
  776. if (
  777. historyRecordRef.value &&
  778. historyRecordRef.value.isCollapsed !== undefined
  779. ) {
  780. console.log("存在");
  781. historyRecordRef.value.isCollapsed = !historyRecordRef.value.isCollapsed;
  782. if (activeTab.value == "AIchat") {
  783. chatStore.aiChatCall = true;
  784. } else if (activeTab.value == "AiEmotion") {
  785. chatStore.aiEmotionCall = true;
  786. }
  787. }
  788. };
  789. const backToHome = () => {
  790. if (isMobile.value) {
  791. console.log("用户是移动端");
  792. // 调用原生方法跳转到首页
  793. uni.postMessage({
  794. data: {
  795. val: {
  796. name: "JWopenView",
  797. extra: {
  798. data: {
  799. type: 3,
  800. },
  801. },
  802. },
  803. },
  804. });
  805. } else {
  806. console.log("用户是pc端");
  807. const env = import.meta.env.VITE_ENV;
  808. console.log("当前的环境为:", env);
  809. if (env == "development" || env == "test") {
  810. window.parent.location.href =
  811. "http://121.89.234.155:8807/hljw/homepage?menu=999999991";
  812. } else {
  813. window.parent.postMessage(
  814. {
  815. type: "NAVIGATE_TO_HOMEPAGE",
  816. menu: "999999991",
  817. },
  818. "*"
  819. );
  820. }
  821. // window.parent.location.href = window.parent.document.referrer
  822. }
  823. };
  824. // 8.18金币兑换Token start
  825. const userInfo = ref({
  826. nickname: "",
  827. img: "",
  828. jwcode: "",
  829. });
  830. const changeRule = ref({
  831. gold: 1,
  832. token: 1,
  833. });
  834. const changeLevelList = ref([
  835. { position: 10, calculatedPosition: 10 },
  836. { position: 20, calculatedPosition: 20 },
  837. { position: 50, calculatedPosition: 50 },
  838. { position: 100, calculatedPosition: 100 },
  839. { position: 200, calculatedPosition: 200 },
  840. { position: 500, calculatedPosition: 500 },
  841. { position: 1000, calculatedPosition: 1000 },
  842. ]);
  843. const activeLevel = ref(
  844. changeLevelList.value[0] || { position: 10, calculatedPosition: 10 }
  845. );
  846. const gold = ref(90);
  847. // 点击剩余次数会弹出的弹窗
  848. // 新增一个 ref 来控制弹窗的显示与隐藏
  849. const dialogVisible = ref(false);
  850. const rechargeDialogVisible = ref(false);
  851. const confirmDialogVisible = ref(false);
  852. const changeSuccessDialogVisible = ref(false);
  853. // 图片加载错误处理
  854. const handleImageError = (event) => {
  855. console.error("图片加载失败:", event.target.src);
  856. // 可以设置默认图片或重试逻辑
  857. event.target.src =
  858. "https://cdn.legu168.com/jtzy/Product/pcjingwang/images/userimg.png";
  859. };
  860. // 获取次数
  861. const showCount = async () => {
  862. try {
  863. if (
  864. !dataStore.userInfo.img ||
  865. !dataStore.userInfo.nickname ||
  866. !dataStore.userInfo.jwcode
  867. ) {
  868. console.log("缺少用户信息,调用方法");
  869. await getUserInfo();
  870. }
  871. userInfo.value.nickname = dataStore.userInfo.nickname;
  872. userInfo.value.img = dataStore.userInfo.img;
  873. userInfo.value.jwcode = dataStore.userInfo.jwcode;
  874. console.log("userInfo", userInfo.value);
  875. const [res, res2] = await Promise.all([
  876. showExchangeAPI(),
  877. getGoldCoinAPI({
  878. token: String(localStorage.getItem("localToken")),
  879. }),
  880. ]);
  881. changeLevelList.value = res.data;
  882. activeLevel.value = changeLevelList.value[0];
  883. changeRule.value.token = res.data[0].ratio;
  884. gold.value = res2.data.total;
  885. // 显示弹窗
  886. dialogVisible.value = true;
  887. console.log("dialogVisible 的值:", dialogVisible.value); // 添加日志确认
  888. } catch (e) {
  889. console.error("获取兑换列表出错", e);
  890. }
  891. };
  892. const chooseLevel = (item) => {
  893. activeLevel.value = item;
  894. };
  895. const changeToken = () => {
  896. if (gold.value < activeLevel.value.position) {
  897. rechargeDialogVisible.value = true;
  898. return;
  899. } else {
  900. confirmDialogVisible.value = true;
  901. }
  902. };
  903. const goRecharge = () => {
  904. console.log("执行前往充值方法");
  905. sessionStorage.setItem("rechargeFlag", "1");
  906. sessionStorage.setItem("activeLevel", JSON.stringify(activeLevel.value));
  907. if (isMobile.value) {
  908. console.log("用户是移动端");
  909. uni.postMessage({
  910. data: {
  911. val: {
  912. name: "JWopenView",
  913. extra: {
  914. data: {
  915. type: 4,
  916. },
  917. },
  918. },
  919. },
  920. });
  921. } else {
  922. console.log("用户是pc端");
  923. const env = import.meta.env.VITE_ENV;
  924. console.log("当前的环境为:", env);
  925. if (env == "development" || env == "test") {
  926. window.parent.location.href =
  927. "http://121.89.234.155:8807/user/myGold?token=" +
  928. encodeURIComponent(localStorage.getItem("localToken")) +
  929. "&where=xiaocaishen&successUrl=https://hwjb.homilychart.com/aixiaocaishen/homePage";
  930. // "&where=xiaocaishen&successUrl=http://192.168.1.5:3000/aixiaocaishen/homePage";
  931. } else {
  932. window.parent.location.href =
  933. "https://web.homilychart.com/user/myGold?token=" +
  934. encodeURIComponent(localStorage.getItem("localToken")) +
  935. "&where=xiaocaishen&successUrl=https://mp.homilychart.com/aixiaocaishen/homePage";
  936. }
  937. // window.parent.location.href = window.parent.document.referrer
  938. }
  939. };
  940. const goChange = async () => {
  941. try {
  942. await exchangeAPI({
  943. token: String(localStorage.getItem("localToken")),
  944. num: activeLevel.value.position,
  945. });
  946. confirmDialogVisible.value = false;
  947. dialogVisible.value = false;
  948. changeSuccessDialogVisible.value = true;
  949. setTimeout(() => {
  950. changeSuccessDialogVisible.value = false;
  951. }, 2000);
  952. // 刷新次数
  953. await chatStore.getUserCount();
  954. } catch (e) {
  955. console.error("兑换失败", e);
  956. }
  957. };
  958. // 8.18金币兑换Token end
  959. onMounted(async () => {
  960. throttledJudgeDevice();
  961. // 禁用全局触摸滚动
  962. touchmoveHandlerRef = touchmoveHandler;
  963. document.addEventListener("touchmove", touchmoveHandlerRef, {
  964. passive: false,
  965. });
  966. setHeight(document.getElementById("testId")); // 给父组件发送窗口高度
  967. // 获取次数
  968. await chatStore.getUserCount();
  969. // 滚动到底部
  970. throttledSmoothScrollToBottom();
  971. // 监听页面高度
  972. throttledHeightListener();
  973. // 添加输入框焦点处理
  974. // handleInputFocus();
  975. // 初始化视口高度变量
  976. // updateAppHeight();
  977. // 添加原生事件监听器
  978. window.addEventListener("resize", throttledJudgeDevice);
  979. window.receiveUniAppMessage = async function (messageData) {
  980. console.log("收到 uni-app 消息:", messageData);
  981. // 根据消息类型进行不同处理
  982. switch (messageData.type) {
  983. case "paymentSuccess":
  984. // 处理支付成功消息
  985. const [res1, res2] = await Promise.all([
  986. godExchangeAPI({ state: 1 }),
  987. getGoldCoinAPI({ token: String(localStorage.getItem("localToken")) }),
  988. ]);
  989. gold.value = res2.data.total;
  990. rechargeDialogVisible.value = false;
  991. break;
  992. default:
  993. console.log("未知消息类型:", messageData.type);
  994. }
  995. };
  996. if (
  997. sessionStorage.getItem("rechargeFlag") == "1" &&
  998. getQueryVariable("successType") == "success"
  999. ) {
  1000. await godExchangeAPI({ state: 1 });
  1001. await showCount();
  1002. activeLevel.value =
  1003. JSON.parse(sessionStorage.getItem("activeLevel")) ||
  1004. changeLevelList.value[0];
  1005. console.log("activeLevel", activeLevel.value);
  1006. sessionStorage.removeItem("activeLevel");
  1007. sessionStorage.setItem("rechargeFlag", "0");
  1008. }
  1009. });
  1010. onUnmounted(() => {
  1011. window.removeEventListener("resize", throttledJudgeDevice);
  1012. if (touchmoveHandlerRef) {
  1013. console.log("卸载touchmoveHandlerRef组件");
  1014. document.removeEventListener("touchmove", touchmoveHandlerRef);
  1015. }
  1016. // 清理AiEmotion页面的高度监听器
  1017. stopAiEmotionHeightObserver();
  1018. delete window.receiveUniAppMessage;
  1019. // 清理图表交互相关的定时器和全局函数
  1020. if (chartInteractionTimer.value) {
  1021. clearTimeout(chartInteractionTimer.value);
  1022. }
  1023. if (window.handleChartInteractionStart) {
  1024. delete window.handleChartInteractionStart;
  1025. }
  1026. if (window.handleChartInteractionEnd) {
  1027. delete window.handleChartInteractionEnd;
  1028. }
  1029. });
  1030. </script>
  1031. <template>
  1032. <div class="homepage" id="testId">
  1033. <!-- 历史记录组件 -->
  1034. <HistoryRecord
  1035. ref="historyRecordRef"
  1036. :current-type="activeTab"
  1037. @selectRecord="handleHistorySelect"
  1038. :isMobile="isMobile"
  1039. @showAnnouncement="showAnnouncement"
  1040. @showFeedback="showFeedback"
  1041. />
  1042. <div
  1043. v-if="isMobile && !historyRecordRef?.isCollapsed"
  1044. class="zhezhao"
  1045. @click="expandHistory"
  1046. ></div>
  1047. <el-container
  1048. v-if="!dataStore.isFeedback"
  1049. class="main-container"
  1050. :class="{
  1051. collapsed: historyRecordRef?.isCollapsed && !isMobile,
  1052. unCollapsed: !historyRecordRef?.isCollapsed && !isMobile,
  1053. }"
  1054. >
  1055. <!-- AI小财神头部 logo 次数 公告 -->
  1056. <el-header class="homepage-head">
  1057. <!-- logo -->
  1058. <div class="homepage-logo" v-if="isMobile">
  1059. <img
  1060. class="expand"
  1061. @click="expandHistory"
  1062. src="https://d31zlh4on95l9h.cloudfront.net/images/37fe3d79a8a700f6c674c9f0e7af066b.png"
  1063. alt="icon"
  1064. />
  1065. <img :src="logo" alt="图片加载失败" class="logo1" />
  1066. <!-- <img :src="madeInHL" alt="图片加载失败" class="logo2" /> -->
  1067. </div>
  1068. <div class="homepage-right-group" v-if="isMobile">
  1069. <div class="count-badge" @click="showCount">
  1070. <img
  1071. src="https://d31zlh4on95l9h.cloudfront.net/images/74e20c65c9ef2526477c63ad68698a50.png"
  1072. class="action-btn"
  1073. />
  1074. <div class="count-number">{{ UserCount }}</div>
  1075. <div class="clickGetCount">点击获取Token</div>
  1076. </div>
  1077. <div class="backToHomeBtn" @click="backToHome()">
  1078. <img
  1079. src="https://d31zlh4on95l9h.cloudfront.net/images/9cbc5b2eb2327bd04d015c19d8c3f1f9.png"
  1080. alt="返回首页"
  1081. class="backImg"
  1082. />
  1083. <div class="backContent">返回首页</div>
  1084. </div>
  1085. <!-- <img
  1086. :src="announcementBtn"
  1087. class="announcement-btn action-btn"
  1088. @click="showAnnouncement"
  1089. />
  1090. <img
  1091. :src="feedbackBtn"
  1092. class="announcement-btn action-btn"
  1093. @click="showFeedback"
  1094. /> -->
  1095. </div>
  1096. </el-header>
  1097. <!-- 主体部分小人 问题轮询图 对话内容 -->
  1098. <el-main class="homepage-body">
  1099. <div class="main-wrapper">
  1100. <section class="tab-section">
  1101. <div
  1102. class="tab-container"
  1103. :class="{
  1104. pcTabContainer: !isMobile,
  1105. }"
  1106. >
  1107. <div
  1108. v-for="(tab, index) in tabs"
  1109. :key="tab.name"
  1110. @click="setActiveTab(tab.name, index)"
  1111. :class="[
  1112. 'tab-item',
  1113. { active: activeIndex === index && !isAnnouncementVisible },
  1114. ]"
  1115. >
  1116. <span>{{ tab.label }}</span>
  1117. </div>
  1118. <div v-if="!isMobile" class="pc-count-badge">
  1119. <div class="pc-countBtn" @click="showCount">
  1120. <div class="pc-action-btn">
  1121. <div class="pc-count-number">{{ UserCount }}</div>
  1122. </div>
  1123. <div class="pc-clickGetCount">点击获取Token</div>
  1124. </div>
  1125. <div class="pc-backToHomeBtn" @click="backToHome()">
  1126. <img
  1127. src="https://d31zlh4on95l9h.cloudfront.net/images/9cbc5b2eb2327bd04d015c19d8c3f1f9.png"
  1128. alt="返回首页"
  1129. class="pc-backImg"
  1130. />
  1131. <div class="pc-backContent">返回首页</div>
  1132. </div>
  1133. </div>
  1134. </div>
  1135. </section>
  1136. <!-- AIchat页面的独立滚动容器 -->
  1137. <div
  1138. v-show="activeTab === 'AIchat'"
  1139. class="tab-content"
  1140. :class="{
  1141. pcTabContent: !isMobile,
  1142. }"
  1143. ref="tabContentAIchat"
  1144. >
  1145. <component
  1146. v-if="activeTab === 'AIchat'"
  1147. :is="activeComponent"
  1148. :messages="messages"
  1149. @updateMessage="updateMessage"
  1150. @sendMessage="sendMessage"
  1151. @ensureAIchat="ensureAIchat"
  1152. @enableInput="enableInput"
  1153. />
  1154. </div>
  1155. <!-- AiEmotion页面的独立滚动容器 -->
  1156. <div
  1157. v-show="activeTab === 'AiEmotion'"
  1158. class="tab-content"
  1159. :class="{
  1160. pcTabContent: !isMobile,
  1161. }"
  1162. ref="tabContentAiEmotion"
  1163. >
  1164. <component
  1165. v-if="activeTab === 'AiEmotion'"
  1166. :is="activeComponent"
  1167. :messages="messages"
  1168. @updateMessage="updateMessage"
  1169. @sendMessage="sendMessage"
  1170. @ensureAIchat="ensureAIchat"
  1171. @enableInput="enableInput"
  1172. @scrollToBottom="handleAiEmotionScrollToBottom"
  1173. ref="aiEmotionRef"
  1174. />
  1175. </div>
  1176. </div>
  1177. </el-main>
  1178. <!-- 尾部 问题输入框 深度思考 多语言 语音播报 -->
  1179. <el-footer
  1180. class="homepage-footer"
  1181. :class="{
  1182. pcFooter: !isMobile,
  1183. }"
  1184. id="input"
  1185. >
  1186. <!-- 第一行按钮 -->
  1187. <div class="footer-first-line">
  1188. <div class="left-group">
  1189. <!-- <img v-if="isThinking" :src="thinkActive" @click="toggleThink" class="action-btn" />
  1190. <img v-else :src="thinkNoActive" @click="toggleThink" class="action-btn" />
  1191. <img :src="languageBtn" @click="changeLanguage" class="action-btn" /> -->
  1192. <!-- 夺宝奇兵大模型按钮 -->
  1193. <img
  1194. :src="activeTab === 'AIchat' ? dbqbButton01 : dbqbButton02"
  1195. @click="setActiveTab('AIchat', 0)"
  1196. class="action-btn model-btn"
  1197. alt="夺宝奇兵大模型"
  1198. />
  1199. <!-- AI情绪大模型按钮 -->
  1200. <img
  1201. :src="
  1202. activeTab === 'AiEmotion' ? emotionButton01 : emotionButton02
  1203. "
  1204. @click="setActiveTab('AiEmotion', 1)"
  1205. class="action-btn model-btn"
  1206. alt="AI情绪大模型"
  1207. />
  1208. <!-- <img v-if="
  1209. getCurrentAudioStore().isVoiceEnabled &&
  1210. getCurrentAudioStore().isPlaying
  1211. " :src="voice" @click="toggleVoice" class="action-btn" style="animation: pulse 1.5s infinite" />
  1212. <img v-else-if="
  1213. getCurrentAudioStore().isVoiceEnabled &&
  1214. !getCurrentAudioStore().isPlaying
  1215. " :src="voiceNoActive" @click="toggleVoice" class="action-btn" />
  1216. <img v-else :src="voiceNoActive" @click="toggleVoice" class="action-btn" /> -->
  1217. </div>
  1218. </div>
  1219. <!-- 第二行输入框 -->
  1220. <div class="footer-second-line">
  1221. <!-- <img :src="msgBtn" class="msg-icon" /> -->
  1222. <div class="input-container">
  1223. <el-input
  1224. type="textarea"
  1225. v-model="message"
  1226. @focus="onFocus"
  1227. @blur="onBlur"
  1228. :autosize="{ minRows: 1, maxRows: 4 }"
  1229. class="msg-input"
  1230. @keydown.enter.exact.prevent="
  1231. isLoading || isInputDisabled ? null : sendMessage()
  1232. "
  1233. :disabled="isInputDisabled"
  1234. resize="none"
  1235. :class="{ input: !message && !inputing }"
  1236. @compositionstart="inputing = true"
  1237. @compositionend="inputing = false"
  1238. >
  1239. </el-input>
  1240. <img
  1241. :src="
  1242. isInputDisabled
  1243. ? 'https://d31zlh4on95l9h.cloudfront.net/images/aa192bcbc1682c97e1bc6fb422f2afff.png'
  1244. : 'https://d31zlh4on95l9h.cloudfront.net/images/e6ec2ae238ced85b74e0912e988f243e.png'
  1245. "
  1246. @click="sendMessage"
  1247. class="action-btn send-btn-inner"
  1248. :style="{
  1249. opacity: isInputDisabled ? 0.5 : 1,
  1250. cursor: isInputDisabled ? 'not-allowed' : 'pointer',
  1251. }"
  1252. />
  1253. </div>
  1254. </div>
  1255. </el-footer>
  1256. </el-container>
  1257. <el-container
  1258. v-else
  1259. class="main-container"
  1260. :class="{
  1261. collapsed: historyRecordRef?.isCollapsed && !isMobile,
  1262. unCollapsed: !historyRecordRef?.isCollapsed && !isMobile,
  1263. }"
  1264. >
  1265. <el-header class="homepage-head">
  1266. <!-- logo -->
  1267. <!-- <div class="homepage-logo">
  1268. <img :src="logo" alt="图片加载失败" class="logo1" />
  1269. <img :src="madeInHL" alt="图片加载失败" class="logo2" />
  1270. </div> -->
  1271. <div class="homepage-right-group">
  1272. <div class="count-badge" @click="showCount">
  1273. <img
  1274. src="https://d31zlh4on95l9h.cloudfront.net/images/74e20c65c9ef2526477c63ad68698a50.png"
  1275. class="action-btn"
  1276. />
  1277. <div class="count-number">{{ UserCount }}</div>
  1278. <div class="clickGetCount">点击获取Token</div>
  1279. </div>
  1280. <div class="backToHomeBtn" @click="backToHome()">
  1281. <img
  1282. src="https://d31zlh4on95l9h.cloudfront.net/images/9cbc5b2eb2327bd04d015c19d8c3f1f9.png"
  1283. alt="返回首页"
  1284. class="backImg"
  1285. />
  1286. <div class="backContent">返回首页</div>
  1287. </div>
  1288. <!-- <img
  1289. :src="announcementBtn"
  1290. class="announcement-btn action-btn"
  1291. @click="showAnnouncement"
  1292. />
  1293. <img
  1294. :src="feedbackBtn"
  1295. class="announcement-btn action-btn"
  1296. @click="showFeedback"
  1297. /> -->
  1298. </div>
  1299. </el-header>
  1300. <!-- 主体部分小人 问题轮询图 对话内容 -->
  1301. <el-main class="homepage-body">
  1302. <component :is="activeTwoTab" />
  1303. </el-main>
  1304. </el-container>
  1305. <!-- 弹窗 -->
  1306. <!-- 新增弹窗组件 -->
  1307. <el-dialog v-model="dialogVisible" :width="isMobile ? '80%' : '48%'">
  1308. <!-- 中间内容部分 -->
  1309. <div class="changeMsg">
  1310. <div class="changeInfo">
  1311. <div class="changeImg">
  1312. <img
  1313. :src="userInfo.img"
  1314. alt="头像"
  1315. class="changeImgClass"
  1316. @error="handleImageError"
  1317. />
  1318. </div>
  1319. <div class="changeContent">
  1320. <div class="changeUsername">{{ userInfo.nickname }}</div>
  1321. <div class="changeJwcode">精网号{{ userInfo.jwcode }}</div>
  1322. </div>
  1323. </div>
  1324. <div class="changeRule">
  1325. 兑换规则{{ changeRule.gold }}金币={{ changeRule.token }}Token
  1326. </div>
  1327. </div>
  1328. <div class="changeLevel">
  1329. <div class="changeLevelTitle">兑换Token</div>
  1330. <div class="changeLevelContent">
  1331. <div
  1332. class="changeLevelItems"
  1333. v-for="item in changeLevelList"
  1334. :key="item"
  1335. :class="{
  1336. changeLevelItemsActive: item.position == activeLevel.position,
  1337. }"
  1338. @click="chooseLevel(item)"
  1339. >
  1340. <div class="changeLevelItem">
  1341. <div class="changeLevelItemToken">
  1342. <img
  1343. src="https://d31zlh4on95l9h.cloudfront.net/images/403ef762dd2f335df3b0c9e3fe488375.png"
  1344. alt="token"
  1345. class="changeLevelItemTokenImg"
  1346. />
  1347. {{ item.calculatedPosition }}
  1348. </div>
  1349. <div class="changeLevelItemToken">{{ item.position }} 金币</div>
  1350. </div>
  1351. </div>
  1352. </div>
  1353. </div>
  1354. <div class="changeNow">
  1355. 应付金额
  1356. <div class="changePay">{{ activeLevel.position }}</div>
  1357. (金币余额{{ gold }})
  1358. </div>
  1359. <div class="changeBtn" @click="changeToken">立即兑换</div>
  1360. </el-dialog>
  1361. <el-dialog
  1362. v-model="rechargeDialogVisible"
  1363. :width="isMobile ? '60%' : '30%'"
  1364. :show-close="false"
  1365. >
  1366. <div class="rechargeDialogTitle">温馨提示</div>
  1367. <div class="rechargeDialogContent">
  1368. 尊敬的用户您好您当前的金币余额不足无法进行兑换可充值金币后进行兑换点击下方的前往充值可进行充值
  1369. </div>
  1370. <div class="rechargeDialogBtnGroup">
  1371. <div class="recharge" @click="goRecharge">前往充值</div>
  1372. <div
  1373. class="rechargeDialogCancel"
  1374. @click="rechargeDialogVisible = false"
  1375. >
  1376. 取消
  1377. </div>
  1378. </div>
  1379. </el-dialog>
  1380. <el-dialog
  1381. v-model="confirmDialogVisible"
  1382. :width="isMobile ? '60%' : '30%'"
  1383. :show-close="false"
  1384. >
  1385. <div class="confirmDialogTitle">兑换</div>
  1386. <div class="confirmDialogContent">
  1387. 尊敬的用户您好您确认要花费{{ activeLevel.position }}金币兑换{{
  1388. activeLevel.calculatedPosition
  1389. }}Token吗
  1390. </div>
  1391. <div class="confirmDialogBtnGroup">
  1392. <div class="confirmDialogConfirm" @click="goChange()">确认</div>
  1393. <div class="confirmDialogCancel" @click="confirmDialogVisible = false">
  1394. 取消
  1395. </div>
  1396. </div>
  1397. </el-dialog>
  1398. <el-dialog
  1399. v-model="changeSuccessDialogVisible"
  1400. :width="isMobile ? '60%' : '30%'"
  1401. :show-close="false"
  1402. class="changeSuccessDialog"
  1403. >
  1404. <div class="changeSuccessDialogTitle">兑换成功</div>
  1405. <div class="changeSuccessDialogContent">
  1406. 尊敬的用户恭喜您成功兑换{{ activeLevel.calculatedPosition }} Token
  1407. </div>
  1408. </el-dialog>
  1409. </div>
  1410. </template>
  1411. <style scoped>
  1412. /* 标签栏 */
  1413. .tab-container {
  1414. display: flex;
  1415. margin-bottom: 10px;
  1416. height: 100%;
  1417. position: relative;
  1418. justify-content: center;
  1419. align-items: center;
  1420. gap: 25vw;
  1421. /* 新增右对齐 */
  1422. }
  1423. .pcTabContainer {
  1424. }
  1425. .tab-item {
  1426. cursor: pointer;
  1427. padding: 8px 12px;
  1428. font-size: clamp(18px, 3vw, 20px);
  1429. /* color: #999; */
  1430. color: #fff;
  1431. transition: all 0.3s;
  1432. border-bottom: 2px solid transparent;
  1433. font-weight: bold;
  1434. }
  1435. .tab-item.active {
  1436. /* color: #000;
  1437. border-color: #000; */
  1438. background: linear-gradient(0deg, #ffffff, #fec13e);
  1439. -webkit-background-clip: text;
  1440. background-clip: text;
  1441. -webkit-text-fill-color: transparent;
  1442. color: transparent;
  1443. border-color: #fec13e;
  1444. }
  1445. .tab-item:not(.active):hover {
  1446. color: #999999;
  1447. }
  1448. .tab-content {
  1449. overflow-y: auto;
  1450. overflow-x: hidden;
  1451. scroll-behavior: smooth;
  1452. height: 100%;
  1453. /* 添加平滑滚动效果 */
  1454. }
  1455. .pcTabContent {
  1456. padding: 0 6%;
  1457. }
  1458. @media (max-width: 768px) {
  1459. .tab-container {
  1460. gap: 15px;
  1461. padding: 0 10px;
  1462. }
  1463. .tab-item {
  1464. font-size: clamp(14px, 3vw, 16px);
  1465. padding: 6px 10px;
  1466. }
  1467. }
  1468. </style>
  1469. <style scoped>
  1470. html {
  1471. height: 100dvh;
  1472. overflow: hidden !important;
  1473. position: fixed;
  1474. margin: 0;
  1475. padding: 0;
  1476. -webkit-overflow-scrolling: auto;
  1477. /* 禁用 iOS 弹性滚动 */
  1478. }
  1479. body {
  1480. height: 100dvh;
  1481. overflow: clip;
  1482. margin: 0;
  1483. padding: 0;
  1484. -webkit-overflow-scrolling: auto;
  1485. /* 禁用 iOS 弹性滚动 */
  1486. position: fixed;
  1487. }
  1488. #app {
  1489. overflow: hidden;
  1490. height: 100%;
  1491. margin: 0;
  1492. padding: 0;
  1493. }
  1494. .homepage {
  1495. /* height: var(--app-height, 100vh); */
  1496. height: var(--app-height, 100vh);
  1497. margin: 0 auto;
  1498. background-image: url("https://d31zlh4on95l9h.cloudfront.net/images/2dc3c13a74100b906e809d26b66db211.png");
  1499. background-size: 100% 100%;
  1500. background-repeat: no-repeat;
  1501. background-position: center;
  1502. display: flex;
  1503. flex-direction: row;
  1504. /* 改为水平布局 */
  1505. overflow: hidden;
  1506. position: fixed;
  1507. top: 0;
  1508. left: 0;
  1509. right: 0;
  1510. bottom: 0;
  1511. width: 100%;
  1512. /* -webkit-overflow-scrolling: touch; */
  1513. }
  1514. .main-container {
  1515. flex: 1;
  1516. transition: margin-left 0.3s ease;
  1517. display: flex;
  1518. flex-direction: column;
  1519. overflow: hidden;
  1520. }
  1521. .main-container.unCollapsed {
  1522. margin-left: 300px; /* 为历史记录组件留出空间 */
  1523. }
  1524. /* 当历史记录组件折叠时调整主容器边距 */
  1525. .main-container.collapsed {
  1526. margin-left: 3%;
  1527. }
  1528. .zhezhao {
  1529. width: 100%;
  1530. height: 100%;
  1531. background-color: rgba(0, 0, 0, 0.5);
  1532. z-index: 100;
  1533. position: fixed;
  1534. }
  1535. /* 移动端适配 */
  1536. @media (max-width: 768px) {
  1537. .homepage {
  1538. background-image: url("https://d31zlh4on95l9h.cloudfront.net/images/90d31d7052e729c63acb9e2cb94d1307.png");
  1539. }
  1540. .main-container {
  1541. /* margin-left: 280px; */
  1542. }
  1543. .main-container.unCollapsed {
  1544. margin-left: 280px;
  1545. }
  1546. .main-container.collapsed {
  1547. margin-left: 40px;
  1548. }
  1549. }
  1550. .homepage .el-container {
  1551. height: 100%;
  1552. flex-direction: column;
  1553. display: flex;
  1554. width: 100%;
  1555. overflow: hidden;
  1556. /* 防止容器滚动 */
  1557. }
  1558. .el-container .el-header {
  1559. flex-shrink: 0;
  1560. /* 防止头部压缩 */
  1561. height: auto;
  1562. min-height: 60px;
  1563. padding: 5px 0;
  1564. position: sticky;
  1565. top: 0;
  1566. z-index: 10;
  1567. /* background-color: rgba(255, 255, 255, 0.9); */
  1568. }
  1569. .el-container .el-main {
  1570. flex: 1;
  1571. /* 自动占据剩余空间 */
  1572. overflow: hidden;
  1573. /* 主容器不滚动 */
  1574. display: flex;
  1575. flex-direction: column;
  1576. min-height: 0;
  1577. /* 允许内容区域缩小 */
  1578. position: relative;
  1579. height: auto;
  1580. }
  1581. .el-container .el-footer {
  1582. flex-shrink: 0;
  1583. height: auto;
  1584. min-height: 70px;
  1585. position: sticky;
  1586. bottom: 0;
  1587. z-index: 20;
  1588. background-color: rgba(211, 24, 24, 0);
  1589. box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  1590. -webkit-transform: translateZ(0);
  1591. transform: translateZ(0);
  1592. padding-bottom: env(safe-area-inset-bottom, 0);
  1593. /* 适配iPhone X及以上的底部安全区域 */
  1594. }
  1595. .homepage-head {
  1596. padding: 0px;
  1597. display: flex;
  1598. position: relative;
  1599. justify-content: space-between;
  1600. width: 100%;
  1601. }
  1602. .homepage-right-group {
  1603. display: flex;
  1604. gap: 8px;
  1605. align-items: center;
  1606. margin-left: auto;
  1607. margin-right: 20px;
  1608. }
  1609. .homepage-right-group .action-btn {
  1610. height: 40px;
  1611. }
  1612. .count-badge {
  1613. position: relative;
  1614. cursor: pointer;
  1615. }
  1616. .count-badge:hover {
  1617. transform: scale(1.05);
  1618. }
  1619. .count-number {
  1620. position: absolute;
  1621. top: 16px;
  1622. right: 0px;
  1623. width: 68%;
  1624. text-align: center;
  1625. color: #6a00ff;
  1626. font-size: 14px;
  1627. font-weight: bold;
  1628. }
  1629. .clickGetCount {
  1630. width: 100%;
  1631. text-align: center;
  1632. color: white;
  1633. font-size: 12px;
  1634. }
  1635. .backToHomeBtn {
  1636. display: flex;
  1637. flex-direction: column;
  1638. justify-content: center;
  1639. align-items: center;
  1640. cursor: pointer;
  1641. }
  1642. .backToHomeBtn:hover {
  1643. transform: scale(1.05);
  1644. }
  1645. .backImg {
  1646. width: 60%;
  1647. height: auto;
  1648. }
  1649. .backContent {
  1650. width: 100%;
  1651. text-align: center;
  1652. color: white;
  1653. font-size: 12px;
  1654. white-space: nowrap;
  1655. }
  1656. .pc-count-badge {
  1657. width: 200px;
  1658. height: 100%;
  1659. position: absolute;
  1660. right: 20px;
  1661. display: flex;
  1662. }
  1663. .pc-countBtn {
  1664. width: 65%;
  1665. height: 100%;
  1666. position: relative;
  1667. cursor: pointer;
  1668. }
  1669. .pc-countBtn:hover {
  1670. transform: scale(1.05);
  1671. }
  1672. .pc-action-btn {
  1673. width: 100%;
  1674. height: 70%;
  1675. background-image: url("https://d31zlh4on95l9h.cloudfront.net/images/74e20c65c9ef2526477c63ad68698a50.png");
  1676. background-repeat: no-repeat;
  1677. background-size: 100% 100%;
  1678. }
  1679. .pc-count-number {
  1680. position: absolute;
  1681. top: 15px;
  1682. right: 4px;
  1683. width: 68%;
  1684. text-align: center;
  1685. color: #6a00ff;
  1686. font-size: 15px;
  1687. font-weight: bold;
  1688. }
  1689. .pc-clickGetCount {
  1690. width: 100%;
  1691. text-align: center;
  1692. color: white;
  1693. font-size: 12px;
  1694. }
  1695. .pc-backToHomeBtn {
  1696. width: 35%;
  1697. height: 100%;
  1698. display: flex;
  1699. flex-direction: column;
  1700. align-items: center;
  1701. cursor: pointer;
  1702. }
  1703. .pc-backImg {
  1704. width: auto;
  1705. height: 70%;
  1706. }
  1707. .pc-backContent {
  1708. width: 100%;
  1709. text-align: center;
  1710. color: white;
  1711. font-size: 12px;
  1712. }
  1713. .pc-backToHomeBtn:hover {
  1714. transform: scale(1.05);
  1715. }
  1716. .homepage-right-group .announcement-btn {
  1717. cursor: pointer;
  1718. transition: transform 0.3s;
  1719. }
  1720. .homepage-right-group .announcement-btn:hover {
  1721. transform: scale(1.3);
  1722. }
  1723. .homepage-body {
  1724. padding: 0px;
  1725. display: flex;
  1726. flex-direction: column;
  1727. flex: 1;
  1728. min-height: 0;
  1729. /* 允许内容区域缩小 */
  1730. overflow: hidden;
  1731. }
  1732. .main-wrapper {
  1733. height: 100%;
  1734. display: flex;
  1735. flex-direction: column;
  1736. flex: 1;
  1737. min-height: 0;
  1738. /* 允许内容区域缩小 */
  1739. }
  1740. .tab-section {
  1741. flex-shrink: 0;
  1742. /* 禁止伸缩 */
  1743. }
  1744. .tab-content {
  1745. flex: 1;
  1746. overflow-y: auto;
  1747. min-height: 0;
  1748. /* 关键:允许内容收缩 */
  1749. }
  1750. .homepage-logo {
  1751. height: 100%;
  1752. width: fit-content;
  1753. display: flex;
  1754. /* flex-direction: column; */
  1755. align-items: center;
  1756. justify-content: center;
  1757. margin-left: 20px;
  1758. margin-right: auto;
  1759. position: relative;
  1760. gap: 10px;
  1761. }
  1762. .expand {
  1763. font-size: 2.5rem;
  1764. cursor: pointer;
  1765. color: white;
  1766. }
  1767. .logo1 {
  1768. width: 110px;
  1769. height: auto;
  1770. margin-bottom: 8px;
  1771. }
  1772. .logo2 {
  1773. width: 80px;
  1774. height: auto;
  1775. }
  1776. /* 尾部 */
  1777. .homepage-footer {
  1778. display: flex;
  1779. flex-direction: column;
  1780. gap: 5px;
  1781. flex-shrink: 0;
  1782. /* width: 100%; */
  1783. background-color: #fff;
  1784. }
  1785. .pcFooter {
  1786. margin: 0 6% 4%;
  1787. }
  1788. .footer-first-line {
  1789. display: flex;
  1790. justify-content: space-between;
  1791. align-items: center;
  1792. padding: 5px 15px;
  1793. flex-shrink: 0;
  1794. }
  1795. .left-group {
  1796. display: flex;
  1797. gap: 15px;
  1798. }
  1799. .action-btn {
  1800. cursor: pointer;
  1801. transition: transform 0.2s;
  1802. height: 28px;
  1803. }
  1804. .model-btn {
  1805. height: 32px;
  1806. transition: all 0.3s ease;
  1807. }
  1808. .model-btn:hover {
  1809. transform: scale(1.1);
  1810. }
  1811. .send-btn {
  1812. margin-left: 10px;
  1813. height: 33px !important;
  1814. width: auto;
  1815. /* margin-right: 5px; */
  1816. }
  1817. .input-container {
  1818. position: relative;
  1819. width: 100%;
  1820. }
  1821. .send-btn-inner {
  1822. position: absolute;
  1823. right: 10px;
  1824. top: 50%;
  1825. transform: translateY(-50%);
  1826. height: 28px !important;
  1827. width: auto;
  1828. z-index: 10;
  1829. transition: all 0.3s ease;
  1830. }
  1831. .send-btn-inner:hover {
  1832. transform: translateY(-50%) scale(1.1);
  1833. }
  1834. /* 音频播放动画 */
  1835. @keyframes pulse {
  1836. 0% {
  1837. transform: scale(1);
  1838. }
  1839. 50% {
  1840. transform: scale(1.1);
  1841. }
  1842. 100% {
  1843. transform: scale(1);
  1844. }
  1845. }
  1846. .footer-second-line {
  1847. position: relative;
  1848. display: flex;
  1849. align-items: center;
  1850. padding: 5px 15px 10px;
  1851. flex-shrink: 0;
  1852. }
  1853. .msg-icon {
  1854. position: absolute;
  1855. left: 25px;
  1856. top: 50%;
  1857. transform: translateY(-50%);
  1858. width: 24px;
  1859. z-index: 999;
  1860. }
  1861. .msg-input:deep(.el-textarea__inner) {
  1862. border: none !important;
  1863. box-shadow: none !important;
  1864. overflow-y: auto !important;
  1865. transition: all 0.2s ease-out;
  1866. resize: none !important;
  1867. line-height: 1.5 !important;
  1868. max-height: 100px !important;
  1869. padding-right: 45px !important;
  1870. }
  1871. .msg-input {
  1872. min-height: 34px;
  1873. width: 100%;
  1874. border-radius: 5px;
  1875. font-size: 16px;
  1876. transition: all 0.3s ease-out;
  1877. overflow-y: hidden;
  1878. box-shadow: 0 4px 12px rgba(89, 24, 241, 0.3);
  1879. background: #fff;
  1880. z-index: 5;
  1881. /* 添加iOS设备特殊处理 */
  1882. -webkit-appearance: none;
  1883. appearance: none;
  1884. }
  1885. .msg-input:focus {
  1886. outline: none;
  1887. }
  1888. .input::before {
  1889. content: "请输入股票名称或股票代码...";
  1890. position: absolute;
  1891. left: 11px;
  1892. top: 5px;
  1893. color: var(--el-text-color-secondary);
  1894. pointer-events: none;
  1895. white-space: nowrap;
  1896. overflow-x: hidden;
  1897. text-overflow: ellipsis;
  1898. width: 80%;
  1899. z-index: 6;
  1900. }
  1901. .changeMsg {
  1902. display: flex;
  1903. width: 100%;
  1904. margin-bottom: 30px;
  1905. flex-wrap: wrap;
  1906. gap: 20px;
  1907. }
  1908. .changeInfo {
  1909. display: flex;
  1910. background-color: #f8f8f8;
  1911. border-radius: 5px;
  1912. padding: 10px 20px;
  1913. /* width: 40%; */
  1914. white-space: nowrap;
  1915. }
  1916. .changeImg {
  1917. height: 100%;
  1918. display: flex;
  1919. justify-content: center;
  1920. align-items: center;
  1921. margin-right: 10px;
  1922. }
  1923. .changeImgClass {
  1924. width: 50px;
  1925. height: auto;
  1926. }
  1927. .changeContent {
  1928. display: flex;
  1929. flex-direction: column;
  1930. justify-content: center;
  1931. font-weight: bold;
  1932. }
  1933. .changeRule {
  1934. display: flex;
  1935. background-color: #f8f8f8;
  1936. border-radius: 5px;
  1937. text-align: center;
  1938. align-items: center;
  1939. justify-content: center;
  1940. color: #4e86fe;
  1941. white-space: nowrap;
  1942. padding: 5px 20px;
  1943. min-width: 40%;
  1944. }
  1945. .changeLevel {
  1946. display: flex;
  1947. flex-direction: column;
  1948. }
  1949. .changeLevelTitle {
  1950. font-weight: bold;
  1951. margin-bottom: 10px;
  1952. }
  1953. .changeLevelContent {
  1954. display: flex;
  1955. flex-wrap: wrap;
  1956. gap: 15px;
  1957. margin-bottom: 10px;
  1958. }
  1959. .changeLevelItems {
  1960. display: flex;
  1961. background-color: #f8f8f8;
  1962. width: 20%;
  1963. min-width: 70px;
  1964. max-width: 150px;
  1965. justify-content: center;
  1966. align-items: center;
  1967. flex-direction: column;
  1968. border-radius: 10px;
  1969. padding: 5px;
  1970. cursor: pointer;
  1971. }
  1972. .changeLevelItems:hover {
  1973. background-color: #ecf2ff;
  1974. }
  1975. .changeLevelItemsActive {
  1976. border: 1px solid #4e86fe;
  1977. background-color: #ecf2ff;
  1978. }
  1979. .changeLevelItem {
  1980. display: flex;
  1981. flex-direction: column;
  1982. justify-content: center;
  1983. align-items: center;
  1984. }
  1985. .changeLevelItemToken {
  1986. display: flex;
  1987. justify-content: center;
  1988. align-items: center;
  1989. }
  1990. .changeLevelItemTokenImg {
  1991. width: 40px;
  1992. height: 40px;
  1993. }
  1994. .changeNow {
  1995. display: flex;
  1996. white-space: nowrap;
  1997. /* font-weight: bold; */
  1998. margin-bottom: 15px;
  1999. align-items: center;
  2000. }
  2001. .changePay {
  2002. color: #4e86fe;
  2003. margin: 0px 5px;
  2004. font-size: 1.1rem;
  2005. }
  2006. .changeBtn {
  2007. width: 40%;
  2008. max-width: 350px;
  2009. background-color: #4e86fe;
  2010. color: white;
  2011. display: flex;
  2012. justify-content: center;
  2013. align-content: center;
  2014. padding: 10px;
  2015. border-radius: 5px;
  2016. cursor: pointer;
  2017. }
  2018. .changeBtn:hover {
  2019. background-color: #3a73e6;
  2020. }
  2021. .rechargeDialogTitle {
  2022. font-size: 1.7rem;
  2023. /* font-weight: bold; */
  2024. color: #4e86fe;
  2025. display: flex;
  2026. justify-content: center;
  2027. align-items: center;
  2028. letter-spacing: 10px;
  2029. }
  2030. .rechargeDialogContent {
  2031. padding: 20px;
  2032. font-size: 1.2rem;
  2033. }
  2034. .rechargeDialogBtnGroup {
  2035. display: flex;
  2036. font-size: 1.2rem;
  2037. padding: 0px 20px;
  2038. justify-content: space-between;
  2039. }
  2040. .recharge {
  2041. color: white;
  2042. background-color: #4e86fe;
  2043. padding: 10px 20px;
  2044. border-radius: 13px;
  2045. cursor: pointer;
  2046. min-width: 20%;
  2047. text-align: center;
  2048. white-space: nowrap;
  2049. }
  2050. .recharge:hover {
  2051. background-color: #3a73e6;
  2052. }
  2053. .rechargeDialogCancel {
  2054. border: 1px solid rgb(202, 202, 202);
  2055. padding: 10px 20px;
  2056. border-radius: 13px;
  2057. cursor: pointer;
  2058. min-width: 20%;
  2059. text-align: center;
  2060. }
  2061. .rechargeDialogCancel:hover {
  2062. background-color: #ecf2ff;
  2063. }
  2064. .confirmDialogTitle {
  2065. font-size: 1.7rem;
  2066. /* font-weight: bold; */
  2067. color: #4e86fe;
  2068. display: flex;
  2069. justify-content: center;
  2070. align-items: center;
  2071. letter-spacing: 10px;
  2072. }
  2073. .confirmDialogContent {
  2074. padding: 20px;
  2075. font-size: 1.2rem;
  2076. }
  2077. .confirmDialogBtnGroup {
  2078. display: flex;
  2079. font-size: 1.2rem;
  2080. padding: 0px 20px;
  2081. justify-content: space-between;
  2082. }
  2083. .confirmDialogConfirm {
  2084. color: white;
  2085. background-color: #4e86fe;
  2086. padding: 10px 20px;
  2087. border-radius: 13px;
  2088. cursor: pointer;
  2089. min-width: 20%;
  2090. text-align: center;
  2091. }
  2092. .confirmDialogConfirm:hover {
  2093. background-color: #3a73e6;
  2094. }
  2095. .confirmDialogCancel {
  2096. border: 1px solid rgb(202, 202, 202);
  2097. padding: 10px 20px;
  2098. border-radius: 13px;
  2099. cursor: pointer;
  2100. min-width: 20%;
  2101. text-align: center;
  2102. }
  2103. .confirmDialogCancel:hover {
  2104. background-color: #ecf2ff;
  2105. }
  2106. .changeSuccessDialogTitle {
  2107. font-size: 1.7rem;
  2108. font-weight: bold;
  2109. color: #de93a3;
  2110. display: flex;
  2111. justify-content: center;
  2112. align-items: center;
  2113. letter-spacing: 10px;
  2114. }
  2115. .changeSuccessDialogContent {
  2116. padding: 20px;
  2117. font-size: 1.2rem;
  2118. font-weight: bold;
  2119. text-align: center;
  2120. }
  2121. @media (max-width: 768px) {
  2122. .action-btn {
  2123. height: 21px;
  2124. }
  2125. .footer-second-line {
  2126. padding: 5px 10px 10px;
  2127. }
  2128. .msg-input {
  2129. /* min-height: 44px; */
  2130. /* height: 44px; */
  2131. font-size: 16px;
  2132. }
  2133. /* .changeImg {
  2134. width: 30px;
  2135. height: 30px;
  2136. } */
  2137. .changeImgClass {
  2138. width: 30px;
  2139. height: 30px;
  2140. }
  2141. .changeContent {
  2142. font-size: 0.5rem;
  2143. }
  2144. .changeLevelItems {
  2145. font-size: 0.5rem;
  2146. }
  2147. .rechargeDialogTitle {
  2148. font-size: 1.3rem;
  2149. }
  2150. .rechargeDialogContent {
  2151. font-size: 1rem;
  2152. }
  2153. .rechargeDialogBtnGroup {
  2154. font-size: 1rem;
  2155. }
  2156. .recharge {
  2157. padding: 5px 10px;
  2158. }
  2159. .rechargeDialogCancel {
  2160. padding: 5px 10px;
  2161. }
  2162. .confirmDialogTitle {
  2163. font-size: 1.3rem;
  2164. }
  2165. .confirmDialogContent {
  2166. font-size: 1rem;
  2167. }
  2168. .confirmDialogBtnGroup {
  2169. font-size: 1rem;
  2170. }
  2171. .confirmDialogConfirm {
  2172. padding: 5px 10px;
  2173. }
  2174. .confirmDialogCancel {
  2175. padding: 5px 10px;
  2176. }
  2177. .changeSuccessDialogTitle {
  2178. font-size: 1.3rem;
  2179. }
  2180. .changeSuccessDialogContent {
  2181. font-size: 1rem;
  2182. }
  2183. }
  2184. </style>
  2185. <style>
  2186. .changeSuccessDialog {
  2187. background: linear-gradient(180deg, #a2dffe, #b59be1);
  2188. }
  2189. </style>