From 5cb4378e81c2f1e5854090e2586fa8d296c08224 Mon Sep 17 00:00:00 2001 From: yvan.ni <765199919@qq.com> Date: Thu, 26 Sep 2019 19:51:21 +0800 Subject: [PATCH] 商品详情,收藏 --- pages/goods/goodsInfo/goodsInfo.js | 47 +++++++++++++++++++++++------------------------ pages/user/collect_list/collect_list.js | 165 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------- pages/user/collect_list/collect_list.wxml | 73 +++++++++++++++++++++++++++---------------------------------------------- pages/user/collect_list/collect_list.wxss | 19 ++++++++++--------- 4 files changed, 154 insertions(+), 150 deletions(-) diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index d565aaf..79a85d6 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -2787,23 +2787,8 @@ close_popup:function(e){ //确定def_pick为选择的门店 sure_pick:function (e) { var th=this; var item=null; - var openindstore = e.currentTarget.dataset.openindstore; - if (openindstore == 1) { - - th.setData({ - openSpecModal: !0, - openSpecModal_ind: openindstore, }); - } else if (openindstore == 2) { - - th.setData({ - openSpecModal: !0, - openSpecModal_ind: openindstore, }); - } else { - - th.setData({ - store: 0, choice_sort_store: 0, sort_store: 0 - }) - } + var openindstore = e.currentTarget.dataset.openindstore; + if(th.data.choice_sort_store==0 ){ var index=th.data.fir_pick_index; if(th.data.is_show_sto_cat==1){ @@ -2811,13 +2796,31 @@ close_popup:function(e){ }else{ item=th.data.only_pk[index]; //当没有门店分类的时候 } + }else{ 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}); + + //th.setData({fir_pick_index:0}); + 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, fir_pick_index:0}); + + if (openindstore == 1) { + th.setData({ + openSpecModal: !0, + openSpecModal_ind: openindstore, }); + } else if (openindstore == 2) { + th.setData({ + openSpecModal: !0, + openSpecModal_ind: openindstore, }); + } else { + th.setData({ + store: 0, choice_sort_store: 0, sort_store: 0 + }) + } + }, //---点击二级之后的选择--- choose_for_store: function (e) { @@ -2834,18 +2837,14 @@ close_popup:function(e){ var index=th.data.fir_pick_index; if(th.data.is_show_sto_cat==1){ - item=th.data.def_pickpu_list[index]; - }else{ - item=th.data.only_pk[index]; //当没有门店分类的时候 } }else{ var index=th.data.sec_pick_index; item=th.data.sec_sto.s_arr[index]; - } var store_id=o.stoid; diff --git a/pages/user/collect_list/collect_list.js b/pages/user/collect_list/collect_list.js index 61b7b0f..0cc324b 100644 --- a/pages/user/collect_list/collect_list.js +++ b/pages/user/collect_list/collect_list.js @@ -17,48 +17,57 @@ Page({ collects: null, currentPage: 1, curpage: 1, - ismore: 0, iscollects: 0, - editEd: 0, //商品编辑按钮是否点击 isall: false, //是否全选 sum: 0, - total_collects:0, - is_goods:0, - pageSize:8,//分页数量 + total_collects: 0, + is_goods: 0, + pageSize: 8, //分页数量 + isdelete: 0 }, onLoad: function() { o.init(this, "", "collects"), - this.requestCollectList(); - // this.requestList(); + this.requestCollectList(); }, requestCollectList: function() { var th = this; - e = "/api/weshop/goodscollect/list?" + "pageSize=" + th.data.pageSize +"&user_id=" + + e = "/api/weshop/goodscollect/list?" + "pageSize=" + th.data.pageSize + "&user_id=" + app_d.user_id + "&store_id=" + oo.stoid + "&page=" + th.data.currentPage; - o.request(e, function(e) { - th.data.currentPage++; - if(th.data.total_collects==0){ - th.setData({ iscollects: 1, total_collects:e.data.data.total}) - } - if (th.data.total_collects