Authored by whb

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy.git into develop

@@ -720,28 +720,34 @@ function actionNav() { @@ -720,28 +720,34 @@ function actionNav() {
720 }); 720 });
721 } 721 }
722 722
  723 +/**
  724 + * 获取三级导航的tip图标
  725 + * @return {[type]} [description]
  726 + */
723 function actionTipPic() { 727 function actionTipPic() {
724 - var $content_code = '' 728 + var tipscode = {};
  729 + var $contentcode = '';
725 var serverApi = 'http://www.yohobuy.com/common/getbanner?content_code='; 730 var serverApi = 'http://www.yohobuy.com/common/getbanner?content_code=';
726 var $img = ''; 731 var $img = '';
727 var $title = ''; 732 var $title = '';
728 var $link = ''; 733 var $link = '';
729 734
730 - $(document).on('mouseenter','.sub-nav-item',function(){  
731 - $content_code = $(this).find('.showdetail').attr('data-code');  
732 - if($content_code){ 735 + $(document).on('mouseenter', '.sub-nav-item', function() {
  736 + $contentcode = $(this).find('.showdetail').attr('data-code');
  737 + if ($contentcode) {
  738 + if (!tipscode[$contentcode]) {
  739 + tipscode[$contentcode] = $contentcode;
733 $img = $(this).find('.showdetail').find('img'); 740 $img = $(this).find('.showdetail').find('img');
734 $title = $(this).find('.showdetail').find('.title'); 741 $title = $(this).find('.showdetail').find('.title');
735 $link = $(this).find('.showdetail').find('a'); 742 $link = $(this).find('.showdetail').find('a');
736 - $.get(serverApi + $content_code+'&width=337&height=250&client_type=web', function(rsdata) {  
737 - $img.attr('src',rsdata.data.src);  
738 - $link.attr('href',rsdata.data.url); 743 + $.get(serverApi + $contentcode + '&width=337&height=250&client_type=web', function(rsdata) {
  744 + $img.attr('src', rsdata.data.src);
  745 + $link.attr('href', rsdata.data.url);
739 $title.text(rsdata.data.title); 746 $title.text(rsdata.data.title);
740 }, 'jsonp'); 747 }, 'jsonp');
741 } 748 }
742 -  
743 - })  
744 - 749 + }
  750 + });
745 } 751 }
746 752
747 /** 753 /**
@@ -1348,7 +1354,7 @@ function actionLoginInfo() { @@ -1348,7 +1354,7 @@ function actionLoginInfo() {
1348 */ 1354 */
1349 function init() { 1355 function init() {
1350 actionNav(); //处理导航 1356 actionNav(); //处理导航
1351 - actionTipPic();//鼠标移入后查询 1357 + actionTipPic(); //鼠标移入后查询
1352 actionExeTemplate(); //处理模板 1358 actionExeTemplate(); //处理模板
1353 actionInitCookie(); //初始化cookie 1359 actionInitCookie(); //初始化cookie
1354 actionExeCookieMap(); //格式化cookie 1360 actionExeCookieMap(); //格式化cookie