lilei 4 anos atrás
pai
commit
6841050f26

+ 6 - 0
pages/agreement/agreement.vue

@@ -340,6 +340,12 @@
 					<view class="MsoNormal">
 						再次感谢您的耐心阅读!
 					</view>
+					<view style="text-align: right;">
+						陕西山海高科信息技术有限公司
+					</view>
+					<view style="text-align: right;">
+						2020年8月
+					</view>
 				</view>
 			</view>
 		</view>

+ 16 - 9
pages/order/order.vue

@@ -5,7 +5,7 @@
 				<view v-for="item in list" :key="item.id" class="order-list-item" @click="goView(item)">
 					<view>
 						<view>{{item.storeName}}</view>
-						<view class="order-finish">{{item.payStatus}}</view>
+						<view :class="item.orderStatus">{{getOptionName(orderStatusList,item.orderStatus)}}</view>
 					</view>
 					<view>
 						<view class="order-carNo">{{item.customerMobile}}</view>
@@ -39,14 +39,14 @@
 				pageNo:1,
 				pageSize:15,
 				count:0,
-			};
+				orderStatusList: []
+			}
 		},
 		onLoad() {
 			this.getList()
-			console.log(this.orderStatusList,'1111')
+			this.orderStatusList = this.$store.state.vuex_payStatus
 		},
 		methods: {
-			
 			getOptionName (list,val) {
 			  let p = list.find((item) => {
 				  return item.code == val
@@ -56,7 +56,6 @@
 			// 获取订单列表
 			getList() {
 				this.status = "loading"
-				let orderStatusList = this.$store.state.vuex_payStatus
 				let payTypeList = this.$store.state.vuex_payType
 				let params = {
 					pageNo: this.pageNo,
@@ -67,7 +66,6 @@
 					if(res.status == 200) {
 						let list = res.data.list
 						list.map(item => {
-							item.payStatus = this.getOptionName(orderStatusList,item.payStatus)
 							item.payType = item.payType ? this.getOptionName(payTypeList,item.payType) : ''
 						})
 						this.list = this.list.concat(list)
@@ -132,15 +130,24 @@
 								padding-left: 15rpx;
 							}
 						}
-						.order-finish{
+						.FINISHED{
 							color: #00aa00;
 						}
-						.order-unPay{
+						.UN_PAY{
 							color: #ff0000;
 						}
-						.order-cansel{
+						.CANCELED{
 							color: #7e7b88;
 						}
+						.PAID{
+							color: #00aaff;
+						}
+						.REFUNDING{
+							color: #00557f;
+						}
+						.REFUNDED{
+							color: #005500;
+						}
 						.order-carNo{
 							font-size: 32rpx;
 						}

+ 31 - 15
pages/order/orderDetail.vue

@@ -3,7 +3,7 @@
 		<u-cell-group>
 			<u-cell-item title="订单状态" :arrow="false">
 				<view slot="right-icon">
-					<text class="order-finish">{{orderInfo.payStatus}}</text>
+					<text :class="orderInfo.orderStatus">{{getOptionName(orderStatusList,orderInfo?orderInfo.orderStatus:'')}}</text>
 				</view>
 			</u-cell-item>
 			<u-cell-item title="订单编号" :arrow="false" >
@@ -35,10 +35,14 @@
 			</u-cell-item>
 		</u-cell-group>
 		<view class="order-photo">
-			<view>洗车前</view>
-			<u-image width="100%" height="400rpx" :src="orderInfo.beginImage"></u-image>
-			<view>洗车后</view>
-			<u-image width="100%" height="400rpx" :src="orderInfo.endImage"></u-image>
+			<view v-if="orderInfo.beginImage">
+				<view>洗车前</view>
+				<u-image width="100%" height="400rpx" :src="orderInfo.beginImage"></u-image>
+			</view>
+			<view v-if="orderInfo.endImage">
+				<view>洗车后</view>
+				<u-image width="100%" height="400rpx" :src="orderInfo.endImage"></u-image>
+			</view>
 		</view>
 	</view>
 </template>
@@ -50,30 +54,33 @@
 		data() {
 			return {
 				orderInfo: null,
-				src: ''
+				src: '',
+				orderStatusList: []
 			}
 		},
 		onLoad(options) {
 			if (options.id) {
 				console.log(options.id)
 				this.getOrderDetail(options.id)
+				this.orderStatusList = this.$store.state.vuex_payStatus
 			}
 		},
 		methods:{
 			getOptionName (list,val) {
-			  let p = list.find((item) => {
-				  return item.code == val
-			  })
-			  return p ? p.dispName : '-'
+			  if(val){
+				  let p = list.find((item) => {
+				  				  return item.code == val
+				  })
+				  return p ? p.dispName : '-'
+			  }
+			  return '-'
 			},
 			// 获取订单详情
 			getOrderDetail (id) {
-				let orderStatusList = this.$store.state.vuex_payStatus
 				let payTypeList = this.$store.state.vuex_payType
 				orderDetail({id:id}).then(res =>{
 					if (res.status == 200) {
 						this.orderInfo = res.data
-						this.orderInfo.payStatus = this.getOptionName(orderStatusList,this.orderInfo.payStatus)
 						this.orderInfo.payType = this.orderInfo.payType ? this.getOptionName(payTypeList,this.orderInfo.payType) : ''
 					} else {
 					}
@@ -96,15 +103,24 @@
 				padding: 20rpx;
 			}
 		}
-		.order-finish{
+		.FINISHED{
 			color: #00aa00;
 		}
-		.order-unPay{
+		.UN_PAY{
 			color: #ff0000;
 		}
-		.order-cansel{
+		.CANCELED{
 			color: #7e7b88;
 		}
+		.PAID{
+			color: #00aaff;
+		}
+		.REFUNDING{
+			color: #00557f;
+		}
+		.REFUNDED{
+			color: #005500;
+		}
 		.order-price{
 			font-size: 36rpx;
 			color: red;

+ 26 - 20
pages/work/index/index.vue

@@ -139,7 +139,9 @@ export default {
 			console.log("--------------------------------------------")
 			if(e.type == 'xcz'){
 				// 进度消息
-				if(e.data.level == 'C'){
+				if(e.data.level == 'C'&&this.status!="reseting"){
+					 // 启动成功
+					 this.startWashCarSuccess()
 					 this.curWorkStutesText= e.data.msgCodeInfo
 					 // 洗车完成
 					 if(e.data.msgCode=="XCWC"){
@@ -147,7 +149,9 @@ export default {
 					 }
 				}
 				// 错误消息
-				if(e.data.level == 'F'){
+				if(e.data.level == 'F'&&this.status!="reseting"){
+					// 启动成功
+					this.startWashCarSuccess()
 					this.curWorkStutesText= e.data.msgCodeInfo
 					// 显示复位提示弹框
 					this.showStop = true;
@@ -216,9 +220,6 @@ export default {
 				this.$store.commit("$sendWebsocket",JSON.stringify(cmd))
 				this.showStart = true
 				this.$store.state.vuex_workStatus = 'start'
-				setTimeout(()=>{
-					this.startWashCarSuccess()
-				},3000)
 			}
 			// 急停
 			if (this.status == 'working') {
@@ -237,22 +238,25 @@ export default {
 		},
 		// 启动成功
 		startWashCarSuccess(){
-			this.status = 'working';
-			this.$store.state.vuex_workStatus = 'working'
-			this.curWorkStutesText='设备已启动';
-			this.showStart = false;
-			this.step = 0;
 			// 进度条,服务时间根据不同的服务类型而不同
-			let serverTime = this.washDuration/60
-			this.interId = setInterval(()=>{
-				// 小于60时说明洗车机正在工作中
-				if(this.step<=60){
-					this.loading(this.step++)
-				}else{
-					// 洗车机正常状态下工作结束
-					this.washCarSuccess()
-				}
-			},1000*serverTime)
+			if(!this.interId){
+				this.status = 'working';
+				this.$store.state.vuex_workStatus = 'working'
+				this.curWorkStutesText='设备已启动';
+				this.showStart = false;
+				this.step = 0;
+				let serverTime = 0.5
+				this.interId = setInterval(()=>{
+					// 小于60时说明洗车机正在工作中
+					if(this.step<=60){
+						this.loading(this.step++)
+					}else{
+						// 洗车机正常状态下工作结束
+						// this.washCarSuccess()
+						this.step = 0
+					}
+				},1000*serverTime)
+			}
 		},
 		// 设备停止成功
 		stopWashCarSuccess(){
@@ -292,6 +296,7 @@ export default {
 			        }
 			    }
 			});
+			console.log('washCarSuccess')
 			// 关闭socket
 			this.$store.commit("$closeWebsocket")
 		},
@@ -301,6 +306,7 @@ export default {
 			this.rdeg= -135;
 			this.ldeg= -135;
 			clearInterval(this.interId);
+			this.interId = null;
 		},
 		// 洗车机进度条动画
 		loading(second) {