商品券处理

This commit is contained in:
GaoHao
2024-11-19 13:52:56 +08:00
parent 69151ca3f4
commit d2dbfd5163
6 changed files with 88 additions and 58 deletions

View File

@@ -662,13 +662,7 @@
if (b == '单规格') { //没有规格为空
this.skuidname = []
}
if ( a == "+" && item.cartNumber >= item.limitNumber){
uni.showToast({
title: '当前商品已达到最大赠送数量',
icon: 'none'
})
return;
}
let cartNumber = a == '+' ? item.cartNumber + 1 : item.cartNumber - 1;
@@ -685,13 +679,7 @@
*/
shopAdd(item, index, index1, a, b) {
if (a == "+") {
if ( this.amountcartNumber >= item.limitNumber){
uni.showToast({
title: '当前商品已达到最大赠送数量',
icon: 'none'
})
return;
}
if (this.skuNumber < this.skuSuit && this.amountcartNumber < this.skuSuit) {
this.amountcartNumber = this.amountcartNumber + (this.skuSuit == 0 ? 1 : this.skuSuit);
} else {
@@ -717,13 +705,7 @@
return;
}
let num = 0;
if (item.cartNumber >= item.limitNumber){
uni.showToast({
title: '当前商品已达到最大赠送数量',
icon: 'none'
})
return;
}
if (item.typeEnum == "normal") {
num = item.cartNumber + this.amountcartNumber;
} else {
@@ -984,6 +966,7 @@
let res = await this.api.productqueryProductSku({
code: this.tableCode,
shopId: this.shopId,
"isVip": 0,
productId: item.id, //商品id
spec_tag: this.skuidname.join(","),
})
@@ -996,6 +979,7 @@
"type": c == '+' ? 1 : 0,
"productId": item.id, //商品id
"note": item.note,
"isVip": 0,
"shopId": this.shopId,
"userId": uni.cache.get('userInfo').id,
}