Browse Source

bug修复

郭宇琦 6 days ago
parent
commit
62e34298cc
1 changed files with 13 additions and 6 deletions
  1. 13 6
      pages/index/index.vue

+ 13 - 6
pages/index/index.vue

@@ -296,8 +296,15 @@
 				path: 'pages/index/index',
 				path: 'pages/index/index',
 			}
 			}
 		},
 		},
+		onUnload() {
+			this.clearIntervalTimer()
+		},
 		methods: {
 		methods: {
-			
+			clearIntervalTimer() {
+				if (this.time == null) return
+				clearInterval(this.time)
+				this.time = null
+			},
 			init() {
 			init() {
 				
 				
 				this.loadModelList()
 				this.loadModelList()
@@ -485,11 +492,11 @@
 						} else {
 						} else {
 							this.isOverdueShow = false
 							this.isOverdueShow = false
 						}
 						}
-						// if(!this.time){
-						// 	this.time = setInterval(()=>{
-						// 		this.loadCarDetail(car_sn)
-						// 	},5000)
-						// }
+						if(!this.time){
+							this.time = setInterval(()=>{
+								this.loadCarDetail(car_sn)
+							},5000)
+						}
 					} else {
 					} else {
 						// common.simpleToast(resp.data.msg);
 						// common.simpleToast(resp.data.msg);
 					}
 					}