...
|
...
|
@@ -17,28 +17,10 @@ var $recommendForYou = $('.recommend-for-you'), |
|
|
var RECID = (new Date().getTime() + '_H5_YOHOBUY_' + Math.floor(Math.random() * 1000000 + 1000000) +
|
|
|
'_' + Math.floor(Math.random() * 1000000 + 1000000));
|
|
|
|
|
|
var C_ID, goodid, goodIds = [],
|
|
|
var goodid,
|
|
|
goodIds = [],
|
|
|
prdLoad;
|
|
|
|
|
|
C_ID = window._ChannelVary[window.cookie('_Channel')];
|
|
|
|
|
|
function yasRequest(PRD_ID, PRD_NUM, ACTION_ID) {
|
|
|
if (window._yas && window._yas.sendCustomInfo) {
|
|
|
window._yas.sendCustomInfo({
|
|
|
op: 'YB_CHOOSE_FOR_YOU_Y',
|
|
|
param: JSON.stringify({
|
|
|
REC_POSE: 100013,
|
|
|
REC_ID: RECID,
|
|
|
PRD_ID: PRD_ID,
|
|
|
PRD_NUM: PRD_NUM,
|
|
|
C_ID: C_ID,
|
|
|
ACTION_ID: ACTION_ID,
|
|
|
PAGE_NUM: 1
|
|
|
})
|
|
|
}, true);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function request() {
|
|
|
if (requesting || end) {
|
|
|
return;
|
...
|
...
|
@@ -48,13 +30,14 @@ function request() { |
|
|
|
|
|
if (preferenceUrl) {
|
|
|
$.get(preferenceUrl).then(function(html) {
|
|
|
if (typeof html !== 'string') { return; }
|
|
|
if (typeof html !== 'string') {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
$recommendForYou.html(html.replace(/https?:/gi, '')).show();
|
|
|
lazyLoad($recommendForYou.find('img.lazy'));
|
|
|
|
|
|
// 为你优选埋点- 加载
|
|
|
|
|
|
$('.goods-container').find('.good-info').each(function() {
|
|
|
goodid = $(this).data('good-id');
|
|
|
|
...
|
...
|
@@ -65,14 +48,28 @@ function request() { |
|
|
|
|
|
prdLoad = JSON.stringify(goodIds).replace(/\[|\]|/g, '');
|
|
|
|
|
|
yasRequest(prdLoad, goodIds.length, 0);
|
|
|
window.givePoint({
|
|
|
REC_POSE: 100013,
|
|
|
REC_ID: RECID,
|
|
|
PRD_ID: prdLoad,
|
|
|
PRD_NUM: goodIds.length,
|
|
|
ACTION_ID: 0,
|
|
|
PAGE_NUM: 1
|
|
|
});
|
|
|
|
|
|
// 点击商品
|
|
|
$('.good-info').on('click', function() {
|
|
|
var PRD_ID = $(this).data('good-id'),
|
|
|
PRD_NUM = $(this).index();
|
|
|
|
|
|
yasRequest(PRD_ID, PRD_NUM, 1);
|
|
|
window.givePoint({
|
|
|
REC_POSE: 100013,
|
|
|
REC_ID: RECID,
|
|
|
PRD_ID: PRD_ID,
|
|
|
PRD_NUM: PRD_NUM,
|
|
|
ACTION_ID: 1,
|
|
|
PAGE_NUM: 1
|
|
|
});
|
|
|
|
|
|
// return false;
|
|
|
});
|
...
|
...
|
|