Authored by OF1706

Merge branch 'feature/suggestItem' of http://git.yoho.cn/fe/yohobuy-node into feature/suggestItem

... ... @@ -180,6 +180,7 @@ const keyword = (req, res, next) => {
return search.getSearchKeywordData(Object.assign(params, {query: query}),
req.yoho.channel).then(result => {
Object.assign(resData, result, {
pageNoFollow: true,
title: `${query}价格_图片_品牌_怎么样-YOHO!BUY有货`,
keywords: `${query},${query}价格,${query}图片,${query}怎么样,${query}品牌,YOHO!BUY有货`,
description: `YOHO!BUY有货网yohobuy.com是国内专业的${query}网上潮流购物商城,为您找到${_.get(result,
... ...
... ... @@ -10,6 +10,7 @@ const _ = require('lodash');
const helpers = global.yoho.helpers;
const crypto = global.yoho.crypto;
const queryString = require('querystring');
const logger = global.yoho.logger;
const indexUrl = {
boys: helpers.urlFormat('/'),
girls: helpers.urlFormat('/woman'),
... ... @@ -1690,7 +1691,12 @@ exports.getSearchParams = params => {
/** 查询参数再处理 **/
// 对可能有中文的情况进行处理
if (params.query) {
params.query = decodeURIComponent(params.query);
try {
params.query = decodeURIComponent(params.query);
} catch (e) {
logger.info(e);
}
}
return Object.assign({}, params, nparams);
... ...
{{# sort}}
<div class="sort-pager">
{{# sortType}}
<a class="sort-type{{#if active}} active{{/if}} pjax" href="{{href}}">
<a class="sort-type{{#if active}} active{{/if}} pjax" href="{{href}}"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>
{{name}}
{{#if hasSortOrient}}
{{#if active}}
... ... @@ -22,7 +22,7 @@
{{#if newPage}}
<div class="page-nav">
{{#if preHref}}
<a class="pjax" href="{{preHref}}">
<a class="pjax" href="{{preHref}}"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>
<span class="page-prev">
<i class="iconfont">&#xe618;</i>
</span>
... ... @@ -34,7 +34,7 @@
{{/if}}
{{#if nextHref}}
<a class="pjax" href="{{nextHref}}">
<a class="pjax" href="{{nextHref}}"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>
<span class="page-next">
下一页
<i class="iconfont">&#xe619;</i>
... ... @@ -53,7 +53,7 @@
<div class="pager-wrap">
<p class="page-orient">
{{#if preHref}}
<a class="pjax" href="{{preHref}}">
<a class="pjax" href="{{preHref}}"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>
<span class="iconfont">&#xe60e;</span>
</a>
{{^}}
... ... @@ -65,7 +65,7 @@
</span>
{{#if nextHref}}
<a class="pjax" href="{{nextHref}}">
<a class="pjax" href="{{nextHref}}"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>
<span class="iconfont">&#xe60c;</span>
</a>
{{^}}
... ... @@ -75,4 +75,4 @@
</div>
{{/if}}
</div>
{{/ sort}}
\ No newline at end of file
{{/ sort}}
... ...
... ... @@ -13,15 +13,15 @@
<div class="pager">
{{# prePage}}
<a href="{{url}}" title="上一页"><span class="iconfont">&#xe60e;</span>上一页</a>
<a href="{{url}}"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}} title="上一页"><span class="iconfont">&#xe60e;</span>上一页</a>
{{/ prePage}}
{{# pages}}
<a{{#if url}} href="{{url}}"{{/if}}{{#if cur}} class="cur"{{/if}}>{{num}}</a>
<a{{#if url}} href="{{url}}"{{/if}}{{#if cur}} class="cur"{{/if}}{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>{{num}}</a>
{{/ pages}}
{{# nextPage}}
<a href="{{url}}" title="下一页">下一页<span class="iconfont">&#xe60c;</span></a>
<a href="{{url}}"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}} title="下一页">下一页<span class="iconfont">&#xe60c;</span></a>
{{/ nextPage}}
</div>
</div>
... ...
... ... @@ -4,12 +4,12 @@
<div class="center-content">
<div class="yoho-group-map left">
<span class="icon-hamburger"></span>
<a href="//www.yohobuy.com">YOHO!BUY 有货</a>
<a href="//www.yohobuy.com"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>YOHO!BUY 有货</a>
{{#if yohoGroup}}
<ul class="yoho-group-list">
{{# yohoGroup}}
<li>
<a href="{{link}}" class="yoho-group" data-en="{{en}}" data-cn="{{cn}}">{{en}}</a>
<a href="{{link}}" class="yoho-group"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}} data-en="{{en}}" data-cn="{{cn}}">{{en}}</a>
</li>
{{/ yohoGroup}}
</ul>
... ... @@ -17,7 +17,7 @@
</div>
<div class="left swindle-info">
<span class="icon-note"></span>
<a href="//www.yohobuy.com/help/detail?id=103&contId=147" target="_blank">
<a href="//www.yohobuy.com/help/detail?id=103&contId=147"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}} target="_blank">
关于防诈骗的重要提醒
</a>
</div>
... ... @@ -58,10 +58,10 @@
<a href="#">客户服务</a>
<ul class="nav-drop-down">
<li>
<a href="{{#if @root.pc.clientService.new}}http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409{{else}}//www.yohobuy.com/service/client{{/if}}" target="_blank">在线客服</a>
<a href="{{#if @root.pc.clientService.new}}http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409{{else}}//www.yohobuy.com/service/client{{/if}}"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}} target="_blank">在线客服</a>
</li>
<li>
<a href="//www.yohobuy.com/help">帮助中心</a>
<a href="//www.yohobuy.com/help"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>帮助中心</a>
</li>
</ul>
</li>
... ... @@ -78,7 +78,7 @@
<li class="phoneapp download-code" id="phoneApp">
<span class="tag-seprate"></span>
<span class="icon-phone"></span>
<a href="//www.yohobuy.com/download/app">手机版</a>
<a href="//www.yohobuy.com/download/app"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>手机版</a>
<div class="download-app-box">
<div class="qr-img code-img"></div>
<h5 class="qr-words">下载手机客户端</h5>
... ... @@ -100,13 +100,13 @@
<li class="{{type}}"{{#if ico}}
style="background: url({{image2 ico w=54 h=32}}) no-repeat center center"{{/if}}>
{{#if ico}}
<a href="{{link}}"{{#if isNewPage}} target="_blank"{{/if}} class="menu-ico"></a>
<a href="{{link}}"{{#if isNewPage}} target="_blank"{{/if}} class="menu-ico"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}></a>
{{^}}
<h5 class="name-cn">
<a href="{{link}}"{{#if isNewPage}} target="_blank"{{/if}}>{{cn}}</a>
<a href="{{link}}"{{#if isNewPage}} target="_blank"{{/if}}{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>{{cn}}</a>
</h5>
<h5 class="name-en">
<a href="{{link}}"{{#if isNewPage}} target="_blank"{{/if}}>{{en}}</a>
<a href="{{link}}"{{#if isNewPage}} target="_blank"{{/if}}{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>{{en}}</a>
</h5>
{{/if}}
</li>
... ... @@ -127,7 +127,7 @@
{{#hotTerms}}
<li>
<a style="display: block;" href="{{href}}" title="{{content}}"
act="{{href}}" target="_blank">
act="{{href}}"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}} target="_blank">
<span class="searchvalue">{{content}}</span>
</a>
</li>
... ... @@ -162,7 +162,7 @@
<ul class="sub-nav-list {{subType}}">
{{# subNav}}
<li {{#if thirdNav}}class="contain-third"{{/if}}>
<a href="{{link}}">{{name}}
<a href="{{link}}"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>{{name}}
{{#if isNew}}
<span class="newlogo"></span>
{{/if}}
... ... @@ -173,18 +173,18 @@
<dl class="hide-list hide">
{{# thirdNav}}
<dt>
<h3 class=""><a href="{{link}}">{{title}}</a></h3>
<h3 class=""><a href="{{link}}"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>{{title}}</a></h3>
</dt>
{{#brandItems}}
<dd>
<a href="{{link}}"{{#if hot}}
class="hot"{{/if}}>{{brandName}}</a>
class="hot"{{/if}}{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>{{brandName}}</a>
</dd>
{{/brandItems}}
{{/thirdNav}}
</dl>
<div class="show-detail" data-code="{{imgCode}}">
<a><img src="data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw=="></a>
<a{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}><img src="data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw=="></a>
<a class="title">热门小物优选</a>
</div>
</div>
... ...
... ... @@ -12,7 +12,7 @@
{{# opts}}
<div class="sort-pager">
{{# sortType}}
<a class="sort-type{{#if active}} active{{/if}}" href="{{href}}">
<a class="sort-type{{#if active}} active{{/if}}" href="{{href}}"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>
{{name}}
{{#if hasSortOrient}}
{{#if active}}
... ... @@ -32,7 +32,7 @@
{{# checks}}
{{#if this}}
<a class="checks{{#if checked}} checked{{/if}}" href="{{href}}">
<a class="checks{{#if checked}} checked{{/if}}" href="{{href}}"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>
{{#if checked}}
<span class="iconfont">&#xe613;</span>
{{^}}
... ... @@ -54,7 +54,7 @@
<ul>
{{# pageCounts}}
<li>
<a href="{{href}}">{{count}}</a>
<a href="{{href}}"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>{{count}}</a>
</li>
{{/ pageCounts}}
</ul>
... ... @@ -62,7 +62,7 @@
<p class="page-orient">
{{#if preHref}}
<a href="{{preHref}}">
<a href="{{preHref}}"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>
<span class="iconfont">&#xe60e;</span>
</a>
{{^}}
... ... @@ -74,7 +74,7 @@
</span>
{{#if nextHref}}
<a href="{{nextHref}}">
<a href="{{nextHref}}"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>
<span class="iconfont">&#xe60c;</span>
</a>
{{^}}
... ... @@ -93,7 +93,7 @@
{{/each}}
{{# hasNextPage}}
<div class="block-next-page">
<a href="{{href}}">
<a href="{{href}}"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>
<img src="{{image2 src}}" alt=""/>
</a>
</div>
... ...