Commit 809a74a0 authored by 郭铭瑶's avatar 郭铭瑶 🤘

修改进度为星星标识

parent 96560b87
...@@ -27,6 +27,15 @@ export default{ ...@@ -27,6 +27,15 @@ export default{
if (ratio <= 90) return 9 if (ratio <= 90) return 9
if (ratio <= 100) return 10 if (ratio <= 100) return 10
}, },
switchIcon(ratio) {
if (!ratio) ratio = 0
if (ratio < 1) {
ratio = ratio * 100
}
if (ratio <= 50) return 'star1'
if (ratio <= 75) return 'star2'
if (ratio <= 100) return 'star3'
},
switchColor(color) { switchColor(color) {
if (!color) return null if (!color) return null
if (color.indexOf('绿') >= 0) return {'background-color': '#8fd618'} if (color.indexOf('绿') >= 0) return {'background-color': '#8fd618'}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div id="HouseMapContainer"> <div id="HouseMapContainer">
<div class="icon-tooltip"> <div class="icon-tooltip">
<p><img src="@/assets/images/focus.png"/>重点关注对象</p> <p><img src="@/assets/images/focus.png"/>重点关注对象</p>
<p><img src="@/assets/images/rent.png"/>出租房</p> <!-- <p><img src="@/assets/images/rent.png"/>出租房</p> -->
<p><img src="@/assets/images/old.png"/>独居高龄老人</p> <p><img src="@/assets/images/old.png"/>独居高龄老人</p>
</div> </div>
</div> </div>
...@@ -100,9 +100,10 @@ export default { ...@@ -100,9 +100,10 @@ export default {
addPoints() { // 初始化添加楼栋图标,返回图标集合 addPoints() { // 初始化添加楼栋图标,返回图标集合
const markerCollection = [] const markerCollection = []
const mock = [ const mock = [
{lon: 121.509987, lat: 31.195844, address: '南码头路451弄9号', icon: 'rent.png'}, {lon: 121.509987, lat: 31.195844, address: '南码头路451弄9号202室', icon: 'focus.png'},
{lon: 121.510955, lat: 31.195374, address: '南码头路451弄23号', icon: 'focus.png'}, {lon: 121.510955, lat: 31.195374, address: '南码头路451弄23号302室', icon: 'focus.png'},
{lon: 121.511426, lat: 31.196219, address: '浦三路12弄24号', icon: 'old.png'}, {lon: 121.511426, lat: 31.196219, address: '浦三路12弄24号102室', icon: 'old.png'},
{lon: 121.510068, lat: 31.195045, address: '南码头路451弄13号201室', icon: 'old.png'},
] ]
const configMarker = item => { const configMarker = item => {
const marker = new AMap.Marker({ const marker = new AMap.Marker({
......
...@@ -390,17 +390,18 @@ export default { ...@@ -390,17 +390,18 @@ export default {
addSpecialMarker() { // 添加地图中特殊的标志点(已公告、同意率>50%等) addSpecialMarker() { // 添加地图中特殊的标志点(已公告、同意率>50%等)
const markers = [] const markers = []
this.eleDataSource.forEach(item => { this.eleDataSource.forEach(item => {
if (item.ratio > 0) { // TODO 应该是同意率>50 if (item.ratio >= 0.5) { // 同意率>50%
const communityName = item.sectName && (item.sectName + '').replace('(补)', '').replace('(补)', '') const communityName = item.sectName && (item.sectName + '').replace('(补)', '').replace('(补)', '')
const cur = this.buildingData.building.find(e => { const cur = this.buildingData.building.find(e => {
const name = e.name && (e.name + '').replace('(补)', '').replace('(补)', '') const name = e.name && (e.name + '').replace('(补)', '').replace('(补)', '')
return (communityName.indexOf(name) >= 0 || name.indexOf(communityName) >= 0) && (e.buildingNo.indexOf(item.unitNo) >= 0 || item.unitNo.indexOf(e.buildingNo) >= 0) && (e.lon && e.lat) return (communityName.indexOf(name) >= 0 || name.indexOf(communityName) >= 0) && (e.buildingNo.indexOf(item.unitNo) >= 0 || item.unitNo.indexOf(e.buildingNo) >= 0) && (e.lon && e.lat)
}) // 查找出返回数据中的同一幢楼栋数据 }) // 查找出返回数据中的同一幢楼栋数据
if (!cur) return
const marker = new AMap.Marker({ const marker = new AMap.Marker({
position: [cur.lon, cur.lat], position: [cur.lon, cur.lat],
offset: new AMap.Pixel(-10, -65), offset: new AMap.Pixel(-10, -65),
icon: new AMap.Icon({ icon: new AMap.Icon({
size: [30, 45], size: [20, 30],
image: require('@/assets/images/than500.gif'), image: require('@/assets/images/than500.gif'),
}), }),
extData: { extData: {
...@@ -420,6 +421,37 @@ export default { ...@@ -420,6 +421,37 @@ export default {
}) })
markers.push(marker) markers.push(marker)
} }
if (item.status == '1') { // 状态为已公告
const communityName = item.sectName && (item.sectName + '').replace('(补)', '').replace('(补)', '')
const cur = this.buildingData.building.find(e => {
const name = e.name && (e.name + '').replace('(补)', '').replace('(补)', '')
return (communityName.indexOf(name) >= 0 || name.indexOf(communityName) >= 0) && (e.buildingNo.indexOf(item.unitNo) >= 0 || item.unitNo.indexOf(e.buildingNo) >= 0) && (e.lon && e.lat)
}) // 查找出返回数据中的同一幢楼栋数据
if (!cur) return
const marker = new AMap.Marker({
position: [cur.lon, cur.lat],
offset: new AMap.Pixel(-10, -65),
icon: new AMap.Icon({
size: [20, 30],
image: require('@/assets/images/notice.gif'),
}),
extData: {
community: cur.name,
buildingNo: cur.buildingNo,
intention: cur.intention,
lon: cur.lon,
lat: cur.lat,
color: cur.color,
...item
},
}).on('click', e => {
this.detailDrawer = true
this.detailDrawerData = marker.getExtData()
const {lon, lat} = this.detailDrawerData
this.showInfoTips(e, [e.lnglat.getLng(), e.lnglat.getLat()], marker.getExtData(), this.addPrism(lon, lat))
})
markers.push(marker)
}
}) })
this.map.add(markers) this.map.add(markers)
}, },
...@@ -432,12 +464,13 @@ export default { ...@@ -432,12 +464,13 @@ export default {
const curObj = buildingDatas.find(e => e.unitNo.indexOf(item.buildingNo) >= 0 || item.buildingNo.indexOf(e.unitNo) >= 0) // 查找出返回数据中的同一幢楼栋数据 const curObj = buildingDatas.find(e => e.unitNo.indexOf(item.buildingNo) >= 0 || item.buildingNo.indexOf(e.unitNo) >= 0) // 查找出返回数据中的同一幢楼栋数据
if (!curObj) return if (!curObj) return
if(item.lon && item.lat && item.intention) { if (curObj.ratio < 0.25) return
if(item && item.lon && item.lat && item.intention) {
const marker = new AMap.Marker({ const marker = new AMap.Marker({
position: [item.lon, item.lat], position: [item.lon, item.lat],
icon: new AMap.Icon({ icon: new AMap.Icon({
size: [30, 10], size: [20, 15],
image: require(`@/assets/images/${this.$com.switchImg(curObj.ratio)}.png`), image: require(`@/assets/images/${this.$com.switchIcon(curObj.ratio)}.png`),
}), }),
extData: { extData: {
community: item.name, community: item.name,
......
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