...
|
...
|
@@ -67,21 +67,16 @@ function getValidateKey(id) { |
|
|
function validateData() {
|
|
|
var $inputs = $('.edit-dialog .input-row.necessary .validate');
|
|
|
var $phone = $('#user-phone');
|
|
|
|
|
|
var pass = true;
|
|
|
if (updateAddressMobile && updateAddressMobile !== '') {
|
|
|
validateMap.mobile.v = {
|
|
|
equal: updateAddressMobile,
|
|
|
errMsg: '您输入的联系电话格式不正确'
|
|
|
};
|
|
|
}
|
|
|
|
|
|
// 检查必填项
|
|
|
$inputs.each(function(idx, input) {
|
|
|
var k = getValidateKey(input.id);
|
|
|
|
|
|
if (k && validateMap[k]) {
|
|
|
if (!validate.start(validateMap[k].sl, validateMap[k].v)) {
|
|
|
if (k === 'mobile' && updateAddressMobile !== '' && updateAddressMobile === $(this).val()) {
|
|
|
return true;
|
|
|
} else if (!validate.start(validateMap[k].sl, validateMap[k].v)) {
|
|
|
pass = false;
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -158,7 +153,6 @@ function editOrder(onEdit) { |
|
|
phone: phone
|
|
|
};
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
url: '/me/editOrder',
|
|
|
type: 'post',
|
...
|
...
|
@@ -194,6 +188,7 @@ function showDiaglog(tpl, onEdit) { |
|
|
btnClass: ['cancel-btn'],
|
|
|
name: '取消',
|
|
|
cb: function() {
|
|
|
updateAddressMobile = '';
|
|
|
tip.close();
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -214,6 +209,8 @@ function showDiaglog(tpl, onEdit) { |
|
|
validate.start(v.sl, v.v);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
updateAddressMobile = $('#user-mobile').val();
|
|
|
}
|
|
|
|
|
|
function start(tplData, onEdit) {
|
...
|
...
|
|