Authored by xuqi

more than 20 address

... ... @@ -12,7 +12,8 @@ var $ = require('yoho-jquery'),
var $receiver = $('#receiver');
var Dialog = popup.Dialog,
Confirm = popup.Confirm;
Confirm = popup.Confirm,
Alert = popup.Alert;
var addressDialogTpl;
var addressTpl;
... ... @@ -278,8 +279,12 @@ $('.address-all').click(function() {
// 新增地址
$('.new-address').click(function() {
// not $('.address-all).click(newAddress);
// because newAddress get a param, this type written will cause disaccord param of newAddress
// 判断是否超过20条地址
if ($('#address-list .address').length >= 20) {
new Alert('您最多添加20个收货地址,可删除不需要的地址后再添加新地址').show();
return;
}
newAddress();
});
... ...