...
|
...
|
@@ -20,6 +20,7 @@ var detailErr = '2-100字符。1个中文为2个字符'; |
|
|
|
|
|
var addressDialogTpl;
|
|
|
var addressTpl;
|
|
|
var updateAddressMobile = '';
|
|
|
|
|
|
require('yoho-jquery-placeholder');
|
|
|
require('yoho-jquery-dotdotdot');
|
...
|
...
|
@@ -97,7 +98,11 @@ function validateAddress($el, isUpdate) { |
|
|
field.mobile.push({
|
|
|
regx: /^\d{3}(\d|\*){4}\d{4}$/, // 验证正常数字或者****
|
|
|
err: '手机号码格式不正确'
|
|
|
});
|
|
|
},
|
|
|
{
|
|
|
equal: true,
|
|
|
err: '手机号码格式不正确'
|
|
|
});
|
|
|
} else {
|
|
|
field.mobile.push({
|
|
|
regx: /^\d{11}$/,
|
...
|
...
|
@@ -115,7 +120,7 @@ function validateAddress($el, isUpdate) { |
|
|
vaRegx = field[key][vaKey];
|
|
|
|
|
|
// 非空验证、非空下正则验证、其他正则验证
|
|
|
if ((vaRegx.noEmpty && cur === '') || (vaRegx.regx &&
|
|
|
if ((vaRegx.equal && updateAddressMobile !== cur) || (vaRegx.noEmpty && cur === '') || (vaRegx.regx &&
|
|
|
(vaRegx.skipWhenEmpty ? !(cur === '' || vaRegx.regx.test(cur)) : !vaRegx.regx.test(cur))
|
|
|
)) {
|
|
|
pass = false;
|
...
|
...
|
@@ -193,7 +198,7 @@ function addressDialogFactory(opt, $the) { |
|
|
address: detail,
|
|
|
mobile: mobile,
|
|
|
phone: phone,
|
|
|
'area_code': areaCode // eslint-disable-line
|
|
|
'area_code': areaCode // eslint-disable-line
|
|
|
}
|
|
|
}).then(function(data) {
|
|
|
var updated;
|
...
|
...
|
@@ -204,7 +209,7 @@ function addressDialogFactory(opt, $the) { |
|
|
address: detail,
|
|
|
mobile: mobile.replace(/^(\d{3}).*(\d{4})$/, '$1****$2'),
|
|
|
phone: phone,
|
|
|
area_code: data.data.area_code, // eslint-disable-line
|
|
|
area_code: data.data.area_code, // eslint-disable-line
|
|
|
address_id: opt.id,
|
|
|
focus: $the.hasClass('focus'),
|
|
|
area: $el.address.getAreaLabels().replace(/,/g, ' '),
|
...
|
...
|
@@ -237,7 +242,7 @@ function addressDialogFactory(opt, $the) { |
|
|
address: detail,
|
|
|
mobile: mobile,
|
|
|
phone: phone,
|
|
|
'area_code': areaCode, // eslint-disable-line
|
|
|
'area_code': areaCode, // eslint-disable-line
|
|
|
init: opt.init
|
|
|
}
|
|
|
}).then(function(data) {
|
...
|
...
|
@@ -280,6 +285,7 @@ function addressDialogFactory(opt, $the) { |
|
|
]
|
|
|
});
|
|
|
|
|
|
updateAddressMobile = opt.mobile || '';
|
|
|
return address;
|
|
|
}
|
|
|
|
...
|
...
|
|