Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
13 changed files
with
318 additions
and
328 deletions
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
11 | </span> | 11 | </span> |
12 | <ul id="country-code-list" class="country-code-list"> | 12 | <ul id="country-code-list" class="country-code-list"> |
13 | {{# countryList}} | 13 | {{# countryList}} |
14 | - <li data-cc="+{{code}}">{{name}} +{{code}}</li> | 14 | + <li data-cc="{{areaCode}}">{{name}} {{areaCode}}</li> |
15 | {{/ countryList}} | 15 | {{/ countryList}} |
16 | </ul> | 16 | </ul> |
17 | </div> | 17 | </div> |
@@ -28,7 +28,7 @@ | @@ -28,7 +28,7 @@ | ||
28 | </li> | 28 | </li> |
29 | <li class="input-container-li clearfix"> | 29 | <li class="input-container-li clearfix"> |
30 | <input id="captcha" class="input va captcha" type="text" name="captcha" placeholder="验证码" autocomplete="off" maxlength="4"> | 30 | <input id="captcha" class="input va captcha" type="text" name="captcha" placeholder="验证码" autocomplete="off" maxlength="4"> |
31 | - <img id="captcha-img" class="captcha-img" src="http://web.dev.yohobuy.com/passport/images" alt=""> | 31 | + <img id="captcha-img" class="captcha-img" src="{{captchaUrl}}" alt=""> |
32 | <a id="change-captcha" class="link change-captcha">换一张</a> | 32 | <a id="change-captcha" class="link change-captcha">换一张</a> |
33 | <span id="captcha-err" class="err-tip captcha-err hide"> | 33 | <span id="captcha-err" class="err-tip captcha-err hide"> |
34 | <i></i> | 34 | <i></i> |
@@ -1483,305 +1483,309 @@ require("js/product/sort-pager"); | @@ -1483,305 +1483,309 @@ require("js/product/sort-pager"); | ||
1483 | require("js/product/product"); | 1483 | require("js/product/product"); |
1484 | }); | 1484 | }); |
1485 | define("js/product/filter", ["jquery"], function(require, exports, module){ | 1485 | define("js/product/filter", ["jquery"], function(require, exports, module){ |
1486 | -/** | ||
1487 | - * 商品筛选逻辑 | ||
1488 | - * @author: xuqi<qi.xu@yoho.cn> | ||
1489 | - * @date: 2015/12/4 | ||
1490 | - */ | ||
1491 | - | ||
1492 | -var $ = require("jquery"); | ||
1493 | - | ||
1494 | -var checkUnicode = { | ||
1495 | - unchecked: '', | ||
1496 | - checked: '' | ||
1497 | -}, | ||
1498 | -moreUnicode = { | ||
1499 | - up: '', | ||
1500 | - down: '' | ||
1501 | -}; | ||
1502 | - | ||
1503 | -//品牌相关变量 | ||
1504 | -var $brandDefault = $('.brand .default'), | ||
1505 | - $brandPanel = $('.brand .brand-panel'), | ||
1506 | - $brandAttrs = $('.brand .attr'), | ||
1507 | - $brandMore = $('#brand-more'), | ||
1508 | - $brandMulti = $('#brand-multi'); | ||
1509 | - | ||
1510 | -var $brandMoreTxt, $brandMoreIcon; | ||
1511 | - | ||
1512 | -//价格相关变量 | ||
1513 | -var $udPrice = $('.ud-price-range'), | ||
1514 | - interReg = /^\d+$/, | ||
1515 | - $limit, $min, $max, $btn; | ||
1516 | - | ||
1517 | -//分类相关变量 | ||
1518 | -var $sortSub = $('.sort-sub-wrap'); | ||
1519 | - | ||
1520 | -//高级选项相关变量 | ||
1521 | -var $seniorSubWrap = $('.senior-sub-wrap'), | ||
1522 | - $seniorAttrWrap = $('.senior-attr-wrap'); | ||
1523 | - | ||
1524 | -var seniorHoverTime, hoveredIndex; | ||
1525 | - | ||
1526 | -//清除checkbox选中状态 | ||
1527 | -function clearChecked($checkbox) { | ||
1528 | - $checkbox.removeClass('checked').html(checkUnicode.unchecked); | ||
1529 | -} | ||
1530 | - | ||
1531 | -//显示更多品牌面板 | ||
1532 | -function brandShowMore() { | ||
1533 | - $brandDefault.addClass('hide'); | ||
1534 | - $brandPanel.removeClass('hide'); | ||
1535 | -} | ||
1536 | - | ||
1537 | -//隐藏更多品牌面板 | ||
1538 | -function brandHideMore() { | ||
1539 | - $brandPanel.addClass('hide'); | ||
1540 | - $brandDefault.removeClass('hide'); | ||
1541 | -} | ||
1542 | - | ||
1543 | -//url构造&跳转 | ||
1544 | -function uriLoc(attr, val) { | ||
1545 | - var href = decodeURIComponent(window.location.search), | ||
1546 | - query = attr + '=' + val, | ||
1547 | - newHref; | ||
1548 | - | ||
1549 | - if (href === '') { | ||
1550 | - newHref = '?' + query; | ||
1551 | - } else { | ||
1552 | - newHref = href + '&' + query; | ||
1553 | - } | ||
1554 | - | ||
1555 | - window.location.href = newHref; | ||
1556 | -} | ||
1557 | - | ||
1558 | -//隐藏高级选项面板 | ||
1559 | -function hideSeniorPanel(index) { | ||
1560 | - $seniorSubWrap.children('.senior-sub:eq(' + hoveredIndex + ')').addClass('hide'); | ||
1561 | - $seniorAttrWrap.children('.attr:eq(' + hoveredIndex + ')').removeClass('hover'); | ||
1562 | - hoveredIndex = -1; | ||
1563 | -} | ||
1564 | - | ||
1565 | -//屏蔽筛选项双击文字选中 | ||
1566 | -$('.filter-box').on('selectstart', '.attr, .brands-index span', function() { | ||
1567 | - return false; | ||
1568 | -}); | ||
1569 | - | ||
1570 | -//【分类】 | ||
1571 | -$('.sort-pre').on('click', 'li', function() { | ||
1572 | - var $this = $(this), | ||
1573 | - index = $this.index(); | ||
1574 | - | ||
1575 | - $this.siblings('.active').removeClass('active'); | ||
1576 | - $this.addClass('active'); | ||
1577 | - | ||
1578 | - $sortSub.children(':not(.hide)').addClass('hide'); | ||
1579 | - $sortSub.children(':eq(' + index + ')').removeClass('hide'); | ||
1580 | -}); | ||
1581 | - | ||
1582 | -//【品牌】 | ||
1583 | -if ($brandMore.length > 0) { | ||
1584 | - $brandMoreTxt = $brandMore.children('em'); | ||
1585 | - $brandMoreIcon = $brandMore.children('.iconfont'); | ||
1586 | -} | ||
1587 | - | ||
1588 | -//【品牌】多选 | ||
1589 | -$brandMulti.click(function() { | ||
1590 | - if ($brandPanel.css('display') === 'none') { | ||
1591 | - | ||
1592 | - //显示品牌面板 | ||
1593 | - brandShowMore(); | ||
1594 | - } | ||
1595 | - | ||
1596 | - $brandPanel.addClass('multi'); //显示出checkbox | ||
1597 | - $(this).addClass('hide'); | ||
1598 | -}); | ||
1599 | - | ||
1600 | -//【品牌】更多 | ||
1601 | -$brandMore.click(function() { | ||
1602 | - var $this = $(this); | ||
1603 | - | ||
1604 | - if ($this.hasClass('more')) { | ||
1605 | - brandHideMore(); | ||
1606 | - | ||
1607 | - $brandMoreTxt.text('更多'); | ||
1608 | - $brandMoreIcon.html(moreUnicode.down); | ||
1609 | - } else { | ||
1610 | - brandShowMore(); | ||
1611 | - | ||
1612 | - $brandMoreTxt.text('收起'); | ||
1613 | - $brandMoreIcon.html(moreUnicode.up); | ||
1614 | - } | ||
1615 | - | ||
1616 | - $(this).toggleClass('more'); | ||
1617 | -}); | ||
1618 | - | ||
1619 | -//【品牌】索引 | ||
1620 | -$('.brands-index').on('click', 'span', function() { | ||
1621 | - var $this = $(this), | ||
1622 | - index = $this.data('index'); | ||
1623 | - | ||
1624 | - if ($this.index() === 0) { | ||
1625 | - | ||
1626 | - //全部 | ||
1627 | - $brandAttrs.removeClass('hide'); | ||
1628 | - } else { | ||
1629 | - $brandAttrs.addClass('hide').filter('[data-index=' + index + ']').removeClass('hide'); | ||
1630 | - } | ||
1631 | -}); | ||
1632 | - | ||
1633 | -//【品牌】搜索 | ||
1634 | -$('#brand-search-input').keyup(function() { | ||
1635 | - var val = $(this).val().toLowerCase(); | ||
1636 | - | ||
1637 | - if (val === '') { | ||
1638 | - $brandAttrs.removeClass('hide'); | ||
1639 | - } else { | ||
1640 | - $brandAttrs.addClass('hide').filter('[data-key*=' + val + ']').removeClass('hide'); | ||
1641 | - } | ||
1642 | -}); | ||
1643 | - | ||
1644 | -//【品牌】多选确定 | ||
1645 | -$('#brand-multi-ok').click(function() { | ||
1646 | - var val = ''; | ||
1647 | - | ||
1648 | - if ($(this).hasClass('dis')) { | ||
1649 | - return; | ||
1650 | - } | ||
1651 | - | ||
1652 | - $brandPanel.find('.checked').each(function() { | ||
1653 | - var id = $(this).data('id'); | ||
1654 | - | ||
1655 | - val += (val === '') ? id : (',' + id); | ||
1656 | - }); | ||
1657 | - | ||
1658 | - uriLoc('brand', val); | ||
1659 | -}); | ||
1660 | - | ||
1661 | -//【品牌/高级选项】多选取消 | ||
1662 | -$('.multi-select-cancel').click(function() { | ||
1663 | - var $panel = $(this).closest('.multi'); | ||
1664 | - | ||
1665 | - if ($panel.hasClass('brand-panel')) { | ||
1666 | - brandHideMore(); | ||
1667 | - | ||
1668 | - $brandMulti.removeClass('hide'); //显示多选按钮 | ||
1669 | - } | ||
1670 | - | ||
1671 | - $panel.removeClass('multi'); | ||
1672 | - clearChecked($panel.find('.checkbox.checked')); //清除选中状态 | ||
1673 | -}); | ||
1674 | - | ||
1675 | -//【品牌/高级选项】checkbox | ||
1676 | -$('.check-container').on('click', '.attr', function() { | ||
1677 | - var $this = $(this), | ||
1678 | - $check = $this.find('.checkbox'), | ||
1679 | - $btnOk = $this.parent('.check-container').next('.btns').find('.multi-select-ok'); | ||
1680 | - | ||
1681 | - $check.toggleClass('checked'); | ||
1682 | - | ||
1683 | - if ($check.hasClass('checked')) { | ||
1684 | - $check.html(checkUnicode.checked); | ||
1685 | - } else { | ||
1686 | - $check.html(checkUnicode.unchecked); | ||
1687 | - } | ||
1688 | - | ||
1689 | - //更新按钮状态 | ||
1690 | - if ($check.hasClass('checked') || | ||
1691 | - $this.siblings('.attr').find('.checked').length > 0) { | ||
1692 | - $btnOk.removeClass('dis'); | ||
1693 | - } else { | ||
1694 | - $btnOk.addClass('dis'); | ||
1695 | - } | ||
1696 | -}); | ||
1697 | - | ||
1698 | -//【品牌/高级选项】当多选时阻止链接默认跳转 | ||
1699 | -$('.brand, .senior').on('click', '.attr > a', function(e) { | ||
1700 | - if ($(this).closest('.multi').length > 0) { | ||
1701 | - e.preventDefault(); | ||
1702 | - } | ||
1703 | -}); | ||
1704 | - | ||
1705 | -//【价格】用户定义价格处理 | ||
1706 | -if ($udPrice.length > 0) { | ||
1707 | - $limit = $udPrice.find('.limit'); | ||
1708 | - $min = $limit.filter('.min'); | ||
1709 | - $max = $limit.filter('.max'); | ||
1710 | - $btn = $udPrice.find('.price-sure'); | ||
1711 | - | ||
1712 | - //【价格】输入 | ||
1713 | - $limit.keyup(function() { | ||
1714 | - var min = $.trim($min.val()), | ||
1715 | - max = $.trim($max.val()), | ||
1716 | - isMinInt = interReg.test(min), | ||
1717 | - isMaxInt = interReg.test(max); | ||
1718 | - | ||
1719 | - if (isMaxInt && (min === '' || isMinInt) || | ||
1720 | - isMinInt && (max === '' || isMaxInt) | ||
1721 | - ) { | ||
1722 | - $btn.removeClass('hide'); | ||
1723 | - } else { | ||
1724 | - $btn.addClass('hide'); | ||
1725 | - } | ||
1726 | - }); | ||
1727 | - | ||
1728 | - //【价格】多项查询 | ||
1729 | - $btn.click(function() { | ||
1730 | - var min = $.trim($min.val()), | ||
1731 | - max = $.trim($max.val()), | ||
1732 | - tmp; | ||
1733 | - | ||
1734 | - //对于min大于max的情况,交换位置 | ||
1735 | - if (min !== '' && max !== '' && +min > +max) { | ||
1736 | - tmp = max; | ||
1737 | - max = min; | ||
1738 | - min = tmp; | ||
1739 | - } | ||
1740 | - | ||
1741 | - uriLoc('price', min + ',' + max); | ||
1742 | - }); | ||
1743 | -} | ||
1744 | - | ||
1745 | -//【高级选项】鼠标移入显示子项 | ||
1746 | -$seniorAttrWrap.on('mouseenter', '.attr', function() { | ||
1747 | - var index = $(this).addClass('hover').index(); | ||
1748 | - | ||
1749 | - $seniorSubWrap.children('.senior-sub:eq(' + index + ')').removeClass('hide'); | ||
1750 | -}).on('mouseleave', '.attr', function() { | ||
1751 | - var $this = $(this), | ||
1752 | - index = $this.index(); | ||
1753 | - | ||
1754 | - hoveredIndex = index; | ||
1755 | - | ||
1756 | - seniorHoverTime = setTimeout(function() { | ||
1757 | - hideSeniorPanel(); | ||
1758 | - }, 100); | ||
1759 | -}); | ||
1760 | - | ||
1761 | -//【高级选项】多选 | ||
1762 | -$('.senior-sub').on('click', '.multi-select', function() { | ||
1763 | - $(this).closest('.senior-sub').addClass('multi'); | ||
1764 | -}).on('click', '.multi-select-ok', function() { | ||
1765 | - var $btn = $(this), | ||
1766 | - $sub = $btn.closest('.senior-sub'), | ||
1767 | - val = ''; | ||
1768 | - | ||
1769 | - if ($btn.hasClass('dis')) { | ||
1770 | - return; | ||
1771 | - } | ||
1772 | - | ||
1773 | - $sub.find('.checked').each(function() { | ||
1774 | - var id = $(this).data('id'); | ||
1775 | - | ||
1776 | - val += (val === '') ? id : (',' + id); | ||
1777 | - }); | ||
1778 | - | ||
1779 | - uriLoc($sub.data('attr'), val); | ||
1780 | -}).on('mouseenter', function() { | ||
1781 | - clearTimeout(seniorHoverTime); | ||
1782 | -}).on('mouseleave', function() { | ||
1783 | - hideSeniorPanel(); | 1486 | +/** |
1487 | + * 商品筛选逻辑 | ||
1488 | + * @author: xuqi<qi.xu@yoho.cn> | ||
1489 | + * @date: 2015/12/4 | ||
1490 | + */ | ||
1491 | + | ||
1492 | +var $ = require("jquery"); | ||
1493 | + | ||
1494 | +var checkUnicode = { | ||
1495 | + unchecked: '', | ||
1496 | + checked: '' | ||
1497 | +}, | ||
1498 | +moreUnicode = { | ||
1499 | + up: '', | ||
1500 | + down: '' | ||
1501 | +}; | ||
1502 | + | ||
1503 | +//品牌相关变量 | ||
1504 | +var $brandDefault = $('.brand .default'), | ||
1505 | + $brandPanel = $('.brand .brand-panel'), | ||
1506 | + $brandAttrs = $('.brand .attr'), | ||
1507 | + $brandMore = $('#brand-more'), | ||
1508 | + $brandMulti = $('#brand-multi'); | ||
1509 | + | ||
1510 | +var $brandMoreTxt, $brandMoreIcon; | ||
1511 | + | ||
1512 | +//价格相关变量 | ||
1513 | +var $udPrice = $('.ud-price-range'), | ||
1514 | + interReg = /^\d+$/, | ||
1515 | + $limit, $min, $max, $btn; | ||
1516 | + | ||
1517 | +//分类相关变量 | ||
1518 | +var $sortSub = $('.sort-sub-wrap'); | ||
1519 | + | ||
1520 | +//高级选项相关变量 | ||
1521 | +var $seniorSubWrap = $('.senior-sub-wrap'), | ||
1522 | + $seniorAttrWrap = $('.senior-attr-wrap'); | ||
1523 | + | ||
1524 | +var seniorHoverTime, hoveredIndex; | ||
1525 | + | ||
1526 | +//清除checkbox选中状态 | ||
1527 | +function clearChecked($checkbox) { | ||
1528 | + $checkbox.removeClass('checked').html(checkUnicode.unchecked); | ||
1529 | +} | ||
1530 | + | ||
1531 | +//显示更多品牌面板 | ||
1532 | +function brandShowMore() { | ||
1533 | + $brandDefault.addClass('hide'); | ||
1534 | + $brandPanel.removeClass('hide'); | ||
1535 | +} | ||
1536 | + | ||
1537 | +//隐藏更多品牌面板 | ||
1538 | +function brandHideMore() { | ||
1539 | + $brandPanel.addClass('hide'); | ||
1540 | + $brandDefault.removeClass('hide'); | ||
1541 | +} | ||
1542 | + | ||
1543 | +//url构造&跳转 | ||
1544 | +function uriLoc(attr, val) { | ||
1545 | + var href = decodeURIComponent(window.location.search), | ||
1546 | + query = attr + '=' + val, | ||
1547 | + newHref; | ||
1548 | + | ||
1549 | + if (href === '') { | ||
1550 | + newHref = '?' + query; | ||
1551 | + } else { | ||
1552 | + newHref = href + '&' + query; | ||
1553 | + } | ||
1554 | + | ||
1555 | + window.location.href = newHref; | ||
1556 | +} | ||
1557 | + | ||
1558 | +//隐藏高级选项面板 | ||
1559 | +function hideSeniorPanel(index) { | ||
1560 | + $seniorSubWrap.children('.senior-sub:eq(' + hoveredIndex + ')').addClass('hide'); | ||
1561 | + $seniorAttrWrap.children('.attr:eq(' + hoveredIndex + ')').removeClass('hover'); | ||
1562 | + hoveredIndex = -1; | ||
1563 | +} | ||
1564 | + | ||
1565 | +//屏蔽筛选项双击文字选中 | ||
1566 | +$('.filter-box').on('selectstart', '.attr, .brands-index span', function() { | ||
1567 | + return false; | ||
1568 | +}); | ||
1569 | + | ||
1570 | +//【分类】 | ||
1571 | +$('.sort-pre').on('click', 'li', function() { | ||
1572 | + var $this = $(this), | ||
1573 | + index = $this.index(); | ||
1574 | + | ||
1575 | + $this.siblings('.active').removeClass('active'); | ||
1576 | + $this.addClass('active'); | ||
1577 | + | ||
1578 | + $sortSub.children(':not(.hide)').addClass('hide'); | ||
1579 | + $sortSub.children(':eq(' + index + ')').removeClass('hide'); | ||
1580 | +}); | ||
1581 | + | ||
1582 | +//【品牌】 | ||
1583 | +if ($brandMore.length > 0) { | ||
1584 | + $brandMoreTxt = $brandMore.children('em'); | ||
1585 | + $brandMoreIcon = $brandMore.children('.iconfont'); | ||
1586 | +} | ||
1587 | + | ||
1588 | +//【品牌】多选 | ||
1589 | +$brandMulti.click(function() { | ||
1590 | + if ($brandPanel.css('display') === 'none') { | ||
1591 | + | ||
1592 | + //显示品牌面板 | ||
1593 | + brandShowMore(); | ||
1594 | + } | ||
1595 | + | ||
1596 | + $brandPanel.addClass('multi'); //显示出checkbox | ||
1597 | + $(this).addClass('hide'); | ||
1598 | +}); | ||
1599 | + | ||
1600 | +//【品牌】更多 | ||
1601 | +$brandMore.click(function() { | ||
1602 | + var $this = $(this); | ||
1603 | + | ||
1604 | + if ($this.hasClass('more')) { | ||
1605 | + brandHideMore(); | ||
1606 | + | ||
1607 | + $brandMoreTxt.text('更多'); | ||
1608 | + $brandMoreIcon.html(moreUnicode.down); | ||
1609 | + } else { | ||
1610 | + brandShowMore(); | ||
1611 | + | ||
1612 | + $brandMoreTxt.text('收起'); | ||
1613 | + $brandMoreIcon.html(moreUnicode.up); | ||
1614 | + } | ||
1615 | + | ||
1616 | + $(this).toggleClass('more'); | ||
1617 | +}); | ||
1618 | + | ||
1619 | +//【品牌】索引 | ||
1620 | +$('.brands-index').on('click', 'span', function() { | ||
1621 | + var $this = $(this), | ||
1622 | + index = $this.data('index'); | ||
1623 | + | ||
1624 | + if ($this.index() === 0) { | ||
1625 | + | ||
1626 | + //全部 | ||
1627 | + $brandAttrs.removeClass('hide'); | ||
1628 | + } else { | ||
1629 | + $brandAttrs.addClass('hide').filter('[data-index=' + index + ']').removeClass('hide'); | ||
1630 | + } | ||
1784 | }); | 1631 | }); |
1632 | + | ||
1633 | +//【品牌】搜索 | ||
1634 | +$('#brand-search-input').keyup(function() { | ||
1635 | + var val = $(this).val().toLowerCase(); | ||
1636 | + | ||
1637 | + if (val === '') { | ||
1638 | + $brandAttrs.removeClass('hide'); | ||
1639 | + } else { | ||
1640 | + $brandAttrs.addClass('hide').filter('[data-key*=' + val + ']').removeClass('hide'); | ||
1641 | + } | ||
1642 | +}); | ||
1643 | + | ||
1644 | +//【品牌】多选确定 | ||
1645 | +$('#brand-multi-ok').click(function() { | ||
1646 | + var val = ''; | ||
1647 | + | ||
1648 | + if ($(this).hasClass('dis')) { | ||
1649 | + return; | ||
1650 | + } | ||
1651 | + | ||
1652 | + $brandPanel.find('.checked').each(function() { | ||
1653 | + var id = $(this).data('id'); | ||
1654 | + | ||
1655 | + val += (val === '') ? id : (',' + id); | ||
1656 | + }); | ||
1657 | + | ||
1658 | + uriLoc('brand', val); | ||
1659 | +}); | ||
1660 | + | ||
1661 | +//【品牌/高级选项】多选取消 | ||
1662 | +$('.multi-select-cancel').click(function() { | ||
1663 | + var $panel = $(this).closest('.multi'); | ||
1664 | + | ||
1665 | + if ($panel.hasClass('brand-panel')) { | ||
1666 | + brandHideMore(); | ||
1667 | + | ||
1668 | + $brandMulti.removeClass('hide'); //显示多选按钮 | ||
1669 | + } | ||
1670 | + | ||
1671 | + $panel.removeClass('multi'); | ||
1672 | + clearChecked($panel.find('.checkbox.checked')); //清除选中状态 | ||
1673 | +}); | ||
1674 | + | ||
1675 | +//【品牌/高级选项】checkbox | ||
1676 | +$('.check-container').on('click', '.attr', function() { | ||
1677 | + var $this = $(this), | ||
1678 | + $check = $this.find('.checkbox'), | ||
1679 | + $btnOk = $this.parent('.check-container').next('.btns').find('.multi-select-ok'); | ||
1680 | + | ||
1681 | + $check.toggleClass('checked'); | ||
1682 | + | ||
1683 | + if ($check.hasClass('checked')) { | ||
1684 | + $check.html(checkUnicode.checked); | ||
1685 | + } else { | ||
1686 | + $check.html(checkUnicode.unchecked); | ||
1687 | + } | ||
1688 | + | ||
1689 | + //更新按钮状态 | ||
1690 | + if ($check.hasClass('checked') || | ||
1691 | + $this.siblings('.attr').find('.checked').length > 0) { | ||
1692 | + $btnOk.removeClass('dis'); | ||
1693 | + } else { | ||
1694 | + $btnOk.addClass('dis'); | ||
1695 | + } | ||
1696 | +}); | ||
1697 | + | ||
1698 | +//【品牌/高级选项】当多选时阻止链接默认跳转 | ||
1699 | +$('.brand, .senior').on('click', '.attr > a', function(e) { | ||
1700 | + if ($(this).closest('.multi').length > 0) { | ||
1701 | + e.preventDefault(); | ||
1702 | + } | ||
1703 | +}); | ||
1704 | + | ||
1705 | +//【价格】用户定义价格处理 | ||
1706 | +if ($udPrice.length > 0) { | ||
1707 | + $limit = $udPrice.find('.limit'); | ||
1708 | + $min = $limit.filter('.min'); | ||
1709 | + $max = $limit.filter('.max'); | ||
1710 | + $btn = $udPrice.find('.price-sure'); | ||
1711 | + | ||
1712 | + //【价格】输入 | ||
1713 | + $limit.keyup(function() { | ||
1714 | + var min = $.trim($min.val()), | ||
1715 | + max = $.trim($max.val()), | ||
1716 | + isMinInt = interReg.test(min), | ||
1717 | + isMaxInt = interReg.test(max); | ||
1718 | + | ||
1719 | + if (isMaxInt && (min === '' || isMinInt) || | ||
1720 | + isMinInt && (max === '' || isMaxInt) | ||
1721 | + ) { | ||
1722 | + $btn.removeClass('hide'); | ||
1723 | + } else { | ||
1724 | + $btn.addClass('hide'); | ||
1725 | + } | ||
1726 | + }); | ||
1727 | + | ||
1728 | + //【价格】多项查询 | ||
1729 | + $btn.click(function() { | ||
1730 | + var min = $.trim($min.val()), | ||
1731 | + max = $.trim($max.val()), | ||
1732 | + tmp; | ||
1733 | + | ||
1734 | + //对于min大于max的情况,交换位置 | ||
1735 | + if (min !== '' && max !== '' && +min > +max) { | ||
1736 | + tmp = max; | ||
1737 | + max = min; | ||
1738 | + min = tmp; | ||
1739 | + } | ||
1740 | + | ||
1741 | + uriLoc('price', min + ',' + max); | ||
1742 | + }); | ||
1743 | +} | ||
1744 | + | ||
1745 | +//【高级选项】鼠标移入显示子项 | ||
1746 | +$seniorAttrWrap.on('mouseenter', '.attr', function() { | ||
1747 | + var $this = $(this); | ||
1748 | + var index = $this.index(); | ||
1749 | + | ||
1750 | + $this.addClass('hover').siblings().removeClass('hover'); | ||
1751 | + | ||
1752 | + $seniorSubWrap.children('.senior-sub:eq(' + index + ')').removeClass('hide').siblings().addClass('hide'); | ||
1753 | +}).on('mouseleave', '.attr', function() { | ||
1754 | + var $this = $(this), | ||
1755 | + index = $this.index(); | ||
1756 | + | ||
1757 | + hoveredIndex = index; | ||
1758 | + | ||
1759 | + seniorHoverTime = setTimeout(function() { | ||
1760 | + hideSeniorPanel(); | ||
1761 | + }, 100); | ||
1762 | +}); | ||
1763 | + | ||
1764 | +//【高级选项】多选 | ||
1765 | +$('.senior-sub').on('click', '.multi-select', function() { | ||
1766 | + $(this).closest('.senior-sub').addClass('multi'); | ||
1767 | +}).on('click', '.multi-select-ok', function() { | ||
1768 | + var $btn = $(this), | ||
1769 | + $sub = $btn.closest('.senior-sub'), | ||
1770 | + val = ''; | ||
1771 | + | ||
1772 | + if ($btn.hasClass('dis')) { | ||
1773 | + return; | ||
1774 | + } | ||
1775 | + | ||
1776 | + $sub.find('.checked').each(function() { | ||
1777 | + var id = $(this).data('id'); | ||
1778 | + | ||
1779 | + val += (val === '') ? id : (',' + id); | ||
1780 | + }); | ||
1781 | + | ||
1782 | + uriLoc($sub.data('attr'), val); | ||
1783 | +}).on('mouseenter', function() { | ||
1784 | + clearTimeout(seniorHoverTime); | ||
1785 | +}).on('mouseleave', function() { | ||
1786 | + hideSeniorPanel(); | ||
1787 | +}); | ||
1788 | + | ||
1785 | }); | 1789 | }); |
1786 | define("js/product/sort-pager", ["jquery"], function(require, exports, module){ | 1790 | define("js/product/sort-pager", ["jquery"], function(require, exports, module){ |
1787 | /** | 1791 | /** |
@@ -3962,7 +3966,7 @@ function picCaptchaAjaxFn(page, callback) { | @@ -3962,7 +3966,7 @@ function picCaptchaAjaxFn(page, callback) { | ||
3962 | type: 'POST', | 3966 | type: 'POST', |
3963 | url: url, | 3967 | url: url, |
3964 | data: { | 3968 | data: { |
3965 | - code: $ca.val() | 3969 | + verifyCode: $ca.val() |
3966 | 3970 | ||
3967 | //mobile: $pn.val(), | 3971 | //mobile: $pn.val(), |
3968 | //area: $region.text().split('+')[1] | 3972 | //area: $region.text().split('+')[1] |
@@ -3995,7 +3999,7 @@ function msgCaptchaAjaxFn(page, callback) { | @@ -3995,7 +3999,7 @@ function msgCaptchaAjaxFn(page, callback) { | ||
3995 | type: 'POST', | 3999 | type: 'POST', |
3996 | url: url, | 4000 | url: url, |
3997 | data: { | 4001 | data: { |
3998 | - code: $ca.val(), | 4002 | + verifyCode: $ca.val(), |
3999 | mobile: $pn.val(), | 4003 | mobile: $pn.val(), |
4000 | area: $region.text().split('+')[1] | 4004 | area: $region.text().split('+')[1] |
4001 | } | 4005 | } |
@@ -4291,7 +4295,7 @@ exports.init = function(page) { | @@ -4291,7 +4295,7 @@ exports.init = function(page) { | ||
4291 | 4295 | ||
4292 | $regionSelect.change(function() { | 4296 | $regionSelect.change(function() { |
4293 | 4297 | ||
4294 | - $region.text('+' + $('#region').val()); | 4298 | + $region.text($('#region').val()); |
4295 | 4299 | ||
4296 | validateRule(page, $pn, showErrTip); //验证 | 4300 | validateRule(page, $pn, showErrTip); //验证 |
4297 | }); | 4301 | }); |
@@ -4319,7 +4323,7 @@ exports.init = function(page) { | @@ -4319,7 +4323,7 @@ exports.init = function(page) { | ||
4319 | data: { | 4323 | data: { |
4320 | area: $region.text().split('+')[1], | 4324 | area: $region.text().split('+')[1], |
4321 | mobile: $pn.val(), | 4325 | mobile: $pn.val(), |
4322 | - code: $ca.val() | 4326 | + verifyCode: $ca.val() |
4323 | } | 4327 | } |
4324 | }).then(function(data) { | 4328 | }).then(function(data) { |
4325 | if (data.code === 200) { | 4329 | if (data.code === 200) { |
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
3.35 KB
2.77 KB
3.76 KB
4.71 KB
1020 Bytes
@@ -218,10 +218,11 @@ | @@ -218,10 +218,11 @@ | ||
218 | .price-sure { | 218 | .price-sure { |
219 | height: 24px; | 219 | height: 24px; |
220 | width: 44px; | 220 | width: 44px; |
221 | - border: 1px solid #e0e0e0; | ||
222 | - background: #fff; | ||
223 | - color: #666; | 221 | + background: #333; |
222 | + color: #fff; | ||
224 | margin-left: 10px; | 223 | margin-left: 10px; |
224 | + outline: none; | ||
225 | + border: none; | ||
225 | } | 226 | } |
226 | 227 | ||
227 | .color-block { | 228 | .color-block { |
@@ -22,6 +22,7 @@ class BackController extends WebAction | @@ -22,6 +22,7 @@ class BackController extends WebAction | ||
22 | 'coverImg' => $banner['img'], | 22 | 'coverImg' => $banner['img'], |
23 | 'countryCode' => '86', | 23 | 'countryCode' => '86', |
24 | 'countryName' => '中国', | 24 | 'countryName' => '中国', |
25 | + 'captchaUrl'=>'/passport/images?t=1449799445', | ||
25 | 'countryList' => RegData::getAreasData(), | 26 | 'countryList' => RegData::getAreasData(), |
26 | ) | 27 | ) |
27 | ); | 28 | ); |
@@ -40,7 +41,7 @@ class BackController extends WebAction | @@ -40,7 +41,7 @@ class BackController extends WebAction | ||
40 | { | 41 | { |
41 | $phoneNum = $this->post('phoneNum',''); | 42 | $phoneNum = $this->post('phoneNum',''); |
42 | $area = $this->post('area','86'); | 43 | $area = $this->post('area','86'); |
43 | - $captcha = $this->post('captcha',''); | 44 | + $verifyCode = $this->post('verifyCode',''); |
44 | if(Helpers::verifyEmail($phoneNum)){ //验证邮箱 | 45 | if(Helpers::verifyEmail($phoneNum)){ //验证邮箱 |
45 | $email = $phoneNum; | 46 | $email = $phoneNum; |
46 | $data = BackData::sendCodeToEmail($email); | 47 | $data = BackData::sendCodeToEmail($email); |
@@ -56,7 +57,7 @@ class BackController extends WebAction | @@ -56,7 +57,7 @@ class BackController extends WebAction | ||
56 | $data = BackData::sendCodeToMobile($mobile); | 57 | $data = BackData::sendCodeToMobile($mobile); |
57 | $this->setSession('phoneNum', $phoneNum); | 58 | $this->setSession('phoneNum', $phoneNum); |
58 | $this->setSession('area', $area); | 59 | $this->setSession('area', $area); |
59 | - $this->setSession('captcha', $captcha); | 60 | + $this->setSession('verifyCode', $verifyCode); |
60 | if($data['code'] == 200) { | 61 | if($data['code'] == 200) { |
61 | $this->redirect('verification'); | 62 | $this->redirect('verification'); |
62 | } | 63 | } |
@@ -75,23 +76,6 @@ class BackController extends WebAction | @@ -75,23 +76,6 @@ class BackController extends WebAction | ||
75 | $this->redirect('index'); | 76 | $this->redirect('index'); |
76 | } | 77 | } |
77 | $banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE); | 78 | $banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE); |
78 | - $simpleHeader = array( | ||
79 | - 'logo' => array( | ||
80 | - 'img' => 'http://static.yohobuy.com/newheader/img/logo_e.png', | ||
81 | - 'url' => 'http://www.yohobuy.com' | ||
82 | - ), | ||
83 | - 'tool' => array( | ||
84 | - 'user' => '2586703@qq.com', | ||
85 | - 'userCenter' => '', | ||
86 | - 'loginHref' => '', | ||
87 | - 'logoutHref' => '', | ||
88 | - 'registerHref' => '', | ||
89 | - 'favoriteHref' => '', | ||
90 | - 'couponHref' => '', | ||
91 | - 'orderHref' => '', | ||
92 | - 'helpHref' => '' | ||
93 | - ) | ||
94 | - ); | ||
95 | $data = array( | 79 | $data = array( |
96 | 'simpleHeader' => PassportModel::getSimpleHeader(false), | 80 | 'simpleHeader' => PassportModel::getSimpleHeader(false), |
97 | 'sendEmail' => array( | 81 | 'sendEmail' => array( |
@@ -176,7 +160,7 @@ class BackController extends WebAction | @@ -176,7 +160,7 @@ class BackController extends WebAction | ||
176 | public function verificationAction() { | 160 | public function verificationAction() { |
177 | $phoneNum = $this->getSession('phoneNum'); | 161 | $phoneNum = $this->getSession('phoneNum'); |
178 | $area = $this->getSession('area'); | 162 | $area = $this->getSession('area'); |
179 | - $captcha = $this->getSession('captcha'); | 163 | + $verifyCode = $this->getSession('verifyCode'); |
180 | if(empty($phoneNum)) { | 164 | if(empty($phoneNum)) { |
181 | $this->redirect('index'); | 165 | $this->redirect('index'); |
182 | } | 166 | } |
@@ -27,7 +27,7 @@ class RegisterController extends WebAction | @@ -27,7 +27,7 @@ class RegisterController extends WebAction | ||
27 | 'loginUrl' => '/signin.html?refer='.$refer, | 27 | 'loginUrl' => '/signin.html?refer='.$refer, |
28 | 'coverHref' => $cover['url'], | 28 | 'coverHref' => $cover['url'], |
29 | 'coverImg' => $cover['img'], | 29 | 'coverImg' => $cover['img'], |
30 | - 'regBtnText' => '快速登录' | 30 | + 'regBtnText' => '立即注册' |
31 | ) | 31 | ) |
32 | ); | 32 | ); |
33 | $this->setCookie('refer', $refer); | 33 | $this->setCookie('refer', $refer); |
-
Please register or login to post a comment