...
|
...
|
@@ -15,7 +15,9 @@ var $action = $('.action'), |
|
|
$addressListPage = $('.my-address-list-page'),
|
|
|
$area = $('.area'),
|
|
|
$footer = $('#yoho-footer'),
|
|
|
$confim = $('.confim-mask'),
|
|
|
isSubmiting,
|
|
|
deleteId,
|
|
|
newArea = [];
|
|
|
|
|
|
function editAddress(data) {
|
...
|
...
|
@@ -32,9 +34,30 @@ function editAddress(data) { |
|
|
// $addressForm.find('[name="consignee"]').focus();
|
|
|
}
|
|
|
|
|
|
function deleteAddress(data) {
|
|
|
|
|
|
}
|
|
|
$confim.on('touchend', '.cancel', function(){
|
|
|
deleteId = null;
|
|
|
$confim.hide();
|
|
|
}).on('touchend', '.confim', function(){
|
|
|
$.ajax({
|
|
|
method: 'POST',
|
|
|
url: '/home/deladdress',
|
|
|
data: {id: deleteId}
|
|
|
}).then(function(res) {
|
|
|
if ($.type(res) !== 'object') {
|
|
|
res = {};
|
|
|
}
|
|
|
if (res.code !== 200) {
|
|
|
tip.show(res.message || '网络出了点问题~');
|
|
|
} else {
|
|
|
window.location.reload();
|
|
|
}
|
|
|
}).fail(function() {
|
|
|
tip.show('网络出了点问题~');
|
|
|
}).always(function() {
|
|
|
deleteId = null;
|
|
|
$confim.hide();
|
|
|
});
|
|
|
});
|
|
|
|
|
|
// 添加地址
|
|
|
$addAddress.on('touchend', function() {
|
...
|
...
|
@@ -45,7 +68,8 @@ $addAddress.on('touchend', function() { |
|
|
$action.on('touchend', '.edit', function() {
|
|
|
editAddress($(this).data());
|
|
|
}).on('touchend', '.del', function() {
|
|
|
deleteAddress();
|
|
|
deleteId = $(this).data('id');
|
|
|
$confim.show();
|
|
|
});
|
|
|
|
|
|
$submit.on('touchend', function() {
|
...
|
...
|
|