Commit 620681c076d4a5d34bab714a9f09d3ac2642c2b7
1 parent
c8cf1f01
样式js修改
Showing
3 changed files
with
42 additions
and
32 deletions
components/goods_list/goods_list.js
components/goods_list/goods_list.wxml
... | ... | @@ -3,6 +3,7 @@ |
3 | 3 | <view class="collects"> |
4 | 4 | <view class="hang "> |
5 | 5 | <!-- 商品详情 --> |
6 | + | |
6 | 7 | <view class="collect ib" wx:for="{{recommend}}" bindtap="go_url" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> |
7 | 8 | <!-- 商品图片 --> |
8 | 9 | <image class="sp" src="{{url+item.original_img}}" mode="scaleToFill" binderror="bind_bnerr_xc" data-url="{{item.original_img}}" data-errorimg="recommend[{{index}}].original_img"></image> | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
... | ... | @@ -278,7 +278,7 @@ Page({ |
278 | 278 | distance=Math.sqrt(e.lat*th.data.lat+e.lon*th.data.lon); |
279 | 279 | e.distance=distance; |
280 | 280 | } |
281 | - | |
281 | + console.log(e,"def_pick_store,刷新进来") | |
282 | 282 | 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}) |
283 | 283 | clearInterval(w_time); |
284 | 284 | },500) |
... | ... | @@ -415,7 +415,7 @@ Page({ |
415 | 415 | mapurl_f_img=res1.data.data.video_img; |
416 | 416 | } |
417 | 417 | }) |
418 | - console.log(fir_com,"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); | |
418 | + | |
419 | 419 | ee.setData({ |
420 | 420 | gallery: gallery, |
421 | 421 | is_collect: is_collect, |
... | ... | @@ -775,32 +775,34 @@ Page({ |
775 | 775 | i.put("/api/weshop/cart/update", { |
776 | 776 | data: updata, |
777 | 777 | success: function(t) { |
778 | - wx.showModal({ | |
779 | - title: "添加成功!", | |
780 | - cancelText: "去购物车", | |
781 | - confirmText: "再逛逛", | |
782 | - success: function(t) { | |
783 | - t.cancel ? wx.switchTab({ | |
784 | - url: "/pages/cart/cart/cart" | |
785 | - }) : e.requestCardNum(); | |
786 | - } | |
787 | - }); | |
778 | + getApp().my_warnning(' 加入购物车成功 ', 1, th); | |
779 | + // wx.showModal({ | |
780 | + // title: "添加成功!", | |
781 | + // cancelText: "去购物车", | |
782 | + // confirmText: "再逛逛", | |
783 | + // success: function(t) { | |
784 | + // t.cancel ? wx.switchTab({ | |
785 | + // url: "/pages/cart/cart/cart" | |
786 | + // }) : e.requestCardNum(); | |
787 | + // } | |
788 | + // }); | |
788 | 789 | } |
789 | 790 | }); |
790 | 791 | } else { |
791 | 792 | i.post("/api/weshop/cart/save", { |
792 | 793 | data: newd, |
793 | 794 | success: function(t) { |
794 | - wx.showModal({ | |
795 | - title: "添加成功!", | |
796 | - cancelText: "去购物车", | |
797 | - confirmText: "再逛逛", | |
798 | - success: function(t) { | |
799 | - t.cancel ? wx.switchTab({ | |
800 | - url: "/pages/cart/cart/cart" | |
801 | - }) : e.requestCardNum(); | |
802 | - } | |
803 | - }); | |
795 | + getApp().my_warnning(' 加入购物车成功 ', 1, th); | |
796 | + // wx.showModal({ | |
797 | + // title: "添加成功!", | |
798 | + // cancelText: "去购物车", | |
799 | + // confirmText: "再逛逛", | |
800 | + // success: function(t) { | |
801 | + // t.cancel ? wx.switchTab({ | |
802 | + // url: "/pages/cart/cart/cart" | |
803 | + // }) : e.requestCardNum(); | |
804 | + // } | |
805 | + // }); | |
804 | 806 | } |
805 | 807 | }); |
806 | 808 | } |
... | ... | @@ -2800,7 +2802,7 @@ close_popup:function(e){ |
2800 | 2802 | |
2801 | 2803 | choose_for_store_fir:function (e) { |
2802 | 2804 | var index_c=e.currentTarget.dataset.ind; |
2803 | - console.log("选择门店的id+",index_c); | |
2805 | + | |
2804 | 2806 | this.setData({fir_pick_index:index_c}) |
2805 | 2807 | }, |
2806 | 2808 | |
... | ... | @@ -2835,14 +2837,14 @@ close_popup:function(e){ |
2835 | 2837 | var index=th.data.sec_pick_index; |
2836 | 2838 | item=th.data.sec_sto.s_arr[index]; |
2837 | 2839 | } |
2838 | - | |
2840 | + console.log("选择门店刷新","def_pick_store",item); | |
2839 | 2841 | th.setData({def_pick_store:item,sto_sele_name:item.pickup_name, |
2840 | 2842 | sto_sele_id:item.pickup_id,sto_sele_distr:item.distr_type,store:0,choice_sort_store:0}); |
2841 | 2843 | }, |
2842 | 2844 | //---点击二级之后的选择--- |
2843 | 2845 | choose_for_store: function (e) { |
2844 | 2846 | var index_c = e.currentTarget.dataset.ind; |
2845 | - console.log("qqqqqqqqqqqqqqqqqqqqqqqqq", index_c), | |
2847 | + | |
2846 | 2848 | this.setData({ sec_pick_index: index_c, fir_pick_index: index_c }) |
2847 | 2849 | }, |
2848 | 2850 | //把选择的门店设置成默认的门店def_pick |
... | ... | @@ -2852,33 +2854,34 @@ close_popup:function(e){ |
2852 | 2854 | if(th.data.choice_sort_store==0 ){ |
2853 | 2855 | |
2854 | 2856 | var index=th.data.fir_pick_index; |
2855 | - console.log("分类的门店地址0",index); | |
2857 | + | |
2856 | 2858 | if(th.data.is_show_sto_cat==1){ |
2857 | 2859 | |
2858 | 2860 | item=th.data.def_pickpu_list[index]; |
2859 | - console.log(item,"分类的门店地址1", index); | |
2861 | + | |
2860 | 2862 | }else{ |
2861 | - console.log("分类的门店地址22222", index); | |
2863 | + | |
2862 | 2864 | item=th.data.only_pk[index]; //当没有门店分类的时候 |
2863 | - console.log(item,"分类的门店地址22222", index); | |
2865 | + | |
2864 | 2866 | } |
2865 | 2867 | }else{ |
2866 | 2868 | var index=th.data.sec_pick_index; |
2867 | 2869 | item=th.data.sec_sto.s_arr[index]; |
2868 | - console.log(item,"分类的门店地址333333333333", index); | |
2870 | + | |
2869 | 2871 | } |
2870 | 2872 | |
2871 | 2873 | var store_id=o.stoid; |
2872 | 2874 | var user_id = getApp().globalData.user_id; |
2873 | 2875 | var def_pickup_id = item.pickup_id; |
2874 | 2876 | |
2875 | - getApp().request.post('/api/weshop/users/save',{ | |
2877 | + getApp().request.put('/api/weshop/users/update',{ | |
2876 | 2878 | data: { user_id,def_pickup_id}, |
2877 | 2879 | success:function(res){ |
2878 | - console.log("是什么",res.data.code); | |
2880 | + | |
2879 | 2881 | if (res.data.code==0){ |
2880 | 2882 | if (th.data.choice_sort_store == 0) th.setData({fir_pick_index:0}); |
2881 | 2883 | s.showWarning("设置门店地址成功", null, 500, !1); |
2884 | + getApp().globalData.pk_store = item; | |
2882 | 2885 | }else{ |
2883 | 2886 | console.log("门店地址失败"); |
2884 | 2887 | s.showWarning("设置默认门店地址失败", null, 500, !1); | ... | ... |