Authored by 毕凯

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

@@ -5,9 +5,9 @@ @@ -5,9 +5,9 @@
5 } 5 }
6 .coin-num { 6 .coin-num {
7 color: #d0021b; 7 color: #d0021b;
8 - font-size: pxToRem(66px); 8 + font-size: pxToRem(80px);
9 font-weight: bold; 9 font-weight: bold;
10 - line-height: pxToRem(106px); 10 + line-height: pxToRem(88px);
11 // letter-spacing: pxToRem(8px); 11 // letter-spacing: pxToRem(8px);
12 } 12 }
13 13
@@ -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>
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 <li class="po-re"> 9 <li class="po-re">
10 <label class="pn-label">手机号码</label> 10 <label class="pn-label">手机号码</label>
11 <span class="country-code">+{{area}}</span> 11 <span class="country-code">+{{area}}</span>
12 - <span class="phone-num">{{phoneNum}}</span> 12 + <span class="phone-num">{{mobile}}</span>
13 </li> 13 </li>
14 <li class="po-re"> 14 <li class="po-re">
15 <input id="captcha" class="input va captcha" type="text" name="captcha"> 15 <input id="captcha" class="input va captcha" type="text" name="captcha">
@@ -22,8 +22,8 @@ @@ -22,8 +22,8 @@
22 </li> 22 </li>
23 <li> 23 <li>
24 <input name="area" id="area" type="hidden" value="{{area}}"> 24 <input name="area" id="area" type="hidden" value="{{area}}">
25 - <input name="mobile" id="mobile" type="hidden" value="{{phoneNum}}">  
26 - <input name="captchaPic" id="captchaPic" type="hidden" value="{{captcha}}"> 25 + <input name="mobile" id="mobile" type="hidden" value="{{mobile}}">
  26 + <input name="captchaPic" id="captchaPic" type="hidden" value="{{verifyCode}}">
