Browse Source

拉代码

lihuilin/feature-20251024095243-我的
ZhangYong 3 weeks ago
parent
commit
7460023527
  1. 4
      api/customerServicePlatform/customerServicePlatform.js
  2. 41
      components/DeepMate.vue
  3. 42
      components/deepExploration_header.vue
  4. 7
      pages.json
  5. 59
      pages/customerServicePlatform/questionDetail.vue
  6. 3
      pages/deepExploration/MainForceActions.vue
  7. 13
      pages/deepMate/deepMate.vue
  8. 27
      pages/home/home.vue
  9. 42
      pages/marketSituation/marketOverview.vue
  10. 55
      pages/notFoundBriefing/notFoundBriefing.vue
  11. 1
      pages/start/select/select.vue
  12. 15
      pages/start/startup/startup.vue
  13. BIN
      static/icons/decoding.png
  14. BIN
      static/icons/funds.png
  15. BIN
      static/icons/radar.png
  16. BIN
      static/icons/tracking.png
  17. BIN
      static/start.webp
  18. 2
      utils/http.js

4
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',
})
}

41
components/DeepMate.vue

@ -26,18 +26,19 @@
<view class="hotspot-item">
<text>市场风险提示</text>
</view>
<view class="hotspot-item">
<!-- <view class="hotspot-item">
<text>投资策略建议</text>
</view>
<view class="hotspot-item">
<text>财经新闻解读</text>
</view>
</view> -->
</view>
<view class="deepmate-action">
<input
class="stock-input"
type="text"
placeholder="请输入股票代码/名称,获取AI洞察"
placeholder-style="color:#fff;opacity:1"
v-model="inputValue"
@confirm="handleSend"
/>
@ -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;
}
}
</style>

42
components/deepExploration_header.vue

@ -65,8 +65,16 @@
class="history-item"
>
<view class="history-left">
<view class="flag-circle"
><image
<view class="flag-circle">
<image
class="icon-stock-model"
:src="modelImage(item.model)"
mode="scaleToFill"
/></view>
</view>
<view class="history-left">
<view class="flag-circle">
<image
class="icon-stock"
:src="stockImage(item.stockMarket)"
mode="scaleToFill"
@ -75,7 +83,6 @@
<view class="history-main" @click="itemClick(item)">
<text class="history-query">{{ item.stockName }}</text>
<text class="history-query">{{ item.stockCode }}</text>
<text class="history-query">{{ modelType(item.model) }} </text>
</view>
<text class="history-time">{{
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 {

7
pages.json

@ -361,6 +361,13 @@
"navigationStyle": "custom"
}
}
},
{
"path" : "pages/notFoundBriefing/notFoundBriefing",
"style" :
{
"navigationBarTitleText" : "机构动向简报"
}
}
],

59
pages/customerServicePlatform/questionDetail.vue

