From 732ce771396246cdf94b9c76c821185f64f20cff Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp Date: Mon, 6 Feb 2023 09:06:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9C=B0=E5=9B=BE=E7=BC=96?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/utils.js | 2 +- uni_modules/d-form/components/d-form/d-form.vue | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/common/utils.js b/common/utils.js index c778ace..8502592 100644 --- a/common/utils.js +++ b/common/utils.js @@ -1,4 +1,4 @@ -export var computeArea=function(val){ +export var computeArea=function(val,reat){ var longitude={ min: Math.min(...val.map(v=>v.longitude)), max: Math.max(...val.map(v=>v.longitude)), diff --git a/uni_modules/d-form/components/d-form/d-form.vue b/uni_modules/d-form/components/d-form/d-form.vue index 5afae79..bf54bf7 100644 --- a/uni_modules/d-form/components/d-form/d-form.vue +++ b/uni_modules/d-form/components/d-form/d-form.vue @@ -248,7 +248,7 @@ :insert="false" lunar @confirm="$emit('input',$event.fulldate)"/> - + @@ -404,11 +404,6 @@ import {computeArea} from '@/common/utils' setPickerCol.bind(this.$refs.picker)(this.columns[0]||[],this.value,1) }) } - this.$nextTick(()=>{ - uni.$u.getRect(".amap").then(res=>{ - console.log(res,'---res----') - }) - }) }, methods:{ async afterRead(e){ @@ -459,10 +454,9 @@ import {computeArea} from '@/common/utils' var amap=uni.createMapContext("amap",this) this.maps=amap.$getAppMap() this.maps.setMapType(plus.maps.MapType.MAPTYPE_SATELLITE) - this.maps.centerAndZoom(new plus.maps.Point(102.712251,25.040609),10) if(this.value.length>0){ - var bound=computeArea(this.value) + var bound=computeArea(this.value,this.reat) for(var i=0;i{ + console.log("zoom",this.maps.getZoom()) this.markerList.length<=0 && this.maps.addOverlay(polyline) if(this.value.length<=0){