Merge remote-tracking branch 'origin/release/wap-optim' into release/wap-optim
Showing
26 changed files
with
143 additions
and
180 deletions
@@ -300,7 +300,8 @@ exports.indexSkn = (req, res, next) => { | @@ -300,7 +300,8 @@ exports.indexSkn = (req, res, next) => { | ||
300 | result: result, | 300 | result: result, |
301 | page: 'detail', | 301 | page: 'detail', |
302 | title: result.goodsName, | 302 | title: result.goodsName, |
303 | - pageFooter: true | 303 | + pageFooter: true, |
304 | + localCss: true | ||
304 | }); | 305 | }); |
305 | }).catch(next); | 306 | }).catch(next); |
306 | }; | 307 | }; |
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | -const mRoot = '../models'; | ||
4 | -const headerModel = require('../../../doraemon/models/header'); // 头部model | ||
5 | const mayLikeModel = require('../models/recom'); | 3 | const mayLikeModel = require('../models/recom'); |
6 | 4 | ||
7 | /** | 5 | /** |
@@ -41,7 +39,7 @@ const mayLike = (req, res, next) => { | @@ -41,7 +39,7 @@ const mayLike = (req, res, next) => { | ||
41 | * 你可能喜欢的潮童的商品列表 | 39 | * 你可能喜欢的潮童的商品列表 |
42 | */ | 40 | */ |
43 | const mayLikeKids = (req, res, next) => { | 41 | const mayLikeKids = (req, res, next) => { |
44 | - let page = req.body.page || 1; | 42 | + let page = req.query.page || 1; |
45 | let limit = 50; | 43 | let limit = 50; |
46 | let channel = req.query.channel || 3; | 44 | let channel = req.query.channel || 3; |
47 | 45 |
@@ -247,7 +247,7 @@ exports.consultsubmit = (req, res, next) => { | @@ -247,7 +247,7 @@ exports.consultsubmit = (req, res, next) => { | ||
247 | data: '' | 247 | data: '' |
248 | }; | 248 | }; |
249 | 249 | ||
250 | - // 判断参数是否存在 | 250 | + // 判断参数是否存在 |
251 | if (!req.body.product_id || !req.body.content) { | 251 | if (!req.body.product_id || !req.body.content) { |
252 | return res.json(data); | 252 | return res.json(data); |
253 | } | 253 | } |
@@ -294,7 +294,8 @@ exports.indexSkn = (req, res, next) => { | @@ -294,7 +294,8 @@ exports.indexSkn = (req, res, next) => { | ||
294 | result: result, | 294 | result: result, |
295 | page: 'seckill-detail', | 295 | page: 'seckill-detail', |
296 | title: result.goodsName, | 296 | title: result.goodsName, |
297 | - pageFooter: true | 297 | + pageFooter: true, |
298 | + localCss: true | ||
298 | }); | 299 | }); |
299 | }).catch(next); | 300 | }).catch(next); |
300 | }; | 301 | }; |
@@ -333,7 +334,8 @@ exports.index = (req, res, next) => { | @@ -333,7 +334,8 @@ exports.index = (req, res, next) => { | ||
333 | result: result, | 334 | result: result, |
334 | page: 'seckill-detail', | 335 | page: 'seckill-detail', |
335 | title: result.goodsName, | 336 | title: result.goodsName, |
336 | - pageFooter: true | 337 | + pageFooter: true, |
338 | + localCss: true | ||
337 | }); | 339 | }); |
338 | }).catch(next); | 340 | }).catch(next); |
339 | }; | 341 | }; |
@@ -344,7 +346,7 @@ exports.index = (req, res, next) => { | @@ -344,7 +346,7 @@ exports.index = (req, res, next) => { | ||
344 | * @param {[type]} res [description] | 346 | * @param {[type]} res [description] |
345 | * @return {[type]} [description] | 347 | * @return {[type]} [description] |
346 | */ | 348 | */ |
347 | -exports.indexData = (req, res, next)=> { | 349 | +exports.indexData = (req, res, next) => { |
348 | if (!req.xhr) { | 350 | if (!req.xhr) { |
349 | return next(); | 351 | return next(); |
350 | } | 352 | } |
@@ -361,7 +363,10 @@ exports.indexData = (req, res, next)=> { | @@ -361,7 +363,10 @@ exports.indexData = (req, res, next)=> { | ||
361 | ua: req.get('user-agent') || '' | 363 | ua: req.get('user-agent') || '' |
362 | }, req.__User__)).then((result) => { | 364 | }, req.__User__)).then((result) => { |
363 | if (_.isEmpty(result)) { | 365 | if (_.isEmpty(result)) { |
364 | - return res.json({code: 400, message: '数据错误'}); | 366 | + return res.json({ |
367 | + code: 400, | ||
368 | + message: '数据错误' | ||
369 | + }); | ||
365 | } | 370 | } |
366 | result.studentPrice = req.__User__.isStudent && result && result.goodsPrice && result.goodsPrice.studentPrice ? result.goodsPrice.studentPrice : false; | 371 | result.studentPrice = req.__User__.isStudent && result && result.goodsPrice && result.goodsPrice.studentPrice ? result.goodsPrice.studentPrice : false; |
367 | return res.json(result); | 372 | return res.json(result); |
1 | {{# shopIndex}} | 1 | {{# shopIndex}} |
2 | - <div class="shop-index yoho-page scroll-wrapper" id="wrapper"> | 2 | + <div class="shop-index yoho-page scroll-wrapper new-shop" id="wrapper"> |
3 | 3 | ||
4 | <div id="scroller"> | 4 | <div id="scroller"> |
5 | <div id="nav-top"> | 5 | <div id="nav-top"> |
@@ -54,9 +54,7 @@ | @@ -54,9 +54,7 @@ | ||
54 | <div id="home-page" class="main"> | 54 | <div id="home-page" class="main"> |
55 | <div id="nav-main" class="nav-main"> | 55 | <div id="nav-main" class="nav-main"> |
56 | <!-- 优惠卷 --> | 56 | <!-- 优惠卷 --> |
57 | - {{#if shopCoupons}} | ||
58 | - {{> shop/shop-coupon}} | ||
59 | - {{/if}} | 57 | + <div class="coupon-group"></div> |
60 | 58 | ||
61 | <!-- 大导航 --> | 59 | <!-- 大导航 --> |
62 | {{#if brandList}} | 60 | {{#if brandList}} |
@@ -5,7 +5,11 @@ | @@ -5,7 +5,11 @@ | ||
5 | {{# list}} | 5 | {{# list}} |
6 | <li class="swiper-slide"> | 6 | <li class="swiper-slide"> |
7 | <a href="javascript:;"> | 7 | <a href="javascript:;"> |
8 | - <img src="{{image img 450 600}}" alt=""> | 8 | + {{#if @first}} |
9 | + <img src="{{image img 450 600}}" alt=""> | ||
10 | + {{else}} | ||
11 | + <img class="swiper-lazy" data-src="{{image img 450 600}}" alt=""> | ||
12 | + {{/if}} | ||
9 | </a> | 13 | </a> |
10 | </li> | 14 | </li> |
11 | {{/ list}} | 15 | {{/ list}} |
@@ -16,48 +16,6 @@ | @@ -16,48 +16,6 @@ | ||
16 | </a> | 16 | </a> |
17 | </li> | 17 | </li> |
18 | {{/list}} | 18 | {{/list}} |
19 | - <!--<li class="hot-single-goods"> | ||
20 | - <img src="" alt="goods" class="goods-pic"> | ||
21 | - <div class="goods-info"> | ||
22 | - <h3 class="price">¥ 188.00</h3> | ||
23 | - <p class="view-num">22人</p> | ||
24 | - <p class="view-status">已加入收藏</p> | ||
25 | - </div> | ||
26 | - </li> | ||
27 | - <li class="hot-single-goods"> | ||
28 | - <img src="" alt="goods" class="goods-pic"> | ||
29 | - <div class="goods-info"> | ||
30 | - <h3 class="price">¥ 188.00</h3> | ||
31 | - <img src="" alt="little-head-icon" class="head-icon"> | ||
32 | - <p class="view-num view-margin">大大王</p> | ||
33 | - <p class="view-status view-margin">10分钟前购买</p> | ||
34 | - </div> | ||
35 | - </li> | ||
36 | - <li class="hot-single-goods"> | ||
37 | - <img src="" alt="goods" class="goods-pic"> | ||
38 | - <div class="goods-info"> | ||
39 | - <h3 class="price">¥ 188.00</h3> | ||
40 | - <p class="view-num">12人</p> | ||
41 | - <p class="view-status">正在浏览</p> | ||
42 | - </div> | ||
43 | - </li> | ||
44 | - <li class="hot-single-goods"> | ||
45 | - <img src="" alt="goods" class="goods-pic"> | ||
46 | - <div class="goods-info"> | ||
47 | - <h3 class="price">¥ 188.00</h3> | ||
48 | - <p class="view-num">22人</p> | ||
49 | - <p class="view-status">已加入收藏</p> | ||
50 | - </div> | ||
51 | - </li> | ||
52 | - <li class="hot-single-goods"> | ||
53 | - <img src="" alt="goods" class="goods-pic"> | ||
54 | - <div class="goods-info"> | ||
55 | - <h3 class="price">¥ 188.00</h3> | ||
56 | - <img src="" alt="little-head-icon" class="head-icon"> | ||
57 | - <p class="view-num view-margin">大大王</p> | ||
58 | - <p class="view-status view-margin">10分钟前购买</p> | ||
59 | - </div> | ||
60 | - </li>--> | ||
61 | </ul> | 19 | </ul> |
62 | </div> | 20 | </div> |
63 | </div> | 21 | </div> |
1 | {{#appIconList}} | 1 | {{#appIconList}} |
2 | -<div class="icons-wrapper" style="background-image:url({{image back_image 640 360}})"> | 2 | +<div class="icons-wrapper" {{#if back_image}} style="background-image:url({{image back_image 640 360}})" {{/if}}> |
3 | <ul class="icons-list clearfix"> | 3 | <ul class="icons-list clearfix"> |
4 | {{#data}} | 4 | {{#data}} |
5 | <li class="icons-item item-{{../number}}"><a href="{{url}}" class="imagebar"><img src="{{image src 98 98}}" alt=""></a><a href="{{url}}" class="linkbar">{{title}}</a></li> | 5 | <li class="icons-item item-{{../number}}"><a href="{{url}}" class="imagebar"><img src="{{image src 98 98}}" alt=""></a><a href="{{url}}" class="linkbar">{{title}}</a></li> |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | {{#data}} | 3 | {{#data}} |
4 | <div class="banner-list"> | 4 | <div class="banner-list"> |
5 | <a href="{{url}}"> | 5 | <a href="{{url}}"> |
6 | - <img class="lazy" data-original="{{image src 640 200}}" alt=""> | 6 | + <img src="{{image src 640 200}}" alt=""> |
7 | </a> | 7 | </a> |
8 | </div> | 8 | </div> |
9 | {{/data}} | 9 | {{/data}} |
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | {{#data}} | 12 | {{#data}} |
13 | <li class="swiper-slide"> | 13 | <li class="swiper-slide"> |
14 | <a href="{{url}}"> | 14 | <a href="{{url}}"> |
15 | - <img class="lazy" data-original="{{image src 640 200}}" alt=""> | 15 | + <img src="{{image src 640 200}}" alt=""> |
16 | </a> | 16 | </a> |
17 | </li> | 17 | </li> |
18 | {{/data}} | 18 | {{/data}} |
@@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
14 | <li class="swiper-slide"> | 14 | <li class="swiper-slide"> |
15 | <div class="img-box"> | 15 | <div class="img-box"> |
16 | <a href="{{url}}"> | 16 | <a href="{{url}}"> |
17 | - <img class="swiper-lazy" data-src="{{image default_images 235 314}}" alt=""> | 17 | + <img src="{{image default_images 235 314}}" alt=""> |
18 | </a> | 18 | </a> |
19 | <div class="swiper-lazy-preloader"></div> | 19 | <div class="swiper-lazy-preloader"></div> |
20 | </div> | 20 | </div> |
@@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
8 | {{# bigList}} | 8 | {{# bigList}} |
9 | <li class="swiper-slide"> | 9 | <li class="swiper-slide"> |
10 | <a href="{{url}}"> | 10 | <a href="{{url}}"> |
11 | - <img class="lazy" data-original="{{image src 640 403}}" alt="{{title}}"> | 11 | + <img class="swiper-lazy" data-src="{{image src 640 403}}" alt="{{title}}"> |
12 | </a> | 12 | </a> |
13 | </li> | 13 | </li> |
14 | {{/ bigList}} | 14 | {{/ bigList}} |
@@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
21 | {{^}} | 21 | {{^}} |
22 | <div class="category-swiper"> | 22 | <div class="category-swiper"> |
23 | <a href="{{url}}"> | 23 | <a href="{{url}}"> |
24 | - <img class="lazy" data-original="{{image src 640 403}}" alt="{{title}}"> | 24 | + <img src="{{image src 640 403}}" alt="{{title}}"> |
25 | </a> | 25 | </a> |
26 | </div> | 26 | </div> |
27 | {{/if}} | 27 | {{/if}} |
@@ -16,48 +16,6 @@ | @@ -16,48 +16,6 @@ | ||
16 | </a> | 16 | </a> |
17 | </li> | 17 | </li> |
18 | {{/list}} | 18 | {{/list}} |
19 | - <!--<li class="hot-single-goods"> | ||
20 | - <img src="" alt="goods" class="goods-pic"> | ||
21 | - <div class="goods-info"> | ||
22 | - <h3 class="price">¥ 188.00</h3> | ||
23 | - <p class="view-num">22人</p> | ||
24 | - <p class="view-status">已加入收藏</p> | ||
25 | - </div> | ||
26 | - </li> | ||
27 | - <li class="hot-single-goods"> | ||
28 | - <img src="" alt="goods" class="goods-pic"> | ||
29 | - <div class="goods-info"> | ||
30 | - <h3 class="price">¥ 188.00</h3> | ||
31 | - <img src="" alt="little-head-icon" class="head-icon"> | ||
32 | - <p class="view-num view-margin">大大王</p> | ||
33 | - <p class="view-status view-margin">10分钟前购买</p> | ||
34 | - </div> | ||
35 | - </li> | ||
36 | - <li class="hot-single-goods"> | ||
37 | - <img src="" alt="goods" class="goods-pic"> | ||
38 | - <div class="goods-info"> | ||
39 | - <h3 class="price">¥ 188.00</h3> | ||
40 | - <p class="view-num">12人</p> | ||
41 | - <p class="view-status">正在浏览</p> | ||
42 | - </div> | ||
43 | - </li> | ||
44 | - <li class="hot-single-goods"> | ||
45 | - <img src="" alt="goods" class="goods-pic"> | ||
46 | - <div class="goods-info"> | ||
47 | - <h3 class="price">¥ 188.00</h3> | ||
48 | - <p class="view-num">22人</p> | ||
49 | - <p class="view-status">已加入收藏</p> | ||
50 | - </div> | ||
51 | - </li> | ||
52 | - <li class="hot-single-goods"> | ||
53 | - <img src="" alt="goods" class="goods-pic"> | ||
54 | - <div class="goods-info"> | ||
55 | - <h3 class="price">¥ 188.00</h3> | ||
56 | - <img src="" alt="little-head-icon" class="head-icon"> | ||
57 | - <p class="view-num view-margin">大大王</p> | ||
58 | - <p class="view-status view-margin">10分钟前购买</p> | ||
59 | - </div> | ||
60 | - </li>--> | ||
61 | </ul> | 19 | </ul> |
62 | </div> | 20 | </div> |
63 | </div> | 21 | </div> |
1 | {{#appIconList}} | 1 | {{#appIconList}} |
2 | -<div class="icons-wrapper" style="background-image:url({{back_image}})"> | 2 | +<div class="icons-wrapper" {{#if back_image}} style="background-image:url({{back_image}})" {{/if}}> |
3 | <ul class="icons-list clearfix"> | 3 | <ul class="icons-list clearfix"> |
4 | {{#data}} | 4 | {{#data}} |
5 | <li class="icons-item item-{{../number}}"><a href="{{url}}" class="imagebar"><img src="{{image src 98 98}}" alt=""></a><a href="{{url}}" class="linkbar">{{title}}</a></li> | 5 | <li class="icons-item item-{{../number}}"><a href="{{url}}" class="imagebar"><img src="{{image src 98 98}}" alt=""></a><a href="{{url}}" class="linkbar">{{title}}</a></li> |
@@ -4,19 +4,19 @@ | @@ -4,19 +4,19 @@ | ||
4 | {{#banner_image}} | 4 | {{#banner_image}} |
5 | <li class="swiper-slide"> | 5 | <li class="swiper-slide"> |
6 | <a href="{{url}}"> | 6 | <a href="{{url}}"> |
7 | - <img class="lazy" data-original="{{image src 640 200}}" alt=""> | 7 | + <img class="swiper-lazy" data-src="{{image src 640 200}}" alt=""> |
8 | </a> | 8 | </a> |
9 | </li> | 9 | </li> |
10 | {{/banner_image}} | 10 | {{/banner_image}} |
11 | </ul> | 11 | </ul> |
12 | {{else}} | 12 | {{else}} |
13 | - {{#banner_image}} | ||
14 | - <div class="banner-list"> | ||
15 | - <a href="{{url}}"> | ||
16 | - <img class="lazy" data-original="{{image src 640 200}}" alt=""> | ||
17 | - </a> | ||
18 | - </div> | ||
19 | - {{/banner_image}} | 13 | + {{#banner_image}} |
14 | + <div class="banner-list"> | ||
15 | + <a href="{{url}}"> | ||
16 | + <img class="lazy" data-original="{{image src 640 200}}" alt=""> | ||
17 | + </a> | ||
18 | + </div> | ||
19 | + {{/banner_image}} | ||
20 | {{/if}} | 20 | {{/if}} |
21 | <div class="swiper-pagination" {{#if banner_image.[1]}}style="display:block"{{/if}}> | 21 | <div class="swiper-pagination" {{#if banner_image.[1]}}style="display:block"{{/if}}> |
22 | <div class="pagination-inner"> | 22 | <div class="pagination-inner"> |
@@ -16,19 +16,19 @@ | @@ -16,19 +16,19 @@ | ||
16 | </div> | 16 | </div> |
17 | <span class="faved-num"></span> | 17 | <span class="faved-num"></span> |
18 | <a href="{{url}}"> | 18 | <a href="{{url}}"> |
19 | - <img src="{{image src 362 174}}" alt="banner" class="top"> | 19 | + <img class="swiper-lazy" data-src="{{image src 362 174}}" alt="banner" class="top"> |
20 | </a> | 20 | </a> |
21 | {{#goods0}} | 21 | {{#goods0}} |
22 | <a href="{{url}}"> | 22 | <a href="{{url}}"> |
23 | <div class="bottom left"> | 23 | <div class="bottom left"> |
24 | - <img src="{{image src 138 183}}" alt="left"> | 24 | + <img class="swiper-lazy" data-src="{{image src 138 183}}" alt="left"> |
25 | </div> | 25 | </div> |
26 | </a> | 26 | </a> |
27 | {{/goods0}} | 27 | {{/goods0}} |
28 | {{#goods1}} | 28 | {{#goods1}} |
29 | <a href="{{url}}"> | 29 | <a href="{{url}}"> |
30 | <div class="bottom right"> | 30 | <div class="bottom right"> |
31 | - <img src="{{image src 138 183}}" alt="right"> | 31 | + <img class="swiper-lazy" data-src="{{image src 138 183}}" alt="right"> |
32 | </div> | 32 | </div> |
33 | </a> | 33 | </a> |
34 | {{/goods1}} | 34 | {{/goods1}} |
@@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
8 | <li class="swiper-slide"> | 8 | <li class="swiper-slide"> |
9 | <a href="{{url}}"> | 9 | <a href="{{url}}"> |
10 | <div class="img-box"> | 10 | <div class="img-box"> |
11 | - <img class="lazy" data-original="{{image src 580 360}}" src="{{image src 580 360}}" alt=""> | 11 | + <img src="{{image src 580 360}}" alt=""> |
12 | </div> | 12 | </div> |
13 | <div class="item-content"> | 13 | <div class="item-content"> |
14 | <p class="title">{{title}}</p> | 14 | <p class="title">{{title}}</p> |
@@ -165,10 +165,6 @@ $('.coupon-message-op-rel').on('click', function() { | @@ -165,10 +165,6 @@ $('.coupon-message-op-rel').on('click', function() { | ||
165 | location.reload(); | 165 | location.reload(); |
166 | }); | 166 | }); |
167 | 167 | ||
168 | -$('.nav-home').on('touchstart', function() { | ||
169 | - $('.homebuttom').toggleClass('hide'); | ||
170 | -}); | ||
171 | - | ||
172 | if ($('#noData').length > 0) { | 168 | if ($('#noData').length > 0) { |
173 | if (location.href.indexOf('?openby:yohobuy=') <= 0) { | 169 | if (location.href.indexOf('?openby:yohobuy=') <= 0) { |
174 | tip.show('网络异常!'); | 170 | tip.show('网络异常!'); |
@@ -114,25 +114,6 @@ if ($('.banner-swiper').find('li').size() > 1) { | @@ -114,25 +114,6 @@ if ($('.banner-swiper').find('li').size() > 1) { | ||
114 | }); | 114 | }); |
115 | } | 115 | } |
116 | 116 | ||
117 | -// single_image的轮播 | ||
118 | - | ||
119 | - | ||
120 | -$('.banner-center-swiper').each(function() { | ||
121 | - if ($(this).find('li').size() > 1) { | ||
122 | - new Swiper('.banner-center-swiper', { | ||
123 | - loop: true, | ||
124 | - autoplay: 3000, | ||
125 | - autoplayDisableOnInteraction: false, | ||
126 | - paginationClickable: true, | ||
127 | - slideElement: 'li', | ||
128 | - pagination: '.banner-center .pagination-inner', | ||
129 | - }); | ||
130 | - } else { | ||
131 | - $(this).unbind(); | ||
132 | - } | ||
133 | -}); | ||
134 | - | ||
135 | - | ||
136 | // 店铺推荐人数和收藏初始查询 | 117 | // 店铺推荐人数和收藏初始查询 |
137 | var checkShop = function() { | 118 | var checkShop = function() { |
138 | var shopIds = []; | 119 | var shopIds = []; |
@@ -189,6 +170,24 @@ var saleTime = function(elem, offsetTime) { | @@ -189,6 +170,24 @@ var saleTime = function(elem, offsetTime) { | ||
189 | }; | 170 | }; |
190 | 171 | ||
191 | function ajaxResource() { | 172 | function ajaxResource() { |
173 | + | ||
174 | + $('.banner-center-swiper').each(function() { | ||
175 | + if ($(this).find('li').length > 1) { | ||
176 | + new Swiper(this, { | ||
177 | + preloadImages: false, | ||
178 | + lazyLoading: true, | ||
179 | + lazyLoadingInPrevNext: true, | ||
180 | + lazyLoadingOnTransitionStart: true, | ||
181 | + loop: true, | ||
182 | + autoplay: 3000, | ||
183 | + autoplayDisableOnInteraction: false, | ||
184 | + paginationClickable: true, | ||
185 | + slideElement: 'li', | ||
186 | + pagination: '.banner-center .pagination-inner', | ||
187 | + }); | ||
188 | + } | ||
189 | + }); | ||
190 | + | ||
192 | // 热门品牌滑动 | 191 | // 热门品牌滑动 |
193 | if ($('.brands-swiper').find('li').length > 1) { | 192 | if ($('.brands-swiper').find('li').length > 1) { |
194 | new Swiper('.brands-swiper', { | 193 | new Swiper('.brands-swiper', { |
@@ -239,6 +238,10 @@ function ajaxResource() { | @@ -239,6 +238,10 @@ function ajaxResource() { | ||
239 | $(this).addClass(swiperClass); | 238 | $(this).addClass(swiperClass); |
240 | if ($('.' + swiperClass).find('.swiper-slide').size() > 1) { | 239 | if ($('.' + swiperClass).find('.swiper-slide').size() > 1) { |
241 | new Swiper('.' + swiperClass, { | 240 | new Swiper('.' + swiperClass, { |
241 | + preloadImages: false, | ||
242 | + lazyLoading: true, | ||
243 | + lazyLoadingInPrevNext: true, | ||
244 | + lazyLoadingOnTransitionStart: true, | ||
242 | loop: true, | 245 | loop: true, |
243 | autoplay: 3000, | 246 | autoplay: 3000, |
244 | autoplayDisableOnInteraction: false, | 247 | autoplayDisableOnInteraction: false, |
@@ -252,6 +255,10 @@ function ajaxResource() { | @@ -252,6 +255,10 @@ function ajaxResource() { | ||
252 | // 店铺推荐滑动效果 | 255 | // 店铺推荐滑动效果 |
253 | if ($('.shop-recom-swiper-container').find('li').length > 1) { | 256 | if ($('.shop-recom-swiper-container').find('li').length > 1) { |
254 | new Swiper('.shop-recom-swiper-container', { | 257 | new Swiper('.shop-recom-swiper-container', { |
258 | + preloadImages: false, | ||
259 | + lazyLoading: true, | ||
260 | + lazyLoadingInPrevNext: true, | ||
261 | + lazyLoadingOnTransitionStart: true, | ||
255 | centeredSlides: true, | 262 | centeredSlides: true, |
256 | slidesPerView: 'auto', | 263 | slidesPerView: 'auto', |
257 | paginationClickable: true, | 264 | paginationClickable: true, |
@@ -30,6 +30,7 @@ var $goodsContainer = $('#goods-container'), | @@ -30,6 +30,7 @@ var $goodsContainer = $('#goods-container'), | ||
30 | $newList = $('.new-list'); | 30 | $newList = $('.new-list'); |
31 | 31 | ||
32 | var winH = $(window).height(); | 32 | var winH = $(window).height(); |
33 | + | ||
33 | window.$ = $; | 34 | window.$ = $; |
34 | var $input = $('#search-input input'), | 35 | var $input = $('#search-input input'), |
35 | $clear = $('#search-input .clear-input'), | 36 | $clear = $('#search-input .clear-input'), |
@@ -519,7 +520,7 @@ function search(opt) { | @@ -519,7 +520,7 @@ function search(opt) { | ||
519 | }); | 520 | }); |
520 | } | 521 | } |
521 | 522 | ||
522 | - if (data === '' || data.list) { | 523 | + if (data === '' || (data.list && data.list.length <= 0)) { |
523 | nav.end = true; | 524 | nav.end = true; |
524 | 525 | ||
525 | if (nav.reload) { | 526 | if (nav.reload) { |
@@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
3 | * @author: liangzhifeng<zhifeng.liang@yoho.cn> | 3 | * @author: liangzhifeng<zhifeng.liang@yoho.cn> |
4 | * @date: 2015/10/20 | 4 | * @date: 2015/10/20 |
5 | */ | 5 | */ |
6 | +require('../../scss/product/detail/_index.css'); | ||
6 | var $ = require('yoho-jquery'), | 7 | var $ = require('yoho-jquery'), |
7 | Swiper = require('yoho-swiper'), | 8 | Swiper = require('yoho-swiper'), |
8 | Hammer = require('yoho-hammer'), | 9 | Hammer = require('yoho-hammer'), |
@@ -25,7 +26,7 @@ require('./detail/page-render')(function() { | @@ -25,7 +26,7 @@ require('./detail/page-render')(function() { | ||
25 | 26 | ||
26 | require('../common'); | 27 | require('../common'); |
27 | 28 | ||
28 | - require('./tick');// 调用秒杀js | 29 | + require('./tick'); // 调用秒杀js |
29 | 30 | ||
30 | // add extra marign-bottom for footer to show the yoho copyright | 31 | // add extra marign-bottom for footer to show the yoho copyright |
31 | function showFooter() { | 32 | function showFooter() { |
@@ -154,6 +155,3 @@ require('./detail/page-render')(function() { | @@ -154,6 +155,3 @@ require('./detail/page-render')(function() { | ||
154 | $('#yoho-footer').css('border-top', '1px solid #e0e0e0'); | 155 | $('#yoho-footer').css('border-top', '1px solid #e0e0e0'); |
155 | } | 156 | } |
156 | }); | 157 | }); |
157 | - | ||
158 | - | ||
159 | - |
@@ -115,7 +115,7 @@ var defaultOpt = require('../common/query-param'); | @@ -115,7 +115,7 @@ var defaultOpt = require('../common/query-param'); | ||
115 | channel: defaultOpt.channel | 115 | channel: defaultOpt.channel |
116 | }, | 116 | }, |
117 | success: function(data) { | 117 | success: function(data) { |
118 | - $goodsContainer.append(data); | 118 | + $('.shop-index').after(data); |
119 | 119 | ||
120 | // 初始化filter&注册filter回调 | 120 | // 初始化filter&注册filter回调 |
121 | filter.initFilter({ | 121 | filter.initFilter({ |
@@ -344,10 +344,13 @@ function tabChange(dom, index) { | @@ -344,10 +344,13 @@ function tabChange(dom, index) { | ||
344 | // 首页导航 | 344 | // 首页导航 |
345 | (function(nav, posNav, main) { | 345 | (function(nav, posNav, main) { |
346 | var scrollToNav1 = function() { | 346 | var scrollToNav1 = function() { |
347 | - window.scrollTo(0, $('#nav').offset().top + 5); | 347 | + setTimeout(function() { |
348 | + window.scrollTo(0, $('#nav').offset().top + 5); | ||
349 | + }, 100); | ||
348 | }; | 350 | }; |
349 | 351 | ||
350 | $(nav + ' li, ' + posNav + ' li').not('li.all-goods').on('touchstart', function() { | 352 | $(nav + ' li, ' + posNav + ' li').not('li.all-goods').on('touchstart', function() { |
353 | + var isPos = $(this).parent().attr('id') === 'pos-nav'; | ||
351 | var index = $(this).index(), | 354 | var index = $(this).index(), |
352 | activeTab = $(this).attr('tab'); | 355 | activeTab = $(this).attr('tab'); |
353 | 356 | ||
@@ -362,17 +365,17 @@ function tabChange(dom, index) { | @@ -362,17 +365,17 @@ function tabChange(dom, index) { | ||
362 | $('#' + activeTab).fadeIn(); | 365 | $('#' + activeTab).fadeIn(); |
363 | if (activeTab === 'new-arrival') { | 366 | if (activeTab === 'new-arrival') { |
364 | toTop = true; | 367 | toTop = true; |
365 | - newData(scrollToNav1); | 368 | + newData(isPos ? scrollToNav1 : function() {}); |
366 | viewType = 2; | 369 | viewType = 2; |
367 | } else if (activeTab === 'popularity') { | 370 | } else if (activeTab === 'popularity') { |
368 | toTop = true; | 371 | toTop = true; |
369 | - hotData(scrollToNav1); | 372 | + hotData(isPos ? scrollToNav1 : function() {}); |
370 | viewType = 3; | 373 | viewType = 3; |
371 | } else if (activeTab === 'home-page') { | 374 | } else if (activeTab === 'home-page') { |
372 | $nav1.removeClass('fixed-top absolute'); | 375 | $nav1.removeClass('fixed-top absolute'); |
373 | $nav2.removeClass('fixed-top absolute'); | 376 | $nav2.removeClass('fixed-top absolute'); |
374 | viewType = 1; | 377 | viewType = 1; |
375 | - scrollToNav1(); | 378 | + isPos && scrollToNav1(); |
376 | } | 379 | } |
377 | scH = $('#scroller').outerHeight(); | 380 | scH = $('#scroller').outerHeight(); |
378 | }); | 381 | }); |
@@ -620,7 +623,7 @@ function search(opt, callback) { | @@ -620,7 +623,7 @@ function search(opt, callback) { | ||
620 | break; | 623 | break; |
621 | } | 624 | } |
622 | 625 | ||
623 | - if (data === '') { | 626 | + if (data === '' || (data.list && data.list.length <= 0)) { |
624 | nav.end = true; | 627 | nav.end = true; |
625 | 628 | ||
626 | if (nav.reload) { | 629 | if (nav.reload) { |
@@ -742,6 +745,7 @@ $newList.on('touchstart', 'li', function(e) { | @@ -742,6 +745,7 @@ $newList.on('touchstart', 'li', function(e) { | ||
742 | }, function() { | 745 | }, function() { |
743 | }); | 746 | }); |
744 | } | 747 | } |
748 | + e.stopPropagation(); | ||
745 | 749 | ||
746 | }); | 750 | }); |
747 | 751 | ||
@@ -753,7 +757,9 @@ $(document).on('touchstart', function(e) { | @@ -753,7 +757,9 @@ $(document).on('touchstart', function(e) { | ||
753 | } | 757 | } |
754 | }); | 758 | }); |
755 | function subNavScrollTo() { | 759 | function subNavScrollTo() { |
756 | - window.scrollTo(0, $('#list-nav').offset().top + 5); | 760 | + setTimeout(function() { |
761 | + window.scrollTo(0, $('#list-nav').offset().top + 5); | ||
762 | + }, 100); | ||
757 | } | 763 | } |
758 | $subNav.on('touchend touchcancel', function(e) { | 764 | $subNav.on('touchend touchcancel', function(e) { |
759 | var $this = $(e.target).closest('li'), | 765 | var $this = $(e.target).closest('li'), |
@@ -910,7 +916,6 @@ $subNav.on('touchend touchcancel', function(e) { | @@ -910,7 +916,6 @@ $subNav.on('touchend touchcancel', function(e) { | ||
910 | url: '/product/search/search', | 916 | url: '/product/search/search', |
911 | nextPage: false | 917 | nextPage: false |
912 | }, function() { | 918 | }, function() { |
913 | - subNavScrollTo(); | ||
914 | }); | 919 | }); |
915 | } | 920 | } |
916 | } | 921 | } |
@@ -10,7 +10,7 @@ shopCoupon = { | @@ -10,7 +10,7 @@ shopCoupon = { | ||
10 | common: { | 10 | common: { |
11 | appVersion: window.queryString.app_version || window.queryString.appVersion, | 11 | appVersion: window.queryString.app_version || window.queryString.appVersion, |
12 | uid: window.queryString.uid, | 12 | uid: window.queryString.uid, |
13 | - shopId: parseInt($('.shop-id').val(), 10) || null, | 13 | + shopId: parseInt($('.shop-id').val() || $('.shopId').val(), 10) || null, |
14 | brandId: parseInt($('.brand-header').data('id'), 10) || null, | 14 | brandId: parseInt($('.brand-header').data('id'), 10) || null, |
15 | couponTemplate: require('product/shop/coupon.hbs') | 15 | couponTemplate: require('product/shop/coupon.hbs') |
16 | }, | 16 | }, |
@@ -399,7 +399,7 @@ function search(opt) { | @@ -399,7 +399,7 @@ function search(opt) { | ||
399 | break; | 399 | break; |
400 | } | 400 | } |
401 | 401 | ||
402 | - if (data === '') { | 402 | + if (data === '' || (data.list && data.list.length <= 0)) { |
403 | nav.end = true; | 403 | nav.end = true; |
404 | 404 | ||
405 | if (nav.reload) { | 405 | if (nav.reload) { |
@@ -213,7 +213,7 @@ function getPageGoods(info) { | @@ -213,7 +213,7 @@ function getPageGoods(info) { | ||
213 | url: info.url, | 213 | url: info.url, |
214 | data: info.data, | 214 | data: info.data, |
215 | success: function(data) { | 215 | success: function(data) { |
216 | - if (data === '') { | 216 | + if (data === '' || (data.list && data.list.length <= 0)) { |
217 | nav.end = true; | 217 | nav.end = true; |
218 | } | 218 | } |
219 | 219 | ||
@@ -707,7 +707,7 @@ function search(opt) { | @@ -707,7 +707,7 @@ function search(opt) { | ||
707 | break; | 707 | break; |
708 | } | 708 | } |
709 | 709 | ||
710 | - if (data === '') { | 710 | + if (data === '' || (data.list && data.list.length <= 0)) { |
711 | nav.end = true; | 711 | nav.end = true; |
712 | 712 | ||
713 | if (nav.reload) { | 713 | if (nav.reload) { |
1 | .shop-index { | 1 | .shop-index { |
2 | - /*position: absolute; | 2 | + position: absolute; |
3 | top: 0; | 3 | top: 0; |
4 | bottom: 0; | 4 | bottom: 0; |
5 | left: 0; | 5 | left: 0; |
6 | right: 0; | 6 | right: 0; |
7 | - overflow: hidden;*/ | ||
8 | - #pos-nav, #pos-list { | ||
9 | - position: fixed; | ||
10 | - left: 0; | ||
11 | - top: 0; | 7 | + overflow: hidden; |
12 | 8 | ||
9 | + &.new-shop { | ||
10 | + position: initial; | ||
11 | + overflow: initial; | ||
12 | + #pos-nav, #pos-list { | ||
13 | + position: fixed; | ||
14 | + left: 0; | ||
15 | + top: 0; | ||
16 | + } | ||
17 | + .nav { | ||
18 | + li { | ||
19 | + height: 100%; | ||
20 | + line-height: 100%; | ||
21 | + margin-top: 0px; | ||
22 | + border-left: none; | ||
23 | + .text { | ||
24 | + display: block; | ||
25 | + width: 100%; | ||
26 | + border-left: 1px solid #e0e0e0; | ||
27 | + margin-top: 30px; | ||
28 | + height: 28px; | ||
29 | + } | ||
30 | + &:first-child { | ||
31 | + .text { | ||
32 | + border-left: none; | ||
33 | + } | ||
34 | + } | ||
35 | + } | ||
36 | + } | ||
37 | + .shop-foot-wrapper { | ||
38 | + position: fixed; | ||
39 | + left: 0; | ||
40 | + } | ||
13 | } | 41 | } |
42 | + | ||
43 | + | ||
14 | .nav-main { | 44 | .nav-main { |
15 | margin-bottom: 30px; | 45 | margin-bottom: 30px; |
16 | } | 46 | } |
@@ -90,25 +120,18 @@ | @@ -90,25 +120,18 @@ | ||
90 | 120 | ||
91 | li{ | 121 | li{ |
92 | display: block; | 122 | display: block; |
93 | - height: 100%; | ||
94 | - line-height: 100%; | 123 | + height: 28px; |
95 | float: left; | 124 | float: left; |
125 | + line-height: 28px; | ||
96 | width: 24.7%; | 126 | width: 24.7%; |
97 | text-align: center; | 127 | text-align: center; |
128 | + border-left: 1px solid #e0e0e0; | ||
129 | + margin-top: 30px; | ||
98 | border-sizing: border-box; | 130 | border-sizing: border-box; |
99 | color: #b0b0b0; | 131 | color: #b0b0b0; |
100 | - .text { | ||
101 | - display: block; | ||
102 | - width: 100%; | ||
103 | - border-left: 1px solid #e0e0e0; | ||
104 | - margin-top: 30px; | ||
105 | - height: 28px; | ||
106 | - } | 132 | + |
107 | &:first-child { | 133 | &:first-child { |
108 | border-left: none; | 134 | border-left: none; |
109 | - .text { | ||
110 | - border-left: none; | ||
111 | - } | ||
112 | } | 135 | } |
113 | 136 | ||
114 | a { | 137 | a { |
@@ -417,9 +440,8 @@ | @@ -417,9 +440,8 @@ | ||
417 | } | 440 | } |
418 | 441 | ||
419 | .shop-foot-wrapper { | 442 | .shop-foot-wrapper { |
420 | - position: fixed; | 443 | + position: absolute; |
421 | bottom: 0; | 444 | bottom: 0; |
422 | - left: 0; | ||
423 | display: table; | 445 | display: table; |
424 | width: 100%; | 446 | width: 100%; |
425 | height: 88px; | 447 | height: 88px; |
@@ -623,9 +645,9 @@ | @@ -623,9 +645,9 @@ | ||
623 | } | 645 | } |
624 | 646 | ||
625 | .shop-index + .filter-mask { | 647 | .shop-index + .filter-mask { |
648 | + margin-top: 1px; | ||
626 | 649 | ||
627 | .filter-body { | 650 | .filter-body { |
628 | - top: 1px; | ||
629 | overflow: auto; | 651 | overflow: auto; |
630 | } | 652 | } |
631 | 653 | ||
@@ -634,8 +656,17 @@ | @@ -634,8 +656,17 @@ | ||
634 | } | 656 | } |
635 | 657 | ||
636 | &.call-by-fix { | 658 | &.call-by-fix { |
659 | + top: 78px; | ||
660 | + } | ||
661 | +} | ||
662 | +.new-shop + .filter-mask { | ||
663 | + margin-top: initial; | ||
664 | + position: fixed; | ||
665 | + top: 46px; | ||
666 | + | ||
667 | + &.call-by-fix { | ||
637 | top: 80px; | 668 | top: 80px; |
638 | position: fixed; | 669 | position: fixed; |
639 | left: 0; | 670 | left: 0; |
640 | } | 671 | } |
641 | -} | 672 | +} |
@@ -22,4 +22,7 @@ | @@ -22,4 +22,7 @@ | ||
22 | @import "product/search/list"; | 22 | @import "product/search/list"; |
23 | @import "product/sale/sale"; | 23 | @import "product/sale/sale"; |
24 | @import "product/shop/shop-index"; | 24 | @import "product/shop/shop-index"; |
25 | +@import "product/shop/shop-prodfile"; | ||
26 | +@import "product/shop/product-category"; | ||
27 | +@import "product/shop/shop-index-coupon"; | ||
25 | @import "home/hot-category"; | 28 | @import "home/hot-category"; |
-
Please register or login to post a comment