Authored by 徐炜

搜索shop_id参数问题

... ... @@ -117,7 +117,8 @@ const list = (req, res, next) => {
title: title,
goodList: params,
firstPageGoodsList: result[2].list || [],
pageFooter: true
pageFooter: true,
shopId: params.shop_id || ''
});
}).catch(next);
}
... ... @@ -182,7 +183,8 @@ const search = (req, res, next) => {
params.limit = 24;
searchModel.getSearchData(params).then((result) => {
if (result && result.list && parseInt(params.page) === 1 && parseInt(params.start) > 0) {
if (result && result.list && result.list.length > params.start &&
parseInt(params.page) === 1 && parseInt(params.start) > 0) {
// 首屏渲染时,使用 'start' 参数裁减已渲染数据
result.list = result.list.slice(params.start || 0);
}
... ...
... ... @@ -5,6 +5,7 @@
<i class="search-icon iconfont">&#xe60f;</i>
<input type="text" value="{{default}}" name="query" class="buriedpoint" data-bp-id="shop-search_input_1" autocomplete="off">
<input type="hidden" value="search" name="from">
<input type="hidden" name="shop_id" value="{{@root.shopId}}">
<i class="clear-input iconfont hide">&#xe626;</i>
<span id="search" class="search buriedpoint" type="submit" data-bp-id="shop-search_btn_0">搜索</span>
</form>
... ...