tianyi 1 month ago
parent
commit
2c1b2e0eea
  1. 32
      pages/index/index.vue

32
pages/index/index.vue

@ -628,7 +628,7 @@
} }
that.searchForm.workerId = uni.getStorageSync('worker') ? uni.getStorageSync('worker').workerId : '' that.searchForm.workerId = uni.getStorageSync('worker') ? uni.getStorageSync('worker').workerId : ''
// //
this.getUserLocation(); // this.getUserLocation();
this.getUserOrders(); this.getUserOrders();
// WebSocket // WebSocket
this.getDeliveryLocation(); this.getDeliveryLocation();
@ -700,6 +700,7 @@
let that = this let that = this
this.tui.request("/mall/delivery/accept", "POST",data, false, true).then((res) => { this.tui.request("/mall/delivery/accept", "POST",data, false, true).then((res) => {
that.loadStatus = 'nomore'; that.loadStatus = 'nomore';
that.getUserLocation();
if (res.code == 200) { if (res.code == 200) {
if(!uni.getStorageSync('worker') && res.result != null){ if(!uni.getStorageSync('worker') && res.result != null){
uni.setStorageSync('worker',res.result) uni.setStorageSync('worker',res.result)
@ -918,22 +919,31 @@
}, },
// //
getUserLocation() { getUserLocation() {
let that = this;
uni.getLocation({ uni.getLocation({
type: 'gcj02', // type: 'gcj02', //
success: (res) => { success: (res) => {
console.log('位置', res) console.log('位置', res)
this.latitude = res.latitude; this.latitude = res.latitude;
this.longitude = res.longitude; this.longitude = res.longitude;
//
this.markers.push({ that.tui.request("/worker/admin/edit", "POST", {
id: 0, workerId:uni.getStorageSync('worker').workerId,
latitude: res.latitude, region:JSON.parse(uni.getStorageSync('area')).id,
longitude: res.longitude, geolocation:this.latitude + ',' + this.longitude
title: '我的位置', }, false, false).then((res) => {
iconPath: '/static/images/tabbar/fabu1.png', //
width: 30, }).catch((res) => {})
height: 30 // //
}); // this.markers.push({
// id: 0,
// latitude: res.latitude,
// longitude: res.longitude,
// title: '',
// iconPath: '/static/images/tabbar/fabu1.png', //
// width: 30,
// height: 30
// });
}, },
fail: (err) => { fail: (err) => {
console.log('获取位置失败', err); console.log('获取位置失败', err);

Loading…
Cancel
Save