Browse Source

Merge branch 'milestone-20251031-简版功能开发' of http://39.101.133.168:8807/qimaohong/deepChartVueApp into wangyi/feature-20251026183100-deepmate王毅

lihuilin/feature-20251024095243-我的
wangyi 4 weeks ago
parent
commit
de74a7b55a
  1. 9
      components/deepExploration_header.vue
  2. 444
      pages/deepExploration/MainForceActions.vue

9
components/deepExploration_header.vue

@ -167,12 +167,19 @@ async function itemClick(item) {
model: 5, model: 5,
}); });
if (res.code == 200) { if (res.code == 200) {
const message = res.data; const message = res.data;
const deepExplorationStore = useDeepExplorationStore(); const deepExplorationStore = useDeepExplorationStore();
deepExplorationStore.setDeepExplorationInfo(message); deepExplorationStore.setDeepExplorationInfo(message);
console.log('点击了历史数据',deepExplorationStore.deepExplorationInfo);
onDrawerBackClick(); onDrawerBackClick();
console.log(deepExplorationStore.deepExplorationInfo);
setTimeout(() => {
uni.navigateTo({
url: '/pages/deepExploration/MainForceActions'
});
}, 200);
} }
} }
const historyList = ref([]); const historyList = ref([]);

444
pages/deepExploration/MainForceActions.vue

