Authored by whb

index.js

@@ -1158,11 +1158,6 @@ function actionCover() { @@ -1158,11 +1158,6 @@ function actionCover() {
1158 var containertop; 1158 var containertop;
1159 var length = ''; 1159 var length = '';
1160 1160
1161 - window.setCookie('_Channel', 'boys', {  
1162 - path: '/',  
1163 - domain: '.yohobuy.com',  
1164 - expires: 7  
1165 - });  
1166 if (typeof gender === 'undefined' || gender === '' || gender === null) { 1161 if (typeof gender === 'undefined' || gender === '' || gender === null) {
1167 $.get('http://www.yohobuy.com/index/guide', function(data) { 1162 $.get('http://www.yohobuy.com/index/guide', function(data) {
1168 newMask = document.createElement('div'); 1163 newMask = document.createElement('div');
@@ -1348,70 +1343,6 @@ function actionExeCookieMap() { @@ -1348,70 +1343,6 @@ function actionExeCookieMap() {
1348 } 1343 }
1349 } 1344 }
1350 } 1345 }
1351 -/**  
1352 - * 一级菜单点击(会设置cookie)  
1353 - * @return {[type]} [description]  
1354 - */  
1355 -function actionFirstMenuClick() {  
1356 - var $cookieGender;  
1357 -  
1358 - $('.first-nav-item').click(function() {  
1359 - $cookieGender = window.cookie('_Gender');  
1360 - if (typeof $cookieGender !== 'undefined' && $cookieGender !== '') {  
1361 - window.setCookie('_Gender', 1, {  
1362 - path: '/',  
1363 - domain: '.yohobuy.com',  
1364 - expires: 7  
1365 - });  
1366 - }  
1367 - if ($(this).find('.name-cn a').text() === '男生') {  
1368 - window.setCookie('_Gender', '1,3', {  
1369 - path: '/',  
1370 - domain: '.yohobuy.com',  
1371 - expires: 7  
1372 - });  
1373 - window.setCookie('_Channel', 'boys', {  
1374 - path: '/',  
1375 - domain: '.yohobuy.com',  
1376 - expires: 7  
1377 - });  
1378 - }  
1379 - if ($(this).find('.name-cn a').text() === '女生') {  
1380 - window.setCookie('_Gender', '2,3', {  
1381 - path: '/',  
1382 - domain: '.yohobuy.com',  
1383 - expires: 7  
1384 - });  
1385 - window.setCookie('_Channel', 'girls', {  
1386 - path: '/',  
1387 - domain: '.yohobuy.com',  
1388 - expires: 7  
1389 - });  
1390 - }  
1391 - if ($(this).find('.name-cn a').text() === '创意生活') {  
1392 - window.setCookie('_Channel', 'lifestyle', {  
1393 - path: '/',  
1394 - domain: '.yohobuy.com',  
1395 - expires: 7  
1396 - });  
1397 - }  
1398 - if ($(this).find('.name-cn a').text() === '潮童') {  
1399 - window.setCookie('_Channel', 'kids', {  
1400 - path: '/',  
1401 - domain: '.yohobuy.com',  
1402 - expires: 7  
1403 - });  
1404 - }  
1405 - });  
1406 -  
1407 - $('#backToOld').click(function() {  
1408 - window.setCookie('_New', 1, {  
1409 - path: '/',  
1410 - domain: '.yohobuy.com'  
1411 - });  
1412 - location.href = 'http://www.yohobuy.com';  
1413 - });  
1414 -}  
1415 1346
1416 1347
1417 /** 1348 /**
@@ -1853,7 +1784,7 @@ function actionLoginInfo() { @@ -1853,7 +1784,7 @@ function actionLoginInfo() {
1853 * 初始化函数 1784 * 初始化函数
1854 * @return {[type]} [description] 1785 * @return {[type]} [description]
1855 */ 1786 */
1856 -exports.init = function() { 1787 +function init() {
1857 actionNav(); //处理导航 1788 actionNav(); //处理导航
1858 actionTipPic(); //鼠标移入后查询 1789 actionTipPic(); //鼠标移入后查询
1859 actionExeTemplate(); //处理模板 1790 actionExeTemplate(); //处理模板
@@ -1866,7 +1797,6 @@ exports.init = function() { @@ -1866,7 +1797,6 @@ exports.init = function() {
1866 actionGetBannerAndNotice(); // 获取banner和服务器维护提示 1797 actionGetBannerAndNotice(); // 获取banner和服务器维护提示
1867 actionBrandChange(); //切换品牌 1798 actionBrandChange(); //切换品牌
1868 actionAddKeyWords(); //跳转后增加关键字 1799 actionAddKeyWords(); //跳转后增加关键字
1869 - actionFirstMenuClick(); //一级菜单点击(会设置cookie)  
1870 actionGoodsCarMouseEffect(); //鼠标滑入滑出效果 1800 actionGoodsCarMouseEffect(); //鼠标滑入滑出效果
1871 actionUpdateCartNum(); //更新购物车数量 1801 actionUpdateCartNum(); //更新购物车数量
1872 actionLoopUpdCartNum(); //循环检测购物车数量 1802 actionLoopUpdCartNum(); //循环检测购物车数量
@@ -1877,8 +1807,8 @@ exports.init = function() { @@ -1877,8 +1807,8 @@ exports.init = function() {
1877 actionLoginInfo(); //获取登录信息 1807 actionLoginInfo(); //获取登录信息
1878 actionCover(); //初次登录弹框 1808 actionCover(); //初次登录弹框
1879 actionAddKeyWords(); //增加关键字 1809 actionAddKeyWords(); //增加关键字
1880 -};  
1881 - 1810 +}
  1811 +init();
1882 1812
1883 }); 1813 });
1884 define("js/simple-header", ["jquery"], function(require, exports, module){ 1814 define("js/simple-header", ["jquery"], function(require, exports, module){
@@ -1978,9 +1908,10 @@ function actionLoginInfo() { @@ -1978,9 +1908,10 @@ function actionLoginInfo() {
1978 * 初始化函数 1908 * 初始化函数
1979 * @return {[type]} [description] 1909 * @return {[type]} [description]
1980 */ 1910 */
1981 -exports.init = function() { 1911 +function init() {
1982 actionLoginInfo(); //获取登录信息 1912 actionLoginInfo(); //获取登录信息
1983 -}; 1913 +}
  1914 +init();
1984 1915
1985 1916
1986 }); 1917 });
@@ -2640,7 +2571,7 @@ $goodInfoMain.on('click', '.col-btn', function() { @@ -2640,7 +2571,7 @@ $goodInfoMain.on('click', '.col-btn', function() {
2640 url: '/product/list/changeFavorite', 2571 url: '/product/list/changeFavorite',
2641 data: { 2572 data: {
2642 skn: $this.closest('.good-info').data('skn'), 2573 skn: $this.closest('.good-info').data('skn'),
2643 - isFavorite: !$this.hasClass('coled') 2574 + isFavorite: $this.hasClass('coled')
2644 } 2575 }
2645 }).then(function(res) { 2576 }).then(function(res) {
2646 if (res.code === 200) { 2577 if (res.code === 200) {
@@ -2653,21 +2584,22 @@ $goodInfoMain.on('click', '.col-btn', function() { @@ -2653,21 +2584,22 @@ $goodInfoMain.on('click', '.col-btn', function() {
2653 2584
2654 // 左侧导航 2585 // 左侧导航
2655 $productListNav.click(function(event) { 2586 $productListNav.click(function(event) {
  2587 + var $this = $(this);
2656 2588
2657 - if (!$(event.target).hasClass('product-list-nav')) { 2589 + if (!$this.hasClass('product-list-nav')) {
2658 return; 2590 return;
2659 } 2591 }
2660 2592
2661 - if ($(this).hasClass('active')) { 2593 + if ($this.hasClass('active')) {
2662 2594
2663 - $(this).find('.sort-child-list').stop(true, true).slideUp(); 2595 + $this.find('.sort-child-list').stop(true, true).slideUp();
2664 2596
2665 } else { 2597 } else {
2666 2598
2667 - $(this).find('.sort-child-list').stop(true, true).slideDown(); 2599 + $this.find('.sort-child-list').stop(true, true).slideDown();
2668 } 2600 }
2669 2601
2670 - $(this).toggleClass('active'); 2602 + $this.toggleClass('active');
2671 }); 2603 });
2672 2604
2673 }); 2605 });
This diff could not be displayed because it is too large.