Showing
3 changed files
with
56 additions
and
50 deletions
@@ -3762,7 +3762,7 @@ var opt = {}; | @@ -3762,7 +3762,7 @@ var opt = {}; | ||
3762 | 3762 | ||
3763 | var paramStr = window.location.search.split('?')[1]; | 3763 | var paramStr = window.location.search.split('?')[1]; |
3764 | 3764 | ||
3765 | -var keyVal = paramStr.split('&'); | 3765 | +var keyVal = paramStr ? paramStr.split('&') : []; |
3766 | 3766 | ||
3767 | var i, key, val; | 3767 | var i, key, val; |
3768 | 3768 | ||
@@ -6738,6 +6738,7 @@ $confim.on('touchend', '.cancel', function() { | @@ -6738,6 +6738,7 @@ $confim.on('touchend', '.cancel', function() { | ||
6738 | $confim.hide(); | 6738 | $confim.hide(); |
6739 | }).on('touchend', '.confim', function() { | 6739 | }).on('touchend', '.confim', function() { |
6740 | loading.showLoadingMask(); | 6740 | loading.showLoadingMask(); |
6741 | + $confim.hide(); | ||
6741 | $.ajax({ | 6742 | $.ajax({ |
6742 | method: 'POST', | 6743 | method: 'POST', |
6743 | url: '/home/delAddress', | 6744 | url: '/home/delAddress', |
@@ -6750,15 +6751,15 @@ $confim.on('touchend', '.cancel', function() { | @@ -6750,15 +6751,15 @@ $confim.on('touchend', '.cancel', function() { | ||
6750 | } | 6751 | } |
6751 | if (res.code !== 200) { | 6752 | if (res.code !== 200) { |
6752 | tip.show(res.message || '网络出了点问题~'); | 6753 | tip.show(res.message || '网络出了点问题~'); |
6754 | + loading.hideLoadingMask(); | ||
6753 | } else { | 6755 | } else { |
6754 | window.location.reload(); | 6756 | window.location.reload(); |
6755 | } | 6757 | } |
6756 | }).fail(function() { | 6758 | }).fail(function() { |
6757 | tip.show('网络出了点问题~'); | 6759 | tip.show('网络出了点问题~'); |
6760 | + loading.hideLoadingMask(); | ||
6758 | }).always(function() { | 6761 | }).always(function() { |
6759 | deleteId = null; | 6762 | deleteId = null; |
6760 | - $confim.hide(); | ||
6761 | - loading.hideLoadingMask(); | ||
6762 | }); | 6763 | }); |
6763 | }); | 6764 | }); |
6764 | 6765 | ||
@@ -6782,7 +6783,7 @@ $action.on('touchend', '.del', function() { | @@ -6782,7 +6783,7 @@ $action.on('touchend', '.del', function() { | ||
6782 | 6783 | ||
6783 | $submit.on('touchend', function() { | 6784 | $submit.on('touchend', function() { |
6784 | if (security.hasDangerInput(false)) { | 6785 | if (security.hasDangerInput(false)) { |
6785 | - return false; | 6786 | + return false; |
6786 | } | 6787 | } |
6787 | $addressForm.submit(); | 6788 | $addressForm.submit(); |
6788 | return false; | 6789 | return false; |
@@ -6792,7 +6793,6 @@ $submit.on('touchend', function() { | @@ -6792,7 +6793,6 @@ $submit.on('touchend', function() { | ||
6792 | $(this).removeClass('highlight'); | 6793 | $(this).removeClass('highlight'); |
6793 | }); | 6794 | }); |
6794 | 6795 | ||
6795 | - | ||
6796 | }); | 6796 | }); |
6797 | define("js/me/browse-record", ["jquery","lazyload","handlebars","source-map","hammer"], function(require, exports, module){ | 6797 | define("js/me/browse-record", ["jquery","lazyload","handlebars","source-map","hammer"], function(require, exports, module){ |
6798 | /** | 6798 | /** |
@@ -6930,11 +6930,11 @@ var $addressForm = $('.edit-address'), | @@ -6930,11 +6930,11 @@ var $addressForm = $('.edit-address'), | ||
6930 | $submit = $('.submit'), | 6930 | $submit = $('.submit'), |
6931 | $editAddressPage = $('.my-edit-address-page'), | 6931 | $editAddressPage = $('.my-edit-address-page'), |
6932 | $addressListPage = $('.my-address-list-page'), | 6932 | $addressListPage = $('.my-address-list-page'), |
6933 | - $area = $('.area'), | ||
6934 | $footer = $('#yoho-footer'), | 6933 | $footer = $('#yoho-footer'), |
6935 | $backBtn = $('.nav-back'), | 6934 | $backBtn = $('.nav-back'), |
6936 | $navTitle = $('.nav-title'), | 6935 | $navTitle = $('.nav-title'), |
6937 | navTitle = $navTitle.html(), | 6936 | navTitle = $navTitle.html(), |
6937 | + $area = $('.area'), | ||
6938 | isSubmiting, | 6938 | isSubmiting, |
6939 | currentPage = 'edit', | 6939 | currentPage = 'edit', |
6940 | newArea = []; | 6940 | newArea = []; |
@@ -6957,7 +6957,7 @@ $backBtn.on('touchend', function(e) { | @@ -6957,7 +6957,7 @@ $backBtn.on('touchend', function(e) { | ||
6957 | 6957 | ||
6958 | // 恢复默认的三级选择 | 6958 | // 恢复默认的三级选择 |
6959 | $addressListPage.hide(); | 6959 | $addressListPage.hide(); |
6960 | - $addressListPage.find('ul').hide(); | 6960 | + $addressListPage.find('ul').hide().find('li').removeClass('highlight'); |
6961 | $addressListPage.children('ul').show().children('li').show(); | 6961 | $addressListPage.children('ul').show().children('li').show(); |
6962 | newArea = []; | 6962 | newArea = []; |
6963 | } else { | 6963 | } else { |
@@ -7026,6 +7026,12 @@ $submit.on('touchend', function() { | @@ -7026,6 +7026,12 @@ $submit.on('touchend', function() { | ||
7026 | $(this).removeClass('highlight'); | 7026 | $(this).removeClass('highlight'); |
7027 | }); | 7027 | }); |
7028 | 7028 | ||
7029 | +$('input, textarea').on('focus', function() { | ||
7030 | + $footer.hide(); | ||
7031 | +}).on('blur', function() { | ||
7032 | + $footer.show(); | ||
7033 | +}); | ||
7034 | + | ||
7029 | // 省市区 | 7035 | // 省市区 |
7030 | $area.on('touchend', function() { | 7036 | $area.on('touchend', function() { |
7031 | $editAddressPage.hide(); | 7037 | $editAddressPage.hide(); |
@@ -7036,61 +7042,61 @@ $area.on('touchend', function() { | @@ -7036,61 +7042,61 @@ $area.on('touchend', function() { | ||
7036 | $navTitle.html('地区选择'); | 7042 | $navTitle.html('地区选择'); |
7037 | }); | 7043 | }); |
7038 | 7044 | ||
7039 | -// touchend 在下滑的时候会触发 | ||
7040 | -// 省市区联动 | ||
7041 | -$addressListPage.find('.address').each(function(i, elem) { | ||
7042 | - var addressHammer = new Hammer(elem); | 7045 | +// 省市区列表异步加载 |
7046 | +$.get('/home/locationList').then(function(html) { | ||
7047 | + $addressListPage.html(html); | ||
7043 | 7048 | ||
7044 | - addressHammer.on('tap', function(e) { | ||
7045 | - var $this = $(e.target); | 7049 | + // touchend 在下滑的时候会触发 |
7050 | + // 省市区联动 | ||
7051 | + $addressListPage.find('.address').each(function(i, elem) { | ||
7052 | + var addressHammer = new Hammer(elem); | ||
7046 | 7053 | ||
7047 | - newArea.push($this.children('.caption').text()); | ||
7048 | - $this.siblings().hide(); | ||
7049 | - $this.children('ul').show().children('li').show(); | 7054 | + addressHammer.on('tap', function(e) { |
7055 | + var $this = $(e.target); | ||
7050 | 7056 | ||
7051 | - $(this).removeClass('highlight'); | ||
7052 | - e.srcEvent.preventDefault(); | ||
7053 | - e.srcEvent.stopPropagation(); | 7057 | + newArea.push($this.children('.caption').text()); |
7058 | + $this.siblings().hide(); | ||
7059 | + $this.children('ul').show().children('li').show(); | ||
7060 | + | ||
7061 | + e.srcEvent.preventDefault(); | ||
7062 | + e.srcEvent.stopPropagation(); | ||
7063 | + }); | ||
7054 | }); | 7064 | }); |
7055 | -}); | ||
7056 | 7065 | ||
7057 | -$addressListPage.find('.address-last').each(function(i, elem) { | ||
7058 | - var addressLastHammer = new Hammer(elem); | 7066 | + $addressListPage.find('.address-last').each(function(i, elem) { |
7067 | + var addressLastHammer = new Hammer(elem); | ||
7059 | 7068 | ||
7060 | - addressLastHammer.on('tap', function(e) { | ||
7061 | - var $this = $(e.target); | 7069 | + addressLastHammer.on('tap', function(e) { |
7070 | + var $this = $(e.target); | ||
7062 | 7071 | ||
7063 | - // 填结果到 html | ||
7064 | - newArea.push($this.children('.caption').text()); | ||
7065 | - $('[name="area"]').val(newArea.join(' ')); | ||
7066 | - $('[name="area_code"]').val($this.data('id')); | 7072 | + // 填结果到 html |
7073 | + newArea.push($this.children('.caption').text()); | ||
7074 | + $('[name="area"]').val(newArea.join(' ')); | ||
7075 | + $('[name="area_code"]').val($this.data('id')); | ||
7067 | 7076 | ||
7068 | - $editAddressPage.show(); | ||
7069 | - currentPage = 'edit'; | ||
7070 | - $navTitle.html(navTitle); | ||
7071 | - $footer.show(); | 7077 | + $editAddressPage.show(); |
7078 | + currentPage = 'edit'; | ||
7079 | + $navTitle.html(navTitle); | ||
7080 | + $footer.show(); | ||
7072 | 7081 | ||
7073 | - // 恢复默认的三级选择 | ||
7074 | - $addressListPage.hide(); | ||
7075 | - $addressListPage.find('ul').hide(); | ||
7076 | - $addressListPage.children('ul').show().children('li').show(); | ||
7077 | - newArea = []; | 7082 | + // 恢复默认的三级选择 |
7083 | + $addressListPage.hide(); | ||
7084 | + $addressListPage.find('ul').hide().find('li').removeClass('highlight'); | ||
7085 | + $addressListPage.children('ul').show().children('li').show(); | ||
7086 | + newArea = []; | ||
7078 | 7087 | ||
7079 | - e.srcEvent.preventDefault(); | ||
7080 | - e.srcEvent.stopPropagation(); | 7088 | + e.srcEvent.preventDefault(); |
7089 | + e.srcEvent.stopPropagation(); | ||
7090 | + }); | ||
7081 | }); | 7091 | }); |
7082 | -}); | ||
7083 | 7092 | ||
7084 | -$addressListPage.on('touchstart', 'li', function() { | ||
7085 | - $(this).addClass('highlight'); | ||
7086 | -}).on('touchend touchcancel', 'li', function() { | ||
7087 | - $(this).removeClass('highlight'); | ||
7088 | -}); | ||
7089 | - | ||
7090 | -$('input, textarea').on('focus', function() { | ||
7091 | - $footer.hide(); | ||
7092 | -}).on('blur', function() { | ||
7093 | - $footer.show(); | 7093 | + $addressListPage.on('touchstart', 'li', function() { |
7094 | + $(this).addClass('highlight'); | ||
7095 | + }).on('touchend touchcancel', 'li', function() { | ||
7096 | + $(this).removeClass('highlight'); | ||
7097 | + }); | ||
7098 | +}).fail(function() { | ||
7099 | + tip.show('获取省市区列表失败'); | ||
7094 | }); | 7100 | }); |
7095 | 7101 | ||
7096 | }); | 7102 | }); |
This diff could not be displayed because it is too large.

10.9 KB
-
Please register or login to post a comment