Authored by 郝肖肖

购物车为您优选埋点

@@ -12,8 +12,38 @@ var Swiper = require('yoho.iswiper'), @@ -12,8 +12,38 @@ var Swiper = require('yoho.iswiper'),
12 var $recommendForYou = $('.recommend-for-you'); 12 var $recommendForYou = $('.recommend-for-you');
13 13
14 $.get('/product/recommend-for-you/cart').then(function(html) { 14 $.get('/product/recommend-for-you/cart').then(function(html) {
  15 + var PRDID =[];
  16 +
15 $recommendForYou.html(html).show(); 17 $recommendForYou.html(html).show();
16 lazyLoad($('img.lazy')); 18 lazyLoad($('img.lazy'));
  19 +
  20 + //为您优选埋点 http://redmine.yoho.cn/issues/10116
  21 + $('.recommend-for-you .good-info').each(function() {
  22 + PRDID.push($(this).data('id'));
  23 + });
  24 +
  25 + window.givePoint({
  26 + 'REC_POSE': 110003,
  27 + 'PRD_ID': PRDID.join(','),
  28 + 'PRD_NUM': $('.recommend-for-you .good-info').length,
  29 + 'ACTION_ID': 0,
  30 + 'page_num': 1
  31 + });
  32 +
  33 + $('.recommend-for-you .good-info').on('click', 'a', function() {
  34 + var index = $(this).closest('.good-info').index() + 1;
  35 +
  36 + window.givePoint({
  37 + 'REC_POSE': 110003,
  38 + 'PRD_ID': $(this).closest('.good-info').data('id'),
  39 + 'PRD_NUM': index,
  40 + 'ACTION_ID': 1,
  41 + 'page_num': 1
  42 + });
  43 +
  44 + return true;
  45 + });
  46 +
17 }).fail(function() { 47 }).fail(function() {
18 $recommendForYou.hide(); 48 $recommendForYou.hide();
19 }); 49 });