|
|
|
|
@ -86,47 +86,52 @@ |
|
|
|
|
success: (res) => { |
|
|
|
|
console.log(res.networkType); |
|
|
|
|
this.networkType = res.networkType; |
|
|
|
|
uni.getStorage({ |
|
|
|
|
key: 'token', |
|
|
|
|
success: (token) => { |
|
|
|
|
this.token = token.data; |
|
|
|
|
if (!e.id) { |
|
|
|
|
this.locationLoading = true |
|
|
|
|
if (res.networkType !== 'none') { |
|
|
|
|
uni.getLocation({ |
|
|
|
|
type: 'gcj02', |
|
|
|
|
success: (res) => { |
|
|
|
|
this.jd = res.longitude; |
|
|
|
|
this.wd = res.latitude; |
|
|
|
|
this.locationLoading = false |
|
|
|
|
}, |
|
|
|
|
fail: (error) => { |
|
|
|
|
this.locationLoading = false |
|
|
|
|
uni.showModal({ |
|
|
|
|
content: JSON.stringify(error), |
|
|
|
|
title: '定位失败' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
plus.geolocation.getCurrentPosition((res) => { |
|
|
|
|
this.jd = res.coords.longitude; |
|
|
|
|
this.wd = res.coords.latitude; |
|
|
|
|
this.locationLoading = false |
|
|
|
|
}, (error) => { |
|
|
|
|
this.locationLoading = false |
|
|
|
|
uni.showModal({ |
|
|
|
|
content: JSON.stringify(error), |
|
|
|
|
title: '定位失败' |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
this.id = e.id |
|
|
|
|
this.requestItem(e.id); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
fail(err) {}, |
|
|
|
|
complete: () => {} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
uni.getStorage({ |
|
|
|
|
key: 'token', |
|
|
|
|
success: (token) => { |
|
|
|
|
this.token = token.data; |
|
|
|
|
|
|
|
|
|
if (!e.id) { |
|
|
|
|
// uni.getLocation({ |
|
|
|
|
// type: 'wgs84', |
|
|
|
|
// success: (res) => { |
|
|
|
|
// this.jd = res.longitude; |
|
|
|
|
// this.wd = res.latitude; |
|
|
|
|
// } |
|
|
|
|
// }); |
|
|
|
|
this.locationLoading = true |
|
|
|
|
plus.geolocation.getCurrentPosition((res) => { |
|
|
|
|
this.jd = res.coords.longitude; |
|
|
|
|
this.wd = res.coords.latitude; |
|
|
|
|
this.locationLoading = false |
|
|
|
|
// resolve({ |
|
|
|
|
// lat: res.coords.latitude, |
|
|
|
|
// lng: res.coords.longitude |
|
|
|
|
// }); |
|
|
|
|
}, (error) => { |
|
|
|
|
this.locationLoading = false |
|
|
|
|
// uni.showToast({ |
|
|
|
|
// title: error.message, |
|
|
|
|
// duration: 3000, |
|
|
|
|
// icon: 'icon' |
|
|
|
|
// }); |
|
|
|
|
// reject(); |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
this.id = e.id |
|
|
|
|
this.requestItem(e.id); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
fail(err) {}, |
|
|
|
|
complete: () => {} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
delImg(index) { |
|
|
|
|
@ -153,7 +158,7 @@ |
|
|
|
|
const str = item.geom?.replace('POINT (', '').replace(')', ''); |
|
|
|
|
console.log(str) |
|
|
|
|
const strs = str.split(' '); |
|
|
|
|
this.jd = parseFloat(strs[0]); |
|
|
|
|
this.jd = parseFloat(strs[0]); |
|
|
|
|
this.wd = parseFloat(strs[1]); |
|
|
|
|
this.reason = item.reason; |
|
|
|
|
this.imgStrs = item.img?.split(','); |
|
|
|
|
|