From 98677be4729679b404a7ebbbee9b3fa19ba33d31 Mon Sep 17 00:00:00 2001 From: no99 <17663930442@163.com> Date: Tue, 19 Aug 2025 09:40:07 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=89=93=E5=BC=80=E5=85=91=E6=8D=A2Token?= =?UTF-8?q?=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/homePage.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/homePage.vue b/src/views/homePage.vue index 12ecd20..3b8e560 100644 --- a/src/views/homePage.vue +++ b/src/views/homePage.vue @@ -355,7 +355,7 @@ const dialogVisible = ref(false); const showCount = () => { console.log("显示剩余次数"); // 显示弹窗 - // dialogVisible.value = true; + dialogVisible.value = true; console.log("dialogVisible 的值:", dialogVisible.value); // 添加日志确认 }; From 5b0c0353e2e40cfed232717a6418113a6b5cb27e Mon Sep 17 00:00:00 2001 From: no99 <17663930442@163.com> Date: Tue, 19 Aug 2025 10:02:45 +0800 Subject: [PATCH 2/7] =?UTF-8?q?chat=E9=A1=B5=E9=9D=A2data=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=A0=B9=E6=8D=AE=E7=8E=AF=E5=A2=83=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E3=80=82=20=E6=A0=B9=E6=8D=AEurl=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E4=B8=8A=E7=9A=84=E5=8F=82=E6=95=B0=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=85=85=E5=80=BC=E5=9B=9E=E5=BD=92=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E4=B8=94=E5=B1=95=E7=A4=BA=E5=BC=B9=E7=AA=97=EF=BC=8C?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=BC=93=E5=AD=98rechargeFlag=E6=9D=A5?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E5=B1=95=E7=A4=BA=E8=BF=87?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/AIchat.vue | 5 +-- src/views/homePage.vue | 90 +++++++++++++++++++++++++++++--------------------- 2 files changed, 56 insertions(+), 39 deletions(-) diff --git a/src/views/AIchat.vue b/src/views/AIchat.vue index 3da2f90..bb809e3 100644 --- a/src/views/AIchat.vue +++ b/src/views/AIchat.vue @@ -1261,8 +1261,9 @@ watch( const env = import.meta.env.VITE_ENV; const result20 = await dataListAPI({ token: - // "8Csj5VVX1UbIb4C3oxrnbZi0+fEeMx8pywnIlrmTm45Cb/EllzWACLto9J9+fCFsfdgBOvKvyY94FvqlvM0", - "8nkj4QBV1RPIb4CzoRTnbZi0+fEeMx8pywnIlrmTxdwROKkuwWqAWu9orpkpeXVqL98DPfeonNYpHv+mucA", + env == "development" || env == "test" + ? "8Csj5VVX1UbIb4C3oxrnbZi0+fEeMx8pywnIlrmTm45Cb/EllzWACLto9J9+fCFsfdgBOvKvyY94FvqlvM0" + : "8nkj4QBV1RPIb4CzoRTnbZi0+fEeMx8pywnIlrmTxdwROKkuwWqAWu9orpkpeXVqL98DPfeonNYpHv+mucA", market: codeData.value.market, code: codeData.value.code, language: "cn", //t.value.suoxie, diff --git a/src/views/homePage.vue b/src/views/homePage.vue index 3b8e560..235ae4e 100644 --- a/src/views/homePage.vue +++ b/src/views/homePage.vue @@ -373,9 +373,9 @@ const aiEmotionScrollTimer = ref(null); // 滚动检测定时器 // 获取当前活动页面的滚动容器 const getCurrentScrollContainer = () => { - if (activeTab.value === 'AIchat') { + if (activeTab.value === "AIchat") { return tabContentAIchat.value; - } else if (activeTab.value === 'AiEmotion') { + } else if (activeTab.value === "AiEmotion") { return tabContentAiEmotion.value; } return null; @@ -406,7 +406,11 @@ const throttledSmoothScrollToBottom = _.throttle(smoothScrollToBottom, 300, { // AiEmotion页面自动滚动到底部的防抖函数 const debouncedAiEmotionScrollToBottom = _.debounce(() => { - if (activeTab.value === 'AiEmotion' && isAiEmotionAutoScrollEnabled.value && !isAiEmotionUserScrolling.value) { + if ( + activeTab.value === "AiEmotion" && + isAiEmotionAutoScrollEnabled.value && + !isAiEmotionUserScrolling.value + ) { const container = tabContentAiEmotion.value; if (container) { container.scrollTop = container.scrollHeight - container.offsetHeight; @@ -418,21 +422,21 @@ const debouncedAiEmotionScrollToBottom = _.debounce(() => { const startAiEmotionHeightObserver = () => { // 先停止之前的监听器 stopAiEmotionHeightObserver(); - + isAiEmotionAutoScrollEnabled.value = true; - + // 创建ResizeObserver监听页面内容变化 aiEmotionHeightObserver.value = new ResizeObserver((entries) => { - if (isAiEmotionAutoScrollEnabled.value && activeTab.value === 'AiEmotion') { + if (isAiEmotionAutoScrollEnabled.value && activeTab.value === "AiEmotion") { debouncedAiEmotionScrollToBottom(); } }); - + // 监听document.body的尺寸变化 if (document.body) { aiEmotionHeightObserver.value.observe(document.body); } - + // 创建MutationObserver监听DOM结构变化 const mutationObserver = new MutationObserver((mutations) => { let shouldScroll = false; @@ -453,12 +457,16 @@ const startAiEmotionHeightObserver = () => { } } }); - - if (shouldScroll && isAiEmotionAutoScrollEnabled.value && activeTab.value === 'AiEmotion') { + + if ( + shouldScroll && + isAiEmotionAutoScrollEnabled.value && + activeTab.value === "AiEmotion" + ) { debouncedAiEmotionScrollToBottom(); } }); - + // 监听AiEmotion页面的主要内容区域的DOM变化 const aiEmotionContainer = tabContentAiEmotion.value; if (aiEmotionContainer) { @@ -469,17 +477,19 @@ const startAiEmotionHeightObserver = () => { characterData: true, }); } - + // 保存mutationObserver引用以便清理 aiEmotionHeightObserver.value.mutationObserver = mutationObserver; - + // 为AiEmotion页面的滚动容器添加滚动事件监听器 if (aiEmotionContainer) { - aiEmotionContainer.addEventListener('scroll', handleAiEmotionUserScroll, { passive: true }); + aiEmotionContainer.addEventListener("scroll", handleAiEmotionUserScroll, { + passive: true, + }); // 保存滚动事件监听器引用以便清理 aiEmotionHeightObserver.value.scrollListener = handleAiEmotionUserScroll; } - + console.log("AiEmotion页面高度监听器已启动"); }; @@ -487,12 +497,12 @@ const startAiEmotionHeightObserver = () => { const handleAiEmotionUserScroll = () => { // 标记用户正在滚动 isAiEmotionUserScrolling.value = true; - + // 清除之前的定时器 if (aiEmotionScrollTimer.value) { clearTimeout(aiEmotionScrollTimer.value); } - + // 设置定时器,2秒后恢复自动滚动 // aiEmotionScrollTimer.value = setTimeout(() => { // isAiEmotionUserScrolling.value = false; @@ -502,7 +512,7 @@ const handleAiEmotionUserScroll = () => { // 处理AiEmotion页面的滚动请求 const handleAiEmotionScrollToBottom = () => { - if (activeTab.value === 'AiEmotion') { + if (activeTab.value === "AiEmotion") { const container = tabContentAiEmotion.value; if (container) { // 使用nextTick确保DOM已更新 @@ -518,32 +528,38 @@ const handleAiEmotionScrollToBottom = () => { const stopAiEmotionHeightObserver = () => { isAiEmotionAutoScrollEnabled.value = false; isAiEmotionUserScrolling.value = false; - + // 清理滚动检测定时器 if (aiEmotionScrollTimer.value) { clearTimeout(aiEmotionScrollTimer.value); aiEmotionScrollTimer.value = null; } - + if (aiEmotionHeightObserver.value) { // 清理ResizeObserver aiEmotionHeightObserver.value.disconnect(); - + // 清理MutationObserver if (aiEmotionHeightObserver.value.mutationObserver) { aiEmotionHeightObserver.value.mutationObserver.disconnect(); aiEmotionHeightObserver.value.mutationObserver = null; } - + // 清理滚动事件监听器 - if (aiEmotionHeightObserver.value.scrollListener && tabContentAiEmotion.value) { - tabContentAiEmotion.value.removeEventListener('scroll', aiEmotionHeightObserver.value.scrollListener); + if ( + aiEmotionHeightObserver.value.scrollListener && + tabContentAiEmotion.value + ) { + tabContentAiEmotion.value.removeEventListener( + "scroll", + aiEmotionHeightObserver.value.scrollListener + ); aiEmotionHeightObserver.value.scrollListener = null; } - + aiEmotionHeightObserver.value = null; } - + console.log("AiEmotion页面高度监听器已停止"); }; @@ -655,7 +671,7 @@ setTimeout(() => { const heightListener = () => { const tabContainer = getCurrentScrollContainer(); if (!tabContainer) return; - + let befortop = 0; const scrollHandler = () => { @@ -807,7 +823,8 @@ const touchmoveHandler = (e) => { } // 判断触摸目标是否在当前活动页面的可滚动区域内 const currentContainer = getCurrentScrollContainer(); - const isScrollableArea = currentContainer && currentContainer.contains(e.target); + const isScrollableArea = + currentContainer && currentContainer.contains(e.target); // 如果不在可滚动区域,则阻止滚动 if (!isScrollableArea) { @@ -925,6 +942,8 @@ const changeToken = () => { }; const goRecharge = () => { + sessionStorage.setItem("rechargeFlag", "1"); + if (isMobile.value) { console.log("用户是移动端"); } else { @@ -953,9 +972,7 @@ const goChange = () => { setTimeout(() => { changeSuccessDialogVisible.value = false; }, 3000); - }; - // 8.18金币兑换Token end onMounted(async () => { @@ -984,12 +1001,12 @@ onMounted(async () => { // 添加原生事件监听器 window.addEventListener("resize", throttledJudgeDevice); - if (getQueryVariable("successType") == "success") { + if ( + sessionStorage.getItem("rechargeFlag") == "1" && + getQueryVariable("successType") == "success" + ) { dialogVisible.value = true; - window.parent.location.href = window.parent.location.href.replace( - "successType=success", - "" - ); + sessionStorage.setItem("rechargeFlag", "0"); } }); @@ -1101,7 +1118,6 @@ onUnmounted(() => {
{{ UserCount }}
点击获取Token
-
{ @enableInput="enableInput" />
- +
Date: Tue, 19 Aug 2025 11:46:45 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E5=BB=B6=E6=97=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=EF=BC=8C=E6=8C=89=E9=92=AE=E7=8A=B6=E6=80=81=E4=BC=98=E5=8C=96?= =?UTF-8?q?=EF=BC=8C=E6=8F=90=E7=A4=BA=E9=97=AE=E9=A2=98=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/homePage.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/views/homePage.vue b/src/views/homePage.vue index 235ae4e..b4b7433 100644 --- a/src/views/homePage.vue +++ b/src/views/homePage.vue @@ -971,7 +971,7 @@ const goChange = () => { changeSuccessDialogVisible.value = true; setTimeout(() => { changeSuccessDialogVisible.value = false; - }, 3000); + }, 2000); }; // 8.18金币兑换Token end @@ -1402,7 +1402,7 @@ onUnmounted(() => { >
兑换成功
- 尊敬的用户,恭喜您成功兑换:{{ activeLevel.calculatedPosition }}Token + 尊敬的用户,恭喜您成功兑换:{{ activeLevel.calculatedPosition }} Token
@@ -1666,6 +1666,12 @@ body { flex-direction: column; justify-content: center; align-items: center; + cursor: pointer; +} + +.backToHomeBtn:hover{ + transform: scale(1.05); + } .backImg { @@ -1693,6 +1699,7 @@ body { width: 65%; height: 100%; position: relative; + cursor: pointer; } .pc-countBtn:hover { @@ -1731,6 +1738,7 @@ body { display: flex; flex-direction: column; align-items: center; + cursor: pointer; } .pc-backImg { width: auto; From 596d0775b3a2224e6ad85135a00a6f81e8d408d4 Mon Sep 17 00:00:00 2001 From: no99 <17663930442@163.com> Date: Tue, 19 Aug 2025 13:59:30 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E6=8E=A5=E8=8E=B7=E5=8F=96=E5=85=91?= =?UTF-8?q?=E6=8D=A2=E5=88=97=E8=A1=A8=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/AIxiaocaishen.js | 15 +++++++++++++++ src/views/homePage.vue | 46 ++++++++++++++++++++++++++++------------------ 2 files changed, 43 insertions(+), 18 deletions(-) diff --git a/src/api/AIxiaocaishen.js b/src/api/AIxiaocaishen.js index 92327aa..c1650ac 100644 --- a/src/api/AIxiaocaishen.js +++ b/src/api/AIxiaocaishen.js @@ -303,3 +303,18 @@ export const clickRecordAPI = function (params) { data: params, }); }; + +// 8.18金币兑换Token start + +export const showExchangeAPI = function (params) { + return request({ + url: `http://192.168.1.22:8080/api/showExchange`, + method: "POST", + data: params, + headers: { + token: localStorage.getItem("localToken"), + }, + }); +}; + +// 8.18金币兑换Token end \ No newline at end of file diff --git a/src/views/homePage.vue b/src/views/homePage.vue index b4b7433..ac61f56 100644 --- a/src/views/homePage.vue +++ b/src/views/homePage.vue @@ -2,7 +2,7 @@ // 导入 import { ref, computed, onMounted, watch, nextTick, onUnmounted, h } from "vue"; import { setHeight } from "../utils/setHeight"; -import { getUserCountAPI } from "../api/AIxiaocaishen"; +import { getUserCountAPI, showExchangeAPI } from "../api/AIxiaocaishen"; import { ElMessage } from "element-plus"; import AIchat from "./AIchat.vue"; import AIfind from "./AIfind.vue"; @@ -348,17 +348,6 @@ const showFeedback = () => { } }; -// 点击剩余次数会弹出的弹窗 -// 新增一个 ref 来控制弹窗的显示与隐藏 -const dialogVisible = ref(false); -// 获取次数 -const showCount = () => { - console.log("显示剩余次数"); - // 显示弹窗 - dialogVisible.value = true; - console.log("dialogVisible 的值:", dialogVisible.value); // 添加日志确认 -}; - // 保证发送消息时,滚动屏在底部 const tabContentAIchat = ref(null); @@ -909,7 +898,10 @@ const userInfo = ref({ jwcode: "90042088", img: " https://d31zlh4on95l9h.cloudfront.net/images/403ef762dd2f335df3b0c9e3fe488375.png", }); -const changeRule = ref("1金币=1Token"); +const changeRule = ref({ + gold:1, + token:1, +}); const changeLevelList = ref([ { position: 10, calculatedPosition: 10 }, { position: 20, calculatedPosition: 20 }, @@ -922,12 +914,30 @@ const changeLevelList = ref([ const activeLevel = ref( changeLevelList.value[0] || { position: 10, calculatedPosition: 10 } ); -const gold = ref(100); - +const gold = ref(90); +// 点击剩余次数会弹出的弹窗 +// 新增一个 ref 来控制弹窗的显示与隐藏 +const dialogVisible = ref(false); const rechargeDialogVisible = ref(false); const confirmDialogVisible = ref(false); const changeSuccessDialogVisible = ref(false); +// 获取次数 +const showCount = async () => { + try { + const res = await showExchangeAPI(); + changeLevelList.value = res.data; + activeLevel.value = changeLevelList.value[0]; + changeRule.value.token=res.data[0].ratio; + + // 显示弹窗 + dialogVisible.value = true; + console.log("dialogVisible 的值:", dialogVisible.value); // 添加日志确认 + } catch (e) { + console.error("获取兑换列表出错", e); + } +}; + const chooseLevel = (item) => { activeLevel.value = item; }; @@ -1317,7 +1327,8 @@ onUnmounted(() => {
精网号:{{ userInfo.jwcode }}
-
兑换规则:{{ changeRule }}
+
兑换规则:{{ changeRule.gold }}金币={{ changeRule.token }}Token
+
兑换Token
@@ -1669,9 +1680,8 @@ body { cursor: pointer; } -.backToHomeBtn:hover{ +.backToHomeBtn:hover { transform: scale(1.05); - } .backImg { From 25bc10c3ebfa284b180ad515ee9a21053e7a5fbf Mon Sep 17 00:00:00 2001 From: no99 <17663930442@163.com> Date: Tue, 19 Aug 2025 14:39:22 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E6=89=8B=E6=9C=BA=E7=AB=AF=E9=80=82?= =?UTF-8?q?=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/homePage.vue | 128 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 99 insertions(+), 29 deletions(-) diff --git a/src/views/homePage.vue b/src/views/homePage.vue index ac61f56..9e55379 100644 --- a/src/views/homePage.vue +++ b/src/views/homePage.vue @@ -899,8 +899,8 @@ const userInfo = ref({ img: " https://d31zlh4on95l9h.cloudfront.net/images/403ef762dd2f335df3b0c9e3fe488375.png", }); const changeRule = ref({ - gold:1, - token:1, + gold: 1, + token: 1, }); const changeLevelList = ref([ { position: 10, calculatedPosition: 10 }, @@ -928,7 +928,7 @@ const showCount = async () => { const res = await showExchangeAPI(); changeLevelList.value = res.data; activeLevel.value = changeLevelList.value[0]; - changeRule.value.token=res.data[0].ratio; + changeRule.value.token = res.data[0].ratio; // 显示弹窗 dialogVisible.value = true; @@ -1315,7 +1315,7 @@ onUnmounted(() => { - +
@@ -1327,8 +1327,9 @@ onUnmounted(() => {
精网号:{{ userInfo.jwcode }}
-
兑换规则:{{ changeRule.gold }}金币={{ changeRule.token }}Token
- +
+ 兑换规则:{{ changeRule.gold }}金币={{ changeRule.token }}Token +
兑换Token
@@ -1367,7 +1368,7 @@ onUnmounted(() => {
温馨提示
@@ -1388,7 +1389,7 @@ onUnmounted(() => {
兑换
@@ -1407,7 +1408,7 @@ onUnmounted(() => { @@ -1980,22 +1981,6 @@ body { z-index: 6; } -@media (max-width: 768px) { - .action-btn { - height: 21px; - } - - .footer-second-line { - padding: 5px 10px 10px; - } - - .msg-input { - /* min-height: 44px; */ - /* height: 44px; */ - font-size: 16px; - } -} - .changeMsg { display: flex; width: 100%; @@ -2065,6 +2050,8 @@ body { display: flex; background-color: #f8f8f8; width: 20%; + min-width: 70px; + max-width: 150px; justify-content: center; align-items: center; flex-direction: column; @@ -2115,6 +2102,7 @@ body { .changeBtn { width: 40%; + max-width: 350px; background-color: #4e86fe; color: white; display: flex; @@ -2156,8 +2144,9 @@ body { padding: 10px 20px; border-radius: 13px; cursor: pointer; - width: 20%; + min-width: 20%; text-align: center; + white-space: nowrap; } .recharge:hover { @@ -2169,7 +2158,7 @@ body { padding: 10px 20px; border-radius: 13px; cursor: pointer; - width: 20%; + min-width: 20%; text-align: center; } @@ -2204,7 +2193,7 @@ body { padding: 10px 20px; border-radius: 13px; cursor: pointer; - width: 20%; + min-width: 20%; text-align: center; } @@ -2217,7 +2206,7 @@ body { padding: 10px 20px; border-radius: 13px; cursor: pointer; - width: 20%; + min-width: 20%; text-align: center; } @@ -2241,6 +2230,87 @@ body { font-weight: bold; text-align: center; } + +@media (max-width: 768px) { + .action-btn { + height: 21px; + } + + .footer-second-line { + padding: 5px 10px 10px; + } + + .msg-input { + /* min-height: 44px; */ + /* height: 44px; */ + font-size: 16px; + } + + /* .changeImg { + width: 30px; + height: 30px; + } */ + + .changeImgClass { + width: 30px; + height: 30px; + } + + .changeContent { + font-size: 0.5rem; + } + + .changeLevelItems { + font-size: 0.5rem; + } + + .rechargeDialogTitle { + font-size: 1.3rem; + } + .rechargeDialogContent { + font-size: 1rem; + } + + .rechargeDialogBtnGroup { + font-size: 1rem; + } + + .recharge { + padding: 5px 10px; + } + + .rechargeDialogCancel { + padding: 5px 10px; + } + + .confirmDialogTitle { + font-size: 1.3rem; + } + .confirmDialogContent { + font-size: 1rem; + } + + .confirmDialogBtnGroup { + font-size: 1rem; + } + + .confirmDialogConfirm { + padding: 5px 10px; + } + + + .confirmDialogCancel { + padding: 5px 10px; + } + + .changeSuccessDialogTitle { + font-size: 1.3rem; + } + + .changeSuccessDialogContent { + font-size: 1rem; + } +}