Commit f8ec0ca4 authored by 郭晓清's avatar 郭晓清

1、签到距离计算

parent 745f7164
...@@ -247,7 +247,7 @@ ...@@ -247,7 +247,7 @@
} }
this.loadOrderDetail() this.loadOrderDetail()
this.loadOrderRecord() this.loadOrderRecord()
this.getLocation() // this.getLocation()
this.getSignDistance() this.getSignDistance()
}, },
onHide() { onHide() {
...@@ -321,6 +321,11 @@ ...@@ -321,6 +321,11 @@
}, },
_locationChangeFn(res) { _locationChangeFn(res) {
console.log('location change', res) console.log('location change', res)
const dataValue = this.dataValue || []
dataValue.push(res.longitude)
dataValue.push(res.latitude)
self.dataValue = dataValue
if(this.getDistance(res.latitude,res.longitude)>this.signDistance){ if(this.getDistance(res.latitude,res.longitude)>this.signDistance){
// 计算签到距离 // 计算签到距离
this.btnClass = "isGan-btn" this.btnClass = "isGan-btn"
...@@ -599,7 +604,7 @@ ...@@ -599,7 +604,7 @@
}else{ }else{
this.closeLocationChange() this.closeLocationChange()
} }
if(this.getDistance(this.order.contactAddressLatitud,this.order.contactAddressLongitud)>this.signDistance){ if(this.getDistance() > this.signDistance){
this.commonToast('签到失败,请点击异常签到处理或联系客服','error') this.commonToast('签到失败,请点击异常签到处理或联系客服','error')
return return
} }
...@@ -727,7 +732,7 @@ ...@@ -727,7 +732,7 @@
}); });
}, },
getDistance(Latitud, Longitud){ getDistance(Latitud, Longitud){
return this.distance(Latitud,Longitud,this.dataValue[1],this.dataValue[0]) return this.distance(this.order.contactAddressLatitud,this.order.contactAddressLongitud,this.dataValue[1],this.dataValue[0])
}, },
/** /**
* echo distance(116.3896,39.91917,116.3940,39.91726); * echo distance(116.3896,39.91917,116.3940,39.91726);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment