Commit ac48d4e3 authored by zhengke's avatar zhengke

修改地图

parent a21ed534
......@@ -120,11 +120,9 @@ export default {
},
addPoint(param){
console.log(param)
let ad=param.address?param.address:param.city
var myGeo = new BMap.Geocoder();
var that=this
console.log(ad)
myGeo.getPoint(ad, function(point){
if (point) {
var geo = that.myChart.getModel().getComponent('geo').coordinateSystem;
......
<template>
<div class="echarts" :style="{height:'110%',width:'110%'}">
<div :style="{height:'110%',width:'110%'}" ref="myEchart"></div>
<div v-if="isShow" v-for="(item, index) in points" :key="index" class="viittoHot" :style="{left:(item[0]-5)+'px',top:(item[1]-5)+'px'}"></div>
<div v-if="isShow2" v-for="(item, subIndex) in ActivateList" :key="subIndex+50000" class="viittoActive" :style="{left:(item[0]-5)+'px',top:(item[1]-5)+'px'}"></div>
</div>
</template>
<script>
......@@ -17,21 +15,10 @@ export default {
return {
chart: null,
position: [-999999, -999999],
points:[],
//活动人数
ActivateList:[],
myChart:{},
isShow:false,
isShow2:false,
};
},
mounted() {
this.bus.$on('addpoint',addTradeInfo=>{
this.addPoint(addTradeInfo)
})
this.bus.$on('addActivePoint',addTradeInfo=>{
this.ActivePoint(addTradeInfo)
})
this.chinaConfigure();
},
beforeDestroy() {
......@@ -130,63 +117,6 @@ export default {
]
});
},
addPoint(param){
let ad=param.address?param.address:param.city
var myGeo = new BMap.Geocoder();
var that=this
myGeo.getPoint(ad, function(point){
if (point) {
var geo = that.myChart.getModel().getComponent('geo').coordinateSystem;
let coord = that.myChart.convertToPixel("geo", [point.lng, point.lat]);
that.points.push(coord);
if(that.points.length>100){
that.points.splice(0,1)
}
}
})
setTimeout(()=>{
that.isShow=true;
}, 6000);
},
//获取活跃人数
ActivePoint(param){
let ad=param.address?param.address:param.city
var myGeo = new BMap.Geocoder();
var that=this
myGeo.getPoint(ad, function(point){
if (point) {
var geo = that.myChart.getModel().getComponent('geo').coordinateSystem;
let coord = that.myChart.convertToPixel("geo", [point.lng, point.lat]);
that.ActivateList.push(coord);
if(that.ActivateList.length>100){
that.ActivateList.splice(0,1)
}
}
})
setTimeout(()=>{
that.isShow2=true;
}, 6000);
}
}
};
</script>
<style>
.viittoHot {
position: absolute;
z-index: 5;
color: #fff;
width: 5px;
height: 5px;
background: #2a73fe;
border-radius: 100%;
}
.viittoActive{
position: absolute;
z-index: 5;
color: #fff;
width: 5px;
height: 5px;
background: #FF75A1;
border-radius: 100%;
}
</style>
</script>
\ No newline at end of file
......@@ -492,7 +492,7 @@ export default {
//切换统计看板
exChangeBoard(){
window.location="http://data.oytour.com/#/viittoData2"
//window.location="http://192.168.0.112:8080/#/viittoData2";
//window.location="http://192.168.0.111:8080/#/viittoData2";
window.location.reload();
}
}
......
......@@ -339,7 +339,7 @@
</div>
</template>
<script>
import centerMp from "../sellDashboard/map/viittoMap";
import centerMp from "../sellDashboard/map/viittoMap2";
export default {
components: {
centerMp
......@@ -351,7 +351,12 @@ export default {
//活跃用户的名称
ActiveDataName:[],
//活跃用户的数据
ActiveData:[]
ActiveData:[],
//传递子组件活跃用户
ActiveArr:[],
//传递不活跃用户
InActiveArr:[]
};
},
mounted() {
......@@ -511,7 +516,7 @@ export default {
//切换统计看板
exChangeBoard(){
window.location="http://data.oytour.com/#/viittoData"
//window.location="http://192.168.0.112:8080/#/viittoData"
//window.location="http://192.168.0.111:8080/#/viittoData"
window.location.reload();
},
//获取地址、
......@@ -520,42 +525,32 @@ export default {
//不经常活动的地址
let InActiveList = res.data.data.InActiveList;
let ActivateList = res.data.data.ActivateList;
var result = [];
this.InActiveArr = [];
var obj = {};
for(var i =0; i<InActiveList.length; i++){
if(!obj[InActiveList[i].District]){
result.push(InActiveList[i]);
obj[InActiveList[i].District] = true;
if(!obj[InActiveList[i].Address]&&InActiveList[i].District!=InActiveList[i].City){
this.InActiveArr.push(InActiveList[i]);
obj[InActiveList[i].Address] = true;
}
}
//活动的
var resultActive = [];
this.ActiveArr = [];
var obj2 = {};
for(var i =0; i<ActivateList.length; i++){
if(!obj2[ActivateList[i].District]){
resultActive.push(ActivateList[i]);
obj2[ActivateList[i].District] = true;
if(!obj2[ActivateList[i].Address]&&ActivateList[i].District!=ActivateList[i].City){
this.ActiveArr.push(ActivateList[i]);
obj2[ActivateList[i].Address] = true;
}
}
if(res.data.resultCode==1){
result.forEach(x=>{
this.bus.$emit("addpoint",{
city:x.City,
address:x.District
});
})
resultActive.forEach(x=>{
this.bus.$emit("addActivePoint",{
city:x.City,
address:x.District
});
})
var newArr = [this.InActiveArr,this.ActiveArr];
//调用生成
this.bus.$emit("addpoint",newArr);
}else{
this.Error(res.data.message);
}
},err => {});
}
},
}
};
</script>
\ No newline at end of file
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