...
|
...
|
@@ -10,49 +10,51 @@ var $ = require('yoho-jquery'), |
|
|
|
|
|
var $recommendForYou = $('.recommend-for-you');
|
|
|
|
|
|
$.get('/product/recommend-for-you/userCenter').then(function(html) {
|
|
|
var PRDID = [];
|
|
|
setTimeout(function () {
|
|
|
$.get('/product/recommend-for-you/userCenter').then(function (html) {
|
|
|
var PRDID = [];
|
|
|
|
|
|
$recommendForYou.html(html);
|
|
|
$recommendForYou.html(html);
|
|
|
|
|
|
|
|
|
lazyLoad($('img.lazy'));
|
|
|
lazyLoad($('img.lazy'));
|
|
|
|
|
|
// 为您优选埋点 http://redmine.yoho.cn/issues/10116
|
|
|
$recommendForYou.find('.good-info').each(function() {
|
|
|
PRDID.push($(this).data('id'));
|
|
|
});
|
|
|
|
|
|
var $recommendSonLen = $recommendForYou.find('.good-info').length;
|
|
|
// 为您优选埋点 http://redmine.yoho.cn/issues/10116
|
|
|
$recommendForYou.find('.good-info').each(function () {
|
|
|
PRDID.push($(this).data('id'));
|
|
|
});
|
|
|
|
|
|
if ($recommendSonLen === 0) {
|
|
|
$recommendForYou.hide();
|
|
|
} else {
|
|
|
$recommendForYou.show();
|
|
|
}
|
|
|
|
|
|
window.givePoint({
|
|
|
REC_POSE: 110004,
|
|
|
PRD_ID: PRDID.join(','),
|
|
|
PRD_NUM: $('.recommend-for-you .good-info').length,
|
|
|
ACTION_ID: 0,
|
|
|
PAGE_NUM: 1
|
|
|
});
|
|
|
var $recommendSonLen = $recommendForYou.find('.good-info').length;
|
|
|
|
|
|
$recommendForYou.find('.good-info').on('click', 'a', function() {
|
|
|
var index = $(this).closest('.good-info').index() + 1;
|
|
|
if ($recommendSonLen === 0) {
|
|
|
$recommendForYou.hide();
|
|
|
} else {
|
|
|
$recommendForYou.show();
|
|
|
}
|
|
|
|
|
|
window.givePoint({
|
|
|
REC_POSE: 110004,
|
|
|
PRD_ID: $(this).closest('.good-info').data('id'),
|
|
|
PRD_NUM: index,
|
|
|
ACTION_ID: 1,
|
|
|
PRD_ID: PRDID.join(','),
|
|
|
PRD_NUM: $('.recommend-for-you .good-info').length,
|
|
|
ACTION_ID: 0,
|
|
|
PAGE_NUM: 1
|
|
|
});
|
|
|
|
|
|
return true;
|
|
|
});
|
|
|
$recommendForYou.find('.good-info').on('click', 'a', function () {
|
|
|
var index = $(this).closest('.good-info').index() + 1;
|
|
|
|
|
|
}).fail(function() {
|
|
|
$recommendForYou.hide();
|
|
|
}); |
|
|
window.givePoint({
|
|
|
REC_POSE: 110004,
|
|
|
PRD_ID: $(this).closest('.good-info').data('id'),
|
|
|
PRD_NUM: index,
|
|
|
ACTION_ID: 1,
|
|
|
PAGE_NUM: 1
|
|
|
});
|
|
|
|
|
|
return true;
|
|
|
});
|
|
|
|
|
|
}).fail(function () {
|
|
|
$recommendForYou.hide();
|
|
|
});
|
|
|
}, 500); |
...
|
...
|
|