Authored by 李靖

联调

... ... @@ -5,12 +5,11 @@ const mRoot = '../models';
const newGuangModel = require(`${mRoot}/guang-new`);
const headerModel = require('../../../doraemon/models/header'); // 头部model
const typeLib = require('../../../config/type-lib');
const channels = {
boys: 1,
girl: 2,
kids: 3,
lifestyle: 4
boys: '1,3',
girls: '2,3',
kids: '1,2,3',
lifestyle: '1,2,3'
};
exports.index = (req, res, next) => {
... ... @@ -26,10 +25,7 @@ exports.index = (req, res, next) => {
};
let params = {
gender: req.query.gender ||
req.query.channel && typeLib.channels[req.query.channel] ||
req.cookies._Channel && channels[req.cookies._Channel] ||
'1,3',
gender: channels[req.cookies._Channel] || '1,3'
};
req.ctx(newGuangModel).index(params).then(result => {
... ...
... ... @@ -27,7 +27,8 @@ class newGuang extends global.yoho.BaseModel {
this._indexRes(params)
]).then((result) => {
let resu = {
floorRes: {}
floorRes: {},
gender: encodeURIComponent(params.gender)
};
if (_.get(result, '[0].data')) {
... ... @@ -41,12 +42,15 @@ class newGuang extends global.yoho.BaseModel {
if (val.template_name === 'GuangRqFloor') {
resu.floorRes.renQi = _.get(val, 'data.list');
}
if (val.template_name === 'GuangRqFloor') {
if (val.template_name === 'GuangDpFloor') {
resu.floorRes.daPei = _.get(val, 'data.list');
}
if (val.template_name === 'GuangRqFloor') {
if (val.template_name === 'GuangHhFloor') {
resu.floorRes.haoHuo = _.get(val, 'data.list');
}
if (val.template_name === 'GuangShowOrderFloor') {
resu.floorRes.show = _.get(val, 'data.list');
}
});
}
... ...
... ... @@ -6,7 +6,7 @@
{{# floorRes.focus}}
<div class="swiper-slide">
<a href="{{url}}">
<img src="{{image2 src w=750 h=322 q=60}}" alt="{{title}}" />
<img src="{{image2 src w=750 h=322 q=30}}" alt="{{title}}" />
</a>
</div>
{{/ floorRes.focus}}
... ... @@ -24,7 +24,7 @@
{{#floorRes.type}}
<div class="swiper-slide">
<a href="{{url}}">
<div class="tab-item" style="background-image: url({{image2 src w=100 h=320 q=60}})">
<div class="tab-item" style="background-image: url({{image2 src w=100 h=320 q=30}})">
<div class="cover"></div>
<div class="title">{{alt}}</div>
</div>
... ... @@ -38,7 +38,7 @@
{{#if floorRes.renQi}}
<div class="big-title">
人气
<a class="iconfont" href="//guang.m.yohobuy.com/?type=1001">MORE&nbsp;&#xe604;</a>
<a class="iconfont" href="//guang.m.yohobuy.com/?gender={{gender}}&type=1001">MORE&nbsp;&#xe604;</a>
</div>
<div class="swiper-page">
<div class="swiper-container">
... ... @@ -47,7 +47,7 @@
<div class="swiper-slide">
<a href="//guang.m.yohobuy.com/info/index?id={{id}}">
<div class="page-c">
<img src="{{image2 src w=690 h=430 q=60}}" />
<img src="{{image2 src w=690 h=430 q=30}}" />
<div class="info">
<p class="name eps">{{title}}</p>
<p class="type eps">{{intro}}</p>
... ... @@ -63,7 +63,7 @@
{{#if floorRes.daPei}}
<div class="big-title">
搭配
<a class="iconfont" href="//guang.m.yohobuy.com/?type=2">MORE&nbsp;&#xe604;</a>
<a class="iconfont" href="//guang.m.yohobuy.com/?gender={{gender}}&type=2">MORE&nbsp;&#xe604;</a>
</div>
<div class="swiper-collocation">
<div class="swiper-container">
... ... @@ -71,7 +71,7 @@
{{# floorRes.daPei}}
<div class="swiper-slide">
<a href="//guang.m.yohobuy.com/info/index?id={{id}}">
<img src="{{image2 src w=590 h=370 q=60}}" />
<img src="{{image2 src w=590 h=370 q=30}}" />
<p class="eps-2">{{title}}</p>
</a>
</div>
... ... @@ -80,11 +80,11 @@
</div>
</div>
{{/if}}
<div class="big-title">
<div class="big-title hide">
限定
<span class="iconfont">MORE&nbsp;&#xe604;</span>
</div>
<div class="swiper-limit">
<div class="swiper-limit hide">
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide">
... ... @@ -97,46 +97,6 @@
<div class="name">¥7999.00</div>
</div>
</div>
<div class="swiper-slide">
<img src="http://img10.static.yhbimg.com/article/2017/10/23/16/01b08f8dee3abc9025cd677e46d875a6b9.jpg" />
<div class="info">
<div class="name eps-2">Nike’s Air Force 1 Is Headed</div>
<div class="title">发布日期</div>
<div class="name">2017/6/15</div>
<div class="title">发售价格</div>
<div class="name">¥7999.00</div>
</div>
</div>
<div class="swiper-slide">
<img src="http://img10.static.yhbimg.com/article/2017/10/23/16/01b08f8dee3abc9025cd677e46d875a6b9.jpg" />
<div class="info">
<div class="name eps-2">Nike’s Air Force 1 Is Headed</div>
<div class="title">发布日期</div>
<div class="name">2017/6/15</div>
<div class="title">发售价格</div>
<div class="name">¥7999.00</div>
</div>
</div>
<div class="swiper-slide">
<img src="http://img10.static.yhbimg.com/article/2017/10/23/16/01b08f8dee3abc9025cd677e46d875a6b9.jpg" />
<div class="info">
<div class="name eps-2">Nike’s Air Force 1 Is Headed</div>
<div class="title">发布日期</div>
<div class="name">2017/6/15</div>
<div class="title">发售价格</div>
<div class="name">¥7999.00</div>
</div>
</div>
<div class="swiper-slide">
<img src="http://img10.static.yhbimg.com/article/2017/10/23/16/01b08f8dee3abc9025cd677e46d875a6b9.jpg" />
<div class="info">
<div class="name eps-2">Nike’s Air Force 1 Is Headed</div>
<div class="title">发布日期</div>
<div class="name">2017/6/15</div>
<div class="title">发售价格</div>
<div class="name">¥7999.00</div>
</div>
</div>
</div>
<div class="swiper-pagination"></div>
</div>
... ... @@ -144,36 +104,33 @@
{{#if floorRes.haoHuo}}
<div class="big-title">
好货
<span class="iconfont">MORE&nbsp;&#xe604;</span>
<a class="iconfont" href="//guang.m.yohobuy.com/?gender={{gender}}&type=4">MORE&nbsp;&#xe604;</a>
</div>
<div class="goods-list clearfix">
{{# floorRes.haoHuo}}
<div class="goods-item">
<a href="//guang.m.yohobuy.com/info/index?id={{id}}">
<img src="{{image2 src w=360 h=224 q=60}}" />
<img src="{{image2 src w=360 h=224 q=30}}" />
<div class="info">
<p class="name eps-2 eps-3">{{title}}</p>
<p class="tips">#潮流行动#</p>
<p class="tips">#{{min_sort_name}}#</p>
</div>
</a>
</div>
{{/ floorRes.haoHuo}}
</div>
{{/if}}
<div class="big-title">
<div class="big-title hide">
人物
<span class="iconfont">MORE&nbsp;&#xe604;</span>
</div>
<div class="person-list clearfix">
<div class="person-item">
<img src="http://img10.static.yhbimg.com/yhb-img01/2017/10/27/12/01fee21a2b9808e42f02ad2217b59a1491.jpg" />
<p class="eps">马思唯:有趣的人会买东西</p>
</div>
<div class="person-list clearfix hide">
<div class="person-item">
<img src="http://img10.static.yhbimg.com/yhb-img01/2017/10/27/12/01fee21a2b9808e42f02ad2217b59a1491.jpg" />
<p class="eps">马思唯:有趣的人会买东西</p>
</div>
</div>
{{#if floorRes.show}}
<div class="big-title">
SHOW
<span class="iconfont">MORE&nbsp;&#xe604;</span>
... ... @@ -181,41 +138,22 @@
<div class="swiper-show">
<div class="swiper-container">
<div class="swiper-wrapper">
{{# floorRes.show}}
<div class="swiper-slide">
<img src="http://img12.static.yhbimg.com/article/2017/10/27/18/02fa575c14cb40d9599875b8e437564f91.jpg" />
<p class="words eps-2">感觉超赞的,穿着很FEEL准备再入手个其他色</p>
<div class="auther">
<span class="name">来自#吴亦凡#</span>
<span class="iconfont">&#xe601;</span>
</div>
</div>
<div class="swiper-slide">
<img src="http://img12.static.yhbimg.com/article/2017/10/27/18/02fa575c14cb40d9599875b8e437564f91.jpg" />
<p class="words eps-2">感觉超赞的</p>
<div class="auther">
<span class="name">来自#吴亦凡#</span>
<span class="iconfont">&#xe601;</span>
</div>
</div>
<div class="swiper-slide">
<img src="http://img12.static.yhbimg.com/article/2017/10/27/18/02fa575c14cb40d9599875b8e437564f91.jpg" />
<p class="words eps-2">感觉超赞的,穿着很FEEL准备再备再备再备再备再备再备再备再备再备再备再入</p>
<div class="auther">
<span class="name">来自#吴亦凡#</span>
<span class="iconfont">&#xe601;</span>
</div>
</div>
<div class="swiper-slide">
<img src="http://img12.static.yhbimg.com/article/2017/10/27/18/02fa575c14cb40d9599875b8e437564f91.jpg" />
<p class="words eps-2">感觉超赞的</p>
<div class="auther">
<span class="name">来自#吴亦凡#</span>
<span class="iconfont">&#xe601;</span>
</div>
<a href="//m.yohobuy.com/product/{{productSkn}}.html">
<img src="{{image2 url w=358 h=358 q=30}}" />
<p class="words eps-2">{{content}}</p>
<div class="auther">
<span class="name">来自#{{userName}}#</span>
<span class="iconfont hide">&#xe601;</span>
</div>
</a>
</div>
{{/ floorRes.show}}
</div>
</div>
</div>
{{/if}}
<div class="big-title hide">
<span class="iconfont">MORE&nbsp;&#xe604;</span>
... ... @@ -241,5 +179,6 @@
</div>
</div>
</div>
<div class="guang-fixed">最新资讯</div>
<a href="//guang.m.yohobuy.com/?gender={{gender}}" class="guang-fixed fixed">最新资讯</a>
<div class="float-top fixed"></div>
</div>
\ No newline at end of file
... ...
... ... @@ -7,8 +7,12 @@ class GuangNew extends Page {
constructor() {
super();
this.selector = {};
this.selector = {
$parentObj: $('.swiper-tab'),
$fixed: $('.fixed')
};
this.fixedTop = 0;
this.init();
}
... ... @@ -19,6 +23,24 @@ class GuangNew extends Page {
this.swiperCollocation();
this.swiperLimit();
this.swiperShow();
this.fixed();
this.fixedRetop();
}
// 返回顶部,最新资讯
fixed() {
$(window).scroll(() => {
this.fixedRetop();
});
}
fixedRetop() {
this.fixedTop = this.selector.$parentObj.offset().top - $(document).scrollTop();
if (this.fixedTop <= 0) {
this.selector.$fixed.show();
} else {
this.selector.$fixed.hide();
}
}
// 顶部swiper
... ...
... ... @@ -518,6 +518,7 @@ html {
}
.guang-fixed {
display: none;
position: fixed;
right: 20px;
bottom: 78px;
... ... @@ -533,3 +534,16 @@ html {
line-height: 25px;
}
}
.float-top {
position: fixed;
bottom: 180px;
right: 20px;
border-radius: 50%;
width: 80px;
height: 80px;
background: resolve("product/back-to-top.png") no-repeat;
background-size: cover;
display: none;
z-index: 9999;
}
... ...