Commit d1e372ed authored by 华国豪's avatar 华国豪 🙄

1

parent 665eb77e
......@@ -19,42 +19,39 @@ export default {
props: ['baiduMapData'],
data(){
return {
dataList: [],
}
},
watch: {
baiduMapData(old, newV){
this.creatMap()
}
},created(){
},mounted() {
let _this = this
this.bus.$on('addpoint',newArr=>{
//this.SourceData=newArr;
this.dataList = newArr
})
let map = new BMap.Map("centerMpBaidu");
map.setMapStyle({
style: 'midnight'
});
map.enableScrollWheelZoom(true); // 开启鼠标滚轮缩放
var MAX = this.baiduMapData.length;
let data = this.baiduMapData;
if (data.length > 0) {
map.centerAndZoom(new BMap.Point(data[0].Lng, data[0].Lat), 10);
} else {
map.centerAndZoom(new BMap.Point(104.0727017791, 30.6643622306), 10);
}
var markers = [];
var pt = null;
for (let i = 0; i < MAX; i++) {
pt = new BMap.Point(data[i].Lng, data[i].Lat);
markers.push(new BMap.Marker(pt));
}
//最简单的用法,生成一个marker数组,然后调用markerClusterer类即可。
var markerClusterer = new BMapLib.MarkerClusterer(map, {markers:markers});
},methods:{
creatMap(){
let map = new BMap.Map("centerMpBaidu");
map.setMapStyle({
style: 'midnight'
});
map.enableScrollWheelZoom(true); // 开启鼠标滚轮缩放
var MAX = this.baiduMapData.length;
let data = this.baiduMapData;
if (data.length > 0) {
map.centerAndZoom(new BMap.Point(data[0].Lng, data[0].Lat), 10);
} else {
map.centerAndZoom(new BMap.Point(104.0727017791, 30.6643622306), 10);
}
var markers = [];
var pt = null;
for (let i = 0; i < MAX; i++) {
pt = new BMap.Point(data[i].Lng, data[i].Lat);
markers.push(new BMap.Marker(pt));
}
//最简单的用法,生成一个marker数组,然后调用markerClusterer类即可。
var markerClusterer = new BMapLib.MarkerClusterer(map, {markers:markers});
}
}
}
</script>
\ No newline at end of file
......@@ -44,8 +44,23 @@ export default {
window.onresize = _this.myChart.resize;
this.myChart.on('click', function(params){
console.log(params)
return
_this.bus.$emit('send-centerMpShow', name)
let name = params.name
if (name === '非正式同行' || name === '正式同行' || name === '激活总数') {
// {location: `${params.data.value[0]}, ${params.data.value[1]}`, key: 'ZzGBZF6L0sgFDLlDohyvYhCnWy4dwksX'}
let url = encodeURIComponent(`http://api.map.baidu.com/geocoder?location=${params.data.value[1]},${params.data.value[0]}&output=json`)
_this.$http.get(`https://reborn.oytour.com/api/test/GetHtmlByUrl?urlStr=${url}`)
.then(res => {
let data = JSON.parse(res.data)
name = data.result.addressComponent.province
_this.bus.$emit('send-centerMpShow', name)
})
.catch(err => {
console.log(err);
})
} else {
_this.bus.$emit('send-centerMpShow', name)
}
});
},
addPoint(newArr){
......
......@@ -302,7 +302,7 @@
</div>
<div class="map-box map-box-centerMpBaidu" v-if="!centerMpShow" style="position:relative;z-index:1;">
<div class="map-box-centerMpBaidu-return" @click="centerMpShow = true, baiduMapData = []">返回</div>
<centerMpBaidu :baiduMapData="baiduMapData" v-if="baiduMapData.length > 0"></centerMpBaidu>
<centerMpBaidu :baiduMapData="baiduMapData" ></centerMpBaidu>
</div>
<el-row class="tonghangshu">
<el-col :span="10">
......
......@@ -145,7 +145,7 @@
</div>
</div>
<div class="video_box" :class="movieShow ? 'video_box_show' : ''">
<video v-if="movieShow" @ended="nextVideo(true)" style="width:100%;height:100%;" ref="video" :src="movie[movieNum]" autoplay="autoplay" controls="controls">您的浏览器不支持视频播放</video>
<video v-if="movieShow" @error="videoErr" @ended="nextVideo(true)" style="width:100%;height:100%;" ref="video" :src="movie[movieNum]" autoplay="autoplay" controls="controls">您的浏览器不支持视频播放</video>
</div>
</div>
</template>
......@@ -194,10 +194,12 @@ export default {
movieShow: false,
movieTime: 0,
movieTimmer: null,
fiveMinutes: 300,
fiveMinutes: 1,
};
},
mounted() {
let audio=this.$refs.audio
let _this=this
for (let i = 0; i < 26; i ++){ // 生成视频数据
this.movie.push(`http://192.168.1.254/${i+1}.mp4`)
// this.movie.push(`http://img.oytour.com/video/${i+1}.mp4`)
......@@ -208,8 +210,6 @@ export default {
this.bus.$on("addVideo", txt => {
this.addVideo(txt);
});
let audio=this.$refs.audio
let _this=this
audio.addEventListener('ended', function () {
console.log(_this.endVideo)
if(_this.endVideo&&_this.endVideo!=''){
......@@ -232,6 +232,11 @@ export default {
}, 1000);
},
methods: {
videoErr: function (){
this.movieShow = false
this.movieTime = 0
this.fiveMinutes = 9999
},
getMovieTimmer: function () {
if (this.movieTime < this.fiveMinutes) {
this.movieTime += 1
......
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