73 Commits

Author SHA1 Message Date
宋杰 c9e63909f2 Merge branch 'songjie/feature-20251023161635-首页' into milestone-20251031-简版功能开发 2 months ago
宋杰 ed2b5d269c Merge branch 'milestone-20251031-简版功能开发' of http://39.101.133.168:8807/qimaohong/deepChartVueApp into milestone-20251031-简版功能开发 2 months ago
宋杰 59470fcf26 Merge branch 'songjie/feature-20251023161635-首页' into milestone-20251031-简版功能开发 2 months ago
dongqian 18270e0579 Merge branch 'dongqian/feature-20251022181325-deepmate简版' into milestone-20251031-简版功能开发 2 months ago
dongqian 0ac41525f5 修改欢迎机器人图片 2 months ago
dongqian d42650569f Merge branch 'dongqian/feature-20251022181325-deepmate简版' into milestone-20251031-简版功能开发 2 months ago
dongqian 545f4dbcef 修改welcome-section显示问题 2 months ago
ZhangYong 3e26fd1644 Merge branch 'milestone-20251031-简版功能开发' of http://39.101.133.168:8807/qimaohong/deepChartVueApp into milestone-20251031-简版功能开发 2 months ago
ZhangYong 3b949f2331 kline 2 months ago
dongqian 3b391ef5b5 Merge branch 'dongqian/feature-20251022181325-deepmate简版' into milestone-20251031-简版功能开发 2 months ago
dongqian 44c5430258 优化deepmate卡片图 2 months ago
dongqian cb9a998146 Merge branch 'dongqian/feature-20251022181325-deepmate简版' into milestone-20251031-简版功能开发 2 months ago
dongqian 8088071e4d 优化deepmate欢迎图片的显示 2 months ago
dongqian 84b38b0949 Merge branch 'dongqian/feature-20251022181325-deepmate简版' into milestone-20251031-简版功能开发 2 months ago
dongqian 82f23bae9c 选股策略加上股票全名 2 months ago
ZhangYong 3e9e7c6efd 样式优化 2 months ago
宋杰 78794c1524 Merge branch 'songjie/feature-20251023161635-首页' into milestone-20251031-简版功能开发 2 months ago
宋杰 7359e08343 Merge branch 'milestone-20251031-简版功能开发' of http://39.101.133.168:8807/qimaohong/deepChartVueApp into milestone-20251031-简版功能开发 2 months ago
宋杰 a69dc99a1c Merge branch 'songjie/feature-20251023161635-首页' into milestone-20251031-简版功能开发 2 months ago
wangyi 82de8da927 Merge branch 'milestone-20251031-简版功能开发' of http://39.101.133.168:8807/qimaohong/deepChartVueApp into wangyi/feature-20251026183100-deepmate王毅 2 months ago
wangyi 7266de1d81 deepmate添加历史记录删除 2 months ago
lihui 7a25e71d99 Merge branch 'refs/heads/lihuilin/feature-20251024095243-我的' into milestone-20251031-简版功能开发 2 months ago
lihui 5a2e264d51 fix:登录也无法点击分享 2 months ago
ZhangYong 7460023527 拉代码 2 months ago
ZhangYong 2cd5f6103f 选股策略对应模块跳转 2 months ago
宋杰 672ee7a72a Merge branch 'songjie/feature-20251023161635-首页' into milestone-20251031-简版功能开发 2 months ago
宋杰 e6b47859b5 Merge branch 'songjie/feature-20251023161635-首页' into milestone-20251031-简版功能开发 2 months ago
宋杰 e94c6d1723 Merge branch 'songjie/feature-20251023161635-首页' into milestone-20251031-简版功能开发 2 months ago
宋杰 456bf2ac8a Merge branch 'songjie/feature-20251023161635-首页' into milestone-20251031-简版功能开发 2 months ago
宋杰 f1690eb940 Merge branch 'songjie/feature-20251023161635-首页' into milestone-20251031-简版功能开发 2 months ago
宋杰 bd3a5689a1 Merge branch 'songjie/feature-20251023161635-首页' into milestone-20251031-简版功能开发 2 months ago
wangyi dea3bfcc8b Merge branch 'milestone-20251031-简版功能开发' of http://39.101.133.168:8807/qimaohong/deepChartVueApp into wangyi/feature-20251026183100-deepmate王毅 2 months ago
wangyi e5632fc652 合并 2 months ago
zhaowenkang c4b183e3d1 地图市场 2 months ago
dongqian 1d83b16936 Merge branch 'dongqian/feature-20251022181325-deepmate简版' into milestone-20251031-简版功能开发 2 months ago
dongqian ebb17a4910 修改返回顶部逻辑 2 months ago
maziyang 11763822cf Merge branch 'maziyang/feature-20251025172218-智能客服中台' into milestone-20251031-简版功能开发 2 months ago
maziyang 24ca157d47 markdown格式数据转换 2 months ago
ZhangYong 409a9fabc9 Merge branch 'zhangyong/feature-20251028115958-深度探索' into milestone-20251031-简版功能开发 2 months ago
ZhangYong b325cd11fc 删除全部历史记录,样式调整 2 months ago
ZhangYong c1410ace26 横坐标展示不全问题 2 months ago
hongxilin c7985a8f8b 地图指数标签接入数据 2 months ago
hongxilin 600af64509 Merge branch 'milestone-20251031-简版功能开发' of http://39.101.133.168:8807/qimaohong/deepChartVueApp into hongxilin/feature-20251023103318-行情数据及页面 2 months ago
hongxilin 25c7cf0ac7 加上缩略图的模拟数据 2 months ago
zhaowenkang ddec705e37 Merge remote-tracking branch 'origin/zhaowenkang/feature-20251028181547-行情页面' into milestone-20251031-简版功能开发 2 months ago
zhaowenkang 609e5e131e 行情定位 2 months ago
wangyi b880ed83d7 Merge branch 'milestone-20251031-简版功能开发' of http://39.101.133.168:8807/qimaohong/deepChartVueApp into wangyi/feature-20251026183100-deepmate王毅 2 months ago
wangyi 02027a714d 登录只有苹果设备才显示苹果登录 2 months ago
hongxilin 69c44c2a37 涨跌加符号,任务栏按钮变大 2 months ago
hongxilin 1075d2d419 Merge branch 'milestone-20251031-简版功能开发' of http://39.101.133.168:8807/qimaohong/deepChartVueApp into hongxilin/feature-20251023103318-行情数据及页面 2 months ago
hongxilin e8e562f154 全球指数加黑加粗 2 months ago
dongqian 3b34077abc Merge branch 'dongqian/feature-20251022181325-deepmate简版' into milestone-20251031-简版功能开发 2 months ago
dongqian f4bc5c0604 当发送消息时回到顶部按钮出现 2 months ago
hongxilin a1bf58162e Merge branch 'hongxilin/feature-20251023103318-行情数据及页面' into milestone-20251031-简版功能开发 2 months ago
hongxilin 54d2c377e9 创建onHide,onShow生命周期,完善tcp连接断开逻辑 2 months ago
dongqian dda58eabfd Merge branch 'dongqian/feature-20251022181325-deepmate简版' into milestone-20251031-简版功能开发 2 months ago
dongqian 67c58355f5 修改deepmate删除功能 2 months ago
dongqian f0dbdcbc9e 修改deepmate图标位置 2 months ago
lihui 9d9fb407ed fix:未登录可以点击分享导致没token 2 months ago
dongqian 2ac3f788a5 修改空白页返回页面逻辑 2 months ago
lihui 9c8931c1c9 Merge branch 'refs/heads/milestone-20251031-简版功能开发' into lihuilin/feature-20251024095243-我的 2 months ago
wangyi 478cadfb4a Merge branch 'milestone-20251031-简版功能开发' of http://39.101.133.168:8807/qimaohong/deepChartVueApp into wangyi/feature-20251026183100-deepmate王毅 2 months ago
wangyi cfa23e2b9b 优化deepmate输出时带html的问题 2 months ago
wangyi c07ac2b713 手机号增添- 2 months ago
lihui 41cabef6c1 Merge remote-tracking branch 'origin/lihuilin/feature-20251024095243-我的' into lihuilin/feature-20251024095243-我的 2 months ago
dongqian cc39200908 修改提示语 2 months ago
hongxilin 32179e19aa Merge branch 'milestone-20251031-简版功能开发' of http://39.101.133.168:8807/qimaohong/deepChartVueApp into hongxilin/feature-20251023103318-行情数据及页面 2 months ago
hongxilin 59cb12ab8e Condition页面结构优化 2 months ago
maziyang a82c90c2aa Merge branch 'maziyang/feature-20251025172218-智能客服中台' into milestone-20251031-简版功能开发 2 months ago
maziyang 2890020539 添加未登录的弹窗提示 2 months ago
ZhangYong 72b1e1cc78 Merge branch 'zhangyong/feature-20251028115958-深度探索' into milestone-20251031-简版功能开发 2 months ago
ZhangYong 977b13da9e 修复意图识别后k线图参数问题 2 months ago
lihui 00db8793e1 Merge branch 'refs/heads/milestone-20251031-简版功能开发' into lihuilin/feature-20251024095243-我的 2 months ago
  1. 2
      .hbuilderx/launch.json
  2. 4
      api/customerServicePlatform/customerServicePlatform.js
  3. 9
      api/deepExploration/deepExploration.js
  4. 13
      api/deepMate/deepMate.js
  5. 2501
      common/stockTimeInformation.js
  6. 8
      components/IndexCard.vue
  7. 48
      components/deepExploration_header.vue
  8. 3
      pages.json
  9. 4
      pages/blank/institutionalTrendsBriefing.vue
  10. 5
      pages/blank/notice.vue
  11. 1
      pages/customerServicePlatform/csPlatformIndex.vue
  12. 87
      pages/customerServicePlatform/questionDetail.vue
  13. 239
      pages/deepExploration/MainForceActions.vue
  14. 151
      pages/deepExploration/deepExploration.vue
  15. 46
      pages/deepExploration/stockSelectDetail.vue
  16. 143
      pages/deepMate/deepMate.vue
  17. 10
      pages/home/member.vue
  18. 148
      pages/marketSituation/globalIndex.vue
  19. 228
      pages/marketSituation/marketCondition.vue
  20. 112
      pages/marketSituation/marketDetail.vue
  21. 169
      pages/marketSituation/marketOverview.vue
  22. 4
      pages/marketSituation/marketSituation.vue
  23. 4
      pages/start/Registration/Registration.vue
  24. 29
      pages/start/login/login.vue
  25. 4
      pages/start/recoverPassword/recoverPassword.vue
  26. 1
      pages/start/select/select.vue
  27. 15
      pages/start/startup/startup.vue
  28. BIN
      static/deepExploration-images/1.png
  29. BIN
      static/deepExploration-images/2.png
  30. BIN
      static/deepExploration-images/3.png
  31. BIN
      static/deepExploration-images/4.png
  32. BIN
      static/deepExploration-images/history.png
  33. BIN
      static/deepExploration-images/icon1.png
  34. BIN
      static/deepExploration-images/icon2.png
  35. BIN
      static/deepExploration-images/icon3.png
  36. BIN
      static/deepExploration-images/icon4.png
  37. BIN
      static/deepExploration-images/kLineAll.png
  38. BIN
      static/deepExploration-images/notice.png
  39. BIN
      static/deepExploration-images/search.png
  40. BIN
      static/icons/decoding.png
  41. BIN
      static/icons/funds.png
  42. BIN
      static/icons/radar.png
  43. BIN
      static/icons/tracking.png
  44. 185
      static/images/welcomeRobot.svg
  45. BIN
      static/start.webp
  46. 2
      utils/http.js

