Commit c9ff1478 authored by xinzhedeai's avatar xinzhedeai

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

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