tianyi 4 weeks ago
parent
commit
307d2092ac
  1. 36
      pages/index/index.vue

36
pages/index/index.vue

@ -932,13 +932,6 @@
regionId: JSON.parse(uni.getStorageSync('area')).id, regionId: JSON.parse(uni.getStorageSync('area')).id,
geolocation: that.latitude + ',' + that.longitude geolocation: that.latitude + ',' + that.longitude
} }
uni.getLocation({
type: 'gcj02', //
isHighAccuracy:true,
success: (res) => {
console.log('位置', res)
that.latitude = res.latitude;
that.longitude = res.longitude;
that.tui.request("/mall/delivery/accept", "POST", data, false, true).then((res) => { that.tui.request("/mall/delivery/accept", "POST", data, false, true).then((res) => {
that.loadStatus = 'nomore'; that.loadStatus = 'nomore';
@ -959,6 +952,9 @@
that.paotuiCount -= 1 that.paotuiCount -= 1
} }
} }
setTimeout(res => {
this.getUserLocation(uni.getStorageSync('worker') ? uni.getStorageSync('worker').workerId : res.result.workerId)
}, 2000)
that.$forceUpdate(); that.$forceUpdate();
} else { } else {
that.tui.toast(res.message); that.tui.toast(res.message);
@ -966,11 +962,6 @@
} }
uni.hideLoading(); uni.hideLoading();
}).catch((res) => {}); }).catch((res) => {});
},
fail: (err) => {
console.log('获取位置失败', err);
}
});
}, },
rejectOrder(item, index) { rejectOrder(item, index) {
@ -1184,9 +1175,23 @@
this.getDelivery(); this.getDelivery();
}, },
// //
getUserLocation() { getUserLocation(id) {
let that = this; let that = this;
uni.getLocation({
type: 'gcj02', //
isHighAccuracy:true,
success: (res) => {
console.log('位置', res)
that.latitude = res.latitude;
that.longitude = res.longitude;
that.tui.request('/worker/admin/editLocation', "POST", {workerId:id,geolocation:that.latitude + ',' + that.longitude}, false, false,false).then((res) => {
}).catch((res) => {});
},
fail: (err) => {
console.log('获取位置失败', err);
}
});
}, },
checkTab1(type) { checkTab1(type) {
this.checked = type this.checked = type
@ -1275,12 +1280,7 @@
this.indexInit() this.indexInit()
break; break;
case 1: case 1:
let worker = uni.getStorageSync('worker')
if (worker == '' || worker == undefined || worker == null) {
this.tui.toast('您还没有注册兼职')
} else {
that.$refs.deLiveryPage.init() that.$refs.deLiveryPage.init()
}
break; break;
case 2: case 2:
uni.navigateTo({ uni.navigateTo({

Loading…
Cancel
Save