Browse Source

配套商品页面绘制、购物车促销活动叠加功能。

zhengjinyi 3 năm trước cách đây
mục cha
commit
63d09d818b

+ 71 - 22
components/cm-module/cart-components/index.vue

@@ -783,34 +783,61 @@ export default {
 			this.goodsList.map((item, index) => {
 				//计算店铺满减后店铺合计
 				if (item.promotions && item.promotions.mode == 2) {
-					let prosPrice = 0
-					let totalOriginalPrice = 0 //商铺合计原价
+					let prosPrice = 0	// 店铺价格合计
+					let prosDiscountNum = 0 // 店铺促销叠加次数
+					let totalOriginalPrice = 0 //店铺原价合计
 					item.cartList.forEach(pros => {
 						prosPrice += pros.price * pros.number
 						totalOriginalPrice += pros.originalPrice * pros.number
 					})
-					if (prosPrice >= item.promotions.touchPrice) {
-						item.totalPrice = prosPrice - item.promotions.reducedPrice
-						item.reducedPrice = item.promotions.reducedPrice
-						item.totalOriginalPrice = totalOriginalPrice
-					} else {
-						item.reducedPrice = 0 //统计合计价格
-						item.totalPrice = prosPrice
+					if(item.promotions.discount == 1){// 支持促销叠加条件的店铺满减 执行
+						prosDiscountNum = parseInt(prosPrice/item.promotions.touchPrice) // 店铺满减促销叠加次数 = 店铺合计价格/满减促销价格
+						console.log('店铺满减促销叠加通道叠加次数',prosDiscountNum)
+						if (prosPrice >= item.promotions.touchPrice) {// 满足店铺满减条件下执行
+							item.totalPrice = prosPrice - item.promotions.reducedPrice*prosDiscountNum
+							item.reducedPrice = item.promotions.reducedPrice*prosDiscountNum
+							item.totalOriginalPrice = totalOriginalPrice
+						} else {
+							item.reducedPrice = 0 //统计合计价格
+							item.totalPrice = prosPrice
+						}
+					}else{
+						console.log('店铺满减非促销叠加通道')
+						if (prosPrice >= item.promotions.touchPrice) {// 满足店铺满减条件下执行
+							item.totalPrice = prosPrice - item.promotions.reducedPrice
+							item.reducedPrice = item.promotions.reducedPrice
+							item.totalOriginalPrice = totalOriginalPrice
+						} else {
+							item.reducedPrice = 0 //统计合计价格
+							item.totalPrice = prosPrice
+						}
 					}
 				} else {
 					//以下为计算除店铺满减以外的单品满减以及正常商品合计
 					let _totalPrice = 0
 					let _reducedPrice = 0
+					let _discountNum = 0
 					let _totalOriginalPrice = 0
 					item.cartList.forEach(pros => {
 						let _price = pros.price * pros.number
-						_totalOriginalPrice += pros.price * pros.number
+						_totalOriginalPrice += _price
 						if (pros.promotions && pros.promotions.type != 2 && pros.promotions.mode == 2) {
-							if (_price >= pros.promotions.touchPrice) {
-								_price = _price - pros.promotions.reducedPrice
-								_reducedPrice += pros.promotions.reducedPrice
+							if(pros.promotions.discount == 1){
+								_discountNum = parseInt(_price/pros.promotions.touchPrice)
+								console.log('单品满减促销叠加通道叠加次数',_discountNum)
+								if (_price >= pros.promotions.touchPrice) {
+									_price = _price - pros.promotions.reducedPrice*_discountNum
+									_reducedPrice += pros.promotions.reducedPrice*_discountNum
+								}
+								_totalPrice += _price
+							}else{
+								console.log('单品满减非促销叠加通道')
+								if (_price >= pros.promotions.touchPrice) {
+									_price = _price - pros.promotions.reducedPrice
+									_reducedPrice += pros.promotions.reducedPrice
+								}
+								_totalPrice += _price
 							}
-							_totalPrice += _price
 						} else {
 							_reducedPrice = 0
 							_totalPrice += pros.price * pros.number
@@ -847,20 +874,42 @@ export default {
 						}
 						// 单品满减
 						if (pros.promotions && pros.promotions.type * 1 === 1 && pros.promotions.mode * 1 === 2) {
-							// 单品满减-重新计算供应商总价/满减金额
-							if (pros.price * pros.number >= pros.promotions.touchPrice) {
-								supplierPrice -= pros.promotions.reducedPrice
-								supplierReducedPrice += pros.promotions.reducedPrice
+							let _price = pros.price * pros.number
+							if(pros.promotions.discount == 1){
+								let _discountNum = parseInt(_price/pros.promotions.touchPrice)
+								console.log('单品满减促销叠加通道叠加次数',_discountNum)
+								// 单品满减-重新计算供应商总价/满减金额
+								if ( _price >= pros.promotions.touchPrice) {
+									supplierPrice -= pros.promotions.reducedPrice*_discountNum
+									supplierReducedPrice += pros.promotions.reducedPrice*_discountNum
+								}
+							}else{
+								console.log(' 单品满减非促销叠加通道')
+								// 单品满减-重新计算供应商总价/满减金额
+								if ( _price >= pros.promotions.touchPrice) {
+									supplierPrice -= pros.promotions.reducedPrice
+									supplierReducedPrice += pros.promotions.reducedPrice
+								}
 							}
 						}
 					}
 				})
 				// 店铺满减
 				if (item.promotions && item.promotions.mode * 1 === 2) {
-					// 店铺满减-计算供应商总价/满减金额
-					if (supplierPrice >= item.promotions.touchPrice) {
-						supplierPrice -= item.promotions.reducedPrice
-						supplierReducedPrice += item.promotions.reducedPrice
+					if(item.promotions.discount == 1){// 支持促销叠加条件的店铺满减 执行
+						let prosDiscountNum = parseInt(supplierPrice/item.promotions.touchPrice) // 店铺满减促销叠加次数 = 店铺合计价格/满减促销价格
+						console.log('店铺满减促销叠加通道叠加次数',prosDiscountNum)
+						if (supplierPrice >= item.promotions.touchPrice) {
+							supplierPrice -= item.promotions.reducedPrice*prosDiscountNum
+							supplierReducedPrice += item.promotions.reducedPrice*prosDiscountNum
+						}
+					}else{
+						console.log('店铺满减非促销叠加通道')
+						// 店铺满减-计算供应商总价/满减金额
+						if (supplierPrice >= item.promotions.touchPrice) {
+							supplierPrice -= item.promotions.reducedPrice
+							supplierReducedPrice += item.promotions.reducedPrice
+						}
 					}
 				}
 				item.totalprice = supplierPrice

+ 252 - 185
pages/goods/goods-supporting.vue

@@ -25,155 +25,206 @@
 							<view class="tui-goods-image" @click.stop="navToDetailPage(pros.productId)"
 								><image :src="pros.image" class="tui-goods-img" />
 							</view>
-							<view
-								class="tui-goods-info"
-								@click.stop="navToDetailPage(pros.productId)"
-							>
-								<text class="list-details-title">{{ pros.name }}</text>
-								<text class="list-details-specs">规格:{{ pros.unit != null ? pros.unit : '' }}</text>
-								<template v-if="userIdentity == 4">
-									<view class="list-details-price" v-if="pros.priceFlag == 1">
-										<view class="list-none"><view class="price-small">¥未公开价格</view></view>
-									</view>
-									<view class="list-details-price" v-else-if="pros.priceFlag == 2">
-										<view class="list-none"><view class="price-small">¥价格仅会员可见</view></view>
-									</view>
-									<template v-else>
-										<view class="list-details-price">
-											<view class="list-price">
-												<text
-													class="price-larger"
-													:class="
-														PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
-															? 'none'
-															: ''
-													"
-												>
-													¥{{
-														(PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
-															? pros.originalPrice
-															: pros.price) | NumFormat
-													}}
-												</text>
+							<view class="tui-goods-info">
+								<text class="list-details-title" @click.stop="navToDetailPage(pros.productId)">{{
+									pros.name
+								}}</text>
+								<text class="list-details-specs" @click.stop="navToDetailPage(pros.productId)"
+									>规格:{{ pros.unit != null ? pros.unit : '' }}</text
+								>
+								<template v-if="hasLogin">
+									<template v-if="userIdentity == 4">
+										<view class="list-details-price" v-if="pros.priceFlag == 1">
+											<view class="list-none"><view class="price-small">¥未公开价格</view></view>
+										</view>
+										<view class="list-details-price" v-else-if="pros.priceFlag == 2">
+											<view class="list-none"><view class="price-small">¥价格仅会员可见</view></view>
+										</view>
+										<template v-else>
+											<view class="list-details-price">
+												<view class="list-price">
+													<text
+														class="price-larger"
+														:class="
+															PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
+																? 'none'
+																: ''
+														"
+													>
+														¥{{
+															(PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
+																? pros.originalPrice
+																: pros.price) | NumFormat
+														}}
+													</text>
+												</view>
+												<view class="add-cart-btn">
+													<view class="number-box">
+														<view
+															class="iconfont icon-jianhao"
+															@click="changeCountSub(pros)"
+														></view>
+														<input
+															class="btn-input"
+															type="number"
+															maxlength="4"
+															v-model="pros.number"
+															@blur="changeNumber($event,pros)"
+															@focus="changeInput(pros)"
+														/>
+														<view
+															class="iconfont icon-jiahao"
+															@click="changeCountAdd(pros)"
+														></view>
+													</view>
+												</view>
 											</view>
-											<view class="add-cart-btn">
-												<view class="number-box">
-													<view
-														class="iconfont icon-jianhao"
-														@click="changeCountSub(item, pros)"
-													></view>
-													<input
-														class="btn-input"
-														type="number"
-														maxlength="4"
-														v-model="pros.number"
-														@blur="changeNnmber($event, item, pros)"
-														@focus="changeInput(pros)"
-													/>
-													<view
-														class="iconfont icon-jiahao"
-														@click="changeCountAdd(item, pros)"
-													></view>
+											<view class="list-details-price none">
+												<view class="floor-item-act">
+													<view class="coupon-tags" v-if="item.product.couponsLogo">优惠券</view>
+													<template v-if="pros.actStatus == 1">
+														<view
+															class="floor-tags"
+															v-if="pros.actStatus == 1 && PromotionsFormat(pros.promotions)"
+														>
+															{{ pros.promotions.name }}
+															<text
+																v-if="hasLogin && userIdentity == 2 && pros.priceFlag != 1"
+																>:¥{{ pros.price | NumFormat }}</text
+															>
+														</view>
+														<view class="floor-tags" v-else>{{ pros.promotions.name }}</view>
+													</template>
+													<template v-if="pros.svipProductFlag == 1">
+														<view class="svip-tags">
+															<view class="tags" :class="{ none: vipFlag == 0 }">SVIP</view>
+															<view class="price" v-if="isShowVipFlag(pros)">{{
+																pros.svipPriceTag
+															}}</view>
+														</view>
+													</template>
 												</view>
 											</view>
+										</template>
+									</template>
+									<template v-else>
+										<view class="list-details-price" v-if="pros.priceFlag == 1">
+											<view class="list-none"><view class="price-small">¥未公开价格</view></view>
 										</view>
-										<view class="list-details-price none">
-											<view class="floor-item-act">
-												<view class="coupon-tags" v-if="item.product.couponsLogo">优惠券</view>
-												<template v-if="pros.actStatus == 1">
-													<view
-														class="floor-tags"
-														v-if="pros.actStatus == 1 && PromotionsFormat(pros.promotions)"
+										<template v-else>
+											<view class="list-details-price">
+												<view class="list-price">
+													<text
+														class="price-larger"
+														:class="
+															PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
+																? 'none'
+																: ''
+														"
 													>
-														{{ pros.promotions.name }}
-														<text
-															v-if="hasLogin && userIdentity == 2 && pros.priceFlag != 1"
-															>:¥{{ pros.price | NumFormat }}</text
-														>
-													</view>
-													<view class="floor-tags" v-else>{{ pros.promotions.name }}</view>
-												</template>
-												<template v-if="pros.svipProductFlag == 1">
-													<view class="svip-tags">
-														<view class="tags" :class="{ none: vipFlag == 0 }">SVIP</view>
-														<view class="price" v-if="isShowVipFlag(pros)">{{
-															pros.svipPriceTag
-														}}</view>
+														¥{{
+															(PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
+																? pros.originalPrice
+																: pros.price) | NumFormat
+														}}
+													</text>
+												</view>
+												<view class="add-cart-btn">
+													<view class="number-box">
+														<view
+															class="iconfont icon-jianhao"
+															:class="[isQuantity == true ? 'disabled' : '']"
+															@click="changeCountSub(pros)"
+														></view>
+														<input
+															class="btn-input"
+															type="number"
+															maxlength="4"
+															v-model="pros.number"
+															@blur="changeNumber($event,pros)"
+															@focus="changeInput(pros)"
+														/>
+														<view
+															class="iconfont icon-jiahao"
+															:class="[isStock == true ? 'disabled' : '']"
+															@click="changeCountAdd(pros)"
+														></view>
 													</view>
-												</template>
+												</view>
 											</view>
-										</view>
+											<view class="list-details-price none">
+												<view class="floor-item-act">
+													<template v-if="pros.actStatus == 1">
+														<view
+															class="floor-tags"
+															v-if="pros.actStatus == 1 && PromotionsFormat(pros.promotions)"
+														>
+															{{ pros.promotions.name }}
+															<text
+																v-if="hasLogin && userIdentity == 2 && pros.priceFlag != 1"
+																>:¥{{ pros.price | NumFormat }}</text
+															>
+														</view>
+														<view class="floor-tags" v-else>{{ pros.promotions.name }}</view>
+													</template>
+													<template v-if="pros.svipProductFlag == 1">
+														<view class="svip-tags">
+															<view class="tags" :class="{ none: vipFlag == 0 }">SVIP</view>
+															<view class="price" v-if="isShowVipFlag(pros)">{{
+																pros.svipPriceTag
+															}}</view>
+														</view>
+													</template>
+												</view>
+											</view>
+										</template>
 									</template>
 								</template>
 								<template v-else>
-									<view class="list-details-price" v-if="pros.priceFlag == 1">
-										<view class="list-none"><view class="price-small">¥未公开价格</view></view>
+									<view class="list-details-price">
+										<view class="p-stars">
+											<text class="p-no">¥</text>
+											<uni-grader :grade="Number(pros.priceGrade)" :margin="14"></uni-grader>
+										</view>
+										<view class="add-cart-btn">
+											<view class="number-box">
+												<view
+													class="iconfont icon-jianhao"
+													@click="changeCountSub(pros)"
+												></view>
+												<input
+													class="btn-input"
+													type="number"
+													maxlength="4"
+													v-model="pros.number"
+													@blur="changeNumber($event, pros)"
+													@focus="changeInput(pros)"
+												/>
+												<view
+													class="iconfont icon-jiahao"
+													@click="changeCountAdd(pros)"
+												></view>
+											</view>
+										</view>
 									</view>
-									<template v-else>
-										<view class="list-details-price">
-											<view class="list-price">
-												<text
-													class="price-larger"
-													:class="
-														PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
-															? 'none'
-															: ''
-													"
+									<view class="list-details-price none">
+										<view class="floor-item-act">
+											<template v-if="pros.actStatus == 1">
+												<view
+													class="floor-tags"
+													v-if="pros.actStatus == 1 && PromotionsFormat(pros.promotions)"
 												>
-													¥{{
-														(PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
-															? pros.originalPrice
-															: pros.price) | NumFormat
-													}}
-												</text>
-											</view>
-											<view class="add-cart-btn">
-												<view class="number-box">
-													<view
-														class="iconfont icon-jianhao"
-														@click="changeCountSub(item, pros)"
-													></view>
-													<input
-														class="btn-input"
-														type="number"
-														maxlength="4"
-														v-model="pros.number"
-														@blur="changeNnmber($event, item, pros)"
-														@focus="changeInput(pros)"
-													/>
-													<view
-														class="iconfont icon-jiahao"
-														@click="changeCountAdd(item, pros)"
-													></view>
+													{{ pros.promotions.name }}
 												</view>
-											</view>
-										</view>
-										<view class="list-details-price none">
-											<view class="floor-item-act">
-												<template v-if="pros.actStatus == 1">
-													<view
-														class="floor-tags"
-														v-if="pros.actStatus == 1 && PromotionsFormat(pros.promotions)"
-													>
-														{{ pros.promotions.name }}
-														<text
-															v-if="hasLogin && userIdentity == 2 && pros.priceFlag != 1"
-															>:¥{{ pros.price | NumFormat }}</text
-														>
-													</view>
-													<view class="floor-tags" v-else>{{ pros.promotions.name }}</view>
-												</template>
-												<template v-if="pros.svipProductFlag == 1">
-													<view class="svip-tags">
-														<view class="tags" :class="{ none: vipFlag == 0 }">SVIP</view>
-														<view class="price" v-if="isShowVipFlag(pros)">{{
-															pros.svipPriceTag
-														}}</view>
-													</view>
-												</template>
-											</view>
+												<view class="floor-tags" v-else>{{ pros.promotions.name }}</view>
+											</template>
+											<template v-if="pros.svipProductFlag == 1">
+												<view class="svip-tags">
+													<view class="tags none">SVIP</view>
+												</view>
+											</template>
 										</view>
-									</template>
+									</view>
 								</template>
 							</view>
 						</view>
@@ -199,8 +250,8 @@
 								<view class="text">全选</view>
 							</view>
 						</view>
-						<view class="tui-button buy" @click="handleAllUnder">立即购买</view>
-						<view class="tui-button add" @click="handleAllUnder">加入购物车</view>
+						<view class="tui-button buy" @click="handleSupportingSubmit('buy')">立即购买</view>
+						<view class="tui-button add" @click="handleSupportingSubmit('add')">加入购物车</view>
 					</view>
 				</view>
 			</view>
@@ -223,6 +274,7 @@
 <script>
 import tuiLoadmore from '@/components/tui-components/loadmore/loadmore'
 import tuiNomore from '@/components/tui-components/nomore/nomore'
+import uniGrader from '@/components/uni-grade/uni-grade.vue'
 
 import { mapState, mapMutations } from 'vuex'
 const defaultListQuery = {
@@ -233,7 +285,8 @@ const defaultListQuery = {
 export default {
 	components: {
 		tuiLoadmore,
-		tuiNomore
+		tuiNomore,
+		uniGrader
 	},
 	data() {
 		return {
@@ -276,7 +329,9 @@ export default {
 			contentModalText: '', //操作文字提示语句
 			modal: false,
 			vipFlag: 0,
-			userIdentity: 0
+			userIdentity: 0,
+			isQuantity: false,
+			isStock: false,
 		}
 	},
 	onLoad() {
@@ -313,7 +368,11 @@ export default {
 						this.isEmpty = false
 						this.hasNextPage = data.hasNextPage
 						this.totalRecord = data.totalRecord
-						this.productList = data.results
+						this.productList = data.results.map((el,index)=>{
+								el.isChecked = false
+								el.number = el.minBuyNumber
+								return el
+							})
 						this.pullFlag = false
 						setTimeout(() => {
 							this.pullFlag = true
@@ -378,21 +437,18 @@ export default {
 					console.log('获取购物车数量失败')
 				})
 		},
-		handleAllUnder() {
-			//批量下架操作
-			let checkedArray = []
-			this.productIds = ''
-			if (this.isProductChecked) {
-				this.productList.forEach(el => {
-					if (el.isChecked) {
-						checkedArray.push(el)
-					}
-				})
-				checkedArray.forEach(el => {
-					this.productIds += el.productId + ','
-				})
-				this.modal = true
-				this.contentModalText = '确定要取消收藏吗?'
+		handleSupportingSubmit(type){
+			if(this.hasLogin){
+				switch(type){
+					case 'buy':
+						console.log('立即购买')
+						break
+					case 'add':
+						console.log('加入购物车')
+						break
+				}
+			}else{
+				this.$api.navigateTo('/pages/login/login')
 			}
 		},
 		handleClick(e) {
@@ -469,53 +525,53 @@ export default {
 			}
 			return false
 		},
-		changeCountAdd() {
+		changeCountAdd(pros) {
 			//popup弹窗数量增加按钮
-			if (this.buyRetailPriceStep == 2) {
-				this.number += this.minBuyNumber
+			if (pros.step == 2) {
+				pros.number += pros.minBuyNumber
 			} else {
-				this.number++
+				pros.number++
 			}
 			this.calculatPerice()
 		},
-		changeCountSub() {
+		changeCountSub(pros) {
 			//popup弹窗数量减按钮
-			if (this.number <= this.minBuyNumber) {
-				this.number = this.minBuyNumber
+			if (pros.number <= pros.minBuyNumber) {
+				pros.number = pros.minBuyNumber
 				this.isQuantity = true
 				this.$util.msg(`该商品最小起订量为${this.minBuyNumber}`, 2000)
 				return
 			} else {
-				if (this.buyRetailPriceStep == 2) {
-					this.number -= this.minBuyNumber
+				if (pros.step == 2) {
+					pros.number -= pros.minBuyNumber
 				} else {
-					this.number--
+					pros.number--
 				}
 				this.calculatPerice()
 				this.isQuantity = false
 			}
 		},
-		changeNumber(e) {
+		changeNumber(e,pros) {
 			let _value = e.detail.value
 			if (!this.$api.isNumber(_value)) {
-				this.number = this.minBuyNumber
-			} else if (_value < this.minBuyNumber) {
-				this.$util.msg(`该商品最小起订量为${this.minBuyNumber}`, 2000)
-				this.number = this.minBuyNumber
-			} else if (_value % this.minBuyNumber != 0) {
+				pros.number = pros.minBuyNumber
+			} else if (_value < pros.minBuyNumber) {
+				this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`, 2000)
+				pros.number = pros.minBuyNumber
+			} else if (_value % pros.minBuyNumber != 0) {
 				this.$util.msg('购买量必须为起订量的整数倍', 2000)
-				this.number = this.minBuyNumber
+				pros.number = pros.minBuyNumber
 			} else {
-				this.number = e.detail.value
-				this.calculatPerice()
+				pros.number = e.detail.value
+				this.calculatPerice(pros)
 			}
 		},
-		calculatPerice() {
+		calculatPerice(pros) {
 			//判断是否为阶梯价然后做计算价格处理
-			if (this.handleData.ladderPriceFlag == 1) {
-				this.handleData.ladderPrices.forEach((item, index) => {
-					if (this.number >= item.buyNum) {
-						this.buyRetailPrice = item.buyPrice
+			if (pros.ladderPriceFlag == 1) {
+				pros.ladderPrices.forEach((el, index) => {
+					if (pros.number >= el.buyNum) {
+						pros.price = el.buyPrice
 					}
 				})
 			}
@@ -582,11 +638,13 @@ export default {
 		},
 		isShowVipFlag(pros) {
 			// 超级会员价格显示控制
-			if (pros.priceFlag != 1) {
-				if (this.userIdentity == 4 && this.vipFlag == 1) {
-					return true
-				} else if (this.userIdentity == 2) {
-					return true
+			if(this.hasLogin){
+				if (pros.priceFlag != 1) {
+					if (this.userIdentity == 4 && this.vipFlag == 1) {
+						return true
+					} else if (this.userIdentity == 2) {
+						return true
+					}
 				}
 			}
 		},
@@ -612,7 +670,7 @@ export default {
 		if (this.hasNextPage) {
 			this.loadding = true
 			this.pullUpOn = true
-			this.GetOnReachBottomData()
+			// this.GetOnReachBottomData()
 		}
 	},
 	onPullDownRefresh() {
@@ -756,6 +814,15 @@ page {
 		width: 100%;
 		line-height: 54rpx;
 		float: left;
+		.p-stars {
+			float: left;
+			.p-no{
+				font-size: $font-size-28;
+				color: $text-color;
+				display: block;
+				float: left;
+			}
+		}
 		&.none {
 			height: 32rpx;
 			line-height: 32rpx;

+ 70 - 20
pages/seller/cart/cart.vue

@@ -643,34 +643,61 @@ export default {
 			this.goodsList.map((item, index) => {
 				//计算店铺满减后店铺合计
 				if (item.promotions && item.promotions.mode == 2) {
-					let prosPrice = 0
-					let totalOriginalPrice = 0 //商铺合计原价
+					let prosPrice = 0	// 店铺价格合计
+					let prosDiscountNum = 0 // 店铺促销叠加次数
+					let totalOriginalPrice = 0 //店铺原价合计
 					item.cartList.forEach(pros => {
 						prosPrice += pros.price * pros.number
 						totalOriginalPrice += pros.price * pros.number
 					})
-					if (prosPrice >= item.promotions.touchPrice) {
-						item.totalPrice = prosPrice - item.promotions.reducedPrice
-						item.reducedPrice = item.promotions.reducedPrice
-						item.totalOriginalPrice = totalOriginalPrice
-					} else {
-						item.reducedPrice = 0 //统计合计价格
-						item.totalPrice = prosPrice
+					if(item.promotions.discount == 1){// 支持促销叠加条件的店铺满减 执行
+						prosDiscountNum = parseInt(prosPrice/item.promotions.touchPrice) // 店铺满减促销叠加次数 = 店铺合计价格/满减促销价格
+						console.log('店铺满减促销叠加通道叠加次数',prosDiscountNum)
+						if (prosPrice >= item.promotions.touchPrice) {// 满足店铺满减条件下执行
+							item.totalPrice = prosPrice - item.promotions.reducedPrice*prosDiscountNum
+							item.reducedPrice = item.promotions.reducedPrice*prosDiscountNum
+							item.totalOriginalPrice = totalOriginalPrice
+						} else {
+							item.reducedPrice = 0 //统计合计价格
+							item.totalPrice = prosPrice
+						}
+					}else{
+						console.log('店铺满减非促销叠加通道')
+						if (prosPrice >= item.promotions.touchPrice) {// 满足店铺满减条件下执行
+							item.totalPrice = prosPrice - item.promotions.reducedPrice
+							item.reducedPrice = item.promotions.reducedPrice
+							item.totalOriginalPrice = totalOriginalPrice
+						} else {
+							item.reducedPrice = 0 //统计合计价格
+							item.totalPrice = prosPrice
+						}
 					}
 				} else {
 					//以下为计算除店铺满减以外的单品满减以及正常商品合计
 					let _totalPrice = 0
 					let _reducedPrice = 0
+					let _discountNum = 0
 					let _totalOriginalPrice = 0
 					item.cartList.forEach(pros => {
 						let _price = pros.price * pros.number
 						_totalOriginalPrice += pros.price * pros.number
 						if (pros.promotions && pros.promotions.type != 2 && pros.promotions.mode == 2) {
-							if (_price >= pros.promotions.touchPrice) {
-								_price = _price - pros.promotions.reducedPrice
-								_reducedPrice += pros.promotions.reducedPrice
+							if(pros.promotions.discount == 1){
+								_discountNum = parseInt(_price/pros.promotions.touchPrice)
+								console.log('单品满减促销叠加通道叠加次数',_discountNum)
+								if (_price >= pros.promotions.touchPrice) {
+									_price = _price - pros.promotions.reducedPrice*_discountNum
+									_reducedPrice += pros.promotions.reducedPrice*_discountNum
+								}
+								_totalPrice += _price
+							}else{
+								console.log('单品满减非促销叠加通道')
+								if (_price >= pros.promotions.touchPrice) {
+									_price = _price - pros.promotions.reducedPrice
+									_reducedPrice += pros.promotions.reducedPrice
+								}
+								_totalPrice += _price
 							}
-							_totalPrice += _price
 						} else {
 							_reducedPrice = 0
 							_totalPrice += pros.price * pros.number
@@ -694,15 +721,27 @@ export default {
 				item.reducedprice = 0
 				item.originalprice = 0
 				item.cartList.forEach(pros => {
-					debugger
 					if (pros.isChecked) {
 						supplierPrice += pros.price * pros.number
 						// 单品满减
 						if (pros.promotions && pros.promotions.type * 1 === 1 && pros.promotions.mode * 1 === 2) {
 							// 单品满减-重新计算供应商总价/满减金额
-							if (pros.price * pros.number >= pros.promotions.touchPrice) {
-								supplierPrice -= pros.promotions.reducedPrice
-								supplierReducedPrice += pros.promotions.reducedPrice
+							let _price = pros.price * pros.number
+							if(pros.promotions.discount == 1){
+								let _discountNum = parseInt(_price/pros.promotions.touchPrice)
+								console.log('促销叠加通道叠加次数',_discountNum)
+								// 单品满减-重新计算供应商总价/满减金额
+								if ( _price >= pros.promotions.touchPrice) {
+									supplierPrice -= pros.promotions.reducedPrice*_discountNum
+									supplierReducedPrice += pros.promotions.reducedPrice*_discountNum
+								}
+							}else{
+								console.log('非促销叠加通道')
+								// 单品满减-重新计算供应商总价/满减金额
+								if ( _price >= pros.promotions.touchPrice) {
+									supplierPrice -= pros.promotions.reducedPrice
+									supplierReducedPrice += pros.promotions.reducedPrice
+								}
 							}
 						}
 					}
@@ -710,9 +749,20 @@ export default {
 				// 店铺满减
 				if (item.promotions && item.promotions.mode * 1 === 2) {
 					// 店铺满减-计算供应商总价/满减金额
-					if (supplierPrice >= item.promotions.touchPrice) {
-						supplierPrice -= item.promotions.reducedPrice
-						supplierReducedPrice += item.promotions.reducedPrice
+					if(item.promotions.discount == 1){// 支持促销叠加条件的店铺满减 执行
+						let prosDiscountNum = parseInt(supplierPrice/item.promotions.touchPrice) // 店铺满减促销叠加次数 = 店铺合计价格/满减促销价格
+						console.log('店铺满减促销叠加通道叠加次数',prosDiscountNum)
+						if (supplierPrice >= item.promotions.touchPrice) {
+							supplierPrice -= item.promotions.reducedPrice*prosDiscountNum
+							supplierReducedPrice += item.promotions.reducedPrice*prosDiscountNum
+						}
+					}else{
+						console.log('店铺满减非促销叠加通道')
+						// 店铺满减-计算供应商总价/满减金额
+						if (supplierPrice >= item.promotions.touchPrice) {
+							supplierPrice -= item.promotions.reducedPrice
+							supplierReducedPrice += item.promotions.reducedPrice
+						}
 					}
 				}
 				item.totalprice = supplierPrice

+ 6 - 6
pages/user/order/create-order.vue

@@ -227,7 +227,7 @@
 				],
 				showModal: false,
 				showModalType:1,
-				showModalstauts:1
+				showModalstauts:0
 			}
 		},
 		onLoad(option){//商品数据
@@ -533,7 +533,7 @@
 				console.log('优惠券金额',this.couponAmount)
 			},
 			orderSubmitMit(){// 提交订单按钮点击事件
-				if(this.showModalstauts == 0){
+				if(this.orderShouldPayFee <1000){
 					this.showModal = true
 					this.contentModalText = '采购金额过小,将扣除500采美豆,建议您前往采美旗下“呵呵商城”小程序购买小额商品。'    //操作文字提示语句
 					this.modalButton= [
@@ -551,9 +551,9 @@
 							plain: false
 						}
 					]
-				}else if(this.showModalstauts == 1){
+				}else if(this.orderShouldPayFee <1000 && this.freightData.userBeans <0){
 					this.showModal = true
-					this.contentModalText = '您已有2个采购金额过小的订单,本次不能再进行采购。建议您前往采美旗下“呵呵商城”小程序购买小额商品。'   //操作文字提示语句
+					this.contentModalText = '您已有采美豆不足,不能提交订单。建议您前往采美旗下“呵呵商城”小程序购买小额商品。'   //操作文字提示语句
 					this.modalButton=[
 						{
 							text: '了解',
@@ -645,7 +645,7 @@
 			},
 			handleClick(e){// 采购量过小提示弹窗
 				if (e.index == 1) {
-					if(this.showModalstauts == 0){
+					if( this.orderShouldPayFee <1000 ){
 						this.showModal = false
 						this.handleClickOrderSubmitMit()
 					}else{
@@ -653,7 +653,7 @@
 						this.handleClickHeHeMiniApplet()
 					}
 				}else{
-					if(this.showModalstauts == 0){
+					if( this.orderShouldPayFee <1000 ){
 						this.showModal = false
 						this.handleClickHeHeMiniApplet()
 					}else{