Showing
1 changed file
with
8 additions
and
2 deletions
@@ -18,28 +18,31 @@ var $action = $('.action'), | @@ -18,28 +18,31 @@ var $action = $('.action'), | ||
18 | $confim = $('.confim-mask'), | 18 | $confim = $('.confim-mask'), |
19 | $pageWrap = $('.page-wrap'), | 19 | $pageWrap = $('.page-wrap'), |
20 | $backBtn = $('.nav-back'), | 20 | $backBtn = $('.nav-back'), |
21 | + $navTitle = $('.nav-title'), | ||
21 | isSubmiting, | 22 | isSubmiting, |
22 | deleteId, | 23 | deleteId, |
23 | currentPage = 'address', | 24 | currentPage = 'address', |
24 | newArea = []; | 25 | newArea = []; |
25 | 26 | ||
26 | -// 清除原有链接 | 27 | +// 清除返回按钮原有链接 |
27 | $backBtn.attr('href', 'javascript:void(0);'); | 28 | $backBtn.attr('href', 'javascript:void(0);'); |
28 | 29 | ||
29 | window.rePosFooter(); | 30 | window.rePosFooter(); |
30 | 31 | ||
31 | -// 自定义事件 | 32 | +// 自定义返回按钮事件 |
32 | $backBtn.on('touchend', function(e) { | 33 | $backBtn.on('touchend', function(e) { |
33 | if (currentPage === 'edit') { | 34 | if (currentPage === 'edit') { |
34 | $pageWrap.hide(); | 35 | $pageWrap.hide(); |
35 | $pageWrap.first().show(); | 36 | $pageWrap.first().show(); |
36 | e.preventDefault(); | 37 | e.preventDefault(); |
37 | currentPage = 'address'; | 38 | currentPage = 'address'; |
39 | + $navTitle.html('地址管理'); | ||
38 | } else if (currentPage === 'list') { | 40 | } else if (currentPage === 'list') { |
39 | $pageWrap.hide(); | 41 | $pageWrap.hide(); |
40 | $editAddressPage.show(); | 42 | $editAddressPage.show(); |
41 | e.preventDefault(); | 43 | e.preventDefault(); |
42 | currentPage = 'edit'; | 44 | currentPage = 'edit'; |
45 | + $navTitle.html('修改地址'); | ||
43 | } else { | 46 | } else { |
44 | window.history.go(-1); | 47 | window.history.go(-1); |
45 | } | 48 | } |
@@ -90,11 +93,13 @@ $confim.on('touchend', '.cancel', function() { | @@ -90,11 +93,13 @@ $confim.on('touchend', '.cancel', function() { | ||
90 | // 添加地址 | 93 | // 添加地址 |
91 | $addAddress.on('touchend', function() { | 94 | $addAddress.on('touchend', function() { |
92 | editAddress(); | 95 | editAddress(); |
96 | + $navTitle.html('添加新地址'); | ||
93 | }); | 97 | }); |
94 | 98 | ||
95 | // 编辑或删除 | 99 | // 编辑或删除 |
96 | $action.on('touchend', '.edit', function() { | 100 | $action.on('touchend', '.edit', function() { |
97 | editAddress($(this).data()); | 101 | editAddress($(this).data()); |
102 | + $navTitle.html('修改地址'); | ||
98 | }).on('touchend', '.del', function() { | 103 | }).on('touchend', '.del', function() { |
99 | deleteId = $(this).data('id'); | 104 | deleteId = $(this).data('id'); |
100 | $confim.show(); | 105 | $confim.show(); |
@@ -177,6 +182,7 @@ $addressListPage.on('touchend', '.address', function() { | @@ -177,6 +182,7 @@ $addressListPage.on('touchend', '.address', function() { | ||
177 | 182 | ||
178 | $editAddressPage.show(); | 183 | $editAddressPage.show(); |
179 | currentPage = 'edit'; | 184 | currentPage = 'edit'; |
185 | + $navTitle.html('修改地址'); | ||
180 | 186 | ||
181 | // 恢复默认的三级选择 | 187 | // 恢复默认的三级选择 |
182 | $addressListPage.hide(); | 188 | $addressListPage.hide(); |
-
Please register or login to post a comment