个股中心
This commit is contained in:
@@ -78,6 +78,8 @@
|
|||||||
currentMonth)) + '-' + (currentDay > 9 ? currentDay : ('0' + currentDay))
|
currentMonth)) + '-' + (currentDay > 9 ? currentDay : ('0' + currentDay))
|
||||||
// this.getYesterdayDateData()
|
// this.getYesterdayDateData()
|
||||||
this.generateMonthDateListData()
|
this.generateMonthDateListData()
|
||||||
|
// 初始化时就派发一次当前日期事件
|
||||||
|
this.$emit('date-change', this.selectDateStr)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
@@ -92,6 +94,8 @@
|
|||||||
let selectDay = selectDate.getDate();
|
let selectDay = selectDate.getDate();
|
||||||
this.selectDateStr = selectYear + '-' + (selectMonth > 9 ? selectMonth : ('0' + selectMonth)) + '-' + (
|
this.selectDateStr = selectYear + '-' + (selectMonth > 9 ? selectMonth : ('0' + selectMonth)) + '-' + (
|
||||||
selectDay > 9 ? selectDay : ('0' + selectDay))
|
selectDay > 9 ? selectDay : ('0' + selectDay))
|
||||||
|
// 派发日期变更事件
|
||||||
|
this.$emit('date-change', this.selectDateStr)
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 生成日期数组
|
* 生成日期数组
|
||||||
@@ -279,6 +283,7 @@
|
|||||||
this.selectDateStr = item.date
|
this.selectDateStr = item.date
|
||||||
this.chgStockData = item
|
this.chgStockData = item
|
||||||
console.log('点击某天');
|
console.log('点击某天');
|
||||||
|
this.$emit('date-change', this.selectDateStr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
294
components/WordCloud/WordCloud.vue
Normal file
294
components/WordCloud/WordCloud.vue
Normal file
@@ -0,0 +1,294 @@
|
|||||||
|
<template>
|
||||||
|
<view class="word-cloud-container">
|
||||||
|
<!-- canvas组件,适配小程序 -->
|
||||||
|
<canvas
|
||||||
|
type="2d"
|
||||||
|
ref="wordCloudCanvas"
|
||||||
|
id="wordCloudCanvas"
|
||||||
|
class="word-cloud-canvas"
|
||||||
|
:style="{width: canvasWidth + 'px', height: canvasHeight + 'px'}"
|
||||||
|
></canvas>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "WordCloud",
|
||||||
|
props: {
|
||||||
|
// 词云数据 [{text: '关键词', value: 100}, ...]
|
||||||
|
wordData: {
|
||||||
|
type: Array,
|
||||||
|
required: true,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
// 画布宽度
|
||||||
|
width: {
|
||||||
|
type: Number,
|
||||||
|
default: 300
|
||||||
|
},
|
||||||
|
// 画布高度
|
||||||
|
height: {
|
||||||
|
type: Number,
|
||||||
|
default: 300
|
||||||
|
},
|
||||||
|
// 文字颜色列表(分层配色)
|
||||||
|
colorList: {
|
||||||
|
type: Array,
|
||||||
|
default: () => ['#60A5FA', '#FEC200', '#EF4444'] // 外圈、中间、中心
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
canvasWidth: this.width,
|
||||||
|
canvasHeight: this.height,
|
||||||
|
ctx: null, // canvas 2d 上下文
|
||||||
|
placedWords: [] // 已放置的文字信息(用于碰撞检测)
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
wordData: {
|
||||||
|
handler() {
|
||||||
|
this.drawWordCloud();
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.initCanvas();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 初始化canvas
|
||||||
|
async initCanvas() {
|
||||||
|
// 修复点1:增加延迟,确保canvas节点渲染完成(兼容小程序渲染时机)
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 50));
|
||||||
|
|
||||||
|
// 适配小程序获取canvas上下文
|
||||||
|
const query = uni.createSelectorQuery().in(this);
|
||||||
|
// 修复点2:使用ref选择器(.ref-wordCloudCanvas)替代ID选择器,或给canvas加id
|
||||||
|
query.select('.word-cloud-canvas') // 改用class选择器,与模板中canvas的class对应
|
||||||
|
.fields({ node: true, size: true })
|
||||||
|
.exec(async (res) => {
|
||||||
|
// 修复点3:增加空值判断,避免res[0]为null时报错
|
||||||
|
if (!res || !res[0] || !res[0].node) {
|
||||||
|
console.error('获取canvas节点失败,请检查canvas是否正确渲染');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const canvas = res[0].node;
|
||||||
|
let ctx = null;
|
||||||
|
|
||||||
|
// 修复点4:兼容不同小程序平台的canvas 2d上下文获取
|
||||||
|
try {
|
||||||
|
ctx = canvas.getContext('2d');
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('获取2d上下文失败,尝试兼容处理', e);
|
||||||
|
// 部分小程序平台需要先初始化canvas 2d
|
||||||
|
ctx = uni.createCanvasContext('wordCloudCanvas', this);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ctx) {
|
||||||
|
console.error('无法获取canvas 2d上下文');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置canvas尺寸
|
||||||
|
const dpr = uni.getSystemInfoSync().pixelRatio || 1;
|
||||||
|
canvas.width = this.canvasWidth * dpr;
|
||||||
|
canvas.height = this.canvasHeight * dpr;
|
||||||
|
ctx.scale(dpr, dpr);
|
||||||
|
|
||||||
|
this.ctx = ctx;
|
||||||
|
this.drawWordCloud();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 绘制词云核心方法
|
||||||
|
drawWordCloud() {
|
||||||
|
if (!this.ctx || !this.wordData.length) return;
|
||||||
|
|
||||||
|
// 清空画布和已放置文字记录
|
||||||
|
this.ctx.clearRect(0, 0, this.canvasWidth, this.canvasHeight);
|
||||||
|
this.placedWords = [];
|
||||||
|
|
||||||
|
// 按权重排序(权重越大,文字越大)
|
||||||
|
const sortedWords = [...this.wordData].sort((a, b) => b.value - a.value);
|
||||||
|
|
||||||
|
// 逐个绘制文字
|
||||||
|
sortedWords.forEach((word, index) => {
|
||||||
|
this.placeWord(word, index);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 放置单个文字(核心:碰撞检测,确保不重叠)
|
||||||
|
placeWord(word, index) {
|
||||||
|
const ctx = this.ctx;
|
||||||
|
// 优化1:提高最大尝试次数(从50→150),让更多文字能找到位置
|
||||||
|
const maxAttempts = 150;
|
||||||
|
const baseFontSize = 12; // 基础字体大小
|
||||||
|
|
||||||
|
// 分段计算分母(适配不同value区间)
|
||||||
|
const value = word.value;
|
||||||
|
const baseDenominator = 1000; // 基础分母
|
||||||
|
const interval = 500; // 区间步长
|
||||||
|
const step = 500; // 分母每次增加的步长
|
||||||
|
|
||||||
|
// 计算当前value所属区间,动态确定分母
|
||||||
|
const intervalNum = Math.floor(value / interval);
|
||||||
|
let denominator = baseDenominator + (intervalNum * step);
|
||||||
|
|
||||||
|
// 兜底:避免分母过小(比如value为0时)
|
||||||
|
denominator = Math.max(denominator, baseDenominator);
|
||||||
|
|
||||||
|
// 根据分段分母计算字体大小,限制最大值
|
||||||
|
const maxFontSize = 28; // 优化2:适当减小最大字体(从32→28),节省空间
|
||||||
|
const fontSize = Math.min(baseFontSize + (value / denominator) * 16, maxFontSize);
|
||||||
|
|
||||||
|
// 旋转角度:-60° 到 60°
|
||||||
|
const rotateAngle = (Math.random() - 0.5) * 120 * Math.PI / 180;
|
||||||
|
|
||||||
|
// 设置字体样式
|
||||||
|
ctx.font = `${fontSize}px sans-serif`;
|
||||||
|
|
||||||
|
// 获取文字宽度和高度(用于碰撞检测)
|
||||||
|
const textWidth = ctx.measureText(word.name).width;
|
||||||
|
// 优化3:更精准的文字高度估算(从1.2→1.05),减少无效空间
|
||||||
|
const textHeight = fontSize * 1.05;
|
||||||
|
|
||||||
|
// 尝试放置文字,直到找到不重叠的位置
|
||||||
|
for (let i = 0; i < maxAttempts; i++) {
|
||||||
|
// 优化4:扩大随机位置范围(从0.2-0.8→0.05-0.95),利用边缘空间
|
||||||
|
const x = this.canvasWidth * 0.05 + Math.random() * this.canvasWidth * 0.9;
|
||||||
|
const y = this.canvasHeight * 0.05 + Math.random() * this.canvasHeight * 0.9;
|
||||||
|
|
||||||
|
// 碰撞检测:检查当前位置是否与已放置的文字重叠(传入间距容差)
|
||||||
|
const isOverlap = this.checkOverlap(x, y, textWidth, textHeight, rotateAngle, 2); // 间距容差2px
|
||||||
|
|
||||||
|
if (!isOverlap) {
|
||||||
|
// ===== 核心修改:按位置分层设置颜色 =====
|
||||||
|
// 1. 计算画布中心坐标
|
||||||
|
const centerX = this.canvasWidth / 2;
|
||||||
|
const centerY = this.canvasHeight / 2;
|
||||||
|
|
||||||
|
// 2. 计算当前文字位置到中心的距离(欧几里得距离)
|
||||||
|
const distance = Math.sqrt(Math.pow(x - centerX, 2) + Math.pow(y - centerY, 2));
|
||||||
|
|
||||||
|
// 3. 计算画布最大半径(中心到角落的距离)
|
||||||
|
const maxDistance = Math.sqrt(Math.pow(centerX, 2) + Math.pow(centerY, 2));
|
||||||
|
|
||||||
|
// 4. 按距离分三层分配颜色
|
||||||
|
let color;
|
||||||
|
if (distance > maxDistance * 0.66) {
|
||||||
|
// 外圈(距离>2/3最大半径):#60A5FA
|
||||||
|
color = this.colorList[0];
|
||||||
|
} else if (distance > maxDistance * 0.33) {
|
||||||
|
// 中间层(距离>1/3最大半径):#FEC200
|
||||||
|
color = this.colorList[1];
|
||||||
|
} else {
|
||||||
|
// 中心层(距离≤1/3最大半径):#EF4444
|
||||||
|
color = this.colorList[2];
|
||||||
|
}
|
||||||
|
// =========================================
|
||||||
|
|
||||||
|
// 设置文字颜色
|
||||||
|
ctx.fillStyle = color;
|
||||||
|
|
||||||
|
// 无重叠,绘制文字
|
||||||
|
this.drawTextAtPosition(word.name, x, y, rotateAngle, fontSize);
|
||||||
|
|
||||||
|
// 记录已放置的文字信息(用于后续碰撞检测)
|
||||||
|
this.placedWords.push({
|
||||||
|
x, y, width: textWidth, height: textHeight, angle: rotateAngle
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 碰撞检测:检查当前文字是否与已放置的文字重叠(新增间距容差参数)
|
||||||
|
checkOverlap(x, y, width, height, angle, gap = 2) {
|
||||||
|
// 简化碰撞检测:使用包围盒检测(旋转后的矩形包围盒)
|
||||||
|
const currentRect = this.getBoundingRect(x, y, width, height, angle, gap);
|
||||||
|
|
||||||
|
for (const placed of this.placedWords) {
|
||||||
|
const placedRect = this.getBoundingRect(placed.x, placed.y, placed.width, placed.height, placed.angle, gap);
|
||||||
|
|
||||||
|
// 轴对齐包围盒(AABB)碰撞检测
|
||||||
|
if (
|
||||||
|
currentRect.left < placedRect.right &&
|
||||||
|
currentRect.right > placedRect.left &&
|
||||||
|
currentRect.top < placedRect.bottom &&
|
||||||
|
currentRect.bottom > placedRect.top
|
||||||
|
) {
|
||||||
|
return true; // 重叠
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false; // 不重叠
|
||||||
|
},
|
||||||
|
|
||||||
|
// 获取旋转后文字的包围盒(新增间距容差参数,缩小包围盒)
|
||||||
|
getBoundingRect(x, y, width, height, angle, gap = 2) {
|
||||||
|
// 计算旋转后的四个顶点
|
||||||
|
const cos = Math.cos(angle);
|
||||||
|
const sin = Math.sin(angle);
|
||||||
|
|
||||||
|
// 优化5:缩小包围盒(减去间距容差),让文字间距更小
|
||||||
|
const halfW = (width - gap) / 2;
|
||||||
|
const halfH = (height - gap) / 2;
|
||||||
|
|
||||||
|
// 四个顶点坐标(相对于中心)
|
||||||
|
const points = [
|
||||||
|
{ x: -halfW, y: -halfH },
|
||||||
|
{ x: halfW, y: -halfH },
|
||||||
|
{ x: halfW, y: halfH },
|
||||||
|
{ x: -halfW, y: halfH }
|
||||||
|
];
|
||||||
|
|
||||||
|
// 旋转并平移到实际位置
|
||||||
|
const rotatedPoints = points.map(point => ({
|
||||||
|
x: x + point.x * cos - point.y * sin,
|
||||||
|
y: y + point.x * sin + point.y * cos
|
||||||
|
}));
|
||||||
|
|
||||||
|
// 计算包围盒的最小/最大坐标
|
||||||
|
const left = Math.min(...rotatedPoints.map(p => p.x));
|
||||||
|
const right = Math.max(...rotatedPoints.map(p => p.x));
|
||||||
|
const top = Math.min(...rotatedPoints.map(p => p.y));
|
||||||
|
const bottom = Math.max(...rotatedPoints.map(p => p.y));
|
||||||
|
|
||||||
|
return { left, right, top, bottom };
|
||||||
|
},
|
||||||
|
|
||||||
|
// 在指定位置绘制旋转后的文字
|
||||||
|
drawTextAtPosition(text, x, y, angle, fontSize) {
|
||||||
|
const ctx = this.ctx;
|
||||||
|
|
||||||
|
// 保存当前画布状态
|
||||||
|
ctx.save();
|
||||||
|
|
||||||
|
// 平移到文字中心位置
|
||||||
|
ctx.translate(x, y);
|
||||||
|
// 旋转
|
||||||
|
ctx.rotate(angle);
|
||||||
|
|
||||||
|
// 绘制文字(居中对齐)
|
||||||
|
ctx.textAlign = 'center';
|
||||||
|
ctx.textBaseline = 'middle';
|
||||||
|
ctx.fillText(text, 0, 0);
|
||||||
|
|
||||||
|
// 恢复画布状态
|
||||||
|
ctx.restore();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.word-cloud-container {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.word-cloud-canvas {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
<scroll-view scroll-y class="stockDetailsC fixed" :style="'top:'+contentTop+'px;'">
|
<scroll-view scroll-y class="stockDetailsC fixed" :style="'top:'+contentTop+'px;'">
|
||||||
<view>
|
<view>
|
||||||
<view style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 16rpx; margin: 0 20rpx;">
|
<view style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 16rpx; margin: 0 20rpx;">
|
||||||
<view @click="list2Index = index" v-for="(item,index) in topLists" :key="index"
|
<view @click="handleTypeClick(index)" v-for="(item,index) in topLists" :key="index"
|
||||||
style="padding: 12rpx;"
|
style="padding: 12rpx;"
|
||||||
:style="{'border-bottom': (list2Index == index ? '1rpx solid #F2C369' : 'none')}">
|
:style="{'border-bottom': (list2Index == index ? '1rpx solid #F2C369' : 'none')}">
|
||||||
<view style="font-size: 24rpx; color: #070707; font-weight: bold; text-align: center;"
|
<view style="font-size: 24rpx; color: #070707; font-weight: bold; text-align: center;"
|
||||||
@@ -33,13 +33,19 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- '股票名称', '涨跌幅', '市值', '成交额', '行业' 的 内容 -->
|
<!-- '股票名称', '涨跌幅', '市值', '成交额', '行业' 的 内容 -->
|
||||||
<view v-for="(obj, j) in 10"
|
<view v-for="(obj, j) in filteredData" @click="itemDetails(obj)"
|
||||||
style="display: grid; grid-template-columns: repeat(5, 1fr); gap: 10rpx; min-height: 60rpx; margin: 0 20rpx;"
|
style="display: grid; grid-template-columns: repeat(5, 1fr); gap: 10rpx; min-height: 60rpx; margin: 0 20rpx;"
|
||||||
:style="{'background-color': (j % 2 == 0 ? '#fff' : '#FAFAFC')}">
|
:style="{'background-color': (j % 2 == 0 ? '#fff' : '#FAFAFC')}">
|
||||||
<view v-for="(item,index) in ['云南白药', '+0.04%', '996.85 亿元', '4.44 亿元', '医药生物']" :key="index"
|
<!-- 外层循环:每一行数据 -->
|
||||||
style="padding: 10rpx 0; color: #666666; font-size: 20rpx; font-weight: 500; text-align: center; display: flex; justify-content: center; align-items: center; flex-direction: column;" :style="{color: (index == 0 ? '#222222' : index == 1 ? '#EC3440' : '#666666')}">
|
<view v-for="(item,index) in getTableItem(obj)" :key="index"
|
||||||
<view>{{item}}</view>
|
style="padding: 10rpx 0; color: #666666; font-size: 20rpx; font-weight: 500; text-align: center; display: flex; justify-content: center; align-items: center; flex-direction: column;"
|
||||||
<view v-if="index == 0" style="color: #666666; font-size: 20rpx; font-weight: 500;">000768</view>
|
|
||||||
|
:style="{
|
||||||
|
color: (index == 0 ? '#222222' :
|
||||||
|
index == 1 ? (item[2] === 'positive' ? '#EC3440' : '#01AB5D') : '#666666')
|
||||||
|
}">
|
||||||
|
<view>{{item[0]}}</view>
|
||||||
|
<view v-if="index == 0" style="color: #666666; font-size: 20rpx; font-weight: 500;">{{item[1]}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="height: 25rpx;"></view>
|
<view style="height: 25rpx;"></view>
|
||||||
@@ -53,12 +59,18 @@
|
|||||||
import {
|
import {
|
||||||
inject
|
inject
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
|
import {
|
||||||
|
marketHeatmap
|
||||||
|
} from '@/request/api'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
navH: inject('navHeight'),
|
navH: inject('navHeight'),
|
||||||
contentTop: '',
|
contentTop: '',
|
||||||
|
allStockData: [],
|
||||||
|
filteredData: [],
|
||||||
|
currentDate: '', // 最终要赋值的日期
|
||||||
topLists: [{
|
topLists: [{
|
||||||
title: '超大盘股',
|
title: '超大盘股',
|
||||||
value: '(>1000亿)',
|
value: '(>1000亿)',
|
||||||
@@ -76,11 +88,90 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.activeIndex = e.index
|
this.currentDate = e.currentDate
|
||||||
this.contentTop = this.navH + (20 + 70 + 25) / 750 * inject('windowWidth')
|
this.contentTop = this.navH + (20 + 70 + 25) / 750 * inject('windowWidth')
|
||||||
|
this.marketHeatmap()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleTypeClick(index) {
|
||||||
|
this.list2Index = index;
|
||||||
|
// 先请求数据,再筛选
|
||||||
|
this.marketHeatmap();
|
||||||
|
},
|
||||||
|
getTableItem(obj) {
|
||||||
|
// 1. 处理空值,避免 toFixed 调用时报错
|
||||||
|
const marketCap = obj.market_cap ? obj.market_cap.toFixed(2) : '0.00';
|
||||||
|
const amount = obj.amount ? obj.amount.toFixed(2) : '0.00';
|
||||||
|
// 统一处理涨跌幅:空值默认0,转数字避免字符串干扰判断
|
||||||
|
const changePercent = obj.change_percent ? Number(obj.change_percent) : 0;
|
||||||
|
|
||||||
|
// 2. 处理涨跌幅的符号和类型标记
|
||||||
|
let changePercentStr = '';
|
||||||
|
let changeType = ''; // 标记正负:positive/negative/zero
|
||||||
|
if (changePercent > 0) {
|
||||||
|
changePercentStr = `+${changePercent}%`; // 正数拼接+号
|
||||||
|
changeType = 'positive';
|
||||||
|
} else if (changePercent < 0) {
|
||||||
|
changePercentStr = `${changePercent}%`; // 负数直接显示
|
||||||
|
changeType = 'negative';
|
||||||
|
} else {
|
||||||
|
changePercentStr = '0%'; // 0值统一显示
|
||||||
|
changeType = 'zero';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 返回数组:涨跌幅位置新增 changeType 用于模板判断颜色
|
||||||
|
return [
|
||||||
|
[obj.stock_name, obj.stock_code],
|
||||||
|
[changePercentStr, '', changeType], // 第三个元素存类型标记
|
||||||
|
[`${marketCap}亿元`],
|
||||||
|
[`${amount}亿元`],
|
||||||
|
[obj.industry || '暂无'] // 处理行业为空的情况
|
||||||
|
];
|
||||||
|
},
|
||||||
|
marketHeatmap() {
|
||||||
|
let param = {
|
||||||
|
limit: 500,
|
||||||
|
date: this.currentDate
|
||||||
|
}
|
||||||
|
marketHeatmap(param).then(res => {
|
||||||
|
// 存储原始数据
|
||||||
|
this.allStockData = res.data || [];
|
||||||
|
// 调用筛选方法
|
||||||
|
this.filterStockByMarketCap();
|
||||||
|
|
||||||
|
}).catch(error => {
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 根据市值区间筛选数据
|
||||||
|
filterStockByMarketCap() {
|
||||||
|
const {
|
||||||
|
list2Index,
|
||||||
|
allStockData
|
||||||
|
} = this;
|
||||||
|
let filtered = [];
|
||||||
|
|
||||||
|
switch (list2Index) {
|
||||||
|
case 0: // 超大盘股(>1000亿)
|
||||||
|
filtered = allStockData.filter(item => item.market_cap > 1000);
|
||||||
|
break;
|
||||||
|
case 1: // 大盘股(500-1000亿)
|
||||||
|
filtered = allStockData.filter(item => item.market_cap >= 500 && item.market_cap <= 1000);
|
||||||
|
break;
|
||||||
|
case 2: // 中盘股(100-500亿)
|
||||||
|
filtered = allStockData.filter(item => item.market_cap >= 100 && item.market_cap <= 500);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
filtered = allStockData;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.filteredData = filtered;
|
||||||
|
},
|
||||||
|
itemDetails(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesStock/stockCenterDetails/stockCenterDetails?code=' + item.stock_code
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -45,12 +45,14 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- '股票名称', '涨跌幅', '市值', '成交额', '行业' 的 内容 -->
|
<!-- '股票名称', '涨跌幅', '市值', '成交额', '行业' 的 内容 -->
|
||||||
|
|
||||||
<view v-for="(obj, j) in filteredData" @click="itemDetails(obj)"
|
<view v-for="(obj, j) in filteredData" @click="itemDetails(obj)"
|
||||||
style="display: grid; grid-template-columns: repeat(5, 1fr); gap: 10rpx; min-height: 60rpx; margin: 0 20rpx;"
|
style="display: grid; grid-template-columns: repeat(5, 1fr); gap: 10rpx; min-height: 60rpx; margin: 0 20rpx;"
|
||||||
:style="{'background-color': (j % 2 == 0 ? '#fff' : '#FAFAFC')}">
|
:style="{'background-color': (j % 2 == 0 ? '#fff' : '#FAFAFC')}">
|
||||||
|
<!-- 外层循环:每一行数据 -->
|
||||||
<view v-for="(item,index) in getTableItem(obj)" :key="index"
|
<view v-for="(item,index) in getTableItem(obj)" :key="index"
|
||||||
style="padding: 10rpx 0; color: #666666; font-size: 20rpx; font-weight: 500; text-align: center; display: flex; justify-content: center; align-items: center; flex-direction: column;"
|
style="padding: 10rpx 0; color: #666666; font-size: 20rpx; font-weight: 500; text-align: center; display: flex; justify-content: center; align-items: center; flex-direction: column;"
|
||||||
:style="{color: (index == 0 ? '#222222' : index == 1 ? '#EC3440' : '#666666')}">
|
:style="{ color: (index == 0 ? '#222222' : index == 1 ? (item[2] === 'positive' ? '#EC3440' : '#01AB5D') : '#666666') }">
|
||||||
<view>{{item[0]}}</view>
|
<view>{{item[0]}}</view>
|
||||||
<view v-if="index == 0" style="color: #666666; font-size: 20rpx; font-weight: 500;">{{item[1]}}
|
<view v-if="index == 0" style="color: #666666; font-size: 20rpx; font-weight: 500;">{{item[1]}}
|
||||||
</view>
|
</view>
|
||||||
@@ -80,7 +82,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view @click="allAction(2)"
|
<view @click="allAction(2)"
|
||||||
style="border: 1rpx solid #DCDCDC; border-radius: 5rpx; padding: 2rpx 10rpx; display: flex; align-items: center; justify-content: center;">
|
style="border: 1rpx solid #DCDCDC; border-radius: 5rpx; padding: 2rpx 10rpx; display: flex; align-items: center; justify-content: center;">
|
||||||
<view style="color: #888888; font-size: 22rpx; font-weight: 500;">2026/01/20</view>
|
<view style="color: #888888; font-size: 22rpx; font-weight: 500;">{{currentDate}}</view>
|
||||||
<image style="width: 11rpx; height: 6rpx; margin-left: 20rpx;"
|
<image style="width: 11rpx; height: 6rpx; margin-left: 20rpx;"
|
||||||
src="/static/icon/invest/downArrow.png" mode="widthFix"></image>
|
src="/static/icon/invest/downArrow.png" mode="widthFix"></image>
|
||||||
</view>
|
</view>
|
||||||
@@ -99,12 +101,13 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-for="(item,index) in 10" :key="index" @click="bkydAction(item)"
|
<view v-for="(item,index) in marketAlertsList" :key="index" @click="bkydAction(item)"
|
||||||
style="margin: 20rpx; margin-top: 0; background-color: #FAFAFC; border-radius: 10rpx; overflow: hidden; padding: 20rpx 30rpx; font-weight: 500;">
|
style="margin: 20rpx; margin-top: 0; background-color: #FAFAFC; border-radius: 10rpx; overflow: hidden; padding: 20rpx 30rpx; font-weight: 500;">
|
||||||
<view style="color: #888888; font-size: 20rpx;">09:54</view>
|
<view style="color: #888888; font-size: 20rpx;">{{item.time}}</view>
|
||||||
|
|
||||||
<view style="display: flex; align-items: center; margin-top: 10rpx;">
|
<view style="display: flex; align-items: center; margin-top: 10rpx;">
|
||||||
<view style="color: #2B2B2B; font-weight: bold; font-size: 26rpx; margin-right: 10rpx;">数据交易所
|
<view style="color: #2B2B2B; font-weight: bold; font-size: 26rpx; margin-right: 10rpx;">
|
||||||
|
{{item.concept_name}}
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
style="color: #EC3440; font-size: 20rpx; border: 1rpx solid #EC3440; border-radius: 15rpx; height: 30rpx; display: flex; align-items: center; justify-content: center; padding: 0 10rpx; box-sizing: border-box;">
|
style="color: #EC3440; font-size: 20rpx; border: 1rpx solid #EC3440; border-radius: 15rpx; height: 30rpx; display: flex; align-items: center; justify-content: center; padding: 0 10rpx; box-sizing: border-box;">
|
||||||
@@ -114,11 +117,17 @@
|
|||||||
</view>
|
</view>
|
||||||
<view style="flex: 1; font-size: 22rpx; text-align: right;">
|
<view style="flex: 1; font-size: 22rpx; text-align: right;">
|
||||||
<text style="color: #71675D;">板块均涨</text>
|
<text style="color: #71675D;">板块均涨</text>
|
||||||
<text
|
<text :style="{
|
||||||
style="color: #EC3440; font-weight: bold; margin-left: 10rpx; margin-right: 20rpx;">+6.64%</text>
|
color: Number(item.alpha) > 0 ? '#EC3440' : '#01AB5D',
|
||||||
<text style="color: #EC3440; font-weight: bold;">14涨</text>
|
fontWeight: 'bold',
|
||||||
|
marginLeft: '5rpx',
|
||||||
|
marginRight: '15rpx'
|
||||||
|
}">
|
||||||
|
{{ Number(item.alpha) > 0 ? '+' + formatAlpha(item.alpha) : formatAlpha(item.alpha) }}%
|
||||||
|
</text>
|
||||||
|
<text style="color: #EC3440; font-weight: bold;">0涨</text>
|
||||||
<text style="color: #888888; margin: 0 5rpx;">/</text>
|
<text style="color: #888888; margin: 0 5rpx;">/</text>
|
||||||
<text style="color: #01AB5D; font-weight: bold;">5跌</text>
|
<text style="color: #01AB5D; font-weight: bold;">0跌</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -126,15 +135,20 @@
|
|||||||
style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 20rpx; font-size: 22rpx; color: #71675D; font-weight: 500; margin-top: 15rpx;">
|
style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 20rpx; font-size: 22rpx; color: #71675D; font-weight: 500; margin-top: 15rpx;">
|
||||||
<view style="text-align: left;">
|
<view style="text-align: left;">
|
||||||
<text>评分</text>
|
<text>评分</text>
|
||||||
<text style="color: #EC3440; font-weight: bold; margin-left: 10rpx;">56</text>
|
<text
|
||||||
|
style="color: #EC3440; font-weight: bold; margin-left: 10rpx;">{{ Math.round(item.final_score) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view style="text-align: center;">
|
<view style="text-align: center;">
|
||||||
<text>超额收益</text>
|
<text>超额收益</text>
|
||||||
<text style="color: #EC3440; font-weight: bold; margin-left: 10rpx;">+9.28%</text>
|
<text style="color: #EC3440; font-weight: bold; margin-left: 10rpx;">+ 0%</text>
|
||||||
</view>
|
</view>
|
||||||
<view style="text-align: right;">
|
|
||||||
|
<view style="text-align: right;"
|
||||||
|
v-if="item && Number(item.limit_up_ratio) > 0 && !isNaN(Number(item.limit_up_ratio))">
|
||||||
<text>涨停比</text>
|
<text>涨停比</text>
|
||||||
<text style="color: #EC3440; font-weight: bold; margin-left: 10rpx;">19%</text>
|
<text style="color: #EC3440; font-weight: bold; margin-left: 10rpx;">
|
||||||
|
{{ formatLimitUpRatio(item.limit_up_ratio, 0) }}
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -157,8 +171,12 @@
|
|||||||
<view v-for="(item,index) in typeList" :key="index">
|
<view v-for="(item,index) in typeList" :key="index">
|
||||||
<view style="height: 1rpx; background-color: #EAEAEA; margin: 0 20rpx;"></view>
|
<view style="height: 1rpx; background-color: #EAEAEA; margin: 0 20rpx;"></view>
|
||||||
<view style="display: flex; align-items: center; justify-content: center; height: 80rpx;">
|
<view style="display: flex; align-items: center; justify-content: center; height: 80rpx;">
|
||||||
<image style="width: 26rpx; height: 26rpx; margin-right: 18rpx;" :src="item.backIcon" mode="aspectFit"></image>
|
<image style="width: 26rpx; height: 26rpx; margin-right: 18rpx;" :src="item.backIcon"
|
||||||
<view style="min-width: 100rpx; text-align: center; font-size: 24rpx; font-weight: 500; color: #070707;">{{item.title}}</view>
|
mode="aspectFit"></image>
|
||||||
|
<view
|
||||||
|
style="min-width: 100rpx; text-align: center; font-size: 24rpx; font-weight: 500; color: #070707;">
|
||||||
|
{{item.title}}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -175,7 +193,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view style="margin: 0 38rpx; padding-bottom: 38rpx;">
|
<view style="margin: 0 38rpx; padding-bottom: 38rpx;">
|
||||||
<LCCalendar2></LCCalendar2>
|
<LCCalendar2 @date-change="handleDateChange"></LCCalendar2>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</uni-popup>
|
</uni-popup>
|
||||||
@@ -187,14 +205,18 @@
|
|||||||
<view style="color: #727A8E; width: 60rpx;"></view>
|
<view style="color: #727A8E; width: 60rpx;"></view>
|
||||||
<view style="flex: 1; text-align: center; color: #333333; font-size: 36rpx; font-weight: bold;">详情
|
<view style="flex: 1; text-align: center; color: #333333; font-size: 36rpx; font-weight: bold;">详情
|
||||||
</view>
|
</view>
|
||||||
<view style="color: #D79412; width: 60rpx; display: flex; align-items: center; justify-content: center;" @click="closeAction(3)">
|
<view
|
||||||
<image style="width: 20rpx; height: 20rpx;" src="/static/icon/home/close.png" mode="widthFix"></image>
|
style="color: #D79412; width: 60rpx; display: flex; align-items: center; justify-content: center;"
|
||||||
|
@click="closeAction(3)">
|
||||||
|
<image style="width: 20rpx; height: 20rpx;" src="/static/icon/home/close.png" mode="widthFix">
|
||||||
|
</image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view style="height: 1rpx; margin: 0 20rpx; background-color: #E7E7E7;"></view>
|
<view style="height: 1rpx; margin: 0 20rpx; background-color: #E7E7E7;"></view>
|
||||||
|
|
||||||
<view style="padding: 0 25rpx; box-sizing: border-box; height: 45rpx; margin: 0 45rpx; margin-top: 15rpx; background-color: #FAFAFC;">
|
<view
|
||||||
|
style="padding: 0 25rpx; box-sizing: border-box; height: 45rpx; margin: 0 45rpx; margin-top: 15rpx; background-color: #FAFAFC;">
|
||||||
<view style="display: flex; align-items: center; height: 100%;">
|
<view style="display: flex; align-items: center; height: 100%;">
|
||||||
<view style="color: #666666; font-weight: 500; font-size: 24rpx; margin-right: 10rpx;">相关股票
|
<view style="color: #666666; font-weight: 500; font-size: 24rpx; margin-right: 10rpx;">相关股票
|
||||||
</view>
|
</view>
|
||||||
@@ -202,24 +224,30 @@
|
|||||||
<view style="flex: 1; font-size: 22rpx; text-align: right;">
|
<view style="flex: 1; font-size: 22rpx; text-align: right;">
|
||||||
<text style="color: #71675D;">板块均涨</text>
|
<text style="color: #71675D;">板块均涨</text>
|
||||||
<text
|
<text
|
||||||
style="color: #EC3440; font-weight: bold; margin-left: 10rpx; margin-right: 20rpx;">+6.64%</text>
|
style="color: #EC3440; font-weight: bold; margin-left: 10rpx; margin-right: 20rpx;">+0.00%</text>
|
||||||
<text style="color: #EC3440; font-weight: bold;">14涨</text>
|
<text style="color: #EC3440; font-weight: bold;">0涨</text>
|
||||||
<text style="color: #888888; margin: 0 5rpx;">/</text>
|
<text style="color: #888888; margin: 0 5rpx;">/</text>
|
||||||
<text style="color: #01AB5D; font-weight: bold;">5跌</text>
|
<text style="color: #01AB5D; font-weight: bold;">0跌</text>
|
||||||
<text style="color: #71675D; margin-left: 20rpx;">涨停比</text>
|
<text style="color: #71675D; margin-left: 20rpx;">涨停比</text>
|
||||||
<text style="color: #EC3440; font-weight: bold; margin-left: 10rpx;">19%</text>
|
<text style="color: #EC3440; font-weight: bold; margin-left: 10rpx;">0%</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-for="(item, index) in conceptStocksList" :key="index"
|
||||||
|
style="padding: 0 25rpx; box-sizing: border-box; height: 45rpx; margin: 0 45rpx; display: flex; align-items: center; font-weight: 500;"
|
||||||
<view v-for="(item, index) in 10" style="padding: 0 25rpx; box-sizing: border-box; height: 45rpx; margin: 0 45rpx; display: flex; align-items: center; font-weight: 500;"
|
|
||||||
:style="{ 'background-color': (index % 2 == 0 ? '#fff' : '#FAFAFC')}">
|
:style="{ 'background-color': (index % 2 == 0 ? '#fff' : '#FAFAFC')}">
|
||||||
<view style="color: #222222; font-size: 24rpx; font-weight: bold;">科泰电源</view>
|
<!-- 股票名称 -->
|
||||||
<view style="flex: 1; color: #888888; font-size: 20rpx; margin: 0 20rpx;">000880</view>
|
<view style="color: #222222; font-size: 24rpx; font-weight: bold;">{{ item.name }}</view>
|
||||||
<view style="color: #EC3440; font-size: 22rpx; font-weight: bold;">+11.02%</view>
|
<!-- 股票代码 -->
|
||||||
|
<view style="flex: 1; color: #888888; font-size: 20rpx; margin: 0 20rpx;">{{ item.code }}</view>
|
||||||
|
<!-- 涨跌幅(动态绑定颜色和格式化显示) -->
|
||||||
|
<view :style="{ color: getChangeColor(item.change_pct), fontSize: '22rpx', fontWeight: 'bold' }">
|
||||||
|
{{ formatChangePct(item.change_pct) }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
</view>
|
||||||
</uni-popup>
|
</uni-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -228,47 +256,56 @@
|
|||||||
import {
|
import {
|
||||||
inject
|
inject
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
import { conceptsDailyTop,marketHeatmap,marketStatistics,marketHotspotOverview } from '@/request/api'
|
import {
|
||||||
|
conceptsDailyTop,
|
||||||
|
marketHeatmap,
|
||||||
|
marketStatistics,
|
||||||
|
marketHotspotOverview,
|
||||||
|
conceptStocks
|
||||||
|
} from '@/request/api'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
navH: inject('navHeight'),
|
navH: inject('navHeight'),
|
||||||
contentTop: '',
|
contentTop: '',
|
||||||
allStockData:[],
|
currentDate: '', // 最终要赋值的日期
|
||||||
filteredData:[],
|
selectedDate: '', // 临时存储选中的日期
|
||||||
|
allStockData: [],
|
||||||
|
filteredData: [],
|
||||||
|
conceptStocksList: [],
|
||||||
topLists: [{
|
topLists: [{
|
||||||
title: '大盘涨跌幅',
|
title: '大盘涨跌幅',
|
||||||
value: '+0.31%',
|
value: '+0.00%',
|
||||||
color: '#EC3440',
|
color: '#EC3440',
|
||||||
backIcon: '/static/icon/gegu/gg-top-0.png'
|
backIcon: '/static/icon/gegu/gg-top-0.png'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '涨停/跌停',
|
title: '涨停/跌停',
|
||||||
value: '+0.31%',
|
value: '+0.00%',
|
||||||
color: '#070707',
|
color: '#070707',
|
||||||
backIcon: '/static/icon/gegu/gg-top-1.png'
|
backIcon: '/static/icon/gegu/gg-top-1.png'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '多空对比',
|
title: '多空对比',
|
||||||
value: '3572/1855',
|
value: '0/0',
|
||||||
color: '#070707',
|
color: '#070707',
|
||||||
backIcon: '/static/icon/gegu/gg-top-2.png'
|
backIcon: '/static/icon/gegu/gg-top-2.png'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '今日成交额',
|
title: '今日成交额',
|
||||||
value: '1.5万亿',
|
value: '0万亿',
|
||||||
color: '#070707',
|
color: '#070707',
|
||||||
backIcon: '/static/icon/gegu/gg-top-3.png'
|
backIcon: '/static/icon/gegu/gg-top-3.png'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'A股总市值',
|
title: 'A股总市值',
|
||||||
value: '113.8万亿',
|
value: '0万亿',
|
||||||
color: '#070707',
|
color: '#070707',
|
||||||
backIcon: '/static/icon/gegu/gg-top-4.png'
|
backIcon: '/static/icon/gegu/gg-top-4.png'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '连板龙头',
|
title: '连板龙头',
|
||||||
value: '10只',
|
value: '0只',
|
||||||
color: '#F59B38',
|
color: '#F59B38',
|
||||||
backIcon: '/static/icon/gegu/gg-top-5.png'
|
backIcon: '/static/icon/gegu/gg-top-5.png'
|
||||||
}
|
}
|
||||||
@@ -306,61 +343,133 @@ import { conceptsDailyTop,marketHeatmap,marketStatistics,marketHotspotOverview }
|
|||||||
{
|
{
|
||||||
title: '放量震荡',
|
title: '放量震荡',
|
||||||
backIcon: '/static/icon/gegu/cate-4.png'
|
backIcon: '/static/icon/gegu/cate-4.png'
|
||||||
}]
|
}
|
||||||
|
],
|
||||||
|
marketAlertsList: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.activeIndex = e.index
|
this.activeIndex = e.index
|
||||||
this.contentTop = this.navH + (20 + 70 + 25) / 750 * inject('windowWidth')
|
this.contentTop = this.navH + (20 + 70 + 25) / 750 * inject('windowWidth')
|
||||||
//this.conceptsDailyTop()
|
//this.conceptsDailyTop()
|
||||||
this.marketHeatmap()
|
const now = new Date()
|
||||||
//this.marketStatistics()
|
const year = now.getFullYear()
|
||||||
//this.marketHotspotOverview()
|
const month = (now.getMonth() + 1).toString().padStart(2, '0')
|
||||||
|
const day = now.getDate().toString().padStart(2, '0')
|
||||||
|
this.currentDate = `${year}-${month}-${day}`
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.marketHeatmap();
|
||||||
|
this.marketStatistics()
|
||||||
|
|
||||||
|
this.marketHotspotListOverview()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
formatAlpha(value) {
|
||||||
|
// 1. 空值/非数字处理
|
||||||
|
if (value === null || value === undefined || isNaN(Number(value))) {
|
||||||
|
return '0.0';
|
||||||
|
}
|
||||||
|
// 2. 转数字后保留1位小数
|
||||||
|
return Number(value).toFixed(1);
|
||||||
|
},
|
||||||
handleTypeClick(index) {
|
handleTypeClick(index) {
|
||||||
this.list2Index = index;
|
this.list2Index = index;
|
||||||
|
|
||||||
// 先请求数据,再筛选
|
// 先请求数据,再筛选
|
||||||
this.marketHeatmap();
|
this.marketHeatmap(this.currentDate);
|
||||||
},
|
},
|
||||||
getTableItem(obj) {
|
getTableItem(obj) {
|
||||||
// 先处理空值,避免 toFixed 调用时报错
|
// 1. 处理空值,避免 toFixed 调用时报错
|
||||||
const marketCap = obj.market_cap ? obj.market_cap.toFixed(2) : '0.00';
|
const marketCap = obj.market_cap ? obj.market_cap.toFixed(2) : '0.00';
|
||||||
const amount = obj.amount ? obj.amount.toFixed(2) : '0.00';
|
const amount = obj.amount ? obj.amount.toFixed(2) : '0.00';
|
||||||
const changePercent = obj.change_percent ? obj.change_percent : 0;
|
// 统一处理涨跌幅:空值默认0,转数字避免字符串干扰判断
|
||||||
|
const changePercent = obj.change_percent ? Number(obj.change_percent) : 0;
|
||||||
|
|
||||||
|
// 2. 处理涨跌幅的符号和类型标记
|
||||||
|
let changePercentStr = '';
|
||||||
|
let changeType = ''; // 标记正负:positive/negative/zero
|
||||||
|
if (changePercent > 0) {
|
||||||
|
changePercentStr = `+${changePercent}%`; // 正数拼接+号
|
||||||
|
changeType = 'positive';
|
||||||
|
} else if (changePercent < 0) {
|
||||||
|
changePercentStr = `${changePercent}%`; // 负数直接显示
|
||||||
|
changeType = 'negative';
|
||||||
|
} else {
|
||||||
|
changePercentStr = '0%'; // 0值统一显示
|
||||||
|
changeType = 'zero';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 返回数组:涨跌幅位置新增 changeType 用于模板判断颜色
|
||||||
return [
|
return [
|
||||||
[obj.stock_name, obj.stock_code],
|
[obj.stock_name, obj.stock_code],
|
||||||
[`${changePercent}%`], // 使用模板字符串更规范
|
[changePercentStr, '', changeType], // 第三个元素存类型标记
|
||||||
[`${marketCap}亿元`],
|
[`${marketCap}亿元`],
|
||||||
[`${amount}亿元`],
|
[`${amount}亿元`],
|
||||||
[obj.industry || '暂无'] // 处理行业为空的情况
|
[obj.industry || '暂无'] // 处理行业为空的情况
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
conceptsDailyTop(){
|
// 处理涨停比:转百分比 + 四舍五入(可指定保留小数位数)
|
||||||
conceptsDailyTop().then(res=>{
|
formatLimitUpRatio(value, decimalPlaces = 0) {
|
||||||
|
// 1. 先判断值是否有效,无效直接返回空或0%
|
||||||
|
if (!value || isNaN(Number(value))) {
|
||||||
|
return '0%';
|
||||||
|
}
|
||||||
|
// 2. 正常计算逻辑
|
||||||
|
const percentValue = Number(value) * 100;
|
||||||
|
const result = decimalPlaces === 0 ? Math.round(percentValue) : percentValue.toFixed(decimalPlaces);
|
||||||
|
return `${result}%`;
|
||||||
|
},
|
||||||
|
|
||||||
}).catch(error=>{
|
|
||||||
|
conceptsDailyTop() {
|
||||||
|
conceptsDailyTop().then(res => {
|
||||||
|
|
||||||
|
}).catch(error => {
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
marketHeatmap(){
|
marketHeatmap(currentDate) {
|
||||||
let param = {
|
let param = {
|
||||||
limit: 500
|
limit: 500
|
||||||
}
|
}
|
||||||
marketHeatmap(param).then(res=>{
|
if (currentDate && currentDate !== 'undefined' && currentDate.trim() !== '') {
|
||||||
|
param.date = currentDate;
|
||||||
|
}
|
||||||
|
marketHeatmap(param).then(res => {
|
||||||
|
this.topLists[2].value = res.statistics.rising_count + "/" + res.statistics.falling_count;
|
||||||
// 存储原始数据
|
// 存储原始数据
|
||||||
this.allStockData = res.data || [];
|
this.allStockData = res.data || [];
|
||||||
|
|
||||||
|
// 2. 计算涨停数和跌停数(核心新增逻辑)
|
||||||
|
// 涨停数:涨幅 >= 9.9% 的股票数量
|
||||||
|
const limitUpCount = this.allStockData.filter((s) => {
|
||||||
|
// 做空值/非数字保护,避免change_percent异常导致判断错误
|
||||||
|
const changePercent = Number(s.change_percent);
|
||||||
|
return !isNaN(changePercent) && changePercent >= 9.9;
|
||||||
|
}).length;
|
||||||
|
|
||||||
|
// 跌停数:跌幅 <= -9.9% 的股票数量
|
||||||
|
const limitDownCount = this.allStockData.filter((s) => {
|
||||||
|
const changePercent = Number(s.change_percent);
|
||||||
|
return !isNaN(changePercent) && changePercent <= -9.9;
|
||||||
|
}).length;
|
||||||
|
|
||||||
|
this.topLists[1].value = limitUpCount + "/" + limitDownCount;
|
||||||
|
this.topLists[5].value = limitUpCount + "只";
|
||||||
// 调用筛选方法
|
// 调用筛选方法
|
||||||
this.filterStockByMarketCap();
|
this.filterStockByMarketCap();
|
||||||
|
|
||||||
}).catch(error=>{
|
}).catch(error => {
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 根据市值区间筛选数据
|
// 根据市值区间筛选数据
|
||||||
filterStockByMarketCap() {
|
filterStockByMarketCap() {
|
||||||
const { list2Index, allStockData } = this;
|
const {
|
||||||
|
list2Index,
|
||||||
|
allStockData
|
||||||
|
} = this;
|
||||||
let filtered = [];
|
let filtered = [];
|
||||||
|
|
||||||
switch (list2Index) {
|
switch (list2Index) {
|
||||||
@@ -377,57 +486,178 @@ import { conceptsDailyTop,marketHeatmap,marketStatistics,marketHotspotOverview }
|
|||||||
filtered = allStockData;
|
filtered = allStockData;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.filteredData = filtered;
|
this.filteredData = filtered.slice(0, 10);
|
||||||
},
|
},
|
||||||
marketStatistics(){
|
marketStatistics() {
|
||||||
marketStatistics().then(res=>{
|
marketStatistics().then(res => {
|
||||||
|
|
||||||
}).catch(error=>{
|
this.topLists[3].value = this.formatToTrillion(res.summary.total_amount);
|
||||||
|
// 格式化 total_market_cap 为 114.7 万亿
|
||||||
|
this.topLists[4].value = this.formatToTrillion(res.summary.total_market_cap);
|
||||||
|
}).catch(error => {
|
||||||
|
this.topLists[3].value = '0.0 万亿';
|
||||||
|
this.topLists[4].value = '0.0 万亿';
|
||||||
|
})
|
||||||
|
},
|
||||||
|
formatToTrillion(num) {
|
||||||
|
if (typeof num !== 'number' || isNaN(num)) {
|
||||||
|
return '0.0 万亿'; // 处理非数字的异常情况
|
||||||
|
}
|
||||||
|
// 转换为万亿单位(除以 10000)并保留 1 位小数
|
||||||
|
const trillionValue = (num / 10000).toFixed(1);
|
||||||
|
return `${trillionValue} 万亿`;
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
marketHotspotListOverview() {
|
||||||
|
|
||||||
|
let param = {
|
||||||
|
date: this.currentDate
|
||||||
|
}
|
||||||
|
marketHotspotOverview(param).then(res => {
|
||||||
|
const alerts = res?.data?.alerts || [];
|
||||||
|
|
||||||
|
const changePct = res.data.index.change_pct;
|
||||||
|
let numPct = 0;
|
||||||
|
// 校验数值有效性,转成数字类型
|
||||||
|
if (changePct && !isNaN(Number(changePct))) {
|
||||||
|
numPct = Number(changePct);
|
||||||
|
}
|
||||||
|
const roundedPct = Math.round(numPct * 100) / 100;
|
||||||
|
const fixedPct = roundedPct.toFixed(2);
|
||||||
|
// 3. 处理正负符号和百分号
|
||||||
|
let formattedPct = '';
|
||||||
|
if (roundedPct > 0) {
|
||||||
|
formattedPct = `+${fixedPct}%`; // 正数拼接+号
|
||||||
|
} else if (roundedPct < 0) {
|
||||||
|
formattedPct = `${fixedPct}%`; // 负数直接显示
|
||||||
|
} else {
|
||||||
|
formattedPct = '0.00%'; // 0值统一显示
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 根据正负值设置颜色
|
||||||
|
const color = roundedPct > 0 ? '#EC3440' : (roundedPct < 0 ? '#01AB5D' : '#666666');
|
||||||
|
|
||||||
|
// 5. 赋值给topLists
|
||||||
|
this.topLists[0].value = formattedPct;
|
||||||
|
this.topLists[0].color = color;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 2. 定义时间排序函数:将 time 字符串(如 "09:42")转换为分钟数进行比较
|
||||||
|
const sortByTimeDesc = (a, b) => {
|
||||||
|
// 把 "HH:MM" 格式的时间转成分钟数(比如 09:42 → 9*60+42=582 分钟)
|
||||||
|
const timeToMinutes = (timeStr) => {
|
||||||
|
const [hours, minutes] = timeStr.split(':').map(Number);
|
||||||
|
return hours * 60 + minutes;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 计算两个条目的分钟数,倒序排列(b - a 实现时间大的在前)
|
||||||
|
const minutesA = timeToMinutes(a.time);
|
||||||
|
const minutesB = timeToMinutes(b.time);
|
||||||
|
return minutesB - minutesA;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 3. 对 alerts 数组进行排序
|
||||||
|
const sortedAlerts = alerts.sort(sortByTimeDesc);
|
||||||
|
|
||||||
|
// 4. 将排序后的数组赋值给页面变量(假设你用的是 Vue,可根据实际框架调整)
|
||||||
|
this.marketAlertsList = sortedAlerts;
|
||||||
|
}).catch(error => {
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
marketHotspotOverview(){
|
itemDetails(item) {
|
||||||
marketHotspotOverview().then(res=>{
|
|
||||||
|
|
||||||
}).catch(error=>{
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
itemDetails(item){
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pagesStock/stockCenterDetails/stockCenterDetails?code='+item.stock_code
|
url: '/pagesStock/stockCenterDetails/stockCenterDetails?code=' + item.stock_code
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
moreAction() {
|
moreAction() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/geGuCenter/detail'
|
url: '/pages/geGuCenter/detail?currentDate=' + this.currentDate
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
allAction(index) {
|
allAction(index) {
|
||||||
if (index == 1) {
|
if (index == 1) {
|
||||||
this.$refs["typePopup"].open()
|
this.$refs["typePopup"].open()
|
||||||
}else if (index == 2) {
|
} else if (index == 2) {
|
||||||
this.$refs["datePopup"].open()
|
this.$refs["datePopup"].open()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
closeAction(index) {
|
closeAction(index) {
|
||||||
if (index == 1) {
|
if (index == 1) {
|
||||||
this.$refs["typePopup"].close()
|
this.$refs["typePopup"].close()
|
||||||
}else if (index == 2) {
|
} else if (index == 2) {
|
||||||
this.$refs["datePopup"].close()
|
this.$refs["datePopup"].close()
|
||||||
}else if (index == 3) {
|
} else if (index == 3) {
|
||||||
this.$refs["detailPopup"].close()
|
this.$refs["detailPopup"].close()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
handleDateChange(date) {
|
||||||
|
this.selectedDate = date
|
||||||
|
console.log('选中的日期:', date)
|
||||||
|
},
|
||||||
confirmAction(index) {
|
confirmAction(index) {
|
||||||
if (index == 1) {
|
if (index == 1) {
|
||||||
this.$refs["typePopup"].close()
|
this.$refs["typePopup"].close()
|
||||||
}else if (index == 2) {
|
} else if (index == 2) {
|
||||||
|
|
||||||
|
if (this.selectedDate) {
|
||||||
|
this.currentDate = this.selectedDate
|
||||||
|
console.log('最终确认的日期:', this.currentDate)
|
||||||
|
} else {
|
||||||
|
// 如果没有选择日期,使用当前日期
|
||||||
|
const now = new Date()
|
||||||
|
const year = now.getFullYear()
|
||||||
|
const month = (now.getMonth() + 1).toString().padStart(2, '0')
|
||||||
|
const day = now.getDate().toString().padStart(2, '0')
|
||||||
|
this.currentDate = `${year}-${month}-${day}`
|
||||||
|
}
|
||||||
|
this.marketHeatmap(this.currentDate)
|
||||||
|
this.marketStatistics()
|
||||||
|
|
||||||
|
this.marketHotspotListOverview()
|
||||||
|
|
||||||
this.$refs["datePopup"].close()
|
this.$refs["datePopup"].close()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
bkydAction(item) {
|
bkydAction(item) {
|
||||||
this.$refs["detailPopup"].open()
|
this.$refs["detailPopup"].open()
|
||||||
|
|
||||||
|
this.conceptStocksDetails(item.concept_id)
|
||||||
|
},
|
||||||
|
conceptStocksDetails(concept_id) {
|
||||||
|
console.log("concept_id", concept_id)
|
||||||
|
|
||||||
|
conceptStocks(concept_id,{}).then(res => {
|
||||||
|
if (res.data && res.data.stocks) {
|
||||||
|
// 将接口数据赋值给列表数组
|
||||||
|
this.conceptStocksList = res.data.stocks;
|
||||||
|
} else {
|
||||||
|
console.warn('接口返回数据格式异常', res);
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
// 格式化涨跌幅显示(处理正负号、保留两位小数)
|
||||||
|
formatChangePct(change_pct) {
|
||||||
|
if (typeof change_pct !== 'number') return '0.00%';
|
||||||
|
// 正数加+号,负数保留-号,保留两位小数
|
||||||
|
const symbol = change_pct >= 0 ? '+' : '';
|
||||||
|
return `${symbol}${change_pct.toFixed(2)}%`;
|
||||||
|
},
|
||||||
|
// 获取涨跌幅文字颜色(涨红跌绿,平盘灰色)
|
||||||
|
getChangeColor(change_pct) {
|
||||||
|
if (typeof change_pct !== 'number') return '#888888';
|
||||||
|
if (change_pct > 0) return '#EC3440'; // 上涨:红色
|
||||||
|
if (change_pct < 0) return '#00B42A'; // 下跌:绿色
|
||||||
|
return '#888888'; // 平盘:灰色
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -404,10 +404,7 @@
|
|||||||
itemStyle: {
|
itemStyle: {
|
||||||
borderRadius: 8
|
borderRadius: 8
|
||||||
},
|
},
|
||||||
// label: {
|
|
||||||
// show: false,
|
|
||||||
// position: 'center'
|
|
||||||
// },
|
|
||||||
emphasis: {
|
emphasis: {
|
||||||
label: {
|
label: {
|
||||||
show: true,
|
show: true,
|
||||||
@@ -516,6 +513,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
onReady() {
|
onReady() {
|
||||||
|
this.fetchData()
|
||||||
// 页面就绪后,若默认选中的是板块分布,初始化饼图
|
// 页面就绪后,若默认选中的是板块分布,初始化饼图
|
||||||
//if (this.activeType === 0) {
|
//if (this.activeType === 0) {
|
||||||
this.initGraphChart(); // 初始化关系图
|
this.initGraphChart(); // 初始化关系图
|
||||||
@@ -541,6 +539,64 @@
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getPreviousDayDate(dateStr) {
|
||||||
|
// 校验输入日期格式是否正确
|
||||||
|
if (!/^\d{4}-\d{2}-\d{2}$/.test(dateStr)) {
|
||||||
|
console.error('日期格式错误,请传入 YYYY-MM-DD 格式的日期');
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建日期对象(注意:月份是 0 开始的,所以需要处理)
|
||||||
|
const [year, month, day] = dateStr.split('-').map(Number);
|
||||||
|
const date = new Date(year, month - 1, day);
|
||||||
|
|
||||||
|
// 将日期减一天
|
||||||
|
date.setDate(date.getDate() - 1);
|
||||||
|
|
||||||
|
// 格式化前一天的日期为 YYYYMMDD 格式(补零处理)
|
||||||
|
const prevYear = date.getFullYear();
|
||||||
|
const prevMonth = String(date.getMonth() + 1).padStart(2, '0');
|
||||||
|
const prevDay = String(date.getDate()).padStart(2, '0');
|
||||||
|
|
||||||
|
return `${prevYear}${prevMonth}${prevDay}`;
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 请求接口数据(优化:动态日期+自动时间戳)
|
||||||
|
*/
|
||||||
|
async fetchData() {
|
||||||
|
try {
|
||||||
|
// 1. 自动生成当前时间戳(替代固定值)
|
||||||
|
const timestamp = new Date().getTime();
|
||||||
|
|
||||||
|
|
||||||
|
// 调用上面的函数,获取前一天的格式化日期(YYYYMMDD)
|
||||||
|
const formattedDate = this.getPreviousDayDate(this.selectedFullDate);
|
||||||
|
const requestUrl = `https://valuefrontier.cn/data/zt/daily/${formattedDate}.json?t=${timestamp}`;
|
||||||
|
console.log('请求URL:', requestUrl); // 打印URL便于调试
|
||||||
|
|
||||||
|
const res = await uni.request({
|
||||||
|
url: requestUrl,
|
||||||
|
method: 'GET'
|
||||||
|
});
|
||||||
|
|
||||||
|
if (res.statusCode === 200 && res.data) {
|
||||||
|
this.originData = res.data;
|
||||||
|
console.log('接口数据请求成功', this.originData.chart_data );
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '数据请求失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('请求异常:', error);
|
||||||
|
uni.showToast({
|
||||||
|
title: '网络异常',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 初始化关系图(增加容错)
|
// 初始化关系图(增加容错)
|
||||||
async initGraphChart() {
|
async initGraphChart() {
|
||||||
|
|
||||||
@@ -557,350 +613,399 @@
|
|||||||
// 初始化饼图(核心修复)
|
// 初始化饼图(核心修复)
|
||||||
async initPieChart() {
|
async initPieChart() {
|
||||||
|
|
||||||
|
// const Piechart = await this.$refs.chartRef.init(echarts);
|
||||||
|
// console.log("Piechart", Piechart);
|
||||||
|
// Piechart.setOption(this.pieOption);
|
||||||
|
try {
|
||||||
|
// 处理饼图数据:将labels和counts组合成name/value格式
|
||||||
|
let pieData = [];
|
||||||
|
const chartData = this.originData.chart_data || {};
|
||||||
|
const labels = chartData.labels || [];
|
||||||
|
const counts = chartData.counts || [];
|
||||||
|
|
||||||
|
// 遍历组合数据,确保数组长度一致
|
||||||
|
const maxLen = Math.min(labels.length, counts.length);
|
||||||
|
for (let i = 0; i < maxLen; i++) {
|
||||||
|
pieData.push({
|
||||||
|
name: labels[i], // 板块名称
|
||||||
|
value: counts[i] // 对应数量
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新饼图配置的data
|
||||||
|
this.pieOption.series[0].data = pieData.length > 0 ? pieData : [
|
||||||
|
{ value: 10, name: '科技板块' },
|
||||||
|
{ value: 8, name: '人脑工程' },
|
||||||
|
{ value: 9, name: '商业航天' }
|
||||||
|
];
|
||||||
|
|
||||||
|
// 初始化ECharts并设置配置
|
||||||
|
if (this.$refs.chartRef) {
|
||||||
const Piechart = await this.$refs.chartRef.init(echarts);
|
const Piechart = await this.$refs.chartRef.init(echarts);
|
||||||
console.log("Piechart", Piechart);
|
console.log("Piechart实例创建成功", Piechart);
|
||||||
Piechart.setOption(this.pieOption);
|
Piechart.setOption(this.pieOption);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('饼图初始化失败:', error);
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
// 初始化词云
|
// 初始化词云
|
||||||
initWordCloud() {
|
initWordCloud() {
|
||||||
|
if (this.originData.word_freq_data && Array.isArray(this.originData.word_freq_data)) {
|
||||||
|
// 直接赋值接口返回的词频数据
|
||||||
|
this.wordData = this.originData.word_freq_data;
|
||||||
|
console.log('词云数据赋值完成', this.wordData);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// 兜底默认数据
|
||||||
this.wordData = [{
|
this.wordData = [{
|
||||||
name: "脑机",
|
name: "脑机",
|
||||||
value: 10000
|
value: 10000
|
||||||
},
|
}, {
|
||||||
{
|
|
||||||
name: "航天",
|
name: "航天",
|
||||||
value: 3428
|
value: 3428
|
||||||
},
|
}];
|
||||||
{
|
|
||||||
name: "商业",
|
|
||||||
value: 1747
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "智能",
|
|
||||||
value: 1692
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "量产",
|
|
||||||
value: 1589
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "落地",
|
|
||||||
value: 1555
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "存储芯片",
|
|
||||||
value: 1487
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "医疗",
|
|
||||||
value: 1348
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "马斯克",
|
|
||||||
value: 1346
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "业绩",
|
|
||||||
value: 1234
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "康复",
|
|
||||||
value: 1143
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "机器人",
|
|
||||||
value: 1127
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "洁净室",
|
|
||||||
value: 1078
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "标的",
|
|
||||||
value: 1072
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "设备",
|
|
||||||
value: 1071
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "算力",
|
|
||||||
value: 1015
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "材料",
|
|
||||||
value: 983
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "卫星",
|
|
||||||
value: 970
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "科技",
|
|
||||||
value: 947
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "资产",
|
|
||||||
value: 828
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "半导体",
|
|
||||||
value: 774
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "重估",
|
|
||||||
value: 750
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "人脑",
|
|
||||||
value: 747
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "平台",
|
|
||||||
value: 737
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "产业链",
|
|
||||||
value: 726
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "赛道",
|
|
||||||
value: 715
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "电池",
|
|
||||||
value: 694
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "估值",
|
|
||||||
value: 689
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "景气",
|
|
||||||
value: 682
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "A股",
|
|
||||||
value: 662
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "商业化",
|
|
||||||
value: 643
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "固态",
|
|
||||||
value: 642
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "工程",
|
|
||||||
value: 642
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "军工",
|
|
||||||
value: 642
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "芯片",
|
|
||||||
value: 615
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "医疗器械",
|
|
||||||
value: 606
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "供应链",
|
|
||||||
value: 585
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "弹性",
|
|
||||||
value: 573
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "蓝箭",
|
|
||||||
value: 551
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "市值",
|
|
||||||
value: 541
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "高端",
|
|
||||||
value: 527
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "植入",
|
|
||||||
value: 523
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "耗材",
|
|
||||||
value: 523
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "逻辑",
|
|
||||||
value: 519
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "数据",
|
|
||||||
value: 512
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "服务器",
|
|
||||||
value: 504
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "供应商",
|
|
||||||
value: 503
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "电子",
|
|
||||||
value: 483
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "芳纶",
|
|
||||||
value: 458
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "传闻",
|
|
||||||
value: 454
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "国产化",
|
|
||||||
value: 453
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "营销",
|
|
||||||
value: 452
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "涨价",
|
|
||||||
value: 450
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "临床",
|
|
||||||
value: 449
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "转型",
|
|
||||||
value: 444
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "强脑",
|
|
||||||
value: 441
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "储能",
|
|
||||||
value: 441
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "智能家居",
|
|
||||||
value: 438
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "场景",
|
|
||||||
value: 435
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "港股",
|
|
||||||
value: 423
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "柔性",
|
|
||||||
value: 422
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "人形",
|
|
||||||
value: 414
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "国产",
|
|
||||||
value: 411
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "接口技术",
|
|
||||||
value: 401
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "消费",
|
|
||||||
value: 399
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "创板",
|
|
||||||
value: 397
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "全球",
|
|
||||||
value: 389
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "替代",
|
|
||||||
value: 389
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "融资",
|
|
||||||
value: 388
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "补贴",
|
|
||||||
value: 369
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "管线",
|
|
||||||
value: 368
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "电极",
|
|
||||||
value: 367
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "模态",
|
|
||||||
value: 364
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "国家",
|
|
||||||
value: 361
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "盈利",
|
|
||||||
value: 359
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "测试",
|
|
||||||
value: 356
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "子公司",
|
|
||||||
value: 354
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "实控",
|
|
||||||
value: 353
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "八院",
|
|
||||||
value: 353
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "价格",
|
|
||||||
value: 352
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "旗下",
|
|
||||||
value: 351
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "组件",
|
|
||||||
value: 346
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "电解液",
|
|
||||||
value: 342
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "中标",
|
|
||||||
value: 340
|
|
||||||
}
|
}
|
||||||
];
|
|
||||||
|
|
||||||
|
// this.wordData = [{
|
||||||
|
// name: "脑机",
|
||||||
|
// value: 10000
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "航天",
|
||||||
|
// value: 3428
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "商业",
|
||||||
|
// value: 1747
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "智能",
|
||||||
|
// value: 1692
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "量产",
|
||||||
|
// value: 1589
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "落地",
|
||||||
|
// value: 1555
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "存储芯片",
|
||||||
|
// value: 1487
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "医疗",
|
||||||
|
// value: 1348
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "马斯克",
|
||||||
|
// value: 1346
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "业绩",
|
||||||
|
// value: 1234
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "康复",
|
||||||
|
// value: 1143
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "机器人",
|
||||||
|
// value: 1127
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "洁净室",
|
||||||
|
// value: 1078
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "标的",
|
||||||
|
// value: 1072
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "设备",
|
||||||
|
// value: 1071
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "算力",
|
||||||
|
// value: 1015
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "材料",
|
||||||
|
// value: 983
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "卫星",
|
||||||
|
// value: 970
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "科技",
|
||||||
|
// value: 947
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "资产",
|
||||||
|
// value: 828
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "半导体",
|
||||||
|
// value: 774
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "重估",
|
||||||
|
// value: 750
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "人脑",
|
||||||
|
// value: 747
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "平台",
|
||||||
|
// value: 737
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "产业链",
|
||||||
|
// value: 726
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "赛道",
|
||||||
|
// value: 715
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "电池",
|
||||||
|
// value: 694
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "估值",
|
||||||
|
// value: 689
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "景气",
|
||||||
|
// value: 682
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "A股",
|
||||||
|
// value: 662
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "商业化",
|
||||||
|
// value: 643
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "固态",
|
||||||
|
// value: 642
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "工程",
|
||||||
|
// value: 642
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "军工",
|
||||||
|
// value: 642
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "芯片",
|
||||||
|
// value: 615
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "医疗器械",
|
||||||
|
// value: 606
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "供应链",
|
||||||
|
// value: 585
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "弹性",
|
||||||
|
// value: 573
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "蓝箭",
|
||||||
|
// value: 551
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "市值",
|
||||||
|
// value: 541
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "高端",
|
||||||
|
// value: 527
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "植入",
|
||||||
|
// value: 523
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "耗材",
|
||||||
|
// value: 523
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "逻辑",
|
||||||
|
// value: 519
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "数据",
|
||||||
|
// value: 512
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "服务器",
|
||||||
|
// value: 504
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "供应商",
|
||||||
|
// value: 503
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "电子",
|
||||||
|
// value: 483
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "芳纶",
|
||||||
|
// value: 458
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "传闻",
|
||||||
|
// value: 454
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "国产化",
|
||||||
|
// value: 453
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "营销",
|
||||||
|
// value: 452
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "涨价",
|
||||||
|
// value: 450
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "临床",
|
||||||
|
// value: 449
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "转型",
|
||||||
|
// value: 444
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "强脑",
|
||||||
|
// value: 441
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "储能",
|
||||||
|
// value: 441
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "智能家居",
|
||||||
|
// value: 438
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "场景",
|
||||||
|
// value: 435
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "港股",
|
||||||
|
// value: 423
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "柔性",
|
||||||
|
// value: 422
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "人形",
|
||||||
|
// value: 414
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "国产",
|
||||||
|
// value: 411
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "接口技术",
|
||||||
|
// value: 401
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "消费",
|
||||||
|
// value: 399
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "创板",
|
||||||
|
// value: 397
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "全球",
|
||||||
|
// value: 389
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "替代",
|
||||||
|
// value: 389
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "融资",
|
||||||
|
// value: 388
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "补贴",
|
||||||
|
// value: 369
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "管线",
|
||||||
|
// value: 368
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "电极",
|
||||||
|
// value: 367
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "模态",
|
||||||
|
// value: 364
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "国家",
|
||||||
|
// value: 361
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "盈利",
|
||||||
|
// value: 359
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "测试",
|
||||||
|
// value: 356
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "子公司",
|
||||||
|
// value: 354
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "实控",
|
||||||
|
// value: 353
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "八院",
|
||||||
|
// value: 353
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "价格",
|
||||||
|
// value: 352
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "旗下",
|
||||||
|
// value: 351
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "组件",
|
||||||
|
// value: 346
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "电解液",
|
||||||
|
// value: 342
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "中标",
|
||||||
|
// value: 340
|
||||||
|
// }
|
||||||
|
// ];
|
||||||
|
|
||||||
//console.log('父页面设置词云数据:', JSON.stringify(this.wordData));
|
//console.log('父页面设置词云数据:', JSON.stringify(this.wordData));
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -267,6 +267,11 @@ export const marketStatistics =param => get('/api/market/statistics',param,true)
|
|||||||
*/
|
*/
|
||||||
export const marketHotspotOverview =param => get('/api/market/hotspot-overview',param,true)
|
export const marketHotspotOverview =param => get('/api/market/hotspot-overview',param,true)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 热点概览接口详情
|
||||||
|
*/
|
||||||
|
export const conceptStocks = (concept_id,param) => get('/api/concept/'+concept_id+'/stocks',param,true)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*日历数据
|
*日历数据
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user