Authored by 周少峰

Merge branch 'master' into feature/brands

... ... @@ -127,7 +127,7 @@ exports.brand = (req, res, next) => {
* @return {[type]} [description]
*/
exports.brandAbout = (req, res, next) => {
let brandDomain = req.params.brandDomain;
let brandDomain = req.query.domain;
let shopId = req.query.shopId;
if (!brandDomain) {
... ...
... ... @@ -9,8 +9,6 @@
const mRoot = '../models';
const sale = require(`${mRoot}/sale`); // sale model
const _ = require('lodash');
/**
* sale 首页
* @param {[type]} req [description]
... ... @@ -152,9 +150,6 @@ exports.special = (req, res, next) => {
return next();
}
_.omit(params, 'specialsale_id');
params.productPool = specialId;
sale.getSaleSpecialData(specialId, params, req.yoho.channel).then(result => {
res.render('sale/special', result);
}).catch(next);
... ...
... ... @@ -442,6 +442,7 @@ const getShopAbout = (shopId, uid, channel) => {
Object.assign(decorator.shopTopBannerBase, {
shopId: shopId,
bannerHeight: 150,
shopHome: `/?shopId=${shopId}`,
shopIntro: `/about?shopId=${shopId}`,
coled: _.get(result, '[2].data.is_favorite', 'N') === 'Y'
... ... @@ -491,7 +492,7 @@ const getAdnav = (params) => {
if (result[1].code === 200 && result[1].data) {
dest.picTitle = brandFolderSeries;
Object.assign(dest.list, searchHandler.handleFolderData(result[0].data));
Object.assign(dest.list, searchHandler.handleSeriesData(result[1].data));
}
... ... @@ -896,6 +897,7 @@ const getBaseShopData = (params, extra, channel, shopId) => {
Object.assign(decorator.shopTopBannerBase, {
shopId: shopId,
bannerHeight: 150,
shopHome: `/?shopId=${shopId}`,
shopIntro: `/about?shopId=${shopId}`,
coled: _.get(result[2], 'data.is_favorite', 'N') === 'Y'
... ... @@ -904,6 +906,7 @@ const getBaseShopData = (params, extra, channel, shopId) => {
_.unset(resData, 'brand.brandBanner');
if (decorator.signboard) {
_.unset(resData, 'brand.node');
_.set(resData, 'brand.signboard', decorator.signboard);
}
}
... ...
... ... @@ -731,9 +731,9 @@ exports.handlePagerData = (total, params) => {
pages: []
};
let currentPage = parseInt((_.isEmpty(params.page) ? 1 : params.page), 10); // 当前页
let perPageCount = parseInt((_.isEmpty(params.limit) ? 60 : params.limit), 10); // 每页商品数
let totalPage = parseInt(total / perPageCount, 10) + 1; // 总页数
let currentPage = parseInt(_.get(params, 'page', 1), 10); // 当前页
let perPageCount = parseInt(_.get(params, 'limit', 60), 10); // 每页商品数
let totalPage = Math.ceil(total / perPageCount); // 总页数
if (currentPage === 1) {
// 当前页为 1,一定没有上一页
... ... @@ -773,11 +773,14 @@ exports.handlePagerData = (total, params) => {
}
} else if (currentPage > totalPage - 2) {
for (let i = totalPage; i >= totalPage - 4; i--) {
pages.push({
url: handleFilterUrl(params, {page: i}),
num: i,
cur: currentPage === i
});
if (i > 0) {
pages.push({
url: handleFilterUrl(params, {page: i}),
num: i,
cur: currentPage === i
});
}
}
pages = _.sortBy(pages, ['num']);
}
... ... @@ -795,7 +798,7 @@ exports.handlePagerData = (total, params) => {
num: '...'
});
}
if (currentPage < totalPage - 2) {
if (currentPage < totalPage - 2 && totalPage > 5) {
nextPages.push({
num: '...'
});
... ...
... ... @@ -1249,7 +1249,7 @@ exports.handleBrandBanner = (data) => {
};
/**
* 处理品牌系列
* 处理品牌系列folder_id
* @type {[type]}
*/
exports.handleFolderData = (data) => {
... ... @@ -1266,6 +1266,23 @@ exports.handleFolderData = (data) => {
};
/**
* 处理品牌系列series
* @type {[type]}
*/
exports.handleSeriesData = (data) => {
let dest = [];
_.forEach(data, (value) => {
dest.push({
href: '?series=' + value.id,
src: value.series_banner
});
});
return dest;
};
/**
* 筛选类链接处理的对外接口
* @type {[type]}
*/
... ...
... ... @@ -61,7 +61,8 @@
"uuid": "^2.0.2",
"winston": "^2.2.0",
"winston-daily-rotate-file": "^1.1.4",
"yoho-node-lib": "0.0.52"
"yoho-express-session": "^1.14.1",
"yoho-node-lib": "0.1.19"
},
"devDependencies": {
"autoprefixer": "^6.3.6",
... ...
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 Tue Oct 11 18:05:14 2016
Created by FontForge 20120731 at Wed Oct 19 11:59:28 2016
By admin
</metadata>
<defs>
... ... @@ -16,10 +16,10 @@ Created by FontForge 20120731 at Tue Oct 11 18:05:14 2016
ascent="896"
descent="-128"
x-height="792"
bbox="0 -212 1158 896"
bbox="-0.75 -212 1160 896.75"
underline-thickness="50"
underline-position="-100"
unicode-range="U+0078-E62C"
unicode-range="U+0078-E637"
/>
<missing-glyph horiz-adv-x="374"
d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
... ... @@ -155,5 +155,32 @@ d="M562 224h109v-111h-109v111zM889 224h109v-111h-109v111zM562 113h109v-110h-109v
h222v-111h-222v111zM889 334h109v-111h-109v111zM780 113h109v-111h-109v111zM562 2h218v-110h-218v110zM889 2h109v-110h-109v110z" />
<glyph glyph-name="uniE62C" unicode="&#xe62c;"
d="M512 769q-104 0 -192.5 -51.5t-140 -140t-51.5 -193t51.5 -193t140 -140t192.5 -51.5t192.5 51.5t140 140t51.5 193t-51.5 193t-140 140t-192.5 51.5zM660 181h-50v175h-196v-175h-50v395h50v-179h196v179h50v-395z" />
<glyph glyph-name="uniE62D" unicode="&#xe62d;" horiz-adv-x="1000"
d="M751 766q21 -20 34 -33t19.5 -22.5t8.5 -16t2 -10.5v-13h-119q-8 0 -14 6t-10 14t-6 16.5t-2 12.5v100h3q6 0 13 -2t15.5 -8t22 -16t33.5 -28zM614 720q0 -16 5 -33.5t15 -32t26 -24t38 -9.5h117v-451q0 -24 -9.5 -42t-24.5 -31t-33.5 -20t-35.5 -7h-394q-15 0 -33 8.5
t-33.5 23t-26 33t-10.5 38.5v543q0 17 7.5 35t21 33.5t30 25.5t35.5 10h305v-100zM664 221q21 0 35.5 14.5t14.5 35.5t-14.5 35.5t-35.5 14.5h-299q-21 0 -35.5 -14.5t-14.5 -35.5t14.5 -35.5t35.5 -14.5h299zM714 470q0 21 -14.5 36t-35.5 15h-299q-21 0 -35.5 -15
t-14.5 -36t14.5 -35t35.5 -14h299q21 0 35.5 14t14.5 35zM714 470z" />
<glyph glyph-name="uniE62E" unicode="&#xe62e;"
d="M154 770v-646h146l-14 -208l240 208h344v646h-716zM752 260h-134v159h-192v-159h-134v382h134v-148h192v148h134v-382z" />
<glyph glyph-name="uniE62F" unicode="&#xe62f;"
d="M866.5 747.5q-97.5 97.5 -228 132t-261.5 0t-228.5 -132t-132 -228.5t0 -261.5t132 -228t228.5 -132t261.5 0t228 132t132 228t0 261.5t-132 228.5zM798 199l-101 -101l-187 186l-186 -186l-101 101l186 186l-186 187l101 101l186 -186l187 186l101 -101l-186 -187z" />
<glyph glyph-name="uniE630" unicode="&#xe630;" horiz-adv-x="1025"
d="M1024 480v338q0 32 -23 55t-55 23h-331h-14q-55 0 -76 -21l-506 -506q-19 -19 -19 -46t19 -45l387 -387q18 -19 45 -19t46 19l506 506q10 10 15 25.5t5.5 26.5t0.5 31zM764 549q-36 0 -61.5 25.5t-25.5 61.5t25.5 61t61.5 25t61 -25t25 -61t-25 -61.5t-61 -25.5z" />
<glyph glyph-name="uniE631" unicode="&#xe631;"
d="M0 812v-1024h1024v1024h-1024zM983 -171h-942v942h942v-942zM288 280h448q9 0 15 6t6 14t-6 14t-15 6h-448q-9 0 -15 -6t-6 -14t6 -14t15 -6z" />
<glyph glyph-name="uniE632" unicode="&#xe632;"
d="M0 812v-1024h1024v1024h-1024zM983 -171h-942v942h942v-942zM288 280h204v-204q0 -9 6 -15t14 -6t14 6t6 15v204h204q9 0 15 6t6 14t-6 14t-15 6h-204v204q0 9 -6 15t-14 6t-14 -6t-6 -15v-204h-204q-9 0 -15 -6t-6 -14t6 -14t15 -6z" />
<glyph glyph-name="uniE633" unicode="&#xe633;"
d="M127 769v-770h770v770h-770zM555 170h-86v86h86v-86zM555 298h-86v257h86v-257z" />
<glyph glyph-name="uniE634" unicode="&#xe634;" horiz-adv-x="1025"
d="M491 6q9 -10 21.5 -10t21.5 10l357 407q9 10 5.5 17.5t-17.5 7.5h-133q-14 0 -23.5 9.5t-9.5 22.5v261q0 13 -10 22.5t-24 9.5h-333q-14 0 -24 -9.5t-10 -22.5v-261q0 -13 -9.5 -22.5t-23.5 -9.5h-133q-14 0 -17.5 -7.5t5.5 -17.5z" />
<glyph glyph-name="uniE635" unicode="&#xe635;"
d="M958 758q0 30 -21 51.5t-51 21.5h-749q-30 0 -51 -21.5t-21 -51.5v-748q0 -30 21 -51t51 -21h749q30 0 51 21t21 51v748zM778 454l-267 -267q-14 -14 -34 -14t-34 14l-168 168q-14 14 -14 34t14 34.5t34 14.5t34 -15l134 -133l233 232q14 14 34 14t34 -14t14 -34t-14 -34
z" />
<glyph glyph-name="uniE636" unicode="&#xe636;" horiz-adv-x="1163"
d="M295 196q67 0 114 -47t47 -113.5t-47 -114t-114 -47.5t-114 47.5t-47 114t47 113.5t114 47zM917.5 196q66.5 0 113.5 -47t47 -113.5t-47 -114t-113.5 -47.5t-114 47.5t-47.5 114t47.5 113.5t114 47zM400 894v-99h-210v0l-187 -294v-372h95q27 56 80 90.5t117 34.5
t117 -34.5t80 -90.5h228q27 56 80 90.5t117.5 34.5t117.5 -34.5t79 -90.5h46v765h-760zM400 452h-283l159 250l124 1v-251v0zM893 701l-131 -276l-63 31l101 206h-105v68h198v-29v0z" />
<glyph glyph-name="uniE637" unicode="&#xe637;"
d="M1020 810q0 34 -24 58t-59 24h-851q-34 0 -58.5 -24t-24.5 -58v-852q0 -34 24.5 -58t58.5 -24h851q35 0 59 24t24 58v852zM815 464l-304 -304q-16 -16 -38.5 -16t-38.5 16l-191 191q-17 16 -17 39t16.5 39t39 16t38.5 -16l153 -152l264 264q16 16 39 16t39 -16t16 -38.5
t-16 -38.5z" />
</font>
</defs></svg>
... ...
No preview for this file type
No preview for this file type
... ... @@ -417,7 +417,7 @@
.search-btn {
background: resolve('layout/search.png') no-repeat center center;
width: 80px;
width: 78px;
height: 28px;
float: right;
border: none;
... ...