Authored by 沈志敏

Merge branch 'develop' of git.yoho.cn:fe/yohoblk-wap into develop

... ... @@ -39,7 +39,7 @@ module.exports = {
sort: req.query.sort,
page: req.query.page,
channel: req.query.channel || 'men',
gender: '1,2,3', // 店铺 不分 性别
gender: req.query.gender || '',
brand: req.query.brand,
shopId: req.query.id,
order: req.query.order || 's_t_desc',
... ...
... ... @@ -8,6 +8,11 @@ const channelDict = require(utilsPath).channelDict;
// 如果 没有 gender, 根据channel,设置gender
// Notice: 如果 没有 channel,则不设 gender
exports.channelGender = (req, res, next) => {
if (/^\/product\/shop\//.test(req.path)) { // 店铺 不分 男女
next();
return;
}
if (!req.query.hasOwnProperty('gender')) {
const channel = channelDict(req.yoho.channel);
... ...
... ... @@ -13,14 +13,16 @@ const ftp = require('gulp-ftp');
const postcss = require('gulp-postcss');
const sourcemaps = require('gulp-sourcemaps');
const cssnano = require('gulp-cssnano');
const scss = require('postcss-scss');
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const webpackConfig = require('./webpack.config.js');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const Dashboard = require('webpack-dashboard');
const DashboardPlugin = require('webpack-dashboard/plugin');
const webpackConfig = require('./webpack.config.js');
const env = {
dev: Symbol('development'),
pro: Symbol('production')
... ... @@ -48,7 +50,7 @@ const dist = {
const postcssPlugin = (et) => {
let sprites = {
spritesmith: {
padding: 2
padding: 8
},
filterBy(file) {
// base64 的图片没有 url 过滤掉
... ... @@ -60,7 +62,7 @@ const postcssPlugin = (et) => {
groupBy(file) {
let group = file.url.split('/')[1];
group = group === '' ? 'yo' : group;
group = group === '' ? 'yoho' : group;
file.retina = true;
... ... @@ -193,7 +195,7 @@ gulp.task('webpack-dev-server', () => {
postcss: {
plugins: postcssPlugin(env.dev),
options: {
parser: require('postcss-scss')
parser: scss
}
},
autoprefixer: false,
... ... @@ -243,7 +245,7 @@ gulp.task('webpack', ['assets'], (done) => {
postcss: {
plugins: postcssPlugin(env.pro),
options: {
parser: require('postcss-scss')
parser: scss
}
},
autoprefixer: false,
... ... @@ -255,13 +257,12 @@ gulp.task('webpack', ['assets'], (done) => {
proConfig.output.path = dist.js;
// TODO: 生产环境加载的插件独立出来
// 生产环境插件
proConfig.plugins.push(new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}));
proConfig.plugins.push(new webpack.optimize.UglifyJsPlugin({
}), new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
... ...
... ... @@ -54,7 +54,13 @@ module.exports = (list, options) => {
}, options);
list = camelCase(list);
let genderVal = options.gender.split(',')[0];
let genderVal = options.gender.split(',');
if (genderVal.indexOf(genderMap.men) && genderVal.indexOf(genderMap.women)) { // 男女 通吃
genderVal = '';
} else {
genderVal = genderVal[0];
}
_.forEach(list, (product) => {
// 商品信息有问题,则不显示
... ...