lilei 4 gadi atpakaļ
vecāks
revīzija
2d4c58e4a1
1 mainītis faili ar 16 papildinājumiem un 16 dzēšanām
  1. 16 16
      pages/work/index/index.vue

+ 16 - 16
pages/work/index/index.vue

@@ -133,22 +133,6 @@ export default {
 	},
 	onShow() {
 		console.log(this.$store.state.vuex_workStatus,"onShow")
-		this.status = this.$store.state.vuex_workStatus
-		// 更新进度条
-		if(this.$store.state.vuex_workStatus == 'working'){
-			this.step = this.$store.state.vuex_workStep
-			this.loading()
-		}
-		// 如果是复位状态
-		if(this.$store.state.vuex_workStatus == 'rest'){
-			this.showReset()
-		}
-		if(this.$store.state.vuex_workStatus == 'starting'){
-			this.status = 'start'
-			this.$store.state.vuex_workStatus = 'start'
-			// 更新当前倒计时
-			this.updateDjs()
-		}
 	},
 	onLoad(options) {
 		console.log("onLoad")
@@ -183,6 +167,22 @@ export default {
 		 
 		// 监听消息
 		uni.$on('wsMessage', this.watchMessage)
+		
+		// 更新进度条
+		if(this.$store.state.vuex_workStatus == 'working'){
+			this.step = this.$store.state.vuex_workStep
+			this.loading()
+		}
+		// 如果是复位状态
+		if(this.$store.state.vuex_workStatus == 'rest'){
+			this.showReset()
+		}
+		if(this.$store.state.vuex_workStatus == 'starting'){
+			this.status = 'start'
+			this.$store.state.vuex_workStatus = 'start'
+			// 更新当前倒计时
+			this.updateDjs()
+		}
 	},
 	onUnload() {
 		// 关闭socket