lilei vor 4 Jahren
Ursprung
Commit
23bf0fa981
3 geänderte Dateien mit 19 neuen und 8 gelöschten Zeilen
  1. 1 1
      pages/getOrder/getOrder.vue
  2. 12 1
      pages/index/index.vue
  3. 6 6
      pages/work/index/index.vue

+ 1 - 1
pages/getOrder/getOrder.vue

@@ -178,7 +178,7 @@
 					deviceNo: bizId
 				}).then(res => {
 					uni.hideLoading()
-					console.log(res)
+					console.log(res,'---------')
 					if(res.status != 200 && res.status != 401) {
 						uni.showModal({
 						    title: '提示',

+ 12 - 1
pages/index/index.vue

@@ -98,12 +98,20 @@
 			this.getCodeList('PAY_TYPE')
 			// 获取网点标签数据字典
 			this.getCodeList('STORE_LABEL')
+			// 监听网络状态
+			uni.onNetworkStatusChange(function (res) {
+				if(res.isConnected){
+					 uni.redirectTo({
+					 	url: "/pages/index/index"
+					 })
+				}
+			});
 		},
 		methods: {
 			// 查询是否有未完成的订单
 			getUnFinishedOrder(){
 				getUnFinishedOrder().then(res => {
-					console.log(res)
+					console.log(res,'============')
 					if(res.status == 200 && res.data){
 						this.workStatus = 'show'
 						// 还未启动
@@ -112,6 +120,9 @@
 						}
 					}else{
 						this.workStatus = 'hide'
+						if(res.status == '6000'){
+							this.toashMsg(res.message)
+						}
 					}
 				})
 			},

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

@@ -243,11 +243,11 @@ export default {
 				if(e.data.level == 'O'){
 					// 启动超时
 					if(e.data.msgCode == "PAUSE"){
-						this.startWashCarFail()
+						this.startWashCarFail('设备启动超时,请稍后重试或联系客服')
 					}
 					// 停车位置不正确,
 					if(e.data.msgCode=="TCWZ_CW"){
-						this.showModal(e.data.msgCodeInfo)
+						this.startWashCarFail(e.data.msgCodeInfo)
 					}
 					// 重新进入页面且还未启动洗车时
 					if(e.data.msgCode == "PAID"){
@@ -374,13 +374,13 @@ export default {
 			this.status = 'working';
 			this.$u.vuex('vuex_workStatus','working')
 		},
-		// 启动超时
-		startWashCarFail(){
+		// 启动超时或失败
+		startWashCarFail(msg){
 			this.showStart = false;
 			this.status = 'start';
 			this.$u.vuex('vuex_workStatus','start')
-			this.curWorkStutesText='设备启动超时'
-			this.showModal('设备启动超时,请稍后重试或联系客服')
+			this.curWorkStutesText=msg
+			this.showModal(msg)
 		},
 		// 发送命令,start 启动,stop 急停,reset 归位
 		sendCmdRabt(cmdCode){