|
@@ -3,7 +3,7 @@
|
|
|
<tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading ="true" :loadingType="5"></tui-skeleton>
|
|
|
<view class="container-cart-main tui-skeleton">
|
|
|
<view v-if="!isEmpty" class="container-cart">
|
|
|
- <scroll-view class="cart-content" scroll-y @scrolltolower="toLower" :style="{paddingBottom :isIphoneX ? (68+100)+'rpx' : '100rpx'}">
|
|
|
+ <view class="cart-content" :style="{paddingBottom :isIphoneX ? '130rpx' : '100rpx'}">
|
|
|
<view class="goods-list">
|
|
|
<view v-for="(item, index) in goodsList" :key="index" class="goods-item">
|
|
|
<view class="shoptitle">
|
|
@@ -67,9 +67,8 @@
|
|
|
<!--选择商品-->
|
|
|
<view class="checkbox-box" @click.stop="ischeckFailure(failure)" v-if="isshowDelbtn">
|
|
|
<button class="checkbox iconfont"
|
|
|
- :disabled="!isCheckAll"
|
|
|
- :class="[failure.productsChecked ?'icon-gouxuanl':'icon-weigouxuan']">
|
|
|
- </button>
|
|
|
+ :class="[ failure.productsChecked ? 'icon-gouxuanl':'icon-weigouxuan']">
|
|
|
+ </button>
|
|
|
</view>
|
|
|
<view class="pros-img">
|
|
|
<image :src="failure.mainImage ? failure.mainImage:''" alt="" />
|
|
@@ -85,9 +84,9 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </scroll-view>
|
|
|
+ </view>
|
|
|
<!-- 脚部菜单 -->
|
|
|
- <view class="footer" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
|
|
|
+ <view class="footer">
|
|
|
<view class="footer-le">
|
|
|
<view class="foot-check checkbox-box" @tap.stop="checkAll()">
|
|
|
<button class="checkbox iconfont" :class="[isCheckAll?'icon-gouxuan':'icon-weigouxuan']"></button>
|
|
@@ -275,7 +274,8 @@
|
|
|
})
|
|
|
},
|
|
|
ischeckFailure(failure){
|
|
|
- failure.productsChecked = !failure.productsChecked;
|
|
|
+ failure.productsChecked = !failure.productsChecked
|
|
|
+ this.updateCheckAllBtn()
|
|
|
},
|
|
|
ischeck(item,pro){//为未选中的时候改变为true,反之为true
|
|
|
pro.productsChecked = !pro.productsChecked;
|
|
@@ -305,8 +305,8 @@
|
|
|
updateCheckAllBtn() {// 全选勾选判断
|
|
|
let goodsCheckedLength = 0,
|
|
|
disabledListLength = 0,
|
|
|
- goodsList = this.goodsList;
|
|
|
-
|
|
|
+ goodsList = this.goodsList,
|
|
|
+ failureList = this.failureList;
|
|
|
goodsList.forEach(item => {
|
|
|
if(item.checked) {
|
|
|
goodsCheckedLength++;
|
|
@@ -315,7 +315,12 @@
|
|
|
disabledListLength++;
|
|
|
}
|
|
|
})
|
|
|
- this.isCheckAll = goodsCheckedLength === goodsList.length - disabledListLength;
|
|
|
+ failureList.forEach(failureItem=>{
|
|
|
+ if(failureItem.productsChecked){
|
|
|
+ goodsCheckedLength++;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.isCheckAll = goodsCheckedLength === goodsList.length+failureList.length - disabledListLength;
|
|
|
},
|
|
|
checkShop(item){//与单选商品类似
|
|
|
item.checked = !item.checked;
|
|
@@ -339,10 +344,7 @@
|
|
|
pros.productsChecked = false;
|
|
|
}
|
|
|
})
|
|
|
- //删除按钮 全选包括失效商品勾选
|
|
|
- this.failureList.forEach(failureItem=>{
|
|
|
- failureItem.productsChecked = !failureItem.productsChecked;
|
|
|
- })
|
|
|
+
|
|
|
},
|
|
|
updateBothCheckBtn() {
|
|
|
if(this.isshowDelbtn) {
|
|
@@ -351,7 +353,10 @@
|
|
|
item.checked = this.isCheckAll;
|
|
|
this.setProductChecked(item);
|
|
|
})
|
|
|
-
|
|
|
+ //删除按钮 全选包括失效商品勾选
|
|
|
+ this.failureList.forEach(failureItem=>{
|
|
|
+ failureItem.productsChecked = this.isCheckAll;
|
|
|
+ })
|
|
|
} else {
|
|
|
this.goodsList.forEach((item)=>{
|
|
|
item.checked = this.isCheckAll && !item.isDisabled;
|
|
@@ -604,7 +609,6 @@
|
|
|
this.$util.msg("请选择要删除的商品~",2000);
|
|
|
return
|
|
|
}else{
|
|
|
- console.log(this.delGoodsList);
|
|
|
this.$util.modal('','确定删除选中的商品吗?','确定','取消',true,() =>{
|
|
|
shoppingCartDelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
|
|
|
this.$util.msg('删除成功',2000);
|
|
@@ -619,9 +623,7 @@
|
|
|
}
|
|
|
},
|
|
|
deletefailureList(){
|
|
|
- this.failureList.forEach(failure=>{
|
|
|
- this.delGoodsList += failure.productID+','
|
|
|
- })
|
|
|
+ this.failureList.forEach(failure=>{ this.delGoodsList += failure.productID+',' })
|
|
|
this.$util.modal('','确定清空全部失效商品吗?','确定','取消',true,() =>{
|
|
|
shoppingCartDelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
|
|
|
this.$util.msg('删除成功',2000);
|
|
@@ -781,7 +783,6 @@
|
|
|
.goods-list{
|
|
|
width: 100%;
|
|
|
height: auto;
|
|
|
- border-top: 1px solid #EBEBEB;
|
|
|
background-color: #F7F7F7;
|
|
|
.goods-item{
|
|
|
width: 702rpx;
|
|
@@ -1059,7 +1060,7 @@
|
|
|
}
|
|
|
.pros-marks{
|
|
|
width: 722rpx;
height: 250rpx;
|
|
|
- z-index: 9;
|
|
|
+ z-index: 90;
|
|
|
background: rgba(0,0,0,.05);
|
|
|
position: absolute;
|
|
|
left:0;
|
|
@@ -1146,7 +1147,7 @@
|
|
|
height: 110rpx;
|
|
|
position: fixed;
|
|
|
bottom: 0rpx;
|
|
|
- z-index: 10;
|
|
|
+ z-index: 100;
|
|
|
.footer-le{
|
|
|
width: 490rpx;
|
|
|
height: 100%;
|