修改购物车删除的bug
This commit is contained in:
parent
5a965ccb16
commit
b9eaf4c1f1
@ -518,9 +518,14 @@ export default {
|
||||
// 删除商品的通用方法
|
||||
deleteCarItem(carItem, goodsIndex, item) {
|
||||
const that = this;
|
||||
const currentTime = new Date().getTime();
|
||||
const isGroupBuyActive = carItem.commodity_goods_info.group_buy_activity_info &&
|
||||
currentTime >= new Date(carItem.commodity_goods_info.group_buy_activity_info?.start_time).getTime() &&
|
||||
currentTime <= new Date(carItem.commodity_goods_info.group_buy_activity_info?.end_time).getTime();
|
||||
|
||||
request(apiArr.deleteCar, "POST", {
|
||||
ids: [carItem.id],
|
||||
goods_cate: 1,
|
||||
goods_cate: isGroupBuyActive ? 2 : 1,
|
||||
}).then((res) => {
|
||||
// 从商品列表中移除该商品
|
||||
item.splice(goodsIndex, 1);
|
||||
@ -686,7 +691,7 @@ export default {
|
||||
|
||||
request(apiArr.deleteCar, "POST", {
|
||||
ids,
|
||||
goods_cate: 1,
|
||||
goods_cate: goods_cate,
|
||||
})
|
||||
.then((res) => {
|
||||
uni.showToast({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user