Authored by 梁志锋

Merge branch 'feature/address' into 'develop'

修改地址页面优化

1. 修改地址表单提交时 弹出小键盘 问题修改;
2. 修改地址页面 省市区点击事件延迟绑定;
3. 地址修改页面 区域选择 点击小箭头出错.

See merge request !8
... ... @@ -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,25 +111,25 @@ $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() {
// 省市区列表异步加载
$.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('地区选择');
});
// 省市区列表异步加载
$.get('/home/locationList').then(function(html) {
$addressListPage.html(html);
});
// touchend 在下滑的时候会触发
// 省市区联动
... ... @@ -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();
... ...