|
@@ -145,7 +145,10 @@ export default {
|
|
console.log("onLoad")
|
|
console.log("onLoad")
|
|
// 创建websocket
|
|
// 创建websocket
|
|
this.$store.commit('$webSocket')
|
|
this.$store.commit('$webSocket')
|
|
-
|
|
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: '正在连接...',
|
|
|
|
+ mask: true
|
|
|
|
+ })
|
|
// 获取用户及订单信息
|
|
// 获取用户及订单信息
|
|
let orderInfo = this.$store.state.vuex_orderInfo
|
|
let orderInfo = this.$store.state.vuex_orderInfo
|
|
this.washCarType = orderInfo.itemCode
|
|
this.washCarType = orderInfo.itemCode
|
|
@@ -153,17 +156,26 @@ export default {
|
|
this.washDuration = orderInfo.duration
|
|
this.washDuration = orderInfo.duration
|
|
// 记录当前的时间
|
|
// 记录当前的时间
|
|
this.$store.state.orderDjs = new Date().getTime()
|
|
this.$store.state.orderDjs = new Date().getTime()
|
|
|
|
+
|
|
// 监听消息
|
|
// 监听消息
|
|
uni.$on('wsMessage',(e)=>{
|
|
uni.$on('wsMessage',(e)=>{
|
|
if(typeof e == 'string'){
|
|
if(typeof e == 'string'){
|
|
// 连接成功
|
|
// 连接成功
|
|
if(e=='connected'){
|
|
if(e=='connected'){
|
|
-
|
|
|
|
|
|
+ console.log('connected')
|
|
|
|
+ uni.hideLoading()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ console.log(typeof e)
|
|
if(typeof e == 'object' && e.type == 'xcz'){
|
|
if(typeof e == 'object' && e.type == 'xcz'){
|
|
console.log(e.data.level,e.data.msgCode,e.data.msgCodeInfo)
|
|
console.log(e.data.level,e.data.msgCode,e.data.msgCodeInfo)
|
|
console.log("--------------------------------------------")
|
|
console.log("--------------------------------------------")
|
|
|
|
+ // 启动超时
|
|
|
|
+ if(e.data.level == 'O'){
|
|
|
|
+ if(e.data.msgCode == "PAUSE"){
|
|
|
|
+ this.startWashCarFail()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
// 进度消息
|
|
// 进度消息
|
|
if(e.data.level == 'C'&&this.status!="reseting"){
|
|
if(e.data.level == 'C'&&this.status!="reseting"){
|
|
// 启动成功
|
|
// 启动成功
|
|
@@ -262,6 +274,15 @@ export default {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 启动超时
|
|
|
|
+ startWashCarFail(){
|
|
|
|
+ this.showStart = false;
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '设备启动超时,请重新点击启动',
|
|
|
|
+ showCancel: false,
|
|
|
|
+ });
|
|
|
|
+ },
|
|
// 启动成功
|
|
// 启动成功
|
|
startWashCarSuccess(){
|
|
startWashCarSuccess(){
|
|
// 进度条,服务时间根据不同的服务类型而不同
|
|
// 进度条,服务时间根据不同的服务类型而不同
|