浏览代码

设备调试

lilei 4 年之前
父节点
当前提交
752a404e3b
共有 7 个文件被更改,包括 28 次插入14 次删除
  1. 2 2
      App.vue
  2. 2 1
      pages/store/storeList.vue
  3. 23 9
      pages/work/index/index.vue
  4. 1 2
      pages/work/success/success.vue
  5. 二进制
      static/img/dky.png
  6. 二进制
      static/img/ygb.png
  7. 二进制
      static/img/yyz.png

+ 2 - 2
App.vue

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

+ 2 - 1
pages/store/storeList.vue

@@ -24,7 +24,8 @@
 					</view>
 				</view>
 				<view class="list-right">
-					<u-image width="55px" height="55px" :border-radius="10" :src="getStoreStatus(item)"></u-image>
+					<u-image width="45px" height="22px" :border-radius="10" :src="getStoreStatus(item)"></u-image>
+					<u-icon size="30" color="#999" name="arrow-right"></u-icon>
 				</view>
 			</view>
 			<u-empty class="noData" :text="noDataText" img-width="120" v-if="storeList.length==0 && status!='loading'" mode="list"></u-empty>

+ 23 - 9
pages/work/index/index.vue

@@ -69,6 +69,11 @@
 					<u-image width="216px" height="120px" src="/static/img/start.png"></u-image>
 					<view style="padding: 15rpx;">洗车机正在启动...</view>
 				</view>
+				<!-- 停止中 -->
+				<view v-if="status == 'stop'">
+					<u-image width="216px" height="120px" src="/static/img/start.png"></u-image>
+					<view style="padding: 15rpx;">洗车机正在停止中...</view>
+				</view>
 				<!-- 归位中 -->
 				<view v-if="status == 'reseting'">
 					<u-image width="216px" height="120px" src="/static/img/reset.png"></u-image>
@@ -131,7 +136,8 @@ export default {
 		
 		// 监听消息
 		uni.$on('wsMessage',(e)=>{
-			console.log(e)
+			console.log(e.data.level,e.data.msgCode,e.data.msgCodeInfo)
+			console.log("--------------------------------------------")
 			if(e.type == 'xcz'){
 				// 进度消息
 				if(e.data.level == 'C'){
@@ -144,24 +150,25 @@ export default {
 				// 错误消息
 				if(e.data.level == 'F'){
 					this.curWorkStutesText= e.data.msgCodeInfo
-					// 显示急停提示弹框
+					// 显示复位提示弹框
 					this.showStop = true;
 				}
 				// 急停
 				if(e.data.level == 'A'){
 					if(e.data.msgCode=="JJTZ"||e.data.msgCode=="XCX_JJTZ"){
 						this.curWorkStutesText= e.data.msgCodeInfo
-						// 显示急停提示弹框
+						// 显示复位提示弹框
 						this.showStop = true;
+						this.stopWashCarSuccess()
 					}else{
 						this.devError()
 					}
 				}
 				// 复位状态
-				if(e.data.leve == 'D'){
-					this.curWorkStutesText= e.data.msgCodeInfo
+				if(e.data.level == 'D'){
 					// 开始复位
 					if(e.data.msgCode=="FW_START"){
+						this.status = 'reseting';
 						this.showStart = true;
 						this.showStop = false;
 					}
@@ -173,6 +180,13 @@ export default {
 			}
 		})
 	},
+	onUnload() {
+		// 开始复位时关闭当前页面
+		if(this.status = 'reseting'){
+			// 关闭socket
+			this.$store.commit("$closeWebsocket");
+		}
+	},
 	methods: {
 		// 电话客服
 		callPhone () {
@@ -195,7 +209,7 @@ export default {
 			if (this.status == 'start') {
 				cmd.operateType = 'start' //操作命令
 				this.$store.commit("$sendWebsocket",JSON.stringify(cmd))
-				this.showStart = true;
+				this.showStart = true
 				setTimeout(()=>{
 					this.startWashCarSuccess()
 				},3000)
@@ -209,6 +223,7 @@ export default {
 				        if (res.confirm) {
 							cmd.operateType = 'stop' //操作命令
 							_this.$store.commit("$sendWebsocket",JSON.stringify(cmd))
+							_this.status = 'stop'
 				        }
 				    }
 				});
@@ -235,9 +250,6 @@ export default {
 		},
 		// 设备停止成功
 		stopWashCarSuccess(){
-			// 关闭socket
-			this.$store.commit("$closeWebsocket")
-			this.status = 'stop';
 			this.$store.state.vuex_workStatus = 'stop'
 			this.curWorkStutesText='设备已停止';
 			this.resetLoadingStatus();
@@ -245,6 +257,8 @@ export default {
 		// 设备异常
 		devError(){
 			this.stopWashCarSuccess();
+			// 关闭socket
+			this.$store.commit("$closeWebsocket");
 			uni.showModal({
 			    title: '提示',
 			    content: '设备异常,请联系客服',

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

@@ -4,8 +4,7 @@
 			<view><u-icon name="checkmark-circle-fill" size="200" color="red"></u-icon></view>
 			<view>洗车机归位成功</view>
 			<view class="s-butoon">
-				<u-button @click="toWork" type="error">重新扫码洗车</u-button>
-				<u-button @click="toHome">返回首页</u-button>
+				<u-button @click="toHome" type="error">返回首页重新扫码洗车</u-button>
 			</view>
 		</vew>
 		<view class="infos">

二进制
static/img/dky.png


二进制
static/img/ygb.png


二进制
static/img/yyz.png