|
@@ -6,10 +6,12 @@
|
|
|
<img :src="imgSrc">
|
|
|
<span class="tem">{{ weatcherData.tem }}°C</span>
|
|
|
<span class="wea">{{ weatcherData.wea }}</span>
|
|
|
+ <!-- 测试,获取疫情接口中的更新时间-->
|
|
|
+ <span>{{ConData.page}}</span>
|
|
|
</div>
|
|
|
<h2>疫情数据分析</h2>
|
|
|
<div class="showTime">
|
|
|
- <span class="time">数据更新至 {{ date }}</span>
|
|
|
+ <span class="time">数据更新至 {{ConData.mapLastUpdatedTime}}</span>
|
|
|
</div>
|
|
|
<div class="showTime1">
|
|
|
<span class="date">
|
|
@@ -43,15 +45,15 @@
|
|
|
<div class="resume-hd">
|
|
|
<ul>
|
|
|
<li>
|
|
|
- <countTo :startVal='startVal' :endVal='1632' :duration='6000'
|
|
|
+ <countTo :startVal='startVal' :endVal='newConfirm' :duration='6000'
|
|
|
separator=","></countTo>
|
|
|
</li>
|
|
|
<li>
|
|
|
- <countTo :startVal='startVal' :endVal='95983' :duration='6000'
|
|
|
+ <countTo :startVal='startVal' :endVal='TotalConfirm' :duration='6000'
|
|
|
separator=","></countTo>
|
|
|
</li>
|
|
|
<li>
|
|
|
- <countTo :startVal='startVal' :endVal='89578' :duration='6000'
|
|
|
+ <countTo :startVal='startVal' :endVal='Cured' :duration='6000'
|
|
|
separator=","></countTo>
|
|
|
</li>
|
|
|
</ul>
|
|
@@ -80,7 +82,7 @@
|
|
|
</div>
|
|
|
<div class="panel">
|
|
|
<h2>现存确诊</h2>
|
|
|
- <RoseCon/>
|
|
|
+ <waterPolo/>
|
|
|
<div class="panel-footer"></div>
|
|
|
</div>
|
|
|
<div class="panel">
|
|
@@ -115,16 +117,21 @@
|
|
|
imgSrc: '',
|
|
|
weatcherData: {},
|
|
|
startVal: 0,
|
|
|
+ ConData: {},
|
|
|
+ newConfirm: null,
|
|
|
+ TotalConfirm: null,
|
|
|
+ Cured: null
|
|
|
}
|
|
|
},
|
|
|
computed: {},
|
|
|
created() {
|
|
|
},
|
|
|
mounted() {
|
|
|
- // this.getWeather();
|
|
|
- // this.timer = setInterval(() => {
|
|
|
- // this.getWeather();
|
|
|
- // }, 1000 * 60 * 60)
|
|
|
+ this.getWeather();
|
|
|
+ this.getConData()
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ this.getWeather();
|
|
|
+ }, 1000 * 60 * 60)
|
|
|
|
|
|
this.nowTimes();
|
|
|
this.getEchart();
|
|
@@ -156,38 +163,61 @@
|
|
|
},
|
|
|
|
|
|
// 第三方天气api接口
|
|
|
- // getWeather() {
|
|
|
- // axios.get('https://www.tianqiapi.com/api/', {
|
|
|
- // params: {
|
|
|
- // appid: '26148275',
|
|
|
- // appsecret: '2id6H48Y',
|
|
|
- // version: 'v6'
|
|
|
- // }
|
|
|
- // }).then(res => {
|
|
|
- // if (res.data) {
|
|
|
- // if (res.data.wea_img == 'xue') {
|
|
|
- // this.imgSrc = require('../assets/img/brand/xue.png');
|
|
|
- // } else if (res.data.wea_img == 'yin') {
|
|
|
- // this.imgSrc = require('../assets/img/brand/yin.png');
|
|
|
- // } else if (res.data.wea_img == 'yu' || res.data.wea_img == 'bingbao') {
|
|
|
- // this.imgSrc = require('../assets/img/brand/yu.png');
|
|
|
- // } else if (res.data.wea_img == 'yun') {
|
|
|
- // this.imgSrc = require('../assets/img/brand/yun.png');
|
|
|
- // } else if (res.data.wea_img == 'wu') {
|
|
|
- // this.imgSrc = require('../assets/img/brand/wu.png');
|
|
|
- // } else if (res.data.wea_img == 'shachen') {
|
|
|
- // this.imgSrc = require('../assets/img/brand/shachen.png');
|
|
|
- // } else if (res.data.wea_img == 'lei') {
|
|
|
- // this.imgSrc = require('../assets/img/brand/lei.png');
|
|
|
- // } else {
|
|
|
- // this.imgSrc = require('../assets/img/brand/qing.png');
|
|
|
- // }
|
|
|
- // this.weatcherData = res.data;
|
|
|
- // }
|
|
|
- // }).catch(err => {
|
|
|
- // console.log(err)
|
|
|
- // })
|
|
|
- // },
|
|
|
+ getWeather() {
|
|
|
+ axios.get('https://www.tianqiapi.com/api/', {
|
|
|
+ params: {
|
|
|
+ appid: '89325657',
|
|
|
+ appsecret: 'jJ2yWJu6 ',
|
|
|
+ version: 'v61'
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data) {
|
|
|
+ if (res.data.wea_img == 'xue') {
|
|
|
+ this.imgSrc = require('../assets/img/brand/xue.png');
|
|
|
+ } else if (res.data.wea_img == 'yin') {
|
|
|
+ this.imgSrc = require('../assets/img/brand/yin.png');
|
|
|
+ } else if (res.data.wea_img == 'yu' || res.data.wea_img == 'bingbao') {
|
|
|
+ this.imgSrc = require('../assets/img/brand/yu.png');
|
|
|
+ } else if (res.data.wea_img == 'yun') {
|
|
|
+ this.imgSrc = require('../assets/img/brand/yun.png');
|
|
|
+ } else if (res.data.wea_img == 'wu') {
|
|
|
+ this.imgSrc = require('../assets/img/brand/wu.png');
|
|
|
+ } else if (res.data.wea_img == 'shachen') {
|
|
|
+ this.imgSrc = require('../assets/img/brand/shachen.png');
|
|
|
+ } else if (res.data.wea_img == 'lei') {
|
|
|
+ this.imgSrc = require('../assets/img/brand/lei.png');
|
|
|
+ } else {
|
|
|
+ this.imgSrc = require('../assets/img/brand/qing.png');
|
|
|
+ }
|
|
|
+ this.weatcherData = res.data;
|
|
|
+ console.log(this.weatcherData)
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //获取疫情数据接口
|
|
|
+ getConData() {
|
|
|
+ axios.get('https://www.maomin.club/fy/get', {
|
|
|
+ dataType: "json"
|
|
|
+ }).then(res => {
|
|
|
+ let ConData = res.data
|
|
|
+ let made = JSON.parse(ConData)
|
|
|
+ let madeData = made.component
|
|
|
+ let data = madeData[0]
|
|
|
+ console.log(data)
|
|
|
+
|
|
|
+ this.newConfirm = Number(data.summaryDataIn.curConfirm)
|
|
|
+ this.TotalConfirm = Number(data.summaryDataIn.confirmed)
|
|
|
+ this.Cured = Number(data.summaryDataIn.cured)
|
|
|
+ console.log('我是' + this.newConfirm)
|
|
|
+ console.log(data.summaryDataIn.curConfirm)
|
|
|
+ this.ConData = data
|
|
|
+ }).catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
// 初始化地图数据
|
|
|
getEchart() {
|
|
@@ -9933,17 +9963,17 @@
|
|
|
}
|
|
|
|
|
|
.showTime {
|
|
|
- position: absolute;
|
|
|
- right: 4rem;
|
|
|
- top: 0.8rem;
|
|
|
- color: rgba(126, 240, 255, 0.7);
|
|
|
- display: flex;
|
|
|
+ position: absolute;
|
|
|
+ right: 3rem;
|
|
|
+ top: 0.8rem;
|
|
|
+ color: rgba(126, 240, 255, 0.7);
|
|
|
+ display: flex;
|
|
|
|
|
|
|
|
|
- .time {
|
|
|
- font-size: .18rem;
|
|
|
- margin-right: .18rem;
|
|
|
- }
|
|
|
+ .time {
|
|
|
+ font-size: .18rem;
|
|
|
+ margin-right: .18rem;
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|