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. 426
      pages/deepExploration/MainForceActions.vue

9
components/deepExploration_header.vue

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

426
pages/deepExploration/MainForceActions.vue

@ -23,24 +23,22 @@
<view class="graphAndTxt">
<view class="graph">
<view class="graph_header">
<view class="left">TESA</view>
<view class="left">{{stockCode}}</view>
<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 class="right">2025/10/26</view>
<view class="right">{{stockTime}}</view>
</view>
<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 class="graph_content">
<view class="charts-box">
<!-- uCharts 蜡烛图组件 -->
<qiun-data-charts type="candle" :opts="opts" :chartData="chartData" :disableScroll="true"
:ontouch="true" :onzoom="true" />
:ontouch="true" :onzoom="true" :key="chartKey" />
</view>
</view>
</view>
@ -65,7 +63,8 @@
<script setup>
import {
ref,
onMounted
onMounted,
watch
} from 'vue'
import deepExploration_header from '@/components/deepExploration_header.vue'
import footerBar from '@/components/footerBar.vue'
@ -87,6 +86,13 @@
import marked from 'marked'; // marked
import hljs from 'highlight.js';
import 'highlight.js/styles/atom-one-dark.css'; //
import {
useDeepExplorationStore
} from '@/stores/modules/deepExploration'
const deepExplorationStore = useDeepExplorationStore()
const historyData = ref({})
//
const type = ref('deepExploration')
@ -113,10 +119,9 @@
//
const searchStock = () => {
htmlContent.value = ''
console.log('搜索参数:', stockName.value);
if (currentIndex.value ) {
console.log('搜索参数:', stockName.value, currentIndex.value);
if (currentIndex.value >= 0 && currentIndex.value <= 3) {
handleModels()
getServerData()
} else {
uni.showToast({
title: '请选择模块',
@ -131,16 +136,18 @@
htmlContent.value = ''
currentIndex.value = index
await handleModels()
// await getServerData()
}
const stockName = ref('')
const stockName = ref('Tesla Inc.')
const searchName = ref('')
const stockCode = ref('')
const stockCode = ref('TSLA')
const language = ref('')
const recordId = ref('')
const parentId = ref('')
const stockId = ref('')
const market = ref('')
const stockTime = ref('2025/10/24')
const loading = ref(true);
const error = ref('');
@ -176,10 +183,7 @@
loading.value = true;
if (searchName.value == '') {
console.log('没有搜索', searchName.value);
const rresult = await handleDefault()
// markdownContent.value = res.data.markdown
htmlContent.value = marked.parse(markdownContent.value);
handleDefault()
} else {
console.log('搜索', searchName.value);
const result = await getModel1First({
@ -191,15 +195,12 @@
console.log('result', result);
if (result.code == 200) {
stockCode.value = result.data.code
stockName.value = result.data.name
// 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
} else {
return
}
const res = await getModel1Second({
@ -217,10 +218,22 @@
htmlContent.value = marked.parse(markdownContent.value);
}
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 || '加载失败,请重试';
} finally {
loading.value = false;
@ -232,23 +245,50 @@
token: "pCtw6AYK0EHAaIexoFHsbZjtsfEAIhcmwkCFm6uKko8VPfMvyDiODL9v9c0veic9fIpQbvT8zN4sH/Si6Q",
model: currentIndex.value + 1
})
if (result.code == 200) {
const rawMarkdown = result.data.markdown;
const adaptedMarkdown = rawMarkdown.replace(/^### /gm, ''); // ###
markdownContent.value = adaptedMarkdown;
htmlContent.value = marked.parse(markdownContent.value);
} else {
}
}
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({
market: market.value || '',
code: searchName || '',
code: searchName.value || '',
language: "cn",
brainPrivilegeState: 1,
marketList: "usa.sg.my.hk.cn.can.vi.th.in.gb"
})
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线
@ -316,51 +356,20 @@
})
// 2. K线
const chartData = ref({})
const chartData = ref({
categories: [],
series: [{
name: '',
data: []
}]
})
//K线methods
// const getServerData = () => {
// const getServerData1 = () => {
// //
// setTimeout(() => {
// const res = {
// "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/24",
// "2025/10/27"
@ -369,228 +378,6 @@
// "name": "",
// "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,
// 1468.8,
// 1447.2,
@ -616,10 +403,51 @@
// }, 500)
// }
let unwatch = null;
// onReady
onMounted(() => {
onMounted(async () => {
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)
}
if (e.stockName) {
stockName.value = e.stockName
console.log('股票名称:', stockName.value)
searchName.value = e.stockName
console.log('股票名称:', searchName.value)
}
})
</script>
@ -738,7 +566,7 @@
}
.center {
margin-left: 105rpx;
margin-left: 155rpx;
display: flex;
align-items: center;
@ -758,21 +586,11 @@
line-height: 18px;
}
.last {
width: 15rpx;
height: 20rpx;
margin-right: 30rpx;
}
.next {
width: 15rpx;
height: 20rpx;
margin-left: 30rpx;
}
}
.right {
margin-left: 50rpx;
margin-left: 60rpx;
color: #6a6a6a;
font-family: "PingFang SC";
font-size: 13px;
@ -804,6 +622,8 @@
}
.graph_content {
min-height: 500rpx;
.charts-box {
width: 100%;
height: 100%;

Loading…
Cancel
Save