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