Commit b3925a89 by cwq0219
2 parents 95533fbf 4a9ad72e
......@@ -30,6 +30,7 @@
v-if="i.isMap"
class='amap-page-container'
>
<span v-show="hasLocation" class="error mapTips">{{i.value}}</span>
<el-amap
vid='amapDemo'
:center='center'
......@@ -130,6 +131,7 @@ export default {
name: 'BusinessDetails',
data() {
return {
hasLocation: false,
tabPosition: 'left',
merchantId: '',
// loading标记
......@@ -184,7 +186,7 @@ export default {
isImg: true
}, {
label: 'POI位置点',
value: '',
value: '无位置信息',
isMap: true
}
],
......@@ -296,6 +298,7 @@ export default {
}
},
mounted() {
this.hasLocation = false
this.$root.eventBus.$on('params', (params) => {
this.activeName = 'first'
this.merchantId = params.merchantId
......@@ -352,14 +355,18 @@ export default {
assignBasicInfo() {
for (var i in this.List) {
if (this.List[i].isMap) {
this.center = [+this.merchantInfo.lng, +this.merchantInfo.lat]
const o = amapManager.getMap()
const marker = new AMap.Marker({
position: this.center
})
marker.setMap(o)
if (this.merchantInfo.lng && this.merchantInfo.lat) {
this.center = [+this.merchantInfo.lng, +this.merchantInfo.lat]
const o = amapManager.getMap()
const marker = new AMap.Marker({
position: this.center
})
marker.setMap(o)
} else {
this.hasLocation = true
}
} else if (this.List[i].isImg) {
this.List[i].value = 'http://www.pptbz.com/pptpic/UploadFiles_6909/201203/2012031220134655.jpg'
this.List[i].value = this.merchantInfo.merchantPortrait
} else {
this.List[i].value = this.merchantInfo[this.List[i].name]
}
......@@ -419,6 +426,12 @@ export default {
.amap-page-container {
width: 100%;
height: 300px;
position: relative;
}
.amap-page-container .mapTips {
position: absolute;
top: -28px;
left: 85px;
}
.amap-demo {
height: 300px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!