diff --git a/yt_suishijiang/pages/index/index.vue b/yt_suishijiang/pages/index/index.vue index 06ec8f7..2c029df 100644 --- a/yt_suishijiang/pages/index/index.vue +++ b/yt_suishijiang/pages/index/index.vue @@ -386,10 +386,26 @@ export default { ? "https://lantu.ytyanhuo.com" : ""; console.log("sdfsf"); + let timeoutFlag = false; + let timeoutId = setTimeout(() => { + if (!timeoutFlag) { + timeoutFlag = true; + console.log("获取位置超时"); + uni.hideLoading(); + uni.showModal({ + title: "温馨提示", + content: "获取位置超时,请打开手机定位", + confirmText: "确定", + showCancel: false, + }); + } + + }, 10000); // 设置超时时间为3秒 uni.getLocation({ type: "gcj02", geocode: true, success(res) { + clearTimeout(timeoutId); _this.setData({ curAddress: res.address, locations: { @@ -417,24 +433,25 @@ export default { }); }, fail() { - uni.showModal({ - title: "温馨提示", - content: "提交随手拍需要获取您的位置信息", - confirmText: "确定", - success: (result) => { - if (result.confirm) { - console.log(this); - console.log(_this); - _this.getLocation(); - } - }, - fail() { - uni.hideLoading(); - uni.alert({ - title: "事件上报需要您的位置,请打开定位。", - }); - }, - }); + clearTimeout(timeoutId); + // uni.showModal({ + // title: "温馨提示", + // content: "提交随手拍需要获取您的位置信息", + // confirmText: "确定", + // success: (result) => { + // if (result.confirm) { + // console.log(this); + // console.log(_this); + // _this.getLocation(); + // } + // }, + // fail() { + // uni.hideLoading(); + // uni.alert({ + // title: "事件上报需要您的位置,请打开定位。", + // }); + // }, + // }); }, }); // uni.showLoading(); diff --git a/yt_suishijiang/unpackage/dist/build/.automator/h5/.automator.json b/yt_suishijiang/unpackage/dist/build/.automator/h5/.automator.json deleted file mode 100644 index e69de29..0000000 diff --git a/yt_suishijiang/unpackage/dist/build/h5-suishijiang/index.html b/yt_suishijiang/unpackage/dist/build/h5-suishijiang/index.html index a2572c5..c566c4c 100644 --- a/yt_suishijiang/unpackage/dist/build/h5-suishijiang/index.html +++ b/yt_suishijiang/unpackage/dist/build/h5-suishijiang/index.html @@ -1,2 +1,2 @@