Authored by zhangxiaoru

添加地址

@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 </div> 8 </div>
9 {{/ address}} 9 {{/ address}}
10 10
11 - <a class="add-address" data-href="/home/addressAct?refer=modify" href='/home/addressAct?refer=modify'> 11 + <a class="add-address" data-href="/home/addressAct?refer=modify">
12 添加新地址 12 添加新地址
13 </a> 13 </a>
14 14
@@ -12,6 +12,8 @@ var $confimMod = $('.confim-modify-mask'), @@ -12,6 +12,8 @@ var $confimMod = $('.confim-modify-mask'),
12 orderCode = $modifyAdd.data('orderCode'), 12 orderCode = $modifyAdd.data('orderCode'),
13 $pageWrap = $('.page-wrap'), 13 $pageWrap = $('.page-wrap'),
14 $footer = $('#yoho-footer'), 14 $footer = $('#yoho-footer'),
  15 + $addAddress = $('.add-address'),
  16 + $addressItem = $('.address-item'),
15 selectId; 17 selectId;
16 18
17 require('../common'); 19 require('../common');
@@ -62,3 +64,14 @@ $confimMod.on('touchend', '.cancel', function() { @@ -62,3 +64,14 @@ $confimMod.on('touchend', '.cancel', function() {
62 }); 64 });
63 return false; 65 return false;
64 }); 66 });
  67 +
  68 +//添加地址
  69 +if ($addressItem.length < 5) {
  70 + $addAddress.attr('href', $addAddress.data('href'));
  71 +}
  72 +$addAddress.on('touchend', function() {
  73 + if ($addressItem.length >= 5) {
  74 + tip.show('您最多添加5个收货地址');
  75 + return false;
  76 + }
  77 +});