uniapp超时提示加载状态
// 声明定时器变量(用于后续清除)
let timeoutId = null;
uni.showLoading({ title: '加载中...', mask: true });
// 设置3秒超时检测(单位:毫秒)
timeoutId = setTimeout(() => {
// 关闭Loading
uni.hideLoading();
// 显示超时提示
uni.showToast({
title: '请检查巡检设备定位是否开启',
icon: 'none',
duration: 2000
});
}, 5000); // 5000ms = 5秒
//关闭
uni.hideLoading();
最近访问时间:2025-06-04 01:06:32