Authored by 刘传洋

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

@@ -194,12 +194,14 @@ exports.getAdnav = (req, res, next) => { @@ -194,12 +194,14 @@ exports.getAdnav = (req, res, next) => {
194 * @return {[type]} [description] 194 * @return {[type]} [description]
195 */ 195 */
196 exports.isFavoriteBrand = (req, res, next) => { 196 exports.isFavoriteBrand = (req, res, next) => {
  197 + let uid = req.user.uid;
  198 + let brandId = req.body.brandId;
197 199
198 - if (!req.xhr || !req.body.brandId || req.user.id) { 200 + if (!req.xhr || !req.body.brandId || !uid) {
199 return next(); 201 return next();
200 } 202 }
201 203
202 - searchApi.isFavoriteBrand(req.user.id, req.body).then(result => { 204 + searchApi.isFavoriteBrand(uid, brandId).then(result => {
203 res.json(result); 205 res.json(result);
204 }).catch(next); 206 }).catch(next);
205 }; 207 };
@@ -25,7 +25,7 @@ const getSortByConditionAsync = (condition) => { @@ -25,7 +25,7 @@ const getSortByConditionAsync = (condition) => {
25 const adsUrl = '/shops/api/v1/ads/getList'; 25 const adsUrl = '/shops/api/v1/ads/getList';
26 26
27 // 判断用户是否收藏品牌 27 // 判断用户是否收藏品牌
28 -// const isFavoriteBrandUrl = '/shops/service/v1/favorite/'; 28 +const isFavoriteBrandUrl = '/shops/service/v1/favorite/getUidBrandFav';
29 29
30 // 根据品牌查询相关文章 30 // 根据品牌查询相关文章
31 const relateArticleUrl = 'guang/service/v2/article/getArticleByBrand'; 31 const relateArticleUrl = 'guang/service/v2/article/getArticleByBrand';
@@ -436,8 +436,10 @@ const getBrandData = (params) => { @@ -436,8 +436,10 @@ const getBrandData = (params) => {
436 * @return 436 * @return
437 */ 437 */
438 const isFavoriteBrand = (uid, brandId) => { 438 const isFavoriteBrand = (uid, brandId) => {
439 -  
440 - return serviceApi.get('', {uid: uid, brandId: brandId}); 439 + return serviceApi.get(isFavoriteBrandUrl, {
  440 + uid: uid,
  441 + brandId: brandId
  442 + });
441 }; 443 };
442 444
443 /** 445 /**
@@ -859,7 +859,7 @@ exports.handlePathNavData = (data, params, page) => { @@ -859,7 +859,7 @@ exports.handlePathNavData = (data, params, page) => {
859 { 859 {
860 name: '品牌一览', 860 name: '品牌一览',
861 pathTitle: '品牌一览', 861 pathTitle: '品牌一览',
862 - href: helpers.urlFormat('brand') 862 + href: helpers.urlFormat('/brands')
863 }, 863 },
864 { 864 {
865 name: data.brandNameEn + data.brandNameCn, 865 name: data.brandNameEn + data.brandNameCn,