...
|
...
|
@@ -12,7 +12,11 @@ var $action = $('.action'), |
|
|
$submit = $('.submit'),
|
|
|
$addAddress = $('.add-address'),
|
|
|
$editAddressPage = $('.my-edit-address-page'),
|
|
|
isSubmiting;
|
|
|
$addressListPage = $('.my-address-list-page'),
|
|
|
$area = $('.area'),
|
|
|
$footer = $('#yoho-footer'),
|
|
|
isSubmiting,
|
|
|
newArea = [];
|
|
|
|
|
|
function editAddress(data) {
|
|
|
data = data || {};
|
...
|
...
|
@@ -71,3 +75,30 @@ $addressForm.on('submit', function() { |
|
|
});
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
// 省市区
|
|
|
$area.on('touchend', function() {
|
|
|
$footer.hide();
|
|
|
$addressListPage.show();
|
|
|
});
|
|
|
|
|
|
$addressListPage.on('touchend', '.address', function() {
|
|
|
newArea.push($(this).children('.caption').text());
|
|
|
$(this).siblings().hide();
|
|
|
$(this).children('ul').show();
|
|
|
return false;
|
|
|
}).on('touchend', '.address-last', function() {
|
|
|
|
|
|
// 填结果到 html
|
|
|
newArea.push($(this).children('.caption').text());
|
|
|
$('[name="area"]').val(newArea.join(' '));
|
|
|
$('[name="area_code"]').val($(this).data('id'));
|
|
|
|
|
|
// 恢复默认的三级选择
|
|
|
$addressListPage.hide();
|
|
|
$addressListPage.find('ul').hide();
|
|
|
$addressListPage.children('ul').show().children('li').show();
|
|
|
$footer.show();
|
|
|
newArea = [];
|
|
|
return false;
|
|
|
}); |
...
|
...
|
|