bug
This commit is contained in:
@@ -3,21 +3,21 @@
|
||||
<div class="gird-wrapper">
|
||||
<div class="gird-item">
|
||||
<h2>一级网格</h2>
|
||||
<div class="gird-item__wrapper level1" @click="isShowStreet = true">
|
||||
<h3>中山门街道</h3>
|
||||
<div class="gird-item__wrapper level1" @click="getStatistics(topGrid.id)">
|
||||
<h3>{{ topGrid.girdName }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gird-item">
|
||||
<div class="gird-item" v-if="secondaryGrid.length">
|
||||
<h2>二级网格</h2>
|
||||
<div class="gird-item__wrapper level2">
|
||||
<div class="grid-item__item" v-for="(item, index) in 10" :key="index">群策巷社区</div>
|
||||
<div class="grid-item__item" v-for="(item, index) in secondaryGrid" :key="index">{{ item.girdName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gird-item">
|
||||
<div class="gird-item" v-if="tertiaryGrid.length">
|
||||
<h2>三级网格</h2>
|
||||
<div class="gird-item__wrapper level3" @click="isShowVillage = true">
|
||||
<h3>专属网格</h3>
|
||||
<p>(12个)</p>
|
||||
<p>({{ tertiaryGrid.length }}个)</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -26,12 +26,12 @@
|
||||
<scroll-view scroll-y class="street-wrapper">
|
||||
<h2 class="title">数据统计</h2>
|
||||
<div class="street-item__wrapper">
|
||||
<div class="street-item" v-for="(item, index) in 40" :key="index">
|
||||
<div class="street-item" v-for="(item, index) in streetInfo" :key="index">
|
||||
<div class="left">
|
||||
<i></i>
|
||||
<h2>网格数</h2>
|
||||
<h2>{{ index }}</h2>
|
||||
</div>
|
||||
<span>12</span>
|
||||
<span>{{ item }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</scroll-view>
|
||||
@@ -52,8 +52,8 @@
|
||||
</div>
|
||||
<h2 class="title">网格列表</h2>
|
||||
<div class="street-item__wrapper">
|
||||
<div class="street-item" style="justify-content: center" v-for="(item, index) in 9" :key="index">
|
||||
<span>群策巷社区</span>
|
||||
<div class="street-item" style="justify-content: center" v-for="(item, index) in tertiaryGrid" :key="index">
|
||||
<span>{{ item.girdName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</scroll-view>
|
||||
@@ -71,16 +71,44 @@
|
||||
data () {
|
||||
return {
|
||||
isShowStreet: false,
|
||||
isShowVillage: false
|
||||
streetInfo: {},
|
||||
isShowVillage: false,
|
||||
topGrid: [],
|
||||
secondaryGrid: [],
|
||||
tertiaryGrid: []
|
||||
}
|
||||
},
|
||||
|
||||
onLoad () {
|
||||
|
||||
this.getInfo()
|
||||
},
|
||||
|
||||
methods: {
|
||||
getStatistics (girdId) {
|
||||
this.$loading()
|
||||
this.$http.post(`/api/appgirdinfo/girdInfoCountById?girdId=${girdId}`).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.isShowStreet = true
|
||||
this.streetInfo = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getInfo () {
|
||||
this.$http.post(`/api/appgirdinfo/listAllByTop`).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.topGrid = res.data
|
||||
|
||||
if (res.data.girdList.length) {
|
||||
this.secondaryGrid = res.data.girdList
|
||||
|
||||
res.data.girdList.forEach(e => {
|
||||
this.tertiaryGrid.push(...e.girdList)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user