...
|
...
|
@@ -9,7 +9,7 @@ var $ = require('yoho-jquery'), |
|
|
area = require('./areaSelect'),
|
|
|
dialog = require('../../common/dialog');
|
|
|
|
|
|
var stringHandle = require('../../common/helpers/stringHandle');
|
|
|
var stringHandle = require('../../common/stringHandle');
|
|
|
|
|
|
var Dialog = dialog.Dialog,
|
|
|
Confirm = dialog.Confirm,
|
...
|
...
|
@@ -105,7 +105,7 @@ function syncShowMoreBtn() { |
|
|
// 地址校验,支持单个字段与多字段
|
|
|
function validateAddress(data) {
|
|
|
var regx = {
|
|
|
consignee: /^([\u4e00-\u9fa5\w]{1,20})$/,
|
|
|
consignee: /^([\u4e00-\u9fa5\w*]{1,20})$/,
|
|
|
areaCode: /^[0-9]{6,9}$/,
|
|
|
mobile: /^\d{3}(\d{4}|\*{4})\d{1,8}$/,
|
|
|
phone: /^(\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}$/
|
...
|
...
|
@@ -120,6 +120,9 @@ function validateAddress(data) { |
|
|
!regx[i].test(data[i])) {
|
|
|
pass = false;
|
|
|
}
|
|
|
if (i === 'consignee' && stringHandle.chinese2(data[i]) > 20) {
|
|
|
pass = false;
|
|
|
}
|
|
|
}
|
|
|
return pass;
|
|
|
}
|
...
|
...
|
@@ -136,7 +139,7 @@ function bindOperateEvent($el) { |
|
|
if (!val) {
|
|
|
tip = '收货人不能为空';
|
|
|
} else if (stringHandle.chinese2(val) > 20) {
|
|
|
tip = '收货人姓名最多支持20个字';
|
|
|
tip = '收货人姓名最多支持20个字符';
|
|
|
} else if (!validateAddress({consignee: val})) {
|
|
|
tip = '收货人姓名不支持特殊符号';
|
|
|
}
|
...
|
...
|
|