diff --git a/pages/goods/search/search.js b/pages/goods/search/search.js index 27e59dd..1bfc900 100644 --- a/pages/goods/search/search.js +++ b/pages/goods/search/search.js @@ -44,23 +44,29 @@ Page({ onLoad: function (t) { this.data.rq_data = t; - + if (t.o) { this.data.rq_data.o = JSON.parse(t.o); }; - var req = t.o; - if(req.cat_id){ - var baseUrl= "/api/weshop/goods/page?isnewwhere=1&cat_id="+req.cat_id - this.setData({ baseUrl: baseUrl }); - } - if(req.nation_id){ - var baseUrl= "/api/weshop/goods/page?isnewwhere=1&nation_id="+req.nation_id - this.setData({ baseUrl: baseUrl }); - } - if(req.brand_id){ - var baseUrl= "/api/weshop/goods/page?isnewwhere=1&brand_id="+req.brand_id + if(t.o) { + var req = t.o; + if(req.cat_id){ + var baseUrl= "/api/weshop/goods/page?isnewwhere=1&cat_id="+req.cat_id + this.setData({ baseUrl: baseUrl }); + } + if(req.nation_id){ + var baseUrl= "/api/weshop/goods/page?isnewwhere=1&nation_id="+req.nation_id + this.setData({ baseUrl: baseUrl }); + } + if(req.brand_id){ + var baseUrl= "/api/weshop/goods/page?isnewwhere=1&brand_id="+req.brand_id + this.setData({ baseUrl: baseUrl }); + } + }else{ + var baseUrl= "/api/weshop/goods/page?isnewwhere=1" this.setData({ baseUrl: baseUrl }); } + //接受有没有导购的参数