diff --git a/pages/cart/cart/zh_calculate.js b/pages/cart/cart/zh_calculate.js index f86dd9e..acd9faa 100644 --- a/pages/cart/cart/zh_calculate.js +++ b/pages/cart/cart/zh_calculate.js @@ -259,11 +259,12 @@ module.exports = { // be=be-bz_num_ok; if (num % vv.zhqty == 0) { be = num / vv.zhqty; - bz_num_ok = num; + // bz_num_ok = num; } else { be = Math.floor(num / vv.zhqty) - bz_num_ok = num - (be * vv.zhqty); + // bz_num_ok = num - (be * vv.zhqty); } + bz_num_ok = be * vv.zhqty; } for (let i = 0; i < zhqty_bz.length; i++) { var vv = zhqty_bz[i]; @@ -293,11 +294,12 @@ module.exports = { // be=be-bz_num_ok; if (num % vv.zhqty == 0) { be = num / vv.zhqty; - bz_num_ok = num; + // bz_num_ok = num; } else { be = Math.floor(num / vv.zhqty) - bz_num_ok = num - (be * vv.zhqty); + // bz_num_ok = num - (be * vv.zhqty); } + bz_num_ok = be * vv.zhqty; } // be=vv.num; for (let j = 0; j < bz_num_ok; j++) { diff --git a/pages/cart/cart2/zh_calculate.js b/pages/cart/cart2/zh_calculate.js index d37ead5..aeff617 100644 --- a/pages/cart/cart2/zh_calculate.js +++ b/pages/cart/cart2/zh_calculate.js @@ -172,11 +172,12 @@ module.exports = { // be=be-bz_num_ok; if (num % vv.zhqty == 0) { be = num / vv.zhqty; - bz_num_ok = num; + // bz_num_ok = num; } else { be = Math.floor(num / vv.zhqty) - bz_num_ok = num - (be * vv.zhqty); + // bz_num_ok = num - (be * vv.zhqty); } + bz_num_ok = be * vv.zhqty; } for (let i = 0; i < zhqty_bz.length; i++) { var vv = zhqty_bz[i]; @@ -207,11 +208,12 @@ module.exports = { // be=be-bz_num_ok; if (num % vv.zhqty == 0) { be = num / vv.zhqty; - bz_num_ok = num; + // bz_num_ok = num; } else { be = Math.floor(num / vv.zhqty) - bz_num_ok = num - (be * vv.zhqty); + // bz_num_ok = num - (be * vv.zhqty); } + bz_num_ok = be * vv.zhqty; } // be=vv.num; for (let j = 0; j < bz_num_ok; j++) {