|
@@ -27,7 +27,7 @@ |
|
@@ -27,7 +27,7 @@ |
27
|
</ul>
|
27
|
</ul>
|
28
|
<ul v-if="street.showList" class="address-ul">
|
28
|
<ul v-if="street.showList" class="address-ul">
|
29
|
<li v-for="pstreet in streets"
|
29
|
<li v-for="pstreet in streets"
|
30
|
- @click="switchAddress(pstreet.id, pstreet.caption, true)">{{pstreet.caption}}
|
30
|
+ @click="switchAddress(pstreet.id, pstreet.caption)">{{pstreet.caption}}
|
31
|
<span v-if="pstreet.id === street.id" class="iconfont icon-v"></span></li>
|
31
|
<span v-if="pstreet.id === street.id" class="iconfont icon-v"></span></li>
|
32
|
</ul>
|
32
|
</ul>
|
33
|
</div>
|
33
|
</div>
|
|
@@ -166,11 +166,8 @@ |
|
@@ -166,11 +166,8 @@ |
166
|
}
|
166
|
}
|
167
|
</style>
|
167
|
</style>
|
168
|
<script>
|
168
|
<script>
|
169
|
- const $ = require('yoho-jquery');
|
|
|
170
|
-
|
|
|
171
|
- // const tip = require('../../../js/plugin/tip');
|
|
|
172
|
-
|
|
|
173
|
require('home/address/address-index.page.css');
|
169
|
require('home/address/address-index.page.css');
|
|
|
170
|
+ const $ = require('yoho-jquery');
|
174
|
|
171
|
|
175
|
let areaForm = $('.edit-address');
|
172
|
let areaForm = $('.edit-address');
|
176
|
let areaCode = areaForm.find('input[name=area_code]');
|
173
|
let areaCode = areaForm.find('input[name=area_code]');
|
|
@@ -222,18 +219,17 @@ |
|
@@ -222,18 +219,17 @@ |
222
|
/* 返回标题处理 */
|
219
|
/* 返回标题处理 */
|
223
|
returnTitle() {
|
220
|
returnTitle() {
|
224
|
let getTitle = '';
|
221
|
let getTitle = '';
|
225
|
- let streetTitle = this.street.allTitle !== '全部' ? this.street.allTitle : '';
|
|
|
226
|
let returnTitle = '';
|
222
|
let returnTitle = '';
|
227
|
|
223
|
|
228
|
if (this.supportChangeProvince) {
|
224
|
if (this.supportChangeProvince) {
|
229
|
getTitle = this.province.allTitle +
|
225
|
getTitle = this.province.allTitle +
|
230
|
this.city.allTitle +
|
226
|
this.city.allTitle +
|
231
|
this.area.allTitle +
|
227
|
this.area.allTitle +
|
232
|
- streetTitle;
|
228
|
+ this.street.allTitle;
|
233
|
} else {
|
229
|
} else {
|
234
|
getTitle = this.city.allTitle +
|
230
|
getTitle = this.city.allTitle +
|
235
|
this.area.allTitle +
|
231
|
this.area.allTitle +
|
236
|
- streetTitle;
|
232
|
+ this.street.allTitle;
|
237
|
}
|
233
|
}
|
238
|
|
234
|
|
239
|
if (getTitle.length > 11) {
|
235
|
if (getTitle.length > 11) {
|
|
@@ -277,15 +273,13 @@ |
|
@@ -277,15 +273,13 @@ |
277
|
this.province.titleActive = this.area.titleActive = this.street.titleActive = false;
|
273
|
this.province.titleActive = this.area.titleActive = this.street.titleActive = false;
|
278
|
break;
|
274
|
break;
|
279
|
case 6:
|
275
|
case 6:
|
280
|
- if (caption !== '全部') {
|
|
|
281
|
- this.area.id = id;
|
|
|
282
|
- this.area.allTitle = caption;
|
|
|
283
|
- this.area.title = this.titleHandle(caption);
|
|
|
284
|
- this.street.title = '请选择';
|
|
|
285
|
- this.street.showList = this.area.titleActive = true;
|
|
|
286
|
- this.province.showList = this.city.showList = this.area.showList = false;
|
|
|
287
|
- this.province.titleActive = this.city.titleActive = this.street.titleActive = false;
|
|
|
288
|
- }
|
276
|
+ this.area.id = id;
|
|
|
277
|
+ this.area.allTitle = caption;
|
|
|
278
|
+ this.area.title = this.titleHandle(caption);
|
|
|
279
|
+ this.street.title = '请选择';
|
|
|
280
|
+ this.street.showList = this.area.titleActive = true;
|
|
|
281
|
+ this.province.showList = this.city.showList = this.area.showList = false;
|
|
|
282
|
+ this.province.titleActive = this.city.titleActive = this.street.titleActive = false;
|
289
|
break;
|
283
|
break;
|
290
|
case 9:
|
284
|
case 9:
|
291
|
this.street.id = id;
|
285
|
this.street.id = id;
|
|
@@ -305,24 +299,13 @@ |
|
@@ -305,24 +299,13 @@ |
305
|
},
|
299
|
},
|
306
|
|
300
|
|
307
|
/* 获取地址数据绑定 */
|
301
|
/* 获取地址数据绑定 */
|
308
|
- switchAddress(id, caption, isStreet) {
|
302
|
+ switchAddress(id, caption) {
|
309
|
if (!id) {
|
303
|
if (!id) {
|
310
|
id = 0;
|
304
|
id = 0;
|
311
|
}
|
305
|
}
|
312
|
|
306
|
|
313
|
this.changeShow(id, caption);
|
307
|
this.changeShow(id, caption);
|
314
|
|
308
|
|
315
|
- /* 选择全部的控制 */
|
|
|
316
|
- if (isStreet && (id + '').length === 6) {
|
|
|
317
|
- this.street.allTitle = this.street.title = '全部';
|
|
|
318
|
- this.street.id = id;
|
|
|
319
|
- areaCode.val(id);
|
|
|
320
|
- let returnTitle = this.returnTitle();
|
|
|
321
|
-
|
|
|
322
|
- area.val(returnTitle);
|
|
|
323
|
- this.show = false;
|
|
|
324
|
- }
|
|
|
325
|
-
|
|
|
326
|
$.get('/home/getaddress.json', {
|
309
|
$.get('/home/getaddress.json', {
|
327
|
id: id
|
310
|
id: id
|
328
|
}, resultData => {
|
311
|
}, resultData => {
|
|
@@ -345,12 +328,7 @@ |
|
@@ -345,12 +328,7 @@ |
345
|
this.areas = resultData;
|
328
|
this.areas = resultData;
|
346
|
break;
|
329
|
break;
|
347
|
case 6:
|
330
|
case 6:
|
348
|
- this.streets = [];
|
|
|
349
|
- this.streets.push({
|
|
|
350
|
- caption: '全部',
|
|
|
351
|
- id: this.area.id
|
|
|
352
|
- });
|
|
|
353
|
- $.merge(this.streets, resultData);
|
331
|
+ this.streets = resultData;
|
354
|
break;
|
332
|
break;
|
355
|
default:
|
333
|
default:
|
356
|
this.provinces = resultData;
|
334
|
this.provinces = resultData;
|
|
@@ -376,7 +354,6 @@ |
|
@@ -376,7 +354,6 @@ |
376
|
switch (type) {
|
354
|
switch (type) {
|
377
|
case 'province':
|
355
|
case 'province':
|
378
|
if (!this.supportChangeProvince) {
|
356
|
if (!this.supportChangeProvince) {
|
379
|
- // tip.show('不允许修改省地址!');
|
|
|
380
|
return false;
|
357
|
return false;
|
381
|
}
|
358
|
}
|
382
|
if (this.provinces.length < 1) {
|
359
|
if (this.provinces.length < 1) {
|