讲所有本机定位替换为高德定位

This commit is contained in:
weipengfei 2024-03-05 14:43:37 +08:00
parent 3733c7370c
commit 85f7900792
29 changed files with 64 additions and 59 deletions

View File

@ -106,9 +106,9 @@
"sdkConfigs" : {
"maps" : {
"amap" : {
"appkey_ios" : "82af93ec51139c712c4118d84ba684ee",
"appkey_android" : "0799f37420c0784f1e6cba230a68bdb1",
"name" : "amap_18982406440DFVLElaO"
"appkey_ios" : "0a3202688624938fd5d2f37b52c30d5d",
"appkey_android" : "0354f5ddc11e2ea76c5aac647f44d945",
"name" : "amapIvoVHpJR"
}
},
"payment" : {
@ -127,12 +127,17 @@
"geolocation" : {
"amap" : {
"__platform__" : [ "ios", "android" ],
"appkey_ios" : "82af93ec51139c712c4118d84ba684ee",
"appkey_android" : "0799f37420c0784f1e6cba230a68bdb1",
"name" : "amap_18982406440DFVLElaO"
"appkey_ios" : "0a3202688624938fd5d2f37b52c30d5d",
"appkey_android" : "0354f5ddc11e2ea76c5aac647f44d945",
"name" : "amapIvoVHpJR"
}
},
"oauth" : {
"weixin" : {
"appid" : "wx9d68c92b550ddd1e",
"UniversalLinks" : "https://shop.lihaink.cn/"
}
},
"oauth" : {},
"ad" : {},
"push" : {},
"speech" : {}

View File

@ -274,7 +274,7 @@
uni.getLocation({
type: 'gcj02',
success: (res) => {
res = wgsToGcj(res);
// res = wgsToGcj(res);
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();

View File

@ -134,9 +134,9 @@
// #endif
if (uni.getStorageSync('RejectTarget')) return
uni.getLocation({
type: 'wgs84',
type: 'gcj02',
success: (res) => {
res = wgsToGcj(res);
// res = wgsToGcj(res);
try {
this.user_latitude = res.latitude;
this.user_longitude = res.longitude;

View File

@ -120,9 +120,9 @@
this.locationInfo.formatted_addresses = {};
this.locationInfo.formatted_addresses.recommend = '定位中'
uni.getLocation({
type: 'wgs84',
type: 'gcj02',
success: (res) => {
res = wgsToGcj(res);
// res = wgsToGcj(res);
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();

View File

@ -477,9 +477,9 @@
let self = this
if (uni.getStorageSync('RejectTarget')) return
uni.getLocation({
type: 'wgs84',
type: 'gcj02',
success: (res) => {
res = wgsToGcj(res);
// res = wgsToGcj(res);
// console.log(res)
let latitude, longitude;
latitude = res.latitude.toString();

View File

@ -451,10 +451,10 @@
})
})
} else uni.getLocation({
type: 'wgs84',
type: 'gcj02',
timeout: '10',
success: (res) => {
res = wgsToGcj(res);
// res = wgsToGcj(res);
// console.log(res)
this.isshow = false
let latitude, longitude;

View File

@ -225,9 +225,9 @@
},
selfLocation() {
uni.getLocation({
type: 'wgs84',
type: 'gcj02',
success: (res) => {
res = wgsToGcj(res);
// res = wgsToGcj(res);
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();

View File

@ -681,8 +681,7 @@
} else {
this.isshow = true
uni.setStorageSync('loction', true);
}
console.log(123123123);
};
// console.log(this.$store.state.storage.location);
if (this.$store?.state?.storage?.location?.lat) {
this.isshow = false
@ -715,9 +714,9 @@
})
})
} else uni.getLocation({
type: 'wgs84',
type: 'gcj02',
success: (res) => {
res = wgsToGcj(res);
// res = wgsToGcj(res);
this.isshow = false
let latitude, longitude;
latitude = res.latitude.toString();

View File

@ -664,10 +664,10 @@
},
uniLocation() {
uni.getLocation({
type: 'wgs84',
type: 'gcj02',
timeout: '1000',
success: (res) => {
res = wgsToGcj(res);
// res = wgsToGcj(res);
console.log('定位成功', res);
this.isshow = false
let latitude, longitude;

View File

@ -627,9 +627,9 @@
this.getStoreList();
})
} else uni.getLocation({
type: 'wgs84',
type: 'gcj02',
success: (res) => {
res = wgsToGcj(res);
// res = wgsToGcj(res);
console.log('定位');
let latitude, longitude;
latitude = res.latitude.toString();

View File

@ -626,9 +626,9 @@
this.getStoreList();
})
} else uni.getLocation({
type: 'wgs84',
type: 'gcj02',
success: (res) => {
res = wgsToGcj(res);
// res = wgsToGcj(res);
console.log('定位');
let latitude, longitude;
latitude = res.latitude.toString();

View File

@ -536,9 +536,9 @@
if (uni.getStorageSync('RejectTarget')) return
let self = this
uni.getLocation({
type: 'wgs84',
type: 'gcj02',
success: (res) => {
res = wgsToGcj(res);
// res = wgsToGcj(res);
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();

View File

@ -333,9 +333,9 @@
let self = this
if (uni.getStorageSync('RejectTarget')) return
uni.getLocation({
type: 'wgs84',
type: 'gcj02',
success: (res) => {
res = wgsToGcj(res);
// res = wgsToGcj(res);
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();

View File

@ -415,9 +415,9 @@
let self = this
if (uni.getStorageSync('RejectTarget')) return
uni.getLocation({
type: 'wgs84',
type: 'gcj02',
success: (res) => {
res = wgsToGcj(res);
// res = wgsToGcj(res);
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();

View File

@ -820,10 +820,10 @@
})
}
else uni.getLocation({
type: 'wgs84',
type: 'gcj02',
success: (res) => {
console.log('定位');
res = wgsToGcj(res);
// res = wgsToGcj(res);
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();

View File

@ -598,9 +598,9 @@
})
}
else uni.getLocation({
type: 'wgs84',
type: 'gcj02',
success: (res) => {
res = wgsToGcj(res);
// res = wgsToGcj(res);
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();

View File

@ -661,10 +661,10 @@
})
}
else uni.getLocation({
type: 'wgs84',
type: 'gcj02',
success: (res) => {
console.log('定位');
res = wgsToGcj(res);
// res = wgsToGcj(res);
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();

View File

@ -461,9 +461,9 @@
selfLocation() {
let self = this
uni.getLocation({
type: 'wgs84',
type: 'gcj02',
success: (res) => {
res = wgsToGcj(res);
// res = wgsToGcj(res);
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();

View File

@ -538,9 +538,9 @@
let self = this
if (uni.getStorageSync('RejectTarget')) return
uni.getLocation({
type: 'wgs84',
type: 'gcj02',
success: (res) => {
res = wgsToGcj(res);
// res = wgsToGcj(res);
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();

View File

@ -424,9 +424,9 @@
selfLocation() {
uni.getLocation({
type: 'wgs84',
type: 'gcj02',
success: (res) => {
res = wgsToGcj(res);
// res = wgsToGcj(res);
// console.log(res);
this.latitude = res.latitude.toString();
this.longitude = res.longitude.toString();

View File

@ -110,7 +110,7 @@
getLoaction() {
this.street = '定位中'
uni.getLocation({
type: 'wgs84',
type: 'gcj02',
timeout: '10',
success: (res) => {
res = wgsToGcj(res);

View File

@ -115,10 +115,11 @@
this.locationInfo = {};
this.locationInfo.formatted_addresses = {};
this.locationInfo.formatted_addresses.recommend = '定位中'
uni.setStorageSync('RejectTarget', false);
uni.getLocation({
type: 'wgs84',
type: 'gcj02',
success: (res) => {
res = wgsToGcj(res);
// res = wgsToGcj(res);
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();

View File

@ -419,9 +419,9 @@
selfLocation() {
let self = this
uni.getLocation({
type: 'wgs84',
type: 'gcj02',
success: (res) => {
res = wgsToGcj(res);
// res = wgsToGcj(res);
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();

View File

@ -657,10 +657,10 @@ import activityCard from "@/components/activityCard.vue"
})
})
} else uni.getLocation({
type: 'wgs84',
type: 'gcj02',
timeout: '10',
success: (res) => {
res = wgsToGcj(res);
// res = wgsToGcj(res);
this.isshow = false
let latitude, longitude;
latitude = res.latitude.toString();

View File

@ -164,9 +164,9 @@
// }
if (uni.getStorageSync('RejectTarget')) return
uni.getLocation({
type: 'wgs84',
type: 'gcj02',
success: function(res) {
res = wgsToGcj(res);
// res = wgsToGcj(res);
try {
uni.setStorageSync('user_latitude', res.latitude);
uni.setStorageSync('user_longitude', res.longitude);

View File

@ -74,7 +74,7 @@ import { Toast } from '../../../libs/uniApi';
onLoad() {
this.getQrcode();
this.getList();
this.getUserInfo()
this.getUserInfo();
},
/**
* 页面上拉触底事件的处理函数

View File

@ -285,7 +285,7 @@
});
if (uni.getStorageSync('RejectTarget')) return
uni.getLocation({
type: 'wgs84',
type: 'gcj02',
success: (res) => {
res = wgsToGcj(res);
let latitude, longitude;

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@ export const test = () => {
export const uniMPgetLocation = () => {
return new Promise((resolve, reject) => {
uni.getLocation({
type: 'wgs84',
type: 'gcj02',
geocode: true,
isHighAccuracy: true,
// altitude: true,