Commit b3734185 authored by co_dengxiongwen's avatar co_dengxiongwen

tj

parent 126b6c9f
...@@ -23,18 +23,18 @@ ...@@ -23,18 +23,18 @@
</div> </div>
<div class="weather-container"> <div class="weather-container">
<div class="user-img">室内</div> <div class="user-img">室内</div>
<div class="weather-info" v-if='list'> <div class="weather-info" v-if="snqxzBean">
<!-- <span :class="station.length < 6 ? 'lineFeed' : ''">{{station }}</span> --> <!-- <span :class="station.length < 6 ? 'lineFeed' : ''">{{station }}</span> -->
<div>温度 {{list.snqxzList[0].temperature}}</div> <div>温度 {{ snqxzBean.temperature }}</div>
<div>湿度 {{list.snqxzList[0].humidity}}%</div> <div>湿度 {{ snqxzBean.humidity }}%</div>
</div> </div>
</div> </div>
<div class="weather-container"> <div class="weather-container">
<div class="user-img">室外</div> <div class="user-img">室外</div>
<div class="weather-info" v-if='list'> <div class="weather-info" v-if="swqxzBean">
<!-- <span :class="station.length < 6 ? 'lineFeed' : ''">{{station }}</span> --> <!-- <span :class="station.length < 6 ? 'lineFeed' : ''">{{station }}</span> -->
<div>温度 {{list.swqxzList[0].temperature}}</div> <div>温度 {{ swqxzBean.temperature }}</div>
<div>湿度 {{list.swqxzList[0].humidity}}%</div> <div>湿度 {{ swqxzBean.humidity }}%</div>
</div> </div>
</div> </div>
<!-- <d2-header-theme /> --> <!-- <d2-header-theme /> -->
...@@ -117,7 +117,9 @@ export default { ...@@ -117,7 +117,9 @@ export default {
timer: null, timer: null,
logTimeout: null, logTimeout: null,
countNum: 0, countNum: 0,
station: '' station: '',
snqxzBean: {},
swqxzBean: {}
} }
}, },
mounted() { mounted() {
...@@ -181,6 +183,14 @@ export default { ...@@ -181,6 +183,14 @@ export default {
watch: { watch: {
size(val) { size(val) {
this.countNum = val this.countNum = val
},
list: {
handler(n, o) {
if (n) {
this.setData()
}
},
deep: true
} }
}, },
methods: { methods: {
...@@ -224,7 +234,21 @@ export default { ...@@ -224,7 +234,21 @@ export default {
if (!this.station || this.station == 'undefined') { if (!this.station || this.station == 'undefined') {
setTimeout(this.getStation, 3000) setTimeout(this.getStation, 3000)
} }
} },
setData() {
// console.log('list:', this.list)
if (this.list) {
if (this.list.snqxzList.length > 0) {
this.snqxzBean = this.list.snqxzList[0]
}
if (this.list.swqxzList.length > 0) {
this.swqxzBean = this.list.swqxzList[0]
}
}
// console.log('snqxzBean:', this.snqxzBean)
// console.log('swqxzBean:', this.swqxzBean)
},
setSwqxzData() {}
} }
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment