提交 89889b1f 作者: ZhangLingKun

功能:问题修复

上级 82697bdf
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<view class="websit-node-list-search"> <view class="websit-node-list-search">
<pick-region @getRegion="handleGetRegion"> <pick-region @getRegion="handleGetRegion">
<view class="location-select"> <view class="location-select">
<view>深圳</view> <view>{{location.city}}</view>
<image src="../../static/images/icon-down.png" /> <image src="../../static/images/icon-down.png" />
</view </view
></pick-region> ></pick-region>
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
let str = this.getQueryString("location") || JSON.stringify(this.locationData); let str = this.getQueryString("location") || JSON.stringify(this.locationData);
this.location = JSON.parse(str); this.location = JSON.parse(str);
uni.showToast({ uni.showToast({
title:'哈哈哈', title:this.location.location.lng+'',
icon:'none' icon:'none'
}) })
}, },
...@@ -83,22 +83,6 @@ export default { ...@@ -83,22 +83,6 @@ export default {
return str.substring(0,3)+'****'+str.substring(str.length-4,str.length) return str.substring(0,3)+'****'+str.substring(str.length-4,str.length)
} }
}, },
onReachBottom() {
if (this.currentTipIndex != 0) {
if (this.query.pageNo * this.query.pageSize < this.total) {
switch (this.currentTipIndex) {
case 1:
this.query.pageNo++
this.getFlyerDotList()
break;
case 2:
this.query.pageNo++
this.getDeviceDotList()
break;
}
}
}
},
methods: { methods: {
toAddWebsit() { toAddWebsit() {
wx.miniProgram.navigateTo({ wx.miniProgram.navigateTo({
...@@ -113,7 +97,9 @@ export default { ...@@ -113,7 +97,9 @@ export default {
} }
return null; return null;
}, },
handleGetRegion(address){
this.location.city=address[1].name==='市辖区'?address[0].name:address[1].name
}
} }
} }
</script> </script>
...@@ -205,29 +191,22 @@ export default { ...@@ -205,29 +191,22 @@ export default {
data: { data: {
lat: this.location.location.lat, lat: this.location.location.lat,
lon: this.location.location.lng, lon: this.location.location.lng,
pageNo:1,
pageSize:9999
} }
}) })
if (res.result) { if (res.result.list) {
let nodeList = res.result.reduce((pre, cur) => { this.websitList=res.result.list.map((v)=>({
let list = cur.locationList.filter((item) => {
item.grade = '4.' + this.RandomNum(5, 9)
item.day = this.RandomNum(1, 10)
item.count = this.RandomNum(4, 5) * 10
return item.range >= 100
});
pre.push(...list);
return pre;
}, []);
this.websitList=nodeList.map((v)=>({
addressDescImg:'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/774dec69-bf56-4dd9-9c3f-aaa33bc47bcd.png', addressDescImg:'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/774dec69-bf56-4dd9-9c3f-aaa33bc47bcd.png',
address:v.dizhi, address:v.address,
distance:v.range distance:v.distance,
lat:v.lat,
lon:v.lon
})) }))
console.log("网点列表数据--->",this.websitList) this.markers = this.websitList.map((item, index) => {
this.markers = nodeList.map((item, index) => {
return { return {
id: index, id: index,
lnglat: [item.jd, item.wd], lnglat: [item.lon, item.lat],
style: 0 style: 0
}; };
}); });
...@@ -256,7 +235,7 @@ export default { ...@@ -256,7 +235,7 @@ export default {
case 3: case 3:
this.query.pageNo = 1 this.query.pageNo = 1
this.query.pageSize=9999 this.query.pageSize=9999
await this.getDeviceDotList() await this.getMaintenance()
this.massMarks.setData(this.markers) this.massMarks.setData(this.markers)
break; break;
} }
...@@ -299,7 +278,7 @@ export default { ...@@ -299,7 +278,7 @@ export default {
}) })
if (res.result.list) { if (res.result.list) {
this.websitList=res.result.list.map((v)=>({ this.websitList=res.result.list.map((v)=>({
addressDescImg:'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/774dec69-bf56-4dd9-9c3f-aaa33bc47bcd.png', addressDescImg:'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/3f8d885a-40ab-41ae-b64d-0494d6d80de9.png',
address:v.uavName, address:v.uavName,
distance:v.distance distance:v.distance
})) }))
...@@ -312,6 +291,32 @@ export default { ...@@ -312,6 +291,32 @@ export default {
}); });
} }
}, },
// 维修网点
async getMaintenance(){
let res = await this.$httpRequest({
url: this.$api.maintenanceList,
method: 'get',
data: {
lat: this.location.location.lat,
lon: this.location.location.lng,
...this.query
}
})
if (res.result.list) {
this.websitList=res.result.list.map((v)=>({
addressDescImg:'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/774dec69-bf56-4dd9-9c3f-aaa33bc47bcd.png',
address:v.name,
distance:v.distance,
}))
this.markers = res.result.list.map((item, index) => {
return {
id: index,
lnglat: [item.lon, item.lat],
style: 1
};
});
}
},
RandomNum(minNum, maxNum) { RandomNum(minNum, maxNum) {
return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10); return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论