From d1c1741613cb495f7dfd5ee626ac8e029021d238 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Sun, 4 Feb 2024 14:01:12 +0800 Subject: [PATCH] 购物车测试的bug优化 --- pages/cart/cart/cart.js | 13 +++++++------ utils/more_cx.js | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pages/cart/cart/cart.js b/pages/cart/cart/cart.js index d169b44..12e7e13 100644 --- a/pages/cart/cart/cart.js +++ b/pages/cart/cart/cart.js @@ -941,7 +941,8 @@ Page({ requestData: arr, all_num: all_num, is_load: 1, - is_edit: 0 + is_edit: 0, + checkAllToggle:0 }), th.doCheckAll(), wx.stopPullDownRefresh(); @@ -2469,7 +2470,7 @@ Page({ - + var cur_car_cp=ut.deep_cp(car); for (var a = 0; a < car.length; a++) { var ite1 = car[a].goods; if(car.length>1 && c_ind>-1 && a==c_ind ){ @@ -2608,11 +2609,13 @@ Page({ ladder_calc.add_ladder_prom(car, a, obj); } + if( cur_car_cp[a].goods[c].goods_price!=th.data.dp_car[a].goods[c].goods_price) { //-- 如果价格有发生变动,要更新界面中的价格显示,还原价格 -- - let txt='requestData['+a+'].goods['+c+'].goods_price'; + let txt = 'requestData[' + a + '].goods[' + c + '].goods_price'; th.setData({ - [txt]:th.data.dp_car[a].goods[c].goods_price + [txt]: th.data.dp_car[a].goods[c].goods_price }) + } } else { @@ -2647,8 +2650,6 @@ Page({ - - //-- 如果这个商品是线下取价的时候 -- if (item[c].is_offline && item[c].prom_type != 7) { offline_price += (item[c].goods_price - item[c].offline_price) * item[c].goods_num; diff --git a/utils/more_cx.js b/utils/more_cx.js index 3b3f2c0..05b3afe 100644 --- a/utils/more_cx.js +++ b/utils/more_cx.js @@ -745,7 +745,7 @@ module.exports = { }) //-- 看一下是不是购物车已经选择好了,购物车选择好了,再确认订单页面也应该是购物车选择的结果,这个也很重要 -- - if(!ck_prom_type){ + if(!ck_prom_type && th.data && ! th.data.is_cart){ for(var ij=0;ij