@ -45,9 +45,12 @@
mode="aspectFit"></image>
<view class="card-text">
<text class="card-paragraph">
<rich-text :nodes="renderMarkdown(answerContent)"></rich-text>
<!-- <text class="card-paragraph">
{{answerContent}}
</text>
</text> -->
</view>
</view>
@ -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() {
@ -90,6 +95,29 @@
}
},
methods: {
renderMarkdown(content) {
const renderer = new marked.Renderer();
// renderer.heading = function (text, level) {
// return `<p>${text}</p>`;
// };
// 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,7 +126,7 @@
} catch (e) {
conversationId = '';
}
try {
const res = await getAnswerApi({
question: this.questionTitle,
conversationId: conversationId,
@ -108,18 +136,29 @@
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();
//
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 = '获取回答失败,请重试';
}
} catch {
this.answerContent = '获取回答失败,请重试';
}
},
async sleepTime() {
sleepTime() {
const ms = Math.floor(Math.random() * (300 - 30 + 1)) + 30;
return new Promise(resolve => setTimeout(resolve, ms));
return ms;
},
toRegistration() {

3
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) {

13
pages/deepMate/deepMate.vue

@ -889,7 +889,17 @@ const scrollToBottom = () => {
});
};
const scrollToTop = () => {
// 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;

27
pages/home/home.vue

@ -61,7 +61,7 @@
</view>
<view class="exploration-item">
<image class="exploration-icon" src="https://d31zlh4on95l9h.cloudfront.net/images/c25ca5e176efc961dabfa5d0d1b486b0.png" mode="aspectFit" lazy-load="true"></image>
<text class="exploration-text">主力</text>
<text class="exploration-text">主力</text>
</view>
<view class="exploration-item">
<image class="exploration-icon" src="https://d31zlh4on95l9h.cloudfront.net/images/c064d7066dc8129a7df7b052762f82cf.png" mode="aspectFit" lazy-load="true"></image>
@ -124,7 +124,7 @@
<text class="section-title-text">机构动向简报</text>
</view>
<view class="text-gap"></view>
<view class="report-item" v-for="(report, index) in institutionalReports" :key="index">
<view class="report-item" v-for="(report, index) in institutionalReports" :key="index" @click="goToNotFoundBriefing(report)">
<view class="report-stock">{{report.stock}}</view>
<view class="report-status">{{report.status}}</view>
</view>
@ -133,6 +133,9 @@
</view>
</view>
</view>
<view class="disclaimer">
<text class="disclaimer-text">以上数据由AI生成不作为最终投资建议决策需独立</text>
</view>
</view>
<!-- 5. TCP连接测试 -->
@ -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;

42
pages/marketSituation/marketOverview.vue

@ -6,10 +6,10 @@
<scroll-view class="content_scroll" scroll-y="true" :style="{ top: contentTopPosition + 'px' }">
<view class="content">
<view class="map">
<view class="INDU">道琼斯{{ judgeSymbol(INDU.value) }}</view>
<view class="NDX">纳斯达克{{ judgeSymbol(NDX.value) }}</view>
<view class="HSI">恒生指数{{ judgeSymbol(HSI.value) }}</view>
<view class="CN">上证指数{{ judgeSymbol(CN.value) }}</view>
<view class="INDU">道琼斯<view :class="getSignClass(INDU.value)">{{ judgeSymbol(INDU.value) }}</view></view>
<view class="NDX">纳斯达克<view :class="getSignClass(NDX.value)">{{ judgeSymbol(NDX.value) }}</view></view>
<view class="HSI">恒生指数<view :class="getSignClass(HSI.value)">{{ judgeSymbol(HSI.value) }}</view></view>
<view class="CN">上证指数<view :class="getSignClass(CN.value)">{{ judgeSymbol(CN.value) }}</view></view>
<image src="/static/marketSituation-image/map.png" mode="widthFix"></image>
</view>
<view class="global_index">
@ -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;
}
</style>

55
pages/notFoundBriefing/notFoundBriefing.vue

@ -0,0 +1,55 @@
<template>
<view class="container">
<view class="content">
<image
class="no-data-image"
src="https://d31zlh4on95l9h.cloudfront.net/images/f5a9bd32c81bc7cca47252b51357c12f.png"
mode="aspectFit"
></image>
<text class="no-data-text">暂无数据~</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
.container {
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background-color: #f5f5f5;
}
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.no-data-image {
width: 200px;
height: 200px;
margin-bottom: 20px;
}
.no-data-text {
font-size: 16px;
color: #999999;
text-align: center;
}
</style>

1
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 {

15
pages/start/startup/startup.vue

@ -1,11 +1,13 @@
<template>
<view class="background">
<image
<!-- <image
class="logo"
src="../../../static/icons/start-logo.png"
mode="scaleToFill"
/>
<view class="logo-text"> DeepChart </view>
<view class="logo-text"> DeepChart </view> -->
<image class="start" src="../../../static/start.webp" mode="scaleToFill" />
</view>
</template>
@ -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);
});
</script>
@ -49,6 +51,11 @@ onShow(() => {
height: 100vh;
}
.start{
width: 100vw;
height: 100vh;
}
.logo-text {
display: flex;
justify-content: center;

BIN
static/icons/decoding.png

After

Width: 80  |  Height: 80  |  Size: 4.6 KiB

BIN
static/icons/funds.png

After

Width: 80  |  Height: 80  |  Size: 3.4 KiB

BIN
static/icons/radar.png

After

Width: 80  |  Height: 80  |  Size: 6.9 KiB

BIN
static/icons/tracking.png

After

Width: 80  |  Height: 80  |  Size: 3.9 KiB

BIN
static/start.webp

2
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();

Loading…
Cancel
Save