...
|
...
|
@@ -27,6 +27,23 @@ var addrList = {}, |
|
|
|
|
|
var addrSelect;
|
|
|
|
|
|
function handleAreaText(areaInfo) {
|
|
|
var maxLength = 30;
|
|
|
var aList, tlen = 0;
|
|
|
|
|
|
if (areaInfo.length > maxLength) {
|
|
|
aList = areaInfo.split(' ');
|
|
|
|
|
|
if (aList[3] && aList[3].length) {
|
|
|
tlen = aList[3].length;
|
|
|
}
|
|
|
|
|
|
return areaInfo.substr(0, maxLength - tlen - 2) + '...' + (aList[3] || '');
|
|
|
}
|
|
|
|
|
|
return areaInfo;
|
|
|
}
|
|
|
|
|
|
// 获取地址数据
|
|
|
$('.addr-item').each(function() {
|
|
|
var data = $(this).data();
|
...
|
...
|
@@ -34,6 +51,11 @@ $('.addr-item').each(function() { |
|
|
if (data.id) {
|
|
|
if (data.area) {
|
|
|
data.areaText = data.area.split(' ').join('/');
|
|
|
data.areaShow = handleAreaText(data.area);
|
|
|
|
|
|
if (data.area !== data.areaShow) {
|
|
|
$(this).find('.area').text(data.areaShow);
|
|
|
}
|
|
|
}
|
|
|
addrList[data.id] = data;
|
|
|
|
...
|
...
|
@@ -209,6 +231,7 @@ function handelAddrInfo(data, reqData, $el) { |
|
|
$.extend(addrList[reqData.id], {
|
|
|
consignee: reqData.consignee,
|
|
|
area: reqData.area,
|
|
|
areaShow: handleAreaText(reqData.area),
|
|
|
areaText: reqData.areaText,
|
|
|
address: reqData.address,
|
|
|
mobile: reqData.mobile,
|
...
|
...
|
@@ -233,6 +256,7 @@ function handelAddrInfo(data, reqData, $el) { |
|
|
id: data.id,
|
|
|
consignee: data.consignee,
|
|
|
area: data.area,
|
|
|
areaShow: handleAreaText(reqData.area),
|
|
|
areaText: data.area.split(' ').join('/'),
|
|
|
address: data.address,
|
|
|
mobile: data.mobile,
|
...
|
...
|
|