Authored by 李靖

联调

@@ -5,12 +5,11 @@ const mRoot = '../models'; @@ -5,12 +5,11 @@ const mRoot = '../models';
5 const newGuangModel = require(`${mRoot}/guang-new`); 5 const newGuangModel = require(`${mRoot}/guang-new`);
6 const headerModel = require('../../../doraemon/models/header'); // 头部model 6 const headerModel = require('../../../doraemon/models/header'); // 头部model
7 7
8 -const typeLib = require('../../../config/type-lib');  
9 const channels = { 8 const channels = {
10 - boys: 1,  
11 - girl: 2,  
12 - kids: 3,  
13 - lifestyle: 4 9 + boys: '1,3',
  10 + girls: '2,3',
  11 + kids: '1,2,3',
  12 + lifestyle: '1,2,3'
14 }; 13 };
15 14
16 exports.index = (req, res, next) => { 15 exports.index = (req, res, next) => {
@@ -26,10 +25,7 @@ exports.index = (req, res, next) => { @@ -26,10 +25,7 @@ exports.index = (req, res, next) => {
26 }; 25 };
27 26
28 let params = { 27 let params = {
29 - gender: req.query.gender ||  
30 - req.query.channel && typeLib.channels[req.query.channel] ||  
31 - req.cookies._Channel && channels[req.cookies._Channel] ||  
32 - '1,3', 28 + gender: channels[req.cookies._Channel] || '1,3'
33 }; 29 };
34 30
35 req.ctx(newGuangModel).index(params).then(result => { 31 req.ctx(newGuangModel).index(params).then(result => {
@@ -27,7 +27,8 @@ class newGuang extends global.yoho.BaseModel { @@ -27,7 +27,8 @@ class newGuang extends global.yoho.BaseModel {
27 this._indexRes(params) 27 this._indexRes(params)
28 ]).then((result) => { 28 ]).then((result) => {
29 let resu = { 29 let resu = {
30 - floorRes: {} 30 + floorRes: {},
  31 + gender: encodeURIComponent(params.gender)
31 }; 32 };
32 33
33 if (_.get(result, '[0].data')) { 34 if (_.get(result, '[0].data')) {
@@ -41,12 +42,15 @@ class newGuang extends global.yoho.BaseModel { @@ -41,12 +42,15 @@ class newGuang extends global.yoho.BaseModel {
41 if (val.template_name === 'GuangRqFloor') { 42 if (val.template_name === 'GuangRqFloor') {
42 resu.floorRes.renQi = _.get(val, 'data.list'); 43 resu.floorRes.renQi = _.get(val, 'data.list');
43 } 44 }
44 - if (val.template_name === 'GuangRqFloor') { 45 + if (val.template_name === 'GuangDpFloor') {
45 resu.floorRes.daPei = _.get(val, 'data.list'); 46 resu.floorRes.daPei = _.get(val, 'data.list');
46 } 47 }
47 - if (val.template_name === 'GuangRqFloor') { 48 + if (val.template_name === 'GuangHhFloor') {
48 resu.floorRes.haoHuo = _.get(val, 'data.list'); 49 resu.floorRes.haoHuo = _.get(val, 'data.list');
49 } 50 }
  51 + if (val.template_name === 'GuangShowOrderFloor') {
  52 + resu.floorRes.show = _.get(val, 'data.list');
  53 + }
50 }); 54 });
51 } 55 }
52 56
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 {{# floorRes.focus}} 6 {{# floorRes.focus}}
7 <div class="swiper-slide"> 7 <div class="swiper-slide">
8 <a href="{{url}}"> 8 <a href="{{url}}">
9 - <img src="{{image2 src w=750 h=322 q=60}}" alt="{{title}}" /> 9 + <img src="{{image2 src w=750 h=322 q=30}}" alt="{{title}}" />
10 </a> 10 </a>
11 </div> 11 </div>
12 {{/ floorRes.focus}} 12 {{/ floorRes.focus}}
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 {{#floorRes.type}} 24 {{#floorRes.type}}
25 <div class="swiper-slide"> 25 <div class="swiper-slide">
26 <a href="{{url}}"> 26 <a href="{{url}}">
27 - <div class="tab-item" style="background-image: url({{image2 src w=100 h=320 q=60}})"> 27 + <div class="tab-item" style="background-image: url({{image2 src w=100 h=320 q=30}})">
28 <div class="cover"></div> 28 <div class="cover"></div>
29 <div class="title">{{alt}}</div> 29 <div class="title">{{alt}}</div>
30 </div> 30 </div>
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
38 {{#if floorRes.renQi}} 38 {{#if floorRes.renQi}}
39 <div class="big-title"> 39 <div class="big-title">
40 人气 40 人气
41 - <a class="iconfont" href="//guang.m.yohobuy.com/?type=1001">MORE&nbsp;&#xe604;</a> 41 + <a class="iconfont" href="//guang.m.yohobuy.com/?gender={{gender}}&type=1001">MORE&nbsp;&#xe604;</a>
42 </div> 42 </div>
43 <div class="swiper-page"> 43 <div class="swiper-page">
44 <div class="swiper-container"> 44 <div class="swiper-container">
@@ -47,7 +47,7 @@ @@ -47,7 +47,7 @@
47 <div class="swiper-slide"> 47 <div class="swiper-slide">
48 <a href="//guang.m.yohobuy.com/info/index?id={{id}}"> 48 <a href="//guang.m.yohobuy.com/info/index?id={{id}}">
49 <div class="page-c"> 49 <div class="page-c">
50 - <img src="{{image2 src w=690 h=430 q=60}}" /> 50 + <img src="{{image2 src w=690 h=430 q=30}}" />
51 <div class="info"> 51 <div class="info">
52 <p class="name eps">{{title}}</p> 52 <p class="name eps">{{title}}</p>
53 <p class="type eps">{{intro}}</p> 53 <p class="type eps">{{intro}}</p>
@@ -63,7 +63,7 @@ @@ -63,7 +63,7 @@
63 {{#if floorRes.daPei}} 63 {{#if floorRes.daPei}}
64 <div class="big-title"> 64 <div class="big-title">
65 搭配 65 搭配
66 - <a class="iconfont" href="//guang.m.yohobuy.com/?type=2">MORE&nbsp;&#xe604;</a> 66 + <a class="iconfont" href="//guang.m.yohobuy.com/?gender={{gender}}&type=2">MORE&nbsp;&#xe604;</a>
67 </div> 67 </div>
68 <div class="swiper-collocation"> 68 <div class="swiper-collocation">
69 <div class="swiper-container"> 69 <div class="swiper-container">
@@ -71,7 +71,7 @@ @@ -71,7 +71,7 @@
71 {{# floorRes.daPei}} 71 {{# floorRes.daPei}}
72 <div class="swiper-slide"> 72 <div class="swiper-slide">
73 <a href="//guang.m.yohobuy.com/info/index?id={{id}}"> 73 <a href="//guang.m.yohobuy.com/info/index?id={{id}}">
74 - <img src="{{image2 src w=590 h=370 q=60}}" /> 74 + <img src="{{image2 src w=590 h=370 q=30}}" />
75 <p class="eps-2">{{title}}</p> 75 <p class="eps-2">{{title}}</p>
76 </a> 76 </a>
77 </div> 77 </div>
@@ -80,11 +80,11 @@ @@ -80,11 +80,11 @@
80 </div> 80 </div>
81 </div> 81 </div>
82 {{/if}} 82 {{/if}}
83 - <div class="big-title"> 83 + <div class="big-title hide">
84 限定 84 限定
85 <span class="iconfont">MORE&nbsp;&#xe604;</span> 85 <span class="iconfont">MORE&nbsp;&#xe604;</span>
86 </div> 86 </div>
87 - <div class="swiper-limit"> 87 + <div class="swiper-limit hide">
88 <div class="swiper-container"> 88 <div class="swiper-container">
89 <div class="swiper-wrapper"> 89 <div class="swiper-wrapper">
90 <div class="swiper-slide"> 90 <div class="swiper-slide">
@@ -97,46 +97,6 @@ @@ -97,46 +97,6 @@
97 <div class="name">¥7999.00</div> 97 <div class="name">¥7999.00</div>
98 </div> 98 </div>
99 </div> 99 </div>
100 - <div class="swiper-slide">  
101 - <img src="http://img10.static.yhbimg.com/article/2017/10/23/16/01b08f8dee3abc9025cd677e46d875a6b9.jpg" />  
102 - <div class="info">  
103 - <div class="name eps-2">Nike’s Air Force 1 Is Headed</div>  
104 - <div class="title">发布日期</div>  
105 - <div class="name">2017/6/15</div>  
106 - <div class="title">发售价格</div>  
107 - <div class="name">¥7999.00</div>  
108 - </div>  
109 - </div>  
110 - <div class="swiper-slide">  
111 - <img src="http://img10.static.yhbimg.com/article/2017/10/23/16/01b08f8dee3abc9025cd677e46d875a6b9.jpg" />  
112 - <div class="info">  
113 - <div class="name eps-2">Nike’s Air Force 1 Is Headed</div>  
114 - <div class="title">发布日期</div>  
115 - <div class="name">2017/6/15</div>  
116 - <div class="title">发售价格</div>  
117 - <div class="name">¥7999.00</div>  
118 - </div>  
119 - </div>  
120 - <div class="swiper-slide">  
121 - <img src="http://img10.static.yhbimg.com/article/2017/10/23/16/01b08f8dee3abc9025cd677e46d875a6b9.jpg" />  
122 - <div class="info">  
123 - <div class="name eps-2">Nike’s Air Force 1 Is Headed</div>  
124 - <div class="title">发布日期</div>  
125 - <div class="name">2017/6/15</div>  
126 - <div class="title">发售价格</div>  
127 - <div class="name">¥7999.00</div>  
128 - </div>  
129 - </div>  
130 - <div class="swiper-slide">  
131 - <img src="http://img10.static.yhbimg.com/article/2017/10/23/16/01b08f8dee3abc9025cd677e46d875a6b9.jpg" />  
132 - <div class="info">  
133 - <div class="name eps-2">Nike’s Air Force 1 Is Headed</div>  
134 - <div class="title">发布日期</div>  
135 - <div class="name">2017/6/15</div>  
136 - <div class="title">发售价格</div>  
137 - <div class="name">¥7999.00</div>  
138 - </div>  
139 - </div>  
140 </div> 100 </div>
141 <div class="swiper-pagination"></div> 101 <div class="swiper-pagination"></div>
142 </div> 102 </div>
@@ -144,36 +104,33 @@ @@ -144,36 +104,33 @@
144 {{#if floorRes.haoHuo}} 104 {{#if floorRes.haoHuo}}
145 <div class="big-title"> 105 <div class="big-title">
146 好货 106 好货
147 - <span class="iconfont">MORE&nbsp;&#xe604;</span> 107 + <a class="iconfont" href="//guang.m.yohobuy.com/?gender={{gender}}&type=4">MORE&nbsp;&#xe604;</a>
148 </div> 108 </div>
149 <div class="goods-list clearfix"> 109 <div class="goods-list clearfix">
150 {{# floorRes.haoHuo}} 110 {{# floorRes.haoHuo}}
151 <div class="goods-item"> 111 <div class="goods-item">
152 <a href="//guang.m.yohobuy.com/info/index?id={{id}}"> 112 <a href="//guang.m.yohobuy.com/info/index?id={{id}}">
153 - <img src="{{image2 src w=360 h=224 q=60}}" /> 113 + <img src="{{image2 src w=360 h=224 q=30}}" />
154 <div class="info"> 114 <div class="info">
155 <p class="name eps-2 eps-3">{{title}}</p> 115 <p class="name eps-2 eps-3">{{title}}</p>
156 - <p class="tips">#潮流行动#</p> 116 + <p class="tips">#{{min_sort_name}}#</p>
157 </div> 117 </div>
158 </a> 118 </a>
159 </div> 119 </div>
160 {{/ floorRes.haoHuo}} 120 {{/ floorRes.haoHuo}}
161 </div> 121 </div>
162 {{/if}} 122 {{/if}}
163 - <div class="big-title"> 123 + <div class="big-title hide">
164 人物 124 人物
165 <span class="iconfont">MORE&nbsp;&#xe604;</span> 125 <span class="iconfont">MORE&nbsp;&#xe604;</span>
166 </div> 126 </div>
167 - <div class="person-list clearfix">  
168 - <div class="person-item">  
169 - <img src="http://img10.static.yhbimg.com/yhb-img01/2017/10/27/12/01fee21a2b9808e42f02ad2217b59a1491.jpg" />  
170 - <p class="eps">马思唯:有趣的人会买东西</p>  
171 - </div> 127 + <div class="person-list clearfix hide">
172 <div class="person-item"> 128 <div class="person-item">
173 <img src="http://img10.static.yhbimg.com/yhb-img01/2017/10/27/12/01fee21a2b9808e42f02ad2217b59a1491.jpg" /> 129 <img src="http://img10.static.yhbimg.com/yhb-img01/2017/10/27/12/01fee21a2b9808e42f02ad2217b59a1491.jpg" />
174 <p class="eps">马思唯:有趣的人会买东西</p> 130 <p class="eps">马思唯:有趣的人会买东西</p>
175 </div> 131 </div>
176 </div> 132 </div>
  133 + {{#if floorRes.show}}
177 <div class="big-title"> 134 <div class="big-title">
178 SHOW 135 SHOW
179 <span class="iconfont">MORE&nbsp;&#xe604;</span> 136 <span class="iconfont">MORE&nbsp;&#xe604;</span>
@@ -181,41 +138,22 @@ @@ -181,41 +138,22 @@
181 <div class="swiper-show"> 138 <div class="swiper-show">
182 <div class="swiper-container"> 139 <div class="swiper-container">
183 <div class="swiper-wrapper"> 140 <div class="swiper-wrapper">
  141 + {{# floorRes.show}}
184 <div class="swiper-slide"> 142 <div class="swiper-slide">
185 - <img src="http://img12.static.yhbimg.com/article/2017/10/27/18/02fa575c14cb40d9599875b8e437564f91.jpg" />  
186 - <p class="words eps-2">感觉超赞的,穿着很FEEL准备再入手个其他色</p>  
187 - <div class="auther">  
188 - <span class="name">来自#吴亦凡#</span>  
189 - <span class="iconfont">&#xe601;</span>  
190 - </div>  
191 - </div>  
192 - <div class="swiper-slide">  
193 - <img src="http://img12.static.yhbimg.com/article/2017/10/27/18/02fa575c14cb40d9599875b8e437564f91.jpg" />  
194 - <p class="words eps-2">感觉超赞的</p>  
195 - <div class="auther">  
196 - <span class="name">来自#吴亦凡#</span>  
197 - <span class="iconfont">&#xe601;</span>  
198 - </div>  
199 - </div>  
200 - <div class="swiper-slide">  
201 - <img src="http://img12.static.yhbimg.com/article/2017/10/27/18/02fa575c14cb40d9599875b8e437564f91.jpg" />  
202 - <p class="words eps-2">感觉超赞的,穿着很FEEL准备再备再备再备再备再备再备再备再备再备再备再入</p>  
203 - <div class="auther">  
204 - <span class="name">来自#吴亦凡#</span>  
205 - <span class="iconfont">&#xe601;</span>  
206 - </div>  
207 - </div>  
208 - <div class="swiper-slide">  
209 - <img src="http://img12.static.yhbimg.com/article/2017/10/27/18/02fa575c14cb40d9599875b8e437564f91.jpg" />  
210 - <p class="words eps-2">感觉超赞的</p>  
211 - <div class="auther">  
212 - <span class="name">来自#吴亦凡#</span>  
213 - <span class="iconfont">&#xe601;</span>  
214 - </div> 143 + <a href="//m.yohobuy.com/product/{{productSkn}}.html">
  144 + <img src="{{image2 url w=358 h=358 q=30}}" />
  145 + <p class="words eps-2">{{content}}</p>
  146 + <div class="auther">
  147 + <span class="name">来自#{{userName}}#</span>
  148 + <span class="iconfont hide">&#xe601;</span>
  149 + </div>
  150 + </a>
215 </div> 151 </div>
  152 + {{/ floorRes.show}}
216 </div> 153 </div>
217 </div> 154 </div>
218 </div> 155 </div>
  156 + {{/if}}
219 <div class="big-title hide"> 157 <div class="big-title hide">
220 158
221 <span class="iconfont">MORE&nbsp;&#xe604;</span> 159 <span class="iconfont">MORE&nbsp;&#xe604;</span>
@@ -241,5 +179,6 @@ @@ -241,5 +179,6 @@
241 </div> 179 </div>
242 </div> 180 </div>
243 </div> 181 </div>
244 - <div class="guang-fixed">最新资讯</div> 182 + <a href="//guang.m.yohobuy.com/?gender={{gender}}" class="guang-fixed fixed">最新资讯</a>
  183 + <div class="float-top fixed"></div>
245 </div> 184 </div>
@@ -7,8 +7,12 @@ class GuangNew extends Page { @@ -7,8 +7,12 @@ class GuangNew extends Page {
7 constructor() { 7 constructor() {
8 super(); 8 super();
9 9
10 - this.selector = {}; 10 + this.selector = {
  11 + $parentObj: $('.swiper-tab'),
  12 + $fixed: $('.fixed')
  13 + };
11 14
  15 + this.fixedTop = 0;
12 this.init(); 16 this.init();
13 } 17 }
14 18
@@ -19,6 +23,24 @@ class GuangNew extends Page { @@ -19,6 +23,24 @@ class GuangNew extends Page {
19 this.swiperCollocation(); 23 this.swiperCollocation();
20 this.swiperLimit(); 24 this.swiperLimit();
21 this.swiperShow(); 25 this.swiperShow();
  26 + this.fixed();
  27 + this.fixedRetop();
  28 + }
  29 +
  30 + // 返回顶部,最新资讯
  31 + fixed() {
  32 + $(window).scroll(() => {
  33 + this.fixedRetop();
  34 + });
  35 + }
  36 +
  37 + fixedRetop() {
  38 + this.fixedTop = this.selector.$parentObj.offset().top - $(document).scrollTop();
  39 + if (this.fixedTop <= 0) {
  40 + this.selector.$fixed.show();
  41 + } else {
  42 + this.selector.$fixed.hide();
  43 + }
22 } 44 }
23 45
24 // 顶部swiper 46 // 顶部swiper
@@ -518,6 +518,7 @@ html { @@ -518,6 +518,7 @@ html {
518 } 518 }
519 519
520 .guang-fixed { 520 .guang-fixed {
  521 + display: none;
521 position: fixed; 522 position: fixed;
522 right: 20px; 523 right: 20px;
523 bottom: 78px; 524 bottom: 78px;
@@ -533,3 +534,16 @@ html { @@ -533,3 +534,16 @@ html {
533 line-height: 25px; 534 line-height: 25px;
534 } 535 }
535 } 536 }
  537 +
  538 +.float-top {
  539 + position: fixed;
  540 + bottom: 180px;
  541 + right: 20px;
  542 + border-radius: 50%;
  543 + width: 80px;
  544 + height: 80px;
  545 + background: resolve("product/back-to-top.png") no-repeat;
  546 + background-size: cover;
  547 + display: none;
  548 + z-index: 9999;
  549 +}