|
@@ -148,6 +148,7 @@
|
|
|
isStock:'',
|
|
|
popupShow:false,
|
|
|
handlerPros:{},//监听单挑促销商品
|
|
|
+ promotionsList:[],//促销活动列表
|
|
|
goodsList:[], //购物车的商品
|
|
|
delGoodsList:'',//要删除的商品
|
|
|
setGoodData:'', //确认订单的商品
|
|
@@ -223,6 +224,7 @@
|
|
|
this.SellerService.GetSellerShoppingInfo(params).then(response =>{
|
|
|
this.skeletonShow = false
|
|
|
this.$store.commit('updateAllNum',response.data.cartQuantity)
|
|
|
+ this.promotionsList = response.data.promotionsList;
|
|
|
const resultsData = response.data.pageDate;
|
|
|
if(resultsData.results&&resultsData.results.length > 0){
|
|
|
this.isEmpty =false
|
|
@@ -270,6 +272,7 @@
|
|
|
let params = {clubId:this.clubId,serviceProviderId:this.serviceProviderId,pageNum:this.pageNum,pageSize:this.pageSize}
|
|
|
this.SellerService.GetSellerShoppingInfo(params).then(response =>{
|
|
|
let resultsData = response.data.pageDate
|
|
|
+ this.promotionsList = response.data.promotionsList;
|
|
|
this.hasNextPage = resultsData.hasNextPage;
|
|
|
this.goodsList = this.goodsList.concat(resultsData.results)
|
|
|
this.goodsList.forEach((item,index) => {
|
|
@@ -383,7 +386,7 @@
|
|
|
if(item.promotions && item.promotions.mode == 2){
|
|
|
productsList.forEach(pros=>{
|
|
|
prosPrice += pros.retailPrice*pros.productCount
|
|
|
- totalOriginalPrice+= pros.retailPrice*pros.productCount;
|
|
|
+ totalOriginalPrice += pros.retailPrice*pros.productCount;
|
|
|
if(prosPrice >= item.promotions.touchPrice){
|
|
|
item.totalPrice = prosPrice - item.promotions.reducedPrice
|
|
|
item.reducedPrice = item.promotions.reducedPrice
|
|
@@ -418,19 +421,23 @@
|
|
|
})
|
|
|
},
|
|
|
totalPeice(){ //计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
|
|
|
- this.allPrice = 0
|
|
|
+ this.allPrice = 0
|
|
|
let productsList =[];
|
|
|
//店铺满减
|
|
|
let prosPrice=0;
|
|
|
let totalPrice = 0;
|
|
|
let reducedPrice=0;//促销满减
|
|
|
let totalOriginalPrice=0;//促销原价
|
|
|
- //凑单满减.单品满减
|
|
|
+ //凑单满减.单品满减
|
|
|
let _totalPrice = 0;
|
|
|
+ let _promsPrice = 0;
|
|
|
let _reducedPrice = 0;
|
|
|
+ let _reducedPromsPrice = 0;
|
|
|
let _totalOriginalPrice =0;
|
|
|
// 正常商品
|
|
|
let _totalNonePrice = 0;
|
|
|
+ let _isFlag = false;
|
|
|
+ let _isShopFlag = false;
|
|
|
/*
|
|
|
*originalPrice:商品原价
|
|
|
*price:商品现价
|
|
@@ -438,21 +445,28 @@
|
|
|
*touchPrice 为需要满金额
|
|
|
*reducedPrice 为满减金额
|
|
|
**/
|
|
|
- this.goodsList.forEach((item,index)=>{
|
|
|
+ this.goodsList.forEach((item,index)=>{
|
|
|
item.productsList.forEach(pros=>{
|
|
|
- if(pros.productsChecked){
|
|
|
+ if(pros.productsChecked){
|
|
|
if(item.promotions && item.promotions.mode == 2){
|
|
|
- prosPrice = pros.retailPrice*pros.productCount
|
|
|
- totalOriginalPrice += pros.price1*pros.productCount //统计原商品价格
|
|
|
- if(prosPrice >= item.promotions.touchPrice){//判断如果商品合计价格已满足满减活动,计算价格
|
|
|
- totalPrice += prosPrice - item.promotions.reducedPrice //统计合计价格
|
|
|
- reducedPrice += item.promotions.reducedPrice //统计总减金额
|
|
|
- }else{
|
|
|
- reducedPrice = 0 //将满减金额置为0
|
|
|
- totalPrice += prosPrice //未达满减的统计合计价格
|
|
|
+ this.promotionsList.forEach(proms =>{
|
|
|
+ if (item.promotions.id == proms.id){
|
|
|
+ _isShopFlag = true;
|
|
|
+ prosPrice += pros.retailPrice*pros.productCount
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(_isShopFlag){
|
|
|
+ if(prosPrice >= item.promotions.touchPrice){//判断如果商品合计价格已满足满减活动,计算价格
|
|
|
+ totalPrice = prosPrice - item.promotions.reducedPrice //统计合计价格
|
|
|
+ totalOriginalPrice += pros.price1*pros.productCount //统计原商品价格
|
|
|
+ reducedPrice = item.promotions.reducedPrice //统计总减金额
|
|
|
+ }else{
|
|
|
+ totalPrice += prosPrice //未达满减的统计合计价格
|
|
|
+ }
|
|
|
}
|
|
|
- }else if(pros.promotions && pros.promotions.mode == 2){//以下为计算除店铺满减以外的单品满减以及正常商品
|
|
|
- let _price = pros.retailPrice*pros.productCount
|
|
|
+ }else if(pros.promotions && pros.promotions.type == 1 && pros.promotions.mode == 2){//以下为计算除店铺满减以外的单品满减
|
|
|
+ let _price = 0;
|
|
|
+ _price = pros.retailPrice*pros.productCount
|
|
|
_totalOriginalPrice += pros.price1*pros.productCount; //统计原商品价格
|
|
|
if(_price >= pros.promotions.touchPrice){//判断如果商品合计价格已满足满减活动,计算价格
|
|
|
_price = _price - pros.promotions.reducedPrice //商品满减后价格
|
|
@@ -461,15 +475,35 @@
|
|
|
_reducedPrice = 0 //将满减金额置为0
|
|
|
}
|
|
|
_totalPrice += _price //统计合计价格
|
|
|
+ }else if(pros.promotions && pros.promotions.type == 2 && pros.promotions.mode == 2){//凑单满减计算合计
|
|
|
+ let _price = 0;
|
|
|
+ this.promotionsList.forEach(proms =>{
|
|
|
+ proms.products.forEach(el =>{
|
|
|
+ if (pros.productID == el.productID){
|
|
|
+ _isFlag = true;
|
|
|
+ _price += pros.retailPrice*pros.productCount
|
|
|
+ _totalOriginalPrice += pros.price1*pros.productCount; //统计原商品价格
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(_price >= pros.promotions.touchPrice){//判断如果商品合计价格已满足满减活动,计算价格
|
|
|
+ _reducedPromsPrice = pros.promotions.reducedPrice //统计总减金额
|
|
|
+ }else{
|
|
|
+ _reducedPromsPrice = 0 //将满减金额置为0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ _promsPrice += _price//统计合计价格
|
|
|
}else{
|
|
|
_totalNonePrice += pros.retailPrice*pros.productCount; //正常商品的价格总计
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
- this.totalOriginalPrice = totalOriginalPrice + _totalOriginalPrice;
|
|
|
- this.reducedPrice = reducedPrice +_reducedPrice;
|
|
|
- this.allPrice = totalPrice + _totalPrice + _totalNonePrice;
|
|
|
- })
|
|
|
+ })
|
|
|
+ if(_isFlag){
|
|
|
+ _promsPrice = _promsPrice - _reducedPromsPrice
|
|
|
+ }
|
|
|
+ this.totalOriginalPrice = totalOriginalPrice + _totalOriginalPrice;
|
|
|
+ this.reducedPrice = reducedPrice + _reducedPrice + _reducedPromsPrice;
|
|
|
+ this.allPrice = totalPrice + _totalPrice + _promsPrice + _totalNonePrice;
|
|
|
},
|
|
|
totalCount(){//计算总数量
|
|
|
this.allCount = 0
|
|
@@ -727,7 +761,7 @@
|
|
|
box-sizing: border-box;
|
|
|
padding: 15rpx 24rpx;
|
|
|
background-color: #F7F7F7;
|
|
|
- z-index: 9999;
|
|
|
+ z-index: 990;
|
|
|
.foot-text{
|
|
|
font-size: $font-size-26;
|
|
|
height: 50rpx;
|
|
@@ -750,7 +784,7 @@
|
|
|
border-radius: 30rpx;
|
|
|
background:#FFFFFF;
|
|
|
border: 1px solid #C9C9C9;
|
|
|
- color: #999999;
|
|
|
+ color: #E15616;
|
|
|
float: right;
|
|
|
text-align: center;
|
|
|
&.none{
|