|
@@ -21,12 +21,12 @@
|
|
|
<view class="shoptitle">
|
|
|
<!--选择商店的全部商品"-->
|
|
|
<view class="checkbox-box" @click.stop="checkShop(item)">
|
|
|
- <view class="checkbox iconfont" :class="[item.checked ?'icon-yixuanze':'icon-weixuanze']"></view>
|
|
|
+ <view class="checkbox iconfont" :class="[item.isChecked ?'icon-yixuanze':'icon-weixuanze']"></view>
|
|
|
</view>
|
|
|
<view v-if="item.promotions" class="floor-item-act">
|
|
|
<view class="floor-tags" @click.stop="clickPopupShow(item,2)">{{item.promotions.name}}</view>
|
|
|
</view>
|
|
|
- <view class="text">{{item.name}}</view>
|
|
|
+ <view class="text">{{item.shopName}}</view>
|
|
|
<view class="text-coupon" @click="showPopup(0,item)" v-if="item.couponsLogo">领券</view>
|
|
|
</view>
|
|
|
<view class="productlist">
|
|
@@ -34,7 +34,7 @@
|
|
|
<view class="goods-pros-t">
|
|
|
<!--选择商品-->
|
|
|
<view class="checkbox-box" @click.stop="ischeck(item,pros)">
|
|
|
- <view class="checkbox iconfont" :class="[pros.productsChecked ? 'icon-yixuanze':'icon-weixuanze']"></view>
|
|
|
+ <view class="checkbox iconfont" :class="[pros.isChecked ? 'icon-yixuanze':'icon-weixuanze']"></view>
|
|
|
</view>
|
|
|
<view class="pros-img" @click.stop="navToListPage(pros.productId)" ><image :src="pros.image ? pros.image:''" alt="" /></view>
|
|
|
<view class="pros-product">
|
|
@@ -93,7 +93,7 @@
|
|
|
<!--选择商品-->
|
|
|
<view class="checkbox-box" @click.stop="ischeckFailure(failure)" v-if="isshowDelbtn">
|
|
|
<button class="checkbox iconfont"
|
|
|
- :class="[ failure.productsChecked ? 'icon-yixuanze':'icon-weixuanze']">
|
|
|
+ :class="[ failure.isChecked ? 'icon-yixuanze':'icon-weixuanze']">
|
|
|
</button>
|
|
|
</view>
|
|
|
<text class="img-tip">失效</text>
|
|
@@ -456,7 +456,7 @@
|
|
|
this.goodsList = data.list;
|
|
|
this.goodsList.forEach((item,index) => {
|
|
|
item.cartList.forEach(pros => {
|
|
|
- pros.shopID = item.shopID;
|
|
|
+ pros.shopId = item.shopId;
|
|
|
pros.isStep = false
|
|
|
if(pros.step === 2){
|
|
|
if(pros.number % pros.min != 0){
|
|
@@ -490,12 +490,12 @@
|
|
|
})
|
|
|
},
|
|
|
ischeckFailure(failure){
|
|
|
- failure.productsChecked = !failure.productsChecked
|
|
|
+ failure.isChecked = !failure.isChecked
|
|
|
this.updateCheckAllBtn()
|
|
|
},
|
|
|
ischeck(item,pro){//为未选中的时候改变为true,反之为true
|
|
|
- pro.productsChecked = !pro.productsChecked;
|
|
|
- if(pro.productsChecked) {
|
|
|
+ pro.isChecked = !pro.isChecked;
|
|
|
+ if(pro.isChecked) {
|
|
|
if(!this.submitIds.includes(pro.productID*1)){
|
|
|
this.submitIds.push(pro.productID);
|
|
|
}
|
|
@@ -515,30 +515,30 @@
|
|
|
disabledLength = 0;
|
|
|
if(this.isshowDelbtn) {
|
|
|
productsList.forEach(pros => {
|
|
|
- if(pros.productsChecked) {
|
|
|
+ if(pros.isChecked) {
|
|
|
productsCheckedLength++;
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
productsList.forEach(pros => {
|
|
|
- if(pros.productsChecked) {
|
|
|
+ if(pros.isChecked) {
|
|
|
productsCheckedLength++;
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- item.checked = productsCheckedLength === productsList.length;
|
|
|
+ item.isChecked = productsCheckedLength === productsList.length;
|
|
|
},
|
|
|
updateCheckAllBtn() {// 全选勾选判断
|
|
|
let goodsCheckedLength = 0,
|
|
|
goodsList = this.goodsList,
|
|
|
failureList = this.failureList;
|
|
|
goodsList.forEach(item => {
|
|
|
- if(item.checked) {
|
|
|
+ if(item.isChecked) {
|
|
|
goodsCheckedLength++;
|
|
|
}
|
|
|
})
|
|
|
failureList.forEach(failureItem=>{
|
|
|
- if(failureItem.productsChecked){
|
|
|
+ if(failureItem.isChecked){
|
|
|
goodsCheckedLength++;
|
|
|
}
|
|
|
})
|
|
@@ -549,19 +549,19 @@
|
|
|
}
|
|
|
},
|
|
|
checkShop(item){//与单选商品类似
|
|
|
- item.checked = !item.checked;
|
|
|
+ item.isChecked = !item.isChecked;
|
|
|
this.setProductChecked(item);
|
|
|
this.updateCheckAllBtn();
|
|
|
},
|
|
|
setProductChecked(item) {
|
|
|
item.cartList.forEach(pros=>{
|
|
|
- if(item.checked) {
|
|
|
- pros.productsChecked = true;
|
|
|
+ if(item.isChecked) {
|
|
|
+ pros.isChecked = true;
|
|
|
if(!this.submitIds.includes(pros.productId*1)){
|
|
|
this.submitIds.push(pros.productId);
|
|
|
}
|
|
|
} else {
|
|
|
- pros.productsChecked = false;
|
|
|
+ pros.isChecked = false;
|
|
|
var lent = this.submitIds.indexOf(pros.productId*1);
|
|
|
if(lent >=0 ){
|
|
|
this.submitIds.splice(lent, 1);
|
|
@@ -573,16 +573,16 @@
|
|
|
if(this.isshowDelbtn) {
|
|
|
// 当管理删除按钮出现时,失效的商品可被选择
|
|
|
this.goodsList.forEach((item)=>{
|
|
|
- item.checked = this.isCheckAll;
|
|
|
+ item.isChecked = this.isCheckAll;
|
|
|
this.setProductChecked(item);
|
|
|
})
|
|
|
//删除按钮 全选包括失效商品勾选
|
|
|
this.failureList.forEach(failureItem=>{
|
|
|
- failureItem.productsChecked = this.isCheckAll;
|
|
|
+ failureItem.isChecked = this.isCheckAll;
|
|
|
})
|
|
|
} else {
|
|
|
this.goodsList.forEach((item)=>{
|
|
|
- item.checked = this.isCheckAll && !item.isDisabled;
|
|
|
+ item.isChecked = this.isCheckAll && !item.isDisabled;
|
|
|
this.setProductChecked(item);
|
|
|
})
|
|
|
}
|
|
@@ -649,7 +649,7 @@
|
|
|
item.reducedprice = 0;
|
|
|
item.originalprice = 0;
|
|
|
item.cartList.forEach(pros=>{
|
|
|
- if(pros.productsChecked){
|
|
|
+ if(pros.isChecked){
|
|
|
supplierPrice += pros.price*pros.number;
|
|
|
// 单品满减
|
|
|
if(pros.promotions && pros.promotions.type*1===1 && pros.promotions.mode*1===2){
|
|
@@ -698,6 +698,9 @@
|
|
|
this.reducedPrice = reducedPrice;
|
|
|
// 最终合计价格 = 店铺满减合计 + 单品满减 + 正常合计 + 凑单满减
|
|
|
this.allPrice = totalPrice ;
|
|
|
+ console.log('totalOriginalPrice',this.totalOriginalPrice)
|
|
|
+ console.log('reducedPrice',this.reducedPrice)
|
|
|
+ console.log('allPrice',this.allPrice)
|
|
|
// 计算优惠券
|
|
|
if(this.totalCouponList.length>0){
|
|
|
let eligibleCoupons = this.calculationCoupon()
|
|
@@ -711,6 +714,7 @@
|
|
|
}
|
|
|
// 最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
|
|
|
this.totalDiscountAmount = this.reducedPrice + this.couponPrice;
|
|
|
+ console.log('totalDiscountAmount',this.totalDiscountAmount)
|
|
|
// 控制显示优惠明细
|
|
|
if(this.totalDiscountAmount > 0 ){
|
|
|
this.isDiscount = true
|
|
@@ -727,7 +731,7 @@
|
|
|
this.goodsList.forEach(item=>{
|
|
|
productsList = item.cartList
|
|
|
productsList.forEach(pros=>{
|
|
|
- if(pros.productsChecked){
|
|
|
+ if(pros.isChecked){
|
|
|
prosAllCount+=parseInt(pros.number);
|
|
|
this.allCount = prosAllCount
|
|
|
}
|
|
@@ -738,7 +742,7 @@
|
|
|
let eligibleCoupons = []
|
|
|
this.goodsList.forEach(shop=>{
|
|
|
shop.cartList.forEach(pros=>{
|
|
|
- if(pros.productsChecked){
|
|
|
+ if(pros.isChecked){
|
|
|
this.totalCouponList.forEach(coupon=>{//循环优惠券
|
|
|
switch(coupon.couponType){
|
|
|
case 0:// 活动券
|
|
@@ -842,7 +846,7 @@
|
|
|
},
|
|
|
processActivityPrice(pros){//单独处理活动价格和阶梯价格
|
|
|
let ladderPriceList = pros.ladderPrices;
|
|
|
- if(pros.ladderFlag == '0' || pros.actStatus == 1){
|
|
|
+ if(pros.ladderFlag == 0 || pros.actStatus == 1){
|
|
|
pros.price = pros.price
|
|
|
}else{
|
|
|
ladderPriceList.forEach((item,index)=>{
|
|
@@ -872,7 +876,7 @@
|
|
|
this.goodsList.forEach(res=>{
|
|
|
let products = res.cartList
|
|
|
products.forEach(pros=>{
|
|
|
- if(pros.productsChecked){
|
|
|
+ if(pros.isChecked){
|
|
|
setGoodsList.push(pros.productId)
|
|
|
}
|
|
|
})
|
|
@@ -884,7 +888,7 @@
|
|
|
this.isNoConfim = false
|
|
|
this.goodsList.forEach(el=>{
|
|
|
el.cartList.forEach(pros=>{
|
|
|
- if(pros.productsChecked){
|
|
|
+ if(pros.isChecked){
|
|
|
if(pros.number<pros.min){
|
|
|
this.isNoConfim = true
|
|
|
}
|
|
@@ -895,20 +899,15 @@
|
|
|
this.$util.modal('','有商品的购买量没达到最小起订量,请修改数量后再次提交结算','去修改','',false,() =>{})
|
|
|
return;
|
|
|
}
|
|
|
- let productID = '';
|
|
|
+ let productIds = '';
|
|
|
this.goodsList.forEach(el=>{//获取勾选的商品ID拼接字符串逗号隔开,最后一个逗号去掉
|
|
|
el.cartList.forEach(pros=>{
|
|
|
- if(pros.productsChecked){
|
|
|
- productID += pros.productId+','
|
|
|
+ if(pros.isChecked){
|
|
|
+ productIds += pros.productId+','
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
- let cartPramsData={
|
|
|
- allPrice:this.allPrice,
|
|
|
- allCount:this.allCount,
|
|
|
- productID:productID.substring(0,productID.lastIndexOf(',')),
|
|
|
- productCount:''
|
|
|
- }
|
|
|
+ let cartPramsData={ productIds:productIds.substring(0,productIds.lastIndexOf(',')) }
|
|
|
// 友盟埋点购物车去结算点击事件
|
|
|
if(process.env.NODE_ENV != 'development'){
|
|
|
this.$uma.trackEvent('Um_Event_shoppingCartConfirmOrder', {
|
|
@@ -925,9 +924,9 @@
|
|
|
this.updateBothCheckBtn();
|
|
|
} else {
|
|
|
this.goodsList.forEach(item => {
|
|
|
- if(item.checked) {
|
|
|
+ if(item.isChecked) {
|
|
|
item.cartList.forEach(pros => {
|
|
|
- pros.productsChecked = true;
|
|
|
+ pros.isChecked = true;
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -949,11 +948,11 @@
|
|
|
// 失效商品取消勾选
|
|
|
this.goodsList.forEach(item => {
|
|
|
if(item.isDisabled) {
|
|
|
- item.checked = false;
|
|
|
+ item.isChecked = false;
|
|
|
}
|
|
|
item.cartList.forEach(pros => {
|
|
|
if(pros.validFlag == 3) {
|
|
|
- pros.productsChecked = false;
|
|
|
+ pros.isChecked = false;
|
|
|
}
|
|
|
})
|
|
|
})
|
|
@@ -974,13 +973,13 @@
|
|
|
this.goodsList.forEach(delitem=>{
|
|
|
let products = delitem.cartList
|
|
|
products.forEach(pros=>{
|
|
|
- if(pros.productsChecked){
|
|
|
+ if(pros.isChecked){
|
|
|
this.delGoodsList += pros.productId+','
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
this.failureList.forEach(failure=>{
|
|
|
- if(failure.productsChecked){
|
|
|
+ if(failure.isChecked){
|
|
|
this.delGoodsList += failure.productId+','
|
|
|
}
|
|
|
})
|
|
@@ -989,7 +988,12 @@
|
|
|
return
|
|
|
}else{
|
|
|
this.$util.modal('','确定删除选中的商品吗?','确定','取消',true,() =>{
|
|
|
- this.ProductService.ShoppingCartDelete({userID:this.userId,productIDs:this.delGoodsList}).then(response =>{
|
|
|
+ this.ProductService.ShoppingCartDelete(
|
|
|
+ {
|
|
|
+ userId:this.userId,
|
|
|
+ productIds:this.delGoodsList,
|
|
|
+ }
|
|
|
+ ).then(response =>{
|
|
|
this.$util.msg('删除成功',2000);
|
|
|
setTimeout(()=>{
|
|
|
this.isshowDelbtn = false;
|
|
@@ -1004,7 +1008,12 @@
|
|
|
deletefailureList(){
|
|
|
this.failureList.forEach(failure=>{ this.delGoodsList += failure.productId+',' })
|
|
|
this.$util.modal('','确定清空全部失效商品吗?','确定','取消',true,() =>{
|
|
|
- this.ProductService.ShoppingCartDelete({userID:this.userId,productIDs:this.delGoodsList}).then(response =>{
|
|
|
+ this.ProductService.ShoppingCartDelete(
|
|
|
+ {
|
|
|
+ userId:this.userId,
|
|
|
+ productIds:this.delGoodsList,
|
|
|
+ }
|
|
|
+ ).then(response =>{
|
|
|
this.$util.msg('删除成功',2000);
|
|
|
setTimeout(()=>{
|
|
|
this.isshowDelbtn = false;
|
|
@@ -1124,7 +1133,7 @@
|
|
|
case 0:
|
|
|
this.currentTab = 0
|
|
|
this.couponParam.status = 1
|
|
|
- this.couponParam.shopId = shop.id
|
|
|
+ this.couponParam.shopId = shop.shopId
|
|
|
this.queryPopupCoupons()
|
|
|
this.popupShow0 = true
|
|
|
break;
|