- + - - + + - + Hi, 我是您的股市随身顾问~ - + - + - + - + @@ -149,10 +107,7 @@ message.isTyping ? "正在思考" : "思考完成" }} - + @@ -174,11 +129,8 @@ - + {{ message.content }} @@ -189,14 +141,8 @@ - + - 以上数据由AI生成,不作为最终投资建议,决策需独立! + 以上数据由AI生成,不作为最终投资建议,决策需独立! - + }" @touchstart="onBackTopTouchStart" @touchmove="onBackTopTouchMove" @touchend="onBackTopTouchEnd" + @click="onBackTopClick"> - + 历史对话 @@ -427,11 +366,11 @@ const formatTime = (t) => { // 历史分组(今天/昨天/近一周/按月) const groupedHistory = computed(() => { const sections = []; - + // 从缓存获取今天日期,如果没有则使用当前日期 const cachedTodayStr = uni.getStorageSync('today_date'); const now = cachedTodayStr ? new Date(cachedTodayStr + 'T00:00:00') : new Date(); - + const startOfDay = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate()); const isSameDay = (a, b) => startOfDay(a).getTime() === startOfDay(b).getTime(); const isYesterday = (d) => { @@ -531,12 +470,10 @@ const simulateBotResponse = async (userMessage) => { // 首先进行意图识别 const res = await postIntent({ - content: "森那美", - language: "cn", - marketlist: "hk,cn,usa,my,sg,vi,in,gb", - token: - "9ior41AF0xTIbIG2pRnnbZi0+fEeMx8pywnilrmTwo5FbqJ91WrSWOxp9MkpKiNtedtUafqvzIwpFKrwuMs", - model: "1", + content: userMessage, + language: 'cn', + marketList: 'hk,cn,usa,my,sg,vi,in,gb', + token: "pCtw6AYK0EHAaIexoFHsbZjtsfEAIhcmwkCFm6uKko8VPfMvyDiODL9v9c0veic9fIpQbvT8zN4sH/Si6Q" }); console.log("res" + res); @@ -557,8 +494,7 @@ const simulateBotResponse = async (userMessage) => { recordId, parentId, stockId, - token: - "9ior41AF0xTIbIG2pRnnbZi0+fEeMx8pywnilrmTwo5FbqJ91WrSWOxp9MkpKiNtedtUafqvzIwpFKrwuMs", + token: memberStore.userInfo?.token || '', language: "cn", }); console.log("StockInfo", StockInfo); @@ -607,8 +543,8 @@ const simulateBotResponse = async (userMessage) => { const delay = slowPunct.test(ch) ? 220 : midPunct.test(ch) - ? 120 - : baseDelay; + ? 120 + : baseDelay; setTimeout(typeWriter, delay); } else { const current = messages.value[botIndex]; @@ -917,7 +853,7 @@ const onBackTopClick = () => { /* box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05); */ } -.welcome-section{ +.welcome-section { /* 灰色卡片(recommend-card)之后展示背景图 */ margin-top: 10rpx; display: flex; @@ -925,9 +861,12 @@ const onBackTopClick = () => { justify-content: center; background: url('https://d31zlh4on95l9h.cloudfront.net/images/eca84d9fb54712cb3bc6c6174773b83b.svg'); background-repeat: no-repeat; - background-position: center top; /* 放在容器顶部,正好在灰色卡片下方 */ - background-size: 80% auto; /* 缩放以适配宽度 */ - height: 460rpx; /* 提供可视高度,让背景图可见 */ + background-position: center top; + /* 放在容器顶部,正好在灰色卡片下方 */ + background-size: 80% auto; + /* 缩放以适配宽度 */ + height: 460rpx; + /* 提供可视高度,让背景图可见 */ } .card-content { @@ -1097,7 +1036,7 @@ const onBackTopClick = () => { } .user-message .message-text { - color:black; + color: black; } .bot-message .message-text { @@ -1132,6 +1071,7 @@ const onBackTopClick = () => { } @keyframes loading { + 0%, 80%, 100% { @@ -1312,11 +1252,12 @@ const onBackTopClick = () => { height: 48px; border-radius: 12px; background: #fff; - box-shadow: 0 2px 10px rgba(0,0,0,0.08); + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); display: flex; align-items: center; justify-content: center; } + .drawer-back-icon { font-size: 16px; color: #8a8a8a; @@ -1383,19 +1324,23 @@ const onBackTopClick = () => { .drawer-content { flex: 1; - min-height: 0; /* 让 flex 子元素可在容器内收缩以启用滚动 */ + min-height: 0; + /* 让 flex 子元素可在容器内收缩以启用滚动 */ height: 100%; - overscroll-behavior-y: contain; /* 防止滚动串联到页面 */ - -webkit-overflow-scrolling: touch; /* iOS 惯性滚动 */ - touch-action: pan-y; /* 优化触控滚动,仅垂直 */ + overscroll-behavior-y: contain; + /* 防止滚动串联到页面 */ + -webkit-overflow-scrolling: touch; + /* iOS 惯性滚动 */ + touch-action: pan-y; + /* 优化触控滚动,仅垂直 */ } .drawer-inner { padding: 20rpx 24rpx 20rpx 24rpx; } -.history-section { - margin-bottom: 20rpx; +.history-section { + margin-bottom: 20rpx; /* margin: 0 24rpx; */ } @@ -1414,7 +1359,9 @@ const onBackTopClick = () => { margin-bottom: 12rpx; } -.history-left { margin-right: 12rpx; } +.history-left { + margin-right: 12rpx; +} .flag-circle { width: 36rpx; @@ -1427,9 +1374,13 @@ const onBackTopClick = () => { justify-content: center; } -.flag-emoji { font-size: 24rpx; } +.flag-emoji { + font-size: 24rpx; +} -.history-main { flex: 1; } +.history-main { + flex: 1; +} .history-query { font-size: 28rpx; @@ -1456,16 +1407,19 @@ const onBackTopClick = () => { 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: 10rpx 0; border: 2rpx solid #e5e5e5; diff --git a/server/deepchart.json b/server/deepchart.json deleted file mode 100644 index 469dc6d..0000000 --- a/server/deepchart.json +++ /dev/null @@ -1,23 +0,0 @@ - - -{ - "intent":{ - "code": 200, - "message": "操作成功", - "data": { - "code": "1A0001", - "market": "cn", - "name": "上证指数", - "refuse": "", - "recordId": 15, - "parentId": 14, - "stockId": 25, - "language": "cn", - "debug_url": "https://www.coze.cn/work_flow?execute_id=7564771475955515444&space_id=7564250621483040822&workflow_id=7564368306322292788&execute_mode=2" - } -}, -"stocks":{"code":"200","cftl":"当前股票处于安全区,牵牛绳为红色,出现蓝色推进K线","date":"更新时间: 24/10/2025","debug_url":"https://www.coze.cn/work_flow?execute_id=7565080703726846004&space_id=7564250621483040822&workflow_id=7564596757864071195&execute_mode=2","gfzl":"该股整体趋势相对较强,个股正处于推进上涨的关键阶段。若当前持有该股票,建议继续持有,进行持续跟踪。若当前无该股票,建议持续跟踪,等待适当时机再进行介入。","hxjzpg":"(1)牛股评级:★★☆☆☆\n(2)暴涨概率:40%\n(3)风险评估:非常安全\n(4)黄金价域:258.984~266.753\n(5)核心证据链\n 资金共识:当日多方资金流入\n 趋势动能:该股中长期处于上升趋势,短期处于强势状态。","kongjian":"预测低一值255.468,预测高一值257.692,预测低二值255.156,预测高二值255.807", -"markdown":" \n# Alphabet Inc.全景作战报告\n## 📊 股票分析报告\n### 📈 股票基本信息\n- **股票名称**: Alphabet Inc.\n- **股票代码**: GOOGL\n- **当前价格**: 259.920\n- **更新时间**: 2025年10月24日\n- **时间节点**: 今日无变盘点\n\n### 🎯 核心价值评估\n- **安全边际**: 164.424 ~ \n- **黄金价域**: 258.984 ~ 266.753\n- **核心证据链**:\n - 🟢 **资金共识**: 当日多方资金流入\n - 🔥 **趋势动能**: 该股中长期处于上升趋势,短期处于强势状态。\n\n### 🕵️ 主力作战分析\n- **主力行为**:\n 1. 📊 该股庄家中长期筹码成本价格为 207.497,短期资金成本价格为 239.503。该股筹码分散,当日筹码成本价格为 254.335。\n 2. 🔍 近日没有出现主力集中吸筹。\n 3. 📈 近期主力持仓比例大于散户持仓比例。 当日主力持仓增加。 当日散户持仓减少。\n\n### 📊 技术分析\n- **空间维度**:\n - 📉 预测低一值: 255.468\n - 📈 预测高一值: 257.692\n - 📉 预测低二值: 255.156\n - 📈 预测高二值: 255.807\n- **能量分析**: AI智能均线多头排列,当前卖盘小于买盘\n\n### ⚡ 综合作战分析\n- **触发条件**: 当前股票处于安全区,牵牛绳为红色,出现蓝色推进K线\n- **攻防指令**: 该股整体趋势相对较强,个股正处于推进上涨的关键阶段。若当前持有该股票,建议继续持有,进行持续跟踪。若当前无该股票,建议持续跟踪,等待适当时机再进行介入。\n\n---\n*该内容由AI生成,仅供参考,投资有风险,请注意甄别。*\n ","message":"","name":"股票名称: Alphabet Inc.(GOOGL)","nengliang":"AI智能均线多头排列,当前卖盘小于买盘","price":"当前价格: 259.920","shijian":"今日无变盘点","zhuli1":"(1)该股庄家中长期筹码成本价格为 207.497,短期资金成本价格为 239.503。该股筹码分散,当日筹码成本价格为 254.335。","zhuli2":"(2)近日没有出现主力集中吸筹。","zhuli3":"(3)近期主力持仓比例大于散户持仓比例。 当日主力持仓增加。 当日散户持仓减少。"} - - -} \ No newline at end of file diff --git a/utils/http.js b/utils/http.js index 4a55bde..da962ce 100644 --- a/utils/http.js +++ b/utils/http.js @@ -1,27 +1,48 @@ -import { useUserStore } from "../stores/modules/userInfo"; +import { useUserStore } from "../stores/modules/userInfo/" -const baseURL = "http://localhost:8888" +// 移除本地 mock 前缀,默认不拼接任何 baseURL。 +// 如需指定真实后端,请将此值改为对应域名,例如: +const baseURL = "https://hwjb.homilychart.com" const httpInterceptor = { // 拦截前触发 invoke(options) { - // 1.非http - if (!options.url.startsWith('http')) { - options.url = baseURL + options.url + // 打印当前 baseURL 便于定位来源 + console.log('HTTP(baseURL)=', baseURL) + // 若出现旧代码将 url 设为 http://localhost:8888,强制改为真实域名 + if (options.url.startsWith('http://localhost:8888')) { + options.url = baseURL.replace(/\/$/, '') + options.url.replace('http://localhost:8888', '') + } else if (options.url.startsWith('https://localhost:8888')) { + options.url = baseURL.replace(/\/$/, '') + options.url.replace('https://localhost:8888', '') } + // 仅当明确配置了 baseURL 时才拼接前缀(去掉 baseURL 尾部的斜杠,避免双斜杠) + if (baseURL && !options.url.startsWith('http')) { + options.url = baseURL.replace(/\/$/, '') + options.url + } + // 打印最终请求地址 + console.log('HTTP(finalUrl)=', options.url) // 2.请求超时,默认60s options.timeout = 60000 console.log(options) //3 添加小程序端请求头 + const sys = uni.getSystemInfoSync(); + // 为对齐后端文档示例,client 固定为 ios(如需按平台设置再改回) + const client = 'ios'; options.header = { ...options.header, - 'source-client': 'miniapp' + 'source-client': 'miniapp', + // 标准头与文档头同时设置,确保兼容 + 'content-type': 'application/json', + 'version': '1', + 'client': client } //4 添加token const memberStore = useUserStore() - const token = memberStore.userInfo?.token + // const token = memberStore.userInfo?.token + const token = '6d818cda701590750245ce69393f2c32' if (token) { + // 根据接口文档,token应该作为独立的header字段 options.header.Authorization = { 'token': token }