Authored by hongweigao

处理phone为null的情况

... ... @@ -25,11 +25,13 @@
let addressList = addressData.data;
for (let i = 0; i < addressList.length; i++) {
let phone = _.get(addressList[i], 'phone') === 'null' ? '' : addressList[i].phone;
result.push({
id: addressList[i].address_id || '',
addressee: addressList[i].consignee || '',
address: addressList[i].area + addressList[i].address + (addressList[i].zip_code || ''),
phone: (addressList[i].mobile || '') + (addressList[i].phone || ''),
address: addressList[i].area + addressList[i].address + ' ' + (addressList[i].zip_code || ''),
phone: (addressList[i].mobile || '') + ' ' + phone,
isPreferred: addressList[i].is_default === 'Y' ? 'true' : ''// 默认地址
});
}
... ... @@ -122,6 +124,7 @@
for (let i = 0; i < addressList.length; i++) {
if (addressList[i].address_id === id) {
addressList[i].phone = _.get(addressList[i], 'phone') === 'null' ? '' : addressList[i].phone;
respData.data = addressList[i];
break;
}
... ...