修复:判断错误 导致普通商品下单时报错,商品ID不存在

This commit is contained in:
wuhui_zzw 2024-04-22 18:17:23 +08:00
parent 08f5cc93ca
commit dcf5974380
1 changed files with 5 additions and 3 deletions

View File

@ -1486,9 +1486,10 @@
// ID
let productId = that.id;
if(that.send_province_info) productId = that.send_province_info.product_id;
let sendProvinceInfoProductId = that.send_province_info.product_id || 0;
let productId = Number(sendProvinceInfoProductId) > 0 ? sendProvinceInfoProductId : that.id;
console.log("发货商户信息", that.send_province_info);
console.log("最终商品ID", productId);
let q = {
is_new: news === undefined ? 0 : 1,
product_id: productId,
@ -1500,6 +1501,7 @@
province_here_id: that.current_province_info.mer_id || 0,// id
province_send_id: that.send_province_info.mer_id || 0,// id
};
console.log("提交信息", q);
postCartAdd(q).then(function (res) {
that.isOpen = that.attr.cartAttr = false;
let cartId = res.data.cart_id