Authored by 郭成尧

'品牌页性别参数'

... ... @@ -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);
... ...
... ... @@ -164,4 +164,5 @@
</ul>
</div>
{{/ shopIndex}}
{{> product/query-param}}
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -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')
));
}
... ...