完善提现功能

This commit is contained in:
Dragon
2023-07-12 17:00:34 +08:00
parent 733ab19c71
commit f9886b9089
29 changed files with 1066 additions and 192 deletions

View File

@@ -1,5 +1,6 @@
let urlPrefix = getUrlPrefix()
let browser = checkVersion()
var url = getQueryString();
let env = EnvCheck();
if (env == 'test') {
new VConsole();
@@ -86,6 +87,8 @@ function getUploadToken (type) {
},
});
} else if (res.code ? res.code == 401 : JSON.parse(res).code == 401) {
window.location.href = './login.html'
} else {
toastMsg(res.message)
}
@@ -126,4 +129,55 @@ function listenFun () {
// 监听所有输入框输入
$(".box1 div .name,.box1 div .card,.box2 div .bankCard,.box2 div .phone,.box2 div .address").on("keyup", function () {
listenFun()
});
});
//
// 保存绑定
function withdrawUserAccount (name, idCardNo, accountNo, contact, thirdAccountNo, address, frontPhoto, backPhoto) {
var obj = {
uid: pubInfo.uid,
accountType: url.accountType,
name,
idCardNo,
accountNo,
contact,
thirdAccountNo,
address,
frontPhoto,
backPhoto,
};
showLoading()
networkRequest({
type: 'POST',
url: urlPrefix + '/withdrawUserAccount/save',
contentType: 'application/json',
data: JSON.stringify(obj),
success (res) {
if (res.code === 200) {
toastMsg('保存成功')
setTimeout(function () {
window.location.href = './withdrawal.html'
}, 500)
} else if (res.code ? res.code == 401 : JSON.parse(res).code == 401) {
window.location.href = './login.html'
} else {
toastMsg(res.message)
}
hideLoading(layerIndex)
},
error (err) {
hideLoading(layerIndex)
toastMsg('網絡錯誤,請退出重進')
}
})
}
$('.but').click(function () {
var frontImageUpload = document.querySelector('#frontImageUpload').files;
var backImageUpload = document.querySelector('#backImageUpload').files;
if (listenFun()) {
if (frontImageUpload.length == 0 || backImageUpload.length == 0) {
toastMsg('請上傳身份證');
return;
}
withdrawUserAccount($('.box1 div .name').val(), $('.box1 div .card').val(), $('.box2 div .bankCard').val(), $('.box2 div .phone').val(), $('.box2 div .alipay').val(), $('.box2 div .address').val(), $('.box3 .idBox .z .documents').attr('src'), $('.box3 .idBox .z .documents').attr('src'));
}
})