Authored by whb

index css js

@@ -472,7 +472,7 @@ function actionGoodsCart() { @@ -472,7 +472,7 @@ function actionGoodsCart() {
472 return false; 472 return false;
473 } 473 }
474 key = encodeURI(key); 474 key = encodeURI(key);
475 - $.get(searchDomain + '?callback=?&query=' + key, function(htmlData) { 475 + $.get(searchDomain + '?query=' + key, function(htmlData) {
476 $('.search-list').html(htmlData.data); 476 $('.search-list').html(htmlData.data);
477 queryNum = $('.search-list').children('li').length; 477 queryNum = $('.search-list').children('li').length;
478 listIndex = -1; 478 listIndex = -1;
@@ -486,7 +486,7 @@ function actionGoodsCart() { @@ -486,7 +486,7 @@ function actionGoodsCart() {
486 }, function() { 486 }, function() {
487 $(this).css('background-color', '#fff'); 487 $(this).css('background-color', '#fff');
488 }); 488 });
489 - }, 'jsonp'); 489 + }, 'json');
490 } 490 }
491 491
492 function getText(obj) { 492 function getText(obj) {
@@ -855,7 +855,7 @@ function createNewArray(obj) { @@ -855,7 +855,7 @@ function createNewArray(obj) {
855 var $that = $(this); 855 var $that = $(this);
856 var $alink = $that.find('a'); 856 var $alink = $that.find('a');
857 var _href = $alink.attr('href'); 857 var _href = $alink.attr('href');
858 - var hottag = $alink.attr('hot') === 'true' ? true : false; 858 + var hottag = $alink.attr('hot') === 'hot' ? true : false;
859 var objt = {}; 859 var objt = {};
860 860
861 if ($that.hasClass('category-title')) { 861 if ($that.hasClass('category-title')) {
@@ -1050,7 +1050,29 @@ function actionNav() { @@ -1050,7 +1050,29 @@ function actionNav() {
1050 }); 1050 });
1051 } 1051 }
1052 1052
  1053 +function actionTipPic() {
  1054 + var $content_code = ''
  1055 + var serverApi = 'http://www.yohobuy.com/common/getbanner?content_code=';
  1056 + var $img = '';
  1057 + var $title = '';
  1058 + var $link = '';
  1059 +
  1060 + $(document).on('mouseenter','.sub-nav-item',function(){
  1061 + $content_code = $(this).find('.showdetail').attr('data-code');
  1062 + if($content_code){
  1063 + $img = $(this).find('.showdetail').find('img');
  1064 + $title = $(this).find('.showdetail').find('.title');
  1065 + $link = $(this).find('.showdetail').find('a');
  1066 + $.get(serverApi + $content_code+'&width=337&height=250&client_type=web', function(rsdata) {
  1067 + $img.attr('src',rsdata.data.src);
  1068 + $link.attr('href',rsdata.data.url);
  1069 + $title.text(rsdata.data.title);
  1070 + }, 'jsonp');
  1071 + }
  1072 +
  1073 + })
1053 1074
  1075 +}
1054 1076
1055 /** 1077 /**
1056 * 查询跳转后保留关键字 1078 * 查询跳转后保留关键字
@@ -1502,7 +1524,7 @@ function actionExeTemplate() { @@ -1502,7 +1524,7 @@ function actionExeTemplate() {
1502 * @return {[type]} [description] 1524 * @return {[type]} [description]
1503 */ 1525 */
1504 function actionSearch() { 1526 function actionSearch() {
1505 - var searchDomain = 'http://search.yohobuy.com/api/suggest'; 1527 + var searchDomain = 'http://search.yohobuy.com/product/search/suggest';
1506 1528
1507 $('#query_key').search(searchDomain); 1529 $('#query_key').search(searchDomain);
1508 } 1530 }
@@ -1656,6 +1678,7 @@ function actionLoginInfo() { @@ -1656,6 +1678,7 @@ function actionLoginInfo() {
1656 */ 1678 */
1657 function init() { 1679 function init() {
1658 actionNav(); //处理导航 1680 actionNav(); //处理导航
  1681 + actionTipPic();//鼠标移入后查询
1659 actionExeTemplate(); //处理模板 1682 actionExeTemplate(); //处理模板
1660 actionInitCookie(); //初始化cookie 1683 actionInitCookie(); //初始化cookie
1661 actionExeCookieMap(); //格式化cookie 1684 actionExeCookieMap(); //格式化cookie
@@ -4782,17 +4805,19 @@ var $cr = $('#country-code-hide'), @@ -4782,17 +4805,19 @@ var $cr = $('#country-code-hide'),
4782 emailReg = /^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/, 4805 emailReg = /^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/,
4783 acAccount = [ 4806 acAccount = [
4784 ['qq.com', '163.com', '126.com', 'sina.com', 'gmail.com', 4807 ['qq.com', '163.com', '126.com', 'sina.com', 'gmail.com',
4785 - 'sohu.com', 'hotmail.com', '139.com', '189.com'], //数字顺序 4808 + 'sohu.com', 'hotmail.com', '139.com', '189.com'
  4809 + ], //数字顺序
4786 ['gmail.com', 'qq.com', '163.com', '126.com', 'sina.com', 4810 ['gmail.com', 'qq.com', '163.com', '126.com', 'sina.com',
4787 - 'sohu.com', 'hotmail.com', '139.com', '189.com'] //组合顺序 4811 + 'sohu.com', 'hotmail.com', '139.com', '189.com'
  4812 + ] //组合顺序
4788 ], 4813 ],
4789 $ccList = $('#country-code-list'), 4814 $ccList = $('#country-code-list'),
4790 $cc = $('#country-code'), 4815 $cc = $('#country-code'),
4791 $btn = $('#find-btn'), 4816 $btn = $('#find-btn'),
4792 $accErr = $('#account-err'), 4817 $accErr = $('#account-err'),
4793 $caErr = $('#captcha-err'), 4818 $caErr = $('#captcha-err'),
4794 - time, //timeout-id  
4795 - caCount = 4, //验证码位数 4819 + time, //timeout-id
  4820 + caCount = 4, //验证码位数
4796 hasPh = false, 4821 hasPh = false,
4797 hasCa = false; 4822 hasCa = false;
4798 4823
@@ -4810,8 +4835,9 @@ require("jquery.placeholder"); @@ -4810,8 +4835,9 @@ require("jquery.placeholder");
4810 4835
4811 function imgcode() { 4836 function imgcode() {
4812 var time = new Date(), 4837 var time = new Date(),
4813 - $captchaImg = $('#captcha-img'),  
4814 - captchaImgSrc = $captchaImg.attr('src').split('?')[0]; 4838 + $captchaImg = $('#captcha-img'),
  4839 + captchaImgSrc = $captchaImg.attr('src').split('?')[0];
  4840 +
4815 $('#captcha-img').attr('src', captchaImgSrc + '?t=' + time.getTime()); 4841 $('#captcha-img').attr('src', captchaImgSrc + '?t=' + time.getTime());
4816 4842
4817 //getSource('yoho_family_web', '换一张', 'homepage_man'); 4843 //getSource('yoho_family_web', '换一张', 'homepage_man');
@@ -4869,8 +4895,8 @@ function vaCa() { @@ -4869,8 +4895,8 @@ function vaCa() {
4869 type: 'POST', 4895 type: 'POST',
4870 url: '/passport/back/authcode', 4896 url: '/passport/back/authcode',
4871 data: { 4897 data: {
4872 - verifyCode: v,  
4873 - phoneNum: $('#phone-num').val(), 4898 + verifyCode: v,
  4899 + phoneNum: $('#phone-num').val(),
4874 area: $('#country-code-hide').val() 4900 area: $('#country-code-hide').val()
4875 } 4901 }
4876 4902
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.