27 <input name="refer" id="refer" type="hidden" value=""> 27 <input name="refer" id="refer" type="hidden" value="">
28 <input id="next-step" class="btn next-step disable" type="submit" value="下一步" disabled=""> 28 <input id="next-step" class="btn next-step disable" type="submit" value="下一步" disabled="">
29 </li> 29 </li>
@@ -102,16 +102,20 @@ @@ -102,16 +102,20 @@
102 </div> 102 </div>
103 </div> 103 </div>
104 104
105 - <ul class="panel-body check-container clearfix">  
106 - {{# brandsShow}}  
107 - <li class="attr" data-index="{{index}}" data-key="{{key}}">  
108 - <a href="{{href}}">  
109 - <span class="iconfont checkbox" data-id="{{id}}">&#xe613;</span>  
110 - <span title="{{name}}">{{name}}</span>  
111 - </a>  
112 - </li>  
113 - {{/ brandsShow}}  
114 - </ul> 105 + <div class="panel-body">
  106 + <div class="ul-scroll">
  107 + <ul class="check-container clearfix">
  108 + {{# brandsShow}}
  109 + <li class="attr" data-index="{{index}}" data-key="{{key}}">
  110 + <a href="{{href}}">
  111 + <span class="iconfont checkbox" data-id="{{id}}">&#xe613;</span>
  112 + <span title="{{name}}">{{name}}</span>
  113 + </a>
  114 + </li>
  115 + {{/ brandsShow}}
  116 + </ul>
  117 + </div>
  118 + </div>
115 119
116 <div class="btns"> 120 <div class="btns">
117 <button id="brand-multi-ok" class="multi-select-ok dis">确定</button> 121 <button id="brand-multi-ok" class="multi-select-ok dis">确定</button>
@@ -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: '&#xe613;',  
1496 - checked: '&#xe612;'  
1497 -},  
1498 -moreUnicode = {  
1499 - up: '&#xe610;',  
1500 - down: '&#xe600;'  
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: '&#xe613;',
  1496 + checked: '&#xe612;'
  1497 +},
  1498 +moreUnicode = {
  1499 + up: '&#xe610;',
  1500 + down: '&#xe600;'
  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.
@@ -152,7 +152,7 @@ $('#brand-search-input').keyup(function() { @@ -152,7 +152,7 @@ $('#brand-search-input').keyup(function() {
152 if (val === '') { 152 if (val === '') {
153 $brandAttrs.removeClass('hide'); 153 $brandAttrs.removeClass('hide');
154 } else { 154 } else {
155 - $brandAttrs.addClass('hide').filter('[data-key*=' + val + ']').removeClass('hide'); 155 + $brandAttrs.addClass('hide').filter('[data-key*="' + val + '"]').removeClass('hide');
156 } 156 }
157 }); 157 });
158 158
@@ -14,16 +14,12 @@ @@ -14,16 +14,12 @@
14 14
15 .title { 15 .title {
16 float: left; 16 float: left;
17 - width: 90px; 17 + width: 75px;
18 line-height: 30px; 18 line-height: 30px;
19 } 19 }
20 20
21 .attr-content { 21 .attr-content {
22 - margin-left: 90px;  
23 -  
24 - .default {  
25 - padding-right: 140px;  
26 - } 22 + margin-left: 75px;
27 } 23 }
28 24
29 .multi-select { 25 .multi-select {
@@ -120,16 +116,17 @@ @@ -120,16 +116,17 @@
120 } 116 }
121 117
122 .brand-more { 118 .brand-more {
123 - margin-right: 20px; 119 + margin-right: 10px;
124 cursor: pointer; 120 cursor: pointer;
125 } 121 }
126 122
127 .brands-index { 123 .brands-index {
128 float: left; 124 float: left;
129 line-height: 30px; 125 line-height: 30px;
  126 + margin-right: 5px;
130 127
131 span { 128 span {
132 - margin: 0 5px; 129 + margin: 0 2px;
133 cursor: pointer; 130 cursor: pointer;
134 -moz-user-select: none; 131 -moz-user-select: none;
135 132
@@ -145,7 +142,7 @@ @@ -145,7 +142,7 @@
145 line-height: 18px; 142 line-height: 18px;
146 border: 1px solid #b0b0b0; 143 border: 1px solid #b0b0b0;
147 margin-top: 5px; 144 margin-top: 5px;
148 - margin-left: 15px; 145 + margin-left: 10px;
149 146
150 input { 147 input {
151 float: left; 148 float: left;
@@ -159,7 +156,7 @@ @@ -159,7 +156,7 @@
159 display: inline-block; 156 display: inline-block;
160 width: 55px; 157 width: 55px;
161 height: 18px; 158 height: 18px;
162 - background: #b0b0b0; 159 + background: #3a3a3a;
163 color: #fff; 160 color: #fff;
164 text-align: center; 161 text-align: center;
165 cursor: default; 162 cursor: default;
@@ -168,10 +165,15 @@ @@ -168,10 +165,15 @@
168 165
169 .panel-body { 166 .panel-body {
170 padding: 15px 20px; 167 padding: 15px 20px;
171 - margin-top: 5px;  
172 background: #f4f7f6; 168 background: #f4f7f6;
173 - min-height: 30px;  
174 - border: 1px solid #000; 169 + margin-top: 5px;
  170 + margin-left: 10px;
  171 +
  172 + .ul-scroll {
  173 + overflow: auto;
  174 + min-height: 30px;
  175 + max-height: 150px;
  176 + }
175 } 177 }
176 } 178 }
177 179
@@ -301,4 +303,4 @@ @@ -301,4 +303,4 @@
301 .multi .checkbox { 303 .multi .checkbox {
302 display: inline; 304 display: inline;
303 } 305 }
304 -} 306 +}
1 -@import "search", "list", "new-sale", "filter-box", "sort-pager", "good", "latest-walk", "left-content", "no-result", "hot-rank"; 1 +@import "search", "list", "new-sale", "filter-box", "sort-pager", "good", "latest-walk", "left-content", "no-result", "hot-rank", "shop-entry";
2 2
3 .product-page { 3 .product-page {
4 4
@@ -44,6 +44,14 @@ @@ -44,6 +44,14 @@
44 height: 315px; 44 height: 315px;
45 } 45 }
46 } 46 }
  47 +
  48 + .panel-body .attr {
  49 + width: 25%;
  50 + }
  51 +
  52 + .filter-box .brand .attr-content {
  53 + max-width: 730px;
  54 + }
47 } 55 }
48 56
49 /*990px*/ 57 /*990px*/
@@ -74,5 +82,9 @@ @@ -74,5 +82,9 @@
74 height: 261px; 82 height: 261px;
75 } 83 }
76 } 84 }
  85 +
  86 + .filter-box .brand .attr-content {
  87 + max-width: 570px;
  88 + }
