فهرست منبع

待办接口有问题后切换其他方法

yin_yu820 2 سال پیش
والد
کامیت
33b680906c
1فایلهای تغییر یافته به همراه16 افزوده شده و 7 حذف شده
  1. 16 7
      src/views/tab_a/tabAll.vue

+ 16 - 7
src/views/tab_a/tabAll.vue

@@ -126,11 +126,14 @@ import toBeDone from '@/api/toBeDone/toBeDone';
 			//待办数据获取
 			dataNumber(){
 				new toBeDone().list().then((res)=>{
-					this.con1 = res.records.length;
+					this.sum1 = res.records.length;
+					this.sum=this.sum1+this.sum2;
 				})
 				new toBeDone().list2().then((res1)=>{
-					this.con2 = res1.records.length;
+					this.sum2 = res1.records.length;
+					this.sum=this.sum1+this.sum2;
 				})
+
 			},
 			onClickLeft(){
 				history.back();
@@ -200,7 +203,7 @@ import toBeDone from '@/api/toBeDone/toBeDone';
 						that.$store.commit('setUser',res.account);
 						that.getBannerImg();//获取轮播图
 						that.getSelectColor();//获取主题颜色
-						that.getStatistics();//获取待办事项数
+						that.dataNumber();//获取待办事项数
 					});
 
 					//})//上线取消注释
@@ -208,7 +211,7 @@ import toBeDone from '@/api/toBeDone/toBeDone';
 				}else{
 					that.getBannerImg();//获取轮播图
 					that.getSelectColor();//获取主题颜色
-					that.getStatistics();//获取待办事项数
+					that.dataNumber();//获取待办事项数
 				}
 
 
@@ -219,9 +222,15 @@ import toBeDone from '@/api/toBeDone/toBeDone';
 				new userSets()
 				.Statistics()
 				.then((res) => {
-					that.sum=res[0].sum;
-					that.sum1=res[0].sum1;
-					that.sum2=res[0].sum2;
+					if(res[0].sum!=undefined&&res[0].sum!=null&&res[0].sum!=""){
+						that.sum=res[0].sum;
+					}
+					if(res[0].sum1!=undefined&&res[0].sum1!=null&&res[0].sum1!=""){
+						that.sum1=res[0].sum1;
+					}
+					if(res[0].sum2!=undefined&&res[0].sum2!=null&&res[0].sum2!=""){
+						that.sum2=res[0].sum2;
+					}
 				});
 			},