wangfukang 4 days ago
parent
commit
157a52fa49
  1. 9
      components/worker/delivery.vue
  2. 3
      manifest.json
  3. 6
      pages/worker/index.vue

9
components/worker/delivery.vue

@ -844,6 +844,12 @@
// //
getUserLocation(item) { getUserLocation(item) {
if (!this.ensureLogin()) return if (!this.ensureLogin()) return
if (!item || !item.workerId) return
// #ifdef APP-PLUS
if (typeof plus == 'undefined' || !plus.geolocation) {
return
}
// #endif
let that = this; let that = this;
uni.getLocation({ uni.getLocation({
type: 'gcj02', type: 'gcj02',
@ -856,7 +862,8 @@
geolocation: that.latitude + ',' + that.longitude geolocation: that.latitude + ',' + that.longitude
}, false, 'post', 'application/x-www-form-urlencoded').then((res) => {}) }, false, 'post', 'application/x-www-form-urlencoded').then((res) => {})
} },
fail: () => {}
}); });
}, },
onReachPage() { onReachPage() {

3
manifest.json

@ -23,7 +23,8 @@
"modules" : { "modules" : {
"Camera" : {}, "Camera" : {},
"Bluetooth" : {}, "Bluetooth" : {},
"Push" : {} "Push" : {},
"Geolocation" : {}
}, },
/* */ /* */
"distribute" : { "distribute" : {

6
pages/worker/index.vue

@ -1146,6 +1146,12 @@
}, },
// //
getUserLocation(id) { getUserLocation(id) {
if (!id) return
// #ifdef APP-PLUS
if (typeof plus == 'undefined' || !plus.geolocation) {
return
}
// #endif
let that = this; let that = this;
uni.getLocation({ uni.getLocation({
type: 'gcj02', // type: 'gcj02', //

Loading…
Cancel
Save