Authored by 姜枫

optim detail page

... ... @@ -8,7 +8,7 @@
</li>
{{/ navs}}
</ul>
<div id="info-list" class="info-list-container">
{{# infos}}
<div class="info-list{{^show}} hide{{/show}}">
... ... @@ -19,7 +19,11 @@
{{# ../swiper}}
<div class="swiper-slide">
<a href="{{url}}">
{{#if @first}}
<img src="{{img}}">
{{^}}
<img class="swiper-lazy" data-src="{{img}}">
{{/if}}
</a>
<div class="swiper-lazy-preloader"></div>
</div>
... ... @@ -45,4 +49,4 @@
<input id="gender" type="hidden" value={{gender}}>
{{/ guang}}
</div>
{{> footer-tab}}
\ No newline at end of file
{{> footer-tab}}
... ...
... ... @@ -36,7 +36,11 @@
</a>
{{/if}}
<a href="{{url}}">
<img class="lazy" data-original="{{img}}" alt="{{alt}}">
{{#if ../@first}}
<img src="{{img}}" alt="{{alt}}">
{{^}}
<img class="lazy" data-original="{{img}}" alt="{{alt}}">
{{/if}}
</a>
</div>
... ... @@ -47,4 +51,4 @@
<p class="info-text">{{text}}</p>
{{> tvls}}
</div>
</div>
\ No newline at end of file
</div>
... ...
... ... @@ -234,7 +234,8 @@ const category = (req, res, next) => {
firstPageGoodsList: firstScreenGoodsList.list,
showDownloadApp: true,
pageFooter: true,
category: true
category: true,
localCss: true
});
}).catch(next);
};
... ...
... ... @@ -101,6 +101,8 @@ const tool = {
let bannerList = [];
_.forEach(goodsGroup, function(value) {
value.img = _.replace(value.img, '/quality/80', '/quality/70');
bannerList.push({
img: value.img
});
... ...
... ... @@ -18,6 +18,7 @@ const cachePage = {
// 商品详情页
'/product/\\/pro_([\\d]+)_([\\d]+)\\/(.*)/': 30 * MINUTE,
'/product/\\/show_([\\d]+)/': 30 * MINUTE,
// 商品详情ajax
// 逛
'/guang/': 1 * MINUTE,
... ...
... ... @@ -26,6 +26,15 @@ module.exports = {
// liveApi: 'http://testapi.live.yohops.com:9999/',
// singleApi: 'http://api-test3.yohops.com:9999/'
// favApi: 'http://192.168.102.31:8092/brower',
// api: 'http://192.168.102.205:8080/gateway/',
// service: 'http://192.168.102.205:8080/gateway/',
// search: 'http://192.168.102.216:8080/yohosearch/'
// api: 'http://api.yoho.yohoops.org/',
// service: 'http://service.yoho.yohoops.org/',
// liveApi: 'http://api.live.yoho.cn/',
// singleApi: 'http://single.yoho.cn/'
// api: 'http://dev-api.yohops.com:9999/',
// service: 'http://dev-service.yohops.com:9999/',
... ...
... ... @@ -30,14 +30,17 @@
</script>
{{/if}}
{{#if devEnv}}
{{#if localCss}}
<link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/common.css">
<link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/{{module}}.{{page}}.css">
{{^}}
{{#if shopPage}}
<link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/shop.css">
{{^}}
{{^}}
<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}}
... ... @@ -51,6 +54,7 @@
{{/if}}
{{#if localCss}}
<link rel="stylesheet" media="all" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/common.css">
<link rel="stylesheet" media="all" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/{{module}}.{{page}}.css">
{{/if}}
... ... @@ -85,15 +89,7 @@
{{#wechatShare}}
<script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
{{/wechatShare}}
{{#if devEnv}}
<script>var STATIC_RESOURCE_PATH = '//{{devHost}}:5001';</script>
<script src="//{{devHost}}:5001/libs.js"></script>
<script src="//{{devHost}}:5001/{{module}}.{{page}}.js"></script>
{{^}}
<script>var STATIC_RESOURCE_PATH = '//cdn.yoho.cn/m-yohobuy-node/assets';</script>
<script src="//cdn.yoho.cn/m-yohobuy-node/{{version}}/libs.js"></script>
<script src="//cdn.yoho.cn/m-yohobuy-node/{{version}}/{{module}}.{{page}}.js"></script>
{{/if}}
{{#unless devEnv}}
{{> analysis}}
{{/unless}}
... ...
... ... @@ -148,7 +148,7 @@ gulp.task('dist', ['ge'], () => {
// postcss compile in dev
gulp.task('postcss-dev', () => {
return gulp.src(['scss/shop.css', 'scss/index.css'])
return gulp.src(['scss/shop.css', 'scss/index.css', 'scss/common.css'])
.pipe(sourcemaps.init())
.pipe(postcss(postcssPlugin(env.dev), {
parser: require('postcss-scss')
... ... @@ -219,7 +219,7 @@ gulp.task('webpack-dev-server', () => {
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');
// devConfig.entry.libs.unshift(`webpack-dev-server/client?${devConfig.output.publicPath}`, 'webpack/hot/dev-server');
new WebpackDevServer(webpack(devConfig), {
contentBase: '.',
... ...
require('../../scss/product/detail/_index.css');
$(function(){
require('../../scss/product/detail/_index.css');
var $ = require('yoho-jquery');
var productId = $('#productId').val();
var goodsId = $('#goodsId').val();
... ... @@ -31,7 +32,7 @@ setTimeout(() => {
// 喂你优选
require('./detail/recommend-for-you-product-desc');
}, 100);
}, 800);
// 动态加载数据
... ... @@ -277,3 +278,5 @@ setTimeout(() => {
});
}, 200);
}(productSkn, productId, brandId));
})();
... ...
... ... @@ -4,6 +4,8 @@
* @date: 2016/7/21
*/
require('../../scss/product/search/list.page.css');
require('./search/list');
require('../common/footer');
require('./shop/coupon');
... ...
/**
* 精简的共用css
*/
@import "layout/reset";
@import "layout/common";
@import "layout/header";
@import "layout/footer";
@import "common/data-bind";
... ...
... ... @@ -3,3 +3,8 @@
@import "product-description";
@import "recommend-for-you";
@import "brand-coupon";
@import "../../layout/swiper";
@import "../../channel/banner-top";
@import "../../common/good";
@import "../../cart/chose-panel";
... ...
@import "../../channel/banner-top";
@import "../../common/good";
@import "search";
@import "list";
@import "search-index";
... ...