lilei %!s(int64=4) %!d(string=hai) anos
pai
achega
b914350f80
Modificáronse 2 ficheiros con 18 adicións e 4 borrados
  1. 1 1
      App.vue
  2. 17 3
      pages/work/index/index.vue

+ 1 - 1
App.vue

@@ -1,6 +1,6 @@
 <script>
 	// const uat_URL = 'http://md.test.zyucgj.com/saas/clz/' // 预发布
-	const uat_URL = 'http://192.168.16.102:8103/cw-wechat/' // 本地
+	const uat_URL = 'http://192.168.16.103:8103/cw-wechat/' // 本地
 	const pro_URL = 'https://car.zyucgj.com/saas/clz/'  // 生产
 	const buildType = 0 // 打包环境对应类型,1 生产 0 预发布
 	const buildURL = buildType ? pro_URL : uat_URL // 打包后实际对应的url

+ 17 - 3
pages/work/index/index.vue

@@ -113,13 +113,13 @@ export default {
 			status: 'start', // 状态,start 开始启动,working 正在工作,stop急停,reseting 归位中, success 洗车成功
 			showStart: false ,// 启动弹框提示
 			showStop: false, // 急停提示
-			washCarType: 1, // 洗车服务类型,不同的类型对应的时间不一样
+			washCarType: '', // 洗车服务类型,不同的类型对应的时间不一样
 			orderNo: '',// 订单编号
 		};
 	},
 	onLoad(options) {
 		// 创建websocket
-		this.$store.commit('$webSocket');
+		this.$store.commit('$webSocket')
 		this.washCarType = options.washCarType
 		this.orderNo = options.orderNo
 	},
@@ -162,7 +162,7 @@ export default {
 				this.status = 'working';
 				this.showStart = false;
 				// 进度条,服务时间根据不同的服务类型而不同
-				let serverTime = 1
+				let serverTime = 7
 				console.log(this.step,'step')
 				this.interId = setInterval(()=>{
 					// 小于60时说明洗车机正在工作中
@@ -183,6 +183,13 @@ export default {
 			    content: '确定紧急停止洗车机?',
 			    success: function (res) {
 			        if (res.confirm) {
+						// 停止命令
+						let cmd = {
+							orderNo: _this.orderNo, // 订单编号
+							operateType: 'stop', //操作命令
+							washType: _this.washCarType,// 洗车模式
+						}
+						_this.$store.commit("$sendWebsocket",JSON.stringify(cmd))
 						// 显示急停提示弹框
 						_this.showStop = true;
 						_this.status = 'stop';
@@ -235,6 +242,13 @@ export default {
 		},
 		// 归位机器
 		resetRabt(){
+			// 归位命令
+			let cmd = {
+				orderNo: this.orderNo, // 订单编号
+				operateType: 'reset', //操作命令
+				washType: this.washCarType,// 洗车模式
+			}
+			this.$store.commit("$sendWebsocket",JSON.stringify(cmd))
 			this.status = 'reseting';
 			this.showStart = true;
 			this.showStop = false;