|
@@ -4,6 +4,254 @@ |
|
@@ -4,6 +4,254 @@ |
4
|
* @date: 2015/10/12
|
4
|
* @date: 2015/10/12
|
5
|
*/
|
5
|
*/
|
6
|
|
6
|
|
|
|
7
|
+// module.exports = function(specificGender) {
|
|
|
8
|
+// var $ = require('yoho-jquery'),
|
|
|
9
|
+// Hammer = require('yoho-hammer'),
|
|
|
10
|
+// ellipsis = require('yoho-mlellipsis'),
|
|
|
11
|
+// tip = require('../plugin/tip'),
|
|
|
12
|
+// loading = require('../plugin/loading'),
|
|
|
13
|
+// lazyLoad = require('yoho-jquery-lazyload');
|
|
|
14
|
+
|
|
|
15
|
+// var navHammer,
|
|
|
16
|
+// winH = $(window).height(),
|
|
|
17
|
+// $goodList = $('#goods-list'),
|
|
|
18
|
+// searching = false,
|
|
|
19
|
+// page = 0,
|
|
|
20
|
+// gender = null,
|
|
|
21
|
+// num,
|
|
|
22
|
+// url,
|
|
|
23
|
+// RECPOSE = '';
|
|
|
24
|
+
|
|
|
25
|
+// // The kidsType can be specified by the parameter. Add by @ZhaoBiao
|
|
|
26
|
+// var kidsType = specificGender === 'kids' || $('.mobile-wrap').hasClass('kids-wrap') ? true : false,
|
|
|
27
|
+// lifestyleType = specificGender === 'lifestyle' ||
|
|
|
28
|
+// $('.mobile-wrap').hasClass('lifestyle-wrap') ? true : false,
|
|
|
29
|
+
|
|
|
30
|
+// yohoCoinType = $('.coin').length ? true : false;
|
|
|
31
|
+// var $curNav,
|
|
|
32
|
+// index,
|
|
|
33
|
+// $navList = $('#maybe-like-nav');
|
|
|
34
|
+
|
|
|
35
|
+// var $footer;
|
|
|
36
|
+
|
|
|
37
|
+// var bottomBannerLoaded;
|
|
|
38
|
+
|
|
|
39
|
+// ellipsis.init();
|
|
|
40
|
+
|
|
|
41
|
+// // ajax url
|
|
|
42
|
+// if (kidsType) {
|
|
|
43
|
+
|
|
|
44
|
+// url = '/product/recom/maylikekids';
|
|
|
45
|
+// } else if (lifestyleType) {
|
|
|
46
|
+
|
|
|
47
|
+// //有货币页面加载男生首页的数据
|
|
|
48
|
+// url = specificGender === 'lifestyle' ? '/product/recom/maylike?gender=1,3&rec_pos=100001' : '/product/recom/maylikelife';
|
|
|
49
|
+// } else if (yohoCoinType) {
|
|
|
50
|
+
|
|
|
51
|
+// gender = (specificGender === 'boys' || $('.mobile-wrap').hasClass('boys-wrap')) ?
|
|
|
52
|
+// '1,3&rec_pos=100009' : '2,3&rec_pos=100009',
|
|
|
53
|
+// url = '/product/recom/maylike?gender=' + gender;
|
|
|
54
|
+// RECPOSE = 110009;
|
|
|
55
|
+
|
|
|
56
|
+// } else if (logisticType) { //物流页面
|
|
|
57
|
+// gender = (specificGender === 'boys' || $('.mobile-wrap').hasClass('boys-wrap')) ?
|
|
|
58
|
+// '1,3&rec_pos=100006' : '2,3&rec_pos=100006',
|
|
|
59
|
+// url = '/product/recom/maylike?gender=' + gender;
|
|
|
60
|
+// RECPOSE = 110006;
|
|
|
61
|
+
|
|
|
62
|
+// } else {
|
|
|
63
|
+// gender = (specificGender === 'boys' || $('.mobile-wrap').hasClass('boys-wrap')) ?
|
|
|
64
|
+// '1,3&rec_pos=100001' : '2,3&rec_pos=100002',
|
|
|
65
|
+// url = '/product/recom/maylike?gender=' + gender;
|
|
|
66
|
+// }
|
|
|
67
|
+
|
|
|
68
|
+
|
|
|
69
|
+// // 首页男生和女生,推荐位ID,埋点
|
|
|
70
|
+// if (window.location.pathname === '/boys') {
|
|
|
71
|
+// RECPOSE = 110001;
|
|
|
72
|
+// } else if (window.location.pathname === '/girls') {
|
|
|
73
|
+// RECPOSE = 110002;
|
|
|
74
|
+// }
|
|
|
75
|
+
|
|
|
76
|
+// $curNav = $navList.children('.focus');
|
|
|
77
|
+
|
|
|
78
|
+// if (lifestyleType) {
|
|
|
79
|
+// navHammer = $navList[0] ? new Hammer($navList[0]) : null;
|
|
|
80
|
+// if (navHammer) {
|
|
|
81
|
+// navHammer.on('tap', function(e) {
|
|
|
82
|
+// var $this = $(e.target).closest('li'),
|
|
|
83
|
+// $goods = $('.goods-list'),
|
|
|
84
|
+// $content;
|
|
|
85
|
+
|
|
|
86
|
+// e.preventDefault();
|
|
|
87
|
+// if ($this.hasClass('focus')) {
|
|
|
88
|
+// return;
|
|
|
89
|
+// }
|
|
|
90
|
+
|
|
|
91
|
+// index = $this.index();
|
|
|
92
|
+
|
|
|
93
|
+// $this.addClass('focus');
|
|
|
94
|
+// $curNav.removeClass('focus');
|
|
|
95
|
+
|
|
|
96
|
+// $goods.not('.hide').addClass('hide');
|
|
|
97
|
+// $content = $goods.eq(index);
|
|
|
98
|
+// $content.removeClass('hide');
|
|
|
99
|
+
|
|
|
100
|
+// $curNav = $this;
|
|
|
101
|
+
|
|
|
102
|
+// $(document).trigger('scroll'); // Trigger lazyLoad
|
|
|
103
|
+// e.srcEvent.stopPropagation();
|
|
|
104
|
+// });
|
|
|
105
|
+// }
|
|
|
106
|
+// }
|
|
|
107
|
+
|
|
|
108
|
+// loading.init($('.maybe-like'));
|
|
|
109
|
+
|
|
|
110
|
+// function search() {
|
|
|
111
|
+// if (searching) {
|
|
|
112
|
+// return;
|
|
|
113
|
+// }
|
|
|
114
|
+// searching = true;
|
|
|
115
|
+
|
|
|
116
|
+// loading.showLoadingMask();
|
|
|
117
|
+
|
|
|
118
|
+// // num = $goodList.find('.good-info').length;
|
|
|
119
|
+// $.ajax({
|
|
|
120
|
+// type: 'GET',
|
|
|
121
|
+// url: url,
|
|
|
122
|
+// data: {
|
|
|
123
|
+// page: page + 1
|
|
|
124
|
+// },
|
|
|
125
|
+// success: function(data) {
|
|
|
126
|
+// var PRDID = [];
|
|
|
127
|
+
|
|
|
128
|
+// if (data === ' ') {
|
|
|
129
|
+// loading.hideLoadingMask();
|
|
|
130
|
+
|
|
|
131
|
+// // 有货币页面不加载底部
|
|
|
132
|
+// if (gender && !specificGender) {
|
|
|
133
|
+// if (bottomBannerLoaded) {
|
|
|
134
|
+// return;
|
|
|
135
|
+// }
|
|
|
136
|
+// url = '/channel/bottomBanner';
|
|
|
137
|
+// $.ajax({
|
|
|
138
|
+// type: 'GET',
|
|
|
139
|
+// url: url,
|
|
|
140
|
+// data: {
|
|
|
141
|
+// gender: gender
|
|
|
142
|
+// },
|
|
|
143
|
+// success: function(res) {
|
|
|
144
|
+// res = res.data;
|
|
|
145
|
+// bottomBannerLoaded = true;
|
|
|
146
|
+// if (res && res.img) {
|
|
|
147
|
+// $('#load-more-img').show();
|
|
|
148
|
+// $('#load-more-img a').attr('href', res.url);
|
|
|
149
|
+// $('#load-more-img a > img').attr('src', res.img);
|
|
|
150
|
+// }
|
|
|
151
|
+// }
|
|
|
152
|
+// });
|
|
|
153
|
+
|
|
|
154
|
+// }
|
|
|
155
|
+// return;
|
|
|
156
|
+// } else {
|
|
|
157
|
+// searching = false;
|
|
|
158
|
+// }
|
|
|
159
|
+
|
|
|
160
|
+// // 加载到数据后,去除bottom样式,使得footer能够随着页面长度的增加改变位置
|
|
|
161
|
+// if (data.length > 1) {
|
|
|
162
|
+// $footer ? null : $footer = $('#yoho-footer');
|
|
|
163
|
+// $footer.hasClass('bottom') ? $footer.removeClass('bottom') : null;
|
|
|
164
|
+// }
|
|
|
165
|
+
|
|
|
166
|
+// num = $goodList.find('.good-info').length;
|
|
|
167
|
+
|
|
|
168
|
+// $goodList.append(data);
|
|
|
169
|
+
|
|
|
170
|
+// // 2015/10/31 fei.hong: 修复第一页分页不显示图片的问题
|
|
|
171
|
+// if (num === 0) {
|
|
|
172
|
+// lazyLoad($goodList.find('.good-info').find('img.lazy'));
|
|
|
173
|
+// } else {
|
|
|
174
|
+// lazyLoad($goodList.find('.good-info:gt(' + (num - 1) + ')').find('img.lazy'));
|
|
|
175
|
+// }
|
|
|
176
|
+
|
|
|
177
|
+// loading.hideLoadingMask();
|
|
|
178
|
+// page++;
|
|
|
179
|
+
|
|
|
180
|
+// $('.good-detail-text .name').each(function() {
|
|
|
181
|
+// var $this = $(this),
|
|
|
182
|
+// $title = $this.find('a');
|
|
|
183
|
+
|
|
|
184
|
+// $title[0].mlellipsis(2);
|
|
|
185
|
+// });
|
|
|
186
|
+
|
|
|
187
|
+// // 为您优选埋点 start
|
|
|
188
|
+// PRDID = [];
|
|
|
189
|
+// $(data).closest('.good-info').each(function() {
|
|
|
190
|
+// PRDID.push($(this).data('id'));
|
|
|
191
|
+// });
|
|
|
192
|
+// window.givePoint({
|
|
|
193
|
+// REC_POSE: RECPOSE,
|
|
|
194
|
+// PRD_ID: PRDID.join(','),
|
|
|
195
|
+// PRD_NUM: $(data).closest('.good-info').length,
|
|
|
196
|
+// ACTION_ID: 0,
|
|
|
197
|
+// page_num: page
|
|
|
198
|
+// });
|
|
|
199
|
+
|
|
|
200
|
+// // 为您优选埋点 end
|
|
|
201
|
+// },
|
|
|
202
|
+// error: function() {
|
|
|
203
|
+// tip.show('网络断开连接了~');
|
|
|
204
|
+// searching = false;
|
|
|
205
|
+// loading.hideLoadingMask();
|
|
|
206
|
+// }
|
|
|
207
|
+// });
|
|
|
208
|
+// }
|
|
|
209
|
+
|
|
|
210
|
+// $('.maybe-like p').on('touchstart', function() {
|
|
|
211
|
+// search();
|
|
|
212
|
+// });
|
|
|
213
|
+
|
|
|
214
|
+// function scrollHandler() {
|
|
|
215
|
+// if ($(window).scrollTop() + winH >= $(document).height() - 200) {
|
|
|
216
|
+// search();
|
|
|
217
|
+// }
|
|
|
218
|
+// }
|
|
|
219
|
+
|
|
|
220
|
+// // 优惠券页面直接加载你可能喜欢。add by @zhaobiao
|
|
|
221
|
+// if (specificGender) {
|
|
|
222
|
+// search();
|
|
|
223
|
+// }
|
|
|
224
|
+
|
|
|
225
|
+// // srcoll to load more
|
|
|
226
|
+// $(window).scroll(function() {
|
|
|
227
|
+// window.requestAnimationFrame(scrollHandler);
|
|
|
228
|
+// });
|
|
|
229
|
+
|
|
|
230
|
+// // 为您优选埋点
|
|
|
231
|
+// $('.maybe-like .goods-list').on('click', 'a', function() {
|
|
|
232
|
+
|
|
|
233
|
+// var pageNum = 50;
|
|
|
234
|
+
|
|
|
235
|
+// index = $(this).closest('.good-info').index() + 1;
|
|
|
236
|
+
|
|
|
237
|
+// window.givePoint({
|
|
|
238
|
+// REC_POSE: RECPOSE,
|
|
|
239
|
+// PRD_ID: $(this).closest('.good-info').data('id'),
|
|
|
240
|
+// PRD_NUM: index % pageNum === 0 ? pageNum : index % pageNum,
|
|
|
241
|
+// ACTION_ID: 1,
|
|
|
242
|
+// page_num: Math.ceil(index / pageNum)
|
|
|
243
|
+// });
|
|
|
244
|
+// return true;
|
|
|
245
|
+// });
|
|
|
246
|
+// };
|
|
|
247
|
+
|
|
|
248
|
+
|
|
|
249
|
+/**
|
|
|
250
|
+ * “你可能喜欢”模块JS
|
|
|
251
|
+ * @author: liangzhifeng<zhifeng.liang@yoho.cn>
|
|
|
252
|
+ * @date: 2015/10/12
|
|
|
253
|
+ */
|
|
|
254
|
+
|
7
|
module.exports = function(specificGender) {
|
255
|
module.exports = function(specificGender) {
|
8
|
var $ = require('yoho-jquery'),
|
256
|
var $ = require('yoho-jquery'),
|
9
|
Hammer = require('yoho-hammer'),
|
257
|
Hammer = require('yoho-hammer'),
|
|
@@ -20,37 +268,55 @@ module.exports = function(specificGender) { |
|
@@ -20,37 +268,55 @@ module.exports = function(specificGender) { |
20
|
gender = null,
|
268
|
gender = null,
|
21
|
num,
|
269
|
num,
|
22
|
url,
|
270
|
url,
|
23
|
- RECPOSE = '';
|
271
|
+ RECPOSE = '110001';
|
24
|
|
272
|
|
25
|
- // The kidsType can be specified by the parameter. Add by @ZhaoBiao
|
273
|
+ //The kidsType can be specified by the parameter. Add by @ZhaoBiao
|
26
|
var kidsType = specificGender === 'kids' || $('.mobile-wrap').hasClass('kids-wrap') ? true : false,
|
274
|
var kidsType = specificGender === 'kids' || $('.mobile-wrap').hasClass('kids-wrap') ? true : false,
|
27
|
lifestyleType = specificGender === 'lifestyle' ||
|
275
|
lifestyleType = specificGender === 'lifestyle' ||
|
28
|
- $('.mobile-wrap').hasClass('lifestyle-wrap') ? true : false;
|
|
|
29
|
-
|
276
|
+ $('.mobile-wrap').hasClass('lifestyle-wrap') ? true : false,
|
|
|
277
|
+ yohoCoinType = $('.coin').length ? true : false,
|
|
|
278
|
+ logisticType = $('.logistic-page').length ? true : false;
|
30
|
var $curNav,
|
279
|
var $curNav,
|
31
|
index,
|
280
|
index,
|
32
|
$navList = $('#maybe-like-nav');
|
281
|
$navList = $('#maybe-like-nav');
|
33
|
|
282
|
|
34
|
var $footer;
|
283
|
var $footer;
|
35
|
|
284
|
|
36
|
- var bottomBannerLoaded;
|
|
|
37
|
-
|
|
|
38
|
ellipsis.init();
|
285
|
ellipsis.init();
|
39
|
|
286
|
|
40
|
- // ajax url
|
287
|
+ //ajax url
|
41
|
if (kidsType) {
|
288
|
if (kidsType) {
|
|
|
289
|
+
|
42
|
url = '/product/recom/maylikekids';
|
290
|
url = '/product/recom/maylikekids';
|
43
|
} else if (lifestyleType) {
|
291
|
} else if (lifestyleType) {
|
44
|
|
292
|
|
45
|
- // 有货币页面加载男生首页的数据
|
|
|
46
|
- url = specificGender === 'lifestyle' ? '/product/recom/maylike?gender=1,3' : '/product/recom/maylikelife';
|
293
|
+ //有货币页面加载男生首页的数据
|
|
|
294
|
+ url = specificGender === 'lifestyle' ? '/product/recom/maylike?gender=1,3&rec_pos=100001' : '/product/recom/maylikelife';
|
|
|
295
|
+ } else if (yohoCoinType) {
|
|
|
296
|
+
|
|
|
297
|
+ gender = (specificGender === 'boys' || $('.mobile-wrap').hasClass('boys-wrap')) ?
|
|
|
298
|
+ '1,3&rec_pos=100009' : '2,3&rec_pos=100009',
|
|
|
299
|
+ url = '/product/recom/maylike?gender=' + gender;
|
|
|
300
|
+ RECPOSE = 110009;
|
|
|
301
|
+
|
|
|
302
|
+ } else if (logisticType) { //物流页面
|
|
|
303
|
+ gender = (specificGender === 'boys' || $('.mobile-wrap').hasClass('boys-wrap')) ?
|
|
|
304
|
+ '1,3&rec_pos=100006' : '2,3&rec_pos=100006',
|
|
|
305
|
+ url = '/product/recom/maylike?gender=' + gender;
|
|
|
306
|
+ RECPOSE = 110006;
|
|
|
307
|
+
|
47
|
} else {
|
308
|
} else {
|
48
|
gender = (specificGender === 'boys' || $('.mobile-wrap').hasClass('boys-wrap')) ?
|
309
|
gender = (specificGender === 'boys' || $('.mobile-wrap').hasClass('boys-wrap')) ?
|
49
|
- '1,3' : '2,3';
|
310
|
+ '1,3&rec_pos=100001' : '2,3&rec_pos=100002',
|
50
|
url = '/product/recom/maylike?gender=' + gender;
|
311
|
url = '/product/recom/maylike?gender=' + gender;
|
51
|
}
|
312
|
}
|
52
|
|
313
|
|
53
|
- // 首页男生和女生,推荐位ID,埋点
|
314
|
+ //日韩馆-你可能喜欢的
|
|
|
315
|
+ if ($('.mobile-wrap').hasClass('yoho-channel-page')) {
|
|
|
316
|
+ url = '/product/recom/newPreference?template_id=' + $.queryString().template_id;
|
|
|
317
|
+ }
|
|
|
318
|
+
|
|
|
319
|
+ //首页男生和女生,推荐位ID,埋点
|
54
|
if (window.location.pathname === '/boys') {
|
320
|
if (window.location.pathname === '/boys') {
|
55
|
RECPOSE = 110001;
|
321
|
RECPOSE = 110001;
|
56
|
} else if (window.location.pathname === '/girls') {
|
322
|
} else if (window.location.pathname === '/girls') {
|
|
@@ -60,7 +326,7 @@ module.exports = function(specificGender) { |
|
@@ -60,7 +326,7 @@ module.exports = function(specificGender) { |
60
|
$curNav = $navList.children('.focus');
|
326
|
$curNav = $navList.children('.focus');
|
61
|
|
327
|
|
62
|
if (lifestyleType) {
|
328
|
if (lifestyleType) {
|
63
|
- navHammer = $navList[0] ? new Hammer($navList[0]) : null;
|
329
|
+ navHammer = $navList[0] ? new Hammer($navList[0]) : undefined;
|
64
|
if (navHammer) {
|
330
|
if (navHammer) {
|
65
|
navHammer.on('tap', function(e) {
|
331
|
navHammer.on('tap', function(e) {
|
66
|
var $this = $(e.target).closest('li'),
|
332
|
var $this = $(e.target).closest('li'),
|
|
@@ -83,7 +349,7 @@ module.exports = function(specificGender) { |
|
@@ -83,7 +349,7 @@ module.exports = function(specificGender) { |
83
|
|
349
|
|
84
|
$curNav = $this;
|
350
|
$curNav = $this;
|
85
|
|
351
|
|
86
|
- $(document).trigger('scroll'); // Trigger lazyLoad
|
352
|
+ $(document).trigger('scroll'); //Trigger lazyLoad
|
87
|
e.srcEvent.stopPropagation();
|
353
|
e.srcEvent.stopPropagation();
|
88
|
});
|
354
|
});
|
89
|
}
|
355
|
}
|
|
@@ -99,7 +365,7 @@ module.exports = function(specificGender) { |
|
@@ -99,7 +365,7 @@ module.exports = function(specificGender) { |
99
|
|
365
|
|
100
|
loading.showLoadingMask();
|
366
|
loading.showLoadingMask();
|
101
|
|
367
|
|
102
|
- // num = $goodList.find('.good-info').length;
|
368
|
+ //num = $goodList.find('.good-info').length;
|
103
|
$.ajax({
|
369
|
$.ajax({
|
104
|
type: 'GET',
|
370
|
type: 'GET',
|
105
|
url: url,
|
371
|
url: url,
|
|
@@ -108,40 +374,36 @@ module.exports = function(specificGender) { |
|
@@ -108,40 +374,36 @@ module.exports = function(specificGender) { |
108
|
},
|
374
|
},
|
109
|
success: function(data) {
|
375
|
success: function(data) {
|
110
|
var PRDID = [];
|
376
|
var PRDID = [];
|
111
|
-
|
|
|
112
|
if (data === ' ') {
|
377
|
if (data === ' ') {
|
|
|
378
|
+ searching = false;
|
113
|
loading.hideLoadingMask();
|
379
|
loading.hideLoadingMask();
|
114
|
|
380
|
|
115
|
// 有货币页面不加载底部
|
381
|
// 有货币页面不加载底部
|
116
|
if (gender && !specificGender) {
|
382
|
if (gender && !specificGender) {
|
117
|
- if (bottomBannerLoaded) {
|
|
|
118
|
- return;
|
383
|
+ if (gender === '1,3') {
|
|
|
384
|
+ url = '/boys/bottomBanner';
|
|
|
385
|
+ } else {
|
|
|
386
|
+ url = '/girls/bottomBanner';
|
119
|
}
|
387
|
}
|
120
|
- url = '/channel/bottomBanner';
|
|
|
121
|
$.ajax({
|
388
|
$.ajax({
|
122
|
type: 'GET',
|
389
|
type: 'GET',
|
123
|
url: url,
|
390
|
url: url,
|
124
|
- data: {
|
|
|
125
|
- gender: gender
|
|
|
126
|
- },
|
|
|
127
|
- success: function(res) {
|
|
|
128
|
- res = res.data;
|
|
|
129
|
- bottomBannerLoaded = true;
|
|
|
130
|
- if (res && res.img) {
|
391
|
+ success: function(data) {
|
|
|
392
|
+ if (data && data.img) {
|
131
|
$('#load-more-img').show();
|
393
|
$('#load-more-img').show();
|
132
|
- $('#load-more-img a').attr('href', res.url);
|
|
|
133
|
- $('#load-more-img a > img').attr('src', res.img);
|
394
|
+ $('#load-more-img a').attr('href', data.url);
|
|
|
395
|
+ $('#load-more-img a > img').attr('src', data.img);
|
134
|
}
|
396
|
}
|
|
|
397
|
+ },
|
|
|
398
|
+ error: function() {
|
135
|
}
|
399
|
}
|
136
|
});
|
400
|
});
|
137
|
|
401
|
|
138
|
}
|
402
|
}
|
139
|
return;
|
403
|
return;
|
140
|
- } else {
|
|
|
141
|
- searching = false;
|
|
|
142
|
}
|
404
|
}
|
143
|
|
405
|
|
144
|
- // 加载到数据后,去除bottom样式,使得footer能够随着页面长度的增加改变位置
|
406
|
+ //加载到数据后,去除bottom样式,使得footer能够随着页面长度的增加改变位置
|
145
|
if (data.length > 1) {
|
407
|
if (data.length > 1) {
|
146
|
$footer ? null : $footer = $('#yoho-footer');
|
408
|
$footer ? null : $footer = $('#yoho-footer');
|
147
|
$footer.hasClass('bottom') ? $footer.removeClass('bottom') : null;
|
409
|
$footer.hasClass('bottom') ? $footer.removeClass('bottom') : null;
|
|
@@ -158,6 +420,7 @@ module.exports = function(specificGender) { |
|
@@ -158,6 +420,7 @@ module.exports = function(specificGender) { |
158
|
lazyLoad($goodList.find('.good-info:gt(' + (num - 1) + ')').find('img.lazy'));
|
420
|
lazyLoad($goodList.find('.good-info:gt(' + (num - 1) + ')').find('img.lazy'));
|
159
|
}
|
421
|
}
|
160
|
|
422
|
|
|
|
423
|
+ searching = false;
|
161
|
loading.hideLoadingMask();
|
424
|
loading.hideLoadingMask();
|
162
|
page++;
|
425
|
page++;
|
163
|
|
426
|
|
|
@@ -168,20 +431,18 @@ module.exports = function(specificGender) { |
|
@@ -168,20 +431,18 @@ module.exports = function(specificGender) { |
168
|
$title[0].mlellipsis(2);
|
431
|
$title[0].mlellipsis(2);
|
169
|
});
|
432
|
});
|
170
|
|
433
|
|
171
|
- // 为您优选埋点 start
|
|
|
172
|
- PRDID = [];
|
434
|
+ //为您优选埋点 start
|
173
|
$(data).closest('.good-info').each(function() {
|
435
|
$(data).closest('.good-info').each(function() {
|
174
|
PRDID.push($(this).data('id'));
|
436
|
PRDID.push($(this).data('id'));
|
175
|
});
|
437
|
});
|
176
|
window.givePoint({
|
438
|
window.givePoint({
|
177
|
- REC_POSE: RECPOSE,
|
|
|
178
|
- PRD_ID: PRDID.join(','),
|
|
|
179
|
- PRD_NUM: $(data).closest('.good-info').length,
|
|
|
180
|
- ACTION_ID: 0,
|
|
|
181
|
- page_num: page
|
439
|
+ 'REC_POSE': RECPOSE,
|
|
|
440
|
+ 'PRD_ID': PRDID.join(','),
|
|
|
441
|
+ 'PRD_NUM': $(data).closest('.good-info').length,
|
|
|
442
|
+ 'ACTION_ID': 0,
|
|
|
443
|
+ 'page_num': RECPOSE === 110009 ? 1 : page
|
182
|
});
|
444
|
});
|
183
|
-
|
|
|
184
|
- // 为您优选埋点 end
|
445
|
+ //为您优选埋点 end
|
185
|
},
|
446
|
},
|
186
|
error: function() {
|
447
|
error: function() {
|
187
|
tip.show('网络断开连接了~');
|
448
|
tip.show('网络断开连接了~');
|
|
@@ -191,7 +452,7 @@ module.exports = function(specificGender) { |
|
@@ -191,7 +452,7 @@ module.exports = function(specificGender) { |
191
|
});
|
452
|
});
|
192
|
}
|
453
|
}
|
193
|
|
454
|
|
194
|
- $('.maybe-like p').on('touchstart', function() {
|
455
|
+ $('.maybe-like p').on('touchstart', function(e) {
|
195
|
search();
|
456
|
search();
|
196
|
});
|
457
|
});
|
197
|
|
458
|
|
|
@@ -206,24 +467,21 @@ module.exports = function(specificGender) { |
|
@@ -206,24 +467,21 @@ module.exports = function(specificGender) { |
206
|
search();
|
467
|
search();
|
207
|
}
|
468
|
}
|
208
|
|
469
|
|
209
|
- // srcoll to load more
|
470
|
+ //srcoll to load more
|
210
|
$(window).scroll(function() {
|
471
|
$(window).scroll(function() {
|
211
|
window.requestAnimationFrame(scrollHandler);
|
472
|
window.requestAnimationFrame(scrollHandler);
|
212
|
});
|
473
|
});
|
213
|
|
474
|
|
214
|
- // 为您优选埋点
|
475
|
+ //为您优选埋点 http://redmine.yoho.cn/issues/10116
|
215
|
$('.maybe-like .goods-list').on('click', 'a', function() {
|
476
|
$('.maybe-like .goods-list').on('click', 'a', function() {
|
216
|
-
|
|
|
217
|
- var pageNum = 50;
|
|
|
218
|
-
|
|
|
219
|
- index = $(this).closest('.good-info').index() + 1;
|
|
|
220
|
-
|
477
|
+ var index = $(this).closest('.good-info').index() + 1,
|
|
|
478
|
+ pageNum = 50;
|
221
|
window.givePoint({
|
479
|
window.givePoint({
|
222
|
- REC_POSE: RECPOSE,
|
|
|
223
|
- PRD_ID: $(this).closest('.good-info').data('id'),
|
|
|
224
|
- PRD_NUM: index % pageNum === 0 ? pageNum : index % pageNum,
|
|
|
225
|
- ACTION_ID: 1,
|
|
|
226
|
- page_num: Math.ceil(index / pageNum)
|
480
|
+ 'REC_POSE': RECPOSE,
|
|
|
481
|
+ 'PRD_ID': $(this).closest('.good-info').data('id'),
|
|
|
482
|
+ 'PRD_NUM': index % pageNum === 0 ? pageNum : index % pageNum,
|
|
|
483
|
+ 'ACTION_ID': 1,
|
|
|
484
|
+ 'page_num': Math.ceil(index / pageNum)
|
227
|
});
|
485
|
});
|
228
|
return true;
|
486
|
return true;
|
229
|
});
|
487
|
});
|