|
|
|
@ -82,9 +82,9 @@ |
|
|
|
</view> |
|
|
|
<uni-popup ref="popup" type="center" :mask-click="false"> |
|
|
|
<view class="popup-box"> |
|
|
|
<view class="tip-title">{{ allSelected ? '确定将购物车纸品删除吗?' : '确定将当前纸品删除吗?' }}</view> |
|
|
|
<view class="tip-title">{{ onlyQuantity ? '确定将当前纸品删除吗?' : (allSelected ? '确定将购物车纸品删除吗?' : '确定将当前纸品删除吗?') }}</view> |
|
|
|
<view class="operation-row"> |
|
|
|
<view class="cancel-text" @tap="cancelTap">取消</view> |
|
|
|
<view class="cancel-text" @tap="cancelTap">{{onlyQuantity ? '我在想想' : '取消'}}</view> |
|
|
|
<view class="line"></view> |
|
|
|
<view class="confirm-text" @tap="confirmTap">确定</view> |
|
|
|
</view> |
|
|
|
@ -123,7 +123,8 @@ export default { |
|
|
|
}, |
|
|
|
checked: false, |
|
|
|
list: [], |
|
|
|
idList: [] |
|
|
|
idList: [], |
|
|
|
onlyQuantity: false, |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
@ -305,9 +306,11 @@ export default { |
|
|
|
delTap() { |
|
|
|
// idList |
|
|
|
this.idList = [] |
|
|
|
let quantity = 0 |
|
|
|
this.list.forEach((el) => { |
|
|
|
el.carItemList.forEach((good) => { |
|
|
|
if (good.checked) { |
|
|
|
quantity = good.quantity |
|
|
|
this.idList.push(good.id) |
|
|
|
} |
|
|
|
}) |
|
|
|
@ -319,6 +322,12 @@ export default { |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
// 单一纸品删除,数量为0时,提示用户确认后删除纸品 |
|
|
|
if(this.idList.length == 1 && quantity == 0) { |
|
|
|
this.onlyQuantity = true |
|
|
|
}else { |
|
|
|
this.onlyQuantity = false |
|
|
|
} |
|
|
|
this.$refs.popup.open('center') |
|
|
|
}, |
|
|
|
confirmTap() { |
|
|
|
|