Sfoglia il codice sorgente

钣喷提交订单

twt 2 anni fa
parent
commit
cf725c8d91
1 ha cambiato i file con 42 aggiunte e 16 eliminazioni
  1. 42 16
      pages/index/paintSure.vue

+ 42 - 16
pages/index/paintSure.vue

@@ -114,11 +114,22 @@
 				timedata:'',
 				billDate:'',
 				itemList:[],
+				sheetDetail:[],
 			}
 		},
 		onLoad(opt) {
 			this.itemList = JSON.parse(opt.itemList);
-
+            console.log(this.itemList)
+			this.itemList.forEach(item=>{
+				var obj={
+					itemId:item.id,
+					itemName:item.name,
+					itemQty:1,
+					salePrice:item.money,
+					totalPrice:item.money,
+				}
+				this.sheetDetail.push(obj)
+			})
 			this.goodsnum = opt.itemQty;
 			//console.log(this.carInfo)
 			this.userInfo = uni.getStorageSync("userInfo");
@@ -138,7 +149,7 @@
 				this.customerName = this.mydata.customerInfo.customerName
 				this.mobilePhone = this.mydata.customerInfo.mobilePhone
 				this.shopInfo = this.mydata.shopInfo
-				
+				this.shopID=this.shopInfo.id
 				uni.setStorage({
 					key: 'yyshopInfo',
 					data:this.shopInfo,
@@ -179,19 +190,11 @@
 				 this.$refs.timeSelect.open();
 			},
 			submit() {
-				var jsonArray = [];
-				var obj = {
-					itemId: this.goodsInfo.id,
-					itemName: this.goodsInfo.name,
-					itemQty: this.goodsnum,
-					salePrice: this.goodsInfo.salePrice,
-					totalPrice: this.totalMoney
-				}
-				jsonArray.push(obj)
+				
 				//"bizType:1商品2项目3套餐
 				var params = {
-					sheetType: this.goodsInfo.bizType,
-					sheetContent: this.goodsInfo.name,
+					sheetType:'5',
+					sheetContent: '钣喷',
 					customerName: this.customerName,
 					mobilePhone: this.mobilePhone,
 					plateNumber: this.carInfo.plateNumber,
@@ -199,7 +202,8 @@
 					totalMoney: this.totalMoney,
 					shopId: this.shopID,
 					comment: this.comment,
-					sheetDetail: JSON.stringify(jsonArray)
+					sheetDetail: JSON.stringify(this.sheetDetail),
+					payType:this.PayType,
 				}
 				uni.showLoading({
 					title: '加载中'
@@ -207,14 +211,28 @@
 				this.$http('openMallOrder/submitOrder', params, 'POST').then(res => {
 					uni.hideLoading();
 					if (res.code == 0) {
-						this.orderData = res.data
-						this.unifiedPay(res.data)
+						this.orderData = res.data;
+						if(this.PayType==1){
+							this.unifiedPay(res.data)
+						}else{
+							uni.showToast({
+								title: '提交成功',
+								icon: 'none',
+								duration: 2000
+							});
+						}
+						
 					} else {
 						uni.showToast({
 							title: res.msg,
 							icon: 'none',
 							duration: 3000
 						});
+						if (this.orderData.sheetType==5){
+							uni.navigateTo({
+								url: "../user/myOrder/paintOrderDetail?id=" +that.orderData.id
+							})
+						}
 					}
 				})
 			},
@@ -272,6 +290,10 @@
 								url: "../user/myOrder/mallOrderDetail?id=" + that.orderData.id +
 									"&SheetType=" + that.orderData.sheetType
 							})
+						}else if (that.orderData.sheetType==5){
+							uni.navigateTo({
+								url: "../user/myOrder/paintOrderDetail?id=" +that.orderData.id
+							})
 						}
 
 					},
@@ -290,6 +312,10 @@
 								url: "../user/myOrder/mallOrderDetail?id=" + that.orderData.id +
 									"&SheetType=" + that.orderData.sheetType
 							})
+						}else if (that.orderData.sheetType==5){
+							uni.navigateTo({
+								url: "../user/myOrder/paintOrderDetail?id=" +that.orderData.id
+							})
 						}
 					}
 				});