|
@@ -28,7 +28,6 @@ var $action = $('.action'), |
|
@@ -28,7 +28,6 @@ var $action = $('.action'), |
28
|
|
28
|
|
29
|
// 清除返回按钮原有链接
|
29
|
// 清除返回按钮原有链接
|
30
|
$backBtn.attr('href', 'javascript:void(0);');
|
30
|
$backBtn.attr('href', 'javascript:void(0);');
|
31
|
-
|
|
|
32
|
window.rePosFooter();
|
31
|
window.rePosFooter();
|
33
|
|
32
|
|
34
|
// 自定义返回按钮事件
|
33
|
// 自定义返回按钮事件
|
|
@@ -39,6 +38,7 @@ $backBtn.on('touchend', function(e) { |
|
@@ -39,6 +38,7 @@ $backBtn.on('touchend', function(e) { |
39
|
e.preventDefault();
|
38
|
e.preventDefault();
|
40
|
currentPage = 'address';
|
39
|
currentPage = 'address';
|
41
|
$navTitle.html('地址管理');
|
40
|
$navTitle.html('地址管理');
|
|
|
41
|
+ window.rePosFooter();
|
42
|
} else if (currentPage === 'list') {
|
42
|
} else if (currentPage === 'list') {
|
43
|
$pageWrap.hide();
|
43
|
$pageWrap.hide();
|
44
|
$editAddressPage.show();
|
44
|
$editAddressPage.show();
|
|
@@ -60,9 +60,10 @@ function editAddress(data) { |
|
@@ -60,9 +60,10 @@ function editAddress(data) { |
60
|
$addressForm.find('[name="address"]').val(data.address || '');
|
60
|
$addressForm.find('[name="address"]').val(data.address || '');
|
61
|
|
61
|
|
62
|
currentPage = 'edit';
|
62
|
currentPage = 'edit';
|
63
|
- $footer.hide();
|
|
|
64
|
$pageWrap.hide();
|
63
|
$pageWrap.hide();
|
65
|
$editAddressPage.show();
|
64
|
$editAddressPage.show();
|
|
|
65
|
+
|
|
|
66
|
+ $footer.addClass('bottom');
|
66
|
}
|
67
|
}
|
67
|
|
68
|
|
68
|
$confim.on('touchend', '.cancel', function() {
|
69
|
$confim.on('touchend', '.cancel', function() {
|
|
@@ -94,30 +95,7 @@ $confim.on('touchend', '.cancel', function() { |
|
@@ -94,30 +95,7 @@ $confim.on('touchend', '.cancel', function() { |
94
|
});
|
95
|
});
|
95
|
});
|
96
|
});
|
96
|
|
97
|
|
97
|
-// 添加地址
|
|
|
98
|
-$addAddress.on('touchend', function() {
|
|
|
99
|
- if ($addressItem.length >= 5) {
|
|
|
100
|
- tip.show('您最多添加5个收货地址');
|
|
|
101
|
- return false;
|
|
|
102
|
- }
|
|
|
103
|
- editAddress();
|
|
|
104
|
- $navTitle.html('添加新地址');
|
|
|
105
|
-});
|
|
|
106
|
-
|
|
|
107
|
-// 编辑或删除
|
|
|
108
|
-$action.on('touchend', '.edit', function() {
|
|
|
109
|
- editAddress($(this).data());
|
|
|
110
|
- $navTitle.html('修改地址');
|
|
|
111
|
-}).on('touchend', '.del', function() {
|
|
|
112
|
- deleteId = $(this).data('id');
|
|
|
113
|
- $confim.show();
|
|
|
114
|
-});
|
|
|
115
|
-
|
|
|
116
|
-$submit.on('touchend', function() {
|
|
|
117
|
- $addressForm.submit();
|
|
|
118
|
- return false;
|
|
|
119
|
-});
|
|
|
120
|
-
|
98
|
+// 提交表单请求
|
121
|
$addressForm.on('submit', function() {
|
99
|
$addressForm.on('submit', function() {
|
122
|
if (isSubmiting) {
|
100
|
if (isSubmiting) {
|
123
|
return false;
|
101
|
return false;
|
|
@@ -168,6 +146,34 @@ $addressForm.on('submit', function() { |
|
@@ -168,6 +146,34 @@ $addressForm.on('submit', function() { |
168
|
return false;
|
146
|
return false;
|
169
|
});
|
147
|
});
|
170
|
|
148
|
|
|
|
149
|
+// 添加地址
|
|
|
150
|
+$addAddress.on('touchend', function() {
|
|
|
151
|
+ if ($addressItem.length >= 5) {
|
|
|
152
|
+ tip.show('您最多添加5个收货地址');
|
|
|
153
|
+ return false;
|
|
|
154
|
+ }
|
|
|
155
|
+ editAddress();
|
|
|
156
|
+ $navTitle.html('添加新地址');
|
|
|
157
|
+});
|
|
|
158
|
+
|
|
|
159
|
+// 编辑或删除
|
|
|
160
|
+$action.on('touchend', '.edit', function() {
|
|
|
161
|
+ editAddress($(this).data());
|
|
|
162
|
+ $navTitle.html('修改地址');
|
|
|
163
|
+}).on('touchend', '.del', function() {
|
|
|
164
|
+ deleteId = $(this).data('id');
|
|
|
165
|
+ $confim.show();
|
|
|
166
|
+});
|
|
|
167
|
+
|
|
|
168
|
+$submit.on('touchend', function() {
|
|
|
169
|
+ $addressForm.submit();
|
|
|
170
|
+ return false;
|
|
|
171
|
+}).on('touchstart', function() {
|
|
|
172
|
+ $(this).addClass('highlight');
|
|
|
173
|
+}).on('touchend touchcancel', function() {
|
|
|
174
|
+ $(this).removeClass('highlight');
|
|
|
175
|
+});
|
|
|
176
|
+
|
171
|
// 省市区
|
177
|
// 省市区
|
172
|
$area.on('touchend', function() {
|
178
|
$area.on('touchend', function() {
|
173
|
$footer.hide();
|
179
|
$footer.hide();
|
|
@@ -176,10 +182,9 @@ $area.on('touchend', function() { |
|
@@ -176,10 +182,9 @@ $area.on('touchend', function() { |
176
|
currentPage = 'list';
|
182
|
currentPage = 'list';
|
177
|
});
|
183
|
});
|
178
|
|
184
|
|
|
|
185
|
+// 省市区联动
|
179
|
$addressListPage.on('touchend', '.address', function() {
|
186
|
$addressListPage.on('touchend', '.address', function() {
|
180
|
- var caption = $(this).children('.caption').text();
|
|
|
181
|
-
|
|
|
182
|
- newArea.push(caption);
|
187
|
+ newArea.push($(this).children('.caption').text());
|
183
|
$(this).siblings().hide();
|
188
|
$(this).siblings().hide();
|
184
|
$(this).children('ul').show();
|
189
|
$(this).children('ul').show();
|
185
|
return false;
|
190
|
return false;
|
|
@@ -193,6 +198,7 @@ $addressListPage.on('touchend', '.address', function() { |
|
@@ -193,6 +198,7 @@ $addressListPage.on('touchend', '.address', function() { |
193
|
$editAddressPage.show();
|
198
|
$editAddressPage.show();
|
194
|
currentPage = 'edit';
|
199
|
currentPage = 'edit';
|
195
|
$navTitle.html('修改地址');
|
200
|
$navTitle.html('修改地址');
|
|
|
201
|
+ $footer.show();
|
196
|
|
202
|
|
197
|
// 恢复默认的三级选择
|
203
|
// 恢复默认的三级选择
|
198
|
$addressListPage.hide();
|
204
|
$addressListPage.hide();
|
|
@@ -201,3 +207,17 @@ $addressListPage.on('touchend', '.address', function() { |
|
@@ -201,3 +207,17 @@ $addressListPage.on('touchend', '.address', function() { |
201
|
newArea = [];
|
207
|
newArea = [];
|
202
|
return false;
|
208
|
return false;
|
203
|
});
|
209
|
});
|
|
|
210
|
+
|
|
|
211
|
+$($editAddressPage, $addressListPage).css('min-height', function() {
|
|
|
212
|
+ return $(window).height() - $('#yoho-header').height();
|
|
|
213
|
+});
|
|
|
214
|
+
|
|
|
215
|
+$pageWrap.first().css('min-height', function() {
|
|
|
216
|
+ return $(window).height() - $('#yoho-header').height() - $footer.height();
|
|
|
217
|
+});
|
|
|
218
|
+
|
|
|
219
|
+$('input, textarea').on('focus', function() {
|
|
|
220
|
+ $footer.hide();
|
|
|
221
|
+}).on('blur', function() {
|
|
|
222
|
+ $footer.show();
|
|
|
223
|
+}); |