资质认证--更新

master
chenxiaojun 5 years ago
parent 0ff9f77181
commit 1594500eca

@ -1145,21 +1145,35 @@ class PromoteController extends ThinkController
if (empty($promoteId)) {
$this->error('参数异常');
}
if (empty($_POST['real_name'])) {
$this->error('真实姓名不能为空');
}
if (empty($_POST['idcard'])) {
$this->error('身份证号码不能为空');
$promote = D('promote')->field('real_name, idcard, mobile_phone')->where(array('id' => $promoteId))->find();
if (empty($promote)) {
$this->error('参数异常');
}
if(!is_idcard($_POST['idcard'])) {
$this->error('证件号码错误');
if (empty($promote['real_name']) || $promote['real_name'] != I('post.real_name', '')) {
if (empty($_POST['real_name'])) {
$this->error('真实姓名不能为空');
}
$save['real_name'] = I('post.real_name', '');
}
if (empty($_POST['mobile_phone'])) {
$this->error('手机号码不能为空');
if (empty($promote['idcard']) || $promote['idcard'] != I('post.idcard', '')) {
if (empty($_POST['idcard'])) {
$this->error('身份证号码不能为空');
}
if(!is_idcard($_POST['idcard'])) {
$this->error('证件号码错误');
}
$save['idcard'] = I('post.idcard', '');
}
$patternPhone = "/^1[3|5|7|8]\\d{9}$/i";
if(!preg_match($patternPhone, $_POST['mobile_phone'])) {
$this->error("手机号码格式不合法");
if (empty($promote['mobile_phone']) || $promote['mobile_phone'] != I('post.mobile_phone', '')) {
if (empty($_POST['mobile_phone'])) {
$this->error('手机号码不能为空');
}
$patternPhone = "/^1[3|5|7|8]\\d{9}$/i";
if(!preg_match($patternPhone, $_POST['mobile_phone'])) {
$this->error("手机号码格式不合法");
}
$save['mobile_phone'] = I('post.mobile_phone', '');
}
if (empty($_POST['idcarpic'])) {
$this->error('身份证证件照不能为空');
@ -1206,10 +1220,7 @@ class PromoteController extends ThinkController
$save['id'] = $promoteId;
$save['ver_status'] = 1;
$save['real_name'] = I('post.real_name', '');
$save['idcard'] = I('post.idcard', '');
$save['idcarpic'] = I('post.idcarpic', '');
$save['mobile_phone'] = I('post.mobile_phone', '');
$save['address'][] = I('post.s_province', '') . ',' . I('post.s_city', '') . ',' . I('post.s_county', '');
$save['address'][] = I('post.s_address', '');
$save['address'] = json_encode($save['address']);

@ -35,6 +35,36 @@
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 30px;
}
.tabcon1711 input[type=text]:read-only {
background: #CCCCCC;
}
.tabcon1711 .span-btn {
float: left;
margin-left: 30px;
height: 30px;
line-height: 30px;
color: #fff;
background-color: #3d96c8;
border: 0;
border-radius: 3px;
cursor: pointer;
align-content: center;
padding-left: 10px;
padding-right: 10px;
}
.tabcon1711 .edit-btn {
background-color: #3d96c8;
}
.tabcon1711 .cancel-btn {
background-color: #999;
display: none;
}
.tabcon1711 .edit-btn:hover {
background-color: #589dc8;
}
.tabcon1711 .cancel-btn {
background-color: #ababab;
}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$meta_title}</h3>
@ -60,14 +90,26 @@
<tr>
<td class="l"><i class="mustmark">*</i>真实姓名:</td>
<td class="r">
<input type="text" class="txt" name="real_name" value="{$records['real_name']|default=''}">
<empty name="records['real_name']">
<input type="text" class="txt" name="real_name" value="{$records['real_name']|default=''}">
<else/>
<input type="text" class="txt" name="real_name" value="{$records['real_name']|default=''}" readonly="readonly">
<span class="span-btn edit-btn">修改</span>
<span class="span-btn cancel-btn">取消</span>
</empty>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>身份证号码:</td>
<td class="r">
<input type="text" class="txt" name="idcard" value="{$records['idcard']|default=''}">
<empty name="records['real_name']">
<input type="text" class="txt" name="idcard" value="{$records['idcard']|default=''}">
<else/>
<input type="text" class="txt" name="idcard" value="{$records['idcard']|default=''}" readonly="readonly">
<span class="span-btn edit-btn">修改</span>
<span class="span-btn cancel-btn">取消</span>
</empty>
<span class="notice-text"></span>
</td>
</tr>
@ -146,7 +188,13 @@
<tr>
<td class="l"><i class="mustmark">*</i>电话:</td>
<td class="r">
<input type="text" class="txt" name="mobile_phone" value="{$records['mobile_phone']|default=''}">
<empty name="records['real_name']">
<input type="text" class="txt" name="mobile_phone" value="{$records['mobile_phone']|default=''}">
<else/>
<input type="text" class="txt" name="mobile_phone" value="{$records['mobile_phone']|default=''}" readonly="readonly">
<span class="span-btn edit-btn">修改</span>
<span class="span-btn cancel-btn">取消</span>
</empty>
<span class="notice-text"></span>
</td>
</tr>
@ -262,6 +310,34 @@
$(function() {
showTab();
$('.edit-btn').click(function () {
var thisInput = $(this).prev();
thisInput.val('');
thisInput.removeAttr('readonly');
thisInput.focus();
$(this).hide();
$(this).next().show();
});
$('.cancel-btn').click(function () {
var thisInput = $(this).parent().children('input');
switch (thisInput.attr('name')) {
case 'real_name':
thisInput.val("{$records['real_name']}");
break;
case 'idcard':
thisInput.val("{$records['idcard']}");
break;
case 'mobile_phone':
thisInput.val("{$records['mobile_phone']}");
break;
}
thisInput.attr('readonly', 'readonly');
$(this).hide();
$(this).prev().show();
});
});
var userInfo = {userId:"kazaff", md5:"",icon:1}; //用户会话信息

Loading…
Cancel
Save