Authored by 沈志敏

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

@@ -39,7 +39,7 @@ module.exports = { @@ -39,7 +39,7 @@ module.exports = {
39 sort: req.query.sort, 39 sort: req.query.sort,
40 page: req.query.page, 40 page: req.query.page,
41 channel: req.query.channel || 'men', 41 channel: req.query.channel || 'men',
42 - gender: '1,2,3', // 店铺 不分 性别 42 + gender: req.query.gender || '',
43 brand: req.query.brand, 43 brand: req.query.brand,
44 shopId: req.query.id, 44 shopId: req.query.id,
45 order: req.query.order || 's_t_desc', 45 order: req.query.order || 's_t_desc',
@@ -8,6 +8,11 @@ const channelDict = require(utilsPath).channelDict; @@ -8,6 +8,11 @@ const channelDict = require(utilsPath).channelDict;
8 // 如果 没有 gender, 根据channel,设置gender 8 // 如果 没有 gender, 根据channel,设置gender
9 // Notice: 如果 没有 channel,则不设 gender 9 // Notice: 如果 没有 channel,则不设 gender
10 exports.channelGender = (req, res, next) => { 10 exports.channelGender = (req, res, next) => {
  11 + if (/^\/product\/shop\//.test(req.path)) { // 店铺 不分 男女
  12 + next();
  13 + return;
  14 + }
  15 +
11 if (!req.query.hasOwnProperty('gender')) { 16 if (!req.query.hasOwnProperty('gender')) {
12 const channel = channelDict(req.yoho.channel); 17 const channel = channelDict(req.yoho.channel);
13 18
@@ -13,14 +13,16 @@ const ftp = require('gulp-ftp'); @@ -13,14 +13,16 @@ const ftp = require('gulp-ftp');
13 const postcss = require('gulp-postcss'); 13 const postcss = require('gulp-postcss');
14 const sourcemaps = require('gulp-sourcemaps'); 14 const sourcemaps = require('gulp-sourcemaps');
15 const cssnano = require('gulp-cssnano'); 15 const cssnano = require('gulp-cssnano');
  16 +const scss = require('postcss-scss');
16 17
17 const webpack = require('webpack'); 18 const webpack = require('webpack');
18 const WebpackDevServer = require('webpack-dev-server'); 19 const WebpackDevServer = require('webpack-dev-server');
19 -const webpackConfig = require('./webpack.config.js');  
20 const ExtractTextPlugin = require('extract-text-webpack-plugin'); 20 const ExtractTextPlugin = require('extract-text-webpack-plugin');
21 const Dashboard = require('webpack-dashboard'); 21 const Dashboard = require('webpack-dashboard');
22 const DashboardPlugin = require('webpack-dashboard/plugin'); 22 const DashboardPlugin = require('webpack-dashboard/plugin');
23 23
  24 +const webpackConfig = require('./webpack.config.js');
  25 +
24 const env = { 26 const env = {
25 dev: Symbol('development'), 27 dev: Symbol('development'),
26 pro: Symbol('production') 28 pro: Symbol('production')
@@ -48,7 +50,7 @@ const dist = { @@ -48,7 +50,7 @@ const dist = {
48 const postcssPlugin = (et) => { 50 const postcssPlugin = (et) => {
49 let sprites = { 51 let sprites = {
50 spritesmith: { 52 spritesmith: {
51 - padding: 2 53 + padding: 8
52 }, 54 },
53 filterBy(file) { 55 filterBy(file) {
54 // base64 的图片没有 url 过滤掉 56 // base64 的图片没有 url 过滤掉
@@ -60,7 +62,7 @@ const postcssPlugin = (et) => { @@ -60,7 +62,7 @@ const postcssPlugin = (et) => {
60 groupBy(file) { 62 groupBy(file) {
61 let group = file.url.split('/')[1]; 63 let group = file.url.split('/')[1];
62 64
63 - group = group === '' ? 'yo' : group; 65 + group = group === '' ? 'yoho' : group;
64 66
65 file.retina = true; 67 file.retina = true;
66 68
@@ -193,7 +195,7 @@ gulp.task('webpack-dev-server', () => { @@ -193,7 +195,7 @@ gulp.task('webpack-dev-server', () => {
193 postcss: { 195 postcss: {
194 plugins: postcssPlugin(env.dev), 196 plugins: postcssPlugin(env.dev),
195 options: { 197 options: {
196 - parser: require('postcss-scss') 198 + parser: scss
197 } 199 }
198 }, 200 },
199 autoprefixer: false, 201 autoprefixer: false,
@@ -243,7 +245,7 @@ gulp.task('webpack', ['assets'], (done) => { @@ -243,7 +245,7 @@ gulp.task('webpack', ['assets'], (done) => {
243 postcss: { 245 postcss: {
244 plugins: postcssPlugin(env.pro), 246 plugins: postcssPlugin(env.pro),
245 options: { 247 options: {
246 - parser: require('postcss-scss') 248 + parser: scss
247 } 249 }
248 }, 250 },
249 autoprefixer: false, 251 autoprefixer: false,
@@ -255,13 +257,12 @@ gulp.task('webpack', ['assets'], (done) => { @@ -255,13 +257,12 @@ gulp.task('webpack', ['assets'], (done) => {
255 257
256 proConfig.output.path = dist.js; 258 proConfig.output.path = dist.js;
257 259
258 - // TODO: 生产环境加载的插件独立出来 260 + // 生产环境插件
259 proConfig.plugins.push(new webpack.DefinePlugin({ 261 proConfig.plugins.push(new webpack.DefinePlugin({
260 'process.env': { 262 'process.env': {
261 NODE_ENV: '"production"' 263 NODE_ENV: '"production"'
262 } 264 }
263 - }));  
264 - proConfig.plugins.push(new webpack.optimize.UglifyJsPlugin({ 265 + }), new webpack.optimize.UglifyJsPlugin({
265 compress: { 266 compress: {
266 warnings: false 267 warnings: false
267 } 268 }
@@ -54,7 +54,13 @@ module.exports = (list, options) => { @@ -54,7 +54,13 @@ module.exports = (list, options) => {
54 }, options); 54 }, options);
55 list = camelCase(list); 55 list = camelCase(list);
56 56
57 - let genderVal = options.gender.split(',')[0]; 57 + let genderVal = options.gender.split(',');
  58 +
  59 + if (genderVal.indexOf(genderMap.men) && genderVal.indexOf(genderMap.women)) { // 男女 通吃
  60 + genderVal = '';
  61 + } else {
  62 + genderVal = genderVal[0];
  63 + }
58 64
59 _.forEach(list, (product) => { 65 _.forEach(list, (product) => {
60 // 商品信息有问题,则不显示 66 // 商品信息有问题,则不显示