Authored by 郭成尧

del-all-handle

... ... @@ -11,9 +11,8 @@ const isProduction = process.env.NODE_ENV === 'production';
const isTest = process.env.NODE_ENV === 'test';
const domains = {
api: 'http://api.yoho.cn/',
service: 'http://service.yoho.cn/',
singleApi: 'http://api-test3.yohops.com:9999/',
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
global: 'http://global-test-soa.yohops.com:9999',
liveApi: 'http://testapi.live.yohops.com:9999/',
imSocket: 'ws://socket.yohobuy.com:10240',
... ...
... ... @@ -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) {
... ...