Authored by OF1706

less sum

... ... @@ -115,8 +115,6 @@ exports.serachFilterBrands = (req, res, next) => {
**/
exports.searchLessRecommend = (req, res, next) => {
console.log(req.query.page);
return co(function * () {
let channel = req.yoho.channel;
... ... @@ -130,7 +128,6 @@ exports.searchLessRecommend = (req, res, next) => {
let ret = yield search.getSearchLessProduct(channel, uid, udid, page);
return res.send(ret);
})().catch(next);
... ...
... ... @@ -114,14 +114,15 @@ exports.getSearchData = (params, channel) => {
shopEntry: result[3],
name: params.query,
suggest: termsSuggestion ? termsSuggestion.join(',').split(',').splice(0, 3) : false,
changedQuery: result[2].data.isChangedQuery,
changedQuery: result[2].data.isChangedQuery == 'Y',
suggestFirst: finalResult.search.suggestFirst,
suggestSecond: finalResult.search.suggestSecond
});
if (finalResult.search.changedQuery === 'Y') {
if (finalResult.search.changedQuery) {
finalResult.search.suggestFirst = finalResult.search.suggest[0];
finalResult.search.suggestSecond = _.reverse(_.slice(_.reverse(finalResult.search.suggest)));
finalResult.search.suggestSecond = _.slice(termsSuggestion, 1, termsSuggestion.length).splice(0,3);
}
finalResult.criteo = {skn: searchHandler.getCriteo(_.get(finalResult.search, 'goods'))};
... ... @@ -236,11 +237,6 @@ exports.getSearchLessProduct = (channel, uid, udid, page) => {
}
};
console.log('**************');
console.log(page);
console.log('**************');
console.log(_.isNumber(page));
console.log(typeof page);
let channelNum = 1;
if (!_.isNumber(page)) {
... ...
... ... @@ -57,15 +57,17 @@
</div>
<div class="list-right pull-right">
{{#if_cond goods.length '>' 20 }}
{{#if_cond goods.length '<' 20 }}
{{#if suggest}}
{{#unless changedQuery}}
<div class="search-suggest-less">
"<em>{{name}}</em>"&nbsp;搜索结果太少了,试试{{#suggest}}&nbsp;"<a href="/?query={{.}}">{{.}}</a>"&nbsp;{{/suggest}}关键词搜索
</div>
{{/unless}}
{{/if}}
{{#if changedQuery}}
<div class="search-suggest-less">
没有找到&nbsp;"<em>{{name}}</em>"&nbsp;相关的商品,
... ... @@ -74,7 +76,6 @@
{{/if}}
{{/if_cond}}
{{> list/top-coupon}}
... ... @@ -100,6 +101,13 @@
{{> product/standard-content}}
{{#if_cond goods.length '<' 20 }}
<div>
<textarea class="lazy-load-object-2" style="visibility: hidden;">
<script>getSearchRecommend();</script>
</textarea>
</div>
<div class="bottom-tab-line">
<span class="bottom-title" data-type="recommend" data-role="recommend-tab">你可能喜欢</span>
</div>
... ... @@ -107,13 +115,7 @@
<div class="goods-slide">
<div data-role="recommend-slide" class="slide-panel"></div>
</div>
<div>
<div class="lazy-load-object-2">
<textarea class="latest-walk-datalazyload" style="visibility: hidden;">
<script>getSearchRecommend();</script>
</textarea>
</div>
</div>
{{/if_cond}}
{{> product/latest-walk}}
... ...
... ... @@ -24,10 +24,8 @@
<div data-role="recommend-slide" class="slide-panel"></div>
</div>
<div>
<div class="lazy-load-object-2">
<textarea class="latest-walk-datalazyload" style="visibility: hidden;">
<script>getSearchRecommend();</script>
</textarea>
</div>
<textarea class="lazy-load-object-2" style="visibility: hidden;">
<script>getSearchRecommend();</script>
</textarea>
</div>
</div>
... ...