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
})
}
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 class="right">
<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>
</div>
@ -132,20 +132,20 @@
<div style="display: flex">
<div style="width: 38px">
{{
item.jzrPrice != "暂无"
item.jzrPrice.toFixed(2) != "0.00"
? item.jzrPrice.toFixed(2)
: "暂无"
: "-"
}}
</div>
<img
v-if="item.jzrPrice >= 0 && item.jzrPrice != '暂无'"
v-if="item.jzrPrice > 0 && item.jzrPrice != '-'"
width="16px"
height="16px"
src="@/assets/images/icon/upRed.png"
alt=""
/>
<img
v-else-if="item.jzrPrice != '暂无'"
v-else-if="item.jzrPrice < 0 && item.jzrPrice != '-'"
width="16px"
height="16px"
src="@/assets/images/icon/downLv.png"
@ -284,7 +284,7 @@ export default {
const data = []
arr.forEach((item, index) => {
if ((index + 1) % 2 === 0) {
const num = (arr[index - 1].AvgPrice + item.AvgPrice) / 2
const num = item.AvgPrice
data.push({ ...item, price: num })
}
})
@ -294,7 +294,7 @@ export default {
prcCollectionListForGov({ ...this.params, ...data }).then((res) => {
if (res.priceslist.length > 0) {
this.dayList = res.priceslist.filter(item => item.CategoryName == '蔬菜')
// console.log(this.dayList)
console.log(this.dayList)
this.getDayScTData()
} else {
this.times = this.$moment(this.times)
@ -345,7 +345,7 @@ export default {
} else {
return {
...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="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: {},

Loading…
Cancel
Save