lilei 4 vuotta sitten
vanhempi
commit
99d153338d
3 muutettua tiedostoa jossa 29 lisäystä ja 25 poistoa
  1. 8 0
      pages/index/index.vue
  2. 20 24
      pages/work/index/index.vue
  3. 1 1
      pages/work/success/success.vue

+ 8 - 0
pages/index/index.vue

@@ -106,6 +106,14 @@
 					console.log(res)
 					if(res.status == 200 && res.data){
 						this.workStatus = 'show'
+						// 还未启动
+						if(res.data.dataStatus == "PAID"){
+							this.$store.state.vuex_workStatus = 'linking'
+						}else{
+							this.$store.state.vuex_workStatus = 'working'
+						}
+					}else{
+						this.workStatus = 'hide'
 					}
 				})
 			},

+ 20 - 24
pages/work/index/index.vue

@@ -33,7 +33,7 @@
 		<!-- 说明提示 -->
 		<view class="work-tips">
 			<view>
-				<view class="work-dtime" v-if="status=='start'">
+				<view class="work-dtime" v-show="status=='start'">
 					距离订单强制完成还剩
 					<u-count-down
 					    v-if="timestamp>0"
@@ -152,7 +152,7 @@ export default {
 		})
 		
 		// 第一次进入洗车页面
-		if(this.$store.state.vuex_workStatus == 'linking'){
+		if(this.$store.state.vuex_orderDjs == 0){
 			// 记录当前的时间
 			this.$store.state.vuex_orderDjs = new Date().getTime()
 		}
@@ -199,14 +199,10 @@ export default {
 				if(e=='connected'){
 					console.log('connected---')
 					uni.hideLoading()
-					this.status = 'start'
-					this.$store.state.vuex_workStatus = 'start'
-				}
-				// 连接开始重连,恢复状态为初始
-				if(e=='reconnect'){
-					console.log('reconnect---')
-					this.status = 'linking'
-					this.$store.state.vuex_workStatus = 'linking'
+					if(this.$store.state.vuex_workStatus == 'linking'){
+						this.status = 'start'
+						this.$store.state.vuex_workStatus = 'start'
+					}
 				}
 				// 重连连接打开时发送获取当前状态的命令
 				if(e=='connectOpen'){
@@ -224,7 +220,11 @@ export default {
 					}
 					// 停车位置不正确,
 					if(e.data.msgCode=="TCWZ_CW"){
-						this.devError(e.data.msgCodeInfo)
+						uni.showModal({
+							title: '提示',
+							content: e.data.msgCodeInfo,
+							showCancel: false,
+						});
 					}
 					// 重新进入页面且还未启动洗车时
 					if(e.data.msgCode == "PAID"){
@@ -238,14 +238,14 @@ export default {
 					}
 				}
 				// 进度消息
-				if(e.data.level == 'C'&&this.status!="reseting"&&e.data.msgCodeSrc){
-					 this.curWorkStutesText= e.data.msgCodeInfo
-					 // 启动成功
-					 this.startWashCarSuccess()
-					 // 更新进度条
-					 this.step = e.data.msgCodeSrc?Number(e.data.msgCodeSrc.split('-')[1]):0
-					 this.$store.state.vuex_workStep = this.step
-					 this.loading()
+				if(e.data.level == 'C'&&this.status!="reseting"){
+					this.curWorkStutesText= e.data.msgCodeInfo
+					// 启动成功
+					this.startWashCarSuccess()
+					// 更新进度条
+					this.step = e.data.msgCodeSrc?Number(e.data.msgCodeSrc.split('-')[1]):0
+					this.$store.state.vuex_workStep = this.step
+					this.loading()
 					 // 洗车完成
 					 if(e.data.msgCode=="XCWC" && this.status != 'end'){
 						 this.washCarSuccess()
@@ -273,12 +273,8 @@ export default {
 				}
 				// 复位状态
 				if(e.data.level == 'D'){
-					// 设备在线,正常服务
-					if(e.data.msgCode == "ON_LINE"){
-						this.curWorkStutesText= e.data.msgCodeInfo
-					}
 					// 开始复位中
-					else if(e.data.msgCode=="FW_START"){
+					if(e.data.msgCode=="FW_START"){
 						this.reseting()
 					}
 					// 复位成功

+ 1 - 1
pages/work/success/success.vue

@@ -35,7 +35,7 @@
 			},
 			// 返回首页
 			toHome () {
-				uni.redirectTo({
+				uni.reLaunch({
 					url: "/pages/index/index"
 				})
 			},