From 4a76c7259900abbc794601174f5eda4a585fc91f Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 4 Jun 2024 14:58:24 +0800 Subject: [PATCH] * [task#119971,done,0.3h] product selection cannot be repeated. --- lib/zin/wg/productsbox/js/v1.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/zin/wg/productsbox/js/v1.js b/lib/zin/wg/productsbox/js/v1.js index 65c769ec41..95eb9b98cb 100644 --- a/lib/zin/wg/productsbox/js/v1.js +++ b/lib/zin/wg/productsbox/js/v1.js @@ -175,9 +175,8 @@ window.updateItems = function() { const $product = $(this).zui('picker'); const productID = $(this).val(); - if(productID == 0) return true; - let currentProductItems = allItems.map(obj => ({ ...obj })); - currentProductItems[productItems[productID].i].disabled = false; + let currentProductItems = JSON.parse(JSON.stringify(allItems)); + if(productID != 0) currentProductItems[productItems[productID].i].disabled = false; $product.render({items: currentProductItems}); });