lilei před 4 roky
rodič
revize
d917384e0b
4 změnil soubory, kde provedl 24 přidání a 20 odebrání
  1. 2 2
      App.vue
  2. 14 14
      pages/getOrder/getOrder.vue
  3. 1 1
      pages/index/index.vue
  4. 7 3
      pages/work/index/index.vue

+ 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

+ 14 - 14
pages/getOrder/getOrder.vue

@@ -172,23 +172,12 @@
 				this.$store.state.vuex_orderInfo.bizId = bizId
 				this.$store.state.vuex_orderInfo.storeId = storeId
 				// 判断当前门店是否已运营
-				this.getStoreStatus(storeId,bizId)
-				
-				// 监听点击已阅读事件
-				uni.$once('read', this.read)
-				// 获取用户信息
-				this.getUserPhone()
-				// 获取服务项目
-				this.getServerList()
+				// this.getStoreStatus(storeId,bizId)
+				this.dataInit()
 			} else {
 				// 判断是否扫码过
 				if (this.$store.state.vuex_orderInfo.bizId != '') {
-					// // 监听点击已阅读事件
-					// uni.$once('read', this.read)
-					// // 获取用户信息
-					// this.getUserPhone()
-					// // 获取服务项目
-					// this.getServerList()
+					this.dataInit()
 				} else {
 					// 返回首页
 					uni.reLaunch({
@@ -206,6 +195,15 @@
 			console.log(this.stepIndex)
 		},
 		methods: {
+			// 查询基础数据
+			dataInit(){
+				// 监听点击已阅读事件
+				uni.$once('read', this.read)
+				// 获取用户信息
+				this.getUserPhone()
+				// 获取服务项目
+				this.getServerList()
+			},
 			// 获取网点营业状态
 			getStoreStatus(storeId, bizId) {
 				uni.showLoading({
@@ -231,6 +229,8 @@
 						        }
 						    }
 						});
+					}else{
+						this.dataInit()
 					}
 				})
 			},

+ 1 - 1
pages/index/index.vue

@@ -72,7 +72,7 @@
 		},
 		data() {
 			return {
-				workStatus: '',
+				workStatus: 'stop',
 				mapCtx: null, // 地图对象
 				markers: [], // 标注点
 				lng: '',

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

@@ -127,7 +127,6 @@ export default {
 	onLoad(options) {
 		// 创建websocket
 		this.$store.commit('$webSocket')
-		this.$store.state.vuex_workStatus = 'start'
 		// 获取用户及订单信息
 		let orderInfo = this.$store.state.vuex_orderInfo
 		this.washCarType = orderInfo.itemCode
@@ -176,6 +175,10 @@ export default {
 					if(e.data.msgCode=="FW_SUCC"){
 						this.resetRabtSuccess()
 					}
+					// 设备离线,设备暂停营业或复位失败
+					if(e.data.msgCode=="PAUSE" || e.data.msgCode == "FW_FAIL"){
+						this.devError()
+					}
 				}
 			}
 		})
@@ -210,6 +213,7 @@ export default {
 				cmd.operateType = 'start' //操作命令
 				this.$store.commit("$sendWebsocket",JSON.stringify(cmd))
 				this.showStart = true
+				this.$store.state.vuex_workStatus = 'start'
 				setTimeout(()=>{
 					this.startWashCarSuccess()
 				},3000)
@@ -276,8 +280,6 @@ export default {
 			this.$store.state.vuex_workStatus = 'stop'
 			this.curWorkStutesText='洗车已结束';
 			this.resetLoadingStatus();
-			// 关闭socket
-			this.$store.commit("$closeWebsocket")
 			uni.showModal({
 			    title: '提示',
 			    content: '洗车已结束',
@@ -288,6 +290,8 @@ export default {
 			        }
 			    }
 			});
+			// 关闭socket
+			this.$store.commit("$closeWebsocket")
 		},
 		// 重置到进度条初始状态
 		resetLoadingStatus(){