预定餐-清空失效菜品
This commit is contained in:
parent
9415bda2e9
commit
fde3f5461d
|
|
@ -629,11 +629,22 @@ export default {
|
||||||
// 购物车为空 不可结算
|
// 购物车为空 不可结算
|
||||||
console.log(this.shoppingCartList)
|
console.log(this.shoppingCartList)
|
||||||
let arr = []
|
let arr = []
|
||||||
|
let arr2 = []
|
||||||
this.shoppingCartList.forEach(item=>{
|
this.shoppingCartList.forEach(item=>{
|
||||||
if(item.isDfficacy == 1){//有效
|
if(item.isDfficacy == 1){//有效
|
||||||
arr.push(item)
|
arr.push(item)
|
||||||
|
}else{
|
||||||
|
arr2.push(item.cartId)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if(arr2.length>0){
|
||||||
|
let param = {
|
||||||
|
"userId":uni.getStorageSync('userId'),
|
||||||
|
"cartIds":arr2,
|
||||||
|
}
|
||||||
|
clearAdvancehoppingCartAPI(param).then(res => {})
|
||||||
|
}
|
||||||
if (arr.length == 0) {
|
if (arr.length == 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请添加菜品',
|
title: '请添加菜品',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue