|
@@ -47,7 +47,7 @@ var vNode = {
|
|
|
loadingSun : true
|
|
|
},
|
|
|
reqCount: 0,
|
|
|
- test: 0
|
|
|
+ timer: null
|
|
|
}
|
|
|
|
|
|
},
|
|
@@ -102,7 +102,7 @@ var vNode = {
|
|
|
that.reqCount++;
|
|
|
if(res.data && Object.keys(res.data).length > 0) {
|
|
|
that.chartLoading = false;
|
|
|
- console.log(that.reqCount,'that.reqCount')
|
|
|
+ // console.log(that.reqCount,'that.reqCount')
|
|
|
// 招标动态数据
|
|
|
if (res.data.topProject && res.data.topProject.length && res.data.topProject.length > 0) {
|
|
|
// 按时间降序排序
|
|
@@ -176,19 +176,27 @@ var vNode = {
|
|
|
} else {
|
|
|
that.isShow.showSun = false;
|
|
|
}
|
|
|
+ // 清除定时器
|
|
|
+ clearTimeout(that.timer)
|
|
|
} else {
|
|
|
console.log(that.reqCount)
|
|
|
- if(that.reqCount < 3) {
|
|
|
- that.getChartData('other')
|
|
|
+ if(that.reqCount < 15) {
|
|
|
+ that.timer = setTimeout(function() {
|
|
|
+ that.getChartData('other')
|
|
|
+ }, 1500)
|
|
|
} else {
|
|
|
- console.log('请求了两次仍获取不到数据,不再请求')
|
|
|
+ console.log('请求了仍获取不到数据,不再请求')
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- if(that.reqCount < 3) {
|
|
|
- that.getChartData('')
|
|
|
+ if(that.reqCount < 15) {
|
|
|
+ that.timer = setTimeout(function() {
|
|
|
+ that.getChartData('')
|
|
|
+ }, 1500)
|
|
|
} else {
|
|
|
- console.log('请求了两次仍获取不到数据,不再请求')
|
|
|
+ console.log('请求了仍获取不到数据,不再请求')
|
|
|
+ clearTimeout(that.timer);
|
|
|
+ history.back();
|
|
|
}
|
|
|
}
|
|
|
|