Browse Source

大屏完善

master
lichao 12 months ago
parent
commit
8ec6c48158
  1. 10
      src/api/home.js
  2. 16
      src/views/next/screen-content-left/zdyf-left/index.vue
  3. 39
      src/views/next/screen-content-right/home-right/index.vue

10
src/api/home.js

@ -42,3 +42,13 @@ export function nowKongqi (id) {
// params // params
}) })
} }
export function getWeather (params) {
return request({
url: '/api/resi/partymember/yifengScreen/getWeather',
method: 'GET',
params
})
}

16
src/views/next/screen-content-left/zdyf-left/index.vue

@ -81,7 +81,7 @@
</div> </div>
<div class="right"> <div class="right">
<div class="top">产业链融合</div> <div class="top">产业链融合</div>
<div class="center blue"><span class="num">5.2</span> 亿元</div> <div class="center blue"> <span class="num">6</span> 亿元</div>
<div class="bot">种子年销售额</div> <div class="bot">种子年销售额</div>
</div> </div>
</div> </div>
@ -132,20 +132,20 @@
<div style="display: flex"> <div style="display: flex">
<div style="width: 38px"> <div style="width: 38px">
{{ {{
item.jzrPrice != "暂无" item.jzrPrice.toFixed(2) != "0.00"
? item.jzrPrice.toFixed(2) ? item.jzrPrice.toFixed(2)
: "暂无" : "-"
}} }}
</div> </div>
<img <img
v-if="item.jzrPrice >= 0 && item.jzrPrice != '暂无'" v-if="item.jzrPrice > 0 && item.jzrPrice != '-'"
width="16px" width="16px"
height="16px" height="16px"
src="@/assets/images/icon/upRed.png" src="@/assets/images/icon/upRed.png"
alt="" alt=""
/> />
<img <img
v-else-if="item.jzrPrice != '暂无'" v-else-if="item.jzrPrice < 0 && item.jzrPrice != '-'"
width="16px" width="16px"
height="16px" height="16px"
src="@/assets/images/icon/downLv.png" src="@/assets/images/icon/downLv.png"
@ -284,7 +284,7 @@ export default {
const data = [] const data = []
arr.forEach((item, index) => { arr.forEach((item, index) => {
if ((index + 1) % 2 === 0) { if ((index + 1) % 2 === 0) {
const num = (arr[index - 1].AvgPrice + item.AvgPrice) / 2 const num = item.AvgPrice
data.push({ ...item, price: num }) data.push({ ...item, price: num })
} }
}) })
@ -294,7 +294,7 @@ export default {
prcCollectionListForGov({ ...this.params, ...data }).then((res) => { prcCollectionListForGov({ ...this.params, ...data }).then((res) => {
if (res.priceslist.length > 0) { if (res.priceslist.length > 0) {
this.dayList = res.priceslist.filter(item => item.CategoryName == '蔬菜') this.dayList = res.priceslist.filter(item => item.CategoryName == '蔬菜')
// console.log(this.dayList) console.log(this.dayList)
this.getDayScTData() this.getDayScTData()
} else { } else {
this.times = this.$moment(this.times) this.times = this.$moment(this.times)
@ -345,7 +345,7 @@ export default {
} else { } else {
return { return {
...item, ...item,
jzrPrice: '暂无' jzrPrice: '0.00'
} }
} }
}) })

39
src/views/next/screen-content-right/home-right/index.vue

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

Loading…
Cancel
Save