@ -23,24 +23,22 @@
<view class="graphAndTxt"> <view class="graphAndTxt">
<view class="graph"> <view class="graph">
<view class="graph_header"> <view class="graph_header">
<view class="left">TESA</view>
<view class="left">{{stockCode}}</view>
<view class="center"> <view class="center">
<image class="last" src="/static/deepExploration-images/last.png" mode="aspectFill"></image>
<text>Taewlkj.sejssssssssf</text>
<image class="next" src="/static/deepExploration-images/next.png" mode="aspectFill"></image>
<text>{{stockName}}</text>
</view> </view>
<view class="right">2025/10/26</view>
<view class="right">{{stockTime}}</view>
</view> </view>
<view class="graph_data"> <view class="graph_data">
<text>435.900</text>
<text>22.410</text>
<text>5.120%</text>
<text>{{stockPrice}}</text>
<text>{{stockChange}}</text>
<text>{{stockAdd}}</text>
</view> </view>
<view class="graph_content"> <view class="graph_content">
<view class="charts-box"> <view class="charts-box">
<!-- uCharts 蜡烛图组件 --> <!-- uCharts 蜡烛图组件 -->
<qiun-data-charts type="candle" :opts="opts" :chartData="chartData" :disableScroll="true" <qiun-data-charts type="candle" :opts="opts" :chartData="chartData" :disableScroll="true"
:ontouch="true" :onzoom="true" />
:ontouch="true" :onzoom="true" :key="chartKey" />
</view> </view>
</view> </view>
</view> </view>
@ -65,7 +63,8 @@
<script setup> <script setup>
import { import {
ref, ref,
onMounted
onMounted,
watch
} from 'vue' } from 'vue'
import deepExploration_header from '@/components/deepExploration_header.vue' import deepExploration_header from '@/components/deepExploration_header.vue'
import footerBar from '@/components/footerBar.vue' import footerBar from '@/components/footerBar.vue'
@ -87,6 +86,13 @@
import marked from 'marked'; // marked import marked from 'marked'; // marked
import hljs from 'highlight.js'; import hljs from 'highlight.js';
import 'highlight.js/styles/atom-one-dark.css'; // import 'highlight.js/styles/atom-one-dark.css'; //
import {
useDeepExplorationStore
} from '@/stores/modules/deepExploration'
const deepExplorationStore = useDeepExplorationStore()
const historyData = ref({})
// //
const type = ref('deepExploration') const type = ref('deepExploration')
@ -113,10 +119,9 @@
// //
const searchStock = () => { const searchStock = () => {
htmlContent.value = '' htmlContent.value = ''
console.log('搜索参数:', stockName.value);
if (currentIndex.value ) {
console.log('搜索参数:', stockName.value, currentIndex.value);
if (currentIndex.value >= 0 && currentIndex.value <= 3) {
handleModels() handleModels()
getServerData()
} else { } else {
uni.showToast({ uni.showToast({
title: '请选择模块', title: '请选择模块',
@ -127,20 +132,22 @@
} }
// //
const handleModel = async(index) => {
const handleModel = async (index) => {
htmlContent.value = '' htmlContent.value = ''
currentIndex.value = index currentIndex.value = index
await handleModels() await handleModels()
// await getServerData()
} }
const stockName = ref('')
const stockName = ref('Tesla Inc.')
const searchName = ref('') const searchName = ref('')
const stockCode = ref('')
const stockCode = ref('TSLA')
const language = ref('') const language = ref('')
const recordId = ref('') const recordId = ref('')
const parentId = ref('') const parentId = ref('')
const stockId = ref('') const stockId = ref('')
const market = ref('') const market = ref('')
const stockTime = ref('2025/10/24')
const loading = ref(true); const loading = ref(true);
const error = ref(''); const error = ref('');
@ -175,31 +182,25 @@
// htmlContent.value = marked.parse(markdownContent.value); // htmlContent.value = marked.parse(markdownContent.value);
loading.value = true; loading.value = true;
if (searchName.value == '') { if (searchName.value == '') {
console.log('没有搜索',searchName.value);
const rresult = await handleDefault()
// markdownContent.value = res.data.markdown
htmlContent.value = marked.parse(markdownContent.value);
}else{
console.log('搜索',searchName.value);
console.log('没有搜索', searchName.value);
handleDefault()
} else {
console.log('搜索', searchName.value);
const result = await getModel1First({ const result = await getModel1First({
content: searchName.value, content: searchName.value,
language: "cn", language: "cn",
marketList: "hk,cn,usa,my,sg,vi,in,gb", marketList: "hk,cn,usa,my,sg,vi,in,gb",
model: currentIndex.value+1
model: currentIndex.value + 1
}) })
console.log('result', result); console.log('result', result);
if (result.code == 200) { if (result.code == 200) {
stockCode.value = result.data.code stockCode.value = result.data.code
stockName.value = result.data.name
// stockName.value = result.data.name
recordId.value = result.data.recordId recordId.value = result.data.recordId
parentId.value = result.data.parentId parentId.value = result.data.parentId
stockId.value = result.data.stockId stockId.value = result.data.stockId
language.value = result.data.language language.value = result.data.language
market.value = result.data.market market.value = result.data.market
} else {
return
}
const res = await getModel1Second({ const res = await getModel1Second({
@ -217,10 +218,22 @@
htmlContent.value = marked.parse(markdownContent.value); htmlContent.value = marked.parse(markdownContent.value);
} }
console.log('res', res); console.log('res', res);
await getServerData()
} else if (result.code == 400) {
markdownContent.value = result.message;
htmlContent.value = marked.parse(markdownContent.value);
} else {
return
} }
} catch {
}
} catch (e) {
error.value = e.message || '加载失败,请重试'; error.value = e.message || '加载失败,请重试';
} finally { } finally {
loading.value = false; loading.value = false;
@ -230,25 +243,52 @@
const handleDefault = async () => { const handleDefault = async () => {
const result = await getModeldefault({ const result = await getModeldefault({
token: "pCtw6AYK0EHAaIexoFHsbZjtsfEAIhcmwkCFm6uKko8VPfMvyDiODL9v9c0veic9fIpQbvT8zN4sH/Si6Q", token: "pCtw6AYK0EHAaIexoFHsbZjtsfEAIhcmwkCFm6uKko8VPfMvyDiODL9v9c0veic9fIpQbvT8zN4sH/Si6Q",
model: currentIndex.value+1
model: currentIndex.value + 1
}) })
if (result.code == 200) {
const rawMarkdown = result.data.markdown; const rawMarkdown = result.data.markdown;
const adaptedMarkdown = rawMarkdown.replace(/^### /gm, ''); // ### const adaptedMarkdown = rawMarkdown.replace(/^### /gm, ''); // ###
markdownContent.value = adaptedMarkdown; markdownContent.value = adaptedMarkdown;
htmlContent.value = marked.parse(markdownContent.value); htmlContent.value = marked.parse(markdownContent.value);
} else {
}
} }
const getServerData = async() =>{
const stockPrice = ref('435.900')
const stockAdd = ref('22.410')
const stockChange = ref('5.120%')
const chartKey = ref(0);
const getServerData = async () => {
const result = await getData({ const result = await getData({
market: market.value || '', market: market.value || '',
code: searchName || '',
code: searchName.value || '',
language: "cn", language: "cn",
brainPrivilegeState: 1, brainPrivilegeState: 1,
marketList: "usa.sg.my.hk.cn.can.vi.th.in.gb" marketList: "usa.sg.my.hk.cn.can.vi.th.in.gb"
}) })
console.log('k线数据',result);
console.log('k线数据', result);
stockName.value = result.data.StockInformation.Name || 'Tesla Inc.'
stockCode.value = result.data.StockInformation.Code || 'TSLA'
stockTime.value = result.data.StockInformation.Time || '2025/10/29'
stockChange.value = result.data.StockInformation.Zhang || '5.120%'
stockAdd.value = result.data.StockInformation.ZhangFu || '22.410'
stockPrice.value = result.data.StockInformation.Price || '435.900'
if (result.data.chartData) {
chartData.value = {
...JSON.parse(JSON.stringify(result.data.chartData))
}
chartKey.value++;
console.log('chartData', chartData.value);
}
} }
// 1. K线 // 1. K线
@ -316,51 +356,20 @@
}) })
// 2. K线 // 2. K线
const chartData = ref({})
const chartData = ref({
categories: [],
series: [{
name: '',
data: []
}]
})
// K线methods
// const getServerData = () => {
//K线methods
// const getServerData1 = () => {
// // // //
// setTimeout(() => { // setTimeout(() => {
// const res = { // const res = {
// "categories": [ // "categories": [
// "2025/08/25",
// "2025/08/26",
// "2025/08/27",
// "2025/08/28",
// "2025/08/29",
// "2025/09/01",
// "2025/09/02",
// "2025/09/03",
// "2025/09/04",
// "2025/09/05",
// "2025/09/08",
// "2025/09/09",
// "2025/09/10",
// "2025/09/11",
// "2025/09/12",
// "2025/09/15",
// "2025/09/16",
// "2025/09/17",
// "2025/09/18",
// "2025/09/19",
// "2025/09/22",
// "2025/09/23",
// "2025/09/24",
// "2025/09/25",
// "2025/09/26",
// "2025/09/29",
// "2025/09/30",
// "2025/10/09",
// "2025/10/10",
// "2025/10/13",
// "2025/10/14",
// "2025/10/15",
// "2025/10/16",
// "2025/10/17",
// "2025/10/20",
// "2025/10/21",
// "2025/10/22",
// "2025/10/23", // "2025/10/23",
// "2025/10/24", // "2025/10/24",
// "2025/10/27" // "2025/10/27"
@ -369,228 +378,6 @@
// "name": "", // "name": "",
// "data": [ // "data": [
// [ // [
// 1470.01,
// 1496.0,
// 1466.0,
// 1499.33
// ],
// [
// 1490.32,
// 1474.23,
// 1480.01,
// 1481.61
// ],
// [
// 1481.88,
// 1484.93,
// 1448.0,
// 1448.0
// ],
// [
// 1447.97,
// 1456.1,
// 1438.77,
// 1446.1
// ],
// [
// 1453.0,
// 1482.58,
// 1452.0,
// 1480.0
// ],
// [
// 1482.2,
// 1488.0,
// 1465.7,
// 1476.1
// ],
// [
// 1478.66,
// 1509.0,
// 1478.0,
// 1491.3
// ],
// [
// 1491.0,
// 1503.5,
// 1466.0,
// 1480.55
// ],
// [
// 1472.0,
// 1479.3,
// 1460.47,
// 1480.66
// ],
// [
// 1471.0,
// 1486.97,
// 1464.0,
// 1483.0
// ],
// [
// 1483.0,
// 1506.44,
// 1477.5,
// 1501.23
// ],
// [
// 1505.0,
// 1509.95,
// 1493.42,
// 1505.0
// ],
// [
// 1506.66,
// 1529.95,
// 1496.0,
// 1522.01
// ],
// [
// 1522.01,
// 1526.02,
// 1508.5,
// 1523.5
// ],
// [
// 1526.0,
// 1538.02,
// 1510.53,
// 1516.0
// ],
// [
// 1515.87,
// 1517.48,
// 1501.5,
// 1515.1
// ],
// [
// 1515.1,
// 1520.99,
// 1496.21,
// 1499.98
// ],
// [
// 1499.99,
// 1510.28,
// 1490.01,
// 1493.0
// ],
// [
// 1492.0,
// 1497.8,
// 1463.5,
// 1467.96
// ],
// [
// 1467.99,
// 1475.5,
// 1457.01,
// 1467.97
// ],
// [
// 1465.09,
// 1467.97,
// 1450.01,
// 1453.35
// ],
// [
// 1450.5,
// 1457.5,
// 1440.0,
// 1447.42
// ],
// [
// 1434.07,
// 1456.78,
// 1434.07,
// 1442.0
// ],
// [
// 1442.83,
// 1445.21,
// 1436.0,
// 1439.0
// ],
// [
// 1441.18,
// 1447.11,
// 1428.01,
// 1435.0
// ],
// [
// 1439.38,
// 1469.99,
// 1435.0,
// 1460.86
// ],
// [
// 1460.0,
// 1460.76,
// 1440.0,
// 1443.99
// ],
// [
// 1436.0,
// 1439.38,
// 1420.0,
// 1436.78
// ],
// [
// 1437.6,
// 1439.94,
// 1427.5,
// 1430.0
// ],
// [
// 1415.7,
// 1422.85,
// 1415.12,
// 1419.2
// ],
// [
// 1429.99,
// 1464.0,
// 1429.99,
// 1451.02
// ],
// [
// 1450.98,
// 1463.0,
// 1445.08,
// 1462.0
// ],
// [
// 1461.92,
// 1484.95,
// 1458.88,
// 1484.91
// ],
// [
// 1483.1,
// 1488.0,
// 1454.03,
// 1455.0
// ],
// [
// 1455.0,
// 1469.5,
// 1454.88,
// 1457.93
// ],
// [
// 1459.0,
// 1469.94,
// 1455.5,
// 1462.26
// ],
// [
// 1462.08,
// 1465.73,
// 1456.0,
// 1458.7
// ],
// [
// 1455.0, // 1455.0,
// 1468.8, // 1468.8,
// 1447.2, // 1447.2,
@ -616,10 +403,51 @@
// }, 500) // }, 500)
// } // }
let unwatch = null;
// onReady // onReady
onMounted(() => {
onMounted(async () => {
iSMT.value = uni.getSystemInfoSync().statusBarHeight iSMT.value = uni.getSystemInfoSync().statusBarHeight
getServerData() //
await getServerData() //
await handleModels()
unwatch = watch(
() => deepExplorationStore.deepExplorationInfo, //
(newVal, oldVal) => {
console.log('deepExplorationInfo 变化了:', newVal)
historyData.value = {
...newVal
}
console.log(historyData.value.wokeFlowData);
console.log('222', historyData.value.stockData.StockInformation);
//
const rawMarkdown = historyData.value.wokeFlowData.One.markdown;
const adaptedMarkdown = rawMarkdown.replace(/^### /gm, ''); // ###
markdownContent.value = adaptedMarkdown;
// markdownContent.value = res.data.markdown
htmlContent.value = marked.parse(markdownContent.value);
//k线
chartData.value = {
...JSON.parse(JSON.stringify(historyData.value.stockData.chartData))
}
chartKey.value++;
console.log('chartData', chartData.value);
stockName.value = historyData.value.stockData.StockInformation.Name || 'Tesla Inc.'
stockCode.value = historyData.value.stockData.StockInformation.Code || 'TSLA'
stockTime.value = historyData.value.stockData.StockInformation.Time || '2025/10/29'
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'
}, {
deep: true,
immediate: true
} //
)
}) })
// //
@ -629,8 +457,8 @@
console.log('模块:', currentIndex.value) console.log('模块:', currentIndex.value)
} }
if (e.stockName) { if (e.stockName) {
stockName.value = e.stockName
console.log('股票名称:', stockName.value)
searchName.value = e.stockName
console.log('股票名称:', searchName.value)
} }
}) })
</script> </script>
@ -738,7 +566,7 @@
} }
.center { .center {
margin-left: 105rpx;
margin-left: 155rpx;
display: flex; display: flex;
align-items: center; align-items: center;
@ -758,21 +586,11 @@
line-height: 18px; line-height: 18px;
} }
.last {
width: 15rpx;
height: 20rpx;
margin-right: 30rpx;
}
.next {
width: 15rpx;
height: 20rpx;
margin-left: 30rpx;
}
} }
.right { .right {
margin-left: 50rpx;
margin-left: 60rpx;
color: #6a6a6a; color: #6a6a6a;
font-family: "PingFang SC"; font-family: "PingFang SC";
font-size: 13px; font-size: 13px;
@ -804,6 +622,8 @@
} }
.graph_content { .graph_content {
min-height: 500rpx;
.charts-box { .charts-box {
width: 100%; width: 100%;
height: 100%; height: 100%;

Loading…
Cancel
Save