Authored by hongweigao

修改address

... ... @@ -155,9 +155,6 @@
zip_code: _.trim(params.zipCode || '')
};
let streets = _.trim(params.streets || '');
query.area_code = streets === 'all' ? _.trim(params.areaCode || '') : streets;
if (query.uid === '' || query.address === '' ||
query.area_code.length < 6 || query.consignee === '' ||
query.email === '' || query.zip_code === '') {
... ...
... ... @@ -40,7 +40,7 @@ var address = {
},
// 初始化地址数据
loadAreaData: function(pCode, toDomId, defaultValue, allCode, isAll) {
loadAreaData: function(pCode, toDomId, defaultValue, allCode) {
var the = this,
$toDom = $('#' + toDomId),
i = 0,
... ... @@ -74,10 +74,9 @@ var address = {
}
$toDom.append('<option value="0">' + defaultValue + '</option>');
if (toDomId === the.streetsDomId) {
allCode.length === 6 && isAll ? selectAll = 'selected' : selectAll = '';
$toDom.append('<option value="all"' + selectAll +'>*全部</option>');
allCode === pCode ? selectAll = 'selected' : selectAll = '';
$toDom.append('<option value="' + pCode + '" ' + selectAll +'>*全部</option>');
}
for (i in jsonData.options) {
if (jsonData.options[i]) {
... ... @@ -111,7 +110,7 @@ var address = {
return;
}
the.loadAreaData(pCode, the.cityDomId, '请选择城市', pCode);
the.loadAreaData(pCode, the.cityDomId, '请选择城市');
$('#' + the.areaDomId).hide();
$('#' + the.streetsDomId).hide().empty();
the.showAreaSel(domOptions.dispDomId);
... ... @@ -124,7 +123,7 @@ var address = {
return;
}
the.loadAreaData(pCode, the.areaDomId, '请选择区县', pCode);
the.loadAreaData(pCode, the.areaDomId, '请选择区县');
$('#' + the.areaDomId).show();
$('#' + the.streetsDomId).hide().empty();
the.showAreaSel(domOptions.dispDomId);
... ... @@ -137,7 +136,7 @@ var address = {
return;
}
the.loadAreaData(pCode, the.streetsDomId, '请选择乡镇/街道', pCode);
the.loadAreaData(pCode, the.streetsDomId, '请选择乡镇/街道');
$('#' + the.streetsDomId).show();
the.showAreaSel(domOptions.dispDomId);
});
... ... @@ -172,8 +171,7 @@ var address = {
},
loadAllData: function(areaCode, domOptions, isInit) {
var the = this,
isAll = isInit ? false : true;
var the = this;
the.initDomIds(domOptions);
areaCode += '';
... ... @@ -190,7 +188,7 @@ var address = {
the.loadAreaData(0, the.provinceDomId, '请选择省份', areaCode);
the.loadAreaData(areaCode.substr(0, 2), the.cityDomId, '请选择城市', areaCode);
the.loadAreaData(areaCode.substr(0, 4), the.areaDomId, '请选择区县', areaCode);
the.loadAreaData(areaCode.substr(0, 6), the.streetsDomId, '请选择乡镇/街道', areaCode, isAll);
the.loadAreaData(areaCode.substr(0, 6), the.streetsDomId, '请选择乡镇/街道', areaCode);
$('#' + this.areaDomId).show();
$('#' + this.streetsDomId).show();
} else if (areaCode.length === 9) {
... ...