Commit c9ff1478 authored by xinzhedeai's avatar xinzhedeai

add:我已阅读勾选+错误重复请求

parent aa23bf20
......@@ -145,7 +145,7 @@
</div>
<van-button type="info" size="small" plain
style="margin-top: 0.2rem;
width: 100%;" @click="showTipPopup = false">
width: 100%;" @click="showTipPopup = false,formData.check=true;">
关闭
</van-button>
</van-popup>
......
......@@ -33,9 +33,11 @@ window.addEventListener("load", function () {
companyName: '',
workerName: '',
startTime: '', // 开始时间字段
endTime: '' // 结束时间字段
endTime: '' ,// 结束时间字段
check: false
},
id: ''
id: '',
errorReqCount: 0,
}
},
created() {
......@@ -87,6 +89,7 @@ window.addEventListener("load", function () {
showTipPage() {
this.showTipPopup = true
this.formData.check = true
this.detail4Tip()
return
......@@ -99,12 +102,16 @@ window.addEventListener("load", function () {
// gemhoUtil.navigatePage(url, '跳转中...')
},
detail4Tip() { // 隐患详情
vant.Toast.loading({
message: '正在加载...',
forbidClick: true,
loadingType: 'spinner',
});
detail4Tip(param) { // 隐患详情
// vant.Toast.loading({
if(!param){ // 初次请求则显示加载框
vant.Toast.loading({
message: '正在加载...',
forbidClick: true,
loadingType: 'spinner',
});
}
http2.post({
serviceId: API_KEY_MAP["no-page"]['id'],
interfacePublicKey: API_KEY_MAP["no-page"]["publicKey"],
......@@ -114,6 +121,16 @@ window.addEventListener("load", function () {
workType: this.formData.workType,
}
}, (res) => {
if (!res) {
// 中台返回为undefined 重新请求
console.log('getRemindStatistic方法返回null!!')
if(this.errorReqCount <= 5){
this.errorReqCount++
this.detail4Tip('repeatReq') // 请求错误后,重新发起请求
}
return
}
if (res) {
console.log('接口回调数据', JSON.parse(res))
setTimeout(() => {
......@@ -135,6 +152,7 @@ window.addEventListener("load", function () {
// 新增:触发滚动条更新逻辑
this.updateScrollWrapper()
})
}
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment