This commit is contained in:
shidongli 2024-01-09 11:41:44 +08:00
parent 9829e24529
commit a8ca5bd533
2 changed files with 24 additions and 17 deletions

View File

@ -140,10 +140,10 @@
},
//
fail: (res) => {
uni.showToast({
icon: 'none',
title: '获取地址失败,请打开定位',
})
// uni.showToast({
// icon: 'none',
// title: ',',
// })
}
})
},

View File

@ -98,8 +98,10 @@
pageNum: 1,
pageSize: 10,
total: 0,
latitude: 39.90374,
longitude: 116.397827,
// latitude: 39.90374,
// longitude: 116.397827,
latitude:'',
longitude:'',
nurseClassId: '', //id
itemClassId: '', //id
searchName: '', //
@ -190,6 +192,7 @@
success: function(res) {
that.latitude = res.latitude
that.longitude = res.longitude
that.mask = false
}
});
@ -278,23 +281,27 @@
const value = uni.getStorageSync('patientId');
if (value) {
getPatientInfo(value).then(res => {
console.log(res)
if (res.code == 200) {
if (res.data.homeLatitude && res.data.homeLongitude) {
that.latitude = res.data.homeLatitude
that.longitude = res.data.homeLongitude
that.requestinfo();
} else {
uni.getLocation({
type: 'wgs84',
success: function(resp) {
that.latitude = resp.latitude
that.longitude = resp.longitude
that.requestinfo();
},
fail(err) {
that.mask = true;
}
});
that.requestinfo();
// uni.getLocation({
// type: 'wgs84',
// success: function(resp) {
// that.latitude = resp.latitude
// that.longitude = resp.longitude
// console.log(that.latitude,that.longitude)
// that.requestinfo();
// },
// fail(err) {
// that.mask = true;
// }
// });
}
} else if (res.code == 9999) {} else {
that.requestinfo();