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(() => {