Commit 1b93a9ae0c1b2ef1f701cacdc76e3c18425b29a7

Authored by 前端开发-陈颖阳
1 parent 2c271d81

分类

pages/goods/goodsList/goodsList.js
... ... @@ -497,9 +497,9 @@ Page({
497 497 },
498 498  
499 499 go_url:function (e) {
500   - var url = e.currentTarget.dataset.url+'&cat_id='+this.data.cat_id;
501   - //var rq_data = JSON.stringify(this.data.rq_data);
502   - //url += `&o=${rq_data}`;
  500 + var url = e.currentTarget.dataset.url;
  501 + var rq_data = JSON.stringify(this.data.rq_data);
  502 + url += `&o=${rq_data}`;
503 503 // console.log('url!!!=======<<<<', url);
504 504 getApp().goto(url);
505 505 },
... ...
pages/goods/search/search.js
... ... @@ -44,11 +44,21 @@ Page({
44 44  
45 45 onLoad: function (t) {
46 46 this.data.rq_data = t;
  47 +
47 48 if (t.o) {
48 49 this.data.rq_data.o = JSON.parse(t.o);
49 50 };
50   - if(t.cat_id){
51   - var baseUrl= "/api/weshop/goods/page?isnewwhere=1&cat_id="+t.cat_id
  51 + var req = t.o;
  52 + if(req.cat_id){
  53 + var baseUrl= "/api/weshop/goods/page?isnewwhere=1&cat_id="+req.cat_id
  54 + this.setData({ baseUrl: baseUrl });
  55 + }
  56 + if(req.nation_id){
  57 + var baseUrl= "/api/weshop/goods/page?isnewwhere=1&nation_id="+req.nation_id
  58 + this.setData({ baseUrl: baseUrl });
  59 + }
  60 + if(req.brand_id){
  61 + var baseUrl= "/api/weshop/goods/page?isnewwhere=1&brand_id="+req.brand_id
52 62 this.setData({ baseUrl: baseUrl });
53 63 }
54 64  
... ...