Authored by 沈志敏

css文件拆分

... ... @@ -164,7 +164,8 @@ exports.comments = (req, res, next) => {
res.render('detail/comments', Object.assign({
title: '购买评价',
pageHeader: headerData,
pageFooter: true
pageFooter: true,
localCss: true
}, result));
}).catch(next);
};
... ... @@ -188,7 +189,8 @@ exports.consults = (req, res, next) => {
res.render('detail/consults', Object.assign({
title: '购买咨询',
pageHeader: headerData,
pageFooter: true
pageFooter: true,
localCss: true
}, result));
}).catch(next);
};
... ... @@ -237,7 +239,8 @@ exports.consultform = (req, res, next) => {
pageHeader: headerData,
productId: req.query.product_id,
formUrl: '/product/detail/consultsubmit',
pageFooter: true
pageFooter: true,
localCss: true
});
};
... ... @@ -336,7 +339,8 @@ exports.index = (req, res, next) => {
result: result,
page: 'detail',
title: result.goodsName,
pageFooter: true
pageFooter: true,
localCss: true
});
}).catch(next);
};
... ...
... ... @@ -37,15 +37,16 @@ const newDetail = {
result: result,
page: 'new-detail',
title: result.goodsName,
pageFooter: true
pageFooter: true,
localCss: true
});
}).catch(next);
},
/*
* 商品基本信息 SKN 进入 pagecache重构
*/
* 商品基本信息 SKN 进入 pagecache重构
*/
sknData(req, res, next) {
let brandId = req.query.brandId;
let productId = req.query.productId;
... ... @@ -56,7 +57,9 @@ const newDetail = {
}
newDetailModel.querySknData({
skn, brandId, productId
skn,
brandId,
productId
}).then(result => {
if (_.isEmpty(result)) {
return next();
... ...
... ... @@ -41,8 +41,12 @@
<link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/index.css">
{{/if}}
{{#if localCss}}
<link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/{{module}}.{{page}}.css">
{{/if}}
{{#if vue}}
<link rel="stylesheet" href="//{{devHost}}:5001/{{module}}.{{page}}.css">
<link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/{{module}}.{{page}}.css">
{{/if}}
{{^}}
{{#if shopPage}}
... ... @@ -51,8 +55,12 @@
<link rel="stylesheet" media="all" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/index.css">
{{/if}}
{{#if localCss}}
<link rel="stylesheet" media="all" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/{{module}}.{{page}}.css">
{{/if}}
{{#if vue}}
<link rel="stylesheet" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/{{module}}.{{page}}.css">
<link rel="stylesheet" media="all" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/{{module}}.{{page}}.css">
{{/if}}
{{/if}}
<link rel="apple-touch-icon-precomposed" href="http://static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png">
... ...
... ... @@ -71,6 +71,7 @@
"postcss-center": "^1.0.0",
"postcss-clearfix": "^1.0.0",
"postcss-crip": "^2.0.1",
"postcss-loader": "^1.1.1",
"postcss-position": "^0.5.0",
"postcss-pxtorem": "^3.3.1",
"postcss-scss": "^0.3.1",
... ...
... ... @@ -204,12 +204,19 @@ gulp.task('webpack-dev-server', () => {
loaders: {
css: ExtractTextPlugin.extract(['css?-url&sourceMap'])
}
},
postcss: {
plugins: postcssPlugin(env.dev),
options: {
parser: scss
}
}
});
devConfig.output.publicPath = 'http://localhost:5001/';
// 开发环境插件
devConfig.plugins[0] = new ExtractTextPlugin('bundle/[name].css');
devConfig.plugins.push(new webpack.HotModuleReplacementPlugin());
devConfig.entry.libs.unshift(`webpack-dev-server/client?${devConfig.output.publicPath}`, 'webpack/hot/dev-server');
... ... @@ -248,6 +255,16 @@ gulp.task('webpack', ['assets'], (done) => {
loaders: {
css: ExtractTextPlugin.extract(['css?-url'])
}
},
postcss: {
plugins: postcssPlugin(env.pro),
options: {
parser: scss
},
autoprefixer: false,
loaders: {
css: ExtractTextPlugin.extract(['css?-url'])
}
}
});
... ...
... ... @@ -3,6 +3,7 @@
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/10/20
*/
require('../../scss/product/detail/_index.css');
var $ = require('yoho-jquery'),
Swiper = require('yoho-swiper'),
Hammer = require('yoho-hammer'),
... ... @@ -152,6 +153,3 @@ require('./detail/page-render')(function() {
}
});
require('./detail/brand-coupon');
... ...
require('../../scss/product/detail/_index.css');
var $ = require('yoho-jquery');
var productId = $('#productId').val();
var goodsId = $('#goodsId').val();
... ...
@import "sale/index";
@import "detail/index";
@import "outlet/index";
@import "seckill/index";
@import "search/index";
... ...
... ... @@ -498,13 +498,13 @@ $basicBtnC: #eb0313;
text-align: left;
.vip-img {
background: url("../img/product/silver.png") no-repeat;
background: url("/product/silver.png") no-repeat;
}
}
&:nth-child(2) {
.vip-img {
background: url("../img/product/golden.png") no-repeat;
background: url("/product/golden.png") no-repeat;
}
}
... ... @@ -512,7 +512,7 @@ $basicBtnC: #eb0313;
text-align: right;
.vip-img {
background: url("../img/product/platinum.png") no-repeat;
background: url("/product/platinum.png") no-repeat;
}
}
}
... ...
... ... @@ -43,7 +43,7 @@ module.exports = {
loader: 'babel?presets[]=es2015&plugins[]=transform-runtime&comments=false'
}, {
test: /\.css$/,
loader: ExtractTextPlugin.extract(['css?-url'])
loader: ExtractTextPlugin.extract(['css?-url!postcss'])
}, {
test: /\.hbs$/,
loader: 'handlebars-loader',
... ... @@ -76,4 +76,3 @@ module.exports = {
})
]
};
... ...