|
|
@ -8,7 +8,7 @@ |
|
|
|
<div class="top"> |
|
|
|
<div class="item"> |
|
|
|
<img src="@/assets/images/weather/kqwd.png" alt="" /> |
|
|
|
<div><span>12°</span> <span>空气温度</span></div> |
|
|
|
<div><span>{{ weatherData.ambientTemperature }}℃</span> <span>空气温度</span></div> |
|
|
|
</div> |
|
|
|
<img |
|
|
|
src="@/assets/images/weather/line.png" |
|
|
@ -17,7 +17,7 @@ |
|
|
|
/> |
|
|
|
<div class="item"> |
|
|
|
<img src="@/assets/images/weather/kqsd.png" alt="" /> |
|
|
|
<div><span class="num">12°</span> <span>空气湿度</span></div> |
|
|
|
<div><span class="num">{{ weatherData.ambientHumidity }}%</span> <span>空气湿度</span></div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="bto"> |
|
|
@ -76,15 +76,17 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { mapActions } from 'vuex' |
|
|
|
import { cultureLegacyList } from '@/api/home' |
|
|
|
import { cultureLegacyList,getWeather } from '@/api/home' |
|
|
|
import {getVegetableOutputList} from "api/zdyf"; |
|
|
|
export default { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
weatherData: [], |
|
|
|
weatherList: [ |
|
|
|
{ |
|
|
|
units: '雨量', |
|
|
|
img: require('@/assets/images/weather/yu.png'), |
|
|
|
value: '20~30mm' |
|
|
|
value: '' |
|
|
|
}, |
|
|
|
{ |
|
|
|
units: '光照', |
|
|
@ -135,6 +137,7 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
created () { |
|
|
|
|
|
|
|
cultureLegacyList().then((res) => { |
|
|
|
let num = 0 |
|
|
|
let index = 0 |
|
|
@ -150,7 +153,10 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
mounted () {}, |
|
|
|
mounted () { |
|
|
|
this.getDayScData() |
|
|
|
|
|
|
|
}, |
|
|
|
beforeDestroy () {}, |
|
|
|
methods: { |
|
|
|
...mapActions({ |
|
|
@ -164,6 +170,29 @@ export default { |
|
|
|
}, |
|
|
|
handelClickTalents () { |
|
|
|
// this.set_szyfTalents(true) |
|
|
|
}, |
|
|
|
getDayScData(){ |
|
|
|
getWeather().then(res => { |
|
|
|
console.log(res.data) |
|
|
|
this.weatherData = res.data |
|
|
|
|
|
|
|
this.weatherList.forEach((item, index) => { |
|
|
|
if (item.units === '雨量') { |
|
|
|
item.value = this.weatherData.rainfall+"mm"; |
|
|
|
} |
|
|
|
if (item.units === '光照') { |
|
|
|
item.value = this.weatherData.lightIntensity+"lux"; |
|
|
|
} |
|
|
|
if (item.units === '土壤温度') { |
|
|
|
item.value = this.weatherData.soilTemp+"℃"; |
|
|
|
} |
|
|
|
if (item.units === '土壤湿度') { |
|
|
|
item.value = this.weatherData.soilHumi+"%"; |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
components: {}, |
|
|
|