Commit 9f9b5168 authored by xinzhedeai's avatar xinzhedeai

中台偶发加载问题处理

parent 226d247d
......@@ -13,7 +13,7 @@ window.addEventListener("load", function() {
loading: false,
finished: false,
page: 0,
size: 9999,
size: 99,
total: 0
}
},
......@@ -34,6 +34,11 @@ window.addEventListener("load", function() {
gemhoUtil.navigatePage('./dw-list-detail.html?dwId='+item.id+'&type=edit')
},
getList(){
vant.Toast.loading({
message: '正在加载...',
forbidClick: true,
loadingType: 'spinner',
});
setTimeout(() => {
http2.post({
serviceId: API_KEY_MAP["dw-list"]['id'],
......@@ -45,7 +50,11 @@ window.addEventListener("load", function() {
sort: 'id,desc',
}
}, (res) => {
if(!res){ // 中台返回为undefined 重新请求
this.page = this.page - 1 // 重新请求后,分页数恢复上一次请求的值
this.getList()
return
}
if(res){
// console.log('接口回调数据', JSON.parse(res))
......@@ -59,6 +68,7 @@ window.addEventListener("load", function() {
}
}
this.loading = false
vant.Toast.clear()
this.$nextTick(()=>{
// 滚动条跳转位置
window.scrollTo(0, gemhoUtil.getCookie('scrollPosition'));
......
......@@ -40,6 +40,11 @@ window.addEventListener("load", function() {
this.getList()
},
getList() {
vant.Toast.loading({
message: '正在加载...',
forbidClick: true,
loadingType: 'spinner',
});
setTimeout(() => {
http2.post({
serviceId: API_KEY_MAP["emergency"]['id'],
......@@ -55,7 +60,11 @@ window.addEventListener("load", function() {
planName: this.planName,
}
}, (res) => {
if(!res){ // 中台返回为undefined 重新请求
this.page = this.page - 1 // 重新请求后,分页数恢复上一次请求的值
this.getList()
return
}
if (res) {
// console.log('接口回调数据', JSON.parse(res))
......@@ -69,6 +78,7 @@ window.addEventListener("load", function() {
}
}
this.loading = false
vant.Toast.clear()
this.$nextTick(()=>{
// 滚动条跳转位置
window.scrollTo(0, gemhoUtil.getCookie('scrollPosition'));
......
......@@ -25,6 +25,11 @@ window.addEventListener("load", function() {
gemhoUtil.navigatePage('./law-list-detail.html?law_id=' + this.list[index].lawId)
},
getList() {
vant.Toast.loading({
message: '正在加载...',
forbidClick: true,
loadingType: 'spinner',
});
setTimeout(() => {
http2.post({
serviceId: API_KEY_MAP["law-list"]['id'],
......@@ -37,7 +42,11 @@ window.addEventListener("load", function() {
sort: 'lawId,desc',
}
}, (res) => {
if(!res){ // 中台返回为undefined 重新请求
this.page = this.page - 1 // 重新请求后,分页数恢复上一次请求的值
this.getList()
return
}
if (res) {
// console.log('接口回调数据', JSON.parse(res))
......@@ -50,6 +59,7 @@ window.addEventListener("load", function() {
}
}
this.loading = false
vant.Toast.clear()
this.$nextTick(()=>{
// 滚动条跳转位置
window.scrollTo(0, gemhoUtil.getCookie('scrollPosition'));
......
......@@ -26,6 +26,11 @@ window.addEventListener("load", function() {
gemhoUtil.navigatePage('./law-lv2.html?pid=' + item.id)
},
getList() {
vant.Toast.loading({
message: '正在加载...',
forbidClick: true,
loadingType: 'spinner',
});
setTimeout(() => {
http2.post({
serviceId: API_KEY_MAP["law-lv"]['id'],
......@@ -37,7 +42,11 @@ window.addEventListener("load", function() {
// sort: 'createTime,desc',
}
}, (res) => {
if(!res){ // 中台返回为undefined 重新请求
this.page = this.page - 1 // 重新请求后,分页数恢复上一次请求的值
this.getList()
return
}
if (res) {
// console.log('接口回调数据', JSON.parse(res))
......@@ -51,6 +60,7 @@ window.addEventListener("load", function() {
}
}
this.loading = false
vant.Toast.clear()
this.$nextTick(()=>{
// 滚动条跳转位置
window.scrollTo(0, gemhoUtil.getCookie('scrollPosition'));
......
......@@ -25,6 +25,11 @@ window.addEventListener("load", function() {
gemhoUtil.navigatePage('./law-list.html?category_id=' + category_id)
},
getList() {
vant.Toast.loading({
message: '正在加载...',
forbidClick: true,
loadingType: 'spinner',
});
setTimeout(() => {
http2.post({
serviceId: API_KEY_MAP["law-lv"]['id'],
......@@ -37,7 +42,11 @@ window.addEventListener("load", function() {
// sort: 'createTime,desc',
}
}, (res) => {
if(!res){ // 中台返回为undefined 重新请求
this.page = this.page - 1 // 重新请求后,分页数恢复上一次请求的值
this.getList()
return
}
if (res) {
// console.log('接口回调数据', JSON.parse(res))
......@@ -54,6 +63,7 @@ window.addEventListener("load", function() {
}
}
this.loading = false
vant.Toast.clear()
this.$nextTick(()=>{
// 滚动条跳转位置
window.scrollTo(0, gemhoUtil.getCookie('scrollPosition'));
......
......@@ -27,6 +27,11 @@ window.addEventListener("load", function() {
.noticeId)
},
getList() {
vant.Toast.loading({
message: '正在加载...',
forbidClick: true,
loadingType: 'spinner',
});
setTimeout(() => {
http2.post({
serviceId: API_KEY_MAP["notice-list"]['id'],
......@@ -38,7 +43,11 @@ window.addEventListener("load", function() {
// sort: 'noticeId,desc',
}
}, (res) => {
if(!res){ // 中台返回为undefined 重新请求
this.page = this.page - 1 // 重新请求后,分页数恢复上一次请求的值
this.getList()
return
}
if (res) {
// console.log('接口回调数据', JSON.parse(res))
......@@ -52,6 +61,7 @@ window.addEventListener("load", function() {
}
}
this.loading = false
vant.Toast.clear()
this.$nextTick(()=>{
// 滚动条跳转位置
window.scrollTo(0, gemhoUtil.getCookie('scrollPosition'));
......
......@@ -28,6 +28,11 @@ window.addEventListener("load", function() {
gemhoUtil.navigatePage('./yh-list-detail.html?hdId=' + item.hdId + '&type=edit')
},
getList() {
vant.Toast.loading({
message: '正在加载...',
forbidClick: true,
loadingType: 'spinner',
});
setTimeout(() => {
http2.post({
serviceId: API_KEY_MAP["yh-list"]['id'],
......@@ -39,6 +44,11 @@ window.addEventListener("load", function() {
sort: 'hdId,desc',
}
}, (res) => {
if(!res){ // 中台返回为undefined 重新请求
this.page = this.page - 1 // 重新请求后,分页数恢复上一次请求的值
this.getList()
return
}
if (res) {
var result = JSON.parse(res)
this.list.push(...result.content);
......@@ -49,6 +59,7 @@ window.addEventListener("load", function() {
}
}
this.loadFlag = false
vant.Toast.clear()
// console.log('响应结束',this.total, this.list.length)
this.$nextTick(()=>{
// 滚动条跳转位置
......
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