2
.hbuilderx/launch.json

@ -2,7 +2,7 @@
"version" : "1.0",
"configurations" : [
{
"customPlaygroundType" : "local",
"customPlaygroundType" : "device",
"packageName" : "io.dcloud.HBuilder",
"playground" : "standard",
"type" : "uni-app:app-android"

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

9
api/deepExploration/deepExploration.js

@ -101,6 +101,15 @@ export const RecordListApi = (data) => {
data:data
})
}
//历史记录删除
export const RecordListDeleteApi = (data) => {
return http({
method: 'POST',
url: '/api/coze/deleteRecord',
data:data
})
}
// 选股策略
export const stocSelectApi = (data) => {
return http({

13
api/deepMate/deepMate.js

@ -54,6 +54,19 @@ export const postHistory = (data) => {
/**
* 删除历史记录
*/
export const postDeleteHistory = (data) => {
return http({
method: 'POST',
url: '/api/deepMate/deleteRecord',
data
})
}
/**
* 历史记录详情
*/

2501
common/stockTimeInformation.js
File diff suppressed because it is too large
View File

8
components/IndexCard.vue

@ -12,8 +12,8 @@
<view class="price-info">
<text class="current-price" :style="{ color: priceColor }">{{ currentPrice }}</text>
<view class="change-info">
<text class="change-amount" :style="{ color: priceColor }">{{ changeAmount }}</text>
<text class="change-percent" :style="{ color: priceColor }">{{ changePercent }}</text>
<text class="change-amount" :style="{ color: priceColor }">{{ judgeSymbol(changeAmount) }}</text>
<text class="change-percent" :style="{ color: priceColor }">{{ judgeSymbol(changePercent) }}</text>
</view>
</view>
@ -63,6 +63,10 @@ const props = defineProps({
},
});
const judgeSymbol = (num) => {
return num[0] === "-" ? num : "+" + num;
};
const getMarketFlag = (market) => {
let imagePath;

48
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)
@ -91,6 +98,7 @@
import {
RecordListApi,
RecordInfoApi,
RecordListDeleteApi
} from "../api/deepExploration/deepExploration";
import { ref, onMounted, computed } from "vue";
import { useDeepExplorationStore } from "../stores/modules/deepExploration";
@ -140,8 +148,9 @@ const openHistoryDrawer = async () => {
};
const clearAllHistory = () => {
searchHistory.value = [];
historyList.value = [];
RecordListDeleteApi({
})
// uni.setStorageSync("search_history", []);
};
@ -163,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":
@ -184,7 +207,6 @@ function stockImage(Market) {
}
}
//
async function itemClick(item) {
const res = await RecordInfoApi({
@ -488,6 +510,10 @@ onMounted(() => {});
height: 50rpx;
}
.icon-stock-model {
width: 45rpx;
height: 45rpx;
}
.icon-stock {
width: 36rpx;
@ -503,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 {

3
pages.json

@ -295,7 +295,8 @@
"navigationStyle": "custom",
"disableSwipeBack": true,
"titleNView": false,
"bounce": false
"bounce": false,
"pageOrientation": "auto"
}
},
{

4
pages/blank/institutionalTrendsBriefing.vue

@ -24,9 +24,7 @@
<script setup>
// deepMate
const goBack = () => {
uni.navigateTo({
url: '/pages/deepMate/deepMate'
});
uni.navigateBack({ delta: 1 })
};
</script>

5
pages/blank/notice.vue

@ -24,9 +24,8 @@
<script setup>
// deepMate
const goBack = () => {
uni.navigateTo({
url: '/pages/deepMate/deepMate'
});
//
uni.navigateBack({ delta: 1 })
};
</script>

1
pages/customerServicePlatform/csPlatformIndex.vue

@ -1,4 +1,5 @@
<template>
<LoginPrompt ref="loginPrompt"></LoginPrompt>
<view class="main">
<view class="top" :style="{height:iSMT+'px'}"></view>

87
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() {
@ -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 `<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,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({

239
pages/deepExploration/MainForceActions.vue

@ -7,7 +7,7 @@
<view class="search">
<input v-model="searchName" class="searchInput" type="text" placeholder="请输入股票名称、股票代码"
placeholder-style="color: #A6A6A6; font-size: 22rpx;" />
placeholder-style="color: #A6A6A6; font-size: 28rpx;" />
<image @click="searchStock" class="seachIcon" src="/static/deepExploration-images/search.png"
mode="aspectFill"></image>
</view>
@ -41,6 +41,7 @@
<qiun-data-charts type="candle" :opts="opts" :chartData="chartData" :disableScroll="true"
:ontouch="true" :onzoom="true" :key="chartKey" />
</view>
<image src="/static/deepExploration-images/kLineAll.png" mode="aspectFill"></image>
</view>
</view>
<view class="txt">
@ -93,11 +94,19 @@
import {
getUserInfo
} from "@/api/member"
import {
useUserStore
} from '@/stores/modules/userInfo.js'
const deepExplorationStore = useDeepExplorationStore()
const userInfo = getUserInfo()
//
const historyData = ref({})
//ref
const loginPrompt = ref(null)
//
const type = ref('deepExploration')
const iSMT = ref(0)
@ -182,6 +191,13 @@
//
const handleModels = async () => {
try {
if (userInfo.isVisitor) {
console.log('是游客');
loginPrompt.value.show()
return
}
console.log('搜了吗');
// markdownContent.value = '\n## 📊 \n\n### 🕵 \n\t1. 📊 360.249 412.577 444.330\n\t2. 🔍 \n\t3. 📈 \n\n### 📊 :\n\t- 📉 : <font color=\"#13c2c2\">443.092</font> \n - 📈 : <font color=\"#ff4d4f\">466.458</font>\n\t- 📉 : <font color=\"#13c2c2\">447.354</font>\n\t- 📈 : <font color=\"#ff4d4f\">462.514</font>\n\t<font color=\"#722ed1\">AI线</font>\n\n### \n\t\t\t<font color=\"#fa8c16\">K线</font>\n\t\t\t<font color=\"#eb2f96\"></font>\n\n---\n<font color=\"#8c8c8c\">*AI*</font>\n '
// htmlContent.value = marked.parse(markdownContent.value);
loading.value = true;
@ -190,94 +206,85 @@
handleDefault()
} else {
if (currentIndex.value == 0) {
console.log('搜索', searchName.value);
const result = await getModel1First({
content: searchName.value,
language: "cn",
marketList: "hk,cn,usa,my,sg,vi,in,gb",
model: currentIndex.value + 1
})
console.log('result', result);
if (result.code == 200) {
stockCode.value = result.data.code
// stockName.value = result.data.name
recordId.value = result.data.recordId
parentId.value = result.data.parentId
stockId.value = result.data.stockId
language.value = result.data.language
market.value = result.data.market
const res = await getModel1Second({
language: language.value,
recordId: recordId.value,
parentId: parentId.value,
stockId: stockId.value,
token: 'pCtw6AYK0EHAaIexoFHsbZjtsfEAIhcmwkCFm6uKko8VPfMvyDiODL9v9c0veic9fIpQbvT8zN4sH/Si6Q'
console.log('搜索', searchName.value);
const result = await getModel1First({
content: searchName.value,
language: "cn",
marketList: "hk,cn,usa,my,sg,vi,in,gb",
model: currentIndex.value + 1
})
if (res.code == 200) {
const rawMarkdown = res.data.markdown;
const adaptedMarkdown = rawMarkdown.replace(/^### /gm, ''); // ###
markdownContent.value = adaptedMarkdown;
// markdownContent.value = res.data.markdown
console.log('result', result);
if (result.code == 200) {
stockCode.value = result.data.code
// stockName.value = result.data.name
recordId.value = result.data.recordId
parentId.value = result.data.parentId
stockId.value = result.data.stockId
language.value = result.data.language
market.value = result.data.market
const res = await getModel1Second({
language: language.value,
recordId: recordId.value,
parentId: parentId.value,
stockId: stockId.value,
token: 'pCtw6AYK0EHAaIexoFHsbZjtsfEAIhcmwkCFm6uKko8VPfMvyDiODL9v9c0veic9fIpQbvT8zN4sH/Si6Q'
})
if (res.code == 200) {
const rawMarkdown = res.data.markdown;
const adaptedMarkdown = rawMarkdown.replace(/^### /gm, ''); // ###
markdownContent.value = adaptedMarkdown;
// markdownContent.value = res.data.markdown
htmlContent.value = marked.parse(markdownContent.value);
await getServerData()
}
console.log('res', res);
} else if (result.code == 400) {
markdownContent.value = result.message;
htmlContent.value = marked.parse(markdownContent.value);
} else {
return
}
console.log('res', res);
await getServerData()
} else if (result.code == 400) {
markdownContent.value = result.message;
htmlContent.value = marked.parse(markdownContent.value);
} else {
return
}
} else if (currentIndex.value == 1) {
console.log('搜索', searchName.value);
const result = await getModel2First({
content: searchName.value,
language: "cn",
marketList: "hk,cn,usa,my,sg,vi,in,gb",
model: currentIndex.value + 1
})
console.log('result', result);
if (result.code == 200) {
stockCode.value = result.data.code
// stockName.value = result.data.name
recordId.value = result.data.recordId
parentId.value = result.data.parentId
stockId.value = result.data.stockId
language.value = result.data.language
market.value = result.data.market
const res = await getModel2Second({
language: language.value,
recordId: recordId.value,
parentId: parentId.value,
stockId: stockId.value,
token: 'pCtw6AYK0EHAaIexoFHsbZjtsfEAIhcmwkCFm6uKko8VPfMvyDiODL9v9c0veic9fIpQbvT8zN4sH/Si6Q'
console.log('搜索', searchName.value);
const result = await getModel2First({
content: searchName.value,
language: "cn",
marketList: "hk,cn,usa,my,sg,vi,in,gb",
model: currentIndex.value + 1
})
if (res.code == 200) {
const rawMarkdown = res.data.markdown;
const adaptedMarkdown = rawMarkdown.replace(/^### /gm, ''); // ###
markdownContent.value = adaptedMarkdown;
// markdownContent.value = res.data.markdown
console.log('result', result);
if (result.code == 200) {
stockCode.value = result.data.code
recordId.value = result.data.recordId
parentId.value = result.data.parentId
stockId.value = result.data.stockId
language.value = result.data.language
market.value = result.data.market
const res = await getModel2Second({
language: language.value,
recordId: recordId.value,
parentId: parentId.value,
stockId: stockId.value,
token: 'pCtw6AYK0EHAaIexoFHsbZjtsfEAIhcmwkCFm6uKko8VPfMvyDiODL9v9c0veic9fIpQbvT8zN4sH/Si6Q'
})
if (res.code == 200) {
const rawMarkdown = res.data.markdown;
const adaptedMarkdown = rawMarkdown.replace(/^### /gm, ''); // ###
markdownContent.value = adaptedMarkdown;
// markdownContent.value = res.data.markdown
htmlContent.value = marked.parse(markdownContent.value);
await getServerData()
}
console.log('res', res);
} else if (result.code == 400) {
markdownContent.value = result.message;
htmlContent.value = marked.parse(markdownContent.value);
} else {
return
}
console.log('res', res);
await getServerData()
} else if (result.code == 400) {
markdownContent.value = result.message;
htmlContent.value = marked.parse(markdownContent.value);
} else {
return
}
}else if(currentIndex.value == 2){
} else if (currentIndex.value == 2) {
console.log('搜索', searchName.value);
const result = await getModel3First({
content: searchName.value,
@ -294,8 +301,8 @@
stockId.value = result.data.stockId
language.value = result.data.language
market.value = result.data.market
const res = await getModel3Second({
language: language.value,
recordId: recordId.value,
@ -309,19 +316,16 @@
markdownContent.value = adaptedMarkdown;
// markdownContent.value = res.data.markdown
htmlContent.value = marked.parse(markdownContent.value);
await getServerData()
}
console.log('res', res);
await getServerData()
} else if (result.code == 400) {
markdownContent.value = result.message;
htmlContent.value = marked.parse(markdownContent.value);
} else {
return
}
}else if(currentIndex.value == 3){
} else if (currentIndex.value == 3) {
console.log('搜索', searchName.value);
const result = await getModel4First({
content: searchName.value,
@ -338,8 +342,6 @@
stockId.value = result.data.stockId
language.value = result.data.language
market.value = result.data.market
const res = await getModel4Second({
language: language.value,
recordId: recordId.value,
@ -353,27 +355,19 @@
markdownContent.value = adaptedMarkdown;
// markdownContent.value = res.data.markdown
htmlContent.value = marked.parse(markdownContent.value);
await getServerData()
}
console.log('res', res);
await getServerData()
} else if (result.code == 400) {
markdownContent.value = result.message;
htmlContent.value = marked.parse(markdownContent.value);
} else {
return
}
}else{
} else {
return
}
}
} catch (e) {
error.value = e.message || '加载失败,请重试';
} finally {
@ -406,7 +400,7 @@
const getServerData = async () => {
const result = await getData({
market: market.value || '',
code: searchName.value || '',
code: stockCode.value || '',
language: "cn",
brainPrivilegeState: 1,
marketList: "usa.sg.my.hk.cn.can.vi.th.in.gb"
@ -422,9 +416,13 @@
stockPrice.value = result.data.StockInformation.Price || '435.900'
if (result.data.chartData) {
const rawData = JSON.parse(JSON.stringify(result.data.chartData));
if (rawData.categories.length > 1) { //
rawData.categories[rawData.categories.length - 1] = ''; //
console.log('删了;');
}
chartData.value = {
...JSON.parse(JSON.stringify(result.data.chartData))
...rawData
}
chartKey.value++;
console.log('chartData', chartData.value);
@ -437,24 +435,25 @@
rotate: false,
rotateLock: false,
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4", "#ea7ccc"],
padding: [15, 15, 0, 15],
padding: [15, 30, 0, 15],
dataLabel: false,
enableScroll: true,
enableMarkLine: false,
legend: {},
xAxis: {
labelCount: 4,
itemCount: 30,
itemCount: 20,
disableGrid: true,
gridColor: "#CCCCCC",
gridType: "solid",
dashLength: 4,
scrollShow: false,
rotate: 45,
scrollAlign: "left",
scrollColor: "#A6A6A6",
scrollBackgroundColor: "#EFEBEF",
labelColor: "#8C8C8C",
fontSize: 9
fontSize: 9,
},
yAxis: {
labelColor: "#8C8C8C",
@ -551,7 +550,6 @@
onMounted(async () => {
iSMT.value = uni.getSystemInfoSync().statusBarHeight
getUserInfo()
await getServerData() //
await handleModels()
unwatch = watch(
@ -572,6 +570,9 @@
htmlContent.value = marked.parse(markdownContent.value);
//k线
if (historyData.value.stockData.chartData.categories.length > 1) { //
historyData.value.stockData.chartData.categories[historyData.value.stockData.chartData.categories.length - 1] = ''; //
}
chartData.value = {
...JSON.parse(JSON.stringify(historyData.value.stockData.chartData))
}
@ -584,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
@ -595,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) {
@ -633,6 +635,7 @@
.searchInput {
color: #111;
width: 100%;
}
}
@ -732,13 +735,14 @@
}
.right {
margin-left: 60rpx;
margin-left: 50rpx;
color: #6a6a6a;
font-family: "PingFang SC";
font-size: 13px;
font-style: normal;
font-weight: 400;
line-height: 15px;
white-space: nowrap;
}
}
@ -764,11 +768,21 @@
}
.graph_content {
position: relative;
min-height: 500rpx;
image{
position: absolute;
bottom: 20rpx;
right: 30rpx;
width: 48rpx;
height: 48rpx;
}
.charts-box {
width: 100%;
height: 100%;
overflow: visible;
}
}
}
@ -787,9 +801,10 @@
}
text {
margin-left: 5rpx;
background-color: #FFFFFF;
color: #000000;
padding: 0 22rpx;
padding: 5rpx 22rpx;
border-radius: 22rpx;
font-size: 28rpx;
font-weight: 400;
@ -798,7 +813,7 @@
}
.txtContent {
min-height: 200rpx;
min-height: 300rpx;
padding: 20rpx 30rpx;
margin-bottom: 100rpx;

151
pages/deepExploration/deepExploration.vue

@ -7,7 +7,7 @@
<deepExploration_header></deepExploration_header>
<view class="search">
<input v-model="stockName" class="searchInput" type="text" placeholder="请输入股票名称、股票代码"
placeholder-style="color: #A6A6A6; font-size: 22rpx;" />
placeholder-style="color: #A6A6A6; font-size: 28rpx; " />
<image @click="searchStock" class="seachIcon" src="/static/deepExploration-images/search.png"
mode="aspectFill"></image>
</view>
@ -15,7 +15,7 @@
<!-- 四大功能模块 -->
<view class="select">
<view class="selectItem" @click="toMain('主力追踪')">
<image class="img" src="/static/deepExploration-images/icon3.png" mode="aspectFill"></image>
<image class="img" src="/static/deepExploration-images/icon1.png" mode="aspectFill"></image>
<view class="txt">主力追踪</view>
</view>
<view class="selectItem" @click="toMain('主力雷达')">
@ -23,7 +23,7 @@
<view class="txt">主力雷达</view>
</view>
<view class="selectItem" @click="toMain('主力解码')">
<image class="img" src="/static/deepExploration-images/icon1.png" mode="aspectFill"></image>
<image class="img" src="/static/deepExploration-images/icon3.png" mode="aspectFill"></image>
<view class="txt">主力解码</view>
</view>
<view class="selectItem" @click="toMain('主力资金流')">
@ -45,66 +45,78 @@
</view>
</view>
<view class="stockSelection_content">
<view class="selectionItem">
<view class="header">
<view class="left">
<image src="/static/deepExploration-images/plus.png" mode="aspectFill"></image>
<text>抄底卖顶</text>
</view>
<view class="right">
<image src="/static/deepExploration-images/Americle.png" mode="aspectFill"></image>
<text>美股</text>
</view>
</view>
<view class="content">
<view class="contentTitle">
<view class="contentTitle_name">股票名称</view>
<view class="contentTitle_close">最新收盘价</view>
<view class="contentTitle_price">选股价格</view>
</view>
<view class="contentItem">
<view class="row" v-for="(item, index) in stockData" :key="index">
<view class="nameItem">{{ item.tscode }}</view>
<view class="closeItem">{{ item.close }}</view>
<view class="priceItem">{{ item.preClose }}</view>
</view>
</view>
</view>
</view>
</view>
<view class="stockSelection_content">
<view class="selectionItem">
<view class="header">
<view class="left">
<image src="/static/deepExploration-images/plus.png" mode="aspectFill"></image>
<text>波段行情</text>
</view>
<view class="right">
<image src="/static/deepExploration-images/Americle.png" mode="aspectFill"></image>
<text>美股</text>
</view>
</view>
<view class="content">
<view class="contentTitle">
<view class="contentTitle_name">股票名称</view>
<view class="contentTitle_close">最新收盘价</view>
<view class="contentTitle_price">选股价格</view>
</view>
<view class="contentItem">
<view class="row" v-for="(item, index) in stockDataByName" :key="index">
<view class="nameItem">{{ item.tscode }}</view>
<view class="closeItem">{{ item.close }}</view>
<view class="priceItem">{{ item.preClose }}</view>
</view>
</view>
</view>
</view>
</view>
</view>
<footerBar class="static-footer" :type="type"></footerBar>
</view>
<view class="stockSelection_content">
<view class="selectionItem">
<view class="header">
<view class="left">
<image
src="/static/deepExploration-images/plus.png"
mode="aspectFill"
></image>
<text>抄底卖顶</text>
</view>
<view class="right">
<image
src="/static/deepExploration-images/Americle.png"
mode="aspectFill"
></image>
<text>美股</text>
</view>
</view>
<view class="content">
<view class="contentTitle">
<view class="contentTitle_name">股票名称</view>
<view class="contentTitle_close">最新收盘价</view>
<view class="contentTitle_price">选股价格</view>
</view>
<view class="contentItem">
<view class="row" v-for="(item, index) in stockData" :key="index">
<view class="nameItem">{{ item.tscode }}{{ item.stockName }}</view>
<view class="closeItem">{{ item.close }}</view>
<view class="priceItem">{{ item.preClose }}</view>
</view>
</view>
</view>
</view>
</view>
<view class="stockSelection_content">
<view class="selectionItem">
<view class="header">
<view class="left">
<image
src="/static/deepExploration-images/plus.png"
mode="aspectFill"
></image>
<text>波段行情</text>
</view>
<view class="right">
<image
src="/static/deepExploration-images/Americle.png"
mode="aspectFill"
></image>
<text>美股</text>
</view>
</view>
<view class="content">
<view class="contentTitle">
<view class="contentTitle_name">股票名称</view>
<view class="contentTitle_close">最新收盘价</view>
<view class="contentTitle_price">选股价格</view>
</view>
<view class="contentItem">
<view class="row" v-for="(item, index) in stockDataByName" :key="index">
<view class="nameItem">{{ item.tscode }}{{ item.stockName }}</view>
<view class="closeItem">{{ item.close }}</view>
<view class="priceItem">{{ item.preClose }}</view>
</view>
</view>
</view>
</view>
</view>
</view>
<footerBar class="static-footer" :type="type"></footerBar>
</view>
</template>
<script setup>
@ -207,6 +219,7 @@
if (Array.isArray(list) && list.length) {
const mapped = list.map(item => ({
tscode: item.tsCode ?? item.tscode ?? item.code ?? '',
stockName: item.stockName ?? item.name ?? '',
close: item.close ?? item.lastClose ?? '',
preClose: item.preClose ?? item.preclose ?? item.prevClose ?? ''
}))
@ -248,6 +261,7 @@
if (Array.isArray(list) && list.length) {
const mapped = list.map(item => ({
tscode: item.tsCode ?? item.tscode ?? item.code ?? '',
stockName: item.stockName ?? item.name ?? '',
close: item.close ?? item.lastClose ?? '',
preClose: item.preClose ?? item.preclose ?? item.prevClose ?? ''
}))
@ -307,6 +321,7 @@
.searchInput {
color: #111;
width: 100%;
}
}
@ -362,16 +377,18 @@
}
.viewAll {
display: flex;
align-items: center;
justify-content: center;
background-color: #000000;
border-radius: 10rpx;
padding: 6rpx 20rpx;
padding: 10rpx 20rpx;
color: #ffffff;
font-family: "PingFang SC";
font-size: 10rpx;
font-size: 24rpx;
font-style: normal;
font-weight: 100;
font-weight: 500;
line-height: 29rpx;
height: 40rpx;
}
}

46
pages/deepExploration/stockSelectDetail.vue

@ -156,19 +156,22 @@
if (Array.isArray(list)) list = sortByPctDesc(list)
if (Array.isArray(list) && list.length) {
strategyData.value = list.map(item => ({
name: item.tsCode ?? item.tscode ?? '',
stockCode: item.tsCode ?? item.tscode ?? '',
latest: item.close ?? '',
name: item.stockName ?? item.name ?? item.tsName ?? item.tsname ?? item.secName ?? '',
stockCode: item.tsCode ?? item.tscode ?? item.code ?? item.symbol ?? '',
latest: item.close ?? item.lastClose ?? '',
increase: formatPctChg(item.pctChg),
decrease: item.change ?? '',
previousClose: item.preClose ?? item.preclose ?? '',
volume: item.vol ?? '',
turnover: item.amount ?? '',
openingPrice: item.open ?? '',
highestPrice: item.high ?? '',
lowestPrice: item.low ?? ''
decrease: item.change ?? item.chg ?? '',
previousClose: item.preClose ?? item.preclose ?? item.prevClose ?? '',
volume: item.vol ?? item.volume ?? '',
turnover: item.amount ?? item.turnover ?? '',
openingPrice: item.open ?? item.openPrice ?? '',
highestPrice: item.high ?? item.highPrice ?? '',
lowestPrice: item.low ?? item.lowPrice ?? ''
}))
console.log(`按名称(${apiName})加载成功,条数:`, strategyData.value.length, '首项:', strategyData.value[0])
if (!strategyData.value[0]?.name) {
console.warn('名称字段未命中,原始keys示例:', Object.keys(list[0] || {}))
}
} else {
console.warn('getStrategyByName 返回空列表或结构不匹配', raw)
}
@ -203,19 +206,22 @@
if (Array.isArray(list)) list = sortByPctDesc(list)
if (Array.isArray(list) && list.length) {
strategyData.value = list.map(item => ({
name: item.tsCode ?? item.tscode ?? '',
stockCode: item.tsCode ?? item.tscode ?? '',
latest: item.close ?? '',
name: item.stockName ?? item.name ?? item.tsName ?? item.tsname ?? item.secName ?? '',
stockCode: item.tsCode ?? item.tscode ?? item.code ?? item.symbol ?? '',
latest: item.close ?? item.lastClose ?? '',
increase: formatPctChg(item.pctChg),
decrease: item.change ?? '',
previousClose: item.preClose ?? item.preclose ?? '',
volume: item.vol ?? '',
turnover: item.amount ?? '',
openingPrice: item.open ?? '',
highestPrice: item.high ?? '',
lowestPrice: item.low ?? ''
decrease: item.change ?? item.chg ?? '',
previousClose: item.preClose ?? item.preclose ?? item.prevClose ?? '',
volume: item.vol ?? item.volume ?? '',
turnover: item.amount ?? item.turnover ?? '',
openingPrice: item.open ?? item.openPrice ?? '',
highestPrice: item.high ?? item.highPrice ?? '',
lowestPrice: item.low ?? item.lowPrice ?? ''
}))
console.log('stockSelectDetail 加载成功(已按涨幅降序),条数:', strategyData.value.length, '首项:', strategyData.value[0])
if (!strategyData.value[0]?.name) {
console.warn('名称字段未命中,原始keys示例:', Object.keys(list[0] || {}))
}
} else {
console.warn('stockSelectDetail 接口返回空列表或结构不匹配', raw)
}

143
pages/deepMate/deepMate.vue

@ -232,6 +232,7 @@
@touchmove="onBackTopTouchMove"
@touchend="onBackTopTouchEnd"
@click="onBackTopClick"
v-if="messages.length > 0"
></image>
<!-- 搜索历史侧拉框 -->
@ -250,6 +251,7 @@
<image
class="delete-icon"
src="/static/icons/Group_48095481.svg"
@click="clearAllHistory"
></image>
<text class="delete-all" @click="clearAllHistory">删除全部</text>
</view>
@ -311,6 +313,7 @@ import {
postIntent,
postHistory,
postHistoryDetail,
postDeleteHistory,
} from "../../api/deepMate/deepMate";
import { useUserStore } from "../../stores/modules/userInfo";
@ -595,10 +598,37 @@ const groupedHistory = computed(() => {
});
const clearAllHistory = () => {
searchHistory.value = [];
// uni.setStorageSync("search_history", []);
uni.showModal({
title: "确认删除",
content: "确定要删除全部历史记录吗?该操作不可撤销。",
confirmText: "删除",
cancelText: "取消",
success: (res) => {
if (res.confirm) {
deleteHistory();
}
},
});
};
//
async function deleteHistory(historyId) {
// historyList searchHistory
// 使
const res = await postDeleteHistory({
model: 5,
});
if (res.code === 200) {
historyList.value = [];
// uni.setStorageSync("search_history", []);
uni.showToast({ title: "历史已清空", icon: "none" });
}
else {
uni.showToast({ title: res.message, icon: "none" });
}
}
//
const sendMessage = () => {
if (inputMessage.value.trim() === "" || isSending.value) return;
@ -669,7 +699,7 @@ const simulateBotResponse = async (userMessage) => {
//
const errorMessage = res.message || "请求失败,请稍后重试";
let responseText = `我已经收到您的消息: "${userMessage}"。错误信息: "${errorMessage}"`;
let responseText = `我已经收到您的消息: "${userMessage}"。"${errorMessage}"`;
//
let index = 0;
@ -677,26 +707,48 @@ const simulateBotResponse = async (userMessage) => {
const typeWriter = () => {
if (index < responseText.length) {
const ch = responseText.charAt(index);
let ch = responseText.charAt(index);
let charsToAdd = ch;
let newIndex = index + 1;
// HTML
if (ch === "<") {
//
let tagEndIndex = responseText.indexOf(">", index);
if (tagEndIndex !== -1) {
//
charsToAdd = responseText.substring(index, tagEndIndex + 1);
newIndex = tagEndIndex + 1;
}
}
const current = messages.value[botIndex];
//
messages.value.splice(botIndex, 1, {
...current,
content: current.content + ch,
content: current.content + charsToAdd,
isTyping: true,
});
index++;
index = newIndex;
scrollToBottom();
//
const baseDelay = 5; //
const slowPunct = /[。!?!?;;]/; //
const midPunct = /[,、,::]/; //
const delay = slowPunct.test(ch)
? 220
: midPunct.test(ch)
? 120
: baseDelay;
// 使
let delay;
if (charsToAdd.startsWith("<")) {
delay = 1; //
} else {
delay = slowPunct.test(ch)
? 220
: midPunct.test(ch)
? 120
: baseDelay;
}
setTimeout(typeWriter, delay);
} else {
//
@ -786,22 +838,33 @@ const simulateBotResponse = async (userMessage) => {
const typeWriter = () => {
if (index < responseText.length) {
const ch = responseText.charAt(index);
let ch = responseText.charAt(index);
let charsToAdd = ch;
let newIndex = index + 1;
let delay = baseDelay;
// HTML
if (ch === "<") {
//
let tagEndIndex = responseText.indexOf(">", index);
if (tagEndIndex !== -1) {
//
charsToAdd = responseText.substring(index, tagEndIndex + 1);
newIndex = tagEndIndex + 1;
delay = 1; //
}
}
const current = messages.value[botIndex];
//
messages.value.splice(botIndex, 1, {
...current,
content: current.content + ch,
content: current.content + charsToAdd,
isTyping: true,
});
index++;
index = newIndex;
scrollToBottom();
const delay = slowPunct.test(ch)
? 220
: midPunct.test(ch)
? 120
: baseDelay;
setTimeout(typeWriter, delay);
} else {
const current = messages.value[botIndex];
@ -842,7 +905,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);
@ -856,6 +929,9 @@ const onChatScroll = (e) => {
const delta = st - lastScrollTop.value;
lastScrollTop.value = st;
//
chatScrollTop.value = st;
if (delta < 0) {
shouldAutoScroll.value = false;
return;
@ -1150,23 +1226,23 @@ async function itemClick(item) {
/* min-height: 20rpx; */
/* border-radius: 20rpx; */
padding: 40rpx;
margin-top: 20rpx;
margin-top: 10rpx;
margin-bottom: 10rpx;
/* box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05); */
}
.welcome-section {
/* 灰色卡片(recommend-card)之后展示背景图 */
margin-top: 10rpx;
margin-top: 40rpx;
display: flex;
align-items: center;
justify-content: center;
background: url("https://d31zlh4on95l9h.cloudfront.net/images/eca84d9fb54712cb3bc6c6174773b83b.svg");
background: url("/static/images/welcomeRobot.svg");
background-repeat: no-repeat;
background-position: center top;
/* 放在容器顶部,正好在灰色卡片下方 */
background-size: 80% auto;
/* 缩放以适配宽度 */
background-position: center center;
/* 居中显示,避免顶部被裁剪 */
background-size: contain;
/* 保证整张图片完整展示 */
height: 460rpx;
/* 提供可视高度,让背景图可见 */
}
@ -1482,7 +1558,7 @@ async function itemClick(item) {
inset: 0;
/* 顶部、底部、左、右都贴合容器 */
width: 100%;
height: 81%;
height: 83%;
border-radius: 15rpx;
z-index: 1;
/* 在灰底之上、内容之下 */
@ -1769,9 +1845,20 @@ async function itemClick(item) {
}
.thinking-content {
transition: transform 1s ease; /* 添加过渡效果 */
transform-origin: top center; /* 设置变换原点 */
padding: 20rpx 30rpx;
}
@keyframes transform {
from {
transform: scaleY(0);
}
to {
transform: scaleY(1);
}
}
.thinking-item {
display: flex;
align-items: center;

10
pages/home/member.vue

@ -1,5 +1,5 @@
<template>
<LoginPrompt ref="loginPrompt"></LoginPrompt>
<LoginPrompt ref="loginwPrompt"></LoginPrompt>
<view class="main">
<view class="top">
<view class="bell">
@ -129,6 +129,14 @@ const goToAbout = () => {
}
const goToShare = () => {
console.log('用户信息==========',userStore.userInfo.isVisitor)
if (userStore.userInfo.isVisitor) {
uni.showToast({
title: '请先登录',
icon: 'none'
})
return
}
uni.navigateTo({
url: '../setting/share'
})

148
pages/marketSituation/globalIndex.vue

@ -30,7 +30,7 @@
</view>
<!-- 内容区域 -->
<scroll-view class="content" :style="{ top: contentTopPosition + 'px' }" scroll-y="true">
<scroll-view class="content" :style="{ top: contentTopPosition + 'px' }" scroll-y="true" v-if="isDataLoaded">
<!-- 亚太-中华 -->
<view class="market-section" v-for="(item, parentIndex) in marketSituationStore.gloablCardData" :key="item">
<view class="market-header">
@ -66,6 +66,7 @@
<script setup>
import { ref, onMounted, onUnmounted, computed, nextTick, watch } from "vue";
import { onShow, onHide } from "@dcloudio/uni-app";
import footerBar from "../../components/footerBar.vue";
import IndexCard from "../../components/IndexCard.vue";
import { getRegionalGroupAPI } from "../../api/marketSituation/marketSituation.js";
@ -78,6 +79,9 @@ const headerHeight = ref(0); // 头部高度
const searchValue = ref(""); //
const isWarnTextOverflow = ref(false); // warn
//
const isDataLoaded = ref(false);
// warnclass
const warnTextClass = computed(() => {
return isWarnTextOverflow.value ? "warn_text scroll-active" : "warn_text";
@ -109,125 +113,6 @@ const checkWarnTextOverflow = () => {
});
};
const globalIndexArray = ref([]);
// -
const asiachinaIndexes = ref([
{
flagIcon: "/static/c1.png",
stockName: "上证指数",
stockCode: "noCode",
currentPrice: "3933.96",
changeAmount: "+24.32",
changePercent: "+0.62%",
isRising: true,
},
{
flagIcon: "/static/c2.png",
stockName: "深证成指",
stockCode: "noCode",
currentPrice: "45757.90",
changeAmount: "-123.45",
changePercent: "-0.27%",
isRising: false,
},
{
flagIcon: "/static/c3.png",
stockName: "创业板指",
stockCode: "noCode",
currentPrice: "6606.08",
changeAmount: "+89.76",
changePercent: "+1.38%",
isRising: true,
},
{
flagIcon: "/static/c4.png",
stockName: "HSI50",
stockCode: "noCode",
currentPrice: "22333.96",
changeAmount: "+156.78",
changePercent: "+0.71%",
isRising: true,
},
{
flagIcon: "/static/c5.png",
stockName: "沪深300",
stockCode: "noCode",
currentPrice: "45757.90",
changeAmount: "-89.12",
changePercent: "-0.19%",
isRising: false,
},
{
flagIcon: "/static/c6.png",
stockName: "上证50",
stockCode: "noCode",
currentPrice: "45757.90",
changeAmount: "+234.56",
changePercent: "+0.52%",
isRising: true,
},
]);
//
const asiaIndexes = ref([
{
flagIcon: "/static/c7.png",
stockName: "日经225",
stockCode: "noCode",
currentPrice: "28456.78",
changeAmount: "+234.56",
changePercent: "+0.83%",
isRising: true,
},
{
flagIcon: "/static/c8.png",
stockName: "韩国KOSPI",
stockCode: "noCode",
currentPrice: "2567.89",
changeAmount: "-12.34",
changePercent: "-0.48%",
isRising: false,
},
{
flagIcon: "/static/c9.png",
stockName: "印度孟买",
stockCode: "noCode",
currentPrice: "65432.10",
changeAmount: "+456.78",
changePercent: "+0.70%",
isRising: true,
},
]);
//
const americaIndexes = ref([
{
flagIcon: "/static/c7.png",
stockName: "道琼斯指数",
stockCode: "noCode",
currentPrice: "34567.89",
changeAmount: "+123.45",
changePercent: "+0.36%",
isRising: true,
},
{
flagIcon: "/static/c8.png",
stockName: "纳斯达克",
stockCode: "noCode",
currentPrice: "13456.78",
changeAmount: "-67.89",
changePercent: "-0.50%",
isRising: false,
},
{
flagIcon: "/static/c9.png",
stockName: "标普500",
stockCode: "noCode",
currentPrice: "4234.56",
changeAmount: "+23.45",
changePercent: "+0.56%",
isRising: true,
},
]);
//
const contentTopPosition = computed(() => {
@ -482,6 +367,8 @@ const parseStockData = (message) => {
}
}
}
//
isDataLoaded.value = true;
} else if ((typeof message === "string" && message.includes('{"count')) || isMorePacket.batch_real_time) {
if (typeof message === "string" && message.includes('{"count')) {
console.log("开始接受分包数据");
@ -564,6 +451,22 @@ const startTcp = () => {
}
};
onShow(async () => {
console.log("显示页面");
await getRegionalGroup();
initTcpListeners();
await nextTick();
//
startTcp();
});
onHide(() => {
console.log("隐藏页面");
sendTcpMessage("stop_real_time");
removeTcpListeners();
disconnectTcp();
});
onUnmounted(() => {
sendTcpMessage("stop_real_time");
removeTcpListeners();
@ -572,11 +475,6 @@ onUnmounted(() => {
//
onMounted(async () => {
await getRegionalGroup();
initTcpListeners();
await nextTick();
//
startTcp();
//
const systemInfo = uni.getSystemInfoSync();
iSMT.value = systemInfo.statusBarHeight || 0;

228
pages/marketSituation/marketCondition.vue

@ -204,16 +204,16 @@
</view>
<view class="test" v-else-if="klineTab === 11">
<view class="button-sp-area">
<button class="mini-btn" type="default" size="mini" @click="ChangeMinutePeriod(1)">分时</button>
<button class="mini-btn" type="default" size="mini" @click="ChangeMinutePeriod(5)">5D</button>
<button class="mini-btn" type="default" size="mini" @click="ChangeKLinePeriod(0)">D</button>
<button class="mini-btn" type="default" size="mini" @click="ChangeKLinePeriod(1)">W</button>
<button class="mini-btn" type="default" size="mini" @click="ChangeKLinePeriod(4)">1M</button>
<button class="mini-btn" type="default" size="mini" @click="ChangeKLinePeriod(5)">15M</button>
</view>
<view style='background-color:#ffffff;'>
<HQChartControl ref="HQChartCtrl" DefaultChart="{Type:'KLine'}" :DefaultSymbol="Symbol"> </HQChartControl>
</view>
<button class="mini-btn" type="default" size="mini" @click="ChangeMinutePeriod(1)">分时</button>
<button class="mini-btn" type="default" size="mini" @click="ChangeMinutePeriod(5)">5D</button>
<button class="mini-btn" type="default" size="mini" @click="ChangeKLinePeriod(0)">D</button>
<button class="mini-btn" type="default" size="mini" @click="ChangeKLinePeriod(1)">W</button>
<button class="mini-btn" type="default" size="mini" @click="ChangeKLinePeriod(4)">1M</button>
<button class="mini-btn" type="default" size="mini" @click="ChangeKLinePeriod(5)">15M</button>
</view>
<view style="background-color: #ffffff">
<HQChartControl ref="HQChartCtrl" DefaultChart="{Type:'KLine'}" :DefaultSymbol="Symbol"> </HQChartControl>
</view>
</view>
<view v-else class="kline-chart-container">
<text>K线图开发中...</text>
@ -249,146 +249,120 @@ import { HCharts } from "@/common/canvasMethod.js";
import tcpConnection, { TCPConnection, TCP_CONFIG } from "../../api/tcpConnection";
import { useMarketSituationStore } from "../../stores/modules/marketSituation.js";
const marketSituationStore = useMarketSituationStore();
import HQChartControl from '@/uni_modules/jones-hqchart2/js_sdk/HQChartControl.vue'
import HQChartControl from "@/uni_modules/jones-hqchart2/js_sdk/HQChartControl.vue";
//
import HQData from "@/uni_modules/jones-hqchart2/js_sdk/umychart.NetworkFilterTest.vue.js"
import { dailyDataPackets } from '@/common/dailyData.js'
import HQData from "@/uni_modules/jones-hqchart2/js_sdk/umychart.NetworkFilterTest.vue.js";
import { dailyDataPackets } from "@/common/dailyData.js";
//
const Symbol = ref('GBPAUD.FXCM')
const ChartWidth = ref(350)
const ChartHeight = ref(500)
const HQChartCtrl = ref(null)
const Symbol = ref("GBPAUD.FXCM");
const HQChartCtrl = ref(null);
//
const CreateHQChart = () => {
const chartHeight = ChartHeight.value
const hqchartCtrl = HQChartCtrl.value
const width = canvasWidth.value;
const height = canvasHeight.value;
const hqchartCtrl = HQChartCtrl.value;
if (!hqchartCtrl) return
if (!hqchartCtrl) return;
//option
//hqchartCtrl.KLine.Option.
hqchartCtrl.NetworkFilter = NetworkFilter
hqchartCtrl.SetSize(ChartWidth.value, chartHeight)
hqchartCtrl.OnSize()
//option
//hqchartCtrl.KLine.Option.
hqchartCtrl.NetworkFilter = NetworkFilter;
hqchartCtrl.SetSize(width, height);
hqchartCtrl.OnSize();
hqchartCtrl.KLine.Option.IsAutoUpdate = false
hqchartCtrl.KLine.Option.KLine.Period = 4
hqchartCtrl.KLine.Option.IsAutoUpdate = false;
hqchartCtrl.KLine.Option.KLine.Period = 4;
nextTick(() => {
hqchartCtrl.CreateHQChart()
})
}
nextTick(() => {
hqchartCtrl.CreateHQChart();
});
};
const transformDailyDataToHQChart = (dailyDataPackets) => {
const symbol = dailyDataPackets.stock_code || Symbol.value
const rows = Array.isArray(dailyDataPackets.data) ? dailyDataPackets.data : []
// HQChart线: [Date, Open, High, Low, Close, Volume]
const data = rows.map((r, idx) => ([
parseInt(r.trade_date, 10), // Date: YYYYMMDD
Number(idx > 0 ? rows[idx - 1].bid_close : r.bid_close), // YClose:
Number(r.bid_open), // Open
Number(r.bid_high), // High
Number(r.bid_low), // Low
Number(r.bid_close), // Close
Number(r.tick_qty || 0), // Volume
Number(r.amount || 0) // Amount0
]))
return { name: symbol, symbol, ver: 2.0, data }
}
const symbol = dailyDataPackets.stock_code || Symbol.value;
const rows = Array.isArray(dailyDataPackets.data) ? dailyDataPackets.data : [];
// HQChart线: [Date, Open, High, Low, Close, Volume]
const data = rows.map((r, idx) => [
parseInt(r.trade_date, 10), // Date: YYYYMMDD
Number(idx > 0 ? rows[idx - 1].bid_close : r.bid_close), // YClose:
Number(r.bid_open), // Open
Number(r.bid_high), // High
Number(r.bid_low), // Low
Number(r.bid_close), // Close
Number(r.tick_qty || 0), // Volume
Number(r.amount || 0), // Amount0
]);
return { name: symbol, symbol, ver: 2.0, data };
};
const ClearHQChart = () => {
const hqchartCtrl = HQChartCtrl.value
if (hqchartCtrl) hqchartCtrl.ClearChart()
}
const hqchartCtrl = HQChartCtrl.value;
if (hqchartCtrl) hqchartCtrl.ClearChart();
};
const ChangeMinutePeriod = (days) => {
const hqchartCtrl = HQChartCtrl.value
if (hqchartCtrl) hqchartCtrl.ChangeMinutePeriod(days)
}
const hqchartCtrl = HQChartCtrl.value;
if (hqchartCtrl) hqchartCtrl.ChangeMinutePeriod(days);
};
const ChangeKLinePeriod = (period) => {
const hqchartCtrl = HQChartCtrl.value
if (hqchartCtrl) hqchartCtrl.ChangeKLinePeriod(period)
}
const hqchartCtrl = HQChartCtrl.value;
if (hqchartCtrl) hqchartCtrl.ChangeKLinePeriod(period);
};
const NetworkFilter = (data, callback) => {
console.log(`[App:NetworkFilter] Name=${data.Name} Explain=${data.Explain}`)
// HQDataCDN
data.PreventDefault = true
const reqSymbol = (data?.Request?.Data?.symbol) || Symbol.value || 'GBPAUD.FXCM'
switch (data.Name) {
// K
case 'KLineChartContainer::RequestHistoryData': {
const packet = dailyDataPackets[reqSymbol]
if (packet) {
const mock = transformDailyDataToHQChart(packet)
callback({ data: mock })
} else {
//
callback({ data: { name: reqSymbol, symbol: reqSymbol, ver: 2.0, data: [] } })
}
break
}
// K
case 'KLineChartContainer::RequestRealtimeData': {
callback({ data: { name: reqSymbol, symbol: reqSymbol, ver: 2.0, data: [] } })
break
}
// /
case 'KLineChartContainer::ReqeustHistoryMinuteData':
case 'KLineChartContainer::RequestMinuteRealtimeData':
case 'MinuteChartContainer::RequestMinuteData':
case 'MinuteChartContainer::RequestHistoryMinuteData': {
callback({ data: { name: reqSymbol, symbol: reqSymbol, ver: 2.0, data: [] } })
break
}
default: {
//
callback({ data: { name: reqSymbol, symbol: reqSymbol, ver: 2.0, data: [] } })
break
}
console.log(`[App:NetworkFilter] Name=${data.Name} Explain=${data.Explain}`);
// HQDataCDN
data.PreventDefault = true;
const reqSymbol = data?.Request?.Data?.symbol || Symbol.value || "GBPAUD.FXCM";
switch (data.Name) {
// K
case "KLineChartContainer::RequestHistoryData": {
const packet = dailyDataPackets[reqSymbol];
if (packet) {
const mock = transformDailyDataToHQChart(packet);
callback({ data: mock });
} else {
//
callback({ data: { name: reqSymbol, symbol: reqSymbol, ver: 2.0, data: [] } });
}
break;
}
}
//
const handleShow = () => {
uni.getSystemInfo({
success: (res) => {
const width = res.windowWidth
const height = res.windowHeight
ChartWidth.value = width
ChartHeight.value = height - 65
nextTick(() => {
CreateHQChart()
})
}
})
}
// K
case "KLineChartContainer::RequestRealtimeData": {
callback({ data: { name: reqSymbol, symbol: reqSymbol, ver: 2.0, data: [] } });
break;
}
// /
case "KLineChartContainer::ReqeustHistoryMinuteData":
case "KLineChartContainer::RequestMinuteRealtimeData":
case "MinuteChartContainer::RequestMinuteData":
case "MinuteChartContainer::RequestHistoryMinuteData": {
callback({ data: { name: reqSymbol, symbol: reqSymbol, ver: 2.0, data: [] } });
break;
}
default: {
//
callback({ data: { name: reqSymbol, symbol: reqSymbol, ver: 2.0, data: [] } });
break;
}
}
};
//
const handleHide = () => {
ClearHQChart()
}
ClearHQChart();
};
//
const handleUnload = () => {
ClearHQChart()
}
//
onMounted(() => {
handleShow()
})
onUnmounted(() => {
handleUnload()
})
ClearHQChart();
};
// TCP
const tcpConnected = ref(false);
@ -750,8 +724,8 @@ const toRightPage = () => {
const updateStockInformation = (stock) => {
klineTab.value = 1;
stockInformation.value.stockName = stock.stockName||stock.name;
stockInformation.value.stockCode = stock.stockCode||stock.code;
stockInformation.value.stockName = stock.stockName || stock.name;
stockInformation.value.stockCode = stock.stockCode || stock.code;
sendTcpMessage("stop_real_time");
sendTcpMessage("init_real_time");
};
@ -2393,8 +2367,8 @@ onLoad((options) => {
// stockInformation
if (stockData) {
stockInformation.value.stockName = stockData.stockName||stockData.name;
stockInformation.value.stockCode = stockData.stockCode||stockData.code;
stockInformation.value.stockName = stockData.stockName || stockData.name;
stockInformation.value.stockCode = stockData.stockCode || stockData.code;
}
} catch (error) {
console.error("解析股票数据失败:", error);
@ -2425,6 +2399,7 @@ onLoad((options) => {
//
onUnmounted(() => {
handleUnload();
removeTcpListeners();
disconnectTcp();
if (timer) {
@ -2468,6 +2443,7 @@ onMounted(async () => {
await nextTick();
setTimeout(() => {
initCanvas();
CreateHQChart();
}, 100);
console.log("所有初始化步骤完成");
} catch (error) {

112
pages/marketSituation/marketDetail.vue

@ -36,7 +36,7 @@
<scroll-view class="content" :style="{ top: contentTopPosition + 'px' }" scroll-y="true">
<!-- 股票列表 -->
<view class="stock-list">
<view class="stock-row" v-for="(item,index) in sortedStockList" :key="item" @click="viewIndexDetail(item,index)">
<view class="stock-row" v-for="(item, index) in sortedStockList" :key="item" @click="viewIndexDetail(item, index)">
<view class="stock-cell name-column">
<view class="stock-name">{{ item.stockName }}</view>
<view class="stock-code">{{ item.stockCode }}</view>
@ -48,7 +48,7 @@
</view>
<view class="stock-cell change-column">
<text class="stock-change" :class="item.isRising ? 'rising' : 'falling'">
{{ item.changePercent }}
{{ judgeSymbol(item.changePercent) }}
</text>
</view>
</view>
@ -79,107 +79,6 @@ const sortType = ref(""); // 排序类型:'price' 或 'change'
const sortOrder = ref("desc"); // 'asc' 'desc'
const regionalGroupArray = ref([]);
//
const stockList = ref([
{
stockName: "Telecommunication",
stockCode: "888607",
price: 1349.47,
change: "+7.67%",
isRising: true,
},
{
stockName: "Other",
stockCode: "888607",
price: 1349.47,
change: "+6.67%",
isRising: true,
},
{
stockName: "Consumer Discretio...",
stockCode: "888610",
price: 1349.47,
change: "+5.67%",
isRising: true,
},
{
stockName: "Telecommunication",
stockCode: "888607",
price: 1349.47,
change: "+4.67%",
isRising: true,
},
{
stockName: "Other",
stockCode: "888611",
price: 1359.47,
change: "+3.67%",
isRising: true,
},
{
stockName: "Consumer Discretio...",
stockCode: "888610",
price: 1349.47,
change: "+2.67%",
isRising: true,
},
{
stockName: "Telecommunication",
stockCode: "888607",
price: 1349.47,
change: "+1.67%",
isRising: true,
},
{
stockName: "Other",
stockCode: "888611",
price: 1009.98,
change: "-1.67%",
isRising: false,
},
{
stockName: "Consumer Discretio...",
stockCode: "888610",
price: 1009.98,
change: "-0.67%",
isRising: false,
},
{
stockName: "Telecommunication",
stockCode: "888607",
price: 1009.98,
change: "-0.67%",
isRising: false,
},
{
stockName: "Other",
stockCode: "888611",
price: 1009.98,
change: "-1.67%",
isRising: false,
},
{
stockName: "Consumer Discretio...",
stockCode: "888610",
price: 1009.98,
change: "-4.67%",
isRising: false,
},
{
stockName: "Consumer Discretio...",
stockCode: "888610",
price: 1009.98,
change: "-3.67%",
isRising: false,
},
{
stockName: "Consumer Discretio...",
stockCode: "888610",
price: 1009.98,
change: "-3.67%",
isRising: false,
},
]);
//
const contentTopPosition = computed(() => {
@ -206,6 +105,10 @@ const sortedStockList = computed(() => {
return list;
});
const judgeSymbol = (num) => {
return num[0] === "-" ? num : "+" + num;
};
const getRegionalGroupList = async () => {
try {
const result = await getRegionalGroupListAPI({
@ -224,7 +127,7 @@ const goBack = () => {
};
//
const viewIndexDetail = (item,index) => {
const viewIndexDetail = (item, index) => {
console.log("查看指数详情:", item.stockName);
//
uni.navigateTo({
@ -348,7 +251,6 @@ const sendTcpMessage = (command) => {
break;
}
if (!messageData) {
return;
} else {
try {

169
pages/marketSituation/marketOverview.vue

@ -6,6 +6,10 @@
<scroll-view class="content_scroll" scroll-y="true" :style="{ top: contentTopPosition + 'px' }">
<view class="content">
<view class="map">
<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">
@ -47,6 +51,7 @@
<script setup>
import { ref, onMounted, onUnmounted, watch, nextTick, computed } from "vue";
import { onShow, onHide } from "@dcloudio/uni-app";
import util from "../../common/util.js";
import IndexCard from "../../components/IndexCard.vue";
import { useMarketSituationStore } from "../../stores/modules/marketSituation.js";
@ -59,6 +64,11 @@ const contentHeight = ref(0);
const headerHeight = ref(0); // header
const isWarnTextOverflow = ref(false); // warn
const INDU = ref({ stockName: "道琼斯", stockCode: "INDU", value: "" });
const NDX = ref({ stockName: "纳斯达克", stockCode: "513300", value: "" });
const HSI = ref({ stockName: "恒生指数", stockCode: "HSI", value: "" });
const CN = ref({ stockName: "上证指数", stockCode: "1A0001", value: "" });
const pageIndex = ref(0);
const scrollToView = ref("");
@ -76,6 +86,20 @@ const warnTextClass = computed(() => {
const globalIndexArray = ref([]);
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;
@ -169,7 +193,7 @@ const getGlobalIndex = async () => {
};
// TCP
import tcpConnection, { TCPConnection, TCP_CONFIG } from "@/api/tcpConnection.js";
import tcpConnection from "@/api/tcpConnection.js";
const tcpConnected = ref(false);
const connectionListener = ref(null);
const messageListener = ref(null);
@ -225,7 +249,6 @@ const sendTcpMessage = (command) => {
if (command == "batch_real_time") {
messageDataArray = globalIndexArray.value.map((item) => item.stockCode);
}
console.log(messageDataArray);
switch (command) {
//
@ -273,11 +296,9 @@ const sendTcpMessage = (command) => {
const success = tcpConnection.send(messageData);
if (success) {
console.log("home发送TCP消息:", messageData);
}
} catch (error) {
console.error("发送TCP消息时出错:", error);
}
}
};
@ -362,6 +383,27 @@ const parseStockData = (message) => {
changePercent: ((100 * (stockDataArray[item.stockCode][0].current_price - stockDataArray[item.stockCode][0].pre_close)) / stockDataArray[item.stockCode][0].pre_close).toFixed(2) + "%",
isRising: stockDataArray[item.stockCode][0].current_price - stockDataArray[item.stockCode][0].pre_close >= 0,
}));
if (stockDataArray[INDU.value.stockCode][0]) {
INDU.value.value = ((100 * (stockDataArray[INDU.value.stockCode][0].current_price - stockDataArray[INDU.value.stockCode][0].pre_close)) / stockDataArray[INDU.value.stockCode][0].pre_close).toFixed(2) + "%";
} else {
console.log("INDU不存在");
}
if (stockDataArray[NDX.value.stockCode][0]) {
NDX.value.value = ((100 * (stockDataArray[NDX.value.stockCode][0].current_price - stockDataArray[NDX.value.stockCode][0].pre_close)) / stockDataArray[NDX.value.stockCode][0].pre_close).toFixed(2) + "%";
} else {
console.log("NDX不存在");
}
if (stockDataArray[HSI.value.stockCode][0]) {
HSI.value.value = ((100 * (stockDataArray[HSI.value.stockCode][0].current_price - stockDataArray[HSI.value.stockCode][0].pre_close)) / stockDataArray[HSI.value.stockCode][0].pre_close).toFixed(2) + "%";
} else {
console.log("HSI不存在");
}
if (stockDataArray[CN.value.stockCode][0]) {
CN.value.value = ((100 * (stockDataArray[CN.value.stockCode][0].current_price - stockDataArray[CN.value.stockCode][0].pre_close)) / stockDataArray[CN.value.stockCode][0].pre_close).toFixed(2) + "%";
} else {
console.log("CN不存在");
}
}
} else if ((typeof message === "string" && message.includes('{"count')) || isMorePacket.batch_real_time) {
if (typeof message === "string" && message.includes('{"count')) {
@ -408,6 +450,27 @@ const parseStockData = (message) => {
changePercent: ((100 * (stockDataArray[item.stockCode][0].current_price - stockDataArray[item.stockCode][0].pre_close)) / stockDataArray[item.stockCode][0].pre_close).toFixed(2) + "%",
isRising: stockDataArray[item.stockCode][0].current_price - stockDataArray[item.stockCode][0].pre_close >= 0,
}));
if (stockDataArray[INDU.value.stockCode][0]) {
INDU.value.value = ((100 * (stockDataArray[INDU.value.stockCode][0].current_price - stockDataArray[INDU.value.stockCode][0].pre_close)) / stockDataArray[INDU.value.stockCode][0].pre_close).toFixed(2) + "%";
} else {
console.log("INDU不存在");
}
if (stockDataArray[NDX.value.stockCode][0]) {
NDX.value.value = ((100 * (stockDataArray[NDX.value.stockCode][0].current_price - stockDataArray[NDX.value.stockCode][0].pre_close)) / stockDataArray[NDX.value.stockCode][0].pre_close).toFixed(2) + "%";
} else {
console.log("NDX不存在");
}
if (stockDataArray[HSI.value.stockCode][0]) {
HSI.value.value = ((100 * (stockDataArray[HSI.value.stockCode][0].current_price - stockDataArray[HSI.value.stockCode][0].pre_close)) / stockDataArray[HSI.value.stockCode][0].pre_close).toFixed(2) + "%";
} else {
console.log("HSI不存在");
}
if (stockDataArray[CN.value.stockCode][0]) {
CN.value.value = ((100 * (stockDataArray[CN.value.stockCode][0].current_price - stockDataArray[CN.value.stockCode][0].pre_close)) / stockDataArray[CN.value.stockCode][0].pre_close).toFixed(2) + "%";
} else {
console.log("CN不存在");
}
}
} else {
// JSON
@ -439,25 +502,38 @@ const startTcp = () => {
removeTcpListeners();
disconnectTcp();
initTcpListeners();
console.log("初始化完成,,,,,,,,,,,,,,,");
connectTcp();
} catch (error) {
console.error("建立连接并设置监听出错:", error);
}
};
onShow(async () => {
console.log("显示页面");
await getGlobalIndex();
initTcpListeners();
await nextTick();
//
startTcp();
});
onHide(() => {
console.log("隐藏页面");
sendTcpMessage("stop_real_time");
removeTcpListeners();
disconnectTcp();
});
onUnmounted(() => {
console.log("卸载页面");
sendTcpMessage("stop_real_time");
removeTcpListeners();
disconnectTcp();
});
onMounted(async () => {
await getGlobalIndex();
initTcpListeners();
await nextTick();
//
startTcp();
console.log("挂载页面");
//
iSMT.value = uni.getSystemInfoSync().statusBarHeight;
@ -708,6 +784,67 @@ watch(headerHeight, (newHeight) => {
min-height: 200rpx;
}
.NDX {
position: absolute;
top: 30%;
left: 17%;
transform: translate(-50%, -50%);
font-size: 11rpx;
color: #000000;
padding: 5rpx 10rpx;
border-radius: 10rpx;
background-color: #ffffff;
z-index: 10;
display: flex;
align-items: center;
justify-content: center;
}
.INDU {
position: absolute;
top: 22%;
left: 35%;
transform: translate(-50%, -50%);
font-size: 11rpx;
color: #000000;
padding: 5rpx 10rpx;
border-radius: 10rpx;
background-color: #ffffff;
z-index: 10;
display: flex;
align-items: center;
justify-content: center;
}
.HSI {
position: absolute;
top: 30%;
right: 4%;
transform: translate(-50%, -50%);
font-size: 11rpx;
color: #000000;
padding: 5rpx 10rpx;
border-radius: 10rpx;
background-color: #ffffff;
z-index: 10;
display: flex;
align-items: center;
justify-content: center;
}
.CN {
position: absolute;
top: 23%;
right: 8%;
transform: translate(-50%, -50%);
font-size: 11rpx;
color: #000000;
padding: 5rpx 10rpx;
border-radius: 10rpx;
background-color: #ffffff;
z-index: 10;
display: flex;
align-items: center;
justify-content: center;
}
.map image {
width: 100%;
height: auto;
@ -837,8 +974,8 @@ watch(headerHeight, (newHeight) => {
.global_index_title {
margin-left: 20rpx;
font-size: 40rpx;
font-weight: 100;
color: #333333;
font-weight: bold;
color: black;
align-items: center;
}
@ -966,4 +1103,12 @@ watch(headerHeight, (newHeight) => {
overflow: hidden;
background-color: white;
}
.index-up {
color: #2fc25b !important;
}
.index-down {
color: #f04864 !important;
}
</style>

4
pages/marketSituation/marketSituation.vue

@ -496,8 +496,8 @@ watch(headerHeight, (newHeight) => {
}
.scroll_indicator image {
width: 20rpx;
height: 20rpx;
width: 30rpx;
height: 30rpx;
opacity: 0.5;
}

4
pages/start/Registration/Registration.vue

@ -326,7 +326,7 @@ function changeAccount() {
}
if (switchType.value === "Phone") {
account.value = `${country.value}${phone.value}`;
account.value = `${country.value}-${phone.value}`;
}
if (switchType.value === "Email") {
account.value = email.value;
@ -511,7 +511,7 @@ async function sendCode() {
if (switchType.value === "Phone") {
//
const phoneAll = `${country.value}${phone.value}`;
const phoneAll = `${country.value}-${phone.value}`;
const res = await SendPhoneCodeApi({
phone: phoneAll,
});

29
pages/start/login/login.vue

@ -10,7 +10,7 @@
</view> -->
<view class="nav-right">
<image
@click="goToService"
@click="goToService"
class="icons"
src="../../../static/icons/Headset.png"
alt="联系客服"
@ -209,7 +209,11 @@
<!-- 第三方登录 -->
<view class="third-party-login">
<view class="third-party-btn" @click="loginWithApple">
<view
v-if="isAppleDevice"
class="third-party-btn"
@click="loginWithApple"
>
<image
class="apple-icon"
src="../../../static/icons/appleIcons.png"
@ -253,7 +257,7 @@
</template>
<script setup>
import { ref } from "vue";
import { computed, ref } from "vue";
//
import countryList from "./list.js";
import footerBar from "../../../components/footerBar";
@ -285,6 +289,19 @@ const verifyCode = ref("");
const account = ref("");
const isLoading = ref(false);
const deviceStore = useDeviceStore();
const isAppleDevice = computed(() => {
if (deviceStore.deviceInfo.brand) {
return deviceStore.deviceInfo.brand.toLowerCase() === "apple";
}
if (deviceStore.deviceInfo.system) {
return deviceStore.deviceInfo.system.includes("ios");
}
return false;
});
// 使list.js
const countries = ref(
countryList.list.map((item) => ({
@ -355,8 +372,6 @@ async function Login() {
return;
}
const deviceStore = useDeviceStore();
const account = changeAccount();
const loginType = changeLoginType();
isLoading.value = true;
@ -536,7 +551,7 @@ function changeAccount() {
}
if (switchType.value === "Phone") {
account.value = `${country.value}${phone.value}`;
account.value = `${country.value}-${phone.value}`;
}
if (switchType.value === "Email") {
account.value = email.value;
@ -652,7 +667,7 @@ async function sendCode() {
if (switchType.value === "Phone") {
//
const phoneAll = `${country.value}${phone.value}`;
const phoneAll = `${country.value}-${phone.value}`;
const res = await SendPhoneCodeApi({
phone: phoneAll,
});

4
pages/start/recoverPassword/recoverPassword.vue

@ -451,7 +451,7 @@ function changeAccount() {
}
if (switchType.value === "Phone") {
account.value = `${country.value}${phone.value}`;
account.value = `${country.value}-${phone.value}`;
}
if (switchType.value === "Email") {
account.value = email.value;
@ -570,7 +570,7 @@ function sendCode() {
}
}
if (switchType.value === "Phone") {
const phoneAll = `${country.value}${phone.value}`;
const phoneAll = `${country.value}-${phone.value}`;
const res = SendPhoneCodeApi({
phone: phoneAll,

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/deepExploration-images/1.png

Before

Width: 750  |  Height: 198  |  Size: 35 KiB

After

Width: 750  |  Height: 198  |  Size: 36 KiB

BIN
static/deepExploration-images/2.png

Before

Width: 750  |  Height: 198  |  Size: 36 KiB

After

Width: 750  |  Height: 198  |  Size: 38 KiB

BIN
static/deepExploration-images/3.png

Before

Width: 750  |  Height: 198  |  Size: 37 KiB

After

Width: 750  |  Height: 198  |  Size: 38 KiB

BIN
static/deepExploration-images/4.png

Before

Width: 750  |  Height: 198  |  Size: 35 KiB

After

Width: 750  |  Height: 198  |  Size: 35 KiB

BIN
static/deepExploration-images/history.png

Before

Width: 16  |  Height: 15  |  Size: 797 B

After

Width: 32  |  Height: 30  |  Size: 2.3 KiB

BIN
static/deepExploration-images/icon1.png

Before

Width: 40  |  Height: 40  |  Size: 1.9 KiB

After

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

BIN
static/deepExploration-images/icon2.png

Before

Width: 40  |  Height: 40  |  Size: 2.6 KiB

After

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

BIN
static/deepExploration-images/icon3.png

Before

Width: 40  |  Height: 40  |  Size: 1.7 KiB

After

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

BIN
static/deepExploration-images/icon4.png

Before

Width: 40  |  Height: 40  |  Size: 1.5 KiB

After

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

BIN
static/deepExploration-images/kLineAll.png

After

Width: 48  |  Height: 48  |  Size: 1.6 KiB

BIN
static/deepExploration-images/notice.png

Before

Width: 18  |  Height: 18  |  Size: 523 B

After

Width: 36  |  Height: 36  |  Size: 1.1 KiB

BIN
static/deepExploration-images/search.png

Before

Width: 16  |  Height: 16  |  Size: 522 B

After

Width: 32  |  Height: 32  |  Size: 1.0 KiB

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

185
static/images/welcomeRobot.svg
File diff suppressed because it is too large
View File

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