Merge branch 'feature/likebottom' into 'release/5.4.1'
猜你喜欢bottom banner See merge request !285
Showing
1 changed file
with
21 additions
and
10 deletions
@@ -34,6 +34,13 @@ module.exports = function(specificGender) { | @@ -34,6 +34,13 @@ module.exports = function(specificGender) { | ||
34 | 34 | ||
35 | var $footer; | 35 | var $footer; |
36 | 36 | ||
37 | + var bottomBannerLoaded, | ||
38 | + channel; | ||
39 | + | ||
40 | + require('../common'); | ||
41 | + | ||
42 | + channel = window.cookie('_Channel'); | ||
43 | + | ||
37 | ellipsis.init(); | 44 | ellipsis.init(); |
38 | 45 | ||
39 | // ajax url | 46 | // ajax url |
@@ -47,19 +54,19 @@ module.exports = function(specificGender) { | @@ -47,19 +54,19 @@ module.exports = function(specificGender) { | ||
47 | } else if (yohoCoinType) { | 54 | } else if (yohoCoinType) { |
48 | 55 | ||
49 | gender = (specificGender === 'boys' || $('.mobile-wrap').hasClass('boys-wrap')) ? | 56 | gender = (specificGender === 'boys' || $('.mobile-wrap').hasClass('boys-wrap')) ? |
50 | - '1,3&rec_pos=100009' : '2,3&rec_pos=100009', | 57 | + '1,3&rec_pos=100009' : '2,3&rec_pos=100009'; |
51 | url = '/product/recom/maylike?gender=' + gender; | 58 | url = '/product/recom/maylike?gender=' + gender; |
52 | RECPOSE = 110009; | 59 | RECPOSE = 110009; |
53 | 60 | ||
54 | } else if (logisticType) { // 物流页面 | 61 | } else if (logisticType) { // 物流页面 |
55 | gender = (specificGender === 'boys' || $('.mobile-wrap').hasClass('boys-wrap')) ? | 62 | gender = (specificGender === 'boys' || $('.mobile-wrap').hasClass('boys-wrap')) ? |
56 | - '1,3&rec_pos=100006' : '2,3&rec_pos=100006', | 63 | + '1,3&rec_pos=100006' : '2,3&rec_pos=100006'; |
57 | url = '/product/recom/maylike?gender=' + gender; | 64 | url = '/product/recom/maylike?gender=' + gender; |
58 | RECPOSE = 110006; | 65 | RECPOSE = 110006; |
59 | 66 | ||
60 | } else { | 67 | } else { |
61 | gender = (specificGender === 'boys' || $('.mobile-wrap').hasClass('boys-wrap')) ? | 68 | gender = (specificGender === 'boys' || $('.mobile-wrap').hasClass('boys-wrap')) ? |
62 | - '1,3&rec_pos=100001' : '2,3&rec_pos=100002', | 69 | + '1,3&rec_pos=100001' : '2,3&rec_pos=100002'; |
63 | url = '/product/recom/maylike?gender=' + gender; | 70 | url = '/product/recom/maylike?gender=' + gender; |
64 | } | 71 | } |
65 | 72 | ||
@@ -134,17 +141,21 @@ module.exports = function(specificGender) { | @@ -134,17 +141,21 @@ module.exports = function(specificGender) { | ||
134 | 141 | ||
135 | // 有货币页面不加载底部 | 142 | // 有货币页面不加载底部 |
136 | if (gender && !specificGender) { | 143 | if (gender && !specificGender) { |
137 | - gender = gender.substr(0, 3); | ||
138 | - | ||
139 | - if (gender === '1,3') { | ||
140 | - url = '/boys/bottomBanner'; | ||
141 | - } else { | ||
142 | - url = '/girls/bottomBanner'; | 144 | + if (bottomBannerLoaded) { |
145 | + return; | ||
143 | } | 146 | } |
147 | + | ||
148 | + url = '/' + channel + '/bottomBanner'; | ||
149 | + | ||
144 | $.ajax({ | 150 | $.ajax({ |
145 | type: 'GET', | 151 | type: 'GET', |
146 | url: url, | 152 | url: url, |
153 | + data: { | ||
154 | + gender: channel | ||
155 | + }, | ||
147 | success: function(data) { | 156 | success: function(data) { |
157 | + bottomBannerLoaded = true; | ||
158 | + | ||
148 | if (data && data.img) { | 159 | if (data && data.img) { |
149 | $('#load-more-img').show(); | 160 | $('#load-more-img').show(); |
150 | $('#load-more-img a').attr('href', data.url); | 161 | $('#load-more-img a').attr('href', data.url); |
@@ -209,7 +220,7 @@ module.exports = function(specificGender) { | @@ -209,7 +220,7 @@ module.exports = function(specificGender) { | ||
209 | }); | 220 | }); |
210 | } | 221 | } |
211 | 222 | ||
212 | - $('.maybe-like p').on('touchstart', function(e) { | 223 | + $('.maybe-like p').on('touchstart', function() { |
213 | search(); | 224 | search(); |
214 | }); | 225 | }); |
215 | 226 |
-
Please register or login to post a comment