From 9c1fd7be9edb71e3d31073900dcb4f8fb1430702 Mon Sep 17 00:00:00 2001 From: Targaryen <chengyao.guo@yoho.cn> Date: Thu, 23 Jun 2016 12:32:05 +0800 Subject: [PATCH] '品牌页性别参数' --- static/js/product/shop.js | 16 +++++++++++++++- template/m.yohobuy.com/actions/product/index/shop.phtml | 1 + yohobuy/m.yohobuy.com/application/modules/Product/controllers/Index.php | 3 ++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/static/js/product/shop.js b/static/js/product/shop.js index 4aa83fc..8e1d42a 100644 --- a/static/js/product/shop.js +++ b/static/js/product/shop.js @@ -557,12 +557,26 @@ function search(opt) { }); } +/** + * 获取url参数 + */ +function getQueryString(name) { + var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i'); + var r = window.location.search.substr(1).match(reg); + + if (r != null) { + return window.unescape(r[2]); + } + return null; +} + $.ajax({ type: 'GET', url: '/search/filter', data: { shop_id: brand ? '' : shopId, - brand: brand + brand: brand, + gender: getQueryString('gender') }, success: function(data) { $goodsContainer.append(data); diff --git a/template/m.yohobuy.com/actions/product/index/shop.phtml b/template/m.yohobuy.com/actions/product/index/shop.phtml index 923a6ce..70ff032 100644 --- a/template/m.yohobuy.com/actions/product/index/shop.phtml +++ b/template/m.yohobuy.com/actions/product/index/shop.phtml @@ -164,4 +164,5 @@ </ul> </div> {{/ shopIndex}} +{{> product/query-param}} {{> layout/footer}} \ No newline at end of file diff --git a/yohobuy/m.yohobuy.com/application/modules/Product/controllers/Index.php b/yohobuy/m.yohobuy.com/application/modules/Product/controllers/Index.php index ed4c6c5..f723891 100644 --- a/yohobuy/m.yohobuy.com/application/modules/Product/controllers/Index.php +++ b/yohobuy/m.yohobuy.com/application/modules/Product/controllers/Index.php @@ -484,7 +484,8 @@ class IndexController extends AbstractAction 'shopPage' => array( 'text' => '分类', 'url' => Helpers::url('/product/index/category', array('shop_id' => $shopId)) - ) + ), + 'gender' => $this->get('gender') )); } -- libgit2 0.24.0