支付宝验证

This commit is contained in:
wyongk
2020-12-18 23:35:55 +08:00
parent 3a2a010469
commit d8e5723e8a
5 changed files with 219 additions and 20 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">
@@ -328,6 +328,8 @@
<div id="aliPayBox" style="display:none"></div>
<script>
var t1 = null;
/** 表单序列化成json字符串的方法 */
function form2JsonString(formId) {
var paramArray = $('#' + formId).serializeArray();
@@ -414,6 +416,45 @@
});
}
// function realname(){
// let id_code = $('#real-name-code').val(),
// name = $('#real-name-name').val();
// if(id_code.length <= 0){
// alert("抱歉!请重新输入身份证号!");
// return;
// }
// if(name.length <= 0){
// alert("抱歉!请重新输入姓名!");
// return;
// }
// let data = {
// cookie:document.cookie,
// id_code: id_code,
// name: name
// }
// $.ajax({
// type: 'POST',
// url: 'http://php-api.juip.com/api/Realname/index',
// dataType: "json",
// contentType: "application/json",
// data: JSON.stringify(data),
// beforeSend: function(xhr) {
// xhr.withCredentials = true;
// },
// crossDomain: true,
// success: function (res) {
// if (res.Code == 10000) {
// $('.real-name').hide();
// alert('实名认证成功。');
// } else {
// alert('请正确填写姓名和身份证号码。');
// }
// }
// });
// }
function realname(){
let id_code = $('#real-name-code').val(),
name = $('#real-name-name').val();
@@ -426,15 +467,17 @@
alert("抱歉!请重新输入姓名!");
return;
}
let data = {
cookie:document.cookie,
id_code: id_code,
name: name
}
$.ajax({
type: 'POST',
url: 'http://php-api.juip.com/api/Realname/index',
url: 'http://php-api.juip.com/api/test/aliverify',
dataType: "json",
contentType: "application/json",
data: JSON.stringify(data),
@@ -444,13 +487,65 @@
crossDomain: true,
success: function (res) {
if (res.Code == 10000) {
$('.real-name').hide();
alert('实名认证成功。');
const certifyUrl = 'alipays://platformapi/startapp?appId=20000067&url='+encodeURIComponent(res.url);
window.location.href=certifyUrl
// t1 = window.setInterval(get_verify_res,1500);
} else {
alert('请正确填写姓名和身份证号码。');
}
}
});
// let data = {
// cookie:document.cookie,
// id_code: id_code,
// name: name
// }
// $.ajax({
// type: 'POST',
// url: 'http://php-api.juip.com/api/Realname/index',
// dataType: "json",
// contentType: "application/json",
// data: JSON.stringify(data),
// beforeSend: function(xhr) {
// xhr.withCredentials = true;
// },
// crossDomain: true,
// success: function (res) {
// if (res.Code == 10000) {
// $('.real-name').hide();
// alert('实名认证成功。');
// } else {
// alert('请正确填写姓名和身份证号码。');
// }
// }
// });
}
function get_verify_res(){
let data = {
cookie:document.cookie
}
$.ajax({
type: 'POST',
url: 'http://php-api.juip.com/api/test/aliGetResult',
dataType: "json",
contentType: "application/json",
data: JSON.stringify(data),
beforeSend: function(xhr) {
xhr.withCredentials = true;
},
crossDomain: true,
success: function (res) {
if (res.Code == 10000) {
clearInterval(t1);
window.location.href='/User/Index';
}
}
});
}
function cash_out() {