From 80380db0a88932119b6d15d4bf1e1a08a7857251 Mon Sep 17 00:00:00 2001
From: Ethereal <3432649580@qq.com>
Date: Fri, 24 Oct 2025 20:14:12 +0800
Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=8F=91=E8=AF=B7=E6=B1=82=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A30?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/deepMate/deepMate.vue | 156 ++++++++++++++++++++++++--------------------
1 file changed, 84 insertions(+), 72 deletions(-)
diff --git a/pages/deepMate/deepMate.vue b/pages/deepMate/deepMate.vue
index 477b1fd..522472e 100644
--- a/pages/deepMate/deepMate.vue
+++ b/pages/deepMate/deepMate.vue
@@ -165,7 +165,11 @@
-
+
{{ message.content }}
@@ -211,24 +215,24 @@ const { safeAreaInsets } = uni.getSystemInfoSync();
import { ref, onMounted, nextTick, watch } from "vue";
import footerBar from "../../components/footerBar-cn.vue";
-import marked from "marked"; // 引入 marked 库
+import marked from "marked"; // 引入 marked 库
// 设置 marked 选项
marked.setOptions({
renderer: new marked.Renderer(),
highlight: null, // 如果需要代码高亮,可以设置适当的函数
- langPrefix: 'language-',
+ langPrefix: "language-",
pedantic: false,
gfm: true,
breaks: false,
sanitize: false,
smartLists: true,
smartypants: false,
- xhtml: false
+ xhtml: false,
});
// 创建一个用于渲染 Markdown 的函数
const renderMarkdown = (content) => {
- if (!content) return '';
+ if (!content) return "";
return marked.parse(content);
};
@@ -239,7 +243,7 @@ const isSending = ref(false);
const uuid = ref("");
const messages = ref([]);
const scrollTop = ref(0); // 用于控制scroll-view的滚动位置
-const dataInfo = ref("")
+// const dataInfo = ref("");
const hotTopics = ref([
{
@@ -321,11 +325,9 @@ const goBlank = () => {
};
// 发送消息
-const sendMessage = () => {
+const sendMessage = () => {
if (inputMessage.value.trim() === "" || isSending.value) return;
-
-
const userMessage = {
content: inputMessage.value,
isUser: true,
@@ -369,7 +371,7 @@ const sendMessageList = (listMessage) => {
};
// 模拟机器人回复
-const simulateBotResponse = (userMessage) => {
+const simulateBotResponse = async (userMessage) => {
isSending.value = true;
// 添加机器人加载消息
@@ -382,49 +384,61 @@ const simulateBotResponse = (userMessage) => {
messages.value.push(botMsg);
+ const toDataInfo = await getDataInfo();
+ console.log(toDataInfo);
+ // dataInfo.value = toDataInfo.data;
+ // console.log(dataInfo.value);
+
+ setTimeout(() => {
+
+ }, 10000);
+
+
+
// 滚动到底部
setTimeout(() => {
scrollToBottom();
}, 100);
// 模拟流式响应
- 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 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 index = 0;
const typeWriter = () => {
@@ -443,6 +457,7 @@ const simulateBotResponse = (userMessage) => {
} else {
messages.value[messages.value.length - 1].isTyping = false;
isSending.value = false;
+ dataInfo.value = '';
// 最后确保滚动到底部
setTimeout(() => {
scrollToBottom();
@@ -476,30 +491,27 @@ const toggleThinking = () => {
showThinking.value = !showThinking.value;
};
-
-
-// function getDataInfo() {
-// return 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) => {
-// console.log(res.data);
-// res.data.forEach(item => {
-// console.log("item是"+item);
-// dataInfo.value = item.name;
-// });
-
-// },
-// fail: (error) => {}
-// })
-// }
+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);
+ },
+ });
+ });
+}