Commit 9744d1fe authored by 刘用法's avatar 刘用法

经纬度计算,接单

parent 47c6f6c8
...@@ -53,7 +53,7 @@ let orderApiFun = function(vm){ ...@@ -53,7 +53,7 @@ let orderApiFun = function(vm){
/** /**
* 接单 * 接单
*/ */
let orderAccept = async (params = {},orderId) => await vm.$u.post(prefix + vm.vuex_token+'/order/'+orderId+'/accept', params); let orderAccept = async (params = {},orderId) => await vm.$u.post(prefix + vm.vuex_token+'/order/'+orderId+'/accept', params, {'content-type': 'application/x-www-form-urlencoded'});
/** /**
* 抢单 * 抢单
......
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
location: { // 当前坐标 location: { // 当前坐标
type: Array, type: Array,
default () { default () {
return [116.3896, 39.91917] // 经度,纬 return [116.3896, 39.91917] // 纬度,经
} }
} }
}, },
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
return this.orderType == 5 return this.orderType == 5
}, },
showDistance() { showDistance() {
return this.orderType == 0 && this.orderData.contactAddressLatitud && this.orderData.contactAddressLongitud && this.location[0] && this.location[1] return this.orderType == 0 && this.location.length >= 2
}, },
types() { types() {
return { return {
...@@ -210,6 +210,7 @@ ...@@ -210,6 +210,7 @@
} }
}, },
orderDistance() { orderDistance() {
console.log('orderData.contactAddressLatitud:',this.orderData.contactAddressLatitud,'orderData.contactAddressLongitud',this.orderData.contactAddressLongitud, 'location:',this.location[0], this.location[1])
return this.distance(this.orderData.contactAddressLatitud,this.orderData.contactAddressLongitud, this.location[0], this.location[1]) return this.distance(this.orderData.contactAddressLatitud,this.orderData.contactAddressLongitud, this.location[0], this.location[1])
} }
}, },
......
...@@ -374,7 +374,7 @@ ...@@ -374,7 +374,7 @@
uni.getLocation({ uni.getLocation({
type: 'gcj02', type: 'gcj02',
success: function(res) { success: function(res) {
self.location = [res.longitude, res.latitude] self.location = [res.latitude, res.longitude]
}, },
complete: function(res) { complete: function(res) {
if (res.errMsg.indexOf('auth') != -1) { if (res.errMsg.indexOf('auth') != -1) {
......
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