Authored by 郭成尧

'为你优选'

@@ -23,7 +23,8 @@ exports.index = (req, res, next) => { @@ -23,7 +23,8 @@ exports.index = (req, res, next) => {
23 23
24 if (result) { 24 if (result) {
25 res.render('index', Object.assign(result, { 25 res.render('index', Object.assign(result, {
26 - pageHeader: headerData 26 + pageHeader: headerData,
  27 + pageFooter: true
27 })); 28 }));
28 } 29 }
29 }).catch(next); 30 }).catch(next);
  1 +require('./recommend-for-you-user-center');
  1 +/**
  2 + * 为您优选
  3 + * @author: bikai<kai.bi@yoho.cn>
  4 + * @date: 2015/11/16
  5 + */
  6 +
  7 +
  8 +var $ = require('yoho-jquery'),
  9 + lazyLoad = require('yoho-jquery-lazyload');
  10 +
  11 +var $recommendForYou = $('.recommend-for-you');
  12 +
  13 +$.get('/product/recommend-for-you/userCenter').then(function (html) {
  14 + var PRDID = [];
  15 +
  16 + $recommendForYou.html(html).show();
  17 + lazyLoad($('img.lazy'));
  18 +
  19 + // 为您优选埋点 http://redmine.yoho.cn/issues/10116
  20 + $recommendForYou.find('.good-info').each(function () {
  21 + PRDID.push($(this).data('id'));
  22 + });
  23 +
  24 + window.givePoint({
  25 + 'REC_POSE': 110004,
  26 + 'PRD_ID': PRDID.join(','),
  27 + 'PRD_NUM': $('.recommend-for-you .good-info').length,
  28 + 'ACTION_ID': 0,
  29 + 'page_num': 1
  30 + });
  31 +
  32 + $recommendForYou.find('.good-info').on('click', 'a', function () {
  33 + var index = $(this).closest('.good-info').index() + 1;
  34 +
  35 + window.givePoint({
  36 + 'REC_POSE': 110004,
  37 + 'PRD_ID': $(this).closest('.good-info').data('id'),
  38 + 'PRD_NUM': index,
  39 + 'ACTION_ID': 1,
  40 + 'page_num': 1
  41 + });
  42 +
  43 + return true;
  44 + });
  45 +
  46 +}).fail(function () {
  47 + $recommendForYou.hide();
  48 +});