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