商品详情数量事件调用错误修复

master
gongfuxiang 2021-10-19 17:28:22 +08:00
parent a18bd7f6fd
commit 862f42f148
1 changed files with 14 additions and 1 deletions

View File

@ -1233,13 +1233,26 @@
buy_number: number
});
//
var spec = this.goods_selected_spec();
var sku_count = this.goods_specifications_choose.length;
var active_count = spec.length;
if (sku_count > 0 && active_count < sku_count) {
this.setData({
goods_spec_base_price: this.goods.price,
goods_spec_base_original_price: this.goods.original_price,
goods_spec_base_inventory: this.goods.inventory
});
return false;
}
//
uni.request({
url: app.globalData.get_request_url('stock', 'goods'),
method: 'POST',
data: {
"id": this.goods.id,
"spec": this.goods_selected_spec(),
"spec": spec,
"stock": this.buy_number,
},
dataType: 'json',