Commit d1c1741613cb495f7dfd5ee626ac8e029021d238

Authored by yvan.ni
1 parent 09659c07

购物车测试的bug优化

pages/cart/cart/cart.js
... ... @@ -941,7 +941,8 @@ Page({
941 941 requestData: arr,
942 942 all_num: all_num,
943 943 is_load: 1,
944   - is_edit: 0
  944 + is_edit: 0,
  945 + checkAllToggle:0
945 946 }),
946 947 th.doCheckAll(), wx.stopPullDownRefresh();
947 948  
... ... @@ -2469,7 +2470,7 @@ Page({
2469 2470  
2470 2471  
2471 2472  
2472   -
  2473 + var cur_car_cp=ut.deep_cp(car);
2473 2474 for (var a = 0; a < car.length; a++) {
2474 2475 var ite1 = car[a].goods;
2475 2476 if(car.length>1 && c_ind>-1 && a==c_ind ){
... ... @@ -2608,11 +2609,13 @@ Page({
2608 2609 ladder_calc.add_ladder_prom(car, a, obj);
2609 2610 }
2610 2611  
  2612 + if( cur_car_cp[a].goods[c].goods_price!=th.data.dp_car[a].goods[c].goods_price) {
2611 2613 //-- 如果价格有发生变动,要更新界面中的价格显示,还原价格 --
2612   - let txt='requestData['+a+'].goods['+c+'].goods_price';
  2614 + let txt = 'requestData[' + a + '].goods[' + c + '].goods_price';
2613 2615 th.setData({
2614   - [txt]:th.data.dp_car[a].goods[c].goods_price
  2616 + [txt]: th.data.dp_car[a].goods[c].goods_price
2615 2617 })
  2618 + }
2616 2619  
2617 2620  
2618 2621 } else {
... ... @@ -2647,8 +2650,6 @@ Page({
2647 2650  
2648 2651  
2649 2652  
2650   -
2651   -
2652 2653 //-- 如果这个商品是线下取价的时候 --
2653 2654 if (item[c].is_offline && item[c].prom_type != 7) {
2654 2655 offline_price += (item[c].goods_price - item[c].offline_price) * item[c].goods_num;
... ...
utils/more_cx.js
... ... @@ -745,7 +745,7 @@ module.exports = {
745 745 })
746 746  
747 747 //-- 看一下是不是购物车已经选择好了,购物车选择好了,再确认订单页面也应该是购物车选择的结果,这个也很重要 --
748   - if(!ck_prom_type){
  748 + if(!ck_prom_type && th.data && ! th.data.is_cart){
749 749 for(var ij=0;ij<k_item.act_arr.length;ij++){
750 750 var act_gd=k_item.act_arr[ij].goods[0];
751 751 if(act_gd.prom_type==k_item.act_arr[ij].prom_type){
... ...