日历对接

This commit is contained in:
renzhijun
2026-01-28 14:23:25 +08:00
parent dc82f4a57c
commit 95441d649f
5 changed files with 633 additions and 249 deletions

View File

@@ -228,7 +228,7 @@
import {
inject
} from 'vue'
import { conceptsDailyTop,marketHeatmap,marketStatistics,marketHotspotOverview } from '@/request/api'
export default {
data() {
return {
@@ -310,8 +310,40 @@
onLoad(e) {
this.activeIndex = e.index
this.contentTop = this.navH + (20 + 70 + 25) / 750 * inject('windowWidth')
this.conceptsDailyTop()
this.marketHeatmap()
this.marketStatistics()
this.marketHotspotOverview()
},
methods: {
conceptsDailyTop(){
conceptsDailyTop().then(res=>{
}).catch(error=>{
})
},
marketHeatmap(){
marketHeatmap().then(res=>{
}).catch(error=>{
})
},
marketStatistics(){
marketStatistics().then(res=>{
}).catch(error=>{
})
},
marketHotspotOverview(){
marketHotspotOverview().then(res=>{
}).catch(error=>{
})
},
moreAction() {
uni.navigateTo({
url: '/pages/geGuCenter/detail'

View File

@@ -35,7 +35,7 @@
<view style="margin: 25rpx;">
<LCCalendar></LCCalendar>
<LCCalendar @date-change="handleDateChange"></LCCalendar>
</view>
@@ -103,7 +103,8 @@
<view
style="height: 400rpx; display: flex; align-items: center; justify-content: center; background-color: blue;">
词云图占位 </view>
<l-echart ref="chartRef"></l-echart>
</view>
<view style="color: #2B2B2B; font-weight: 500; display: flex; margin: 25rpx 20rpx;">
@@ -161,19 +162,24 @@
import {
inject
} from 'vue'
import { calendarCombinedData,analyseHighStocks } from '@/request/api'
const echarts = require('../../uni_modules/lime-echart/static/echarts.min.js');
export default {
data() {
return {
navH: inject('navHeight'),
contentTop: '',
selectedYearMonth: '', // 年-月(去掉日)
selectedFullDate: '', // 年-月-日
selectedItem: null , // 选中的item完整数据
tabTypes: [{
data: '1月14日',
data: '',
change: 0,
title: '当前日期'
},
{
data: '102',
data: '',
change: 3,
title: '涨停家数'
},
@@ -251,15 +257,127 @@
'板块关联图',
'板块分布',
'热门概念词云'
]
],
option2:{
title: {
show:false
},
legend: {
show:false
},
tooltip:{
show:true,
triggerOn:'mousemove'
},
radar: {
indicator: [
{ name: '市场地位', max: 100 },
{ name: '技术实力', max: 100 },
{ name: '品牌价值', max: 100 },
{ name: '运营效率', max: 100 },
{ name: '财务健康', max: 100 },
{ name: '创新能力', max: 100 },
{ name: '风险控制', max: 100 },
{ name: '成长潜力', max: 100 }
],
shape: 'polygon',
splitNumber: 5,
axisName: {
color: '#54555A'
},
splitLine: {
lineStyle: {
color: ['#CFD2D7']
}
},
splitArea: {
areaStyle:{
color:['#F4F6FA','white']
}
},
axisLine: {
lineStyle: {
color: '#CFD2D7'
}
}
},
series: [
{
name: 'Beijing',
type: 'radar',
lineStyle: {
width:1
},
data: [],
symbol: 'circle',
symbolSize: 4,
label:{
show:true
},
itemStyle: {
color: '#5070DD'
},
areaStyle: {
opacity: 0.1
}
},
]
},
}
},
onLoad(e) {
this.activeIndex = e.index
this.contentTop = this.navH + 20 / 750 * inject('windowWidth')
this.analyseHighStocks()
},
// mounted() {
// // 初始化当天日期格式(防止日历组件事件未及时触发)
// const today = new Date();
// const month = today.getMonth() + 1;
// const day = today.getDate();
// this.tabTypes[0].data = `${month}月${day}日`;
// this.tabTypes[1].data = '0'; // 默认涨停家数为0后续会被日历数据覆盖
// },
methods: {
handleDateChange(data) {
console.log('从日历组件接收的参数:', data.item?.zt_count);
// 赋值到父页面的变量中
this.selectedYearMonth = data.yearMonth;
this.selectedFullDate = data.fullDate;
this.selectedItem = data.item;
// 2. 格式化日期:年-月-日 → 月日(如 2026-01-14 → 1月14日
if (data.fullDate) {
const [year, month, day] = data.fullDate.split('-').map(Number);
this.tabTypes[0].data = `${month}${day}`;
}
// 3. 赋值涨停家数优先取item中的zt_count无数据则显示0
const ztCount = data.item?.zt_count ?? 0;
this.tabTypes[1].data = ztCount.toString(); // 转为字符串保证格式统一
// this.analyseHighStocks()
},
analyseHighStocks(){
const formatDate = this.selectedFullDate.replace(/-/g, '');
let param = {
date: formatDate
}
analyseHighStocks(param).then(res=>{
}).catch(error=>{
})
},
async init() {
// chart 图表实例不能存在data里
const chart = await this.$refs.chartRef.init(echarts);
// chart.on('click',function (params) {
// console.log(params)
// })
chart.setOption(this.option2)
},
bkydAction(index) {
uni.navigateTo({
url: `/pagesStock/stockCenterDetails/bkydmx?index=${index}`