77 } 89 }
78 } 90 }
@@ -148,6 +148,4 @@ @@ -148,6 +148,4 @@
148 color: #f00; 148 color: #f00;
149 } 149 }
150 } 150 }
151 -  
152 - @import "shop-entry";  
153 } 151 }
@@ -5,7 +5,6 @@ @@ -5,7 +5,6 @@
5 */ 5 */
6 6
7 .product-search-page { 7 .product-search-page {
8 - @import "shop-entry";  
9 .goods-container { 8 .goods-container {
10 height: auto; 9 height: auto;
11 padding: 25px 0 0 0; 10 padding: 25px 0 0 0;
@@ -22,7 +21,6 @@ @@ -22,7 +21,6 @@
22 /*990px*/ 21 /*990px*/
23 @media (max-width: 1180px) { 22 @media (max-width: 1180px) {
24 .product-search-page { 23 .product-search-page {
25 -  
26 .goods-container { 24 .goods-container {
27 height: auto; 25 height: auto;
28 padding-top: 25px; 26 padding-top: 25px;
@@ -42,5 +40,9 @@ @@ -42,5 +40,9 @@
42 height: 255px; 40 height: 255px;
43 } 41 }
44 } 42 }
  43 +
  44 + .filter-box .brand .attr-content {
  45 + max-width: 750px;
  46 + }
45 } 47 }
46 } 48 }
1 -<?php  
2 -use Action\WebAction;  
3 -use LibModels\Web\Passport\RegData;  
4 -use Passport\PassportModel;  
5 -use Plugin\Helpers;  
6 -use LibModels\Wap\Passport\BackData;  
7 -use Plugin\AuthCode;  
8 -  
9 -class BackController extends WebAction  
10 -{  
11 - /**  
12 - * 找回密码  
13 - */  
14 - public function indexAction()  
15 - {  
16 - $banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);  
17 - $data = array(  
18 - 'simpleHeader' => PassportModel::getSimpleHeader(false),  
19 - 'backPage' => true,  
20 - 'back' => array(  
21 - 'coverHref' => $banner['url'],  
22 - 'coverImg' => $banner['img'],  
23 - 'countryCode' => '86',  
24 - 'countryName' => '中国',  
25 - 'countryList' => RegData::getAreasData(),  
26 - )  
27 - );  
28 - $this->_view->display('index', $data);  
29 - }  
30 -  
31 - public function authcodeAction()  
32 - {  
33 - echo $this->echoJson(array('code'=> 200));  
34 - }  
35 -  
36 - /**  
37 - *  
38 - */  
39 - public function emailAction()  
40 - {  
41 - $phoneNum = $this->post('phoneNum','');  
42 - $area = $this->post('area','86');  
43 - $captcha = $this->post('captcha','');  
44 - if(Helpers::verifyEmail($phoneNum)){ //验证邮箱  
45 - $email = $phoneNum;  
46 - $data = BackData::sendCodeToEmail($email);  
47 - $this->setSession('phoneNum', $phoneNum);  
48 - if($data['code'] == 200) {  
49 - $this->redirect('sendemail');  
50 - }  
51 - else {  
52 - $this->redirect('index');  
53 - }  
54 - } else if(Helpers::verifyMobile($phoneNum)) {//验证手机号  
55 - $mobile = $phoneNum;  
56 - $data = BackData::sendCodeToMobile($mobile);  
57 - $this->setSession('phoneNum', $phoneNum);  
58 - $this->setSession('area', $area);  
59 - $this->setSession('captcha', $captcha);  
60 - if($data['code'] == 200) {  
61 - $this->redirect('verification');  
62 - }  
63 - else {  
64 - $this->redirect('index');  
65 - }  
66 - }  
67 - }  
68 -  
69 - /**  
70 - * 发送邮件页面  
71 - */  
72 - public function sendemailAction() {  
73 - $phoneNum = $this->getSession('phoneNum');  
74 - if(empty($phoneNum)) {  
75 - $this->redirect('index');  
76 - }  
77 - $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(  
96 - 'simpleHeader' => PassportModel::getSimpleHeader(false),  
97 - 'sendEmail' => array(  
98 - 'coverHref' => $banner['url'],  
99 - 'coverImg' => $banner['img'],  
100 - 'countrys' => array(),  
101 - )  
102 - );  
103 - $this->_view->display('send-email', $data);  
104 - }  
105 -  
106 - /**  
107 - * 重置密码页面  
108 - */  
109 - public function backcodeAction() {  
110 - $code = $this->get('code');  
111 - $info = $this->checkCode($code);  
112 - if(empty($info)) {  
113 - $this->redirect('index');  
114 - }  
115 - $banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);  
116 - $data = array(  
117 - 'simpleHeader' => PassportModel::getSimpleHeader(false),  
118 - 'resetPage' => true,  
119 - 'resetPwd' => array(  
120 - 'coverHref' => $banner['url'],  
121 - 'coverImg' => $banner['img'],  
122 - 'countrys' => array(),  
123 - 'code' => $code,  
124 - )  
125 - );  
126 - $this->_view->display('reset-pwd', $data);  
127 - }  
128 -  
129 - /**  
130 - * 更新密码接口  
131 - *  
132 - */  
133 - public function updateAction()  
134 - {  
135 - $code = $this->post('code');  
136 - $password = $this->post('pwd');  
137 - $info = $this->checkCode($code);  
138 - if(Helpers::verifyPassword($password) && !empty($info)) {  
139 - //修改密码  
140 - if(isset($info['mobile'])) {//手机号修改密码  
141 - $mobile = $info['mobile'];  
142 - $token = $info['token'];  
143 - $area = $info['area'];  
144 - $data = BackData::modifyPasswordByMobile($mobile, $token, $password, $area);  
145 - if($data['code']) {  
146 - $this->redirect('resetSuccess');  
147 - }  
148 - } else if(isset($info['uid'])) {//其他方式修改密码  
149 - $uid = $info['uid'];  
150 - $this->redirect('resetSuccess');  
151 - }  
152 - }  
153 - //跳转错误页面  
154 - $this->redirect('/error/index');  
155 - }  
156 -  
157 - /**  
158 - * 重置密码成功  
159 - */  
160 - public function resetSuccessAction() {  
161 - $banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);  
162 - $data = array(  
163 - 'simpleHeader' => PassportModel::getSimpleHeader(false),  
164 - 'resetSuccess' => array(  
165 - 'coverHref' => $banner['url'],  
166 - 'coverImg' => $banner['img'],  
167 - 'countrys' => array()  
168 - )  
169 - );  
170 - $this->_view->display('reset-success', $data);  
171 - }  
172 -  
173 - /**  
174 - * 手机验证页面  
175 - */  
176 - public function verificationAction() {  
177 - $phoneNum = $this->getSession('phoneNum');  
178 - $area = $this->getSession('area');  
179 - $captcha = $this->getSession('captcha');  
180 - if(empty($phoneNum)) {  
181 - $this->redirect('index');  
182 - }  
183 - $banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);  
184 - $data = array(  
185 - 'simpleHeader' => PassportModel::getSimpleHeader(false),  
186 - 'vertificationPage' => true,  
187 - 'verification' => array(  
188 - 'coverHref' => $banner['url'],  
189 - 'coverImg' => $banner['img'],  
190 - 'phoneNum' => $phoneNum,  
191 - 'area' => $area,  
192 - 'captcha'=> $captcha,  
193 - 'countrys' => array()  
194 - )  
195 - );  
196 - $this->_view->display('verification', $data);  
197 - }  
198 -  
199 - /**  
200 - * 手机找回密码验证  
201 - */  
202 - public function backmobileAction()  
203 - {  
204 - $mobile = $this->post('mobile');//phoneNum  
205 - $area = $this->post('area');  
206 - //$captcha = $this->post('captcha');  
207 - $code = $this->post('captcha');//code  
208 - if($this->getSession('phoneNum') == $mobile && $this->getSession('area') == $area)  
209 - {  
210 - $result = BackData::validateMobileCode($mobile, $code, $area);  
211 - if($result['code'] == 200) {  
212 - $str = json_encode(array(  
213 - 'mobile'=> $mobile,  
214 - 'area' => $area,  
215 - 'token'=> $result['data']['token'],  
216 - 'create_time' => time()  
217 - ));  
218 - $code = AuthCode::encode($str, PassportModel::BACK_FIND_SECRET_KEY);  
219 - $url = '/passport/back/backcode?code='.base64_encode($code);  
220 - $this->redirect(SITE_MAIN.$url);  
221 - }  
222 - }  
223 - }  
224 -  
225 - /**  
226 - * 检查code  
227 - *  
228 - * @param string $code  
229 - * @return boolean  
230 - */  
231 - private function checkCode($code)  
232 - {  
233 - $code = base64_decode($code);  
234 - $info = json_decode(AuthCode::decode($code, PassportModel::BACK_FIND_SECRET_KEY), true);  
235 - if ($info['create_time'] < 1 || (time() - $info['create_time']) > 86400) {  
236 - return array();  
237 - }  
238 - return $info;  
239 - } 1 +<?php
  2 +use Action\WebAction;
  3 +use LibModels\Web\Passport\RegData;
  4 +use Passport\PassportModel;
  5 +use Plugin\Helpers;
  6 +use LibModels\Wap\Passport\BackData;
  7 +use Plugin\AuthCode;
  8 +
  9 +class BackController extends WebAction
  10 +{
  11 + /**
  12 + * 找回密码
  13 + */
  14 + public function indexAction()
  15 + {
  16 + $banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);
  17 + $data = array(
  18 + 'simpleHeader' => PassportModel::getSimpleHeader(false),
  19 + 'backPage' => true,
  20 + 'back' => array(
  21 + 'coverHref' => $banner['url'],
  22 + 'coverImg' => $banner['img'],
  23 + 'countryCode' => '86',
  24 + 'countryName' => '中国',
  25 + 'captchaUrl'=>'/passport/images?t=1449799445',
  26 + 'countryList' => RegData::getAreasData(),
  27 + )
  28 + );
  29 + $this->_view->display('index', $data);
  30 + }
  31 +
  32 + public function authcodeAction()
  33 + {
  34 + echo $this->echoJson(array('code'=> 200));
  35 + }
  36 +
  37 + /**
  38 + *
  39 + */
  40 + public function emailAction()
  41 + {
  42 + $phoneNum = $this->post('phoneNum','');
  43 + $area = $this->post('area','86');
  44 + $verifyCode = $this->post('verifyCode','');
  45 + if(Helpers::verifyEmail($phoneNum)){ //验证邮箱
  46 + $email = $phoneNum;
  47 + $data = BackData::sendCodeToEmail($email);
  48 + if($data['code'] == 200) {
  49 + $this->setSession('email', $email);
  50 + $this->redirect('sendemail');
  51 + }
  52 + else {
  53 + $this->redirect('index');
  54 + }
  55 + } else if(Helpers::verifyMobile($phoneNum)) {//验证手机号
  56 + $mobile = $phoneNum;
  57 + $data = BackData::sendCodeToMobile($mobile);
  58 + if($data['code'] == 200) {
  59 + $this->setSession('mobile', $mobile);
  60 + $this->setSession('area', $area);
  61 + $this->setSession('verifyCode', $verifyCode);
  62 + $this->redirect('verification');
  63 + }
  64 + else {
  65 + $this->redirect('index');
  66 + }
  67 + }
  68 + }
  69 +
  70 + /**
  71 + * 发送邮件页面
  72 + */
  73 + public function sendemailAction() {
  74 + $email = $this->getSession('email');
  75 + if(empty($email)) {
  76 + $this->redirect('index');
  77 + }
  78 + $banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);
  79 + $data = array(
  80 + 'simpleHeader' => PassportModel::getSimpleHeader(false),
  81 + 'sendEmail' => array(
  82 + 'coverHref' => $banner['url'],
  83 + 'coverImg' => $banner['img'],
  84 + 'countrys' => array(),
  85 + )
  86 + );
  87 + $this->_view->display('send-email', $data);
  88 + }
  89 +
  90 + /**
  91 + * 重置密码页面
  92 + */
  93 + public function backcodeAction() {
  94 + $code = $this->get('code');
  95 + $info = $this->checkCode($code);
  96 + if(empty($info)) {
  97 + $this->redirect('index');
  98 + }
  99 + $banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);
  100 + $data = array(
  101 + 'simpleHeader' => PassportModel::getSimpleHeader(false),
  102 + 'resetPage' => true,
  103 + 'resetPwd' => array(
  104 + 'coverHref' => $banner['url'],
  105 + 'coverImg' => $banner['img'],
  106 + 'countrys' => array(),
  107 + 'code' => $code,
  108 + )
  109 + );
  110 + $this->_view->display('reset-pwd', $data);
  111 + }
  112 +
  113 + /**
  114 + * 更新密码接口
  115 + *
  116 + */
  117 + public function updateAction()
  118 + {
  119 + $code = $this->post('code');
  120 + $password = $this->post('pwd');
  121 + $info = $this->checkCode($code);
  122 + if(Helpers::verifyPassword($password) && !empty($info)) {
  123 + //修改密码
  124 + if(isset($info['mobile'])) {//手机号修改密码
  125 + $mobile = $info['mobile'];
  126 + $token = $info['token'];
  127 + $area = $info['area'];
  128 + $data = BackData::modifyPasswordByMobile($mobile, $token, $password, $area);
  129 + if($data['code']) {
  130 + $this->redirect('resetSuccess');
  131 + }
  132 + } else if(isset($info['uid'])) {//其他方式修改密码
  133 + $uid = $info['uid'];
  134 + $this->redirect('resetSuccess');
  135 + }
  136 + }
  137 + //跳转错误页面
  138 + $this->redirect('/error/index');
  139 + }
  140 +
  141 + /**
  142 + * 重置密码成功
  143 + */
  144 + public function resetSuccessAction() {
  145 + $banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);
  146 + $data = array(
  147 + 'simpleHeader' => PassportModel::getSimpleHeader(false),
  148 + 'resetSuccess' => array(
  149 + 'coverHref' => $banner['url'],
  150 + 'coverImg' => $banner['img'],
  151 + 'countrys' => array()
  152 + )
  153 + );
  154 + $this->_view->display('reset-success', $data);
  155 + }
  156 +
  157 + /**
  158 + * 手机验证页面
  159 + */
  160 + public function verificationAction() {
  161 + $mobile = $this->getSession('mobile');
  162 + $area = $this->getSession('area');
  163 + $verifyCode = $this->getSession('verifyCode');
  164 + if(empty($mobile)) {
  165 + $this->redirect('index');
  166 + }
  167 + $banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);
  168 + $data = array(
  169 + 'simpleHeader' => PassportModel::getSimpleHeader(false),
  170 + 'vertificationPage' => true,
  171 + 'verification' => array(
  172 + 'coverHref' => $banner['url'],
  173 + 'coverImg' => $banner['img'],
  174 + 'mobile' => $mobile,
  175 + 'area' => $area,
  176 + 'verifyCode'=> $verifyCode,
  177 + 'countrys' => array()
  178 + )
  179 + );
  180 + $this->_view->display('verification', $data);
  181 + }
  182 +
  183 + /**
  184 + * 手机找回密码验证
  185 + */
  186 + public function backmobileAction()
  187 + {
  188 + $mobile = $this->post('mobile');
  189 + $area = $this->post('area');
  190 + $verifyCode = $this->post('verifyCode');
  191 + $code = $this->post('code');//code
  192 + if($this->getSession('mobile') == $mobile && $this->getSession('area') == $area)
  193 + {
  194 + $result = BackData::validateMobileCode($mobile, $code, $area);
  195 + if($result['code'] == 200) {
  196 + $str = json_encode(array(
  197 + 'mobile'=> $mobile,
  198 + 'area' => $area,
  199 + 'token'=> $result['data']['token'],
  200 + 'create_time' => time()
  201 + ));
  202 + $code = AuthCode::encode($str, PassportModel::BACK_FIND_SECRET_KEY);
  203 + $url = '/passport/back/backcode?code='.base64_encode($code);
  204 + $this->redirect(SITE_MAIN.$url);
  205 + }
  206 + }
  207 + }
  208 +
  209 + /**
  210 + * 检查code
  211 + *
  212 + * @param string $code
  213 + * @return boolean
  214 + */
  215 + private function checkCode($code)
  216 + {
  217 + $code = base64_decode($code);
  218 + $info = json_decode(AuthCode::decode($code, PassportModel::BACK_FIND_SECRET_KEY), true);
  219 + if ($info['create_time'] < 1 || (time() - $info['create_time']) > 86400) {
  220 + return array();
  221 + }
  222 + return $info;
  223 + }
240 } 224 }
@@ -22,12 +22,12 @@ class RegisterController extends WebAction @@ -22,12 +22,12 @@ class RegisterController extends WebAction
22 'region' => RegData::getAreasData(), 22 'region' => RegData::getAreasData(),
23 'location' => '+86', 23 'location' => '+86',
24 'captchaUrl' => '/passport/images?t=1449799445', 24 'captchaUrl' => '/passport/images?t=1449799445',
25 - 'itemUrl' => '##', 25 + 'itemUrl' => 'http://www.yohobuy.com/help/?category_id=9',
26 'referUrl' => $refer, 26 'referUrl' => $refer,
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);