modify to gulp ge css js to 0.0.6
Showing
3 changed files
with
236 additions
and
103 deletions
@@ -294,13 +294,62 @@ if ($brandList.length > 0) { | @@ -294,13 +294,62 @@ if ($brandList.length > 0) { | ||
294 | }); | 294 | }); |
295 | } | 295 | } |
296 | 296 | ||
297 | -myHammer = new Hammer($('#right-bar .con').find('b').unbind()[0]); | ||
298 | -myHammer.on('tap', function(e) { | ||
299 | - var index = $(this).index(); | 297 | +if ($('#right-bar .con').find('b').unbind()[0]) { |
298 | + myHammer = new Hammer($('#right-bar .con').find('b').unbind()[0]); | ||
299 | + myHammer.on('tap', function(e) { | ||
300 | + var index = $(this).index(); | ||
300 | 301 | ||
301 | - if ($('.bar-' + index).size() > 0) { | ||
302 | - document.body.scrollTop = parseInt($('.bar-' + index)[0].offsetTop) - parseInt(brandSwipe - 1); | ||
303 | - } | 302 | + if ($('.bar-' + index).size() > 0) { |
303 | + document.body.scrollTop = parseInt($('.bar-' + index)[0].offsetTop) - parseInt(brandSwipe - 1); | ||
304 | + } | ||
305 | + }); | ||
306 | +} | ||
307 | + | ||
308 | +function searchResult(type) { | ||
309 | + var keyword = $('#keyword').val(), | ||
310 | + gender = $('#gender').val(); | ||
311 | + | ||
312 | + $.get('/brands/search', { | ||
313 | + keyword: keyword, | ||
314 | + gender: gender, | ||
315 | + type: type | ||
316 | + }, function(html) { | ||
317 | + $('.search-result').html(html); | ||
318 | + | ||
319 | + }); | ||
320 | +} | ||
321 | + | ||
322 | +$('#keyword').on('keyup', function() { | ||
323 | + searchResult(0); | ||
324 | +}).on('keydown', function() { | ||
325 | + $(this).closest('.search-box').css('width', '11.25rem'); | ||
326 | + $('.search-action').show(); | ||
327 | +}).on('blur', function() { | ||
328 | + $(this).closest('.search-box').css('width', '12.5rem'); | ||
329 | + $('.search-action').hide(); | ||
330 | +}); | ||
331 | + | ||
332 | +$('#search-btn').on('tap', function() { | ||
333 | + searchResult(1); | ||
334 | +}); | ||
335 | + | ||
336 | +$('.clear-text').on('tap', function() { | ||
337 | + $('#keyword').val('').trigger('input'); | ||
338 | +}); | ||
339 | + | ||
340 | +$('form.search-box').on('submit', function() { | ||
341 | + return false; | ||
342 | +}); | ||
343 | + | ||
344 | +$('.clear-history').on('tap', function() { | ||
345 | + | ||
346 | + // setcookie('h_brands', '', { | ||
347 | + // expire: -1, | ||
348 | + // path: '/', | ||
349 | + // domain: '.m.yohobuy.com' | ||
350 | + // }); | ||
351 | + $('#history-keyword').remove(); | ||
352 | + $(this).hide(); | ||
304 | }); | 353 | }); |
305 | 354 | ||
306 | }); | 355 | }); |
@@ -444,7 +493,9 @@ likeHammer.on('tap', function(e) { | @@ -444,7 +493,9 @@ likeHammer.on('tap', function(e) { | ||
444 | success: function(data) { | 493 | success: function(data) { |
445 | if (data.code === 200) { | 494 | if (data.code === 200) { |
446 | $this.toggleClass('like'); | 495 | $this.toggleClass('like'); |
447 | - } else if (data.code === 400) { | 496 | + } else if (data.code === 400 || data.code === 412) { |
497 | + | ||
498 | + //code:412 用户ID不正确,即未登录 | ||
448 | tip.show('未登录'); | 499 | tip.show('未登录'); |
449 | } else { | 500 | } else { |
450 | tip.show(data.message); | 501 | tip.show(data.message); |
@@ -1226,6 +1277,7 @@ navHammer.on('tap', function(event) { | @@ -1226,6 +1277,7 @@ navHammer.on('tap', function(event) { | ||
1226 | }); | 1277 | }); |
1227 | 1278 | ||
1228 | event.srcEvent.stopPropagation(); | 1279 | event.srcEvent.stopPropagation(); |
1280 | + return false; | ||
1229 | }); | 1281 | }); |
1230 | 1282 | ||
1231 | mobileWrapHammer = new Hammer($('.mobile-wrap')[0]); | 1283 | mobileWrapHammer = new Hammer($('.mobile-wrap')[0]); |
@@ -1243,11 +1295,12 @@ mobileWrapHammer.on('tap', function(e) { | @@ -1243,11 +1295,12 @@ mobileWrapHammer.on('tap', function(e) { | ||
1243 | $('.overlay').hide(); | 1295 | $('.overlay').hide(); |
1244 | }, 300); | 1296 | }, 300); |
1245 | e.srcEvent.stopPropagation(); | 1297 | e.srcEvent.stopPropagation(); |
1298 | + return false; | ||
1246 | } | 1299 | } |
1247 | }); | 1300 | }); |
1248 | 1301 | ||
1249 | //点击一级导航,弹出二级导航 | 1302 | //点击一级导航,弹出二级导航 |
1250 | -$sideNav.on('touchstart', 'li', function () { | 1303 | +$sideNav.on('touchend', 'li', function () { |
1251 | if ($(this).find('.sub-nav').size() > 0) { | 1304 | if ($(this).find('.sub-nav').size() > 0) { |
1252 | $('.sub-nav').removeClass('show'); | 1305 | $('.sub-nav').removeClass('show'); |
1253 | $(this).find('.sub-nav').addClass('show'); | 1306 | $(this).find('.sub-nav').addClass('show'); |
@@ -1256,10 +1309,12 @@ $sideNav.on('touchstart', 'li', function () { | @@ -1256,10 +1309,12 @@ $sideNav.on('touchstart', 'li', function () { | ||
1256 | 1309 | ||
1257 | //返回一级导航,收起二级导航 | 1310 | //返回一级导航,收起二级导航 |
1258 | $('.sub-nav').each(function () { | 1311 | $('.sub-nav').each(function () { |
1259 | - $(this).find('li').eq(0).on('touchstart', function (e) { | 1312 | + $(this).find('li').eq(0).on('touchend', function (e) { |
1260 | $('.sub-nav').removeClass('show'); | 1313 | $('.sub-nav').removeClass('show'); |
1261 | - e.stopPropagation(); | 1314 | + return false; |
1262 | }); | 1315 | }); |
1316 | +}).on('touchend', function() { | ||
1317 | + $('.sub-nav').find('li').removeClass('current'); | ||
1263 | }); | 1318 | }); |
1264 | 1319 | ||
1265 | //头部banner轮播 | 1320 | //头部banner轮播 |
@@ -1375,7 +1430,7 @@ function tsAnimate() { | @@ -1375,7 +1430,7 @@ function tsAnimate() { | ||
1375 | setTimeout(tsAnimate, 3000); | 1430 | setTimeout(tsAnimate, 3000); |
1376 | 1431 | ||
1377 | }); | 1432 | }); |
1378 | -define("js/home/maybe-like", ["jquery","lazyload"], function(require, exports, module){ | 1433 | +define("js/home/maybe-like", ["jquery","hammer","lazyload"], function(require, exports, module){ |
1379 | /** | 1434 | /** |
1380 | * “你可能喜欢”模块JS | 1435 | * “你可能喜欢”模块JS |
1381 | * @author: liangzhifeng<zhifeng.liang@yoho.cn> | 1436 | * @author: liangzhifeng<zhifeng.liang@yoho.cn> |
@@ -1383,10 +1438,12 @@ define("js/home/maybe-like", ["jquery","lazyload"], function(require, exports, m | @@ -1383,10 +1438,12 @@ define("js/home/maybe-like", ["jquery","lazyload"], function(require, exports, m | ||
1383 | */ | 1438 | */ |
1384 | 1439 | ||
1385 | var $ = require("jquery"), | 1440 | var $ = require("jquery"), |
1441 | + Hammer = require("hammer"), | ||
1386 | tip = require("js/plugin/tip"), | 1442 | tip = require("js/plugin/tip"), |
1387 | lazyLoad = require("lazyload"); | 1443 | lazyLoad = require("lazyload"); |
1388 | 1444 | ||
1389 | -var winH = $(window).height(), | 1445 | +var navHammer, |
1446 | + winH = $(window).height(), | ||
1390 | loadMoreH = $('#load-more').height(), | 1447 | loadMoreH = $('#load-more').height(), |
1391 | $goodList = $('#goods-list'), | 1448 | $goodList = $('#goods-list'), |
1392 | loading = false, | 1449 | loading = false, |
@@ -1413,93 +1470,103 @@ if (kidsType) { | @@ -1413,93 +1470,103 @@ if (kidsType) { | ||
1413 | 1470 | ||
1414 | $curNav = $navList.children('.focus'); | 1471 | $curNav = $navList.children('.focus'); |
1415 | 1472 | ||
1416 | -$('#maybe-like-nav').delegate('li', 'tap', function() { | ||
1417 | - var $this = $(this), | ||
1418 | - $goods = $('.goods-list'), | ||
1419 | - $content; | 1473 | +if (lifestyleType) { |
1474 | + navHammer = new Hammer($navList[0]); | ||
1475 | + navHammer.on('tap', function(e) { | ||
1476 | + var $this = $(e.target).closest('li'), | ||
1477 | + $goods = $('.goods-list'), | ||
1478 | + $content; | ||
1420 | 1479 | ||
1480 | + if ($this.hasClass('focus')) { | ||
1481 | + return; | ||
1482 | + } | ||
1421 | 1483 | ||
1422 | - if ($this.hasClass('focus')) { | ||
1423 | - return; | ||
1424 | - } | 1484 | + index = $this.index(); |
1425 | 1485 | ||
1426 | - index = $this.index(); | 1486 | + $this.addClass('focus'); |
1487 | + $curNav.removeClass('focus'); | ||
1427 | 1488 | ||
1428 | - $this.addClass('focus'); | ||
1429 | - $curNav.removeClass('focus'); | 1489 | + $goods.not('.hide').addClass('hide'); |
1490 | + $content = $goods.eq(index); | ||
1491 | + $content.removeClass('hide'); | ||
1430 | 1492 | ||
1431 | - $goods.not('.hide').addClass('hide'); | ||
1432 | - $content = $goods.eq(index); | ||
1433 | - $content.removeClass('hide'); | 1493 | + $curNav = $this; |
1434 | 1494 | ||
1435 | - $curNav = $this; | 1495 | + $(document).trigger('scroll'); //Trigger lazyLoad |
1496 | + }); | ||
1497 | +} | ||
1436 | 1498 | ||
1437 | - $(document).trigger('scroll'); //Trigger lazyLoad | ||
1438 | -}); | ||
1439 | 1499 | ||
1440 | -//srcoll to load more | ||
1441 | -$(window).scroll(function () { | ||
1442 | - if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH - 50) { | ||
1443 | - if (loading) { | ||
1444 | - return; | ||
1445 | - } | ||
1446 | - loading = true; | ||
1447 | - | ||
1448 | - //num = $goodList.find('.good-info').length; | ||
1449 | - $.ajax({ | ||
1450 | - type: 'GET', | ||
1451 | - url: url, | ||
1452 | - data: { | ||
1453 | - page: page + 1 | ||
1454 | - }, | ||
1455 | - success: function(data) { | ||
1456 | - if (data === ' ') { | ||
1457 | - loading = true; | ||
1458 | - if (gender) { | ||
1459 | - if (gender === '1,3') { | ||
1460 | - url = '/boys/bottomBanner'; | ||
1461 | - } else { | ||
1462 | - url = '/girls/bottomBanner'; | ||
1463 | - } | ||
1464 | - $.ajax({ | ||
1465 | - type: 'GET', | ||
1466 | - url: url, | ||
1467 | - success: function(data) { | ||
1468 | - if (data && data[0] && data[0].banner[0]) { | ||
1469 | - $('#load-more-img').show(); | ||
1470 | - $('#load-more-img a').attr('url', data[0].banner[0].url); | ||
1471 | - $('#load-more-img a > img').attr('src', data[0].banner[0].img); | ||
1472 | - } | ||
1473 | - }, | ||
1474 | - error: function() { | ||
1475 | - } | ||
1476 | - }); | 1500 | +function search() { |
1501 | + if (loading) { | ||
1502 | + return; | ||
1503 | + } | ||
1504 | + loading = true; | ||
1477 | 1505 | ||
1506 | + //num = $goodList.find('.good-info').length; | ||
1507 | + $.ajax({ | ||
1508 | + type: 'GET', | ||
1509 | + url: url, | ||
1510 | + data: { | ||
1511 | + page: page + 1 | ||
1512 | + }, | ||
1513 | + success: function(data) { | ||
1514 | + if (data === ' ') { | ||
1515 | + loading = true; | ||
1516 | + if (gender) { | ||
1517 | + if (gender === '1,3') { | ||
1518 | + url = '/boys/bottomBanner'; | ||
1519 | + } else { | ||
1520 | + url = '/girls/bottomBanner'; | ||
1478 | } | 1521 | } |
1479 | - return; | 1522 | + $.ajax({ |
1523 | + type: 'GET', | ||
1524 | + url: url, | ||
1525 | + success: function(data) { | ||
1526 | + if (data) { | ||
1527 | + $('#load-more-img').show(); | ||
1528 | + $('#load-more-img a').attr('href', data.url); | ||
1529 | + $('#load-more-img a > img').attr('src', data.img); | ||
1530 | + } | ||
1531 | + }, | ||
1532 | + error: function() { | ||
1533 | + } | ||
1534 | + }); | ||
1535 | + | ||
1480 | } | 1536 | } |
1537 | + return; | ||
1538 | + } | ||
1481 | 1539 | ||
1482 | - num = $goodList.find('.good-info').length; | 1540 | + num = $goodList.find('.good-info').length; |
1483 | 1541 | ||
1484 | - $goodList.append(data); | 1542 | + $goodList.append(data); |
1485 | 1543 | ||
1486 | - // 2015/10/31 fei.hong: 修复第一页分页不显示图片的问题 | ||
1487 | - if (num === 0) { | ||
1488 | - lazyLoad($goodList.find('.good-info').find('img.lazy')); | ||
1489 | - } else { | ||
1490 | - lazyLoad($goodList.find('.good-info:gt(' + (num - 1) + ')').find('img.lazy')); | ||
1491 | - } | ||
1492 | - | ||
1493 | - loading = false; | ||
1494 | - page++; | ||
1495 | - }, | ||
1496 | - error: function() { | ||
1497 | - tip.show('网络断开连接了~'); | ||
1498 | - loading = false; | 1544 | + // 2015/10/31 fei.hong: 修复第一页分页不显示图片的问题 |
1545 | + if (num === 0) { | ||
1546 | + lazyLoad($goodList.find('.good-info').find('img.lazy')); | ||
1547 | + } else { | ||
1548 | + lazyLoad($goodList.find('.good-info:gt(' + (num - 1) + ')').find('img.lazy')); | ||
1499 | } | 1549 | } |
1500 | - }); | ||
1501 | - } | ||
1502 | 1550 | ||
1551 | + loading = false; | ||
1552 | + page++; | ||
1553 | + }, | ||
1554 | + error: function() { | ||
1555 | + tip.show('网络断开连接了~'); | ||
1556 | + loading = false; | ||
1557 | + } | ||
1558 | + }); | ||
1559 | +} | ||
1560 | + | ||
1561 | +$('.maybe-like p').on('touchstart', function (e) { | ||
1562 | + search(); | ||
1563 | +}); | ||
1564 | + | ||
1565 | +//srcoll to load more | ||
1566 | +$(window).scroll(function () { | ||
1567 | + if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH - 50) { | ||
1568 | + search(); | ||
1569 | + } | ||
1503 | }); | 1570 | }); |
1504 | }); | 1571 | }); |
1505 | define("js/index/entry", ["jquery","hammer"], function(require, exports, module){ | 1572 | define("js/index/entry", ["jquery","hammer"], function(require, exports, module){ |
@@ -1511,6 +1578,7 @@ define("js/index/entry", ["jquery","hammer"], function(require, exports, module) | @@ -1511,6 +1578,7 @@ define("js/index/entry", ["jquery","hammer"], function(require, exports, module) | ||
1511 | 1578 | ||
1512 | require("js/index/search"); | 1579 | require("js/index/search"); |
1513 | require("js/index/footer"); | 1580 | require("js/index/footer"); |
1581 | +require("js/index/channel"); | ||
1514 | }); | 1582 | }); |
1515 | define("js/index/search", ["jquery","hammer"], function(require, exports, module){ | 1583 | define("js/index/search", ["jquery","hammer"], function(require, exports, module){ |
1516 | /** | 1584 | /** |
@@ -1701,6 +1769,49 @@ if ($('#float-layer-btn') && $('#float-layer-btn')[0]) { | @@ -1701,6 +1769,49 @@ if ($('#float-layer-btn') && $('#float-layer-btn')[0]) { | ||
1701 | } | 1769 | } |
1702 | 1770 | ||
1703 | }); | 1771 | }); |
1772 | +define("js/index/channel", ["jquery"], function(require, exports, module){ | ||
1773 | +/** | ||
1774 | + * 频道选择页面顶部搜索 | ||
1775 | + * @author: bikai<kai.bi@yoho.cn> | ||
1776 | + * @date: 2015/10/28 | ||
1777 | + */ | ||
1778 | +var $ = require("jquery"); | ||
1779 | +var $searchBox = $('.search-box'), | ||
1780 | + $indexSearch = $('.index-search'), | ||
1781 | + $indexLogo = $('.index-logo'); | ||
1782 | + | ||
1783 | +$searchBox.find('input').on('focus', function() { | ||
1784 | + $indexLogo.css({ | ||
1785 | + width: 0 | ||
1786 | + }); | ||
1787 | + $searchBox.css({ | ||
1788 | + width: '12.8rem' | ||
1789 | + }); | ||
1790 | + $indexSearch.css({ | ||
1791 | + width: '15.5rem' | ||
1792 | + }); | ||
1793 | + $('.clear-text, .no-search').show(); | ||
1794 | +}).on('blur', function() { | ||
1795 | + $indexLogo.css({ | ||
1796 | + width: '5.4rem' | ||
1797 | + }); | ||
1798 | + $searchBox.css({ | ||
1799 | + width: '8.8rem' | ||
1800 | + }); | ||
1801 | + $indexSearch.css({ | ||
1802 | + width: '9.6rem' | ||
1803 | + }); | ||
1804 | + $('.clear-text, .no-search').hide(); | ||
1805 | +}); | ||
1806 | +$searchBox.find('.clear-text').click(function() { | ||
1807 | + $searchBox.find('input').val('').trigger('focus'); | ||
1808 | +}); | ||
1809 | +$searchBox.find('.search-icon').click(function() { | ||
1810 | + $indexSearch.submit(); | ||
1811 | +}); | ||
1812 | + | ||
1813 | + | ||
1814 | +}); | ||
1704 | define("js/passport/entry", ["jquery"], function(require, exports, module){ | 1815 | define("js/passport/entry", ["jquery"], function(require, exports, module){ |
1705 | /** | 1816 | /** |
1706 | * 注册、登录、密码找回打包入口 | 1817 | * 注册、登录、密码找回打包入口 |
@@ -2644,6 +2755,8 @@ var defaultOpt = { | @@ -2644,6 +2755,8 @@ var defaultOpt = { | ||
2644 | dayLimit: 1 | 2755 | dayLimit: 1 |
2645 | }; | 2756 | }; |
2646 | 2757 | ||
2758 | +var storeOpt = $.extend({}, defaultOpt); //存储默认筛选条件以便重置 | ||
2759 | + | ||
2647 | var now = new Date(), | 2760 | var now = new Date(), |
2648 | month = now.getMonth() + 1, | 2761 | month = now.getMonth() + 1, |
2649 | date = now.getDate(); | 2762 | date = now.getDate(); |
@@ -2870,8 +2983,7 @@ $.ajax({ | @@ -2870,8 +2983,7 @@ $.ajax({ | ||
2870 | //切换active状态到$pre上 | 2983 | //切换active状态到$pre上 |
2871 | $pre.addClass('active'); | 2984 | $pre.addClass('active'); |
2872 | $pre.siblings('.filter').removeClass('active'); | 2985 | $pre.siblings('.filter').removeClass('active'); |
2873 | - }, | ||
2874 | - missStatus: true | 2986 | + } |
2875 | }); | 2987 | }); |
2876 | } | 2988 | } |
2877 | }); | 2989 | }); |
@@ -2946,6 +3058,10 @@ navHammer.on('tap', function(e) { | @@ -2946,6 +3058,10 @@ navHammer.on('tap', function(e) { | ||
2946 | $dgc.removeClass('hide'); | 3058 | $dgc.removeClass('hide'); |
2947 | break; | 3059 | break; |
2948 | } | 3060 | } |
3061 | + | ||
3062 | + //重置筛选项 | ||
3063 | + filter.resetFilter(); | ||
3064 | + defaultOpt = $.extend({}, storeOpt); | ||
2949 | } | 3065 | } |
2950 | 3066 | ||
2951 | $active.removeClass('active'); | 3067 | $active.removeClass('active'); |
@@ -2993,13 +3109,6 @@ var missStatus; //是否忽略选中状态 | @@ -2993,13 +3109,6 @@ var missStatus; //是否忽略选中状态 | ||
2993 | //隐藏筛选界面 | 3109 | //隐藏筛选界面 |
2994 | function hideFilter() { | 3110 | function hideFilter() { |
2995 | $filter.addClass('hide'); | 3111 | $filter.addClass('hide'); |
2996 | - | ||
2997 | - if (missStatus) { | ||
2998 | - | ||
2999 | - //重置一级筛选项选中状态 | ||
3000 | - $filter.find('.classify-item.active').removeClass('active'); | ||
3001 | - $filter.find('.classify-item:first-child').addClass('active'); | ||
3002 | - } | ||
3003 | } | 3112 | } |
3004 | 3113 | ||
3005 | //显示筛选界面 | 3114 | //显示筛选界面 |
@@ -3007,6 +3116,7 @@ function showFilter() { | @@ -3007,6 +3116,7 @@ function showFilter() { | ||
3007 | $filter.removeClass('hide'); | 3116 | $filter.removeClass('hide'); |
3008 | } | 3117 | } |
3009 | 3118 | ||
3119 | +//主筛选项Tap事件句柄 | ||
3010 | function classifyTapEvt($this) { | 3120 | function classifyTapEvt($this) { |
3011 | if ($this.hasClass('active')) { | 3121 | if ($this.hasClass('active')) { |
3012 | return; | 3122 | return; |
@@ -3017,9 +3127,8 @@ function classifyTapEvt($this) { | @@ -3017,9 +3127,8 @@ function classifyTapEvt($this) { | ||
3017 | $this.addClass('active'); | 3127 | $this.addClass('active'); |
3018 | } | 3128 | } |
3019 | 3129 | ||
3020 | -function subClassifyTapEvt($this) { | ||
3021 | - var id = $this.data('id'); | ||
3022 | - | 3130 | +//子筛选项选中处理 |
3131 | +function setSubClassify($this) { | ||
3023 | var $sub = $this.closest('.sub-classify'); | 3132 | var $sub = $this.closest('.sub-classify'); |
3024 | 3133 | ||
3025 | var $shower = $sub.siblings('.shower'); | 3134 | var $shower = $sub.siblings('.shower'); |
@@ -3048,6 +3157,17 @@ function subClassifyTapEvt($this) { | @@ -3048,6 +3157,17 @@ function subClassifyTapEvt($this) { | ||
3048 | $shower.removeClass('default'); | 3157 | $shower.removeClass('default'); |
3049 | } | 3158 | } |
3050 | 3159 | ||
3160 | + return $sub; | ||
3161 | +} | ||
3162 | + | ||
3163 | +//子筛选项Tap句柄 | ||
3164 | +function subClassifyTapEvt($this) { | ||
3165 | + var id = $this.data('id'); | ||
3166 | + | ||
3167 | + var $sub; | ||
3168 | + | ||
3169 | + $sub = setSubClassify($this); | ||
3170 | + | ||
3051 | if (fCbFn) { | 3171 | if (fCbFn) { |
3052 | fCbFn({ | 3172 | fCbFn({ |
3053 | type: $sub.data('type'), | 3173 | type: $sub.data('type'), |
@@ -3056,12 +3176,6 @@ function subClassifyTapEvt($this) { | @@ -3056,12 +3176,6 @@ function subClassifyTapEvt($this) { | ||
3056 | } | 3176 | } |
3057 | 3177 | ||
3058 | hideFilter(); | 3178 | hideFilter(); |
3059 | - | ||
3060 | - //重置选中状态 | ||
3061 | - if (missStatus) { | ||
3062 | - $this.removeClass('chosed'); | ||
3063 | - $sub.children(':first-child').addClass('chosed'); | ||
3064 | - } | ||
3065 | } | 3179 | } |
3066 | 3180 | ||
3067 | //初始化筛选 | 3181 | //初始化筛选 |
@@ -3109,11 +3223,28 @@ function initFilter(opt) { | @@ -3109,11 +3223,28 @@ function initFilter(opt) { | ||
3109 | }); | 3223 | }); |
3110 | } | 3224 | } |
3111 | 3225 | ||
3226 | +//重置筛选面板 | ||
3227 | +function resetFilter() { | ||
3228 | + if (typeof $filter === 'undefined') { | ||
3229 | + return; | ||
3230 | + } | ||
3231 | + | ||
3232 | + //重置子筛选项 | ||
3233 | + $('.sub-classify').each(function() { | ||
3234 | + setSubClassify($(this).children(':first-child')); | ||
3235 | + }); | ||
3236 | + | ||
3237 | + //重置主筛选项 | ||
3238 | + classifyTapEvt($('.classify > :first-child')); | ||
3239 | +} | ||
3240 | + | ||
3112 | exports.initFilter = initFilter; | 3241 | exports.initFilter = initFilter; |
3113 | 3242 | ||
3114 | exports.showFilter = showFilter; | 3243 | exports.showFilter = showFilter; |
3115 | 3244 | ||
3116 | exports.hideFilter = hideFilter; | 3245 | exports.hideFilter = hideFilter; |
3246 | + | ||
3247 | +exports.resetFilter = resetFilter; | ||
3117 | }); | 3248 | }); |
3118 | define("js/product/newsale/discount", ["jquery","swiper","hammer","lazyload","index"], function(require, exports, module){ | 3249 | define("js/product/newsale/discount", ["jquery","swiper","hammer","lazyload","index"], function(require, exports, module){ |
3119 | /** | 3250 | /** |
@@ -3877,6 +4008,8 @@ if ($brandHeader.length > 0) { | @@ -3877,6 +4008,8 @@ if ($brandHeader.length > 0) { | ||
3877 | success: function(data) { | 4008 | success: function(data) { |
3878 | if (data.code === 200) { | 4009 | if (data.code === 200) { |
3879 | $this.toggleClass('coled'); | 4010 | $this.toggleClass('coled'); |
4011 | + } else if (data.code === 400 || data.code === 412) { | ||
4012 | + tip.show('未登录'); | ||
3880 | } else { | 4013 | } else { |
3881 | tip.show(data.message); | 4014 | tip.show(data.message); |
3882 | } | 4015 | } |
This diff could not be displayed because it is too large.
1 | -define("index",["jquery","hammer","swiper","lazyload","mlellipsis","iscroll-probe","index"],function(e,a,s){var n;e("js/common"),e("js/category/entry"),e("js/guang/entry"),e("js/home/entry"),e("js/index/entry"),e("js/passport/entry"),e("js/product/entry"),s.exports=n}),define("js/common",["jquery"],function(e,a,s){function n(e){var a,s,n=document.cookie;return document.cookie&&""!==document.cookie&&(s=n.indexOf(e+"="),s>-1&&(s+=e.length+1,a=decodeURIComponent(d.trim(n.substring(s,n.indexOf(";",s)))))),a}function i(e,a,s){var n,i,t,o,r="";"undefined"!=typeof a&&(s=s||{},null===a&&(a="",s.expires=-1),s.expires&&("number"==typeof s.expires||s.expires.toUTCString)&&("number"==typeof s.expires?(o=new Date,o.setTime(o.getTime()+24*s.expires*60*60*1e3)):o=s.expires,r="; expires="+o.toUTCString()),n=s.path?"; path="+s.path:"",i=s.domain?"; domain="+s.domain:"",t=s.secure?"; secure":"",document.cookie=[e,"=",encodeURIComponent(a),r,n,i,t].join(""))}function t(){var e,a=n("_UID");return"undefined"==typeof a?0:(e=a.split("::"),"undefined"==typeof e||e.length<4?0:e)}function o(){var e=t();return 0===e?0:e[1]}function r(){var e=n("_g");return"undefined"==typeof e?"":JSON.parse(e).k}function l(){0!==c.length&&(d("body").height()<d(window).height()-u?c.addClass("bottom"):c.removeClass("bottom"))}var d=e("jquery"),c=d("#yoho-footer"),u=120;!function(){var e=c.children(".op-row"),a=t();d("body").height()<d(window).height()-u&&c.addClass("bottom"),0===a?e.prepend('<a href="http://m.yohobuy.com/signin.html">登录</a><span class="sep-line">|</span><a href="http://m.yohobuy.com/reg.html">注册</a>'):e.prepend('Hi,<a class="user-name" href="http://m.yohobuy.com/home?tmp='+Math.random()+'">'+a[0]+'</a><a href="http://m.yohobuy.com/passport/signout/index?token='+a[3]+'">退出</a>'),c.removeClass("hide")}(),window.cookie=n,window.setCookie=i,window.getUser=t,window.getUid=o,window.getShoppingKey=r,window.rePosFooter=l}),define("js/category/entry",["jquery","hammer","swiper","lazyload","index"],function(e,a,s){e("js/category/index"),e("js/category/brand")}),define("js/category/index",["jquery","hammer"],function(e,a,s){var n,i,t=e("jquery"),o=e("hammer"),r=t(".category-nav"),l=t(".category-container"),d=l.children(".content"),c=d.not(".hide");t("#search-input").focus(function(){t(this).blur()}),n=new o(r[0]),n.on("tap",function(e){var a=t(e.target).closest("li"),s=a.index();a.hasClass("focus")||(r.find("li.focus").removeClass("focus"),a.addClass("focus"),c.addClass("hide"),c=d.eq(s).removeClass("hide"))}),i=new o(l[0]),i.on("tap",function(e){var a,s,n,i=t(e.target);if(s=i.closest(".p-level-item"),s.length>0){if(n=s.index(),a=i.closest(".content").find(".sub-level"),i.hasClass("focus"))return;i.closest(".primary-level").children(".focus").removeClass("focus"),i.addClass("focus"),a.not(".hide").addClass("hide"),a.eq(n).removeClass("hide")}})}),define("js/category/brand",["jquery","hammer","swiper","lazyload","index"],function(e,a,s){var n,i,t=e("jquery"),o=e("hammer"),r=e("swiper"),l=e("lazyload"),d=t(".brand-list"),c=t(".newbrand-search").outerHeight(),u=t(".yoho-header").outerHeight(),p=parseInt(c)+parseInt(u)-1;n=new r(".swiper-container",{lazyLoading:!0,loop:!0,autoplay:3e3,pagination:".swiper-pagination .pagination-inner"}),l(t("img.lazy")),t(".yoho-header").css({"z-index":2,position:"fixed"}),t(".banner-top").css("padding-top","90px"),d.length>0&&t(window).scroll(function(){var e=t(window).scrollTop();t(".brand-list").each(function(){var a=t(this).offset().top-p;e>=a?(d.find(".title-bar").css("position","static"),t(this).find(".title-bar").css({position:"fixed",top:p})):t(this).find(".title-bar").css("position","static")})}),i=new o(t("#right-bar .con").find("b").unbind()[0]),i.on("tap",function(e){var a=t(this).index();t(".bar-"+a).size()>0&&(document.body.scrollTop=parseInt(t(".bar-"+a)[0].offsetTop)-parseInt(p-1))})}),define("js/guang/entry",["jquery","hammer","lazyload","swiper","mlellipsis","iscroll-probe","index"],function(e,a,s){e("js/guang/plus-star/list"),e("js/guang/plus-star/detail"),e("js/guang/home"),e("js/guang/list"),e("js/guang/detail")}),define("js/guang/plus-star/list",["jquery","hammer","lazyload","swiper","index"],function(e,a,s){var n,i,t=e("jquery"),o=e("hammer"),r=e("lazyload"),l=e("swiper"),d=t("#nav-tab > li"),c=t("#ps-content > .content");r(t("img.lazy")),n=new l(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),i=new o(document.getElementById("nav-tab")),i.on("tap",function(e){var a=t(e.target).closest("li");a.hasClass("focus")||(d.toggleClass("focus"),c.toggleClass("hide"),t(document).trigger("scroll"))})}),define("js/guang/plus-star/detail",["jquery","hammer","mlellipsis","lazyload"],function(e,a,s){var n,i,t,o,r=e("jquery"),l=e("hammer"),d=e("mlellipsis"),c=e("lazyload"),u=r("#intro"),p=r("#intro-more-txt"),h=r("#related-infos-container"),f=e("js/guang/info"),g=e("js/plugin/tip"),m=r("#brand-info").data("id");d.init(),c(r("img.lazy")),u[0].mlellipsis(3),setTimeout(function(){n=u.text(),i=u.attr("title")}),f.initInfosEvt(h),t=new l(document.getElementById("more-intro")),t.on("tap",function(e){var a=r(e.target).closest("#more-intro");a.toggleClass("spread"),a.hasClass("spread")?(u.text(i),p.text("收起")):(u.text(n),p.text("more"),r(window).scrollTop(0,400)),e.preventDefault()}),o=new l(document.getElementById("brand-like")),o.on("tap",function(e){var a="ok",s=r(e.target);e.preventDefault(),s.hasClass("like")&&(a="cancel"),r.ajax({type:"POST",url:"/product/opt/favoriteBrand",data:{id:m,opt:a},success:function(e){200===e.code?s.toggleClass("like"):400===e.code?g.show("未登录"):g.show(e.message)},error:function(){g.show("网络断开连接了~")}})})}),define("js/guang/info",["jquery","hammer","mlellipsis","lazyload"],function(e,a,s){function n(e){d(e.find("img.lazy")),e.each(function(){var e=o(this),a=e.find(".info-title"),s=e.find(".info-text");a[0].mlellipsis(2),s[0].mlellipsis(2)})}function i(e){var a=new r(e[0]);a.on("tap",function(e){var a,s,n=o(e.target),i="ok";a=n.closest(".like-btn"),a.length>0&&(a.hasClass("like")&&(i="cancel"),s=n.closest(".guang-info"),o.ajax({type:"POST",url:"/guang/opt/praiseArticle",data:{id:s.data("id"),opt:i},success:function(e){var s=e.code;200===s&&(a.next(".like-count").text(e.data),a.toggleClass("like"))},error:function(){c.show("网络断开连接了~")}}))}),n(e.find(".guang-info"))}function t(e,a){var s;g||a.end||(1===a.page&&u.showLoadingMask(),s=e.find(".guang-info").length,g=!0,o.ajax({type:"GET",url:" /guang/index/page",data:a,success:function(i){var t;return" "===i?(a.end=!0,g=!1,h.addClass("hide"),void f.removeClass("hide")):(e.append(i),t=s>0?e.find(".guang-info:gt("+(s-1)+")"):e.find(".guang-info"),n(t),1===a.page&&u.hideLoadingMask(),a.page++,void(g=!1))},error:function(){c.show("网络断开连接了~"),g=!1}}))}var o=e("jquery"),r=e("hammer"),l=e("mlellipsis"),d=e("lazyload"),c=e("js/plugin/tip"),u=e("js/plugin/loading"),p=o("#load-more-info"),h=o(""),f=o(""),g=!1;l.init(),p.length>0&&(h=p.children(".loading"),f=p.children(".no-more")),a.initInfosEvt=i,a.setLazyLoadAndMellipsis=n,a.loadMore=t}),define("js/plugin/tip",["jquery"],function(e,a,s){function n(e,a){var s,n;"undefined"!=typeof e&&(s=e.toString(),n=a&&a>0?a:2e3,i.text(s).show(),t=setTimeout(function(){"block"===i.css("display")&&i.hide()},n))}var i,t,o=e("jquery");!function(){var e='<div id="yoho-tip" class="yoho-tip"></div>';o(".yoho-page").append(e),i=o("#yoho-tip"),i.on("tap",function(){i.hide(),clearTimeout(t)})}(),a.show=n}),define("js/plugin/loading",["jquery"],function(e,a,s){function n(){t.removeClass("hide")}function i(){t.addClass("hide")}var t,o=e("jquery"),r=o(".yoho-page");!function(){var e='<div class="loading-mask hide"><div class="loading"></div></div>';r.append(e),t=r.children(".loading-mask")}(),a.showLoadingMask=n,a.hideLoadingMask=i}),define("js/guang/home",["jquery","hammer","swiper","mlellipsis","lazyload","index"],function(e,a,s){var n,i,t=e("jquery"),o=e("hammer"),r=e("swiper"),l=e("js/guang/info"),d=l.loadMore,c=t("#load-more-info"),u=t(""),p=t(""),h=t(window).height(),f=c.height(),g=t("#info-list"),m=g.children(".info-list"),v=t("#guang-nav"),w=v.children(".focus"),y=w.data("type"),b={};c.length>0&&(u=c.children(".loading"),p=c.children(".no-more")),n=new r(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),l.initInfosEvt(g),function(){var e=t("#gender").val();v.children(".guang-nav-item").each(function(){var a=t(this).data("type"),s=t(this).hasClass("focus");b[a]={page:s?2:1,gender:e,type:a,end:!1}})}(),i=new o(v[0]),i.on("tap",function(e){var a,s,n=t(e.target).closest(".guang-nav-item");n.hasClass("focus")||(s=n.index(),n.addClass("focus"),w.removeClass("focus"),m.not(".hide").addClass("hide"),a=m.eq(s),a.removeClass("hide"),w=n,y=n.data("type"),1===b[y].page&&d(a,b[y]),b[y].end?(u.addClass("hide"),p.removeClass("hide")):(u.removeClass("hide"),p.addClass("hide")))}),t(document).scroll(function(){t(window).scrollTop()+h>=t(document).height()-f&&d(m.not(".hide"),b[y])})}),define("js/guang/list",["jquery","hammer","mlellipsis","lazyload"],function(e,a,s){var n=e("jquery"),i=e("js/guang/info"),t=i.loadMore,o=n(window).height(),r=n("#load-more").height(),l=n("#author-infos"),d=n("#tag"),c=n("#gender"),u=n("#isApp"),p={page:2,end:!1},h=n("#info-list");i.initInfosEvt(h),l.length>0&&n.extend(p,{authorId:l.data("id")}),d.length>0&&n.extend(p,{tag:d.val(),gender:c.val(),isApp:u.val()}),n(document).scroll(function(){n(window).scrollTop()+o>=n(document).height()-r-50&&t(h,p)})}),define("js/guang/detail",["jquery","mlellipsis","lazyload","iscroll-probe"],function(e,a,s){function n(e){var a=e.offset().left,s=-b+a+w/2+"px";o.css({backgroundPosition:s+" bottom"}),m&&y.css({backgroundPosition:s+" bottom"})}function i(e){var a,s,i,p=u(e.currentTarget),f=p.index();p.hasClass("focus")||(r.filter(".focus").removeClass("focus"),m&&(a=p.closest(".fixed-thumb-container").length>0?o:y,s=a.find(".thumb").eq(f),y.find(".thumb.focus").removeClass("focus"),s.addClass("focus")),p.addClass("focus"),n(p),l.not(".hide").addClass("hide"),i=l.eq(f),i.removeClass("hide"),h(i.find(".lazy")),m?c&&c.scrollToElement(d,400):u("body").animate({scrollTop:t.offset().top},400))}var t,o,r,l,d,c,u=e("jquery"),p=e("mlellipsis"),h=e("lazyload"),f=e("iscroll-probe"),g=u(".author .intro"),m=navigator.userAgent.indexOf("iPhone")>0?!0:!1,v=u(".collocation-block").length>0?!0:!1,w=0,y=u(""),d=document.querySelector("#wrapper .collocation-block"),b=u(window).width();e("js/plugin/wx-share")(),m&&u("#wrapper").addClass("ios"),p.init(),h(u(".lazy")),u(".info-list .title, .one-good .reco-name").each(function(){this.mlellipsis(2)}),parseInt(g.offset().left,10)===parseInt(g.css("margin-left"),10)&&g.css("padding-top",0),v&&(t=u(".collocation-block"),o=t.children(".thumb-container"),r=o.find("li"),l=t.find(".prod"),w=r.width(),m&&(y=u("#wrapper").after(o.clone().addClass("fixed-thumb-container fixed-bottom")).next(".thumb-container"),h(y.find(".lazy"),{event:"sporty"})),n(r.filter(".focus")),o.delegate(".thumb","touchend",i),m&&y.delegate(".thumb","touchend",i)),window.onload=function(){var e,a,s,n,i,r=u("#scroller");if(m){if(c=new f("#wrapper",{probeType:3,mouseWheel:!0,click:!0}),document.addEventListener("touchmove",function(e){e.preventDefault()},!1),!v)return void c.on("scroll",function(){r.trigger("scroll")});e=u(window).height(),i=y[0],a=o.height(),s=t.height(),n=t.offset().top,c.on("scroll",function(){var t=-this.y,o=i.className;n-e+a>=t?-1===o.indexOf("fixed-bottom")&&y.addClass("fixed-bottom").removeClass("hide"):n>=t?-1===o.indexOf("hide")&&y.addClass("hide").removeClass("fixed-bottom fixed-top"):n+s-a>=t?-1===o.indexOf("fixed-top")&&y.addClass("fixed-top").removeClass("hide absolute").css("top",""):n+s>=t?(-1===o.indexOf("absolute")&&y.addClass("absolute").removeClass("fixed-top hide"),i.style.top=n+s-a-t+"px"):t>n+s&&-1===o.indexOf("hide")&&y.addClass("hide").removeClass("absolute"),r.trigger("scroll")})}}}),define("js/plugin/wx-share",["jquery"],function(e,a,s){var n=e("jquery");s.exports=function(){var e="http://www.yohoshow.com/api/wechat/getSignPackage";n.getJSON(e+"?pageurl="+encodeURIComponent(location.href.split("#")[0])+"&callback=?",function(e){var a,s,n,i;void 0!==e&&""!==e&&(a=e.appId.toString(),s=e.timestamp,n=e.nonceStr.toString(),i=e.signature.toString(),wx.config({debug:!1,appId:a,timestamp:s,nonceStr:n,signature:i,jsApiList:["checkJsApi","onMenuShareTimeline","onMenuShareAppMessage","onMenuShareQQ","onMenuShareWeibo","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","translateVoice","startRecord","stopRecord","onRecordEnd","playVoice","pauseVoice","stopVoice","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","closeWindow","scanQRCode","chooseWXPay","openProductSpecificView","addCard","chooseCard","openCard"]}))}),wx.ready(function(){var e=n("#shareTitle").val(),a=n("#shareImg").val(),s=n("#shareDesc").val(),i=n("#shareLink").val(),t={title:e,desc:s,imgUrl:a,link:i};wx.onMenuShareAppMessage(t),wx.onMenuShareTimeline(t),wx.onMenuShareQQ(t),wx.onMenuShareWeibo(t)})}}),define("js/home/entry",["jquery","hammer","swiper","lazyload","index"],function(e,a,s){e("js/home/home"),e("js/home/maybe-like")}),define("js/home/home",["jquery","hammer","swiper","lazyload","index"],function(e,a,s){function n(){x+=10,k.css({transform:"rotateX("+x+"deg)","-webkit-transform":"rotateX("+x+"deg)","-moz-transform":"rotateX("+x+"deg)"}),x/90%2===1&&(q?(k.addClass("animate"),q=!1):(k.removeClass("animate"),q=!0)),x/90%2===0&&x%360!==0?window.setTimeout(n,3e3):x%360===0?window.setTimeout(n,6e4):d(function(){n()})}var i,t,o,r,l,d,c,u,p,h,f,g,m=e("jquery"),v=e("hammer"),w=e("swiper"),y=e("lazyload"),b=m(".mobile-wrap"),C=m(".overlay"),j=m(".side-nav"),x=0,k=m(".home-header .logo"),q=!0;e("js/home/maybe-like"),y(m("img.lazy")),f=new v(m(".nav-btn")[0]),f.on("tap",function(e){b.addClass("menu-open"),C.show().css("opacity",.3),j.addClass("on"),m("body").css({height:m(window).height(),width:"100%",overflow:"hidden"}),e.srcEvent.stopPropagation()}),g=new v(m(".mobile-wrap")[0]),g.on("tap",function(e){b.hasClass("menu-open")&&(b.removeClass("menu-open"),C.css("opacity",0),m(".sub-nav").removeClass("show"),j.removeClass("on"),m("body").css({height:"auto",overflow:"auto"}),setTimeout(function(){m(".overlay").hide()},300),e.srcEvent.stopPropagation())}),j.on("touchstart","li",function(){m(this).find(".sub-nav").size()>0&&(m(".sub-nav").removeClass("show"),m(this).find(".sub-nav").addClass("show"))}),m(".sub-nav").each(function(){m(this).find("li").eq(0).on("touchstart",function(e){m(".sub-nav").removeClass("show"),e.stopPropagation()})}),m(".banner-swiper").find("li").size()>1&&(i=new w(".banner-swiper",{lazyLoading:!0,lazyLoadingInPrevNext:!0,loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:".banner-top .pagination-inner"})),o=new w(".brands-swiper",{grabCursor:!0,slidesPerView:"auto",wrapperClass:"brands-list",slideElement:"li"}),t=new w(".recommend-swiper",{grabCursor:!0,slidesPerView:"auto",wrapperClass:"recommend-list",slideElement:"li"}),m(".trend-topic-swiper").find("li").size()>1&&(r=new w(".trend-topic-swiper",{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:".trend-topic-content .pagination-inner"})),m(".category-swiper").each(function(e,a){p="category-swiper"+e,m(this).addClass(p),m("."+p).find(".swiper-slide").size()>1&&(l=new w("."+p,{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:"."+p+" .pagination-inner"}))}),d=function(){var e=null,a=["webkit","moz","ms"];for(u=0;u<a.length;u++)c=a[u]+"RequestAnimationFrame",window[c]&&(h=!0,e=c);return h?function(a){window[e](a)}:function(e){window.setTimeout(e,67)}}(),setTimeout(n,3e3)}),define("js/home/maybe-like",["jquery","lazyload"],function(e,a,s){var n,i,t,o,r=e("jquery"),l=e("js/plugin/tip"),d=e("lazyload"),c=r(window).height(),u=r("#load-more").height(),p=r("#goods-list"),h=!1,f=0,g=null,m=r(".mobile-wrap").hasClass("kids-wrap")?!0:!1,v=r(".mobile-wrap").hasClass("lifestyle-wrap")?!0:!1,w=r("#maybe-like-nav");m?i="/product/recom/maylikekids":v?i="/product/recom/maylikelife":(g=r(".mobile-wrap").hasClass("boys-wrap")?"1,3":"2,3",i="/product/recom/maylike?gender="+g),t=w.children(".focus"),r("#maybe-like-nav").delegate("li","tap",function(){var e,a=r(this),s=r(".goods-list");a.hasClass("focus")||(o=a.index(),a.addClass("focus"),t.removeClass("focus"),s.not(".hide").addClass("hide"),e=s.eq(o),e.removeClass("hide"),t=a,r(document).trigger("scroll"))}),r(window).scroll(function(){if(r(window).scrollTop()+c>=r(document).height()-u-50){if(h)return;h=!0,r.ajax({type:"GET",url:i,data:{page:f+1},success:function(e){return" "===e?(h=!0,void(g&&(i="1,3"===g?"/boys/bottomBanner":"/girls/bottomBanner",r.ajax({type:"GET",url:i,success:function(e){e&&e[0]&&e[0].banner[0]&&(r("#load-more-img").show(),r("#load-more-img a").attr("url",e[0].banner[0].url),r("#load-more-img a > img").attr("src",e[0].banner[0].img))},error:function(){}})))):(n=p.find(".good-info").length,p.append(e),d(0===n?p.find(".good-info").find("img.lazy"):p.find(".good-info:gt("+(n-1)+")").find("img.lazy")),h=!1,void f++)},error:function(){l.show("网络断开连接了~"),h=!1}})}})}),define("js/index/entry",["jquery","hammer"],function(e,a,s){e("js/index/search"),e("js/index/footer")}),define("js/index/search",["jquery","hammer"],function(e,a,s){var n,i,t=e("jquery"),o=e("hammer"),r=t("#search-input input"),l=t("#search-input .clear-input"),d=t("#search-form"),c=t(".history"),u=t("#clear-history"),p=e("js/index/write-search"),h=p.getRanToken();n=new o(u[0]),n.on("tap",function(){localStorage.removeItem("historys"),c.html("")}),r.on("input",function(){""===r.val()?l.addClass("hide"):l.removeClass("hide")}),i=new o(l[0]),i.on("tap",function(){r.val("").trigger("input")}),function(){var e,a,s,n="";if(localStorage&&(a=localStorage.getItem("historys"),a&&a.length>0)){for(a=a.split(h),s=0;s<a.length;s++)e=a[s],""!==e&&(n+='<li><a href="/?query='+e+'">'+e+"</li>");c.html(n),u.removeClass("hide")}}(),p.bindWirteLocal(d)}),define("js/index/write-search",[],function(e,a,s){function n(){return t}function i(e){e.on("submit",function(){var e,a=this.query.value;if(localStorage){if(e=localStorage.getItem("historys"),e=e?e:"",e.indexOf(t+a+t)>-1)return;""===e&&(a=t+a),e+=a+t,localStorage.setItem("historys",e)}})}var t=" ??++ ";a.getRanToken=n,a.bindWirteLocal=i}),define("js/index/footer",["jquery","hammer"],function(e,a,s){function n(){var e="http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445",a=new Date;setTimeout(function(){new Date-a<2e3&&(window.location=e)},500)}var i,t,o=e("jquery"),r=e("hammer");o("#float-layer-close")&&o("#float-layer-close")[0]&&(i=new r(o("#float-layer-close")[0]),i.on("tap",function(e){o("#float-layer-app").hide(),window.setCookie("_float-layer-app","id490655927",{domain:".yohobuy.com"}),window.setCookie("_float-layer-app-close",1,{domain:".yohobuy.com",expires:1})})),o("#float-layer-btn")&&o("#float-layer-btn")[0]&&(t=new r(o("#float-layer-btn")[0]),t.on("tap",function(e){n("bottom")}),window.cookie("_float-layer-app")?o("#float-layer-app").hide():o("#float-layer-app").show())}),define("js/passport/entry",["jquery"],function(e,a,s){e("js/passport/register/register"),e("js/passport/register/code"),e("js/passport/register/password"),e("js/passport/login/login"),e("js/passport/login/international"),e("js/passport/back/mobile"),e("js/passport/back/code"),e("js/passport/back/email"),e("js/passport/back/email-success"),e("js/passport/back/new-password")}),define("js/passport/register/register",["jquery"],function(e,a,s){var n=e("jquery"),i=n("#phone-num"),t=n("#country-select"),o=n("#area-code"),r=n("#btn-next"),l=e("js/passport/api"),d=e("js/plugin/tip"),c=n.trim,u=d.show;l.selectCssHack(n("#country-select")),l.bindClearEvt(),i.bind("input",function(){""===c(i.val())?r.addClass("disable"):r.removeClass("disable")}),t.change(function(){o.text(t.val())}),r.on("touchstart",function(){var e=c(i.val()),a=t.val();r.hasClass("disable")||(l.phoneRegx[a].test(e)?n.ajax({url:"/passport/reg/verifymobile",type:"POST",data:{areaCode:a.replace("+",""),phoneNum:e},success:function(e){200===e.code?location.href=e.data:u(e.message)}}):u("手机号格式不正确,请重新输入"))})}),define("js/passport/api",["jquery"],function(e,a,s){function n(e){var a,s=r(".has-eye");e&&"open"===e.status?s.append('<div class="eye"></div>'):s.append('<div class="eye close"></div>'),a=s.children(".eye"),a.on("touchstart",function(e){var a=r(this),s=a.siblings(".pwd");e.preventDefault(),a.toggleClass("close"),a.hasClass("close")?s.attr("type","password"):s.attr("type","text"),s.focus()})}function i(){var e,a=r(".has-clear");a.append('<div class="clear-input"></div>'),e=a.children(".clear-input"),e.on("touchstart",function(a){var s=e.siblings(".input");s.val("").trigger("input").focus(),a.preventDefault()}),a.children(".input").bind("input",function(){var e=r(this),a=e.siblings(".clear-input"),s=l(e.val());""===s?a.hide():a.show()})}function t(e){return e.length>=6&&e.length<=20?!0:!1}function o(e){function a(){var a=e.find("option:selected").text().length;switch(a){case 2:e.outerWidth(90);break;case 3:e.outerWidth(110);break;default:e.outerWidth(130)}}var s=navigator.userAgent;s.match(/uc/i)&&s.match(/android/i)?e.change(function(){a()}):e.removeClass("in-android-uc")}var r=e("jquery"),l=r.trim,d=/^([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/,c={"+86":/^1[35847]{1}[0-9]{9}$/,"+852":/^[965]{1}[0-9]{7}$/,"+853":/^[0-9]{8}$/,"+886":/^[0-9]{10}$/,"+65":/^[98]{1}[0-9]{7}$/,"+60":/^1[1234679]{1}[0-9]{8}$/,"+1":/^[0-9]{10}$/,"+82":/^01[0-9]{9}$/,"+44":/^7[789][0-9]{8}$/,"+81":/^0[9|8|7][0-9]{9}$/,"+61":/^[0-9]{11}$/};s.exports={emailRegx:d,phoneRegx:c,bindEyesEvt:n,bindClearEvt:i,pwdValidate:t,selectCssHack:o}}),define("js/passport/register/code",["jquery"],function(e,a,s){e("js/passport/code")(!0)}),define("js/passport/code",["jquery"],function(e,a,s){var n=e("jquery");s.exports=function(a){function s(){var e,a=59;e=setInterval(function(){0===a?(o.text("重发验证码").removeClass("disable"),clearInterval(e)):o.text("重发验证码 ("+a--+"秒)")},1e3)}var i=n("#captcha"),t=n("#btn-next"),o=n("#captcha-tip"),r=n("#phone-num").val(),l=n("#area-code").val().replace("+",""),d=e("js/passport/api"),c=e("js/plugin/tip"),u=n.trim,p=c.show,h=a?"reg":"back";d.bindClearEvt(),i.bind("input",function(){""!==u(i.val())?t.removeClass("disable"):t.addClass("disable")}),o.on("touchstart",function(){o.hasClass("disable")||n.ajax({type:"POST",url:"/passport/"+h+"/sendcode",data:{phoneNum:r,areaCode:l},success:function(e){200===e.code?(o.text("重发验证码 (60秒)").addClass("disable"),s()):p(e.message)}})}),t.on("touchstart",function(){t.hasClass("disable")||n.ajax({type:"POST",url:"/passport/"+h+"/verifycode",data:{phoneNum:r,areaCode:l,code:u(i.val()),token:n("#token").val()},success:function(e){200===e.code?location.href=e.data:p(e.message)}})}),s()}}),define("js/passport/register/password",["jquery"],function(e,a,s){var n=e("jquery"),i=n("#pwd"),t=n("#btn-sure"),o=e("js/passport/api"),r=e("js/plugin/tip"),l=n.trim,d=r.show;o.bindEyesEvt({status:"open"}),i.bind("input",function(){""===l(i.val())?t.addClass("disable"):t.removeClass("disable")}),t.on("touchstart",function(){var e=l(i.val());t.hasClass("disable")||(o.pwdValidate(e)===!1?d("密码6-20位,请重新输入"):n.ajax({type:"POST",url:"/passport/reg/setpassword",data:{password:e,phoneNum:n("#phone-num").val(),areaCode:n("#area-code").val(),token:n("#token").val()},success:function(e){200===e.code?(d("注册成功"),setTimeout(function(){location.href=e.data},1e3)):401===e.code||404===e.code||505===e.code?d(e.message):(d(e.message),setTimeout(function(){location.href=e.data},1e3))}}))})}),define("js/passport/login/login",["jquery"],function(e,a,s){function n(){p&&h?d.removeClass("disable"):d.addClass("disable")}function i(){c.show(),u.show()}function t(){c.hide(),u.hide()}var o=e("jquery"),r=o("#account"),l=o("#pwd"),d=o("#btn-login"),c=o("#retrive-pwd-mask"),u=o("#retrive-pwd-ways"),p=!1,h=!1,f=e("js/passport/api"),g=e("js/plugin/tip"),m=o.trim,v=g.show;f.bindEyesEvt(),f.bindClearEvt(),r.bind("input",function(){p=""!==m(r.val())?!0:!1,n()}),l.bind("input",function(){h=""===m(l.val())?!1:!0,n()}),d.on("touchstart",function(){var e=m(r.val()),a=m(l.val());d.hasClass("disable")||((/^[0-9]+$/.test(e)||f.emailRegx.test(e))&&f.pwdValidate(a)?o.ajax({type:"POST",url:"/passport/login/auth",data:{account:e,password:a},success:function(e){200===e.code?(v("登录成功"),setTimeout(function(){location.href=e.data},1e3)):v(e.message)},error:function(){v("网络断开连接啦~")}}):v("账号或密码有错误,请重新输入"))}),o("#forget-pwd").on("touchstart",function(){i()}),c.on("touchstart",function(){t()}),o("#cancel-retrive").on("touchstart",function(e){e.preventDefault(),t()}),r.trigger("input"),l.trigger("input")}),define("js/passport/login/international",["jquery"],function(e,a,s){function n(){c&&u?d.removeClass("disable"):d.addClass("disable")}var i=e("jquery"),t=i("#phone-num"),o=i("#country-select"),r=i("#area-code"),l=i("#pwd"),d=i("#btn-login"),c=!1,u=!1,p=e("js/passport/api"),h=e("js/plugin/tip"),f=i.trim,g=h.show;p.selectCssHack(o),p.bindEyesEvt(),p.bindClearEvt(),t.bind("input",function(){c=""===f(t.val())?!1:!0,n()}),l.bind("input",function(){var e=f(l.val());u=""===e?!1:!0,n()}),o.change(function(){r.text(o.val())}),d.on("touchstart",function(){var e=f(t.val()),a=o.val(),s=f(l.val());d.hasClass("disable")||(p.phoneRegx[a].test(e)&&p.pwdValidate(s)?i.ajax({type:"POST",url:"/passport/login/auth",data:{areaCode:a.replace("+",""),account:e,password:s},success:function(e){200===e.code?(g("登录成功"),setTimeout(function(){location.href=e.data},1e3)):g(e.message)},error:function(){g("网络断开连接啦~")}}):g("账号或密码有错误,请重新输入"))}),t.trigger("input"),l.trigger("input")}),define("js/passport/back/mobile",["jquery"],function(e,a,s){var n=e("jquery"),i=n("#phone-num"),t=n("#country-select"),o=n("#area-code"),r=n("#btn-next"),l=e("js/passport/api"),d=e("js/plugin/tip"),c=n.trim,u=d.show;l.selectCssHack(n("#country-select")),l.bindClearEvt(),i.bind("input",function(){""===c(i.val())?r.addClass("disable"):r.removeClass("disable")}),t.change(function(){o.text(t.val())}),r.on("touchstart",function(){var e=c(i.val()),a=t.val();r.hasClass("disable")||(l.phoneRegx[a].test(e)?n.ajax({url:"/passport/back/sendcode",type:"POST",data:{areaCode:a.replace("+",""),phoneNum:e},success:function(e){200===e.code?location.href=e.data:u(e.message)}}):u("手机号格式不正确,请重新输入"))})}),define("js/passport/back/code",["jquery"],function(e,a,s){e("js/passport/code")(!1)}),define("js/passport/back/email",["jquery"],function(e,a,s){var n=e("jquery"),i=n("#email"),t=n("#btn-sure"),o=e("js/passport/api"),r=e("js/plugin/tip"),l=n.trim,d=r.show;o.bindClearEvt(),i.bind("input",function(){""===l(i.val())?t.addClass("disable"):t.removeClass("disable")}),t.on("touchstart",function(){var e=l(i.val());t.hasClass("disable")||(o.emailRegx.test(e)?n.ajax({url:"/passport/back/sendemail",type:"POST",data:{email:e},success:function(e){200===e.code?location.href=e.data:d(e.message)}}):d("邮箱格式不正确,请重新输入"))})}),define("js/passport/back/email-success",["jquery"],function(e,a,s){var n=e("jquery"),i=n("#resend"),t=e("js/plugin/tip"),o=t.show;i.on("touchstart",function(e){e.preventDefault(),n.ajax({url:i.data("url"),type:"GET",success:function(e){o(200===e.code?e.message:e.message)}})})}),define("js/passport/back/new-password",["jquery"],function(e,a,s){var n=e("jquery"),i=n("#pwd"),t=n("#btn-ok"),o=e("js/passport/api"),r=e("js/plugin/tip"),l=n.trim,d=r.show,c=n("#phone-num");o.bindEyesEvt(),i.bind("input",function(){""===l(i.val())?t.addClass("disable"):t.removeClass("disable")}),t.on("touchstart",function(){var e,a,s=l(i.val()),r=!0;t.hasClass("disable")||(e={password:s},0===c.length&&(r=!1),r?(n.extend(e,{phoneNum:c.val(),areaCode:n("#areaCode").val(),token:n("#token").val()}),a="/passport/back/passwordByMobile"):(n.extend(e,{code:n("#email-code").val()}),a="/passport/back/passwordByEmail"),o.pwdValidate(s)?n.ajax({type:"POST",url:a,data:e,success:function(e){200===e.code?(d("密码修改成功"),setTimeout(function(){location.href=e.data},1e3)):d(e.message)}}):d("密码6-20位,请重新输入"))})}),define("js/product/entry",["jquery","swiper","hammer","lazyload","index"],function(e,a,s){e("js/product/newsale/newarrival"),e("js/product/newsale/discount"),e("js/product/list"),e("js/product/detail/detail")}),define("js/product/newsale/newarrival",["jquery","swiper","hammer","lazyload","index"],function(e,a,s){function n(e){var a,s,n,i,l,u,p={};if(!d){if(e){for(s in q)q.hasOwnProperty(s)&&(q[s].reload=!0);switch(k.children(".active").removeClass("active"),z.addClass("active"),e.type){case"gender":a={gender:e.id};break;case"brand":a={brand:e.id};break;case"sort":a={sort:e.id};break;case"color":a={color:e.id};break;case"size":a={size:e.id};break;case"price":a={price:e.id};break;case"discount":a={discount:e.id};break;case"limit":a={limit:e.id};break;case"channel":a={channel:e.id};break;case"p_d":a={p_d:e.id}}c.extend(b,a)}if(z.hasClass("today")?(i="today",l=1):z.hasClass("week")?(i="week",l=2):z.hasClass("sale")&&(i="sale",l=3),n=q[i],u=n.page+1,n.reload)u=1;else if(n.end)return;c.extend(p,b,{dayLimit:l,page:u}),d=!0,g.showLoadingMask(),c.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:p,success:function(e){var a,s;switch(i){case"today":a=t;break;case"week":a=o;break;case"sale":a=r}" "===e?(n.end=!0,n.reload&&a.html(y)):n.reload?(a.html(e),h(a.find(".lazy"))):(s=a.find(".good-info").length,a.append(e),h(a.find(".good-info:gt("+(s-1)+") .lazy"))),n.reload=!1,n.page=u,d=!1,g.hideLoadingMask(),window.rePosFooter()}})}}var i,t,o,r,l,d,c=e("jquery"),u=e("swiper"),p=e("hammer"),h=e("lazyload"),f=e("js/plugin/filter"),g=e("js/plugin/loading"),m=c("#goods-container"),v=m.children(),t=c(v.get(0)),o=c(v.get(1)).addClass("hide"),r=c(v.get(2)).addClass("hide"),w=c(window).height(),y='<p class="no-result">未找到相关搜索结果</p>',b={gender:c("#gender").val(),brand:c("#brand").val(),sort:c("#sort").val(),color:c("#color").val(),size:c("#size").val(),price:c("#price").val(),discount:c("#discount").val(),limit:c("#limit").val(),channel:c("#channel").val(),p_d:c("#p_d").val(),dayLimit:1},C=new Date,j=C.getMonth()+1,x=C.getDate(),k=c("#list-nav"),q={today:{reload:!0,page:0,end:!1},week:{reload:!0,page:0,end:!1},sale:{reload:!0,page:0,end:!1}},z=k.find(".active");c("#today a").text(j+"月"+x+"号"),c(".swiper-container .swiper-slide").length>1&&(i=new u(".swiper-container",{lazyLoading:!0,lazyLoadingInPrevNext:!0,loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,pagination:".swiper-pagination"})),c.ajax({type:"GET",url:"/product/newsale/filter",data:b,success:function(e){m.append(e),f.initFilter({fCbFn:n,hCbFn:function(){z.addClass("active"),z.siblings(".filter").removeClass("active")},missStatus:!0})}}),h(c(".lazy")),l=new p(k[0]),l.on("tap",function(e){var a,s,i,l=c(e.target).closest("li");if(l.hasClass("filter"))l.hasClass("active")?(f.hideFilter(),z.addClass("active"),l.removeClass("active")):(z=l.siblings(".active"),z.removeClass("active"),l.addClass("active"),f.showFilter());else{if(l.hasClass("today")?s="today":l.hasClass("week")?s="week":l.hasClass("sale")&&(s="sale"),a=q[s],!l.hasClass("active")){if(i=l.siblings(".active"),z=l,i.hasClass("filter"))f.hideFilter();else switch(m.children(".container:not(.hide)").addClass("hide"),s){case"today":t.removeClass("hide");break;case"week":o.removeClass("hide");break;case"sale":r.removeClass("hide")}i.removeClass("active"),l.addClass("active")}a.reload&&n()}}),c(window).scroll(function(){c(window).scrollTop()+w>c(document).height()-.25*m.height()-50&&void 0!==z&&n()}),n()}),define("js/plugin/filter",["jquery","hammer"],function(e,a,s){function n(){l.addClass("hide"),u&&(l.find(".classify-item.active").removeClass("active"), | ||
2 | -l.find(".classify-item:first-child").addClass("active"))}function i(){l.removeClass("hide")}function t(e){e.hasClass("active")||(e.siblings(".active").removeClass("active"),e.addClass("active"))}function o(e){var a,s,i=e.data("id"),t=e.closest(".sub-classify"),o=t.siblings(".shower");e.hasClass("chosed")||(t.children(".chosed").removeClass("chosed"),e.addClass("chosed"),a=p.trim(e.html()),s=p.trim(o.html()),o.html(s.substring(0,s.indexOf("</span>")+7)+a.substring(0,a.indexOf("<i"))),0===e.index()?o.addClass("default"):o.removeClass("default"),d&&d({type:t.data("type"),id:i}),n(),u&&(e.removeClass("chosed"),t.children(":first-child").addClass("chosed")))}function r(e){var a;d=e.fCbFn,c=e.hCbFn,u=e.missStatus,l=p(".filter-mask"),a=new h(l[0]),a.on("tap",function(e){var a,s=p(e.target);s.closest(".filter-body").length>0?(a=s.closest(".sub-item"),a.length>0?(a=s.closest("li"),o(a)):(a=s.closest(".classify-item"),e.srcEvent.stopPropagation(),t(a))):(n(),c&&c())})}var l,d,c,u,p=e("jquery"),h=e("hammer");a.initFilter=r,a.showFilter=i,a.hideFilter=n}),define("js/product/newsale/discount",["jquery","swiper","hammer","lazyload","index"],function(e,a,s){function n(e){var a,s,n,i,t,l={};if(!o){if(e){for(s in j)j.hasOwnProperty(s)&&(j[s].reload=!0);switch(C.children(".active").removeClass("active"),x.addClass("active"),e.type){case"gender":a={gender:e.id};break;case"brand":a={brand:e.id};break;case"sort":a={sort:e.id};break;case"color":a={color:e.id};break;case"size":a={size:e.id};break;case"price":a={price:e.id};break;case"discount":a={discount:e.id}}r.extend(b,a)}if(x.hasClass("new")?i="newest":x.hasClass("price")?i="price":x.hasClass("discount")&&(i="discount"),n=j[i],t=n.page+1,n.reload)t=1;else if(n.end)return;r.extend(l,b,{type:i,order:n.order,page:t}),o=!0,p.showLoadingMask(),r.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:l,success:function(e){var a,s;switch(i){case"newest":a=g;break;case"price":a=m;break;case"discount":a=v}" "===e?(n.end=!0,n.reload&&a.html(y)):n.reload?(a.html(e),c(a.find(".lazy"))):(s=a.find(".good-info").length,a.append(e),c(a.find(".good-info:gt("+(s-1)+") .lazy"))),n.reload=!1,n.page=t,o=!1,p.hideLoadingMask(),window.rePosFooter()}})}}var i,t,o,r=e("jquery"),l=e("swiper"),d=e("hammer"),c=e("lazyload"),u=e("js/plugin/filter"),p=e("js/plugin/loading"),h=r("#goods-container"),f=h.children(),g=r(f.get(0)),m=r(f.get(1)),v=r(f.get(2)),w=r(window).height(),y='<p class="no-result">未找到相关搜索结果</p>',b={gender:r("#gender").val(),brand:r("#brand").val(),sort:r("#sort").val(),color:r("#color").val(),size:r("#size").val(),price:r("#price").val(),discount:r("#discount").val()},C=r("#list-nav"),j={newest:{order:1,reload:!0,page:0,end:!1},price:{order:0,reload:!0,page:0,end:!1},discount:{order:0,reload:!0,page:0,end:!1}},x=C.find(".active");r(".swiper-container .swiper-slide").length>1&&(i=new l(".swiper-container",{lazyLoading:!0,lazyLoadingInPrevNext:!0,loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,pagination:".swiper-pagination"})),r.ajax({type:"GET",url:"/product/newsale/filter",data:b,success:function(e){h.append(e),u.initFilter({fCbFn:n,hCbFn:function(){x.addClass("active"),x.siblings(".filter").removeClass("active")},missStatus:!0})}}),c(r(".lazy")),t=new d(C[0]),t.on("tap",function(e){var a,s,i,t=r(e.target).closest("li");if(t.hasClass("filter"))t.hasClass("active")?(u.hideFilter(),x.addClass("active"),t.removeClass("active")):(x=t.siblings(".active"),x.removeClass("active"),t.addClass("active"),u.showFilter());else{if(t.hasClass("new")?s="newest":t.hasClass("price")?s="price":t.hasClass("discount")&&(s="discount"),a=j[s],t.hasClass("active")){if(t.hasClass("new"))return;(t.hasClass("price")||t.hasClass("discount"))&&(t.find(".icon > .iconfont").toggleClass("cur"),x=t,a.reload=!0,a.order=0===a.order?1:0)}else{if(i=t.siblings(".active"),x=t,i.hasClass("filter"))u.hideFilter();else switch(h.children(".container:not(.hide)").addClass("hide"),s){case"newest":g.removeClass("hide");break;case"price":m.removeClass("hide");break;case"discount":v.removeClass("hide")}i.removeClass("active"),t.addClass("active")}a.reload&&n()}}),r(window).scroll(function(){r(window).scrollTop()+w>r(document).height()-.25*h.height()-50&&void 0!==x&&n()}),n()}),define("js/product/list",["jquery","hammer","lazyload"],function(e,a,s){function n(e){var a,s,n,t,o,r={};if(!i){if(e){for(s in q)q.hasOwnProperty(s)&&(q[s].reload=!0);switch(k.children(".active").removeClass("active"),z.addClass("active"),e.type){case"gender":a={gender:e.id};break;case"brand":a={brand:e.id};break;case"sort":a={sort:e.id};break;case"color":a={color:e.id};break;case"size":a={size:e.id};break;case"price":a={price:e.id};break;case"discount":a={discount:e.id}}d.extend(x,a)}if(z.hasClass("new")?t="newest":z.hasClass("price")?t="price":z.hasClass("discount")&&(t="discount"),n=q[t],o=n.page+1,n.reload)o=1;else if(n.end)return;d.extend(r,x,{type:t,order:n.order,page:o}),i=!0,v.showLoadingMask(),d.ajax({type:"GET",url:"/index/search/search",data:r,success:function(e){var a,s,r='<p class="no-result">未找到相关搜索结果</p>';switch(t){case"newest":s=y;break;case"price":s=b;break;case"discount":s=C}" "===e?(n.end=!0,n.reload&&s.html(r)):n.reload?(s.html(e),u(s.find(".lazy"))):(a=s.find(".good-info").length,s.append(e),u(s.find(".good-info:gt("+(a-1)+") .lazy"))),n.reload=!1,n.page=o,i=!1,v.hideLoadingMask(),window.rePosFooter()}})}}var i,t,o,r,l,d=e("jquery"),c=e("hammer"),u=e("lazyload"),p=d("#brand-header"),h=d("#intro-box"),f=e("js/plugin/filter"),g=e("js/index/write-search"),m=e("js/plugin/tip"),v=e("js/plugin/loading"),w=d("#goods-container"),y=w.children(".new-goods"),b=w.children(".price-goods"),C=w.children(".discount-goods"),j=d(window).height(),x={gender:d("#gender").val(),brand:d("#brand").val(),sort:d("#sort").val(),color:d("#color").val(),size:d("#size").val(),price:d("#price").val(),discount:d("#discount").val(),query:d("#query").val()},k=d("#list-nav"),q={newest:{order:1,reload:!0,page:0,end:!1},price:{order:0,reload:!0,page:0,end:!1},discount:{order:0,reload:!0,page:0,end:!1}},z=k.find(".active");d.ajax({type:"GET",url:"/search/filter",data:x,success:function(e){w.append(e),f.initFilter({fCbFn:n,hCbFn:function(){z.addClass("active"),z.siblings(".filter").removeClass("active")}})}}),u(d(".lazy")),g.bindWirteLocal(d("#search-form")),t=new c(k[0]),t.on("tap",function(e){var a,s,i,t=d(e.target).closest("li");if(t.hasClass("filter"))t.hasClass("active")?(f.hideFilter(),z.addClass("active"),t.removeClass("active")):(z=t.siblings(".active"),z.removeClass("active"),t.addClass("active"),f.showFilter());else{if(t.hasClass("new")?s="newest":t.hasClass("price")?s="price":t.hasClass("discount")&&(s="discount"),a=q[s],t.hasClass("active")){if(t.hasClass("new"))return;(t.hasClass("price")||t.hasClass("discount"))&&(t.find(".icon > .iconfont").toggleClass("cur"),z=t,a.reload=!0,a.order=0===a.order?1:0)}else{if(i=t.siblings(".active"),z=t,i.hasClass("filter"))f.hideFilter();else switch(w.children(".container:not(.hide)").addClass("hide"),s){case"newest":y.removeClass("hide");break;case"price":b.removeClass("hide");break;case"discount":C.removeClass("hide")}i.removeClass("active"),t.addClass("active")}a.reload&&n()}}),d(window).scroll(function(){d(window).scrollTop()+j>d(document).height()-.25*w.height()&&n()}),p.length>0&&(o=new c(p.children(".btn-intro")[0]),o.on("tap",function(){h.removeClass("hide"),d("body").addClass("overflow-hidden")}),r=new c(document.getElementById("intro-box")),r.on("tap",function(e){var a=d(e.target);e.srcEvent.preventDefault(),(0===a.closest("#brand-intro").length||a.hasClass("close-intro"))&&(h.addClass("hide"),d("body").removeClass("overflow-hidden"))}),l=new c(p.children(".btn-col")[0]),l.on("tap",function(){var e,a=d(this),s=p.data("id");e=a.hasClass("coled")?"cancel":"ok",d.ajax({type:"POST",url:"/product/opt/favoriteBrand",data:{id:s,opt:e},success:function(e){200===e.code?a.toggleClass("coled"):m.show(e.message)},error:function(){m.show("网络断开连接了~")}})})),n()}),define("js/product/detail/detail",["jquery","swiper","lazyload","index"],function(e,a,s){var n,i=e("jquery"),t=e("swiper"),o=e("lazyload");o(i("img.lazy")),n=new t(".banner-swiper",{loop:!0,pagination:".banner-top .pagination-inner",slideElement:"div",nextButton:".swiper-button-next",prevButton:".swiper-button-prev"})}); | ||
1 | +define("index",["jquery","hammer","swiper","lazyload","mlellipsis","iscroll-probe","index"],function(e,a,n){var s;e("js/common"),e("js/category/entry"),e("js/guang/entry"),e("js/home/entry"),e("js/index/entry"),e("js/passport/entry"),e("js/product/entry"),n.exports=s}),define("js/common",["jquery"],function(e,a,n){function s(e){var a,n,s=document.cookie;return document.cookie&&""!==document.cookie&&(n=s.indexOf(e+"="),n>-1&&(n+=e.length+1,a=decodeURIComponent(d.trim(s.substring(n,s.indexOf(";",n)))))),a}function i(e,a,n){var s,i,t,o,r="";"undefined"!=typeof a&&(n=n||{},null===a&&(a="",n.expires=-1),n.expires&&("number"==typeof n.expires||n.expires.toUTCString)&&("number"==typeof n.expires?(o=new Date,o.setTime(o.getTime()+24*n.expires*60*60*1e3)):o=n.expires,r="; expires="+o.toUTCString()),s=n.path?"; path="+n.path:"",i=n.domain?"; domain="+n.domain:"",t=n.secure?"; secure":"",document.cookie=[e,"=",encodeURIComponent(a),r,s,i,t].join(""))}function t(){var e,a=s("_UID");return"undefined"==typeof a?0:(e=a.split("::"),"undefined"==typeof e||e.length<4?0:e)}function o(){var e=t();return 0===e?0:e[1]}function r(){var e=s("_g");return"undefined"==typeof e?"":JSON.parse(e).k}function l(){0!==c.length&&(d("body").height()<d(window).height()-u?c.addClass("bottom"):c.removeClass("bottom"))}var d=e("jquery"),c=d("#yoho-footer"),u=120;!function(){var e=c.children(".op-row"),a=t();d("body").height()<d(window).height()-u&&c.addClass("bottom"),0===a?e.prepend('<a href="http://m.yohobuy.com/signin.html">登录</a><span class="sep-line">|</span><a href="http://m.yohobuy.com/reg.html">注册</a>'):e.prepend('Hi,<a class="user-name" href="http://m.yohobuy.com/home?tmp='+Math.random()+'">'+a[0]+'</a><a href="http://m.yohobuy.com/passport/signout/index?token='+a[3]+'">退出</a>'),c.removeClass("hide")}(),window.cookie=s,window.setCookie=i,window.getUser=t,window.getUid=o,window.getShoppingKey=r,window.rePosFooter=l}),define("js/category/entry",["jquery","hammer","swiper","lazyload","index"],function(e,a,n){e("js/category/index"),e("js/category/brand")}),define("js/category/index",["jquery","hammer"],function(e,a,n){var s,i,t=e("jquery"),o=e("hammer"),r=t(".category-nav"),l=t(".category-container"),d=l.children(".content"),c=d.not(".hide");t("#search-input").focus(function(){t(this).blur()}),s=new o(r[0]),s.on("tap",function(e){var a=t(e.target).closest("li"),n=a.index();a.hasClass("focus")||(r.find("li.focus").removeClass("focus"),a.addClass("focus"),c.addClass("hide"),c=d.eq(n).removeClass("hide"))}),i=new o(l[0]),i.on("tap",function(e){var a,n,s,i=t(e.target);if(n=i.closest(".p-level-item"),n.length>0){if(s=n.index(),a=i.closest(".content").find(".sub-level"),i.hasClass("focus"))return;i.closest(".primary-level").children(".focus").removeClass("focus"),i.addClass("focus"),a.not(".hide").addClass("hide"),a.eq(s).removeClass("hide")}})}),define("js/category/brand",["jquery","hammer","swiper","lazyload","index"],function(e,a,n){function s(e){var a=o("#keyword").val(),n=o("#gender").val();o.get("/brands/search",{keyword:a,gender:n,type:e},function(e){o(".search-result").html(e)})}var i,t,o=e("jquery"),r=e("hammer"),l=e("swiper"),d=e("lazyload"),c=o(".brand-list"),u=o(".newbrand-search").outerHeight(),p=o(".yoho-header").outerHeight(),h=parseInt(u)+parseInt(p)-1;i=new l(".swiper-container",{lazyLoading:!0,loop:!0,autoplay:3e3,pagination:".swiper-pagination .pagination-inner"}),d(o("img.lazy")),o(".yoho-header").css({"z-index":2,position:"fixed"}),o(".banner-top").css("padding-top","90px"),c.length>0&&o(window).scroll(function(){var e=o(window).scrollTop();o(".brand-list").each(function(){var a=o(this).offset().top-h;e>=a?(c.find(".title-bar").css("position","static"),o(this).find(".title-bar").css({position:"fixed",top:h})):o(this).find(".title-bar").css("position","static")})}),o("#right-bar .con").find("b").unbind()[0]&&(t=new r(o("#right-bar .con").find("b").unbind()[0]),t.on("tap",function(e){var a=o(this).index();o(".bar-"+a).size()>0&&(document.body.scrollTop=parseInt(o(".bar-"+a)[0].offsetTop)-parseInt(h-1))})),o("#keyword").on("keyup",function(){s(0)}).on("keydown",function(){o(this).closest(".search-box").css("width","11.25rem"),o(".search-action").show()}).on("blur",function(){o(this).closest(".search-box").css("width","12.5rem"),o(".search-action").hide()}),o("#search-btn").on("tap",function(){s(1)}),o(".clear-text").on("tap",function(){o("#keyword").val("").trigger("input")}),o("form.search-box").on("submit",function(){return!1}),o(".clear-history").on("tap",function(){o("#history-keyword").remove(),o(this).hide()})}),define("js/guang/entry",["jquery","hammer","lazyload","swiper","mlellipsis","iscroll-probe","index"],function(e,a,n){e("js/guang/plus-star/list"),e("js/guang/plus-star/detail"),e("js/guang/home"),e("js/guang/list"),e("js/guang/detail")}),define("js/guang/plus-star/list",["jquery","hammer","lazyload","swiper","index"],function(e,a,n){var s,i,t=e("jquery"),o=e("hammer"),r=e("lazyload"),l=e("swiper"),d=t("#nav-tab > li"),c=t("#ps-content > .content");r(t("img.lazy")),s=new l(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),i=new o(document.getElementById("nav-tab")),i.on("tap",function(e){var a=t(e.target).closest("li");a.hasClass("focus")||(d.toggleClass("focus"),c.toggleClass("hide"),t(document).trigger("scroll"))})}),define("js/guang/plus-star/detail",["jquery","hammer","mlellipsis","lazyload"],function(e,a,n){var s,i,t,o,r=e("jquery"),l=e("hammer"),d=e("mlellipsis"),c=e("lazyload"),u=r("#intro"),p=r("#intro-more-txt"),h=r("#related-infos-container"),f=e("js/guang/info"),g=e("js/plugin/tip"),m=r("#brand-info").data("id");d.init(),c(r("img.lazy")),u[0].mlellipsis(3),setTimeout(function(){s=u.text(),i=u.attr("title")}),f.initInfosEvt(h),t=new l(document.getElementById("more-intro")),t.on("tap",function(e){var a=r(e.target).closest("#more-intro");a.toggleClass("spread"),a.hasClass("spread")?(u.text(i),p.text("收起")):(u.text(s),p.text("more"),r(window).scrollTop(0,400)),e.preventDefault()}),o=new l(document.getElementById("brand-like")),o.on("tap",function(e){var a="ok",n=r(e.target);e.preventDefault(),n.hasClass("like")&&(a="cancel"),r.ajax({type:"POST",url:"/product/opt/favoriteBrand",data:{id:m,opt:a},success:function(e){200===e.code?n.toggleClass("like"):400===e.code||412===e.code?g.show("未登录"):g.show(e.message)},error:function(){g.show("网络断开连接了~")}})})}),define("js/guang/info",["jquery","hammer","mlellipsis","lazyload"],function(e,a,n){function s(e){d(e.find("img.lazy")),e.each(function(){var e=o(this),a=e.find(".info-title"),n=e.find(".info-text");a[0].mlellipsis(2),n[0].mlellipsis(2)})}function i(e){var a=new r(e[0]);a.on("tap",function(e){var a,n,s=o(e.target),i="ok";a=s.closest(".like-btn"),a.length>0&&(a.hasClass("like")&&(i="cancel"),n=s.closest(".guang-info"),o.ajax({type:"POST",url:"/guang/opt/praiseArticle",data:{id:n.data("id"),opt:i},success:function(e){var n=e.code;200===n&&(a.next(".like-count").text(e.data),a.toggleClass("like"))},error:function(){c.show("网络断开连接了~")}}))}),s(e.find(".guang-info"))}function t(e,a){var n;g||a.end||(1===a.page&&u.showLoadingMask(),n=e.find(".guang-info").length,g=!0,o.ajax({type:"GET",url:" /guang/index/page",data:a,success:function(i){var t;return" "===i?(a.end=!0,g=!1,h.addClass("hide"),void f.removeClass("hide")):(e.append(i),t=n>0?e.find(".guang-info:gt("+(n-1)+")"):e.find(".guang-info"),s(t),1===a.page&&u.hideLoadingMask(),a.page++,void(g=!1))},error:function(){c.show("网络断开连接了~"),g=!1}}))}var o=e("jquery"),r=e("hammer"),l=e("mlellipsis"),d=e("lazyload"),c=e("js/plugin/tip"),u=e("js/plugin/loading"),p=o("#load-more-info"),h=o(""),f=o(""),g=!1;l.init(),p.length>0&&(h=p.children(".loading"),f=p.children(".no-more")),a.initInfosEvt=i,a.setLazyLoadAndMellipsis=s,a.loadMore=t}),define("js/plugin/tip",["jquery"],function(e,a,n){function s(e,a){var n,s;"undefined"!=typeof e&&(n=e.toString(),s=a&&a>0?a:2e3,i.text(n).show(),t=setTimeout(function(){"block"===i.css("display")&&i.hide()},s))}var i,t,o=e("jquery");!function(){var e='<div id="yoho-tip" class="yoho-tip"></div>';o(".yoho-page").append(e),i=o("#yoho-tip"),i.on("tap",function(){i.hide(),clearTimeout(t)})}(),a.show=s}),define("js/plugin/loading",["jquery"],function(e,a,n){function s(){t.removeClass("hide")}function i(){t.addClass("hide")}var t,o=e("jquery"),r=o(".yoho-page");!function(){var e='<div class="loading-mask hide"><div class="loading"></div></div>';r.append(e),t=r.children(".loading-mask")}(),a.showLoadingMask=s,a.hideLoadingMask=i}),define("js/guang/home",["jquery","hammer","swiper","mlellipsis","lazyload","index"],function(e,a,n){var s,i,t=e("jquery"),o=e("hammer"),r=e("swiper"),l=e("js/guang/info"),d=l.loadMore,c=t("#load-more-info"),u=t(""),p=t(""),h=t(window).height(),f=c.height(),g=t("#info-list"),m=g.children(".info-list"),v=t("#guang-nav"),w=v.children(".focus"),y=w.data("type"),b={};c.length>0&&(u=c.children(".loading"),p=c.children(".no-more")),s=new r(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),l.initInfosEvt(g),function(){var e=t("#gender").val();v.children(".guang-nav-item").each(function(){var a=t(this).data("type"),n=t(this).hasClass("focus");b[a]={page:n?2:1,gender:e,type:a,end:!1}})}(),i=new o(v[0]),i.on("tap",function(e){var a,n,s=t(e.target).closest(".guang-nav-item");s.hasClass("focus")||(n=s.index(),s.addClass("focus"),w.removeClass("focus"),m.not(".hide").addClass("hide"),a=m.eq(n),a.removeClass("hide"),w=s,y=s.data("type"),1===b[y].page&&d(a,b[y]),b[y].end?(u.addClass("hide"),p.removeClass("hide")):(u.removeClass("hide"),p.addClass("hide")))}),t(document).scroll(function(){t(window).scrollTop()+h>=t(document).height()-f&&d(m.not(".hide"),b[y])})}),define("js/guang/list",["jquery","hammer","mlellipsis","lazyload"],function(e,a,n){var s=e("jquery"),i=e("js/guang/info"),t=i.loadMore,o=s(window).height(),r=s("#load-more").height(),l=s("#author-infos"),d=s("#tag"),c=s("#gender"),u=s("#isApp"),p={page:2,end:!1},h=s("#info-list");i.initInfosEvt(h),l.length>0&&s.extend(p,{authorId:l.data("id")}),d.length>0&&s.extend(p,{tag:d.val(),gender:c.val(),isApp:u.val()}),s(document).scroll(function(){s(window).scrollTop()+o>=s(document).height()-r-50&&t(h,p)})}),define("js/guang/detail",["jquery","mlellipsis","lazyload","iscroll-probe"],function(e,a,n){function s(e){var a=e.offset().left,n=-b+a+w/2+"px";o.css({backgroundPosition:n+" bottom"}),m&&y.css({backgroundPosition:n+" bottom"})}function i(e){var a,n,i,p=u(e.currentTarget),f=p.index();p.hasClass("focus")||(r.filter(".focus").removeClass("focus"),m&&(a=p.closest(".fixed-thumb-container").length>0?o:y,n=a.find(".thumb").eq(f),y.find(".thumb.focus").removeClass("focus"),n.addClass("focus")),p.addClass("focus"),s(p),l.not(".hide").addClass("hide"),i=l.eq(f),i.removeClass("hide"),h(i.find(".lazy")),m?c&&c.scrollToElement(d,400):u("body").animate({scrollTop:t.offset().top},400))}var t,o,r,l,d,c,u=e("jquery"),p=e("mlellipsis"),h=e("lazyload"),f=e("iscroll-probe"),g=u(".author .intro"),m=navigator.userAgent.indexOf("iPhone")>0?!0:!1,v=u(".collocation-block").length>0?!0:!1,w=0,y=u(""),d=document.querySelector("#wrapper .collocation-block"),b=u(window).width();e("js/plugin/wx-share")(),m&&u("#wrapper").addClass("ios"),p.init(),h(u(".lazy")),u(".info-list .title, .one-good .reco-name").each(function(){this.mlellipsis(2)}),parseInt(g.offset().left,10)===parseInt(g.css("margin-left"),10)&&g.css("padding-top",0),v&&(t=u(".collocation-block"),o=t.children(".thumb-container"),r=o.find("li"),l=t.find(".prod"),w=r.width(),m&&(y=u("#wrapper").after(o.clone().addClass("fixed-thumb-container fixed-bottom")).next(".thumb-container"),h(y.find(".lazy"),{event:"sporty"})),s(r.filter(".focus")),o.delegate(".thumb","touchend",i),m&&y.delegate(".thumb","touchend",i)),window.onload=function(){var e,a,n,s,i,r=u("#scroller");if(m){if(c=new f("#wrapper",{probeType:3,mouseWheel:!0,click:!0}),document.addEventListener("touchmove",function(e){e.preventDefault()},!1),!v)return void c.on("scroll",function(){r.trigger("scroll")});e=u(window).height(),i=y[0],a=o.height(),n=t.height(),s=t.offset().top,c.on("scroll",function(){var t=-this.y,o=i.className;s-e+a>=t?-1===o.indexOf("fixed-bottom")&&y.addClass("fixed-bottom").removeClass("hide"):s>=t?-1===o.indexOf("hide")&&y.addClass("hide").removeClass("fixed-bottom fixed-top"):s+n-a>=t?-1===o.indexOf("fixed-top")&&y.addClass("fixed-top").removeClass("hide absolute").css("top",""):s+n>=t?(-1===o.indexOf("absolute")&&y.addClass("absolute").removeClass("fixed-top hide"),i.style.top=s+n-a-t+"px"):t>s+n&&-1===o.indexOf("hide")&&y.addClass("hide").removeClass("absolute"),r.trigger("scroll")})}}}),define("js/plugin/wx-share",["jquery"],function(e,a,n){var s=e("jquery");n.exports=function(){var e="http://www.yohoshow.com/api/wechat/getSignPackage";s.getJSON(e+"?pageurl="+encodeURIComponent(location.href.split("#")[0])+"&callback=?",function(e){var a,n,s,i;void 0!==e&&""!==e&&(a=e.appId.toString(),n=e.timestamp,s=e.nonceStr.toString(),i=e.signature.toString(),wx.config({debug:!1,appId:a,timestamp:n,nonceStr:s,signature:i,jsApiList:["checkJsApi","onMenuShareTimeline","onMenuShareAppMessage","onMenuShareQQ","onMenuShareWeibo","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","translateVoice","startRecord","stopRecord","onRecordEnd","playVoice","pauseVoice","stopVoice","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","closeWindow","scanQRCode","chooseWXPay","openProductSpecificView","addCard","chooseCard","openCard"]}))}),wx.ready(function(){var e=s("#shareTitle").val(),a=s("#shareImg").val(),n=s("#shareDesc").val(),i=s("#shareLink").val(),t={title:e,desc:n,imgUrl:a,link:i};wx.onMenuShareAppMessage(t),wx.onMenuShareTimeline(t),wx.onMenuShareQQ(t),wx.onMenuShareWeibo(t)})}}),define("js/home/entry",["jquery","hammer","swiper","lazyload","index"],function(e,a,n){e("js/home/home"),e("js/home/maybe-like")}),define("js/home/home",["jquery","hammer","swiper","lazyload","index"],function(e,a,n){function s(){x+=10,k.css({transform:"rotateX("+x+"deg)","-webkit-transform":"rotateX("+x+"deg)","-moz-transform":"rotateX("+x+"deg)"}),x/90%2===1&&(q?(k.addClass("animate"),q=!1):(k.removeClass("animate"),q=!0)),x/90%2===0&&x%360!==0?window.setTimeout(s,3e3):x%360===0?window.setTimeout(s,6e4):d(function(){s()})}var i,t,o,r,l,d,c,u,p,h,f,g,m=e("jquery"),v=e("hammer"),w=e("swiper"),y=e("lazyload"),b=m(".mobile-wrap"),C=m(".overlay"),j=m(".side-nav"),x=0,k=m(".home-header .logo"),q=!0;e("js/home/maybe-like"),y(m("img.lazy")),f=new v(m(".nav-btn")[0]),f.on("tap",function(e){return b.addClass("menu-open"),C.show().css("opacity",.3),j.addClass("on"),m("body").css({height:m(window).height(),width:"100%",overflow:"hidden"}),e.srcEvent.stopPropagation(),!1}),g=new v(m(".mobile-wrap")[0]),g.on("tap",function(e){return b.hasClass("menu-open")?(b.removeClass("menu-open"),C.css("opacity",0),m(".sub-nav").removeClass("show"),j.removeClass("on"),m("body").css({height:"auto",overflow:"auto"}),setTimeout(function(){m(".overlay").hide()},300),e.srcEvent.stopPropagation(),!1):void 0}),j.on("touchend","li",function(){m(this).find(".sub-nav").size()>0&&(m(".sub-nav").removeClass("show"),m(this).find(".sub-nav").addClass("show"))}),m(".sub-nav").each(function(){m(this).find("li").eq(0).on("touchend",function(e){return m(".sub-nav").removeClass("show"),!1})}).on("touchend",function(){m(".sub-nav").find("li").removeClass("current")}),m(".banner-swiper").find("li").size()>1&&(i=new w(".banner-swiper",{lazyLoading:!0,lazyLoadingInPrevNext:!0,loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:".banner-top .pagination-inner"})),o=new w(".brands-swiper",{grabCursor:!0,slidesPerView:"auto",wrapperClass:"brands-list",slideElement:"li"}),t=new w(".recommend-swiper",{grabCursor:!0,slidesPerView:"auto",wrapperClass:"recommend-list",slideElement:"li"}),m(".trend-topic-swiper").find("li").size()>1&&(r=new w(".trend-topic-swiper",{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:".trend-topic-content .pagination-inner"})),m(".category-swiper").each(function(e,a){p="category-swiper"+e,m(this).addClass(p),m("."+p).find(".swiper-slide").size()>1&&(l=new w("."+p,{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:"."+p+" .pagination-inner"}))}),d=function(){var e=null,a=["webkit","moz","ms"];for(u=0;u<a.length;u++)c=a[u]+"RequestAnimationFrame",window[c]&&(h=!0,e=c);return h?function(a){window[e](a)}:function(e){window.setTimeout(e,67)}}(),setTimeout(s,3e3)}),define("js/home/maybe-like",["jquery","hammer","lazyload"],function(e,a,n){function s(){m||(m=!0,d.ajax({type:"GET",url:o,data:{page:v+1},success:function(e){return" "===e?(m=!0,void(w&&(o="1,3"===w?"/boys/bottomBanner":"/girls/bottomBanner",d.ajax({type:"GET",url:o,success:function(e){e&&(d("#load-more-img").show(),d("#load-more-img a").attr("href",e.url),d("#load-more-img a > img").attr("src",e.img))},error:function(){}})))):(t=g.find(".good-info").length,g.append(e),p(0===t?g.find(".good-info").find("img.lazy"):g.find(".good-info:gt("+(t-1)+")").find("img.lazy")),m=!1,void v++)},error:function(){u.show("网络断开连接了~"),m=!1}}))}var i,t,o,r,l,d=e("jquery"),c=e("hammer"),u=e("js/plugin/tip"),p=e("lazyload"),h=d(window).height(),f=d("#load-more").height(),g=d("#goods-list"),m=!1,v=0,w=null,y=d(".mobile-wrap").hasClass("kids-wrap")?!0:!1,b=d(".mobile-wrap").hasClass("lifestyle-wrap")?!0:!1,C=d("#maybe-like-nav");y?o="/product/recom/maylikekids":b?o="/product/recom/maylikelife":(w=d(".mobile-wrap").hasClass("boys-wrap")?"1,3":"2,3",o="/product/recom/maylike?gender="+w),r=C.children(".focus"),b&&(i=new c(C[0]),i.on("tap",function(e){var a,n=d(e.target).closest("li"),s=d(".goods-list");n.hasClass("focus")||(l=n.index(),n.addClass("focus"),r.removeClass("focus"),s.not(".hide").addClass("hide"),a=s.eq(l),a.removeClass("hide"),r=n,d(document).trigger("scroll"))})),d(".maybe-like p").on("touchstart",function(e){s()}),d(window).scroll(function(){d(window).scrollTop()+h>=d(document).height()-f-50&&s()})}),define("js/index/entry",["jquery","hammer"],function(e,a,n){e("js/index/search"),e("js/index/footer"),e("js/index/channel")}),define("js/index/search",["jquery","hammer"],function(e,a,n){var s,i,t=e("jquery"),o=e("hammer"),r=t("#search-input input"),l=t("#search-input .clear-input"),d=t("#search-form"),c=t(".history"),u=t("#clear-history"),p=e("js/index/write-search"),h=p.getRanToken();s=new o(u[0]),s.on("tap",function(){localStorage.removeItem("historys"),c.html("")}),r.on("input",function(){""===r.val()?l.addClass("hide"):l.removeClass("hide")}),i=new o(l[0]),i.on("tap",function(){r.val("").trigger("input")}),function(){var e,a,n,s="";if(localStorage&&(a=localStorage.getItem("historys"),a&&a.length>0)){for(a=a.split(h),n=0;n<a.length;n++)e=a[n],""!==e&&(s+='<li><a href="/?query='+e+'">'+e+"</li>");c.html(s),u.removeClass("hide")}}(),p.bindWirteLocal(d)}),define("js/index/write-search",[],function(e,a,n){function s(){return t}function i(e){e.on("submit",function(){var e,a=this.query.value;if(localStorage){if(e=localStorage.getItem("historys"),e=e?e:"",e.indexOf(t+a+t)>-1)return;""===e&&(a=t+a),e+=a+t,localStorage.setItem("historys",e)}})}var t=" ??++ ";a.getRanToken=s,a.bindWirteLocal=i}),define("js/index/footer",["jquery","hammer"],function(e,a,n){function s(){var e="http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445",a=new Date;setTimeout(function(){new Date-a<2e3&&(window.location=e)},500)}var i,t,o=e("jquery"),r=e("hammer");o("#float-layer-close")&&o("#float-layer-close")[0]&&(i=new r(o("#float-layer-close")[0]),i.on("tap",function(e){o("#float-layer-app").hide(),window.setCookie("_float-layer-app","id490655927",{domain:".yohobuy.com"}),window.setCookie("_float-layer-app-close",1,{domain:".yohobuy.com",expires:1})})),o("#float-layer-btn")&&o("#float-layer-btn")[0]&&(t=new r(o("#float-layer-btn")[0]),t.on("tap",function(e){s("bottom")}),window.cookie("_float-layer-app")?o("#float-layer-app").hide():o("#float-layer-app").show())}),define("js/index/channel",["jquery"],function(e,a,n){var s=e("jquery"),i=s(".search-box"),t=s(".index-search"),o=s(".index-logo");i.find("input").on("focus",function(){o.css({width:0}),i.css({width:"12.8rem"}),t.css({width:"15.5rem"}),s(".clear-text, .no-search").show()}).on("blur",function(){o.css({width:"5.4rem"}),i.css({width:"8.8rem"}),t.css({width:"9.6rem"}),s(".clear-text, .no-search").hide()}),i.find(".clear-text").click(function(){i.find("input").val("").trigger("focus")}),i.find(".search-icon").click(function(){t.submit()})}),define("js/passport/entry",["jquery"],function(e,a,n){e("js/passport/register/register"),e("js/passport/register/code"),e("js/passport/register/password"),e("js/passport/login/login"),e("js/passport/login/international"),e("js/passport/back/mobile"),e("js/passport/back/code"),e("js/passport/back/email"),e("js/passport/back/email-success"),e("js/passport/back/new-password")}),define("js/passport/register/register",["jquery"],function(e,a,n){var s=e("jquery"),i=s("#phone-num"),t=s("#country-select"),o=s("#area-code"),r=s("#btn-next"),l=e("js/passport/api"),d=e("js/plugin/tip"),c=s.trim,u=d.show;l.selectCssHack(s("#country-select")),l.bindClearEvt(),i.bind("input",function(){""===c(i.val())?r.addClass("disable"):r.removeClass("disable")}),t.change(function(){o.text(t.val())}),r.on("touchstart",function(){var e=c(i.val()),a=t.val();r.hasClass("disable")||(l.phoneRegx[a].test(e)?s.ajax({url:"/passport/reg/verifymobile",type:"POST",data:{areaCode:a.replace("+",""),phoneNum:e},success:function(e){200===e.code?location.href=e.data:u(e.message)}}):u("手机号格式不正确,请重新输入"))})}),define("js/passport/api",["jquery"],function(e,a,n){function s(e){var a,n=r(".has-eye");e&&"open"===e.status?n.append('<div class="eye"></div>'):n.append('<div class="eye close"></div>'),a=n.children(".eye"),a.on("touchstart",function(e){var a=r(this),n=a.siblings(".pwd");e.preventDefault(),a.toggleClass("close"),a.hasClass("close")?n.attr("type","password"):n.attr("type","text"),n.focus()})}function i(){var e,a=r(".has-clear");a.append('<div class="clear-input"></div>'),e=a.children(".clear-input"),e.on("touchstart",function(a){var n=e.siblings(".input");n.val("").trigger("input").focus(),a.preventDefault()}),a.children(".input").bind("input",function(){var e=r(this),a=e.siblings(".clear-input"),n=l(e.val());""===n?a.hide():a.show()})}function t(e){return e.length>=6&&e.length<=20?!0:!1}function o(e){function a(){var a=e.find("option:selected").text().length;switch(a){case 2:e.outerWidth(90);break;case 3:e.outerWidth(110);break;default:e.outerWidth(130)}}var n=navigator.userAgent;n.match(/uc/i)&&n.match(/android/i)?e.change(function(){a()}):e.removeClass("in-android-uc")}var r=e("jquery"),l=r.trim,d=/^([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/,c={"+86":/^1[35847]{1}[0-9]{9}$/,"+852":/^[965]{1}[0-9]{7}$/,"+853":/^[0-9]{8}$/,"+886":/^[0-9]{10}$/,"+65":/^[98]{1}[0-9]{7}$/,"+60":/^1[1234679]{1}[0-9]{8}$/,"+1":/^[0-9]{10}$/,"+82":/^01[0-9]{9}$/,"+44":/^7[789][0-9]{8}$/,"+81":/^0[9|8|7][0-9]{9}$/,"+61":/^[0-9]{11}$/};n.exports={emailRegx:d,phoneRegx:c,bindEyesEvt:s,bindClearEvt:i,pwdValidate:t,selectCssHack:o}}),define("js/passport/register/code",["jquery"],function(e,a,n){e("js/passport/code")(!0)}),define("js/passport/code",["jquery"],function(e,a,n){var s=e("jquery");n.exports=function(a){function n(){var e,a=59;e=setInterval(function(){0===a?(o.text("重发验证码").removeClass("disable"),clearInterval(e)):o.text("重发验证码 ("+a--+"秒)")},1e3)}var i=s("#captcha"),t=s("#btn-next"),o=s("#captcha-tip"),r=s("#phone-num").val(),l=s("#area-code").val().replace("+",""),d=e("js/passport/api"),c=e("js/plugin/tip"),u=s.trim,p=c.show,h=a?"reg":"back";d.bindClearEvt(),i.bind("input",function(){""!==u(i.val())?t.removeClass("disable"):t.addClass("disable")}),o.on("touchstart",function(){o.hasClass("disable")||s.ajax({type:"POST",url:"/passport/"+h+"/sendcode",data:{phoneNum:r,areaCode:l},success:function(e){200===e.code?(o.text("重发验证码 (60秒)").addClass("disable"),n()):p(e.message)}})}),t.on("touchstart",function(){t.hasClass("disable")||s.ajax({type:"POST",url:"/passport/"+h+"/verifycode",data:{phoneNum:r,areaCode:l,code:u(i.val()),token:s("#token").val()},success:function(e){200===e.code?location.href=e.data:p(e.message)}})}),n()}}),define("js/passport/register/password",["jquery"],function(e,a,n){var s=e("jquery"),i=s("#pwd"),t=s("#btn-sure"),o=e("js/passport/api"),r=e("js/plugin/tip"),l=s.trim,d=r.show;o.bindEyesEvt({status:"open"}),i.bind("input",function(){""===l(i.val())?t.addClass("disable"):t.removeClass("disable")}),t.on("touchstart",function(){var e=l(i.val());t.hasClass("disable")||(o.pwdValidate(e)===!1?d("密码6-20位,请重新输入"):s.ajax({type:"POST",url:"/passport/reg/setpassword",data:{password:e,phoneNum:s("#phone-num").val(),areaCode:s("#area-code").val(),token:s("#token").val()},success:function(e){200===e.code?(d("注册成功"),setTimeout(function(){location.href=e.data},1e3)):401===e.code||404===e.code||505===e.code?d(e.message):(d(e.message),setTimeout(function(){location.href=e.data},1e3))}}))})}),define("js/passport/login/login",["jquery"],function(e,a,n){function s(){p&&h?d.removeClass("disable"):d.addClass("disable")}function i(){c.show(),u.show()}function t(){c.hide(),u.hide()}var o=e("jquery"),r=o("#account"),l=o("#pwd"),d=o("#btn-login"),c=o("#retrive-pwd-mask"),u=o("#retrive-pwd-ways"),p=!1,h=!1,f=e("js/passport/api"),g=e("js/plugin/tip"),m=o.trim,v=g.show;f.bindEyesEvt(),f.bindClearEvt(),r.bind("input",function(){p=""!==m(r.val())?!0:!1,s()}),l.bind("input",function(){h=""===m(l.val())?!1:!0,s()}),d.on("touchstart",function(){var e=m(r.val()),a=m(l.val());d.hasClass("disable")||((/^[0-9]+$/.test(e)||f.emailRegx.test(e))&&f.pwdValidate(a)?o.ajax({type:"POST",url:"/passport/login/auth",data:{account:e,password:a},success:function(e){200===e.code?(v("登录成功"),setTimeout(function(){location.href=e.data},1e3)):v(e.message)},error:function(){v("网络断开连接啦~")}}):v("账号或密码有错误,请重新输入"))}),o("#forget-pwd").on("touchstart",function(){i()}),c.on("touchstart",function(){t()}),o("#cancel-retrive").on("touchstart",function(e){e.preventDefault(),t()}),r.trigger("input"),l.trigger("input")}),define("js/passport/login/international",["jquery"],function(e,a,n){function s(){c&&u?d.removeClass("disable"):d.addClass("disable")}var i=e("jquery"),t=i("#phone-num"),o=i("#country-select"),r=i("#area-code"),l=i("#pwd"),d=i("#btn-login"),c=!1,u=!1,p=e("js/passport/api"),h=e("js/plugin/tip"),f=i.trim,g=h.show;p.selectCssHack(o),p.bindEyesEvt(),p.bindClearEvt(),t.bind("input",function(){c=""===f(t.val())?!1:!0,s()}),l.bind("input",function(){var e=f(l.val());u=""===e?!1:!0,s()}),o.change(function(){r.text(o.val())}),d.on("touchstart",function(){var e=f(t.val()),a=o.val(),n=f(l.val());d.hasClass("disable")||(p.phoneRegx[a].test(e)&&p.pwdValidate(n)?i.ajax({type:"POST",url:"/passport/login/auth",data:{areaCode:a.replace("+",""),account:e,password:n},success:function(e){200===e.code?(g("登录成功"),setTimeout(function(){location.href=e.data},1e3)):g(e.message)},error:function(){g("网络断开连接啦~")}}):g("账号或密码有错误,请重新输入"))}),t.trigger("input"),l.trigger("input")}),define("js/passport/back/mobile",["jquery"],function(e,a,n){var s=e("jquery"),i=s("#phone-num"),t=s("#country-select"),o=s("#area-code"),r=s("#btn-next"),l=e("js/passport/api"),d=e("js/plugin/tip"),c=s.trim,u=d.show;l.selectCssHack(s("#country-select")),l.bindClearEvt(),i.bind("input",function(){""===c(i.val())?r.addClass("disable"):r.removeClass("disable")}),t.change(function(){o.text(t.val())}),r.on("touchstart",function(){var e=c(i.val()),a=t.val();r.hasClass("disable")||(l.phoneRegx[a].test(e)?s.ajax({url:"/passport/back/sendcode",type:"POST",data:{areaCode:a.replace("+",""),phoneNum:e},success:function(e){200===e.code?location.href=e.data:u(e.message)}}):u("手机号格式不正确,请重新输入"))})}),define("js/passport/back/code",["jquery"],function(e,a,n){e("js/passport/code")(!1)}),define("js/passport/back/email",["jquery"],function(e,a,n){var s=e("jquery"),i=s("#email"),t=s("#btn-sure"),o=e("js/passport/api"),r=e("js/plugin/tip"),l=s.trim,d=r.show;o.bindClearEvt(),i.bind("input",function(){""===l(i.val())?t.addClass("disable"):t.removeClass("disable")}),t.on("touchstart",function(){var e=l(i.val());t.hasClass("disable")||(o.emailRegx.test(e)?s.ajax({url:"/passport/back/sendemail",type:"POST",data:{email:e},success:function(e){200===e.code?location.href=e.data:d(e.message)}}):d("邮箱格式不正确,请重新输入"))})}),define("js/passport/back/email-success",["jquery"],function(e,a,n){var s=e("jquery"),i=s("#resend"),t=e("js/plugin/tip"),o=t.show;i.on("touchstart",function(e){e.preventDefault(),s.ajax({url:i.data("url"),type:"GET",success:function(e){o(200===e.code?e.message:e.message)}})})}),define("js/passport/back/new-password",["jquery"],function(e,a,n){var s=e("jquery"),i=s("#pwd"),t=s("#btn-ok"),o=e("js/passport/api"),r=e("js/plugin/tip"),l=s.trim,d=r.show,c=s("#phone-num");o.bindEyesEvt(),i.bind("input",function(){""===l(i.val())?t.addClass("disable"):t.removeClass("disable")}),t.on("touchstart",function(){var e,a,n=l(i.val()),r=!0;t.hasClass("disable")||(e={password:n},0===c.length&&(r=!1),r?(s.extend(e,{phoneNum:c.val(),areaCode:s("#areaCode").val(),token:s("#token").val()}),a="/passport/back/passwordByMobile"):(s.extend(e,{code:s("#email-code").val()}),a="/passport/back/passwordByEmail"),o.pwdValidate(n)?s.ajax({type:"POST",url:a,data:e,success:function(e){200===e.code?(d("密码修改成功"),setTimeout(function(){location.href=e.data},1e3)):d(e.message)}}):d("密码6-20位,请重新输入"))})}),define("js/product/entry",["jquery","swiper","hammer","lazyload","index"],function(e,a,n){e("js/product/newsale/newarrival"),e("js/product/newsale/discount"),e("js/product/list"),e("js/product/detail/detail")}),define("js/product/newsale/newarrival",["jquery","swiper","hammer","lazyload","index"],function(e,a,n){function s(e){var a,n,s,i,l,u,p={};if(!d){if(e){for(n in z)z.hasOwnProperty(n)&&(z[n].reload=!0);switch(q.children(".active").removeClass("active"),T.addClass("active"),e.type){case"gender":a={gender:e.id};break;case"brand":a={brand:e.id};break;case"sort":a={sort:e.id};break;case"color":a={color:e.id};break;case"size":a={size:e.id};break;case"price":a={price:e.id};break;case"discount":a={discount:e.id};break;case"limit":a={limit:e.id};break;case"channel":a={channel:e.id};break;case"p_d":a={p_d:e.id}}c.extend(b,a)}if(T.hasClass("today")?(i="today",l=1):T.hasClass("week")?(i="week",l=2):T.hasClass("sale")&&(i="sale",l=3),s=z[i],u=s.page+1,s.reload)u=1;else if(s.end)return;c.extend(p,b,{dayLimit:l,page:u}),d=!0,g.showLoadingMask(),c.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:p,success:function(e){var a,n;switch(i){case"today":a=t;break;case"week":a=o;break;case"sale":a=r}" "===e?(s.end=!0,s.reload&&a.html(y)):s.reload?(a.html(e),h(a.find(".lazy"))):(n=a.find(".good-info").length,a.append(e),h(a.find(".good-info:gt("+(n-1)+") .lazy"))),s.reload=!1,s.page=u,d=!1,g.hideLoadingMask(),window.rePosFooter()}})}}var i,t,o,r,l,d,c=e("jquery"),u=e("swiper"),p=e("hammer"),h=e("lazyload"),f=e("js/plugin/filter"),g=e("js/plugin/loading"),m=c("#goods-container"),v=m.children(),t=c(v.get(0)),o=c(v.get(1)).addClass("hide"),r=c(v.get(2)).addClass("hide"),w=c(window).height(),y='<p class="no-result">未找到相关搜索结果</p>',b={gender:c("#gender").val(),brand:c("#brand").val(),sort:c("#sort").val(),color:c("#color").val(),size:c("#size").val(),price:c("#price").val(),discount:c("#discount").val(),limit:c("#limit").val(),channel:c("#channel").val(),p_d:c("#p_d").val(),dayLimit:1},C=c.extend({},b),j=new Date,x=j.getMonth()+1,k=j.getDate(),q=c("#list-nav"),z={today:{reload:!0,page:0,end:!1},week:{reload:!0,page:0,end:!1},sale:{reload:!0,page:0,end:!1}},T=q.find(".active");c("#today a").text(x+"月"+k+"号"), | ||
2 | +c(".swiper-container .swiper-slide").length>1&&(i=new u(".swiper-container",{lazyLoading:!0,lazyLoadingInPrevNext:!0,loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,pagination:".swiper-pagination"})),c.ajax({type:"GET",url:"/product/newsale/filter",data:b,success:function(e){m.append(e),f.initFilter({fCbFn:s,hCbFn:function(){T.addClass("active"),T.siblings(".filter").removeClass("active")}})}}),h(c(".lazy")),l=new p(q[0]),l.on("tap",function(e){var a,n,i,l=c(e.target).closest("li");if(l.hasClass("filter"))l.hasClass("active")?(f.hideFilter(),T.addClass("active"),l.removeClass("active")):(T=l.siblings(".active"),T.removeClass("active"),l.addClass("active"),f.showFilter());else{if(l.hasClass("today")?n="today":l.hasClass("week")?n="week":l.hasClass("sale")&&(n="sale"),a=z[n],!l.hasClass("active")){if(i=l.siblings(".active"),T=l,i.hasClass("filter"))f.hideFilter();else{switch(m.children(".container:not(.hide)").addClass("hide"),n){case"today":t.removeClass("hide");break;case"week":o.removeClass("hide");break;case"sale":r.removeClass("hide")}f.resetFilter(),b=c.extend({},C)}i.removeClass("active"),l.addClass("active")}a.reload&&s()}}),c(window).scroll(function(){c(window).scrollTop()+w>c(document).height()-.25*m.height()-50&&void 0!==T&&s()}),s()}),define("js/plugin/filter",["jquery","hammer"],function(e,a,n){function s(){c.addClass("hide")}function i(){c.removeClass("hide")}function t(e){e.hasClass("active")||(e.siblings(".active").removeClass("active"),e.addClass("active"))}function o(e){var a,n,s=e.closest(".sub-classify"),i=s.siblings(".shower");return e.hasClass("chosed")?void 0:(s.children(".chosed").removeClass("chosed"),e.addClass("chosed"),a=f.trim(e.html()),n=f.trim(i.html()),i.html(n.substring(0,n.indexOf("</span>")+7)+a.substring(0,a.indexOf("<i"))),0===e.index()?i.addClass("default"):i.removeClass("default"),s)}function r(e){var a,n=e.data("id");a=o(e),u&&u({type:a.data("type"),id:n}),s()}function l(e){var a;u=e.fCbFn,p=e.hCbFn,h=e.missStatus,c=f(".filter-mask"),a=new g(c[0]),a.on("tap",function(e){var a,n=f(e.target);n.closest(".filter-body").length>0?(a=n.closest(".sub-item"),a.length>0?(a=n.closest("li"),r(a)):(a=n.closest(".classify-item"),e.srcEvent.stopPropagation(),t(a))):(s(),p&&p())})}function d(){"undefined"!=typeof c&&(f(".sub-classify").each(function(){o(f(this).children(":first-child"))}),t(f(".classify > :first-child")))}var c,u,p,h,f=e("jquery"),g=e("hammer");a.initFilter=l,a.showFilter=i,a.hideFilter=s,a.resetFilter=d}),define("js/product/newsale/discount",["jquery","swiper","hammer","lazyload","index"],function(e,a,n){function s(e){var a,n,s,i,t,l={};if(!o){if(e){for(n in j)j.hasOwnProperty(n)&&(j[n].reload=!0);switch(C.children(".active").removeClass("active"),x.addClass("active"),e.type){case"gender":a={gender:e.id};break;case"brand":a={brand:e.id};break;case"sort":a={sort:e.id};break;case"color":a={color:e.id};break;case"size":a={size:e.id};break;case"price":a={price:e.id};break;case"discount":a={discount:e.id}}r.extend(b,a)}if(x.hasClass("new")?i="newest":x.hasClass("price")?i="price":x.hasClass("discount")&&(i="discount"),s=j[i],t=s.page+1,s.reload)t=1;else if(s.end)return;r.extend(l,b,{type:i,order:s.order,page:t}),o=!0,p.showLoadingMask(),r.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:l,success:function(e){var a,n;switch(i){case"newest":a=g;break;case"price":a=m;break;case"discount":a=v}" "===e?(s.end=!0,s.reload&&a.html(y)):s.reload?(a.html(e),c(a.find(".lazy"))):(n=a.find(".good-info").length,a.append(e),c(a.find(".good-info:gt("+(n-1)+") .lazy"))),s.reload=!1,s.page=t,o=!1,p.hideLoadingMask(),window.rePosFooter()}})}}var i,t,o,r=e("jquery"),l=e("swiper"),d=e("hammer"),c=e("lazyload"),u=e("js/plugin/filter"),p=e("js/plugin/loading"),h=r("#goods-container"),f=h.children(),g=r(f.get(0)),m=r(f.get(1)),v=r(f.get(2)),w=r(window).height(),y='<p class="no-result">未找到相关搜索结果</p>',b={gender:r("#gender").val(),brand:r("#brand").val(),sort:r("#sort").val(),color:r("#color").val(),size:r("#size").val(),price:r("#price").val(),discount:r("#discount").val()},C=r("#list-nav"),j={newest:{order:1,reload:!0,page:0,end:!1},price:{order:0,reload:!0,page:0,end:!1},discount:{order:0,reload:!0,page:0,end:!1}},x=C.find(".active");r(".swiper-container .swiper-slide").length>1&&(i=new l(".swiper-container",{lazyLoading:!0,lazyLoadingInPrevNext:!0,loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,pagination:".swiper-pagination"})),r.ajax({type:"GET",url:"/product/newsale/filter",data:b,success:function(e){h.append(e),u.initFilter({fCbFn:s,hCbFn:function(){x.addClass("active"),x.siblings(".filter").removeClass("active")},missStatus:!0})}}),c(r(".lazy")),t=new d(C[0]),t.on("tap",function(e){var a,n,i,t=r(e.target).closest("li");if(t.hasClass("filter"))t.hasClass("active")?(u.hideFilter(),x.addClass("active"),t.removeClass("active")):(x=t.siblings(".active"),x.removeClass("active"),t.addClass("active"),u.showFilter());else{if(t.hasClass("new")?n="newest":t.hasClass("price")?n="price":t.hasClass("discount")&&(n="discount"),a=j[n],t.hasClass("active")){if(t.hasClass("new"))return;(t.hasClass("price")||t.hasClass("discount"))&&(t.find(".icon > .iconfont").toggleClass("cur"),x=t,a.reload=!0,a.order=0===a.order?1:0)}else{if(i=t.siblings(".active"),x=t,i.hasClass("filter"))u.hideFilter();else switch(h.children(".container:not(.hide)").addClass("hide"),n){case"newest":g.removeClass("hide");break;case"price":m.removeClass("hide");break;case"discount":v.removeClass("hide")}i.removeClass("active"),t.addClass("active")}a.reload&&s()}}),r(window).scroll(function(){r(window).scrollTop()+w>r(document).height()-.25*h.height()-50&&void 0!==x&&s()}),s()}),define("js/product/list",["jquery","hammer","lazyload"],function(e,a,n){function s(e){var a,n,s,t,o,r={};if(!i){if(e){for(n in q)q.hasOwnProperty(n)&&(q[n].reload=!0);switch(k.children(".active").removeClass("active"),z.addClass("active"),e.type){case"gender":a={gender:e.id};break;case"brand":a={brand:e.id};break;case"sort":a={sort:e.id};break;case"color":a={color:e.id};break;case"size":a={size:e.id};break;case"price":a={price:e.id};break;case"discount":a={discount:e.id}}d.extend(x,a)}if(z.hasClass("new")?t="newest":z.hasClass("price")?t="price":z.hasClass("discount")&&(t="discount"),s=q[t],o=s.page+1,s.reload)o=1;else if(s.end)return;d.extend(r,x,{type:t,order:s.order,page:o}),i=!0,v.showLoadingMask(),d.ajax({type:"GET",url:"/index/search/search",data:r,success:function(e){var a,n,r='<p class="no-result">未找到相关搜索结果</p>';switch(t){case"newest":n=y;break;case"price":n=b;break;case"discount":n=C}" "===e?(s.end=!0,s.reload&&n.html(r)):s.reload?(n.html(e),u(n.find(".lazy"))):(a=n.find(".good-info").length,n.append(e),u(n.find(".good-info:gt("+(a-1)+") .lazy"))),s.reload=!1,s.page=o,i=!1,v.hideLoadingMask(),window.rePosFooter()}})}}var i,t,o,r,l,d=e("jquery"),c=e("hammer"),u=e("lazyload"),p=d("#brand-header"),h=d("#intro-box"),f=e("js/plugin/filter"),g=e("js/index/write-search"),m=e("js/plugin/tip"),v=e("js/plugin/loading"),w=d("#goods-container"),y=w.children(".new-goods"),b=w.children(".price-goods"),C=w.children(".discount-goods"),j=d(window).height(),x={gender:d("#gender").val(),brand:d("#brand").val(),sort:d("#sort").val(),color:d("#color").val(),size:d("#size").val(),price:d("#price").val(),discount:d("#discount").val(),query:d("#query").val()},k=d("#list-nav"),q={newest:{order:1,reload:!0,page:0,end:!1},price:{order:0,reload:!0,page:0,end:!1},discount:{order:0,reload:!0,page:0,end:!1}},z=k.find(".active");d.ajax({type:"GET",url:"/search/filter",data:x,success:function(e){w.append(e),f.initFilter({fCbFn:s,hCbFn:function(){z.addClass("active"),z.siblings(".filter").removeClass("active")}})}}),u(d(".lazy")),g.bindWirteLocal(d("#search-form")),t=new c(k[0]),t.on("tap",function(e){var a,n,i,t=d(e.target).closest("li");if(t.hasClass("filter"))t.hasClass("active")?(f.hideFilter(),z.addClass("active"),t.removeClass("active")):(z=t.siblings(".active"),z.removeClass("active"),t.addClass("active"),f.showFilter());else{if(t.hasClass("new")?n="newest":t.hasClass("price")?n="price":t.hasClass("discount")&&(n="discount"),a=q[n],t.hasClass("active")){if(t.hasClass("new"))return;(t.hasClass("price")||t.hasClass("discount"))&&(t.find(".icon > .iconfont").toggleClass("cur"),z=t,a.reload=!0,a.order=0===a.order?1:0)}else{if(i=t.siblings(".active"),z=t,i.hasClass("filter"))f.hideFilter();else switch(w.children(".container:not(.hide)").addClass("hide"),n){case"newest":y.removeClass("hide");break;case"price":b.removeClass("hide");break;case"discount":C.removeClass("hide")}i.removeClass("active"),t.addClass("active")}a.reload&&s()}}),d(window).scroll(function(){d(window).scrollTop()+j>d(document).height()-.25*w.height()&&s()}),p.length>0&&(o=new c(p.children(".btn-intro")[0]),o.on("tap",function(){h.removeClass("hide"),d("body").addClass("overflow-hidden")}),r=new c(document.getElementById("intro-box")),r.on("tap",function(e){var a=d(e.target);e.srcEvent.preventDefault(),(0===a.closest("#brand-intro").length||a.hasClass("close-intro"))&&(h.addClass("hide"),d("body").removeClass("overflow-hidden"))}),l=new c(p.children(".btn-col")[0]),l.on("tap",function(){var e,a=d(this),n=p.data("id");e=a.hasClass("coled")?"cancel":"ok",d.ajax({type:"POST",url:"/product/opt/favoriteBrand",data:{id:n,opt:e},success:function(e){200===e.code?a.toggleClass("coled"):400===e.code||412===e.code?m.show("未登录"):m.show(e.message)},error:function(){m.show("网络断开连接了~")}})})),s()}),define("js/product/detail/detail",["jquery","swiper","lazyload","index"],function(e,a,n){var s,i=e("jquery"),t=e("swiper"),o=e("lazyload");o(i("img.lazy")),s=new t(".banner-swiper",{loop:!0,pagination:".banner-top .pagination-inner",slideElement:"div",nextButton:".swiper-button-next",prevButton:".swiper-button-prev"})}); |
-
Please register or login to post a comment