Authored by 刘传洋

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

... ... @@ -109,6 +109,24 @@ exports.brand = (req, res, next) => {
};
/**
* 品牌介绍页
* @param {[type]} req [description]
* @param {[type]} res [description]
* @return {[type]} [description]
*/
exports.brandAbout = (req, res, next) => {
let brandDomain = req.params.brandDomain;
if (!brandDomain) {
return res.redirect(helpers.urlFormat(''));
}
list.getBrandAbout(brandDomain, req.user.uid, req.yoho.channel).then(result => {
res.render('list/brand', Object.assign(result, {page: 'search'}));
}).catch(next);
};
/**
* 店铺商品列表页
* @param {[type]} req [description]
* @param {[type]} res [description]
... ...
... ... @@ -272,6 +272,84 @@ exports.getBrandData = (params, extra, channel) => {
};
/**
* 获取品牌页面数据
*/
exports.getBrandAbout = (domain, uid, channel) => {
channel = channel || 'boys';
return Promise.all([
headerModel.requestHeaderData(channel),
searchApi.getBrandData({domain: domain})
]).then(result => {
let home;
let finalResult = {
headerData: Object.assign(result[0].headerData, {
header: true
})
};
switch (channel) {
case 'girls':
home = helpers.urlFormat('/woman', {}, 'new');
break;
case 'lifestyle':
home = helpers.urlFormat('/lifestyle', {}, 'new');
break;
case 'kids':
home = helpers.urlFormat('/kids', {}, 'new');
break;
default:
home = helpers.urlFormat('');
break;
}
if (result[1].code === 200) {
let data = result[1].data || {};
let extra = {
brandId: data.id,
brandNameEn: data.brand_name_en || '',
brandNameCn: data.brand_name_cn || '',
brandBanner: data.brand_banner || '',
node: data.static_content_code || '',
brandAbout: data.brand_intro || '',
shopTemplateType: data.shop_template_type || 0,
url: helpers.urlFormat('', '', data.brand_domain),
name: data.brand_name,
shopId: data.shop_id || 0,
type: data.type || 0,
brandDomain: data.brand_domain
};
finalResult.brand = {
brandBanner: searchHandler.handleBrandBanner(extra),
pathNav: [
{
href: home,
name: `${_.toUpper(channel)}首页`,
pathTitle: 'YOHO!BUY 有货'
},
{
href: helpers.urlFormat('/brands'),
name: '品牌一览',
pathTitle: '品牌一览'
},
{
name: `${extra.brandNameEn} ${extra.brandNameCn}`
}
],
brandAbout: {
brandIntro: extra.brandAbout
}
};
}
return finalResult;
});
};
/**
* 获取品牌页面水牌
*/
exports.getNodeContentData = (params) => {
... ...
... ... @@ -368,7 +368,7 @@ exports.handleSortData = (origin, params) => {
leftContent.allSort.all = [{
name: '全部品类',
num: allCount,
href: handleFilterUrl(params)
href: handleFilterUrl(params, {}, {msort: true, misort: true})
}];
//
... ...
... ... @@ -77,6 +77,7 @@ router.get('/list/new', list.new);
// 品牌页
router.get('/brand/:brandDomain', list.brand);
router.get('/about/:brandDomain', list.brandAbout);
router.get('/shoplist', list.shopList); // 店铺列表页
router.post('/shop/togglecollect', favorite.collectShop); // 店铺收藏
... ...
... ... @@ -5,15 +5,15 @@
<div class="opt-wrap">
<p class="opt center-content">
<a href="{{brandHome}}">
<i class="iconfont">&#xe617;</i>
<i class="iconfont">&#xe61a;</i>
品牌首页
</a>
<a href="{{brandIntro}}">
<i class="iconfont">&#xe631;</i>
<i class="iconfont">&#xe62a;</i>
品牌介绍
</a>
<span id="brand-favor" class="brand-favor" data-id="{{dataId}}">
<i class="iconfont{{#if coled}} coled{{/if}}">&#xe616;</i>
<i class="iconfont{{#if coled}} coled{{/if}}">&#xe611;</i>
</span>
</p>
</div>
... ... @@ -29,15 +29,15 @@
<span class="shop-name">{{shopName}}</span>
{{/if}}
<a href="{{shopHome}}">
<i class="iconfont">&#xe617;</i>
<i class="iconfont">&#xe61a;</i>
店铺首页
</a>
<a href="{{shopIntro}}">
<i class="iconfont">&#xe631;</i>
<i class="iconfont">&#xe62a;</i>
店铺介绍
</a>
<span id="shop-favor" class="brand-favor shop-favor" data-id="{{shopId}}">
<i class="iconfont{{#if coled}} coled{{/if}}">&#xe616;</i>
<i class="iconfont{{#if coled}} coled{{/if}}">&#xe611;</i>
</span>
</p>
</div>
... ... @@ -45,38 +45,40 @@
{{/ shopBanner}}
<div class="center-content clearfix">
{{> common/path-nav}}
{{# pathNav}}
{{> common/path-nav}}
{{/ pathNav}}
<div class="list-left pull-left">
{{> product/left-content}}
</div>
{{# brandAbout}}
<div class="brand-about">
{{{brandIntro}}}
</div>
{{^}}
<div class="list-left pull-left">
{{> product/left-content}}
</div>
<div class="list-right pull-right">
{{# sortIntro}}
<div class="sort-intro clearfix">
<div class="texts pull-left">
<p class="name">{{name}}</p>
<p class="en-name">{{enName}}</p>
<p class="desc">{{{description}}}</p>
<div class="key-entry">
{{#each keyEntry}}
<a href="{{url}}">{{name}}</a>
{{/each}}
</div>
</div>
<img class="pull-right img" src="{{img}}">
</div>
{{/ sortIntro}}
<div class="list-right pull-right">
{{# sortIntro}}
<div class="sort-intro clearfix">
<div class="texts pull-left">
<p class="name">{{name}}</p>
<p class="en-name">{{enName}}</p>
<p class="desc">{{{description}}}</p>
<div class="key-entry">
{{#each keyEntry}}
<a href="{{url}}">{{name}}</a>
{{/each}}
</div>
</div>
<img class="pull-right img" src="{{img}}">
</div>
{{/ sortIntro}}
{{> list/shop-entry}}
{{> list/shop-entry}}
{{> product/standard-content}}
{{> product/standard-content}}
{{> product/latest-walk}}
{{> product/latest-walk}}
</div>
</div>
{{/ brandAbout}}
</div>
... ...
... ... @@ -32,6 +32,10 @@ module.exports = () => {
break;
default: // 其它(识别为品牌)
req.url = `/product/brand/${req.subdomains[0]}`;
if (req.path === '/about') {
req.url = `/product/about/${req.subdomains[0]}`;
}
break;
}
}
... ...
No preview for this file type
... ... @@ -2,7 +2,7 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
Created by FontForge 20120731 at Wed Aug 10 19:10:35 2016
Created by FontForge 20120731 at Wed Sep 21 17:18:20 2016
By admin
</metadata>
<defs>
... ... @@ -19,7 +19,7 @@ Created by FontForge 20120731 at Wed Aug 10 19:10:35 2016
bbox="0 -212 1158 896"
underline-thickness="50"
underline-position="-100"
unicode-range="U+0078-E623"
unicode-range="U+0078-E62A"
/>
<missing-glyph horiz-adv-x="374"
d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
... ... @@ -129,5 +129,26 @@ t-35.5 -173.5t35.5 -173.5t95.5 -142.5t142.5 -95t173 -35t173.5 35t142.5 95t95 142
" />
<glyph glyph-name="uniE623" unicode="&#xe623;"
d="M512 63l-316 -166l60 352l-256 250l354 51l158 321l158 -321l354 -51l-256 -250l60 -352z" />
<glyph glyph-name="uniE624" unicode="&#xe624;" horiz-adv-x="1000"
d="M744 598h-488q-38 0 -64.5 -26.5t-26.5 -64.5v-290q0 -38 26.5 -64.5t64.5 -26.5h227l200 -138v138h61q38 0 64.5 26.5t26.5 64.5v290q0 38 -26.5 64.5t-64.5 26.5zM744 358z" />
<glyph glyph-name="uniE625" unicode="&#xe625;"
d="M511 832q-91 0 -173.5 -35.5t-142 -95t-95 -142t-35.5 -173.5t35.5 -173.5t95 -142t142 -95t173.5 -35.5t173.5 35.5t142.5 95t95 142t35 173.5t-35 173.5t-95 142t-142.5 95t-173.5 35.5zM734 337h-237q-7 0 -14 3q-22 9 -22 33v237q0 15 10.5 26t26 11t26 -11t10.5 -26
v-200h200q15 0 26 -10.5t11 -26t-11 -26t-26 -10.5zM734 337z" />
<glyph glyph-name="uniE626" unicode="&#xe626;" horiz-adv-x="1025"
d="M994 163q-18 9 -16 30.5t27 46.5q24 27 17.5 54.5t-33.5 40.5q-17 8 -24.5 17.5t-2 20t26.5 19.5q30 11 29.5 55.5t-31.5 80.5q-34 39 -278 23l-23 -1q3 2 3 145q0 101 -28 139t-84 36q-18 0 -28.5 -5t-17 -13t-11 -26.5t-7.5 -38t-10 -56.5t-16 -74q-12 -47 -38 -94
t-54 -80t-55 -59t-44 -39l-18 -13v-386q10 -14 27 -25.5t31 -17t31 -11.5t21 -8q9 -4 65 -10.5t105.5 -11t51.5 -4.5q4 0 11 0.5t30 2.5t45 4.5t52 6.5t56.5 8t53.5 9.5t47 11t33.5 13t15.5 14.5q8 24 3 39t-2 27t23 20q27 10 34.5 34.5t0.5 46t-19 28.5zM0 379v-380
q0 -28 20 -48.5t49 -20.5h137v518h-137q-29 0 -49 -20.5t-20 -48.5zM0 379z" />
<glyph glyph-name="uniE627" unicode="&#xe627;" horiz-adv-x="1025"
d="M512 719q-167 0 -304.5 -89.5t-205.5 -236.5q-4 -9 0 -18q68 -147 205.5 -236.5t304.5 -89.5t304.5 89.5t205.5 236.5q4 9 0 18q-68 147 -205.5 236.5t-304.5 89.5zM512 153q-96 0 -163.5 67.5t-67.5 163.5t67.5 163.5t163.5 67.5t163.5 -67.5t67.5 -163.5t-67.5 -163.5
t-163.5 -67.5zM512 384zM364 384q0 61 43.5 104.5t104.5 43.5t104.5 -43.5t43.5 -104.5t-43.5 -104.5t-104.5 -43.5t-104.5 43.5t-43.5 104.5z" />
<glyph glyph-name="uniE628" unicode="&#xe628;"
d="M512 886q-102 0 -195 -39.5t-160.5 -107t-107 -160.5t-39.5 -195t39.5 -195t107 -160.5t160.5 -107t195 -39.5t195 39.5t160.5 107t107 160.5t39.5 195t-39.5 195t-107 160.5t-160.5 107t-195 39.5zM521 -15q-34 0 -58.5 24t-24.5 58.5t24.5 58.5t58.5 24t58 -24t24 -58
q1 -34 -23.5 -58.5t-58.5 -24.5zM738 477q-17 -34 -67 -83q-45 -43 -60 -61q-12 -16 -17 -35q-6 -22 -6 -61l1 -31h-142v30q0 56 9 90q11 38 30 64q17 23 62 71q43 44 52 60q8 13 8 44q0 28 -20 51q-20 21 -61 21q-29 0 -48.5 -9.5t-28.5 -27.5t-12.5 -36t-3.5 -43v-30h-142
l1 31q2 72 18 111q16 40 52 73q34 31 78 46q41 14 88 14q96 0 160 -56q66 -59 66 -154q0 -43 -17 -79z" />
<glyph glyph-name="uniE629" unicode="&#xe629;"
d="M511 833q-91 0 -174 -36t-143 -96t-95.5 -143t-35.5 -174t35.5 -174t95.5 -143t143 -95.5t174 -35.5t174 35.5t143 95.5t95.5 143t35.5 174t-35.5 174t-95.5 143t-143 96t-174 36zM770 193q15 -14 15 -34t-14.5 -34t-34 -14t-33.5 14l-192 191l-192 -191q-14 -14 -34 -14
t-34 14t-14 34t14 34l192 191l-192 192q-14 14 -14 34t14 34t34 14t34 -14l192 -192l192 192q14 14 33.5 14t34 -14t14.5 -34t-15 -34l-191 -192z" />
<glyph glyph-name="uniE62A" unicode="&#xe62a;"
d="M799 456l127 127v313h-830v-609l421 -413l409 404v181l-414 -401l-288 284v426h575v-312zM671 518l-107 22l-53 100l-52 -100l-108 -22l75 -83l-14 -114l99 49l99 -49l-14 114z" />
</font>
</defs></svg>
... ...
No preview for this file type
No preview for this file type
... ... @@ -203,7 +203,7 @@ $productListNav.find('h3').click(function() {
// 品牌页请求
if ($brandFavor.length) {
html = $('#pic-link-tpl').html();
html = $('#pic-link-tpl').html() || '';
$.ajax({
type: 'POST',
... ...
... ... @@ -15,14 +15,6 @@ require('./detail/latest-walk');
product.init(4);
lazyLoad($('img.lazy'), {
failure_limit: 20
});
... ...