...
|
...
|
@@ -414,9 +414,8 @@ function getAddress(d, callback) { |
|
|
data: {
|
|
|
id: d.id * 1
|
|
|
}
|
|
|
}).then(function(d) {
|
|
|
|
|
|
structureOption($obj, d.data, selectId);
|
|
|
}).then(function(resData) {
|
|
|
structureOption($obj, resData.data, selectId, d.id);
|
|
|
|
|
|
if (typeof callback === 'function') {
|
|
|
callback();
|
...
|
...
|
@@ -426,18 +425,13 @@ function getAddress(d, callback) { |
|
|
}
|
|
|
|
|
|
// 构建select下拉选项
|
|
|
function structureOption($obj, data, selectId) {
|
|
|
function structureOption($obj, data, selectId, countryId) {
|
|
|
var i,
|
|
|
optionHtml = '',
|
|
|
defaultOption,
|
|
|
isStar = '';
|
|
|
var countyId;
|
|
|
|
|
|
for (i = 0; i < data.length; i++) {
|
|
|
if (!countyId) {
|
|
|
countyId = data[i].id;
|
|
|
}
|
|
|
|
|
|
if (data[i].is_support_express === 'Y') {
|
|
|
isStar = '*';
|
|
|
} else {
|
...
|
...
|
@@ -462,10 +456,8 @@ function structureOption($obj, data, selectId) { |
|
|
} else if ($obj.attr('name') === 'street') {
|
|
|
defaultOption = '<option value="0">请选择乡镇/街道</option>';
|
|
|
|
|
|
if (countyId) {
|
|
|
countyId += '';
|
|
|
countyId = countyId.substr(0, 6);
|
|
|
defaultOption += '<option value="' + countyId + '">全部</option>';
|
|
|
if (countryId) {
|
|
|
defaultOption += '<option value="' + countryId + '">全部</option>';
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|