Authored by hongweigao

去掉货到付款提示,过滤电话为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' : ''// 默认地址
});
}
... ... @@ -57,7 +59,6 @@
}, {
isSelect: true,
labelText: '省份:',
tips: '注:标"*"的为支持货到付款的地区',
tipsUrl: '/help/?category_id=48',
selects: [{
key: 'province'
... ... @@ -122,6 +123,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;
}
... ...
... ... @@ -63,6 +63,7 @@
<label for="{{key}}">{{labelText}}</label>
<input type="text" name='{{key}}' id="{{key}}" class="input-1 width-150" value="{{value}}">
{{/if}}
{{#if tips}}
<span class="form-prompt form-info" id="{{key}}-tip">
{{tips}}
{{#isSelect}}
... ... @@ -71,6 +72,7 @@
<!--</a>-->
{{/isSelect}}
</span>
{{/if}}
</div>
{{/each}}
</div>
... ...
... ... @@ -43,8 +43,7 @@ var address = {
loadAreaData: function(pCode, toDomId, defaultValue, allCode) {
var the = this,
$toDom = $('#' + toDomId),
i = 0,
point = '';
i = 0;
var active,
val,
... ... @@ -76,12 +75,11 @@ var address = {
$toDom.append('<option value="0">' + defaultValue + '</option>');
if (toDomId === the.streetsDomId) {
allCode === pCode ? selectAll = 'selected' : selectAll = '';
$toDom.append('<option value="' + pCode + '" ' + selectAll + '>*全部</option>');
$toDom.append('<option value="' + pCode + '" ' + selectAll + '>全部</option>');
}
for (i in jsonData.options) {
if (jsonData.options[i]) {
val = jsonData.options[i];
point = (toDomId === the.streetsDomId && val.is_support === 'Y') ? '*' : '';
nId = val.value;
selecter = '';
... ... @@ -89,7 +87,7 @@ var address = {
nId === allCode.substr(0, nId.length)) {
selecter = 'selected';
}
$toDom.append('<option value="' + nId + '" ' + selecter + '>' + point + val.text + '</option>');
$toDom.append('<option value="' + nId + '" ' + selecter + '>' + val.text + '</option>');
}
}
}
... ...