const index = successCallbackIds.indexOf(callbackId);
if (index >= 0) {
callbackIds$2.splice(index, 1);
} else {
callbackOffErrorIds.forEach(callbackId => {
invoke$1(callbackId, {
errMsg: 'offLocationChange:fail'
});
});
successCallbackIds.splice(index, 1);
}
} else {
callbackIds$2.length = 0;
successCallbackIds = [];
}
}
// 移除实时地理位置变化事件的监听函数
function onLocationChangeError (callbackId) {
errorCallbackIds.push(callbackId);
}
function offLocationChangeError (callbackId) {
callbackOffErrorIds.push(callbackId);
if (callbackId) {
const index = errorCallbackIds.indexOf(callbackId);
if (index >= 0) {
errorCallbackIds.splice(index, 1);
}
} else {
errorCallbackIds = [];
}
}
const RECORD_TIME = 60 * 60 * 1000;
...
...
@@ -12321,8 +12315,8 @@ var serviceContext = (function () {
startLocationUpdate: startLocationUpdate,
stopLocationUpdate: stopLocationUpdate,
onLocationChange: onLocationChange,
onLocationChangeError: onLocationChangeError,
offLocationChange: offLocationChange,
onLocationChangeError: onLocationChangeError,
offLocationChangeError: offLocationChangeError,
startRecord: startRecord,
stopRecord: stopRecord,
...
...
@@ -20743,6 +20737,7 @@ var serviceContext = (function () {
});
const callbacks$7 = [];
const oldCallbacks = [];
onMethod('onThemeChange', function (res) {
callbacks$7.forEach(callbackId => {
...
...
@@ -20756,13 +20751,13 @@ var serviceContext = (function () {
// 旧版本 API,后期文档更新后考虑移除
onMethod('onUIStyleChange', function (res) {
callbacks$7.forEach(callbackId => {
oldCallbacks.forEach(callbackId => {
invoke$1(callbackId, res);
});
});
function onUIStyleChange (callbackId) {
callbacks$7.push(callbackId);
oldCallbacks.push(callbackId);
console.warn('The "uni.onUIStyleChange" API is deprecated, please use "uni.onThemeChange". Learn more: https://uniapp.dcloud.net.cn/api/system/theme.');