Authored by 郭成尧

Merge branch 'release/newSearch'

@@ -132,9 +132,9 @@ const _shop = (req, res, shopId) => { @@ -132,9 +132,9 @@ const _shop = (req, res, shopId) => {
132 shopHeadHide: true, 132 shopHeadHide: true,
133 gender: req.query.gender, 133 gender: req.query.gender,
134 channel: req.query.channel, 134 channel: req.query.channel,
135 - title: result.storeName + '|' + result.storeName + '潮流服装服饰-Yoho!Buy有货',  
136 - keywords: result.storeName + ',' + result.storeName + '服装服饰,' + result.storeName + '潮流服装服饰',  
137 - description: result.storeName + '|Yoho!Buy有货' + result.storeName + '潮流服饰官方授权店!100%品牌正品保证,支持货到付款。', 135 + title: result.seoTitle + '|' + result.seoTitle + '潮流服装服饰-Yoho!Buy有货',
  136 + keywords: result.seoTitle + ',' + result.seoTitle + '服装服饰,' + result.seoTitle + '潮流服装服饰',
  137 + description: result.seoTitle + '|Yoho!Buy有货' + result.seoTitle + '潮流服饰官方授权店!100%品牌正品保证,支持货到付款。',
138 shopId: shopId, 138 shopId: shopId,
139 shopPage: true 139 shopPage: true
140 }); 140 });
@@ -232,7 +232,7 @@ const brand = (req, res, next) => { @@ -232,7 +232,7 @@ const brand = (req, res, next) => {
232 }, params); 232 }, params);
233 233
234 // 无店铺:0--->品牌页 无单品店有多品店:1--->搜索页 有单品店:2--->店铺页面 234 // 无店铺:0--->品牌页 无单品店有多品店:1--->搜索页 有单品店:2--->店铺页面
235 - if (brandLogo.type === '2' && brandLogo.shopId) { 235 + if (req.query.from !== 'search' && brandLogo.type === '2' && brandLogo.shopId) {
236 _shop(req, res, brandLogo.shopId); 236 _shop(req, res, brandLogo.shopId);
237 } else { // 获取品牌店铺信息 237 } else { // 获取品牌店铺信息
238 listModel.getBrandShops(brandId).then(brandShop => { 238 listModel.getBrandShops(brandId).then(brandShop => {
@@ -362,12 +362,14 @@ const favoriteBrand = (req, res, next) => { @@ -362,12 +362,14 @@ const favoriteBrand = (req, res, next) => {
362 } 362 }
363 }); 363 });
364 364
365 - refer = refererSplit[0] + '?' + shopId; 365 + if (shopId) {
  366 + refer = refererSplit[0] + '?' + shopId;
  367 + }
366 } 368 }
367 369
368 let url = helpers.urlFormat('/signin.html') + '?refer=' + refer; 370 let url = helpers.urlFormat('/signin.html') + '?refer=' + refer;
369 371
370 - if (appVersion) { 372 + if (appVersion && appVersion !== 'false') {
371 uid = req.query.uid ? crypto.decrypt('', req.query.uid) : req.cookies.appUid; 373 uid = req.query.uid ? crypto.decrypt('', req.query.uid) : req.cookies.appUid;
372 374
373 if (!uid || uid === 'undefined') { 375 if (!uid || uid === 'undefined') {
@@ -46,12 +46,12 @@ const list = (req, res, next) => { @@ -46,12 +46,12 @@ const list = (req, res, next) => {
46 query = query.toLowerCase(); 46 query = query.toLowerCase();
47 _.forEach(result[0], obj => { 47 _.forEach(result[0], obj => {
48 48
49 - if (query === obj.brandDomain && /^[a-z0-9]+$/i.test(obj.brandName)) { // 精确查品牌域名 49 + if (query === obj.brandDomain) { // 精确查品牌域名
50 domain = query; 50 domain = query;
51 return false; 51 return false;
52 } 52 }
53 53
54 - if (query === obj.brandName || query === obj.brandName || query === obj.brandName && /^[a-z0-9]+$/i.test(obj.brandName)) { // 精确查品牌名称 54 + if (query === obj.brandName || query === obj.brandName || query === obj.brandName) { // 精确查品牌名称
55 domain = obj.brandDomain; 55 domain = obj.brandDomain;
56 return false; 56 return false;
57 } 57 }
@@ -34,8 +34,8 @@ const _processBrandShops = (list) => { @@ -34,8 +34,8 @@ const _processBrandShops = (list) => {
34 url: helpers.urlFormat('/product/index/brand/', { 34 url: helpers.urlFormat('/product/index/brand/', {
35 shop_id: item.shop_id 35 shop_id: item.shop_id
36 }), 36 }),
37 - thumb: helpers.image(item.brandIco, 75, 40),  
38 - name: item.brandName 37 + thumb: helpers.image(item.brand_ico, 75, 40),
  38 + name: item.brand_name
39 }); 39 });
40 } 40 }
41 }); 41 });
@@ -367,6 +367,7 @@ const _formShopData = (data, shopId, isApp) => { @@ -367,6 +367,7 @@ const _formShopData = (data, shopId, isApp) => {
367 logoImg: _.get(data, 'shopInfo.shop_logo', ''), 367 logoImg: _.get(data, 'shopInfo.shop_logo', ''),
368 storeName: (_.get(data, 'shopInfo.is_show_shop_name', '') === 'Y') ? 368 storeName: (_.get(data, 'shopInfo.is_show_shop_name', '') === 'Y') ?
369 _.get(data, 'shopInfo.shop_name', '') : '', 369 _.get(data, 'shopInfo.shop_name', '') : '',
  370 + seoTitle: _.get(data, 'shopInfo.shop_name', ''),
370 collect: _.get(data, 'shopInfo.is_favorite', '') === 'Y', 371 collect: _.get(data, 'shopInfo.is_favorite', '') === 'Y',
371 url: helpers.urlFormat('', { 372 url: helpers.urlFormat('', {
372 shop_id: shopId 373 shop_id: shopId
@@ -741,15 +742,15 @@ const getShopCategory = (params) => { @@ -741,15 +742,15 @@ const getShopCategory = (params) => {
741 742
742 _.forEach(resultCopy, value => { 743 _.forEach(resultCopy, value => {
743 finalResult.class.push({ 744 finalResult.class.push({
744 - name: value.categoryName 745 + name: value.category_name
745 }); 746 });
746 747
747 _.forEach(value.sub, (subValue, subKey) => { 748 _.forEach(value.sub, (subValue, subKey) => {
748 value.sub[subKey].url = helpers.urlFormat('/product/search/list', { 749 value.sub[subKey].url = helpers.urlFormat('/product/search/list', {
749 shop_id: params.shopId, 750 shop_id: params.shopId,
750 sort: _.get(value, 'relation_parameter.sort', ''), 751 sort: _.get(value, 'relation_parameter.sort', ''),
751 - title: subValue.categoryName,  
752 - query: subValue.categoryName 752 + title: subValue.category_name,
  753 + query: subValue.category_name
753 }); 754 });
754 }); 755 });
755 756
@@ -22,9 +22,9 @@ @@ -22,9 +22,9 @@
22 {{# category}} 22 {{# category}}
23 <ul class="sub-level"> 23 <ul class="sub-level">
24 {{# subcategory}} 24 {{# subcategory}}
25 - <li class="buriedpoint" data-bp-id="shop_sublevel_{{categoryName}}_1"> 25 + <li class="buriedpoint" data-bp-id="shop_sublevel_{{category_name}}_1">
26 <a href={{url}}> 26 <a href={{url}}>
27 - {{categoryName}} 27 + {{category_name}}
28 </a> 28 </a>
29 </li> 29 </li>
30 {{/ subcategory}} 30 {{/ subcategory}}