Authored by 陈峰

优化

... ... @@ -52,7 +52,10 @@ let _channelPage = (req, res, data) => {
// }
// }].concat(result.content);
// console.log(result.content[9]);
res.render('channel', Object.assign({}, _renderData, data, result));
console.log(result)
res.render('channel', Object.assign({}, _renderData, data, result, {
localCss: true
}));
});
};
... ...
... ... @@ -69,7 +69,8 @@ const editor = (req, res, next) => {
infos: build,
isApp: isApp,
authorInfo: authorData.data
}
},
localCss: true
}, parameter));
} else {
return next();
... ... @@ -172,7 +173,9 @@ const index = (req, res, next) => {
res.set('Cache-Control', 'no-cache');
}
}
res.render('guang', Object.assign(responseData, result));
res.render('guang', Object.assign(responseData, result, {
localCss: true
}));
}).catch(next);
};
... ...
... ... @@ -357,7 +357,8 @@ const index = (req, res, next) => {
page: 'info-index',
title: '逛',
gender: gender,
wechatShare: true
wechatShare: true,
localCss: true
}, data, parameter));
});
} else {
... ...
<div class="banner-top">
<div class="banner-swiper swiper-container">
<ul class="swiper-wrapper">
<div class="banner-alloy alloy-container">
<div class="alloy-wrapper" style="width: {{widthFull}}">
{{#each data}}
{{#if @first}}
<li class="swiper-slide">
<a href="{{url}}">
<img src="{{image src 640 240}}">
</a>
</li>
<img src="{{image src 640 240}}" style="width: {{../width}}">
{{^}}
<li class="swiper-slide">
<a href="{{url}}">
<img class="swiper-lazy" data-src="{{image src 640 240}}">
</a>
<img class="swiper-lazy" data-src="{{image src 640 240}}" style="width: {{../width}}">
<div class="swiper-lazy-preloader"></div>
</li>
{{/if}}
{{/each}}
</ul>
</div>
</div>
<div class="swiper-pagination">
<div class="alloy-pagination">
<div class="pagination-inner">
</div>
</div>
... ...
... ... @@ -18,6 +18,7 @@
},
"license": "MIT",
"dependencies": {
"alloytouch": "^0.1.0",
"bluebird": "^3.4.6",
"body-parser": "^1.15.2",
"captchapng": "0.0.1",
... ...
... ... @@ -3,8 +3,59 @@
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/10/12
*/
//加载css
require("layout/_loading.css")
require("layout/_utils.css")
require("common/_filter.css")
require("common/_good.css")
require("common/_loading.css")
require("common/_suspend-home.css")
require("channel/_banner-bottom.css")
require("channel/_banner-center.css")
require("channel/_banner-top.css")
require("channel/_brand.css")
require("channel/_cate.css")
require("channel/_creative-life.css")
require("channel/_divide-image.css")
require("channel/_fine-brands.css")
require("channel/_floor-header.css")
require("channel/_footer-tab.css")
require("channel/_fresh-only.css")
require("channel/_goods-category.css")
require("channel/_home-header.css")
require("channel/_home.css")
require("channel/_hot-brands.css")
require("channel/_hot-category.css")
require("channel/_hot-single.css")
require("channel/_icons-enter.css")
require("channel/_index.css")
require("channel/_left-right.css")
require("channel/_maybe-like.css")
require("channel/_new-first.css")
require("channel/_new-user-floor.css")
require("channel/_notice.css")
require("channel/_plus-star.css")
require("channel/_sale-floor.css")
require("channel/_search-input.css")
require("channel/_search.css")
require("channel/_seckill.css")
require("channel/_shop-recommand.css")
require("channel/_side-nav.css")
require("channel/_six-lines-floor.css")
require("channel/_three-picture.css")
require("channel/_thumb-row.css")
require("channel/_trend-topics.css")
require("channel/_trend-tops.css")
require("channel/_trendsetter-collocation.css")
require("channel/_two-column-goods.css")
require("channel/_vip-only.css")
var $ = require('yoho-jquery'),
Swiper = require('yoho-swiper'),
alloytouch = require('alloytouch'),
lazyLoad = require('yoho-jquery-lazyload'),
fastclick = require('yoho-fastclick'),
noticeScroll = require('../plugin/notice-scroll'),
... ... @@ -101,17 +152,57 @@ highlight($subNav);
// 头部banner轮播
if ($('.banner-swiper').find('li').size() > 1) {
new Swiper('.banner-swiper', {
lazyLoading: true,
lazyLoadingInPrevNext: true,
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
paginationClickable: true,
slideElement: 'li',
pagination: '.banner-top .pagination-inner'
});
if ($('.banner-alloy').find('img').size() > 1) {
new alloytouch({
touch:".banner-alloy",//反馈触摸的dom
vertical: false,//不必需,默认是true代表监听竖直方向touch
target: $('.alloy-wrapper')[0], //运动的对象
property: "translateY", //被运动的属性
change:function(){ }, //不必需,属性改变的回调。alloytouch.css版本不支持该事件
touchStart:function(value){ },
touchMove:function(value){ },
touchEnd:function(evt, v, index){
var step_v = index * this.step * -1;
var dx = v - step_v;
console.log(v)
if (Math.abs(dx) < 30) {
this.go(step_v);
}
else if (dx > 0) {
this.go(step_v + this.step);
} else {
this.go(step_v - this.step);
}
return false;
},
animationEnd:function(v, page){
var i = 0,
len = items.length;
for (; i < len; i++) {
if (i === page) {
items[i].classList.add("active");
} else {
items[i].classList.remove("active");
}
}
} //运动结束
})
// new Swiper('.banner-swiper', {
// lazyLoading: true,
// lazyLoadingInPrevNext: true,
// loop: true,
// autoplay: 3000,
// autoplayDisableOnInteraction: false,
// paginationClickable: true,
// slideElement: 'li',
// pagination: '.banner-top .pagination-inner'
// });
}
// 店铺推荐人数和收藏初始查询
... ...
... ... @@ -3,6 +3,17 @@
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/10
*/
require("layout/_loading.css")
require("layout/_swiper.css")
require("layout/_utils.css")
require("common/_loading.css")
require("common/_suspend-home.css")
require("guang/_info-list.css")
require("guang/_info.css")
require("guang/_tvls.css")
var $ = require('yoho-jquery');
... ...
... ... @@ -3,6 +3,21 @@
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/10
*/
require("layout/_loading.css")
require("layout/_swiper.css")
require("layout/_utils.css")
require("common/_good.css")
require("common/_loading.css")
require("common/_suspend-home.css")
require("channel/_footer-tab.css")
require("guang/_info-list.css")
require("guang/_info.css")
require("guang/_tvls.css")
var $ = require('yoho-jquery');
... ...
... ... @@ -3,6 +3,16 @@
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/13
*/
require("layout/_common.css")
require("layout/_utils.css")
require("common/_filter.css")
require("common/_good.css")
require("common/_loading.css")
require("common/_suspend-home.css")
require("guang/_detail.css")
require("guang/_tvls.css")
var $ = require('yoho-jquery'),
ellipsis = require('yoho-mlellipsis'),
... ...
... ... @@ -55,3 +55,16 @@
}
}
}
.banner-alloy {
width: 100%;
overflow: hidden;
position: relative;
max-height: 312px;
.alloy-wrapper {
position: relative;
max-height: 312px;
img {
display: initial;
}
}
}
... ...
... ... @@ -90,7 +90,10 @@ module.exports = (list) => {
if (floor.sale1T1L4R && floor.data && floor.data.big_image) {
floor.data.banner_image = floor.data.big_image;
}
if (floor.focus && floor.data && floor.data.length) {
floor.widthFull = `${100 * floor.data.length}%`;
floor.width = `${100 / floor.data.length}%`;
}
formatData.push(floor);
});
... ...