Authored by zhangxiaoru

品牌跳搜索

... ... @@ -45,7 +45,7 @@ const handleBrandList = origin => {
}
_.forEach(value, function(subValue) {
subValue.brandUrl = '//m.yohobuy.com/product/index/brand?domain=' + subValue.brand_domain + '&app_type=1';
subValue.brandUrl = '//search.m.yohobuy.com?query=' + subValue.brand_domain + '&app_type=1';
subValue.name = subValue.brand_name_en || subValue.brand_name_cn || subValue.brand_name;
subValue.domain = subValue.brand_domain;
});
... ...
... ... @@ -22,6 +22,7 @@ const shop = {
let brandLogo = {};
let title = '';
let uid = req.user.uid || 0;
let shopEnter;
if (req.query.shop_id) {
return shop.shop(req, res, next);
... ... @@ -73,7 +74,14 @@ const shop = {
if (brandId === 0) {
params.query = domain;
}
if (brandShop.length > 0 || brandLogo) {
if (req.query.app_type && parseInt(req.query.app_type, 10) === 1) {
shopEnter = false;
} else {
shopEnter = true;
}
if (brandShop.length > 0 || brandLogo && shopEnter) {
params = _.assign({
brandWay: _.isEmpty(brandShop) ? brandLogo : brandShop,
search: {
... ...
... ... @@ -68,11 +68,18 @@ const list = (req, res, next) => {
// 跳转到品牌商品列表页
if (domain !== null && !params.shop_id) {
let url = helpers.urlFormat('', {
let urlPro = {
from: 'search',
query: query
}
if (req.query.app_type) {
urlPro = _.assign(urlPro, {
app_type: req.query.app_type
})
}
}, domain);
let url = helpers.urlFormat('', urlPro, domain);
return res.redirect(url);
}
... ...