|
|
@ -187,7 +187,7 @@ |
|
|
|
</u-input> |
|
|
|
<button v-if="btnText" @click="btnFun" class="cu-btn bg-green shadow">{{btnText}}</button> |
|
|
|
</view> |
|
|
|
<view v-else-if="type=='map'" class="map plant-dingweixiao" :class="{noData:true}" @click="showMap=true">选择经纬度</view> |
|
|
|
<view v-else-if="type=='map'" class="map plant-dingweixiao" :class="{noData:true}" @click="openMap">选择经纬度</view> |
|
|
|
<view v-else-if="type=='select'" class="plant-youbian" :class="{noData: !value[0]}" @click="show=true">{{pickerContent}}</view> |
|
|
|
<u-upload v-else-if="type=='upImg'" :fileList="imgs" previewFullImage multiple :maxCount="num" @delete="delImg" @afterRead="afterRead"> |
|
|
|
<view class="album"> |
|
|
@ -332,7 +332,9 @@ import {dataType} from 'black-knight/lib/config/tools' |
|
|
|
show:false, |
|
|
|
dateType:"start", |
|
|
|
imgList:[], |
|
|
|
|
|
|
|
showMap:false, |
|
|
|
maps:null, |
|
|
|
} |
|
|
|
}, |
|
|
|
watch:{ |
|
|
@ -379,38 +381,6 @@ import {dataType} from 'black-knight/lib/config/tools' |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted(){ |
|
|
|
/* #ifdef APP-PLUS */ |
|
|
|
this.$nextTick(()=>{ |
|
|
|
if(this.type=='amp'){ |
|
|
|
var a=uni.createMapContext("amap",this) |
|
|
|
|
|
|
|
var maps=a.$getAppMap() |
|
|
|
maps.setMapType(plus.maps.MapType.MAPTYPE_SATELLITE) |
|
|
|
maps.onclick=(e)=>{ |
|
|
|
console.log(e,'-------maps--click---------') |
|
|
|
} |
|
|
|
var polygon=new plus.maps.Polygon([ |
|
|
|
new plus.maps.Point(116.39524,39.925301), |
|
|
|
new plus.maps.Point(116.400444,39.925285), |
|
|
|
new plus.maps.Point(116.400558,39.923282), |
|
|
|
new plus.maps.Point(116.395502,39.923082), |
|
|
|
]) |
|
|
|
polygon.setLineWidth(2) |
|
|
|
polygon.setStrokeColor("#10C176") |
|
|
|
polygon.setFillColor("#10C176") |
|
|
|
polygon.setFillOpacity(0.3) |
|
|
|
maps.addOverlay(polygon) |
|
|
|
|
|
|
|
var marker=new plus.maps.Marker(new plus.maps.Point(116.396137,39.924055)); |
|
|
|
marker.setIcon("/static/tab_home.png"); |
|
|
|
marker.bringToTop() |
|
|
|
marker.setDraggable(true) |
|
|
|
maps.addOverlay(marker); |
|
|
|
} |
|
|
|
}) |
|
|
|
/* #endif */ |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
async afterRead(e){ |
|
|
|
this.imgList=this.imgList.concat(e.file.map(v=>Object.assign(v,{ |
|
|
@ -451,6 +421,36 @@ import {dataType} from 'black-knight/lib/config/tools' |
|
|
|
this.$refs.picker.setColumnValues(e.columnIndex+1,e.value[0].children) |
|
|
|
} |
|
|
|
}, |
|
|
|
openMap(){ |
|
|
|
/* #ifdef APP-PLUS */ |
|
|
|
this.showMap=true |
|
|
|
if(!this.maps){ |
|
|
|
var amap=uni.createMapContext("amap",this) |
|
|
|
this.maps=amap.$getAppMap() |
|
|
|
this.maps.setMapType(plus.maps.MapType.MAPTYPE_SATELLITE) |
|
|
|
this.maps.onclick=(e)=>{ |
|
|
|
console.log(e,'-------maps--click---------') |
|
|
|
} |
|
|
|
var polygon=new plus.maps.Polygon([ |
|
|
|
new plus.maps.Point(116.39524,39.925301), |
|
|
|
new plus.maps.Point(116.400444,39.925285), |
|
|
|
new plus.maps.Point(116.400558,39.923282), |
|
|
|
new plus.maps.Point(116.395502,39.923082), |
|
|
|
]) |
|
|
|
polygon.setLineWidth(2) |
|
|
|
polygon.setStrokeColor("#10C176") |
|
|
|
polygon.setFillColor("#10C176") |
|
|
|
polygon.setFillOpacity(0.3) |
|
|
|
this.maps.addOverlay(polygon) |
|
|
|
|
|
|
|
var marker=new plus.maps.Marker(new plus.maps.Point(116.396137,39.924055)); |
|
|
|
marker.setIcon("/static/tab_home.png"); |
|
|
|
marker.bringToTop() |
|
|
|
marker.setDraggable(true) |
|
|
|
this.maps.addOverlay(marker); |
|
|
|
} |
|
|
|
/* #endif */ |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
</script> |