diff --git a/api/customerServicePlatform/customerServicePlatform.js b/api/customerServicePlatform/customerServicePlatform.js index 0f20be0..0345ab0 100644 --- a/api/customerServicePlatform/customerServicePlatform.js +++ b/api/customerServicePlatform/customerServicePlatform.js @@ -14,7 +14,7 @@ export const uploadImageApi = (data) => { export const getAnswerApi = (data) => { return http({ method: 'POST', - url: 'http://pbb6edde.natappfree.cc' +'/api/customer/askQuestion', + url: '/api/customer/askQuestion', data }) } @@ -23,7 +23,7 @@ export const getAnswerApi = (data) => { export const getQuestionApi = (data) => { return http({ method: 'GET', - url: 'http://pbb6edde.natappfree.cc' +'/api/customer/getQuestion', + url: '/api/customer/getQuestion', }) } diff --git a/components/DeepMate.vue b/components/DeepMate.vue index d7a0f67..2891c1e 100644 --- a/components/DeepMate.vue +++ b/components/DeepMate.vue @@ -26,18 +26,19 @@ 市场风险提示 - + @@ -196,16 +197,20 @@ .stock-input { flex: 1; height: 36px; - font-size: 14px; + font-size: 13px; color: #ffffff; - padding: 0 10px; + padding: 0 8px; border: none; background-color: transparent; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } -.stock-input::placeholder { +/* .stock-input::placeholder { color: rgba(255, 255, 255, 0.8); -} +} */ .send-button-container { display: flex; @@ -278,4 +283,28 @@ opacity: 0; } } + +/* 小屏幕设备优化 */ +@media screen and (max-width: 375px) { + .stock-input { + font-size: 12px; + padding: 0 6px; + } + + .deepmate-action { + padding: 6px 12px; + } +} + +/* 超小屏幕设备优化 */ +@media screen and (max-width: 320px) { + .stock-input { + font-size: 11px; + padding: 0 4px; + } + + .deepmate-action { + padding: 5px 10px; + } +} \ No newline at end of file diff --git a/components/deepExploration_header.vue b/components/deepExploration_header.vue index db2188d..8c86684 100644 --- a/components/deepExploration_header.vue +++ b/components/deepExploration_header.vue @@ -65,8 +65,16 @@ class="history-item" > - + + + + + {{ item.stockName }} ({{ item.stockCode }}) - {{ modelType(item.model) }} {{ formatTimeForHistory(item.createdTime) @@ -165,6 +172,20 @@ const onDrawerBackClick = () => { }; // 历史记录国家图像 +function modelImage(model) { + switch (model) { + case 1: + return "../../static/icons/tracking.png"; + case 2: + return "../../static/icons/radar.png"; + case 3: + return "../../static/icons/decoding.png"; + case 4: + return "../../static/icons/funds.png"; + } +} + +// 历史记录国家图像 function stockImage(Market) { switch (Market) { case "usa": @@ -186,7 +207,6 @@ function stockImage(Market) { } } - // 历史记录详情 async function itemClick(item) { const res = await RecordInfoApi({ @@ -490,6 +510,10 @@ onMounted(() => {}); height: 50rpx; } +.icon-stock-model { + width: 45rpx; + height: 45rpx; +} .icon-stock { width: 36rpx; @@ -505,11 +529,11 @@ onMounted(() => {}); display: flex; align-items: center; justify-content: center; - image { - width: 50rpx; - height: 50rpx; - border-radius: 50%; - } + // image { + // width: 50rpx; + // height: 50rpx; + // border-radius: 50%; + // } } .history-main { diff --git a/pages.json b/pages.json index bcb036c..35e10c6 100644 --- a/pages.json +++ b/pages.json @@ -361,6 +361,13 @@ "navigationStyle": "custom" } } + }, + { + "path" : "pages/notFoundBriefing/notFoundBriefing", + "style" : + { + "navigationBarTitleText" : "机构动向简报" + } } ], diff --git a/pages/customerServicePlatform/questionDetail.vue b/pages/customerServicePlatform/questionDetail.vue index cedeecb..2bbba38 100644 --- a/pages/customerServicePlatform/questionDetail.vue +++ b/pages/customerServicePlatform/questionDetail.vue @@ -45,9 +45,12 @@ mode="aspectFit"> - + + + + @@ -65,6 +68,8 @@ import { getAnswerApi } from "../../api/customerServicePlatform/customerServicePlatform"; + import marked from "marked"; // 引入 marked 库 + export default { data() { return { @@ -72,7 +77,7 @@ iSMT: 0, questionTitle: '', answerContent: '正在思考...', - showLoginRegister:false, + showLoginRegister: false, }; }, mounted() { @@ -83,13 +88,36 @@ if (options.question) { this.questionTitle = decodeURIComponent(options.question); if (this.questionTitle.includes("如何注册")) { - this.showLoginRegister = true + this.showLoginRegister = true } else { - this.showLoginRegister = false + this.showLoginRegister = false } } }, methods: { + renderMarkdown(content) { + const renderer = new marked.Renderer(); + // renderer.heading = function (text, level) { + // return `

${text}

`; + // }; + // 设置 marked 选项 + marked.setOptions({ + renderer: renderer, + highlight: null, // 如果需要代码高亮,可以设置适当的函数 + langPrefix: "language-", + pedantic: false, + gfm: true, + breaks: false, + sanitize: false, + smartLists: true, + smartypants: false, + xhtml: false, + }); + if (!content) return ""; + let renderedContent = marked.parse(content); + renderedContent = renderedContent.replace(/\*/g, ''); + return renderedContent; + }, async getAnswerContent() { let conversationId = ''; try { @@ -98,29 +126,40 @@ } catch (e) { conversationId = ''; } - - const res = await getAnswerApi({ - question: this.questionTitle, - conversationId: conversationId, - }) - console.log(res) - - if (res.code == 200) { - uni.setStorageSync('conversationId', res.data.conversationId); - const answer = res.data.answer - this.answerContent = ''; - for (let i = 0; i < answer.length; i++) { - this.answerContent += answer[i]; - await this.sleepTime(); + try { + const res = await getAnswerApi({ + question: this.questionTitle, + conversationId: conversationId, + }) + console.log(res) + + if (res.code == 200) { + uni.setStorageSync('conversationId', res.data.conversationId); + const answer = res.data.answer + // 流式输出逻辑 + let currentIndex = 0; + const answerLength = answer.length; + + // 每隔一定时间显示一部分内容 + this.interval = setInterval(() => { + this.answerContent = answer.slice(0, currentIndex); + currentIndex++; + + if (currentIndex > answerLength) { + clearInterval(this.interval); + } + }, Math.floor(Math.random() * (150 - 30 + 1)) + 30); + } else { + this.answerContent = '获取回答失败,请重试'; } - } else { + } catch { this.answerContent = '获取回答失败,请重试'; } }, - async sleepTime() { - const ms = Math.floor(Math.random() * (300 - 30 + 1)) + 30; - return new Promise(resolve => setTimeout(resolve, ms)); - }, + sleepTime() { + const ms = Math.floor(Math.random() * (300 - 30 + 1)) + 30; + return ms; + }, toRegistration() { uni.redirectTo({ diff --git a/pages/deepExploration/MainForceActions.vue b/pages/deepExploration/MainForceActions.vue index 3c32ab8..ff02109 100644 --- a/pages/deepExploration/MainForceActions.vue +++ b/pages/deepExploration/MainForceActions.vue @@ -585,6 +585,7 @@ stockChange.value = historyData.value.stockData.StockInformation.Zhang || '5.120%' stockAdd.value = historyData.value.stockData.StockInformation.ZhangFu || '22.410' stockPrice.value = historyData.value.stockData.StockInformation.Price || '435.900' + currentIndex.value = historyData.value.model-1 }, { deep: true, immediate: true @@ -596,7 +597,7 @@ // 页面加载时执行 onLoad((e) => { if (e.index) { - currentIndex.value = e.index - 1 + // currentIndex.value = e.index - 1 console.log('模块:', currentIndex.value) } if (e.stockName) { diff --git a/pages/deepMate/deepMate.vue b/pages/deepMate/deepMate.vue index a894035..657f181 100644 --- a/pages/deepMate/deepMate.vue +++ b/pages/deepMate/deepMate.vue @@ -889,7 +889,17 @@ const scrollToBottom = () => { }); }; const scrollToTop = () => { - chatScrollTop.value = 0; + // 聊天区存在:控制 scroll-view 回到顶部 + if (messages.value.length > 0) { + chatScrollTop.value = 0; + return; + } + // 未发起对话:页面级滚动回到顶部 + try { + uni.pageScrollTo({ scrollTop: 0, duration: 200 }); + } catch (e) { + // 兜底,无需处理 + } }; // 自动滚动控制:用户向上滚动时暂停自动滚到底部 const shouldAutoScroll = ref(true); @@ -903,6 +913,9 @@ const onChatScroll = (e) => { const delta = st - lastScrollTop.value; lastScrollTop.value = st; + // 同步当前滚动位置,确保点击回顶能产生数值变化 + chatScrollTop.value = st; + if (delta < 0) { shouldAutoScroll.value = false; return; diff --git a/pages/home/home.vue b/pages/home/home.vue index 3b0e786..2a0e913 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -61,7 +61,7 @@
- 主力资达 + 主力雷达 @@ -124,7 +124,7 @@ 机构动向简报 - + {{report.stock}} {{report.status}} @@ -133,6 +133,9 @@ + + 以上数据由AI生成,不作为最终投资建议,决策需独立! + @@ -472,6 +475,13 @@ export default { }) }, + // 跳转到缺省页面(机构动向简报点击) + goToNotFoundBriefing(report) { + uni.navigateTo({ + url: '/pages/notFoundBriefing/notFoundBriefing' + }) + }, + // 处理游客登录成功事件 handleVisitorLoginSuccess(data) { console.log('收到游客登录成功事件:', data) @@ -1970,6 +1980,19 @@ export default { padding: 5px; } +.disclaimer { + text-align: center; + padding: 8px 10px; + margin-top: 5px; + border-radius: 4px; +} + +.disclaimer-text { + font-size: 11px; + color: grey; + line-height: 1.4; +} + /* 底部空间 */ .bottom-space { height: 60px; diff --git a/pages/marketSituation/marketOverview.vue b/pages/marketSituation/marketOverview.vue index 6dcd1cf..ba74e11 100644 --- a/pages/marketSituation/marketOverview.vue +++ b/pages/marketSituation/marketOverview.vue @@ -6,10 +6,10 @@ - 道琼斯{{ judgeSymbol(INDU.value) }} - 纳斯达克{{ judgeSymbol(NDX.value) }} - 恒生指数{{ judgeSymbol(HSI.value) }} - 上证指数{{ judgeSymbol(CN.value) }} + 道琼斯{{ judgeSymbol(INDU.value) }} + 纳斯达克{{ judgeSymbol(NDX.value) }} + 恒生指数{{ judgeSymbol(HSI.value) }} + 上证指数{{ judgeSymbol(CN.value) }} @@ -90,6 +90,16 @@ const judgeSymbol = (num) => { return num[0] === "-" ? num : "+" + num; }; +function getSignClass(value) { + const s = typeof value === 'string' ? value : String(value ?? ''); + const trimmed = s.trim(); + if (trimmed.startsWith('-')) return 'index-down'; + if (trimmed.startsWith('+')) return 'index-up'; + const n = parseFloat(trimmed); + if (!isNaN(n)) return n >= 0 ? 'index-up' : 'index-down'; + return ''; +} + // 搜索输入事件 const onSearchInput = (e) => { searchValue.value = e.detail.value; @@ -785,6 +795,9 @@ watch(headerHeight, (newHeight) => { border-radius: 10rpx; background-color: #ffffff; z-index: 10; + display: flex; + align-items: center; + justify-content: center; } .INDU { position: absolute; @@ -797,11 +810,14 @@ watch(headerHeight, (newHeight) => { border-radius: 10rpx; background-color: #ffffff; z-index: 10; + display: flex; + align-items: center; + justify-content: center; } .HSI { position: absolute; top: 30%; - right: 13%; + right: 4%; transform: translate(-50%, -50%); font-size: 11rpx; color: #000000; @@ -809,11 +825,14 @@ watch(headerHeight, (newHeight) => { border-radius: 10rpx; background-color: #ffffff; z-index: 10; + display: flex; + align-items: center; + justify-content: center; } .CN { position: absolute; top: 23%; - right: 16%; + right: 8%; transform: translate(-50%, -50%); font-size: 11rpx; color: #000000; @@ -821,6 +840,9 @@ watch(headerHeight, (newHeight) => { border-radius: 10rpx; background-color: #ffffff; z-index: 10; + display: flex; + align-items: center; + justify-content: center; } .map image { @@ -1081,4 +1103,12 @@ watch(headerHeight, (newHeight) => { overflow: hidden; background-color: white; } + +.index-up { + color: #2fc25b !important; +} + +.index-down { + color: #f04864 !important; +} diff --git a/pages/notFoundBriefing/notFoundBriefing.vue b/pages/notFoundBriefing/notFoundBriefing.vue new file mode 100644 index 0000000..bd8dc48 --- /dev/null +++ b/pages/notFoundBriefing/notFoundBriefing.vue @@ -0,0 +1,55 @@ + + + + + \ No newline at end of file diff --git a/pages/start/select/select.vue b/pages/start/select/select.vue index 6b9cd88..70370f0 100644 --- a/pages/start/select/select.vue +++ b/pages/start/select/select.vue @@ -110,6 +110,7 @@ function toLogin() { border-radius: 60rpx; font-size: 32rpx; padding: 20rpx; + border: 1rpx solid #00000022; } .register-button { diff --git a/pages/start/startup/startup.vue b/pages/start/startup/startup.vue index 4d9b44b..f7d74ef 100644 --- a/pages/start/startup/startup.vue +++ b/pages/start/startup/startup.vue @@ -1,11 +1,13 @@ @@ -19,7 +21,7 @@ onShow(() => { // 获取设备ID uni.getSystemInfo({ success: (res) => { - deviceInfo.setDeviceInfo(res) + deviceInfo.setDeviceInfo(res); }, }); @@ -38,7 +40,7 @@ onShow(() => { animationDuration: 1000, }); } - }, 1500); + }, 3000); }); @@ -49,6 +51,11 @@ onShow(() => { height: 100vh; } +.start{ + width: 100vw; + height: 100vh; +} + .logo-text { display: flex; justify-content: center; diff --git a/static/icons/decoding.png b/static/icons/decoding.png new file mode 100644 index 0000000..9de70bb Binary files /dev/null and b/static/icons/decoding.png differ diff --git a/static/icons/funds.png b/static/icons/funds.png new file mode 100644 index 0000000..60b56e6 Binary files /dev/null and b/static/icons/funds.png differ diff --git a/static/icons/radar.png b/static/icons/radar.png new file mode 100644 index 0000000..ae6ad57 Binary files /dev/null and b/static/icons/radar.png differ diff --git a/static/icons/tracking.png b/static/icons/tracking.png new file mode 100644 index 0000000..ecf8774 Binary files /dev/null and b/static/icons/tracking.png differ diff --git a/static/start.webp b/static/start.webp new file mode 100644 index 0000000..d5d5a73 Binary files /dev/null and b/static/start.webp differ diff --git a/utils/http.js b/utils/http.js index 7afc353..7249e24 100644 --- a/utils/http.js +++ b/utils/http.js @@ -23,7 +23,7 @@ const httpInterceptor = { // 打印最终请求地址 console.log('HTTP(finalUrl)=', options.url) // 2.请求超时,默认60s - options.timeout = 10000 + options.timeout = 30000 console.log(options) //3 添加小程序端请求头 const sys = uni.getSystemInfoSync();