lilei před 4 roky
rodič
revize
b53faff8af
1 změnil soubory, kde provedl 31 přidání a 10 odebrání
  1. 31 10
      pages/work/index/index.vue

+ 31 - 10
pages/work/index/index.vue

@@ -82,6 +82,15 @@
 				</view>
 			</view>
 		</u-popup>
+		<!-- 错误提示 -->
+		<u-popup v-model="showError" :mask-close-able="false" border-radius="10" mode="center" width="500rpx" height="400rpx">
+			<view style="padding: 30rpx;display: flex;justify-content: center;text-align: center;">
+				<view>
+					<u-image width="216px" height="120px" src="/static/img/start.png"></u-image>
+					<view style="padding: 15rpx;">{{curWorkStutesText}}</view>
+				</view>
+			</view>
+		</u-popup>
 		<!-- 急停提示弹框 -->
 		<u-popup v-model="showStop" :mask-close-able="false" border-radius="10" mode="center" width="80%">
 			<view style="padding: 30rpx;text-align: center;">
@@ -115,9 +124,9 @@ export default {
 			rdeg: -135, // 进度条初始角度
 			ldeg: -135, /// 进度条初始角度
 			step: 0, // 进度条增值,共60步
-			interId: null, // 进度时间id
 			status: 'linking', // 状态,linking 连接中,start 开始启动, starting 启动中,working 正在工作,stoping 停止中, reset 归位,reseting 归位中, end 洗车完成
 			curWorkStutesText: '设备准备就绪', // 当前机器运行的进度提示
+			showError: false, // 错误提示
 			showStart: false ,// 启动弹框提示
 			showStop: false, // 急停提示
 			washCarType: '', // 洗车服务类型,不同的类型对应的时间不一样
@@ -166,8 +175,6 @@ export default {
 	onUnload() {
 		// 关闭socket
 		this.$store.commit("$closeWebsocket")
-	},
-	onUnload() {
 		uni.$off('wsMessage', this.watchMessage)
 	},
 	methods: {
@@ -236,17 +243,31 @@ export default {
 				}
 				// 复位状态
 				if(e.data.level == 'D'){
+					// 设备在线,正常服务
+					if(e.data.msgCode == "ON_LINE"){
+						this.curWorkStutesText= e.data.msgCodeInfo
+					}
 					// 开始复位中
-					if(e.data.msgCode=="FW_START"){
+					else if(e.data.msgCode=="FW_START"){
 						this.reseting()
 					}
 					// 复位成功
-					if(e.data.msgCode=="FW_SUCC"){
+					else if(e.data.msgCode=="FW_SUCC"){
 						this.resetRabtSuccess()
 					}
-					// 设备离线,设备暂停营业或复位失败
-					if(e.data.msgCode=="PAUSE" || e.data.msgCode == "FW_FAIL"){
-						this.devError()
+					// 停车位置不正确,
+					else if(e.data.msgCode=="TCWZ_CW"){
+						this.curWorkStutesText= e.data.msgCodeInfo
+						this.showError = true
+					}
+					// 停车位置正确
+					else if(e.data.msgCode=="TCWZ_ZQ"){
+						this.curWorkStutesText= e.data.msgCodeInfo
+						this.showError = false
+					}
+					// 设备离线,设备异常,暂停营业或复位失败,设备使用中
+					else if(e.data.msgCode=="PAUSE" || e.data.msgCode == "FW_FAIL" || e.data.msgCode == 'ERROR' || e.data.msgCode == 'SB_SYZ'){
+						this.devError(e.data.msgCodeInfo)
 					}
 				}
 			}
@@ -384,13 +405,13 @@ export default {
 			this.$store.commit("$closeWebsocket")
 		},
 		// 设备异常
-		devError(){
+		devError(msg){
 			this.status = "end";
 			this.$store.state.vuex_workStatus = 'end'
 			this.resetLoadingStatus();
 			uni.showModal({
 			    title: '提示',
-			    content: '设备异常,请联系客服',
+			    content: msg || '设备异常,请联系客服',
 				showCancel: false,
 			    success: function (res) {
 			        if (res.confirm) {