diff --git a/.env.development b/.env.development index 007e426..32dcc78 100644 --- a/.env.development +++ b/.env.development @@ -5,8 +5,8 @@ VITE_OUTPUT_DIR = 'dev' VITE_PUBLIC_PATH = / #新数据接口 -# VITE_APP_API_BASE_URL = "http://39.101.133.168:8828/link" -VITE_APP_API_BASE_URL = "https://api.homilychart.com/link" +VITE_APP_API_BASE_URL = "http://39.101.133.168:8828/link" +# VITE_APP_API_BASE_URL = "https://api.homilychart.com/link" VITE_APP_IMG_API_BASE_URL = "http://39.101.133.168:8828/hljw/api/aws/upload" #MJ API diff --git a/package-lock.json b/package-lock.json index e04a679..7bf2b91 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "html-to-text": "^9.0.5", "katex": "^0.16.21", "lodash": "^4.17.21", - "marked": "^15.0.7", + "marked": "^15.0.12", "mitt": "^3.0.1", "moment": "^2.30.1", "pinia": "^2.3.1", @@ -5117,9 +5117,9 @@ } }, "node_modules/marked": { - "version": "15.0.7", - "resolved": "https://mirrors.huaweicloud.com/repository/npm/marked/-/marked-15.0.7.tgz", - "integrity": "sha512-dgLIeKGLx5FwziAnsk4ONoGwHwGPJzselimvlVskE9XLN4Orv9u2VA3GWw/lYUqjfA0rUT/6fqKwfZJapP9BEg==", + "version": "15.0.12", + "resolved": "https://mirrors.huaweicloud.com/repository/npm/marked/-/marked-15.0.12.tgz", + "integrity": "sha512-8dD6FusOQSrpv9Z1rdNMdlSgQOIP880DHqnohobOmYLElGEqAL/JvxvuxZO16r4HtjTlfPRDC1hbvxC9dPN2nA==", "license": "MIT", "bin": { "marked": "bin/marked.js" diff --git a/package.json b/package.json index 70957f2..14651ed 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "html-to-text": "^9.0.5", "katex": "^0.16.21", "lodash": "^4.17.21", - "marked": "^15.0.7", + "marked": "^15.0.12", "mitt": "^3.0.1", "moment": "^2.30.1", "pinia": "^2.3.1", diff --git a/src/api/AIxiaocaishen.js b/src/api/AIxiaocaishen.js index b3394ad..0cbce31 100644 --- a/src/api/AIxiaocaishen.js +++ b/src/api/AIxiaocaishen.js @@ -213,12 +213,53 @@ export const getMarketAndCodeAPI = function (params) { }; // 登录获取次数接口 export const addUsageAPI = function (params) { - return request({ - url: `${APIurl}/api/ai_god/addUsage`, - method: "POST", - data: new URLSearchParams(params), - headers: { - "Content-Type": "application/x-www-form-urlencoded", - }, - }); - }; \ No newline at end of file + return request({ + url: `${APIurl}/api/ai_god/addUsage`, + method: "POST", + data: new URLSearchParams(params), + headers: { + "Content-Type": "application/x-www-form-urlencoded", + }, + }); +}; + +// duobao11 +export const dbqbFirstAPI = function (params) { + return request({ + url: `${APIurl}/api/workflow/dbqbFirst`, + method: "POST", + data: params, + }); +}; +// duobao21 +export const dbqbSecondOneAPI = function (params) { + return request({ + url: `${APIurl}/api/workflow/dbqbSecondOne`, + method: "POST", + data: params, + }); +}; +// duobao22 +export const dbqbSecondTwoAPI = function (params) { + return request({ + url: `${APIurl}/api/workflow/dbqbSecondTwo`, + method: "POST", + data: params, + }); +}; +// duobao23 +export const dbqbSecondThreeAPI = function (params) { + return request({ + url: `${APIurl}/api/workflow/dbqbSecondThree`, + method: "POST", + data: params, + }); +}; +// duobao24 +export const dbqbSecondFourAPI = function (params) { + return request({ + url: `${APIurl}/api/workflow/dbqbSecondFour`, + method: "POST", + data: params, + }); +}; diff --git a/src/assets/img/AIchat/主力作战.png b/src/assets/img/AIchat/主力作战.png new file mode 100644 index 0000000..20e5ec8 Binary files /dev/null and b/src/assets/img/AIchat/主力作战.png differ diff --git a/src/assets/img/AIchat/攻防三维.png b/src/assets/img/AIchat/攻防三维.png new file mode 100644 index 0000000..d006673 Binary files /dev/null and b/src/assets/img/AIchat/攻防三维.png differ diff --git a/src/assets/img/AIchat/核心价值评估标题.png b/src/assets/img/AIchat/核心价值评估标题.png new file mode 100644 index 0000000..0daca02 Binary files /dev/null and b/src/assets/img/AIchat/核心价值评估标题.png differ diff --git a/src/assets/img/AIchat/框.png b/src/assets/img/AIchat/框.png new file mode 100644 index 0000000..b4cf65e Binary files /dev/null and b/src/assets/img/AIchat/框.png differ diff --git a/src/assets/img/AIchat/综合作战.png b/src/assets/img/AIchat/综合作战.png new file mode 100644 index 0000000..55e3add Binary files /dev/null and b/src/assets/img/AIchat/综合作战.png differ diff --git a/src/assets/img/AIchat/罗盘边框.png b/src/assets/img/AIchat/罗盘边框.png new file mode 100644 index 0000000..6ab83e6 Binary files /dev/null and b/src/assets/img/AIchat/罗盘边框.png differ diff --git a/src/assets/img/AIchat/边框.png b/src/assets/img/AIchat/边框.png new file mode 100644 index 0000000..b4c457b Binary files /dev/null and b/src/assets/img/AIchat/边框.png differ diff --git a/src/utils/request.js b/src/utils/request.js index 80b4877..e4f8432 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -115,6 +115,7 @@ service.interceptors.response.use( const errorMsg = res.msg || 'Unkonw error' // ElMessage.error(errorMsg) // return Promise.reject(new Error(res.msg || 'Error')) + return response.data } else { return response.data } diff --git a/src/views/AIchat.vue b/src/views/AIchat.vue index 676d2fa..44a9343 100644 --- a/src/views/AIchat.vue +++ b/src/views/AIchat.vue @@ -1,120 +1,55 @@ @@ -4710,7 +5451,6 @@ onUnmounted(() => { animation-duration: 35s; /* PC端改为35秒 */ } - } @keyframes marquee { @@ -4723,30 +5463,200 @@ onUnmounted(() => { } } +.loading-dots { + display: inline-block; +} + +.dot { + opacity: 0.4; + animation: loading 1.4s infinite; +} + +.dot:nth-child(1) { + animation-delay: 0s; +} +.dot:nth-child(2) { + animation-delay: 0.2s; +} +.dot:nth-child(3) { + animation-delay: 0.4s; +} +.dot:nth-child(4) { + animation-delay: 0.6s; +} +.dot:nth-child(5) { + animation-delay: 0.8s; +} +.dot:nth-child(6) { + animation-delay: 1s; +} + +@keyframes loading { + 0%, + 60%, + 100% { + opacity: 0.4; + } + 30% { + opacity: 1; + } +} + .message-bubble { - max-width: 70%; + max-width: 80%; margin: 10px 0px; - padding: 15px 25px; - border-radius: 10px; + padding: 15px 20px; + position: relative; } .message-bubble.user { - background: #8263f0; - color: white; + color: #6d22f8; + background: white; + font-weight: bold; margin-left: auto; + border-radius: 10px; margin-right: 20px; /* border-bottom-right-radius: 5px; */ } .message-bubble.ai { + background: #2b378d; + color: #ffffff; + margin: 0 auto; + /* border-bottom-left-radius: 5px; */ +} + +.message-bubble.ing { background: #ffffff; - color: #333; - margin-right: auto; + color: #000000; + font-weight: bold; + border-radius: 10px; margin-left: 20px; + margin-right: auto; + /* border-bottom-left-radius: 5px; */ +} + +.message-bubble.ai.title1 { + width: 100%; + display: flex; + border-radius: 10px 10px 0px 0px; /* border-bottom-left-radius: 5px; */ } +.mainTitle { + font-size: 16px; + font-weight: bold; + background-image: url("@/assets/img/AiEmotion/bk01.png"); + background-repeat: no-repeat; + background-size: 100% 100%; + min-width: 200px; + width: 20vw; + height: 50px; + padding: 5px 0px 0px 0px; + display: flex; + justify-content: center; + align-items: center; +} + +.date { + font-size: 18px; + font-weight: bold; + margin-left: auto; + /* width: 100px; */ + display: flex; + justify-content: center; + align-items: center; +} + +.message-bubble.ai.title2 { + width: 100%; + display: flex; + justify-content: center; + align-items: center; +} + +.title1Img { + max-width: 500px; + width: 80vw; +} + +.message-bubble.ai.title3 { + width: 100%; + display: flex; + justify-content: center; + align-items: center; +} + +.title2Img { + max-width: 500px; + width: 90vw; +} + +.message-bubble.ai.content1 { + width: 100%; + display: flex; + justify-content: center; + align-items: center; +} + +.content1Text { + background-image: url("@/assets/img/AIchat/框.png"); + background-repeat: no-repeat; + background-size: 100% 100%; + width: 50vw; + min-width: 350px; + /* height: 20vw; */ + /* max-height: 400px; */ + padding: 5% 0; +} + +.text1 { + font-weight: bold; + /* margin-left: 6%; */ + /* margin-bottom: 10px; */ + margin: 0px 6% 10px 6%; + font-size: 30px; +} + +.message-bubble.ai.content2 { + width: 100%; +} + +.message-bubble.ai.content3 { + width: 100%; + display: flex; + justify-content: center; + align-items: center; +} + +.content3Text { + background-image: url("@/assets/img/AIchat/边框.png"); + background-repeat: no-repeat; + background-size: 100% 100%; + width: 50vw; + min-width: 350px; + /* height: 20vw; */ + /* max-height: 400px; */ + padding: 5% 0px; +} + +.text3 { + /* font-weight: bold; */ + /* margin-left: 6%; */ + /* margin-bottom: 10px; */ + margin: 0px 6% 10px 6%; + font-size: 30px; +} + +.message-bubble.ai.mianze { + width: 100%; + text-align: center; + font-weight: bold; + font-size: 24px; + border-radius: 0px 0px 10px 10px; +} + .kline-container { margin-top: 10px; /* 最小高度 */ @@ -4758,9 +5668,34 @@ onUnmounted(() => { @media (max-width: 768px) { .kline-container { - min-width: 75vw; } + + .content1Text { + width: 77vw; + min-width: 0px; + /* height: 20vw; */ + /* min-height: 150px; */ + } + + .text1 { + font-size: 20px; + } + + .content3Text { + width: 77vw; + min-width: 0px; + /* height: 20vw; */ + /* min-height: 150px; */ + } + + .text3 { + font-size: 20px; + } + + .message-bubble.ai.mianze { + font-size: 18px; + } } .kline-container .chart-mount-point { diff --git a/src/views/homePage.vue b/src/views/homePage.vue index be29860..472eab9 100644 --- a/src/views/homePage.vue +++ b/src/views/homePage.vue @@ -3,14 +3,14 @@ import { ref, computed, onMounted, watch, nextTick, onUnmounted } from "vue"; import { setHeight } from "../utils/setHeight"; import { getUserCountAPI } from "../api/AIxiaocaishen"; -import { ElMessage } from 'element-plus' +import { ElMessage } from "element-plus"; import AIchat from "./AIchat.vue"; import AIfind from "./AIfind.vue"; import Feedback from "./Feedback.vue"; -import { useAppBridge } from '../assets/js/useAppBridge.js' -import { useDataStore } from '@/store/dataList.js' -import { useChatStore } from '../store/chat' -import { useAudioStore } from '../store/audio' +import { useAppBridge } from "../assets/js/useAppBridge.js"; +import { useDataStore } from "@/store/dataList.js"; +import { useChatStore } from "../store/chat"; +import { useAudioStore } from "../store/audio"; import _ from "lodash"; import logo from "../assets/img/homePage/logo.png"; @@ -23,7 +23,7 @@ import languageBtn from "../assets/img/homePage/tail/language.png"; import dbqbButton01 from "../assets/img/AiEmotion/dbqb-button01.png"; import dbqbButton02 from "../assets/img/AiEmotion/dbqb-button02.png"; import emotionButton01 from "../assets/img/AiEmotion/emotion-button01.png"; -import emotionButton02 from "../assets/img/AiEmotion/emotion-button02.png"; +import emotionButton02 from "../assets/img/AiEmotion/emotion-button02.png"; import voice from "../assets/img/homePage/tail/voice.png"; import voiceNoActive from "../assets/img/homePage/tail/voice-no-active.png"; import sendBtn from "../assets/img/homePage/tail/send.png"; @@ -31,24 +31,23 @@ import msgBtn from "../assets/img/homePage/tail/msg.png"; import feedbackBtn from "../assets/img/Feedback/feedbackBtn.png"; import AiEmotion from "./AiEmotion.vue"; - // import VConsole from 'vconsole'; // const vConsole = new VConsole(); // 获取 AiEmotion 组件的 ref -const aiEmotionRef = ref(null) +const aiEmotionRef = ref(null); // import { useUserStore } from "../store/userPessionCode.js"; -const { getQueryVariable, setActiveTabIndex } = useDataStore() -const dataStore = useDataStore() -const chatStore = useChatStore() +const { getQueryVariable, setActiveTabIndex } = useDataStore(); +const dataStore = useDataStore(); +const chatStore = useChatStore(); // 变量 // 音频管理 -const audioStore = useAudioStore() -const isVoice = computed(() => audioStore.isVoiceEnabled) +const audioStore = useAudioStore(); +const isVoice = computed(() => audioStore.isVoiceEnabled); const toggleVoice = () => { - audioStore.toggleVoice() -} + audioStore.toggleVoice(); +}; // 将默认值改为从 sessionStorage 中获取,如果没有则使用默认值 'aifindCow'为第一个默认tab const activeTab = ref(sessionStorage.getItem("activeTabAI") || "AIchat"); const activeIndex = ref( @@ -66,13 +65,13 @@ const tabs = computed(() => [ // }, { name: "AiEmotion", - label: "AI情绪大模型" - } + label: "AI情绪大模型", + }, ]); // 修改 setActiveTab 方法,添加一个可选参数 forceAIchat const setActiveTab = (tab, index, forceAIchat = false) => { - isScrolling.value = false; //回复滚动到底部方法 + isScrolling.value = false; //回复滚动到底部方法 isAnnouncementVisible.value = false; if (forceAIchat && activeTab.value !== "AIchat") { activeTab.value = "AIchat"; @@ -85,7 +84,7 @@ const setActiveTab = (tab, index, forceAIchat = false) => { sessionStorage.setItem("activeTabAI", tab); sessionStorage.setItem("activeIndexAI", index.toString()); } - setActiveTabIndex(index) + setActiveTabIndex(index); console.log(tab, index, "tab, index"); setHeight(document.getElementById("testId")); // 给父组件发送窗口高度 }; @@ -110,12 +109,11 @@ const ensureAIchat = () => { }; // 获取次数 -const UserCount = computed(() => chatStore.UserCount) - +const UserCount = computed(() => chatStore.UserCount); const getCount = () => { - console.log('点击了获取次数的按钮') -} + console.log("点击了获取次数的按钮"); +}; // 深度思考 const isThinking = ref(true); @@ -128,7 +126,9 @@ const message = ref(""); // 传输对象 const messages = ref([]); // 信息加载状态 -const isLoading = computed(() => { chatStore.isLoading }); +const isLoading = computed(() => { + chatStore.isLoading; +}); // 添加用户消息 const updateMessage = (title) => { @@ -136,14 +136,17 @@ const updateMessage = (title) => { // console.log("updateMessage 的值:", title); }; const sendMessage = async () => { - if (localStorage.getItem('localToken') == null || localStorage.getItem('localToken') == '') { - ElMessage.error('请先登录'); + if ( + localStorage.getItem("localToken") == null || + localStorage.getItem("localToken") == "" + ) { + ElMessage.error("请先登录"); return; } isScrolling.value = false; - + // 判断当前是否为 AiEmotion 组件 - if (activeTab.value === 'AiEmotion') { + if (activeTab.value === "AiEmotion") { // 调用 AiEmotion 组件的 handleSendMessage 方法 aiEmotionRef.value?.handleSendMessage(message.value); message.value = ""; // 清空输入框 @@ -153,11 +156,11 @@ const sendMessage = async () => { // 调用 ensureAIchat 确保跳转到 AIchat 页面 ensureAIchat(); - console.log(chatStore.isLoading, 'isLoading.value1111'); + console.log(chatStore.isLoading, "isLoading.value1111"); if (!message.value) return; if (chatStore.isLoading) return; chatStore.setLoading(true); - console.log(chatStore.isLoading, 'isLoading.value2222'); + console.log(chatStore.isLoading, "isLoading.value2222"); const messageContent = message.value; // 重置消息输入框 @@ -172,12 +175,10 @@ const sendMessage = async () => { sender: "user", content: messageContent, timestamp: new Date().toISOString(), - } + }, ]; - console.log(messages.value, 'messages.value'); + console.log(messages.value, "messages.value"); }, 200); - - }; // 公告 @@ -190,8 +191,8 @@ const isAnnouncementVisible = ref(false); const showAnnouncement = async () => { console.log("打开公告"); dataStore.isFeedback = false; // 显示用户反馈页面 - isScrolling.value = false; //回复滚动到底部方法 - setActiveTab('', -1); // 清空当前选中状态 + isScrolling.value = false; //回复滚动到底部方法 + setActiveTab("", -1); // 清空当前选中状态 isAnnouncementVisible.value = true; // 显示公告页面 }; @@ -200,7 +201,7 @@ const showAnnouncement = async () => { const showFeedback = () => { console.log("打开用户反馈"); dataStore.isFeedback = true; // 显示用户反馈页面 -} +}; // 点击剩余次数会弹出的弹窗 // 新增一个 ref 来控制弹窗的显示与隐藏 @@ -216,10 +217,10 @@ const showCount = () => { // 保证发送消息时,滚动屏在底部 const tabContent = ref(null); -const isScrolling = ref(false); //判断用户是否在滚动 +const isScrolling = ref(false); //判断用户是否在滚动 const smoothScrollToBottom = async () => { - console.log('调用滚动到底部的方法') + console.log("调用滚动到底部的方法"); // await nextTick(); const container = tabContent.value; // console.log(container, 'container') @@ -235,10 +236,11 @@ const smoothScrollToBottom = async () => { // container.scrollTop = container.scrollHeight + container.offsetHeight; // console.log(container.scrollHeight, container.offsetHeight, container.scrollHeight - container.offsetHeight, container.scrollTop, "总长度", "可视长度", "位置") } +}; -} - -const throttledSmoothScrollToBottom = _.throttle(smoothScrollToBottom, 500, { trailing: false }); +const throttledSmoothScrollToBottom = _.throttle(smoothScrollToBottom, 500, { + trailing: false, +}); watch( () => chatStore.messages, @@ -250,16 +252,15 @@ watch( { deep: true, immediate: true } ); - watch( activeTab, async () => { - console.log('activeTab变化了', activeTab.value) - if (activeTab.value === 'AIchat') { - isScrolling.value = false; //回复滚动到底部方法 + console.log("activeTab变化了", activeTab.value); + if (activeTab.value === "AIchat") { + isScrolling.value = false; //回复滚动到底部方法 setTimeout(() => { throttledSmoothScrollToBottom(); - }, 100) + }, 100); } // setTimeout(throttledSmoothScrollToBottom, 100); }, @@ -272,43 +273,46 @@ const fnGetToken = () => { window.JWready = (ress) => { // console.log('进入JWready') try { - ress = JSON.parse(ress) + ress = JSON.parse(ress); // console.log(ress, 'ress') } catch (error) { - console.log(error, 'fnGetToken error') + console.log(error, "fnGetToken error"); } //platform为5是app端 // platform.value = ress.data.platform // 处理平台判断 - console.log(ress.data.platform, 'ress.data.platform') + console.log(ress.data.platform, "ress.data.platform"); if (!ress.data.platform) { // 非App环境通过URL参数获取 - localStorage.setItem('localToken', decodeURIComponent(String(getQueryVariable('token')))) + localStorage.setItem( + "localToken", + decodeURIComponent(String(getQueryVariable("token"))) + ); // localStorage.setItem('localToken', "+SsksARQgUHIbIG3rRnnbZi0+fEeMx8pywnIlrmTxo5EOPR/wjWDV7w7+ZUseiBtf9kFa/atmNx6QfSpv5w") } else { // App环境通过桥接获取 useAppBridge().packageFun( - 'JWgetStorage', + "JWgetStorage", (response) => { - const res = JSON.parse(response) // 解析返回的结果 - localStorage.setItem('localToken', res.data) + const res = JSON.parse(response); // 解析返回的结果 + localStorage.setItem("localToken", res.data); // localStorage.setItem('localToken', "+SsksARQgUHIbIG3rRnnbZi0+fEeMx8pywnIlrmTxo5EOPR/wjWDV7w7+ZUseiBtf9kFa/atmNx6QfSpv5w") }, 5, { - key: 'token' + key: "token", } - ) + ); } - } + }; // console.log('出来了') // 触发App桥接 - useAppBridge().packageFun('JWwebReady', () => { }, 5, {}) -} + useAppBridge().packageFun("JWwebReady", () => {}, 5, {}); +}; // 在setTimeout中延迟执行 setTimeout(() => { - fnGetToken() -}, 800) + fnGetToken(); +}, 800); const heightListener = () => { const tabContainer = tabContent.value; @@ -318,9 +322,10 @@ const heightListener = () => { const aftertop = tabContainer.scrollTop; // 新增底部判断逻辑 - const isBottom = aftertop + tabContainer.offsetHeight + 50 >= tabContainer.scrollHeight; + const isBottom = + aftertop + tabContainer.offsetHeight + 50 >= tabContainer.scrollHeight; - if (activeTab.value === 'AIchat') { + if (activeTab.value === "AIchat") { if (aftertop - befortop > 0) { // console.log('向下滚动'); isScrolling.value = true; @@ -340,52 +345,62 @@ const heightListener = () => { // console.log(isScrolling.value, 'isScrolling.value') - tabContainer.addEventListener('scroll', scrollHandler); + tabContainer.addEventListener("scroll", scrollHandler); }; -const throttledHeightListener = _.throttle(heightListener, 500, { trailing: false }); +const throttledHeightListener = _.throttle(heightListener, 500, { + trailing: false, +}); const goToRecharge = () => { - console.log('点击充值') + console.log("点击充值"); // http://39.101.133.168:8919/payment/recharge/index? // url=http%3A%2F%2Flocalhost%3A8080%2FLiveActivity%2Fpck // &platform=1 // &token=+S4h5QEE1hTIb4CxphrnbZi0+fEeMx8pywnIlrmTmo4QO6IolWnVWu5r+J4rKXMwK41UPfKqyIp+RvWmtM8 const userAgent = navigator.userAgent.toLowerCase(); - const mobileKeywords = ['mobile', 'android', 'iphone', 'ipad', 'ipod']; - const isMobile = mobileKeywords.some(keyword => userAgent.includes(keyword)); - - console.log(isMobile ? '手机' : '电脑') - - const url = encodeURI("http://39.101.133.168:8857/aixiaocaishen/homePage") - console.log(url, 'url') - const platform = isMobile ? 2 : 1 - const token = encodeURIComponent(localStorage.getItem('localToken')) - console.log(token, 'token') - const rechargeUrl = 'http://39.101.133.168:8919/payment/recharge/index?' + 'url=' + url + '&platform=' + platform + '&token=' + token - console.log(rechargeUrl, 'rechargeUrl') - window.location.href = rechargeUrl + const mobileKeywords = ["mobile", "android", "iphone", "ipad", "ipod"]; + const isMobile = mobileKeywords.some((keyword) => + userAgent.includes(keyword) + ); + + console.log(isMobile ? "手机" : "电脑"); + + const url = encodeURI("http://39.101.133.168:8857/aixiaocaishen/homePage"); + console.log(url, "url"); + const platform = isMobile ? 2 : 1; + const token = encodeURIComponent(localStorage.getItem("localToken")); + console.log(token, "token"); + const rechargeUrl = + "http://39.101.133.168:8919/payment/recharge/index?" + + "url=" + + url + + "&platform=" + + platform + + "&token=" + + token; + console.log(rechargeUrl, "rechargeUrl"); + window.location.href = rechargeUrl; // window.open(rechargeUrl) -} - +}; const adjustFooterPosition = (height) => { - console.log('调整底部位置', height) - const footer = document.querySelector('.el-footer'); - const main = document.querySelector('.el-main'); - const homePage = document.querySelector('.homepage'); - const app = document.getElementById('app'); + console.log("调整底部位置", height); + const footer = document.querySelector(".el-footer"); + const main = document.querySelector(".el-main"); + const homePage = document.querySelector(".homepage"); + const app = document.getElementById("app"); // Footer 的默认高度(假设为 60px) // 动态推高 Footer - // footer.style.bottom = `${keyboardHeight}px`; + // footer.style.bottom = `${keyboardHeight}px`; // 给 Main 区域留出 Footer + 键盘的空间 homePage.style.height = `${height}px`; // app.style.height = `${height}px`; void homePage.offsetHeight; - const html = document.querySelector('html'); - const body = document.querySelector('body'); + const html = document.querySelector("html"); + const body = document.querySelector("body"); html.style.height = `${height}px`; body.style.height = `${height}px`; @@ -394,9 +409,9 @@ const adjustFooterPosition = (height) => { setTimeout(() => { // 隐藏滚动条 - html.style.overflow = 'hidden'; - body.style.overflow = 'hidden'; - }, 200) + html.style.overflow = "hidden"; + body.style.overflow = "hidden"; + }, 200); // console.log(html.offsetHeight, 'html') // console.log(html.clientHeight, 'html') @@ -411,68 +426,74 @@ const adjustFooterPosition = (height) => { // console.log(main.offsetHeight, 'main') // console.log(main.clientHeight, 'mainClientHeight') // console.log(main.scrollHeight, 'mainScrollHeight') - }; const onFocus = function () { - const visualViewport = window.visualViewport + const visualViewport = window.visualViewport; // 获取可视区域高度 setTimeout(() => { - console.log('输入框聚焦') + console.log("输入框聚焦"); - console.log(visualViewport.height, 'visualViewport.height') - const keyboardHeight = window.innerHeight - visualViewport.height - console.log(window.innerHeight, 'window.innerHeight') - console.log(keyboardHeight, 'keyboardHeight') + console.log(visualViewport.height, "visualViewport.height"); + const keyboardHeight = window.innerHeight - visualViewport.height; + console.log(window.innerHeight, "window.innerHeight"); + console.log(keyboardHeight, "keyboardHeight"); - adjustFooterPosition(visualViewport.height) - }, 200) -} + adjustFooterPosition(visualViewport.height); + }, 200); +}; const onBlur = function () { - const visualViewport = window.visualViewport + const visualViewport = window.visualViewport; setTimeout(() => { - console.log('输入框失焦') + console.log("输入框失焦"); - const keyboardHeight = window.innerHeight - visualViewport.height - console.log(window.innerHeight, 'window.innerHeight') - console.log(visualViewport.height, 'visualViewport.height') - console.log(keyboardHeight, 'keyboardHeight') - adjustFooterPosition(visualViewport.height) - }, 200) -} + const keyboardHeight = window.innerHeight - visualViewport.height; + console.log(window.innerHeight, "window.innerHeight"); + console.log(visualViewport.height, "visualViewport.height"); + console.log(keyboardHeight, "keyboardHeight"); + adjustFooterPosition(visualViewport.height); + }, 200); +}; -window.addEventListener('resize', () => { +window.addEventListener("resize", () => { // 检测是否为iOS设备 const isIOS = /iPhone|iPad|iPod|ios/i.test(navigator.userAgent); - console.log('是否为iOS设备:', isIOS); + console.log("是否为iOS设备:", isIOS); if (!isIOS) { - console.log('窗口大小变化') - const homePage = document.querySelector('.homepage'); + console.log("窗口大小变化"); + const homePage = document.querySelector(".homepage"); homePage.style.height = `${window.innerHeight}px`; } }); // 禁用全局触摸滚动 -document.addEventListener('touchmove', (e) => { - if (!dataStore.isFeedback) { - // 判断触摸目标是否在可滚动区域内 - const isScrollableArea = e.target.closest('.tab-content'); - - // 如果不在可滚动区域,则阻止滚动 - if (!isScrollableArea) { - e.preventDefault(); +document.addEventListener( + "touchmove", + (e) => { + if (!dataStore.isFeedback) { + // 判断触摸目标是否在可滚动区域内 + const isScrollableArea = e.target.closest(".tab-content"); + + // 如果不在可滚动区域,则阻止滚动 + if (!isScrollableArea) { + e.preventDefault(); + } } - } -}, { passive: false }); + }, + { passive: false } +); onMounted(async () => { const isPhone = /phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/i.test( navigator.userAgent - ) + ); !isPhone && - localStorage.setItem('localToken', decodeURIComponent(String(getQueryVariable('token')))) + localStorage.setItem( + "localToken", + decodeURIComponent(String(getQueryVariable("token"))) + ); setHeight(document.getElementById("testId")); // 给父组件发送窗口高度 // 获取次数 await chatStore.getUserCount(); @@ -486,7 +507,7 @@ onMounted(async () => { // 初始化视口高度变量 // updateAppHeight(); -}) +});
-

- 试运行期间,AI小财神可以检索全市场数据 -

-

- (每个市场20支股票,股票详情参见【公告】页面), -

-

- 弘历会员每人每日拥有10次检索机会! -

+

试运行期间,AI小财神可以检索全市场数据

+

(每个市场20支股票,股票详情参见【公告】页面),

+

弘历会员每人每日拥有10次检索机会!

@@ -655,7 +723,7 @@ onMounted(async () => { .tab-item.active { /* color: #000; border-color: #000; */ - background: linear-gradient(0deg, #ffffff, #fec13e); + background: linear-gradient(0deg, #ffffff, #fec13e); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;