Browse Source

历史数据对接完成

maziyang/feature-20251025172218-智能客服中台
ZhangYong 4 weeks ago
parent
commit
5f2dfe5eef
  1. 10
      components/deepExploration_header.vue
  2. 60
      pages/deepExploration/MainForceActions.vue

10
components/deepExploration_header.vue

@ -154,13 +154,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);
onDrawerBackClick();
console.log('点击了历史数据',deepExplorationStore.deepExplorationInfo); console.log('点击了历史数据',deepExplorationStore.deepExplorationInfo);
onDrawerBackClick();
setTimeout(() => {
uni.navigateTo({
url: '/pages/deepExploration/MainForceActions'
});
}, 200);
} }
} }
const historyList = ref([]); const historyList = ref([]);

60
pages/deepExploration/MainForceActions.vue

@ -31,8 +31,8 @@
</view> </view>
<view class="graph_data"> <view class="graph_data">
<text>{{stockPrice}}</text> <text>{{stockPrice}}</text>
<text>{{stockAdd}}</text>
<text>{{stockChange}}</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">
@ -93,23 +93,7 @@
const deepExplorationStore = useDeepExplorationStore() const deepExplorationStore = useDeepExplorationStore()
const historyData = ref({}) const historyData = ref({})
watch(
() => deepExplorationStore.deepExplorationInfo, //
(newVal, oldVal) => {
console.log('deepExplorationInfo 变化了:', newVal)
historyData.value = {...newVal}
console.log(historyData.value.wokeFlowData);
//
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);
}, {
deep: true
} //
)
// //
const type = ref('deepExploration') const type = ref('deepExploration')
const iSMT = ref(0) const iSMT = ref(0)
@ -249,7 +233,7 @@
} }
} catch {
} catch (e) {
error.value = e.message || '加载失败,请重试'; error.value = e.message || '加载失败,请重试';
} finally { } finally {
loading.value = false; loading.value = false;
@ -294,6 +278,7 @@
stockTime.value = result.data.StockInformation.Time || '2025/10/29' stockTime.value = result.data.StockInformation.Time || '2025/10/29'
stockChange.value = result.data.StockInformation.Zhang || '5.120%' stockChange.value = result.data.StockInformation.Zhang || '5.120%'
stockAdd.value = result.data.StockInformation.ZhangFu || '22.410' stockAdd.value = result.data.StockInformation.ZhangFu || '22.410'
stockPrice.value = result.data.StockInformation.Price || '435.900'
if (result.data.chartData) { if (result.data.chartData) {
@ -418,12 +403,51 @@
// }, 500) // }, 500)
// } // }
let unwatch = null;
// onReady // onReady
onMounted(async () => { onMounted(async () => {
iSMT.value = uni.getSystemInfoSync().statusBarHeight iSMT.value = uni.getSystemInfoSync().statusBarHeight
await getServerData() // await getServerData() //
await handleModels() 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
} //
)
}) })
// //

Loading…
Cancel
Save