实名认证 手机端

This commit is contained in:
“wanyongkang”
2020-12-27 16:39:32 +08:00
parent 124d0e56be
commit 1b57b64a65
2 changed files with 40 additions and 9 deletions

View File

@@ -71,7 +71,7 @@
<!-- 账户信息 -->
<div class="accout_tit"><span class="lineBar"></span>账户信息 <button class="btnXq" onclick="$('#infoBox').show()">完善信息</button>
<button class="btnXq" onclick="$('#pwdBox').show()">修改密码</button>
<!-- <button class="btnXq" id="real-name-confirm" onclick="$('#real-name').show()">实名认证</button> -->
<button class="btnXq" id="real-name-confirm" onclick="$('#real-name').show()">实名认证</button>
</div>
<div class="model">
<div class="item">
@@ -301,7 +301,7 @@
</div>
<div class="layerTable" id="real-name" style="margin-right:10em;">
<form id="nameForm">
<form id="id-cert">
<table border="0" cellspacing="0" cellpadding="0">
<p>接主管部门要求,会员账号需要实名认证方可使用主要功能,请仔细阅读</p><br>
<p>1、为了你的帐号安全请勿使用他人手机号或身份信息</p><br>
@@ -311,6 +311,10 @@
<td>真实姓名:</td>
<td><input type="text" id="real-name-name" class="inputBox" placeholder="请输入真实姓名"/></td>
</tr>
<tr>
<td>手机号码:</td>
<td><input type="text" id="real-name-phone" class="inputBox" placeholder="请输入手机号码" ></td>
</tr>
<tr>
<td>身份证号:</td>
<td><input type="number" id="real-name-code" class="inputBox" placeholder="请输入身份证号码"/></td>
@@ -322,11 +326,14 @@
<button type="button" class="btnXq" onclick="realname()">确定</button>
</div>
</form>
<h1 id="verify-info" style="display:none;text-align: center;padding-top:100px;font-size:25px">请长按二维码下载,进入支付宝扫码验证</h1>
<div style="padding: 50px 100px;text-align: center;" id="qrcode"></div>
</div>
<!-- 支付弹窗 -->
<div id="aliPayBox" style="display:none"></div>
<script type="text/javascript" src="https://static.runoob.com/assets/qrcode/qrcode.min.js"></script>
<script>
var t1 = null;
@@ -456,22 +463,36 @@ var t1 = null;
// }
function realname(){
let id_code = $('#real-name-code').val(),
name = $('#real-name-name').val();
name = $('#real-name-name').val(),
phone = $('#real-name-phone').val();
if(id_code.length <= 0){
alert("抱歉!请重新输入身份证号!");
return;
}
if(phone.length != 11){
alert("抱歉!请重新输入手机号!");
return;
}
if(name.length <= 0){
alert("抱歉!请重新输入姓名!");
return;
}
var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
if(reg.test(id_code) === false)
{
alert("身份证输入不合法");
return false;
}
let data = {
cookie:document.cookie,
id_code: id_code,
name: name
name: name,
phone: phone
}
@@ -486,10 +507,20 @@ var t1 = null;
},
crossDomain: true,
success: function (res) {
if (res.Code == 20000) {
alert('已经认证成功');
window.location.href='/User/Index';
return ;
}
if (res.Code == 10000) {
const certifyUrl = 'alipays://platformapi/startapp?appId=20000067&url='+encodeURIComponent(res.url);
window.location.href=certifyUrl
// t1 = window.setInterval(get_verify_res,1500);
$('#id-cert').hide();
$('#verify-info').show();
new QRCode(document.getElementById("qrcode"), {
text: res.url,
width : 550,
height : 550
});
t1 = window.setInterval(get_verify_res,1500);
} else {
alert('请正确填写姓名和身份证号码。');

View File

@@ -260,7 +260,7 @@
</p>
</form>
<h3 id="verify-info" style="display:none;text-align: center;">请打开 支付宝 扫码进行认证</h3>
<div id="qrcode"></div>
<div id="qrcode_s"></div>
</div>
<div class="row">
@@ -600,7 +600,7 @@
if (res.Code == 10000) {
$('#id-cert').hide();
$('#verify-info').show();
new QRCode(document.getElementById("qrcode"), {
new QRCode(document.getElementById("qrcode_s"), {
text: res.url,
width : 550,
height : 550