fix minp location

This commit is contained in:
xuecong 2021-12-02 17:54:32 +08:00
parent dd192b3426
commit 5f4ba844e1
3 changed files with 39 additions and 5 deletions

View File

@ -24,4 +24,4 @@ export const WECHAT_VERSION = '7.0.0';
export const SDK_VERSION = '2.16.0';
export const VERSION = '1.1.11';
export const VERSION = '1.1.12';

View File

@ -165,7 +165,19 @@ CwPage({
wx.getSetting({
success: res => {
if (res.authSetting['scope.userLocation']) {
if (res.authSetting['scope.userLocation'] === undefined) {
wx.authorize({
scope: 'scope.userLocation',
success: () => {
getLocationAndSend();
},
fail: () => {
$toast.fail({
message: '请授权位置'
});
}
});
} else if (res.authSetting['scope.userLocation'] === true) {
getLocationAndSend();
} else {
wx.openSetting({
@ -176,9 +188,14 @@ CwPage({
$toast.clear();
$toast.fail({
message: '不能使用位置'
message: '请打开位置'
});
}
},
fail: () => {
$toast.fail({
message: '请授权位置'
});
}
});
}

View File

@ -171,7 +171,19 @@ CwPage({
wx.getSetting({
success: res => {
if (res.authSetting['scope.userLocation']) {
if (res.authSetting['scope.userLocation'] === undefined) {
wx.authorize({
scope: 'scope.userLocation',
success: () => {
getLocationAndSend();
},
fail: () => {
$toast.fail({
message: '请授权位置'
});
}
});
} else if (res.authSetting['scope.userLocation'] === true) {
getLocationAndSend();
} else {
wx.openSetting({
@ -182,9 +194,14 @@ CwPage({
$toast.clear();
$toast.fail({
message: '不能使用位置'
message: '请打开位置'
});
}
},
fail: () => {
$toast.fail({
message: '请授权位置'
});
}
});
}