Commit 2b061c86 by 胡悦

修改位置提示

1 parent eb55d8ae
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
v-if="i.isMap" v-if="i.isMap"
class='amap-page-container' class='amap-page-container'
> >
<span v-show="hasLocation" class="error mapTips">{{i.value}}</span>
<el-amap <el-amap
vid='amapDemo' vid='amapDemo'
:center='center' :center='center'
...@@ -130,6 +131,7 @@ export default { ...@@ -130,6 +131,7 @@ export default {
name: 'BusinessDetails', name: 'BusinessDetails',
data() { data() {
return { return {
hasLocation: false,
tabPosition: 'left', tabPosition: 'left',
merchantId: '', merchantId: '',
// loading标记 // loading标记
...@@ -184,7 +186,7 @@ export default { ...@@ -184,7 +186,7 @@ export default {
isImg: true isImg: true
}, { }, {
label: 'POI位置点', label: 'POI位置点',
value: '', value: '无位置信息',
isMap: true isMap: true
} }
], ],
...@@ -303,6 +305,7 @@ export default { ...@@ -303,6 +305,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.hasLocation = false
this.$root.eventBus.$on('params', (params) => { this.$root.eventBus.$on('params', (params) => {
if (params.merchantId !== this.merchantId) { if (params.merchantId !== this.merchantId) {
this.activeName = 'first' this.activeName = 'first'
...@@ -355,14 +358,18 @@ export default { ...@@ -355,14 +358,18 @@ export default {
assignBasicInfo() { assignBasicInfo() {
for (var i in this.List) { for (var i in this.List) {
if (this.List[i].isMap) { if (this.List[i].isMap) {
this.center = [+this.merchantInfo.lng, +this.merchantInfo.lat] if (this.merchantInfo.lng && this.merchantInfo.lat) {
const o = amapManager.getMap() this.center = [+this.merchantInfo.lng, +this.merchantInfo.lat]
const marker = new AMap.Marker({ const o = amapManager.getMap()
position: this.center const marker = new AMap.Marker({
}) position: this.center
marker.setMap(o) })
marker.setMap(o)
} else {
this.hasLocation = true
}
} else if (this.List[i].isImg) { } 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 { } else {
this.List[i].value = this.merchantInfo[this.List[i].name] this.List[i].value = this.merchantInfo[this.List[i].name]
} }
...@@ -422,6 +429,12 @@ export default { ...@@ -422,6 +429,12 @@ export default {
.amap-page-container { .amap-page-container {
width: 100%; width: 100%;
height: 300px; height: 300px;
position: relative;
}
.amap-page-container .mapTips {
position: absolute;
top: -28px;
left: 85px;
} }
.amap-demo { .amap-demo {
height: 300px; height: 300px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!