Commit 9056af795c75b6330ed42d7444e0e86432f88441

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

首页进入分类搜索

Showing 1 changed file with 18 additions and 12 deletions
pages/goods/search/search.js
... ... @@ -44,23 +44,29 @@ Page({
44 44  
45 45 onLoad: function (t) {
46 46 this.data.rq_data = t;
47   -
  47 +
48 48 if (t.o) {
49 49 this.data.rq_data.o = JSON.parse(t.o);
50 50 };
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
  51 + if(t.o) {
  52 + var req = t.o;
  53 + if(req.cat_id){
  54 + var baseUrl= "/api/weshop/goods/page?isnewwhere=1&cat_id="+req.cat_id
  55 + this.setData({ baseUrl: baseUrl });
  56 + }
  57 + if(req.nation_id){
  58 + var baseUrl= "/api/weshop/goods/page?isnewwhere=1&nation_id="+req.nation_id
  59 + this.setData({ baseUrl: baseUrl });
  60 + }
  61 + if(req.brand_id){
  62 + var baseUrl= "/api/weshop/goods/page?isnewwhere=1&brand_id="+req.brand_id
  63 + this.setData({ baseUrl: baseUrl });
  64 + }
  65 + }else{
  66 + var baseUrl= "/api/weshop/goods/page?isnewwhere=1"
62 67 this.setData({ baseUrl: baseUrl });
63 68 }
  69 +
64 70  
65 71  
66 72 //接受有没有导购的参数
... ...