diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js index 032a1cb..95836e4 100644 --- a/pages/cart/cart2/cart2.js +++ b/pages/cart/cart2/cart2.js @@ -97,19 +97,21 @@ Page({ } }); - //先获取是否有关闭使用优惠券 - getApp().getConfig2(function (ee) { - var json_d = JSON.parse(ee.switch_list); - th.setData({ is_close_quan: json_d.is_close_quan }); - //-----先获取物流,再获取用户信息,再展示页面----- - th.get_wuliu(th.get_info(th.show_page)); - }) + }, onUnload: function () { this.setData({ isclose: 1 })}, //----------子页返回父页触发---------- onShow: function() { - console.log('onshow'); + + //先获取是否有关闭使用优惠券 + getApp().getConfig2(function (ee) { + var json_d = JSON.parse(ee.switch_list); + th.setData({ is_close_quan: json_d.is_close_quan }); + //-----先获取物流,再获取用户信息,再展示页面----- + th.get_wuliu(th.get_info(th.show_page)); + }) + var th=this; console.log(th.data.isclose); if (th.data.isclose==0){ @@ -230,7 +232,7 @@ Page({ }); }, - //-----真的获取购物车-------- + //-----真的获取购物车,入口-------- get_cart: function () { var th = this,app=getApp(); a.get("/api/weshop/cart/list", { @@ -289,7 +291,7 @@ Page({ var m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code; if(e_t==0 && def_exp_code){ for(var k=0;k{ if(res.data.code==0) quanlist=res.data.data.pageData; - console.log("22222222222222222222券的列表", quanlist); + }) } @@ -436,7 +445,7 @@ Page({ t.data.data.prom_type = 0; th.setData({ - bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et, + bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et,index:m_wind, bn_pick: gg.pick_id, bn_t_exp_t: distr_t,selected_quan_list:quanlist }); //计算价格 @@ -465,7 +474,6 @@ Page({ }).then(res=>{ if(res.data.code==0) quanlist=res.data.data.pageData; - console.log("券接口的列表333333333333333",quanlist); }) var frozenQuan=null; @@ -481,9 +489,9 @@ Page({ } } } - console.log("3333333333券的列表", quanlist); + th.setData({ - bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et, + bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et,index:m_wind, bn_pick: gg.pick_id, bn_t_exp_t: distr_t,selected_quan_list:quanlist }); //计算价格 @@ -1087,15 +1095,14 @@ Page({ }); }, - //--------立即购买时,选择自提和物流----------- + //--------购物车购买时,选择自提和物流----------- setexptype_w:function(t){ - var uerinfo= getApp().globalData.userInfo.def_exp_code; - - console.log(getApp().globalData.userInfo, "获取默认的物流地址", uerinfo ); - var th=this; - - var ty = t.currentTarget.dataset.t, txt = t.currentTarget.dataset.txt, ont = t.currentTarget.dataset.ont; + var def_exp_code= getApp().globalData.userInfo.def_exp_code,th=this; + var ty = t.currentTarget.dataset.t, txt = t.currentTarget.dataset.txt, + wl_txt = t.currentTarget.dataset.wl_txt, + ont = t.currentTarget.dataset.ont; + th.setData({ [txt]: ty }); var iszt=1; @@ -1111,37 +1118,51 @@ Page({ th.setData({ is_all_zt: iszt }); } //判断有没有默认的物流地址值 - if (uerinfo != "" && uerinfo != null && uerinfo !=undefined) { + if (def_exp_code != "" && def_exp_code != null && def_exp_code !=undefined) { var wu_arr=this.data.wu_arr; if (wu_arr!= null && wu_arr!=""){ for(var i=0;i - 快递邮寄 + 快递邮寄 - {{wu_arr[index].name}} + {{wu_arr[item.wind].name}} @@ -169,9 +172,7 @@ 商品属性: {{bn_goods.goods_spec}}/{{bn_goods.goods_color}} - - - + {{filters.toFix(bn_goods.shop_price,2)}} x{{bn_goods.buynum}} @@ -199,11 +200,11 @@ - + 自提 - + 物流 @@ -216,28 +217,6 @@ - - - - - @@ -245,7 +224,6 @@ 使用余额 :¥{{yuer}} - @@ -381,8 +359,7 @@ - - + {{filter.get_type_card(item.UseObjectType)}} @@ -401,7 +378,7 @@ --> - Γ + Γ diff --git a/pages/goods/goodsList/goodsList.js b/pages/goods/goodsList/goodsList.js index 6ab543f..1e77a48 100644 --- a/pages/goods/goodsList/goodsList.js +++ b/pages/goods/goodsList/goodsList.js @@ -26,14 +26,14 @@ Page({ this.data.is_new=t.is_new; this.data.is_hot=t.is_hot; - if (0 != t.cat_id && t.cat_id != undefined) { - url += "&cat_id=" + t.cat_id; - if (t.parent_id == undefined && t.parent_id == null){ - url += "&parent_id=0"; - }else{ - url += "&parent_id="+t.parent_id; - } - } + if (0 != t.cat_id && t.cat_id != undefined) { + url += "&cat_id=" + t.cat_id; + if (t.pid == undefined || t.pid == null){ + url += "&parent_id=0"; + }else{ + url += "&parent_id="+t.pid; + } + } if (0 != t.brand_id && t.brand_id != undefined) { url += "&brand_id=" + t.brand_id; } if (0 != t.nation_id && t.nation_id != undefined) { url += "&nation_id=" + t.nation_id; }