Browse Source

每次进入首页都更新数据。

李天标 6 years ago
parent
commit
137232a684
2 changed files with 14 additions and 4 deletions
  1. 12 4
      pages/Charts/mainStatistics.vue
  2. 2 0
      pages/Login/Login.vue

+ 12 - 4
pages/Charts/mainStatistics.vue

@@ -105,6 +105,12 @@
 		// 	console.log("onLoad")
 		// 	this.init();
 		// },
+		onShow() {
+			var test = uni.getStorageSync('test');
+			if(test == 2){
+				this.init();
+			}
+		},
 		mounted() {
 			console.log("mounted")
 			this.init();
@@ -124,6 +130,7 @@
 				await this.initDateRang(new Date(),'week');
 				await this.initDateRang(new Date(),'month');
 				await this.initDateRang(new Date(),'year');
+				uni.setStorageSync('test', '2');
 			},
 			initDateRang(day,chartType) {
 				const daystr = dateUtils.formateDate(day, 'yyyy/MM/dd');
@@ -448,20 +455,21 @@
 	.qiun-title-dot-light {
 		border-left: 10upx solid #0ea391;
 		padding-left: 10upx;
+		font-family: "宋体";
 		font-size: 50upx;
-		color: #000000
+		color: #000000;
 	}
 	
 	.qiun-charts {
 		width: 750upx;
-		height: 430upx;
+		height: 500upx;
 		background-color: #FFFFFF;
 		margin: auto;
 	}
 	
 	.charts {
-		width: 600upx;
-		height: 430upx;
+		width: 750upx;
+		height: 500upx;
 		background-color: #FFFFFF;
 		margin: auto;
 	}

+ 2 - 0
pages/Login/Login.vue

@@ -36,6 +36,8 @@
 						// uni.redirectTo({
 						// 	url: '/pages/Charts/column',
 						// });
+						//标记刚登录跳转
+						uni.setStorageSync('test', '1');
 						uni.reLaunch({
 						    url: '/pages/Charts/mainStatistics',
 						});