|
@@ -133,24 +133,28 @@ export default {
|
|
|
let d = new Date().getTime() - od
|
|
|
this.timestamp = 300 - d/1000
|
|
|
}
|
|
|
+
|
|
|
+ // 更新进度条
|
|
|
+ if(this.$store.state.vuex_workStatus == 'working'){
|
|
|
+ this.step = this.$store.state.vuex_workStep
|
|
|
+ this.loading()
|
|
|
+ }
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
console.log("onLoad")
|
|
|
// 创建websocket
|
|
|
- if(!this.$store.vuex_socket){
|
|
|
- this.$store.commit('$webSocket')
|
|
|
- // uni.showLoading({
|
|
|
- // title: '正在连接...',
|
|
|
- // mask: true
|
|
|
- // })
|
|
|
+ this.$store.commit('$webSocket')
|
|
|
+ uni.showLoading({
|
|
|
+ title: '正在连接...',
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+
|
|
|
+ // 第一次进入洗车页面
|
|
|
+ if(this.$store.state.vuex_workStatus == 'linking'){
|
|
|
// 记录当前的时间
|
|
|
this.$store.state.vuex_orderDjs = new Date().getTime()
|
|
|
}
|
|
|
-
|
|
|
- // 更新进度条
|
|
|
- this.step = this.$store.state.vuex_workStep
|
|
|
- this.loading()
|
|
|
-
|
|
|
+
|
|
|
// 获取用户及订单信息
|
|
|
let orderInfo = this.$store.state.vuex_orderInfo
|
|
|
this.washCarType = orderInfo.itemCode
|
|
@@ -160,11 +164,8 @@ export default {
|
|
|
uni.$on('wsMessage', this.watchMessage)
|
|
|
},
|
|
|
onUnload() {
|
|
|
- // 开始复位时关闭当前页面
|
|
|
- if(this.status = 'reseting'){
|
|
|
- // 关闭socket
|
|
|
- this.$store.commit("$closeWebsocket");
|
|
|
- }
|
|
|
+ // 关闭socket
|
|
|
+ this.$store.commit("$closeWebsocket")
|
|
|
},
|
|
|
onUnload() {
|
|
|
uni.$off('wsMessage', this.watchMessage)
|
|
@@ -188,8 +189,9 @@ export default {
|
|
|
// 连接成功
|
|
|
if(e=='connected'){
|
|
|
console.log('connected')
|
|
|
- // uni.hideLoading()
|
|
|
+ uni.hideLoading()
|
|
|
this.status = 'start'
|
|
|
+ this.$store.state.vuex_workStatus = 'start'
|
|
|
}
|
|
|
}
|
|
|
if(typeof e == 'object' && e.type == 'xcz'){
|