From 83c0f2eaaf7c4b9159cab946445a689220f8ff5e Mon Sep 17 00:00:00 2001 From: wangyetao <2898314561@qq.com> Date: Thu, 23 Oct 2025 20:08:01 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E7=BC=BA=E7=9C=81=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages.json b/pages.json index 0efbef4..8ccdc0b 100644 --- a/pages.json +++ b/pages.json @@ -130,7 +130,7 @@ "bounce": false } }, - { + { "path": "pages/blank/blank", "style": { "navigationBarTitleText": "", From 2a2a772462bc3e672f9512a15fa55b2cdc7a8544 Mon Sep 17 00:00:00 2001 From: wangyetao <2898314561@qq.com> Date: Thu, 23 Oct 2025 21:12:53 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AF=8D=E6=9D=A1?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/deepMate/deepMate.vue | 107 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 96 insertions(+), 11 deletions(-) diff --git a/pages/deepMate/deepMate.vue b/pages/deepMate/deepMate.vue index 558e4ab..13208e1 100644 --- a/pages/deepMate/deepMate.vue +++ b/pages/deepMate/deepMate.vue @@ -33,11 +33,10 @@ - - 个股诊断 - 市场情绪温度计 - 买卖时机提示 - 个股 + + + {{ tab }} + @@ -135,7 +134,7 @@ \ No newline at end of file From f4f5514df0fca23049075678e9d2d481a90f5314 Mon Sep 17 00:00:00 2001 From: wangyetao <2898314561@qq.com> Date: Sat, 25 Oct 2025 17:07:07 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/deepMate/deepMate.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pages/deepMate/deepMate.vue b/pages/deepMate/deepMate.vue index 77ff2d9..5c69819 100644 --- a/pages/deepMate/deepMate.vue +++ b/pages/deepMate/deepMate.vue @@ -255,9 +255,7 @@ onMounted(() => { backTopY.value = initY; initUUID(); - if (messages.value.length === 0) { - nextTick(startTabsMarquee); - } + if (messages.value.length > 0) { nextTick(() => { measureChatContainer(); scrollToBottom(); }); } From 6eed33e9c2048ac17b73f04d1c2e9115ff3d5b17 Mon Sep 17 00:00:00 2001 From: wangyetao <2898314561@qq.com> Date: Sat, 25 Oct 2025 17:21:24 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/deepMate/deepMate.vue | 354 +++++++++++++++++++++++++++++--------------- 1 file changed, 232 insertions(+), 122 deletions(-) diff --git a/pages/deepMate/deepMate.vue b/pages/deepMate/deepMate.vue index 5c69819..e04d5dd 100644 --- a/pages/deepMate/deepMate.vue +++ b/pages/deepMate/deepMate.vue @@ -3,23 +3,17 @@ - + + DeepMate - - + + + - - - - - - - Hi, 我是您的股市随身顾问~ - 个股诊断、市场情绪解读,都可以找我。 - - + + + + + + + Hi, 我是您的股市随身顾问~ + 个股诊断、市场情绪解读,都可以找我。 + + - - + - - - - - - - 当前特斯拉该如何布局? - TSLA + + + + + + + 当前特斯拉该如何布局? + TSLA + + + - - - - + - - - Hi, 我是您的股市随身顾问~ 个股诊断、市场情绪解读,都可以找我。 - - - + + + + + Hi, 我是您的股市随身顾问~ 个股诊断、市场情绪解读,都可以找我。 + + + + - + - + "> - +
-
-
∞
-
深度思考 正在思考
-
25 个结果
-
- ↑ - ↓ -
+
+
∞
+
深度思考 正在思考
+
25 个结果
+
+ ↑ + ↓
-
-
-
- ✓ -
-
问题分析完成
+
+
+
+
+ ✓
-
-
- ✓ -
-
收集相关信息
+
问题分析完成
+
+
+
+ ✓
+
收集相关信息
+
- - {{ message.content }} + + {{ message.content }} @@ -149,14 +138,8 @@ - + - 以上数据由AI生成,不作为最终投资建议,决策需独立! + 以上数据由AI生成,不作为最终投资建议,决策需独立! + + + + + + + + + 搜索历史 + × + + + + 暂无搜索历史 + + + {{ item.query }} + {{ formatTime(item.time) }} + + - @@ -186,7 +180,7 @@ const { safeAreaInsets } = uni.getSystemInfoSync(); import { ref, computed, onMounted, onUnmounted, watch, nextTick } from "vue"; -import footerBar from '../../components/footerBar-cn' +import footerBar from '../../components/footerBar-cn' import marked from "marked"; // 引入 marked 库 import { onPageScroll } from '@dcloudio/uni-app' // 设置 marked 选项 @@ -215,6 +209,8 @@ const chatScrollTop = ref(0); const chatContainerHeight = ref(0); const uuid = ref(""); const messages = ref([]); +const showHistoryDrawer = ref(false); +const searchHistory = ref([]); const hotTopics = ref([ { id: 1, @@ -255,10 +251,16 @@ onMounted(() => { backTopY.value = initY; initUUID(); - + if (messages.value.length === 0) { + nextTick(startTabsMarquee); + } if (messages.value.length > 0) { nextTick(() => { measureChatContainer(); scrollToBottom(); }); } + + // 载入历史 + const hist = uni.getStorageSync("search_history") || []; + searchHistory.value = Array.isArray(hist) ? hist : []; }); // 初始化 UUID @@ -303,6 +305,22 @@ const goBlank = () => { }); }; +// 历史抽屉控制 +const openHistoryDrawer = () => { showHistoryDrawer.value = true; }; +const closeHistoryDrawer = () => { showHistoryDrawer.value = false; }; + +// 时间格式化:YYYY-MM-DD HH:mm +const pad2 = (n) => (n < 10 ? '0' + n : '' + n); +const formatTime = (t) => { + const d = new Date(t); + const y = d.getFullYear(); + const m = pad2(d.getMonth() + 1); + const day = pad2(d.getDate()); + const hh = pad2(d.getHours()); + const mm = pad2(d.getMinutes()); + return `${y}-${m}-${day} ${hh}:${mm}`; +}; + // 发送消息 const sendMessage = () => { if (inputMessage.value.trim() === "" || isSending.value) return; @@ -317,6 +335,11 @@ const sendMessage = () => { messages.value.push(userMessage); inputMessage.value = ""; + // 记录搜索历史 + const entry = { query: userMessage.content, time: Date.now() }; + searchHistory.value.unshift(entry); + uni.setStorageSync('search_history', searchHistory.value); + // 发送后强制恢复并滚到底部 shouldAutoScroll.value = true; nextTick(() => { forceScrollToBottom(); }); @@ -386,7 +409,7 @@ const simulateBotResponse = (userMessage) => { const botIndex = messages.value.length - 1; const baseDelay = 165; // 普通字符基础延迟(毫秒) const slowPunct = /[。!?!?;;]/; // 句号、感叹号、分号等较长停顿 - const midPunct = /[,、,::]/; // 逗号、顿号、冒号等中等停顿 + const midPunct = /[,、,::]/; // 逗号、顿号、冒号等中等停顿 const typeWriter = () => { if (index < responseText.length) { @@ -545,10 +568,15 @@ const onBackTopClick = () => { .deepMate-page { display: flex; flex-direction: column; - position: fixed; /* 充满视口,彻底禁用页面滚动 */ - top: 0; left: 0; right: 0; bottom: 0; + position: fixed; + /* 充满视口,彻底禁用页面滚动 */ + top: 0; + left: 0; + right: 0; + bottom: 0; height: 100vh; - overflow: hidden; /* 锁定页面滚动 */ + overflow: hidden; + /* 锁定页面滚动 */ background-color: #ffffff; padding: 20rpx 0rpx; } @@ -559,7 +587,7 @@ const onBackTopClick = () => { align-items: center; padding: 20rpx 30rpx; background-color: #ffffff; - box-shadow: 0 2rpx rgba(0, 0, 0, 0.1); + box-shadow: 0 2rpx rgba(0, 0, 0, 0.1); } .header-left, @@ -598,7 +626,8 @@ const onBackTopClick = () => { flex: 1; display: flex; flex-direction: column; - overflow: hidden; /* 内部滚动交给聊天容器 */ + overflow: hidden; + /* 内部滚动交给聊天容器 */ padding: 20rpx; margin-top: 1rpx; margin-bottom: 120rpx; @@ -607,7 +636,8 @@ const onBackTopClick = () => { /* 聊天顶部粘性欢迎块样式 */ .chat-header { position: sticky; - top: 0; /* 在页面滚动时始终贴顶 */ + top: 0; + /* 在页面滚动时始终贴顶 */ z-index: 50; background-color: #ffffff; padding: 3rpx 20rpx; @@ -784,7 +814,8 @@ const onBackTopClick = () => { .chat-container { margin-top: 30rpx; border-radius: 10rpx; - height: 65%; /* 缩短滚动区域,避免被输入框覆盖 */ + height: 65%; + /* 缩短滚动区域,避免被输入框覆盖 */ overflow-y: auto; -webkit-overflow-scrolling: touch; } @@ -829,7 +860,7 @@ const onBackTopClick = () => { .bot-message .message-icon { background: url('https://d31zlh4on95l9h.cloudfront.net/images/61fa384381c88ad80be28f41827fe0e5.svg'); - + color: white; } @@ -845,7 +876,7 @@ const onBackTopClick = () => { } .bot-message .message-content { - background-color: #f0f0f0; + background-color: #f0f0f0; border-radius: 10rpx; padding: 15rpx; } @@ -891,11 +922,13 @@ const onBackTopClick = () => { } @keyframes loading { + 0%, 80%, 100% { transform: scale(0); } + 40% { transform: scale(1); } @@ -948,6 +981,7 @@ const onBackTopClick = () => { color: #ffffff !important; opacity: 1; } + /* .uni-scroll-view{ height: 92%; } */ @@ -975,24 +1009,30 @@ const onBackTopClick = () => { justify-content: center; margin-top: 15rpx; } + .banner-panel { position: relative; - height: 480rpx; /* 拉长容器,灰色背景跟随变高 */ - overflow: hidden; /* 让圆角和内部层剪裁一致 */ + height: 480rpx; + /* 拉长容器,灰色背景跟随变高 */ + overflow: hidden; + /* 让圆角和内部层剪裁一致 */ border-radius: 15rpx; } -.panelShow{ + +.panelShow { height: 12%; } .pray-banner { position: absolute; /* background-size: 100% 100%; */ - inset: 0; /* 顶部、底部、左、右都贴合容器 */ + inset: 0; + /* 顶部、底部、左、右都贴合容器 */ width: 100%; height: 81%; border-radius: 15rpx; - z-index: 1; /* 在灰底之上、内容之下 */ + z-index: 1; + /* 在灰底之上、内容之下 */ } @@ -1000,12 +1040,14 @@ const onBackTopClick = () => { margin: 0 20rpx; gap: 5rpx; } + .banner-panel .robot-container, .banner-panel .function-tabs, .banner-panel .recommend-card { position: relative; z-index: 2; } + .back-to-top { position: fixed; left: 0; @@ -1014,13 +1056,81 @@ const onBackTopClick = () => { height: 100rpx; z-index: 1000; } + .back-to-top:active { transform: scale(0.96); } + .static-footer { - position: fixed; - bottom: 0; + position: fixed; + bottom: 0; +} + +/* 搜索历史侧拉框样式 */ +.drawer-overlay { + position: fixed; + left: 0; + top: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.35); + z-index: 900; +} + +.drawer-panel { + position: fixed; + top: 0; + right: 0; + bottom: 0; + width: 600rpx; + max-width: 75%; + background: #ffffff; + box-shadow: -8rpx 0 20rpx rgba(0, 0, 0, 0.08); + z-index: 901; + display: flex; + flex-direction: column; +} + +.drawer-header { + display: flex; + align-items: center; + justify-content: space-between; + padding: 24rpx 28rpx; + border-bottom: 2rpx solid #f0f0f0; } + +.drawer-title { + font-size: 32rpx; + font-weight: 600; + color: #333333; +} + +.drawer-close { + font-size: 42rpx; + color: #999999; +} + +.drawer-content { + flex: 1; + padding: 20rpx 24rpx; +} + +.history-card { + background-color: #fff; + border: 2rpx solid #f2f2f2; + border-left: 8rpx solid rgb(220, 31, 29); + border-radius: 12rpx; + padding: 18rpx 20rpx; + margin-bottom: 16rpx; + box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.03); +} + +.history-query { + font-size: 28rpx; + color: #333333; + font-weight: 500; } +.history-time { margin-top: 8rpx; font-size: 22rpx; color: #888888; } +.empty-history { padding: 40rpx; color: #999999; text-align: center; } .thinking-process { margin: 20rpx 0; border: 2rpx solid #e5e5e5; From 864045d7aeeed3c5eb02a79210eb1a01de704d82 Mon Sep 17 00:00:00 2001 From: wangyetao <2898314561@qq.com> Date: Sat, 25 Oct 2025 18:46:47 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/deepMate/deepMate.vue | 151 +++++++++++++++++++++++--------------------- 1 file changed, 80 insertions(+), 71 deletions(-) diff --git a/pages/deepMate/deepMate.vue b/pages/deepMate/deepMate.vue index e04d5dd..703e3ca 100644 --- a/pages/deepMate/deepMate.vue +++ b/pages/deepMate/deepMate.vue @@ -97,34 +97,44 @@ - - -
-
-
∞
-
深度思考 正在思考
-
25 个结果
-
- ↑ - ↓ -
-
-
-
-
- ✓ -
-
问题分析完成
-
-
-
- ✓ -
-
收集相关信息
-
-
-
-
+ + + + + ∞ + {{ + message.isTyping ? "正在思考" : "思考完成" + }} + + + + + ↑ + ↓ + + + + + + ✓ + + 问题分析完成 + + + + ✓ + + 收集相关信息 + + + + @@ -252,7 +262,7 @@ onMounted(() => { initUUID(); if (messages.value.length === 0) { - nextTick(startTabsMarquee); + // nextTick(startTabsMarquee); } if (messages.value.length > 0) { nextTick(() => { measureChatContainer(); scrollToBottom(); }); @@ -342,14 +352,14 @@ const sendMessage = () => { // 发送后强制恢复并滚到底部 shouldAutoScroll.value = true; - nextTick(() => { forceScrollToBottom(); }); + nextTick(() => { scrollToBottom(); }); // 模拟机器人回复 simulateBotResponse(userMessage.content); }; // 模拟机器人回复 -const simulateBotResponse = (userMessage) => { +const simulateBotResponse = async(userMessage) => { isSending.value = true; // 添加机器人加载消息 @@ -357,57 +367,32 @@ const simulateBotResponse = (userMessage) => { content: "", isUser: false, isTyping: true, - isThinking: false, + isThinking: true, }; messages.value.push(botMsg); + + // 添加请求延迟 + await new Promise((resolve) => setTimeout(resolve, 2000)); + const toDataInfo = await getDataInfo(); + console.log(toDataInfo); + // dataInfo.value = toDataInfo.data; + // console.log(dataInfo.value); + messages.value[messages.value.length - 1].isThinking = false; + + // 滚动到底部 nextTick(() => { scrollToBottom(); }); // 模拟流式响应 - let responseText = `我已经收到您的消息: "${userMessage}"。 ## 股票分析报告 - -### 股票名称: Tesla Inc. (TSLA) - -- **当前价格**: 448.980 -- **更新时间**: 23/10/2025 -- **今日无变盘点** - -### 技术分析 -- **CFTL**: 当前牵牛绳为红色,处于龙线区域,最近出现“牛刀小试”,度牛线目前处于青绿色区域。 -- **空间预测**: - - 预测低一值: 413.364 - - 预测高一值: 426.636 - - 预测低二值: 421.670 - - 预测高二值: 448.314 -- **能量分析**: AI智能均线多头排列,当前卖盘小于买盘 - -### 资金与主力 -- **主力分析**: - 1. 该股庄家中长期筹码成本价格为 356.036,短期资金成本价格为 406.429。该股筹码分散,当日筹码成本价格为 439.322。 - 2. 近日没有出现主力集中吸筹。 - 3. 近期主力持仓比例大于散户持仓比例。当日主力持仓增加。当日散户持仓减少。 - -### 综合评价 -- **个股走势评价**: - - 该股整体趋势向好,出现暴涨的可能性较大,当前如果已经持有该股票,可以继续持股观察,如果尚未持有该股票,可持续进行观察,目前处于机会的初期,处于反弹阶段,可以分步建仓! - -- **核心证据链**: - - 资金共识:当日多方资金流入。 - - 趋势动能:该股中长期处于上升趋势,短期处于弱势状态。 - -- **牛股评级**: ★★★☆☆ -- **暴涨概率**: 60% -- **风险评估**: 非常安全 -- **安全边际**: 432.671~458.057 -- **黄金价域**: 427.995~440.835`; + let responseText = `我已经收到您的消息: "${userMessage}"。+"${toDataInfo.data}" `; let index = 0; const botIndex = messages.value.length - 1; - const baseDelay = 165; // 普通字符基础延迟(毫秒) + const baseDelay = 5; // 普通字符基础延迟(毫秒) const slowPunct = /[。!?!?;;]/; // 句号、感叹号、分号等较长停顿 const midPunct = /[,、,::]/; // 逗号、顿号、冒号等中等停顿 @@ -472,7 +457,7 @@ const shouldAutoScroll = ref(true); const latestContentHeight = ref(0); const lastScrollTop = ref(0); const windowHeight = uni.getSystemInfoSync().windowHeight; -const AUTO_SCROLL_REENABLE_THRESHOLD = 400; // px,接近底部时恢复自动滚动 +const AUTO_SCROLL_REENABLE_THRESHOLD = 40000; // px,接近底部时恢复自动滚动 const onChatScroll = (e) => { const st = e.detail?.scrollTop || 0; @@ -562,6 +547,30 @@ const onBackTopClick = () => { scrollToTop(); }; + + +function getDataInfo() { + return new Promise((resolve, reject) => { + uni.request({ + url: "http://localhost:8888/ka", + data: {}, + header: { + Accept: "application/json", + "Content-Type": "application/json", + "X-Requested-With": "XMLHttpRequest", + }, + method: "GET", + sslVerify: true, + success: (res) => { + resolve(res.data); + }, + fail: (error) => { + reject(error); + }, + }); + }); +} +