From 8c0749ed7e220db183daccc1ed7c35eab14007c9 Mon Sep 17 00:00:00 2001 From: no99 <17663930442@163.com> Date: Thu, 14 Aug 2025 15:30:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E9=A6=96=E9=A1=B5=EF=BC=8C?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=8E=86=E5=8F=B2=E7=BA=AA=E5=BD=95=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=94=E5=9B=9E=E6=A0=BC=E5=BC=8F=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/HistoryRecord.vue | 6 +- src/views/homePage.vue | 132 +++++++++++++++++++++++++++++---- 2 files changed, 122 insertions(+), 16 deletions(-) diff --git a/src/views/components/HistoryRecord.vue b/src/views/components/HistoryRecord.vue index 2adb342..14e4298 100644 --- a/src/views/components/HistoryRecord.vue +++ b/src/views/components/HistoryRecord.vue @@ -418,8 +418,8 @@ const categoryHistory = ref([]); const getHistoryList = async (params) => { try { const result = await getHistoryListAPI(params); - historyRecords.value = result.data.list; - let remainingRecords = result.data.list; // 复制原数组 + historyRecords.value = result.data; + let remainingRecords = result.data; // 复制原数组 // 1. 筛选置顶记录 let topList = remainingRecords.filter((record) => record.isTop === 1); @@ -477,7 +477,7 @@ const getHistoryList = async (params) => { return !recordDate.isAfter(thirtyDaysAgo); }); - historyRecords.value = result.data.list; + historyRecords.value = result.data; categoryHistory.value = [ { diff --git a/src/views/homePage.vue b/src/views/homePage.vue index 660c941..8d15129 100644 --- a/src/views/homePage.vue +++ b/src/views/homePage.vue @@ -267,19 +267,19 @@ const enableInput = () => { // 处理历史记录选择 const handleHistorySelect = (stockData) => { - console.log('接收到历史记录数据:', stockData); - + console.log("接收到历史记录数据:", stockData); + // 如果当前不在AiEmotion页面,切换到AiEmotion页面 // if (activeTab.value !== 'AiEmotion') { // setActiveTab('AiEmotion', 1); // } - + // 等待组件渲染完成后调用addStock方法 nextTick(() => { if (aiEmotionRef.value && aiEmotionRef.value.addStock) { aiEmotionRef.value.addStock(stockData); } else { - console.error('AiEmotion组件或addStock方法不可用'); + console.error("AiEmotion组件或addStock方法不可用"); } }); }; @@ -631,6 +631,40 @@ const expandHistory = () => { } }; +const backToHome = () => { + if (isMobile.value) { + console.log("用户是移动端"); + // 调用原生方法跳转到首页 + uni.postMessage({ + data: { + val: { + name: "JWopenView", + extra: { + data: { + type: 3, + }, + }, + }, + }, + }); + } else { + console.log("用户是pc端"); + const env = import.meta.env.VITE_ENV; + console.log("当前的环境为:", env); + if (env == "development" || env == "test") { + window.parent.location.href = + "http://121.89.234.155:8807/hljw/homepage?menu=999999991"; + } else if (env == "product") { + window.parent.location.href = + "https://web.homilychart.com/product/hljw/homepage?menu=999999991"; + } else if (env == "production") { + window.parent.location.href = + "https://web.homilychart.com/hljw/homepage?menu=999999991"; + } + // window.parent.location.href = window.parent.document.referrer + } +}; + onMounted(async () => { throttledJudgeDevice(); // 禁用全局触摸滚动 @@ -716,6 +750,14 @@ onUnmounted(() => {