饼图
This commit is contained in:
@@ -276,7 +276,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<scroll-view scroll-y="true" show-scrollbar="false" style="flex: 1; ">
|
<scroll-view scroll-y="true" show-scrollbar="false" style="height: 360rpx; ">
|
||||||
<view v-for="(item, index) in conceptStocksList" :key="index"
|
<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;"
|
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')}">
|
||||||
|
|||||||
@@ -178,7 +178,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getBaseURL} from '@/request/http.js'
|
import {getBaseURL1 } from '@/request/http.js'
|
||||||
import {
|
import {
|
||||||
inject
|
inject
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
@@ -418,55 +418,7 @@
|
|||||||
length2:5,
|
length2:5,
|
||||||
|
|
||||||
},
|
},
|
||||||
data: [{
|
data: []
|
||||||
value: 10,
|
|
||||||
name: '科技板块'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 8,
|
|
||||||
name: '人脑工程'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 9,
|
|
||||||
name: '商业航天'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 10,
|
|
||||||
name: '人工智能'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 9,
|
|
||||||
name: '芯片'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 7,
|
|
||||||
name: '算力网'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 6,
|
|
||||||
name: '智能机器'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 6,
|
|
||||||
name: '资产注入'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 5,
|
|
||||||
name: '智能医疗'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 5,
|
|
||||||
name: '国防军工'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 5,
|
|
||||||
name: '康复医疗'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 20,
|
|
||||||
name: '创新药'
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
// 关系图配置项
|
// 关系图配置项
|
||||||
@@ -519,7 +471,7 @@
|
|||||||
//if (this.activeType === 0) {
|
//if (this.activeType === 0) {
|
||||||
this.initGraphChart(); // 初始化关系图
|
this.initGraphChart(); // 初始化关系图
|
||||||
//} else if (this.activeType === 1) {
|
//} else if (this.activeType === 1) {
|
||||||
this.initPieChart(); // 初始化饼图
|
// 初始化饼图
|
||||||
//}
|
//}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -552,7 +504,7 @@
|
|||||||
const date = new Date(year, month - 1, day);
|
const date = new Date(year, month - 1, day);
|
||||||
|
|
||||||
// 将日期减一天
|
// 将日期减一天
|
||||||
date.setDate(date.getDate() - 1);
|
date.setDate(date.getDate() - 2);
|
||||||
|
|
||||||
// 格式化前一天的日期为 YYYYMMDD 格式(补零处理)
|
// 格式化前一天的日期为 YYYYMMDD 格式(补零处理)
|
||||||
const prevYear = date.getFullYear();
|
const prevYear = date.getFullYear();
|
||||||
@@ -572,7 +524,9 @@
|
|||||||
|
|
||||||
// 调用上面的函数,获取前一天的格式化日期(YYYYMMDD)
|
// 调用上面的函数,获取前一天的格式化日期(YYYYMMDD)
|
||||||
const formattedDate = this.getPreviousDayDate(this.selectedFullDate);
|
const formattedDate = this.getPreviousDayDate(this.selectedFullDate);
|
||||||
const requestUrl = getBaseURL1+`/data/zt/daily/${formattedDate}.json?t=${timestamp}`;
|
const baseURL = getBaseURL1();
|
||||||
|
const requestUrl = `${baseURL}/data/zt/daily/${formattedDate}.json?t=${timestamp}`;
|
||||||
|
|
||||||
console.log('请求URL:', requestUrl); // 打印URL便于调试
|
console.log('请求URL:', requestUrl); // 打印URL便于调试
|
||||||
|
|
||||||
const res = await uni.request({
|
const res = await uni.request({
|
||||||
@@ -583,6 +537,7 @@
|
|||||||
if (res.statusCode === 200 && res.data) {
|
if (res.statusCode === 200 && res.data) {
|
||||||
this.originData = res.data;
|
this.originData = res.data;
|
||||||
console.log('接口数据请求成功', this.originData.chart_data );
|
console.log('接口数据请求成功', this.originData.chart_data );
|
||||||
|
this.initPieChart();
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '数据请求失败',
|
title: '数据请求失败',
|
||||||
@@ -1029,7 +984,8 @@
|
|||||||
// this.analyseHighStocks()
|
// this.analyseHighStocks()
|
||||||
},
|
},
|
||||||
analyseHighStocks() {
|
analyseHighStocks() {
|
||||||
const formatDate = this.selectedFullDate.replace(/-/g, '');
|
|
||||||
|
const formatDate = this.getPreviousDayDate(this.selectedFullDate);
|
||||||
let param = {
|
let param = {
|
||||||
date: formatDate
|
date: formatDate
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export function getBaseURL() {
|
|||||||
return baseURL
|
return baseURL
|
||||||
}
|
}
|
||||||
export function getBaseURL1() {
|
export function getBaseURL1() {
|
||||||
return "https://api.valuefrontier.cn"
|
return "https://valuefrontier.cn"
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user