Authored by ccbikai

修改地址添加 loading

@@ -5,7 +5,8 @@ @@ -5,7 +5,8 @@
5 */ 5 */
6 6
7 var $ = require('jquery'), 7 var $ = require('jquery'),
8 - tip = require('../plugin/tip'); 8 + tip = require('../plugin/tip'),
  9 + loading = require('../plugin/loading');
9 10
10 var $action = $('.action'), 11 var $action = $('.action'),
11 $addressForm = $('.edit-address'), 12 $addressForm = $('.edit-address'),
@@ -67,6 +68,7 @@ $confim.on('touchend', '.cancel', function() { @@ -67,6 +68,7 @@ $confim.on('touchend', '.cancel', function() {
67 deleteId = null; 68 deleteId = null;
68 $confim.hide(); 69 $confim.hide();
69 }).on('touchend', '.confim', function() { 70 }).on('touchend', '.confim', function() {
  71 + loading.showLoadingMask();
70 $.ajax({ 72 $.ajax({
71 method: 'POST', 73 method: 'POST',
72 url: '/home/deladdress', 74 url: '/home/deladdress',
@@ -87,6 +89,7 @@ $confim.on('touchend', '.cancel', function() { @@ -87,6 +89,7 @@ $confim.on('touchend', '.cancel', function() {
87 }).always(function() { 89 }).always(function() {
88 deleteId = null; 90 deleteId = null;
89 $confim.hide(); 91 $confim.hide();
  92 + loading.hideLoadingMask();
90 }); 93 });
91 }); 94 });
92 95
@@ -137,6 +140,7 @@ $addressForm.on('submit', function() { @@ -137,6 +140,7 @@ $addressForm.on('submit', function() {
137 } 140 }
138 141
139 isSubmiting = true; 142 isSubmiting = true;
  143 + loading.showLoadingMask();
140 $.ajax({ 144 $.ajax({
141 method: 'POST', 145 method: 'POST',
142 url: '/home/saveaddress', 146 url: '/home/saveaddress',
@@ -154,6 +158,7 @@ $addressForm.on('submit', function() { @@ -154,6 +158,7 @@ $addressForm.on('submit', function() {
154 tip.show('网络出了点问题~'); 158 tip.show('网络出了点问题~');
155 }).always(function() { 159 }).always(function() {
156 isSubmiting = false; 160 isSubmiting = false;
  161 + loading.hideLoadingMask();
157 }); 162 });
158 return false; 163 return false;
159 }); 164 });