diff --git a/components/goods_list/goods_list.js b/components/goods_list/goods_list.js index 1bbfb29..53d3d0c 100644 --- a/components/goods_list/goods_list.js +++ b/components/goods_list/goods_list.js @@ -75,6 +75,12 @@ Component({ }, + go_url:function(e){ + var url=e.currentTarget.dataset.url; + t.goto(url); + }, + + }, diff --git a/components/goods_list/goods_list.wxml b/components/goods_list/goods_list.wxml index ce32fa8..642e3cc 100644 --- a/components/goods_list/goods_list.wxml +++ b/components/goods_list/goods_list.wxml @@ -3,6 +3,7 @@ + diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index e9ebc73..202b9f3 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -278,7 +278,7 @@ Page({ distance=Math.sqrt(e.lat*th.data.lat+e.lon*th.data.lon); e.distance=distance; } - + console.log(e,"def_pick_store,刷新进来") if(e) that.setData({def_pick_store:e,sto_sele_name:e.pickup_name,sto_sele_id:e.pickup_id,sto_sele_distr:e.distr_type}) clearInterval(w_time); },500) @@ -415,7 +415,7 @@ Page({ mapurl_f_img=res1.data.data.video_img; } }) - console.log(fir_com,"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); + ee.setData({ gallery: gallery, is_collect: is_collect, @@ -775,32 +775,34 @@ Page({ i.put("/api/weshop/cart/update", { data: updata, success: function(t) { - wx.showModal({ - title: "添加成功!", - cancelText: "去购物车", - confirmText: "再逛逛", - success: function(t) { - t.cancel ? wx.switchTab({ - url: "/pages/cart/cart/cart" - }) : e.requestCardNum(); - } - }); + getApp().my_warnning(' 加入购物车成功 ', 1, th); + // wx.showModal({ + // title: "添加成功!", + // cancelText: "去购物车", + // confirmText: "再逛逛", + // success: function(t) { + // t.cancel ? wx.switchTab({ + // url: "/pages/cart/cart/cart" + // }) : e.requestCardNum(); + // } + // }); } }); } else { i.post("/api/weshop/cart/save", { data: newd, success: function(t) { - wx.showModal({ - title: "添加成功!", - cancelText: "去购物车", - confirmText: "再逛逛", - success: function(t) { - t.cancel ? wx.switchTab({ - url: "/pages/cart/cart/cart" - }) : e.requestCardNum(); - } - }); + getApp().my_warnning(' 加入购物车成功 ', 1, th); + // wx.showModal({ + // title: "添加成功!", + // cancelText: "去购物车", + // confirmText: "再逛逛", + // success: function(t) { + // t.cancel ? wx.switchTab({ + // url: "/pages/cart/cart/cart" + // }) : e.requestCardNum(); + // } + // }); } }); } @@ -2800,7 +2802,7 @@ close_popup:function(e){ choose_for_store_fir:function (e) { var index_c=e.currentTarget.dataset.ind; - console.log("选择门店的id+",index_c); + this.setData({fir_pick_index:index_c}) }, @@ -2835,14 +2837,14 @@ close_popup:function(e){ var index=th.data.sec_pick_index; item=th.data.sec_sto.s_arr[index]; } - + console.log("选择门店刷新","def_pick_store",item); th.setData({def_pick_store:item,sto_sele_name:item.pickup_name, sto_sele_id:item.pickup_id,sto_sele_distr:item.distr_type,store:0,choice_sort_store:0}); }, //---点击二级之后的选择--- choose_for_store: function (e) { var index_c = e.currentTarget.dataset.ind; - console.log("qqqqqqqqqqqqqqqqqqqqqqqqq", index_c), + this.setData({ sec_pick_index: index_c, fir_pick_index: index_c }) }, //把选择的门店设置成默认的门店def_pick @@ -2852,33 +2854,34 @@ close_popup:function(e){ if(th.data.choice_sort_store==0 ){ var index=th.data.fir_pick_index; - console.log("分类的门店地址0",index); + if(th.data.is_show_sto_cat==1){ item=th.data.def_pickpu_list[index]; - console.log(item,"分类的门店地址1", index); + }else{ - console.log("分类的门店地址22222", index); + item=th.data.only_pk[index]; //当没有门店分类的时候 - console.log(item,"分类的门店地址22222", index); + } }else{ var index=th.data.sec_pick_index; item=th.data.sec_sto.s_arr[index]; - console.log(item,"分类的门店地址333333333333", index); + } var store_id=o.stoid; var user_id = getApp().globalData.user_id; var def_pickup_id = item.pickup_id; - getApp().request.post('/api/weshop/users/save',{ + getApp().request.put('/api/weshop/users/update',{ data: { user_id,def_pickup_id}, success:function(res){ - console.log("是什么",res.data.code); + if (res.data.code==0){ if (th.data.choice_sort_store == 0) th.setData({fir_pick_index:0}); s.showWarning("设置门店地址成功", null, 500, !1); + getApp().globalData.pk_store = item; }else{ console.log("门店地址失败"); s.showWarning("设置默认门店地址失败", null, 500, !1);