调整微信小程序的报错。

This commit is contained in:
cst61
2026-02-01 09:49:48 +08:00
parent cc01c4dc47
commit 802ffbb2f3
454 changed files with 62476 additions and 45 deletions

View File

@@ -0,0 +1,58 @@
"use strict";
const common_vendor = require("../../../common/vendor.js");
class Gps {
constructor(arg) {
this.lock = false;
}
async getLocation(param = {
type: "wgs84"
}) {
return new Promise(async (callback) => {
if (this.lock) {
callback(false);
return false;
}
this.lock = true;
common_vendor.index.getLocation({
...param,
success: (res) => {
this.lock = false;
callback(res);
},
fail: async (err) => {
common_vendor.index.showToast({
title: "定位获取失败",
icon: "none"
});
common_vendor.index.__f__("error", "at uni_modules/json-gps/js_sdk/gps.js:30", JSON.stringify(err));
callback(false);
if (err.errMsg == "getLocation:fail auth deny") {
common_vendor.index.showModal({
content: "应用无定位权限",
confirmText: "前往设置",
complete: (e) => {
if (e.confirm) {
common_vendor.index.openSetting({
success(res) {
common_vendor.index.__f__("log", "at uni_modules/json-gps/js_sdk/gps.js:46", res.authSetting);
}
});
}
this.lock = false;
}
});
}
if (err.errMsg == "getLocation:fail:ERROR_NOCELL&WIFI_LOCATIONSWITCHOFF") {
common_vendor.index.showModal({
content: "未开启定位权限,请前往手机系统设置中开启",
showCancel: false,
confirmText: "知道了"
});
}
}
});
});
}
}
exports.Gps = Gps;
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/uni_modules/json-gps/js_sdk/gps.js.map