|
@@ -22,6 +22,16 @@ var $addressForm = $('.edit-address'), |
|
@@ -22,6 +22,16 @@ var $addressForm = $('.edit-address'), |
22
|
currentPage = 'edit',
|
22
|
currentPage = 'edit',
|
23
|
newArea = [];
|
23
|
newArea = [];
|
24
|
|
24
|
|
|
|
25
|
+var Vue = require('vue');
|
|
|
26
|
+var vueAddressAct = require('home/address/address-act.vue');
|
|
|
27
|
+
|
|
|
28
|
+var addressVact = new Vue({
|
|
|
29
|
+ el: '#vAddressAct',
|
|
|
30
|
+ components: {
|
|
|
31
|
+ vueAddressAct: vueAddressAct
|
|
|
32
|
+ }
|
|
|
33
|
+});
|
|
|
34
|
+
|
25
|
require('../common.js');
|
35
|
require('../common.js');
|
26
|
|
36
|
|
27
|
$($editAddressPage, $addressListPage).css('min-height', function() {
|
37
|
$($editAddressPage, $addressListPage).css('min-height', function() {
|
|
@@ -81,7 +91,7 @@ $addressForm.on('submit', function() { |
|
@@ -81,7 +91,7 @@ $addressForm.on('submit', function() { |
81
|
isSubmiting = true;
|
91
|
isSubmiting = true;
|
82
|
loading.showLoadingMask();
|
92
|
loading.showLoadingMask();
|
83
|
$submit.css('background', '#777');
|
93
|
$submit.css('background', '#777');
|
84
|
- console.log(window.queryString.refer);
|
94
|
+
|
85
|
$.ajax({
|
95
|
$.ajax({
|
86
|
method: 'POST',
|
96
|
method: 'POST',
|
87
|
url: '/home/saveAddress',
|
97
|
url: '/home/saveAddress',
|
|
@@ -132,10 +142,7 @@ function bindAddressListEvent(html) { |
|
@@ -132,10 +142,7 @@ function bindAddressListEvent(html) { |
132
|
|
142
|
|
133
|
// 省市区
|
143
|
// 省市区
|
134
|
$area.on('touchend', function() {
|
144
|
$area.on('touchend', function() {
|
135
|
- $editAddressPage.hide();
|
|
|
136
|
- $addressListPage.show();
|
|
|
137
|
- currentPage = 'list';
|
|
|
138
|
- $navTitle.html('地区选择');
|
145
|
+ addressVact.$children[0].show = true;
|
139
|
});
|
146
|
});
|
140
|
|
147
|
|
141
|
// touchend 在下滑的时候会触发
|
148
|
// touchend 在下滑的时候会触发
|
|
@@ -191,16 +198,7 @@ function bindAddressListEvent(html) { |
|
@@ -191,16 +198,7 @@ function bindAddressListEvent(html) { |
191
|
});
|
198
|
});
|
192
|
}
|
199
|
}
|
193
|
|
200
|
|
194
|
-// 读取省市区列表缓存
|
|
|
195
|
-// if (window.localStorage && window.localStorage.getItem) {
|
|
|
196
|
-// chinaAddressList = window.localStorage.getItem('chinaAddressList');
|
|
|
197
|
-// }
|
|
|
198
|
-
|
|
|
199
|
-// if (chinaAddressList) {
|
|
|
200
|
-// bindAddressListEvent(chinaAddressList);
|
|
|
201
|
-// } else {
|
|
|
202
|
-
|
|
|
203
|
- // 省市区列表异步加载
|
201
|
+// 省市区列表异步加载
|
204
|
$.ajax({
|
202
|
$.ajax({
|
205
|
method: 'GET',
|
203
|
method: 'GET',
|
206
|
url: '/home/locationList',
|
204
|
url: '/home/locationList',
|
|
@@ -208,22 +206,6 @@ $.ajax({ |
|
@@ -208,22 +206,6 @@ $.ajax({ |
208
|
cache: true
|
206
|
cache: true
|
209
|
}).then(function(html) {
|
207
|
}).then(function(html) {
|
210
|
bindAddressListEvent(html);
|
208
|
bindAddressListEvent(html);
|
211
|
-
|
|
|
212
|
- // if (window.localStorage && window.localStorage.setItem) {
|
|
|
213
|
- // window.localStorage.setItem('chinaAddressList', html);
|
|
|
214
|
- // }
|
|
|
215
|
}).fail(function() {
|
209
|
}).fail(function() {
|
216
|
tip.show('获取省市区列表失败');
|
210
|
tip.show('获取省市区列表失败');
|
217
|
}); |
211
|
}); |
218
|
-
|
|
|
219
|
-// }
|
|
|
220
|
-var Vue = require('vue');
|
|
|
221
|
-
|
|
|
222
|
-var app = require('home/address/address-act.vue');
|
|
|
223
|
-
|
|
|
224
|
-new Vue({
|
|
|
225
|
- el: '#app',
|
|
|
226
|
- components: {
|
|
|
227
|
- app: app
|
|
|
228
|
- }
|
|
|
229
|
-}); |
|
|