地图
This commit is contained in:
@@ -40,6 +40,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
...mapActions(['wxInvoke']),
|
||||||
injectLib(url, cb) {
|
injectLib(url, cb) {
|
||||||
const script = document.createElement('script')
|
const script = document.createElement('script')
|
||||||
script.type = 'text/javascript';
|
script.type = 'text/javascript';
|
||||||
@@ -54,29 +55,49 @@ export default {
|
|||||||
var latLng = {}
|
var latLng = {}
|
||||||
if(this.config.lat) { //通用版
|
if(this.config.lat) { //通用版
|
||||||
latLng = this.config
|
latLng = this.config
|
||||||
|
this.mapLib = TMap
|
||||||
|
this.tmap = new TMap.Map(this.$refs.tmap, {
|
||||||
|
zoom: 11,
|
||||||
|
center: new TMap.LatLng(latLng.lat, latLng.lng),
|
||||||
|
...this.ops
|
||||||
|
})
|
||||||
|
this.$emit('loaded')
|
||||||
|
this.$emit('update:lib', TMap)
|
||||||
|
this.$emit('update:map', this.tmap)
|
||||||
|
this.areaId && this.getMapArea()
|
||||||
}else { //上架版
|
}else { //上架版
|
||||||
wx.getLocation({
|
|
||||||
type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
|
this.wxInvoke(['getLocation', {
|
||||||
success: (res) => {
|
}, (res) => {
|
||||||
console.log(res)
|
latLng = {
|
||||||
latLng = {
|
lat: res.latitude,
|
||||||
lat: res.latitude,
|
lng: res.longitude
|
||||||
lng: res.longitude
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
this.mapLib = TMap
|
||||||
|
this.tmap = new TMap.Map(this.$refs.tmap, {
|
||||||
|
zoom: 11,
|
||||||
|
center: new TMap.LatLng(latLng.lat, latLng.lng),
|
||||||
|
...this.ops
|
||||||
|
})
|
||||||
|
this.$emit('loaded')
|
||||||
|
this.$emit('update:lib', TMap)
|
||||||
|
this.$emit('update:map', this.tmap)
|
||||||
|
this.areaId && this.getMapArea()
|
||||||
|
}])
|
||||||
|
|
||||||
|
// wx.getLocation({
|
||||||
|
// type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
|
||||||
|
// success: (res) => {
|
||||||
|
// console.log(res)
|
||||||
|
// latLng = {
|
||||||
|
// lat: res.latitude,
|
||||||
|
// lng: res.longitude
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
this.mapLib = TMap
|
|
||||||
this.tmap = new TMap.Map(this.$refs.tmap, {
|
|
||||||
zoom: 11,
|
|
||||||
center: new TMap.LatLng(latLng.lat, latLng.lng),
|
|
||||||
...this.ops
|
|
||||||
})
|
|
||||||
this.$emit('loaded')
|
|
||||||
this.$emit('update:lib', TMap)
|
|
||||||
this.$emit('update:map', this.tmap)
|
|
||||||
this.areaId && this.getMapArea()
|
|
||||||
},
|
},
|
||||||
fitBounds(latLngList, count = 0) {
|
fitBounds(latLngList, count = 0) {
|
||||||
// 由多边形顶点坐标数组计算能完整呈现该多边形的最小矩形范围
|
// 由多边形顶点坐标数组计算能完整呈现该多边形的最小矩形范围
|
||||||
|
|||||||
@@ -108,13 +108,17 @@
|
|||||||
<div class="item" v-for="(item, index) in list" :key="index">
|
<div class="item" v-for="(item, index) in list" :key="index">
|
||||||
<p>{{item.content}}</p>
|
<p>{{item.content}}</p>
|
||||||
<div>{{item.createTime}}
|
<div>{{item.createTime}}
|
||||||
<span>{{item.createUserName}}</span>
|
<span>
|
||||||
|
网格员:<AiOpenData v-if="item.createUserName" type="userName" :openid="item.createUserName" />
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-flex" v-if="info.releaseName">
|
<div class="item-flex" v-if="info.releaseName">
|
||||||
<div class="label">异常解除人</div>
|
<div class="label">异常解除人</div>
|
||||||
<div class="value">{{info.releaseName}}</div>
|
<div class="value">
|
||||||
|
<AiOpenData v-if="info.releaseName" type="userName" :openid="info.releaseName" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-flex" v-if="info.releaseName">
|
<div class="item-flex" v-if="info.releaseName">
|
||||||
<div class="label">异常解除时间</div>
|
<div class="label">异常解除时间</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user