Authored by 郝肖肖

个人中心为您优选埋点

@@ -50,10 +50,13 @@ class HelperHome @@ -50,10 +50,13 @@ class HelperHome
50 { 50 {
51 $result = array(); 51 $result = array();
52 foreach ($product as $key => $val) { 52 foreach ($product as $key => $val) {
53 - $result[$key]['href'] = Helpers::getUrlBySkc($val['product_id'], $val['goods_list'][0]['product_skc'], $val['cn_alphabet']);  
54 - $result[$key]['thumb'] = (isset($val['default_images']) && $val['default_images'])?Images::getImageUrl($val['default_images'], 400, 500):'';  
55 - $result[$key]['name'] = $val['product_name'];  
56 - $result[$key]['price'] = $val['sales_price']; 53 + $result[] = array(
  54 + 'href' => Helpers::getUrlBySkc($val['product_id'], $val['goods_list'][0]['product_skc'], $val['cn_alphabet']),
  55 + 'thumb' => (isset($val['default_images']) && $val['default_images'])?Images::getImageUrl($val['default_images'], 400, 500) : '',
  56 + 'name' => $val['product_name'],
  57 + 'price' => $val['sales_price'],
  58 + 'productId' => $val['product_id'],
  59 + );
57 } 60 }
58 return $result; 61 return $result;
59 } 62 }
@@ -97,7 +97,7 @@ @@ -97,7 +97,7 @@
97 <ul class="clearfix"> 97 <ul class="clearfix">
98 {{# recommend}} 98 {{# recommend}}
99 <li> 99 <li>
100 - <a href="{{href}}"> 100 + <a href="{{href}}" data-id='{{productId}}'>
101 <img class="thumb" src="{{thumb}}"> 101 <img class="thumb" src="{{thumb}}">
102 <p class="name">{{name}}</p> 102 <p class="name">{{name}}</p>
103 <span class="price">¥{{price}}</span> 103 <span class="price">¥{{price}}</span>
@@ -68,7 +68,8 @@ function pageChange(self, $ul, page, itemWith, curPage, num) { @@ -68,7 +68,8 @@ function pageChange(self, $ul, page, itemWith, curPage, num) {
68 naItemWith = $naUl.children('li:last-child').outerWidth(), 68 naItemWith = $naUl.children('li:last-child').outerWidth(),
69 rcItemWith = $rcUl.children('li:last-child').outerWidth(), 69 rcItemWith = $rcUl.children('li:last-child').outerWidth(),
70 naCurPage = 1, 70 naCurPage = 1,
71 - rcCurPage = 1; 71 + rcCurPage = 1,
  72 + PRDID = [];
72 73
73 $naUl.width($naUl.width() * naPage); 74 $naUl.width($naUl.width() * naPage);
74 $rcUl.width($rcUl.width() * rcPage); 75 $rcUl.width($rcUl.width() * rcPage);
@@ -101,4 +102,30 @@ function pageChange(self, $ul, page, itemWith, curPage, num) { @@ -101,4 +102,30 @@ function pageChange(self, $ul, page, itemWith, curPage, num) {
101 pageChange($this, $rcUl, rcPage, rcItemWith, rcCurPage, 6); 102 pageChange($this, $rcUl, rcPage, rcItemWith, rcCurPage, 6);
102 } 103 }
103 }); 104 });
  105 +
  106 + //为您优选埋点 start
  107 + $rcUl.find('li').each(function() {
  108 + PRDID.push($(this).find('a').data('id'));
  109 + });
  110 +
  111 + window.givePoint({
  112 + 'REC_POSE': 120004,
  113 + 'PRD_ID': PRDID.join(','),
  114 + 'PRD_NUM': $rcUl.find('li').length,
  115 + 'ACTION_ID': 0,
  116 + 'page_num': 1
  117 + });
  118 +
  119 + $rcUl.find('li a').unbind('click').bind('click', function() {
  120 + window.givePoint({
  121 + 'REC_POSE': 120004,
  122 + 'PRD_ID': $(this).data('id'),
  123 + 'PRD_NUM': $(this).closest('li').index(),
  124 + 'ACTION_ID': 1,
  125 + 'page_num': 1
  126 + });
  127 + return true;
  128 + });
  129 + //为您优选埋点 end
  130 +
104 }()); 131 }());
@@ -7,13 +7,13 @@ define('SUB_DOMAIN', '.yohobuy.com'); // 子域名后缀 @@ -7,13 +7,13 @@ define('SUB_DOMAIN', '.yohobuy.com'); // 子域名后缀
7 define('USE_CACHE', false); // 缓存的开关 7 define('USE_CACHE', false); // 缓存的开关
8 define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录 8 define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录
9 define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录 9 define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录
10 -defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'developer'); 10 +defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'production');
11 11
12 -define('API_URL', 'http://testapi.yoho.cn:28078/');  
13 -define('SERVICE_URL', 'http://testservice.yoho.cn:28077/'); 12 +define('API_URL', 'http://api.yoho.yohoops.org/');
  13 +define('SERVICE_URL', 'http://service.yoho.yohoops.org/');
14 define('YOHOBUY_URL', 'http://www.yohobuy.com/'); 14 define('YOHOBUY_URL', 'http://www.yohobuy.com/');
15 -define('SERVICE_NOTIFY', 'http://testservice.yoho.cn:28077/');  
16 -define('API_OLD', 'http://test2.open.yohobuy.com/'); 15 +define('SERVICE_NOTIFY', 'http://service.yoho.cn/');
  16 +define('API_OLD', 'http://api2.open.yohobuy.com/');
17 17
18 $application = new Application(APPLICATION_PATH . '/configs/application.developer.ini'); 18 $application = new Application(APPLICATION_PATH . '/configs/application.developer.ini');
19 $application->bootstrap()->run(); 19 $application->bootstrap()->run();