Merge branch 'release/4.6' of http://git.yoho.cn/fe/yohobuywap-node into release/4.6
Showing
18 changed files
with
95 additions
and
60 deletions
@@ -12,17 +12,7 @@ | @@ -12,17 +12,7 @@ | ||
12 | <ul class="clearfix swiper-wrapper"> | 12 | <ul class="clearfix swiper-wrapper"> |
13 | {{# starAvatar}} | 13 | {{# starAvatar}} |
14 | <li class="swiper-slide"> | 14 | <li class="swiper-slide"> |
15 | - <a class="rank-avatar" href='{{url}}' data-avatar="{{image cover 180 180}}"></a> | ||
16 | - </li> | ||
17 | - {{/ starAvatar}} | ||
18 | - {{# starAvatar}} | ||
19 | - <li class="swiper-slide"> | ||
20 | - <a class="rank-avatar" href='{{url}}' data-avatar="{{image cover 180 180}}"></a> | ||
21 | - </li> | ||
22 | - {{/ starAvatar}} | ||
23 | - {{# starAvatar}} | ||
24 | - <li class="swiper-slide"> | ||
25 | - <a class="rank-avatar" href='{{url}}' data-avatar="{{image cover 180 180}}"></a> | 15 | + <span class="rank-avatar" data-url='{{url}}' data-avatar="{{image cover 180 180}}"></span> |
26 | </li> | 16 | </li> |
27 | {{/ starAvatar}} | 17 | {{/ starAvatar}} |
28 | </ul> | 18 | </ul> |
@@ -56,8 +56,8 @@ exports.activityList = (req, res) => { | @@ -56,8 +56,8 @@ exports.activityList = (req, res) => { | ||
56 | }); | 56 | }); |
57 | let categoryId = req.query.category_id; | 57 | let categoryId = req.query.category_id; |
58 | let type = req.query.type || 2; | 58 | let type = req.query.type || 2; |
59 | - let template = type === 2 ? 'outlet/will-end' : 'outlet/will-start'; | ||
60 | - let page = type === 2 ? 'outlet-will-end' : 'outlet-will-start'; | 59 | + let template = parseInt(type, 10) === 2 ? 'outlet/will-end' : 'outlet/will-start'; |
60 | + let page = parseInt(type, 10) === 2 ? 'outlet-will-end' : 'outlet-will-start'; | ||
61 | 61 | ||
62 | if (!categoryId) { | 62 | if (!categoryId) { |
63 | throw new Error('No parent_id for OUTLET channel page!'); | 63 | throw new Error('No parent_id for OUTLET channel page!'); |
@@ -3,5 +3,10 @@ | @@ -3,5 +3,10 @@ | ||
3 | {{# activity}} | 3 | {{# activity}} |
4 | {{> resources/acivity-outlets}} | 4 | {{> resources/acivity-outlets}} |
5 | {{/ activity}} | 5 | {{/ activity}} |
6 | + | ||
7 | + <div class="empty hide"> | ||
8 | + <div class="bag"></div> | ||
9 | + <p>活动正在火热中进行,左滑切换频道,更多潮品,就在YOHO!BUY有货</p> | ||
10 | + </div> | ||
6 | </div> | 11 | </div> |
7 | 12 |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <img class="back-image" src="{{image coverUrl 640 300}}"> | 3 | <img class="back-image" src="{{image coverUrl 640 300}}"> |
4 | <div class="center-square"> | 4 | <div class="center-square"> |
5 | <div class="title">{{title}}</div> | 5 | <div class="title">{{title}}</div> |
6 | - <div class="num"><span class="discountNum">{{discountNum}}</span> {{discountText}}</div> | 6 | + <div class="num"><span class="discount-num">{{discountNum}}</span> {{discountText}}</div> |
7 | {{>product/outlet/countdown}} | 7 | {{>product/outlet/countdown}} |
8 | </div> | 8 | </div> |
9 | </a> | 9 | </a> |
public/.DS_Store
0 → 100644
No preview for this file type
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
1 | -!function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}({0:function(t,e,n){var i=n(2),r=n(32),o=n(11),s=n(33),a=i(".cd-medium");n(8),a.length>0&&a.each(function(){r.Countdown({el:i(this)})}),i("#index_nav").length>0&&s({el:"#index_nav"})["goto"](i("#index_nav").find(".active").index()),i("#list-nav").length>0&&s({el:"#list-nav"})["goto"](0),i(".will-end-back").on("click",function(){return o.show("活动即将结束"),!1})},2:function(t,e,n){var i,r;/*! | 1 | +!function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}({0:function(t,e,n){var i=n(2),r=n(32),o=n(11),s=n(33),a=i(".cd-medium");n(8),a.length>0&&a.each(function(){new r.Countdown({el:i(this)})}),i("#index_nav").length>0&&s({el:"#index_nav"})["goto"](i("#index_nav").find(".active").index()),i(".will-end-back").length<1&&i(".empty").show(),i(".will-end-back").on("click",function(){return o.show("活动即将结束"),!1})},2:function(t,e,n){var i,r;/*! |
2 | * jQuery JavaScript Library v2.2.4 | 2 | * jQuery JavaScript Library v2.2.4 |
3 | * http://jquery.com/ | 3 | * http://jquery.com/ |
4 | * | 4 | * |
1 | -!function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}({0:function(t,e,n){var i=n(2),r=n(32),o=n(11),s=n(33),a=i(".cd-lite");n(8),a.length>0&&a.each(function(){r.Countdown({el:i(this)})}),i("#index_nav").length>0&&s({el:"#index_nav"})["goto"](i("#index_nav").find(".active").index()),i("#list-nav").length>0&&s({el:"#list-nav"})["goto"](0),i(".back-ground-white").on("click",function(){return o.show("活动即将开始"),!1})},2:function(t,e,n){var i,r;/*! | 1 | +!function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}({0:function(t,e,n){var i=n(2),r=n(32),o=n(11),s=n(33),a=i(".cd-lite");n(8),a.length>0&&a.each(function(){new r.Countdown({el:i(this)})}),i("#index_nav").length>0&&s({el:"#index_nav"})["goto"](i("#index_nav").find(".active").index()),i(".back-ground-white").length<1&&i(".empty").show(),i(".back-ground-white").on("click",function(){return o.show("活动即将开始"),!1})},2:function(t,e,n){var i,r;/*! |
2 | * jQuery JavaScript Library v2.2.4 | 2 | * jQuery JavaScript Library v2.2.4 |
3 | * http://jquery.com/ | 3 | * http://jquery.com/ |
4 | * | 4 | * |
No preview for this file type

5.64 KB
public/img/product/bag_moren.png
0 → 100755

5.64 KB
@@ -31,7 +31,7 @@ var $window = $(window), | @@ -31,7 +31,7 @@ var $window = $(window), | ||
31 | var mySwiper; | 31 | var mySwiper; |
32 | */ | 32 | */ |
33 | 33 | ||
34 | -var avatarKey, bannerLen; | 34 | +var avatarKey, bannerLen, res; |
35 | 35 | ||
36 | require('../common'); | 36 | require('../common'); |
37 | 37 | ||
@@ -66,6 +66,31 @@ function setAvatar($userAvatar) { | @@ -66,6 +66,31 @@ function setAvatar($userAvatar) { | ||
66 | }; | 66 | }; |
67 | } | 67 | } |
68 | 68 | ||
69 | + | ||
70 | +// 明星头像点击居中显示或跳转 | ||
71 | +function bindAvatar(dom) { | ||
72 | + avatarKey = dom.index(); | ||
73 | + | ||
74 | + if (!dom.hasClass('swiper-slide-active')) { | ||
75 | + if (avatarKey >= (2 * bannerLen + 1)) { | ||
76 | + avatarSwiperClone && avatarSwiperClone.slideTo(bannerLen + 1, 200); | ||
77 | + avatarSwiper.slideTo(bannerLen + 1, 200); | ||
78 | + } else if (avatarKey <= (bannerLen - 1)) { | ||
79 | + avatarSwiperClone && avatarSwiperClone.slideTo(2 * bannerLen - 1, 200); | ||
80 | + avatarSwiper.slideTo(2 * bannerLen - 1, 200); | ||
81 | + } else { | ||
82 | + avatarSwiperClone && avatarSwiperClone.slideTo(avatarKey, 200); | ||
83 | + avatarSwiper.slideTo(avatarKey, 200); | ||
84 | + } | ||
85 | + | ||
86 | + return false; | ||
87 | + } else if (window.queryString.app_version) { | ||
88 | + return false; | ||
89 | + } | ||
90 | + | ||
91 | + return false; | ||
92 | +} | ||
93 | + | ||
69 | function setIndexAction() { | 94 | function setIndexAction() { |
70 | var starIScroll; | 95 | var starIScroll; |
71 | 96 | ||
@@ -106,14 +131,20 @@ function setIndexAction() { | @@ -106,14 +131,20 @@ function setIndexAction() { | ||
106 | if (!avatarSwiperClone) { | 131 | if (!avatarSwiperClone) { |
107 | avatarSwiperClone = new Swiper('.avatar-0', { | 132 | avatarSwiperClone = new Swiper('.avatar-0', { |
108 | loop: true, | 133 | loop: true, |
109 | - initialSlide: $('.avatar-1').find('.swiper-slide-active').index(), | 134 | + initialSlide: $('.avatar-1').find('.swiper-slide-active').index() % bannerLen, |
110 | centeredSlides: true, | 135 | centeredSlides: true, |
111 | slidesPerView: 'auto', | 136 | slidesPerView: 'auto', |
112 | loopedSlides: bannerLen, | 137 | loopedSlides: bannerLen, |
113 | spaceBetween: 10, | 138 | spaceBetween: 10, |
114 | slidesOffsetBefore: -($('.swiper-num').width()), | 139 | slidesOffsetBefore: -($('.swiper-num').width()), |
115 | watchSlidesProgress: true, | 140 | watchSlidesProgress: true, |
116 | - watchSlidesVisibility: true | 141 | + watchSlidesVisibility: true, |
142 | + onInit: function() { | ||
143 | + $('.avatar-0 li').on('click', function() { | ||
144 | + res = bindAvatar($(this)); | ||
145 | + return res; | ||
146 | + }); | ||
147 | + } | ||
117 | }); | 148 | }); |
118 | 149 | ||
119 | avatarSwiperClone.params.control = avatarSwiper; | 150 | avatarSwiperClone.params.control = avatarSwiper; |
@@ -206,7 +237,13 @@ function setIndexAction() { | @@ -206,7 +237,13 @@ function setIndexAction() { | ||
206 | spaceBetween: 10, | 237 | spaceBetween: 10, |
207 | slidesOffsetBefore: -($('.swiper-num').width()), | 238 | slidesOffsetBefore: -($('.swiper-num').width()), |
208 | watchSlidesProgress: true, | 239 | watchSlidesProgress: true, |
209 | - watchSlidesVisibility: true | 240 | + watchSlidesVisibility: true, |
241 | + onInit: function() { | ||
242 | + $('.avatar-1 li').on('click', function() { | ||
243 | + res = bindAvatar($(this)); | ||
244 | + return res; | ||
245 | + }); | ||
246 | + } | ||
210 | }); | 247 | }); |
211 | } | 248 | } |
212 | 249 | ||
@@ -243,28 +280,6 @@ function setIndexAction() { | @@ -243,28 +280,6 @@ function setIndexAction() { | ||
243 | }); | 280 | }); |
244 | } | 281 | } |
245 | 282 | ||
246 | - // 明星头像点击居中显示或跳转 | ||
247 | - $('.avatar-swiper li').on('click', function() { | ||
248 | - if (!$(this).hasClass('swiper-slide-active')) { | ||
249 | - avatarKey = $(this).index(); | ||
250 | - | ||
251 | - if (avatarKey >= (2 * bannerLen + 1)) { | ||
252 | - avatarSwiperClone && avatarSwiperClone.slideTo(bannerLen + 1, 200); | ||
253 | - avatarSwiper.slideTo(bannerLen + 1, 200); | ||
254 | - } else if (avatarKey <= (bannerLen - 1)) { | ||
255 | - avatarSwiperClone && avatarSwiperClone.slideTo(2 * bannerLen - 1, 200); | ||
256 | - avatarSwiper.slideTo(2 * bannerLen - 1, 200); | ||
257 | - } else { | ||
258 | - avatarSwiperClone && avatarSwiperClone.slideTo(avatarKey, 200); | ||
259 | - avatarSwiper.slideTo(avatarKey, 200); | ||
260 | - } | ||
261 | - | ||
262 | - return false; | ||
263 | - } else if (window.queryString.app_version) { | ||
264 | - return false; | ||
265 | - } | ||
266 | - }); | ||
267 | - | ||
268 | $('.rank-avatar').each(function(key, item) { | 283 | $('.rank-avatar').each(function(key, item) { |
269 | if ($(item).attr('data-avatar') !== '') { | 284 | if ($(item).attr('data-avatar') !== '') { |
270 | setAvatar($(item)); | 285 | setAvatar($(item)); |
@@ -276,6 +291,8 @@ function setIndexAction() { | @@ -276,6 +291,8 @@ function setIndexAction() { | ||
276 | }); | 291 | }); |
277 | } | 292 | } |
278 | 293 | ||
294 | + | ||
295 | +// 首页数据请求 | ||
279 | getIndexHtml = function() { | 296 | getIndexHtml = function() { |
280 | var $starMain = $('.star-main'); | 297 | var $starMain = $('.star-main'); |
281 | 298 |
@@ -11,11 +11,11 @@ var $el = $('.cd-medium'); | @@ -11,11 +11,11 @@ var $el = $('.cd-medium'); | ||
11 | require('../common'); | 11 | require('../common'); |
12 | 12 | ||
13 | if ($el.length > 0) { | 13 | if ($el.length > 0) { |
14 | - $el.each(function(){ | ||
15 | - Countdown.Countdown({ | 14 | + $el.each(function() { |
15 | + new Countdown.Countdown({ | ||
16 | el: $(this) | 16 | el: $(this) |
17 | - }) | ||
18 | - }) | 17 | + }); |
18 | + }); | ||
19 | } | 19 | } |
20 | 20 | ||
21 | // 导航滚动 | 21 | // 导航滚动 |
@@ -25,10 +25,8 @@ if ($('#index_nav').length > 0) { | @@ -25,10 +25,8 @@ if ($('#index_nav').length > 0) { | ||
25 | }).goto($('#index_nav').find('.active').index()); | 25 | }).goto($('#index_nav').find('.active').index()); |
26 | } | 26 | } |
27 | 27 | ||
28 | -if ($('#list-nav').length > 0) { | ||
29 | - iscroll({ | ||
30 | - el: '#list-nav' | ||
31 | - }).goto(0); | 28 | +if ($('.will-end-back').length < 1) { |
29 | + $('.empty').show(); | ||
32 | } | 30 | } |
33 | 31 | ||
34 | $('.will-end-back').on('click', function() { | 32 | $('.will-end-back').on('click', function() { |
@@ -11,11 +11,11 @@ var $el = $('.cd-lite'); | @@ -11,11 +11,11 @@ var $el = $('.cd-lite'); | ||
11 | require('../common'); | 11 | require('../common'); |
12 | 12 | ||
13 | if ($el.length > 0) { | 13 | if ($el.length > 0) { |
14 | - $el.each(function(){ | ||
15 | - Countdown.Countdown({ | 14 | + $el.each(function() { |
15 | + new Countdown.Countdown({ | ||
16 | el: $(this) | 16 | el: $(this) |
17 | - }) | ||
18 | - }) | 17 | + }); |
18 | + }); | ||
19 | } | 19 | } |
20 | 20 | ||
21 | // 导航滚动 | 21 | // 导航滚动 |
@@ -25,10 +25,8 @@ if ($('#index_nav').length > 0) { | @@ -25,10 +25,8 @@ if ($('#index_nav').length > 0) { | ||
25 | }).goto($('#index_nav').find('.active').index()); | 25 | }).goto($('#index_nav').find('.active').index()); |
26 | } | 26 | } |
27 | 27 | ||
28 | -if ($('#list-nav').length > 0) { | ||
29 | - iscroll({ | ||
30 | - el: '#list-nav' | ||
31 | - }).goto(0); | 28 | +if ($('.back-ground-white').length < 1) { |
29 | + $('.empty').show(); | ||
32 | } | 30 | } |
33 | 31 | ||
34 | $('.back-ground-white').on('click', function() { | 32 | $('.back-ground-white').on('click', function() { |
@@ -58,7 +58,7 @@ | @@ -58,7 +58,7 @@ | ||
58 | font-size: 25px; | 58 | font-size: 25px; |
59 | color: #ff0705; | 59 | color: #ff0705; |
60 | 60 | ||
61 | - .discountNum { | 61 | + .discount-num { |
62 | font-size: 40px; | 62 | font-size: 40px; |
63 | } | 63 | } |
64 | } | 64 | } |
@@ -153,7 +153,6 @@ | @@ -153,7 +153,6 @@ | ||
153 | .time { | 153 | .time { |
154 | font-size: 22px; | 154 | font-size: 22px; |
155 | } | 155 | } |
156 | - | ||
157 | } | 156 | } |
158 | 157 | ||
159 | .outlet-discount { | 158 | .outlet-discount { |
@@ -184,4 +183,26 @@ | @@ -184,4 +183,26 @@ | ||
184 | .hidden { | 183 | .hidden { |
185 | display: none; | 184 | display: none; |
186 | } | 185 | } |
186 | + | ||
187 | + .empty { | ||
188 | + position: absolute; | ||
189 | + width: 330px; | ||
190 | + left: 50%; | ||
191 | + top: 300px; | ||
192 | + margin-left: -150px; | ||
193 | + font-size: 24px; | ||
194 | + color: #444; | ||
195 | + font-family: STHeitiSC Mdedi; | ||
196 | + | ||
197 | + .bag { | ||
198 | + display: block; | ||
199 | + width: 200px; | ||
200 | + height: 200px; | ||
201 | + margin-left: 65px; | ||
202 | + margin-bottom: 30px; | ||
203 | + background-image: resolve("product/bag_moren.png"); | ||
204 | + background-repeat: no-repeat; | ||
205 | + background-size: 100% 100%; | ||
206 | + } | ||
207 | + } | ||
187 | } | 208 | } |
-
Please register or login to post a comment