...
|
...
|
@@ -27,7 +27,7 @@ |
|
|
</ul>
|
|
|
<ul v-if="street.showList" class="address-ul">
|
|
|
<li v-for="pstreet in streets"
|
|
|
@click="switchAddress(pstreet.id, pstreet.caption, true)">{{pstreet.caption}}
|
|
|
@click="switchAddress(pstreet.id, pstreet.caption)">{{pstreet.caption}}
|
|
|
<span v-if="pstreet.id === street.id" class="iconfont icon-v"></span></li>
|
|
|
</ul>
|
|
|
</div>
|
...
|
...
|
@@ -166,11 +166,8 @@ |
|
|
}
|
|
|
</style>
|
|
|
<script>
|
|
|
const $ = require('yoho-jquery');
|
|
|
|
|
|
// const tip = require('../../../js/plugin/tip');
|
|
|
|
|
|
require('home/address/address-index.page.css');
|
|
|
const $ = require('yoho-jquery');
|
|
|
|
|
|
let areaForm = $('.edit-address');
|
|
|
let areaCode = areaForm.find('input[name=area_code]');
|
...
|
...
|
@@ -222,18 +219,17 @@ |
|
|
/* 返回标题处理 */
|
|
|
returnTitle() {
|
|
|
let getTitle = '';
|
|
|
let streetTitle = this.street.allTitle !== '全部' ? this.street.allTitle : '';
|
|
|
let returnTitle = '';
|
|
|
|
|
|
if (this.supportChangeProvince) {
|
|
|
getTitle = this.province.allTitle +
|
|
|
this.city.allTitle +
|
|
|
this.area.allTitle +
|
|
|
streetTitle;
|
|
|
this.street.allTitle;
|
|
|
} else {
|
|
|
getTitle = this.city.allTitle +
|
|
|
this.area.allTitle +
|
|
|
streetTitle;
|
|
|
this.street.allTitle;
|
|
|
}
|
|
|
|
|
|
if (getTitle.length > 11) {
|
...
|
...
|
@@ -277,15 +273,13 @@ |
|
|
this.province.titleActive = this.area.titleActive = this.street.titleActive = false;
|
|
|
break;
|
|
|
case 6:
|
|
|
if (caption !== '全部') {
|
|
|
this.area.id = id;
|
|
|
this.area.allTitle = caption;
|
|
|
this.area.title = this.titleHandle(caption);
|
|
|
this.street.title = '请选择';
|
|
|
this.street.showList = this.area.titleActive = true;
|
|
|
this.province.showList = this.city.showList = this.area.showList = false;
|
|
|
this.province.titleActive = this.city.titleActive = this.street.titleActive = false;
|
|
|
}
|
|
|
this.area.id = id;
|
|
|
this.area.allTitle = caption;
|
|
|
this.area.title = this.titleHandle(caption);
|
|
|
this.street.title = '请选择';
|
|
|
this.street.showList = this.area.titleActive = true;
|
|
|
this.province.showList = this.city.showList = this.area.showList = false;
|
|
|
this.province.titleActive = this.city.titleActive = this.street.titleActive = false;
|
|
|
break;
|
|
|
case 9:
|
|
|
this.street.id = id;
|
...
|
...
|
@@ -305,24 +299,13 @@ |
|
|
},
|
|
|
|
|
|
/* 获取地址数据绑定 */
|
|
|
switchAddress(id, caption, isStreet) {
|
|
|
switchAddress(id, caption) {
|
|
|
if (!id) {
|
|
|
id = 0;
|
|
|
}
|
|
|
|
|
|
this.changeShow(id, caption);
|
|
|
|
|
|
/* 选择全部的控制 */
|
|
|
if (isStreet && (id + '').length === 6) {
|
|
|
this.street.allTitle = this.street.title = '全部';
|
|
|
this.street.id = id;
|
|
|
areaCode.val(id);
|
|
|
let returnTitle = this.returnTitle();
|
|
|
|
|
|
area.val(returnTitle);
|
|
|
this.show = false;
|
|
|
}
|
|
|
|
|
|
$.get('/home/getaddress.json', {
|
|
|
id: id
|
|
|
}, resultData => {
|
...
|
...
|
@@ -345,12 +328,7 @@ |
|
|
this.areas = resultData;
|
|
|
break;
|
|
|
case 6:
|
|
|
this.streets = [];
|
|
|
this.streets.push({
|
|
|
caption: '全部',
|
|
|
id: this.area.id
|
|
|
});
|
|
|
$.merge(this.streets, resultData);
|
|
|
this.streets = resultData;
|
|
|
break;
|
|
|
default:
|
|
|
this.provinces = resultData;
|
...
|
...
|
@@ -376,7 +354,6 @@ |
|
|
switch (type) {
|
|
|
case 'province':
|
|
|
if (!this.supportChangeProvince) {
|
|
|
// tip.show('不允许修改省地址!');
|
|
|
return false;
|
|
|
}
|
|
|
if (this.provinces.length < 1) {
|
...
|
...
|
|