This commit is contained in:
yanran200730
2022-07-02 15:19:27 +08:00
parent 32935d94fc
commit 54f0d57b37
3 changed files with 47 additions and 20 deletions

View File

@@ -67,7 +67,7 @@
if (this.current > this.pages && this.current !== 1) return if (this.current > this.pages && this.current !== 1) return
this.$loading() this.$loading()
this.$http.post('/app/appcompany/list', null, { this.$http.post('/app/appgirdmembercompany/getUnbindCompany', null, {
params: { params: {
size: 10, size: 10,
current: this.current, current: this.current,

View File

@@ -3,21 +3,21 @@
<div class="gird-wrapper"> <div class="gird-wrapper">
<div class="gird-item"> <div class="gird-item">
<h2>一级网格</h2> <h2>一级网格</h2>
<div class="gird-item__wrapper level1" @click="isShowStreet = true"> <div class="gird-item__wrapper level1" @click="getStatistics(topGrid.id)">
<h3>中山门街道</h3> <h3>{{ topGrid.girdName }}</h3>
</div> </div>
</div> </div>
<div class="gird-item"> <div class="gird-item" v-if="secondaryGrid.length">
<h2>二级网格</h2> <h2>二级网格</h2>
<div class="gird-item__wrapper level2"> <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> </div>
<div class="gird-item"> <div class="gird-item" v-if="tertiaryGrid.length">
<h2>三级网格</h2> <h2>三级网格</h2>
<div class="gird-item__wrapper level3" @click="isShowVillage = true"> <div class="gird-item__wrapper level3" @click="isShowVillage = true">
<h3>专属网格</h3> <h3>专属网格</h3>
<p>12</p> <p>{{ tertiaryGrid.length }}</p>
</div> </div>
</div> </div>
</div> </div>
@@ -26,12 +26,12 @@
<scroll-view scroll-y class="street-wrapper"> <scroll-view scroll-y class="street-wrapper">
<h2 class="title">数据统计</h2> <h2 class="title">数据统计</h2>
<div class="street-item__wrapper"> <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"> <div class="left">
<i></i> <i></i>
<h2>网格数</h2> <h2>{{ index }}</h2>
</div> </div>
<span>12</span> <span>{{ item }}</span>
</div> </div>
</div> </div>
</scroll-view> </scroll-view>
@@ -52,8 +52,8 @@
</div> </div>
<h2 class="title">网格列表</h2> <h2 class="title">网格列表</h2>
<div class="street-item__wrapper"> <div class="street-item__wrapper">
<div class="street-item" style="justify-content: center" v-for="(item, index) in 9" :key="index"> <div class="street-item" style="justify-content: center" v-for="(item, index) in tertiaryGrid" :key="index">
<span>群策巷社区</span> <span>{{ item.girdName }}</span>
</div> </div>
</div> </div>
</scroll-view> </scroll-view>
@@ -71,16 +71,44 @@
data () { data () {
return { return {
isShowStreet: false, isShowStreet: false,
isShowVillage: false streetInfo: {},
isShowVillage: false,
topGrid: [],
secondaryGrid: [],
tertiaryGrid: []
} }
}, },
onLoad () { onLoad () {
this.getInfo()
}, },
methods: { 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> </script>

View File

@@ -71,9 +71,6 @@
let {lib: TMap, map} = this let {lib: TMap, map} = this
if (map) { if (map) {
if (this.markers.length) { if (this.markers.length) {
console.log(this.MarkerCluster)
// this.MarkerCluster.destroy()
// this.MarkerCluster = null
this.markers.forEach(v => { this.markers.forEach(v => {
v.setMap(null) v.setMap(null)
}) })
@@ -134,6 +131,7 @@
enableDefaultStyle: false, // 关闭默认样式 enableDefaultStyle: false, // 关闭默认样式
geometries: points.map(e => ({ geometries: points.map(e => ({
position: new TMap.LatLng(e.lat, e.lng), position: new TMap.LatLng(e.lat, e.lng),
id: e.id,
content: `${e.name}`, content: `${e.name}`,
properties: {...e} properties: {...e}
})) || [], })) || [],
@@ -164,11 +162,12 @@
cls.push(clusterBubble) cls.push(clusterBubble)
} else { } else {
//点标记样式 //点标记样式
let {content} = item.geometries?.[0] || {}, let {content, id} = item.geometries?.[0] || {},
overlay = new ClusterBubble({map, position: item.center, content}) overlay = new ClusterBubble({map, position: item.center, content})
overlay.on('click', () => { overlay.on('click', () => {
this.buildPopup = true uni.navigateTo({
this.building = item.geometries?.[0]?.properties || {} url: `../AppMerchantManage/detail?id=${id}`
})
}) })
this.markers.push(overlay) this.markers.push(overlay)
} }