|
@ -185,14 +185,14 @@ |
|
|
this.delItem(item) |
|
|
this.delItem(item) |
|
|
} else { |
|
|
} else { |
|
|
let numData = item.num + num |
|
|
let numData = item.num + num |
|
|
this.Post({sku_id: item.sku_id, num: numData},'/api/cart/update_sku').then(res =>{ |
|
|
this.Post({id: item.id, num: numData},'/api/cart/update_sku').then(res =>{ |
|
|
item.num += num |
|
|
item.num += num |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// 单个删除 |
|
|
// 单个删除 |
|
|
delItem(item){ |
|
|
delItem(item){ |
|
|
this.Post({sku_id: item.sku_id},'/api/cart/del_sku').then(res =>{ |
|
|
this.Post({id: item.id},'/api/cart/del_sku').then(res =>{ |
|
|
// this.cartData.splice(index,1) |
|
|
// this.cartData.splice(index,1) |
|
|
this.getList() |
|
|
this.getList() |
|
|
}) |
|
|
}) |
|
@ -200,8 +200,8 @@ |
|
|
}, |
|
|
}, |
|
|
// 把店铺下的所有商品删除 |
|
|
// 把店铺下的所有商品删除 |
|
|
delCartByShop (item, index) { |
|
|
delCartByShop (item, index) { |
|
|
let goods = item.goods.map(v=>v.sku_id) |
|
|
let goods = item.goods.map(v=>v.id) |
|
|
this.Post({sku_id: goods.join(',')},'/api/cart/del_sku').then(res =>{ |
|
|
this.Post({id: goods.join(',')},'/api/cart/del_sku').then(res =>{ |
|
|
this.getList() |
|
|
this.getList() |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
@ -209,9 +209,9 @@ |
|
|
delAll () { |
|
|
delAll () { |
|
|
let goods = [] |
|
|
let goods = [] |
|
|
this.cartList.forEach(v=>{ |
|
|
this.cartList.forEach(v=>{ |
|
|
v.goods.forEach(x=>{goods.push(x.sku_id)}) |
|
|
v.goods.forEach(x=>{goods.push(x.id)}) |
|
|
}) |
|
|
}) |
|
|
this.Post({sku_id: goods.join(',')},'/api/cart/del_sku').then(res =>{ |
|
|
this.Post({id: goods.join(',')},'/api/cart/del_sku').then(res =>{ |
|
|
this.getList() |
|
|
this.getList() |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|