Browse Source

commit-m -协销购物车

zhengjinyi 4 years ago
parent
commit
7e8e07c570

+ 1 - 0
pages/goods/cart.vue

@@ -229,6 +229,7 @@
 				this.isModallayer = false //遮罩层 防止多次点击
 				this.skeletonShow = true //预加载圆圈
 				this.isCheckAll=false//是否全选
+				this.submitIds = []
 				this.$api.getStorage().then((resolve) => {
 					this.userID = resolve.userID;
 					this.initGetCartGoodsList();

+ 1 - 0
pages/tabBar/cart/cart.vue

@@ -217,6 +217,7 @@
 				this.isModallayer = false //遮罩层 防止多次点击
 				this.skeletonShow = true //预加载圆圈
 				this.isCheckAll=false//是否全选
+				this.submitIds = []
 				this.$api.getStorage().then((resolve) => {
 					this.userID = resolve.userID;
 					this.initGetCartGoodsList();

+ 15 - 7
seller/pages/cart/cart.vue

@@ -195,6 +195,7 @@
 				this.isModallayer = false //遮罩层 防止多次点击
 				this.skeletonShow = true //预加载圆圈
 				this.isCheckAll=false//是否全选
+				this.submitIds = []
 				this.$api.getStorage().then((resolve) => {
 					this.serviceProviderId = resolve.serviceProviderID;
 					this.initGetCartGoodsList();
@@ -608,20 +609,27 @@
 							}
 						})
 					})
-					console.log(productIdList)
+					//判断勾选的商品是否为充值商品或者为定金商品的一些处理逻辑
 					const isHasDepositlds = productIdList.filter(item =>this.depositIds.includes(item))
 					const isHasRechargeIds = productIdList.filter(item =>this.rechargeIds.includes(item))
 					const isGoods= productIdList.every(item =>{ [...this.depositIds,...this.rechargeIds].includes(item)}) 
-					console.log(isHasDepositlds)
-					console.log(isHasRechargeIds)
-					console.log(isGoods)
-					
-					if(isHasDepositlds.length === 1 || isHasRechargeIds.length === 1 && isGoods){
+					if(productIdList.length == 1 && isHasDepositlds.length === 1 && isHasRechargeIds.length === 0){
+						console.log('定金商品')
 						productIdList.forEach(item =>{
 							productID += item +','
 						})
+					}else if(productIdList.length == 1 && isHasRechargeIds.length === 1 && isHasDepositlds.length === 0){
+						console.log('充值余额商品')
+						productIdList.forEach(item =>{
+							productID += item +','
+						})
+					}else if(!isGoods && isHasRechargeIds.length === 0 && isHasDepositlds.length === 0){
+						console.log('正常商品')
+ 						productIdList.forEach(item =>{
+							productID += item +','
+						})
 					}else{
-						this.$util.modal('提示','缴纳定金商品或余额充值商品请单独下单!','确定','',false,() =>{})
+						this.$util.modal('提示','缴纳金商品或余额充值商品请单独下单!','确定','',false,() =>{})
 						return
 					}
 					let cartPramsData={

+ 13 - 2
seller/pages/order/create-order.vue

@@ -8,13 +8,13 @@
 		<seller-goodsList ref='goods' v-if="isRequest" :goodsData="goodsData" @handleGoodList="handChangeInputGoodsList"></seller-goodsList>
 		<!-- 发票信息 -->
 		<seller-invoice ref="invoice" 
-						v-if="isRequest" 
+						v-if="isRequest && isDepositFlg" 
 						:invoiceDatas="invoiceData" 
 						@handleChoiceaInvoice="handleChoiceaInvoiceData">
 		</seller-invoice>
 		<!-- 运费 -->
 		<seller-freight ref="freight" 
-						v-if="isFreight" 
+						v-if="isFreight && isDepositFlg" 
 						:freightDatas="freightData" 
 						@handleChoiceaFreight="handleChoiceaFreightData" 
 						@showFreightAlert="handFreightAlertShow">
@@ -116,6 +116,8 @@
 				orderInfo:[],			  //提交的商品信息
 				payInfo:{},				  //订单信息
 				rechargeGoods:false,
+				isDepositFlg:true,
+				depositIds : [6060,6061,6062,6063,6064,6065,6066,6067,6068,6069],//定金&充值余额商品ID
 				isIphoneX:this.$store.state.isIphoneX
 			}
 		},
@@ -163,6 +165,7 @@
 					let params ={clubId:this.clubId,serviceProviderId:this.serviceProviderId,count:this.productCount,productIds:this.productIds}
 					this.SellerService.SellerSettlement(params).then(response =>{
 						let data = response.data
+						let productIds = []
 						this.isRequest = true
 						this.goodsData = data.shopList
 						this.userMoney = data.userMoney
@@ -170,6 +173,14 @@
 						this.totalOriginalPrice = data.reducedPrice + data.totalAmount
 						this.rechargeGoods = data.rechargeGoods
 						this.allPrice = this.payAllPrice = data.totalAmount
+						this.goodsData.forEach(item =>{
+							item.productsList.forEach(pros =>{
+								if(this.depositIds.indexOf(pros.productID)>=0){
+									this.isDepositFlg = false
+								}
+							})
+						})
+						console.log(this.isDepositFlg)
 					}).catch(error =>{
 						this.$util.msg(error.msg,2000)
 					})