...
|
...
|
@@ -16,6 +16,7 @@ var $addressForm = $('.edit-address'), |
|
|
$footer = $('#yoho-footer'),
|
|
|
$backBtn = $('.nav-back'),
|
|
|
$navTitle = $('.nav-title'),
|
|
|
$input = $('input, textarea'),
|
|
|
navTitle = $navTitle.html(),
|
|
|
$area = $('.area'),
|
|
|
isSubmiting,
|
...
|
...
|
@@ -101,6 +102,7 @@ $addressForm.on('submit', function() { |
|
|
});
|
|
|
|
|
|
$submit.on('touchend', function() {
|
|
|
$input.blur();
|
|
|
$addressForm.submit();
|
|
|
return false;
|
|
|
}).on('touchstart', function() {
|
...
|
...
|
@@ -109,26 +111,26 @@ $submit.on('touchend', function() { |
|
|
$(this).removeClass('highlight');
|
|
|
});
|
|
|
|
|
|
$('input, textarea').on('focus', function() {
|
|
|
$input.on('focus', function() {
|
|
|
$footer.hide();
|
|
|
}).on('blur', function() {
|
|
|
$footer.show();
|
|
|
});
|
|
|
|
|
|
// 省市区
|
|
|
$area.on('touchend', function() {
|
|
|
$editAddressPage.hide();
|
|
|
$addressListPage.show(1, function() {
|
|
|
$footer.hide();
|
|
|
});
|
|
|
currentPage = 'list';
|
|
|
$navTitle.html('地区选择');
|
|
|
});
|
|
|
|
|
|
// 省市区列表异步加载
|
|
|
$.get('/home/locationList').then(function(html) {
|
|
|
$addressListPage.html(html);
|
|
|
|
|
|
// 省市区
|
|
|
$area.on('touchend', function() {
|
|
|
$editAddressPage.hide();
|
|
|
$addressListPage.show(1, function() {
|
|
|
$footer.hide();
|
|
|
});
|
|
|
currentPage = 'list';
|
|
|
$navTitle.html('地区选择');
|
|
|
});
|
|
|
|
|
|
// touchend 在下滑的时候会触发
|
|
|
// 省市区联动
|
|
|
$addressListPage.find('.address').each(function(i, elem) {
|
...
|
...
|
@@ -137,6 +139,9 @@ $.get('/home/locationList').then(function(html) { |
|
|
addressHammer.on('tap', function(e) {
|
|
|
var $this = $(e.target);
|
|
|
|
|
|
if (e.target.tagName !== 'li') {
|
|
|
$this = $this.parent('li');
|
|
|
}
|
|
|
newArea.push($this.children('.caption').text());
|
|
|
$this.siblings().hide();
|
|
|
$this.children('ul').show().children('li').show();
|
...
|
...
|
|