|
@@ -1,19 +1,12 @@
|
|
<template>
|
|
<template>
|
|
- <div class="layout" @touchmove.prevent>
|
|
|
|
- <div id="map"></div>
|
|
|
|
-
|
|
|
|
- <div class="dialog" v-show="showDialog">
|
|
|
|
- <a class="close" @click="showDialog = false"></a>
|
|
|
|
- <a class="jleft" @click="slideHandle(--imgIndex)">
|
|
|
|
- <img src="@/assets/images/jiantou.png">
|
|
|
|
- </a>
|
|
|
|
- <a class="jright" @click="slideHandle(++imgIndex)">
|
|
|
|
- <img src="@/assets/images/jiantou2.png">
|
|
|
|
- </a>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- <div class="map-bottom-layout" :class="{mobile: ismobile}">
|
|
|
|
- <div class="map-tabs clear" :class="{mobile: ismobile}" v-if="dmodel && dmodel.link">
|
|
|
|
|
|
+<div class="layout" :style="{top:showList?'0':'100%'}" @touchmove.prevent>
|
|
|
|
+ <div id="map"></div>
|
|
|
|
+ <div class="map-bottom-layout" :class="{mobile: ismobile}">
|
|
|
|
+ <div class="map-tabs clear" :class="{mobile: ismobile}">
|
|
|
|
+ <template v-if="!isLocal && !ismobile">
|
|
|
|
+ <a class="rad list-pc-icon" @click="tapList()"><i class="iconfont icon-suolve"></i></a>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-if="dmodel && dmodel.link">
|
|
<template v-if="ismobile">
|
|
<template v-if="ismobile">
|
|
<span v-if="mapTab === 1" @click="goto(dmodel)">
|
|
<span v-if="mapTab === 1" @click="goto(dmodel)">
|
|
<i class="iconfont icon-leixing_hangpai"></i>航拍
|
|
<i class="iconfont icon-leixing_hangpai"></i>航拍
|
|
@@ -22,39 +15,46 @@
|
|
<i class="iconfont icon-tuceng"></i>平面
|
|
<i class="iconfont icon-tuceng"></i>平面
|
|
</span>
|
|
</span>
|
|
</template>
|
|
</template>
|
|
- <template v-else>
|
|
|
|
- <a :class="{active: mapTab === 1}" class="rad">
|
|
|
|
- 俯视整个{{$route.params.title}}
|
|
|
|
- </a>
|
|
|
|
- <a @click="goto(dmodel)" :class="{active: mapTab === 0}" class="rad">
|
|
|
|
|
|
+ <template v-if="!ismobile">
|
|
|
|
+ <a class="rad mar-left" >
|
|
|
|
+ 俯视整个{{$route.params.title}}
|
|
|
|
+ </a>
|
|
|
|
+ <a @click="goto(dmodel)" :class="{active: mapTab === 1}" class="rad mar-rigth">
|
|
航拍视角
|
|
航拍视角
|
|
</a>
|
|
</a>
|
|
</template>
|
|
</template>
|
|
- </div>
|
|
|
|
-
|
|
|
|
- <div class="focus-info" v-if="info && ismobile">
|
|
|
|
- <h3>{{info.name}}</h3>
|
|
|
|
- <div class="tags">
|
|
|
|
- <span>{{info.parent}}</span>
|
|
|
|
|
|
+ </template>
|
|
|
|
+ <template v-if="!isLocal && ismobile">
|
|
|
|
+ <div class="list-icon" @click="tapList()">
|
|
|
|
+ <i class="iconfont icon-suolve"></i>列图
|
|
</div>
|
|
</div>
|
|
- <div class="tags">
|
|
|
|
- <span>{{info.tagType}}</span>
|
|
|
|
- </div>
|
|
|
|
- <p>{{info.address}}</p>
|
|
|
|
- <div class="types">
|
|
|
|
- <i v-for="type in info.showType" :key="type" class="iconfont" :class="'icon-'+type"></i>
|
|
|
|
- </div>
|
|
|
|
- <a @click="goto(info)" v-if="info.link || info.data">
|
|
|
|
|
|
+ </template>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="focus-info" v-if="info && ismobile">
|
|
|
|
+ <h3>{{info.name}}</h3>
|
|
|
|
+ <div class="tags">
|
|
|
|
+ <span>{{info.parent}}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="tags">
|
|
|
|
+ <span>{{info.tagType.name}}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <p>{{info.address}}</p>
|
|
|
|
+ <div class="types">
|
|
|
|
+ <i v-for="type in info.showType" :key="type" class="iconfont" :class="'icon-'+type"></i>
|
|
|
|
+ </div>
|
|
|
|
+ <a @click="goto(info)" v-if="info.link || info.data">
|
|
<span>点击</span><span>参观</span>
|
|
<span>点击</span><span>参观</span>
|
|
</a>
|
|
</a>
|
|
- <a class="nolink" v-else>
|
|
|
|
|
|
+ <a class="nolink" v-else>
|
|
<span>正在</span><span>拍摄</span>
|
|
<span>正在</span><span>拍摄</span>
|
|
</a>
|
|
</a>
|
|
- </div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <imageQuery :introduce="introduce" :name="name" :showAside="true" :screens="screens" @exitHandle="screens = null"/>
|
|
|
|
|
|
- <imageQuery :screens="screens" @exitHandle="screens = null" />
|
|
|
|
- <!-- <div class="image-dialog" v-if="screens">
|
|
|
|
|
|
+ <!-- <div class="image-dialog" v-if="screens">
|
|
<a @click="screens = null"><i class="iconfont icon-left"></i>返回</a>
|
|
<a @click="screens = null"><i class="iconfont icon-left"></i>返回</a>
|
|
<div class="image-layout">
|
|
<div class="image-layout">
|
|
<Slide :screens="screens" :current="0">
|
|
<Slide :screens="screens" :current="0">
|
|
@@ -64,7 +64,7 @@
|
|
</Slide>
|
|
</Slide>
|
|
</div>
|
|
</div>
|
|
</div> -->
|
|
</div> -->
|
|
- </div>
|
|
|
|
|
|
+</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
@@ -74,7 +74,9 @@ import data from '@/data'
|
|
const AMap = global.AMap
|
|
const AMap = global.AMap
|
|
|
|
|
|
export default {
|
|
export default {
|
|
- components: { imageQuery },
|
|
|
|
|
|
+ components: {
|
|
|
|
+ imageQuery
|
|
|
|
+ },
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
cacheMakers: [],
|
|
cacheMakers: [],
|
|
@@ -84,7 +86,17 @@ export default {
|
|
ismobile: browser.mobile,
|
|
ismobile: browser.mobile,
|
|
info: null,
|
|
info: null,
|
|
dmodel: {},
|
|
dmodel: {},
|
|
- screens: null
|
|
|
|
|
|
+ isType: true,
|
|
|
|
+ screens: null,
|
|
|
|
+ showList: false,
|
|
|
|
+ introduce: [],
|
|
|
|
+ name: ''
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ isLocal () {
|
|
|
|
+ return this.$isLocal
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -109,10 +121,10 @@ export default {
|
|
<span>${item.name}</span>
|
|
<span>${item.name}</span>
|
|
</h3>
|
|
</h3>
|
|
<div class="content">
|
|
<div class="content">
|
|
- <div><span>${item.parent}</span><span>${item.tagType}</span></div>
|
|
|
|
|
|
+ <div><span>${item.parent}</span><span>${item.tagType.name}</span></div>
|
|
<p>${item.address}</p>
|
|
<p>${item.address}</p>
|
|
<div class="oper">
|
|
<div class="oper">
|
|
- <div>${types.join('')}</div>
|
|
|
|
|
|
+ <div>${(item.link || item.data) ? types.join('') : ''}</div>
|
|
<a class='query-image'>${(item.link || item.data) ? '点击参观' : '正在拍摄'}</a>
|
|
<a class='query-image'>${(item.link || item.data) ? '点击参观' : '正在拍摄'}</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -205,10 +217,21 @@ export default {
|
|
|
|
|
|
global.AMap.event.addListener(marker, 'click', e => {
|
|
global.AMap.event.addListener(marker, 'click', e => {
|
|
if (!show) {
|
|
if (!show) {
|
|
- this.$router.push({name: 'info', params: {title: this.$route.params.title, show: item.name}})
|
|
|
|
|
|
+ this.$router.push({
|
|
|
|
+ name: 'info',
|
|
|
|
+ params: {
|
|
|
|
+ title: this.$route.params.title,
|
|
|
|
+ show: item.name
|
|
|
|
+ }
|
|
|
|
+ })
|
|
// marker.seftadditional.play()
|
|
// marker.seftadditional.play()
|
|
} else {
|
|
} else {
|
|
- this.$router.push({name: 'map', params: {title: this.$route.params.title}})
|
|
|
|
|
|
+ this.$router.push({
|
|
|
|
+ name: 'map',
|
|
|
|
+ params: {
|
|
|
|
+ title: this.$route.params.title
|
|
|
|
+ }
|
|
|
|
+ })
|
|
// marker.seftadditional.pause()
|
|
// marker.seftadditional.pause()
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -219,7 +242,12 @@ export default {
|
|
content: infoDom
|
|
content: infoDom
|
|
})
|
|
})
|
|
infoDom.querySelector('h3').addEventListener('click', () => {
|
|
infoDom.querySelector('h3').addEventListener('click', () => {
|
|
- this.$router.push({name: 'map', params: {title: this.$route.params.title}})
|
|
|
|
|
|
+ this.$router.push({
|
|
|
|
+ name: 'map',
|
|
|
|
+ params: {
|
|
|
|
+ title: this.$route.params.title
|
|
|
|
+ }
|
|
|
|
+ })
|
|
// marker.seftadditional.pause()
|
|
// marker.seftadditional.pause()
|
|
})
|
|
})
|
|
infoDom.querySelector('a').addEventListener('click', clickHandle)
|
|
infoDom.querySelector('a').addEventListener('click', clickHandle)
|
|
@@ -235,6 +263,38 @@ export default {
|
|
}
|
|
}
|
|
this.loadding(item, params.show)
|
|
this.loadding(item, params.show)
|
|
},
|
|
},
|
|
|
|
+ tapList () {
|
|
|
|
+ let {params} = this.$route
|
|
|
|
+ // let items, item
|
|
|
|
+ // let tagType
|
|
|
|
+
|
|
|
|
+ // if (params.show) {
|
|
|
|
+ // if (data.types.find(item => item.title === params.title)) {
|
|
|
|
+ // items = data.types.find(item => item.title === params.title)
|
|
|
|
+ // } else {
|
|
|
|
+ // items = data.modules.find(item => item.title === params.title)
|
|
|
|
+ // }
|
|
|
|
+ // if (name === 'map' || name === 'info' || name === 'home') {
|
|
|
|
+
|
|
|
|
+ // }
|
|
|
|
+ // item = items ? items.children.find(item => item.name === params.show) : ''
|
|
|
|
+
|
|
|
|
+ // tagType = item.tagType.name
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ this.$router.push({
|
|
|
|
+ name: params.show ? 'item' : 'list',
|
|
|
|
+ params: !this.isType ? {
|
|
|
|
+ title: params.title,
|
|
|
|
+ type: '全部',
|
|
|
|
+ show: params.show
|
|
|
|
+ } : {
|
|
|
|
+ title: '全部',
|
|
|
|
+ type: params.title,
|
|
|
|
+ show: params.show
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
goto (info) {
|
|
goto (info) {
|
|
if (info.link) {
|
|
if (info.link) {
|
|
let id = null
|
|
let id = null
|
|
@@ -243,13 +303,23 @@ export default {
|
|
id = key
|
|
id = key
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- this.$router.push({name: 'external', params: {url: info.link, id: id}})
|
|
|
|
|
|
+ this.$router.push({
|
|
|
|
+ name: 'external',
|
|
|
|
+ params: {
|
|
|
|
+ url: info.link,
|
|
|
|
+ id: id
|
|
|
|
+ }
|
|
|
|
+ })
|
|
} else if (info.data) {
|
|
} else if (info.data) {
|
|
this.screens = info.data
|
|
this.screens = info.data
|
|
|
|
+ this.introduce = info.introduce
|
|
|
|
+ this.name = info.name
|
|
}
|
|
}
|
|
},
|
|
},
|
|
queryImage (item) {
|
|
queryImage (item) {
|
|
this.screens = item.data
|
|
this.screens = item.data
|
|
|
|
+ this.introduce = item.introduce
|
|
|
|
+ this.name = item.name
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
@@ -260,16 +330,22 @@ export default {
|
|
this.map.add(this.satellite)
|
|
this.map.add(this.satellite)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ showList () {
|
|
|
|
+ if (!this.ismobile) {
|
|
|
|
+ this.$bus.$emit('showaside', true)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
'$route.params.title': {
|
|
'$route.params.title': {
|
|
handler: function (newVal, oldVal) {
|
|
handler: function (newVal, oldVal) {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
if (newVal !== oldVal) {
|
|
if (newVal !== oldVal) {
|
|
let params = this.$route.params
|
|
let params = this.$route.params
|
|
let item = data.modules.find(item => item.title === params.title)
|
|
let item = data.modules.find(item => item.title === params.title)
|
|
|
|
+ this.isType = false
|
|
if (!item) {
|
|
if (!item) {
|
|
|
|
+ this.isType = true
|
|
item = data.types.find(item => item.title === params.title)
|
|
item = data.types.find(item => item.title === params.title)
|
|
}
|
|
}
|
|
-
|
|
|
|
this.map.setCenter(item.center)
|
|
this.map.setCenter(item.center)
|
|
this.map.setZoom(item.zoom)
|
|
this.map.setZoom(item.zoom)
|
|
}
|
|
}
|
|
@@ -283,6 +359,9 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted () {
|
|
mounted () {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.showList = true
|
|
|
|
+ })
|
|
this.map = new global.AMap.Map('map', {
|
|
this.map = new global.AMap.Map('map', {
|
|
mapStyle: 'amap://styles/fresh',
|
|
mapStyle: 'amap://styles/fresh',
|
|
zoom: 18,
|
|
zoom: 18,
|
|
@@ -296,8 +375,6 @@ export default {
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
@import url(./style);
|
|
@import url(./style);
|
|
-</style>
|
|
|
|
-
|
|
|
|
-<style>
|
|
|
|
|
|
+</style><style>
|
|
@import url(./map_style);
|
|
@import url(./map_style);
|
|
</style>
|
|
</style>
|