Files

877 lines
35 KiB
HTML
Raw Permalink Normal View History

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>绑定支付</title>
<link rel="stylesheet" type="text/css" href="/css/api.css" />
<link rel="stylesheet" type="text/css" href="/css/content.css" />
<script type="text/javascript" src="/scripts/jquery-3.4.1.min.js"></script>
<script type="text/javascript" src="/scripts/jquery.cookie.min.js"></script>
<!--<script type="text/javascript" src="/scripts/iscroll.js"></script>-->
<script type="text/javascript" src="/script/main.js?t=0"></script>
<script type="text/javascript" src="/layer/layer.js"></script>
<script type="text/javascript" src="/Scripts/long.js"></script>
<script type="text/javascript" src="/script/moment.js"></script>
<script type="text/javascript" src="/script/area.js?t=0"></script>
<script type="text/javascript" src="/script/api.js"></script>
<style type="text/css">
html, body {
overflow: hidden;
}
#wrapper {
flex: 1;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.pullDown {
position: absolute;
top: -1.25rem;
left: 0;
width: 100%;
z-index: 100;
text-align: center;
display: none;
}
.pullUp {
position: absolute;
bottom: -1.25rem;
left: 0;
width: 100%;
z-index: 100;
text-align: center;
display: none;
}
.pullDown.loading, .pullUp.loading, .pullDown.refresh, .pullUp.refresh {
display: block;
}
#wrapper_content .ub-f1 {
}
#wrapper_content select {
color: #848484;
height: 2em;
}
.dbtnbox {
margin: 0 auto;
width: 100%;
text-align: center;
padding: 0;
box-sizing: border-box;
}
.dbtnbox input[type='button'] {
height: 3.5em;
line-height: 3.5em;
border-radius: 0;
}
.uploadpic_btn {
position: absolute;
width: 5em;
height: 5em;
right: 0;
top: 0;
opacity: 0;
filter: alpha(opacity=0);
}
</style>
<script type="text/javascript">
var userId = null;
var LoginId = null;
var CartId = null;
var opentimes = null;
var sInterval0 = null;
var t = 0, uploading = 0;
var image = "", image0 = "", img_url = "";
var myScroll = null;
var pullDown = 1; // 下拉刷新避免多次执行
var pullUp = 1; // 上拉加载避免多次执行
var downHeight = 0;
var upHeight = 0;
var isload = true;//设置是否终止滚动加载
var curScrollHeight = 0;//当前滚动位置
var curCount = 1;//计数器,防止滚动时重复执行加载下一页
$(document).ready(function () {
userId = getlocalStorage("userId");
LoginId = getlocalStorage("LoginId");
CartId = getlocalStorage("CartId");
var tt = $.getUrlParam("t");
if (tt != null) {
t = tt;
}
onnav();
$(".tab a").on("click", function () {
var num = $(this).index();
t = num;
onnav();
});
rdata(1);
});
function onnav() {
$($(".tab a")[t]).addClass("on").siblings().removeClass("on");
if (t == 0) {
var azhhide = $(".zhhide");
for (var i = 0; i < azhhide.length; i++) {
$(azhhide[i]).removeClass('uhide');
}
azhhide = $(".zhhide0");
for (var i = 0; i < azhhide.length; i++) {
$(azhhide[i]).addClass('uhide');
}
azhhide = $(".zhhide1");
for (var i = 0; i < azhhide.length; i++) {
$(azhhide[i]).addClass('uhide');
}
azhhide = $(".zhhide2");
for (var i = 0; i < azhhide.length; i++) {
$(azhhide[i]).addClass('uhide');
}
} else if (t == 1) {
var azhhide = $(".zhhide0");
for (var i = 0; i < azhhide.length; i++) {
$(azhhide[i]).removeClass('uhide');
}
azhhide = $(".zhhide");
for (var i = 0; i < azhhide.length; i++) {
$(azhhide[i]).addClass('uhide');
}
azhhide = $(".zhhide1");
for (var i = 0; i < azhhide.length; i++) {
$(azhhide[i]).addClass('uhide');
}
azhhide = $(".zhhide2");
for (var i = 0; i < azhhide.length; i++) {
$(azhhide[i]).addClass('uhide');
}
} else if (t == 2) {
var azhhide = $(".zhhide0");
for (var i = 0; i < azhhide.length; i++) {
$(azhhide[i]).addClass('uhide');
}
azhhide = $(".zhhide");
for (var i = 0; i < azhhide.length; i++) {
$(azhhide[i]).addClass('uhide');
}
azhhide = $(".zhhide1");
for (var i = 0; i < azhhide.length; i++) {
$(azhhide[i]).removeClass('uhide');
}
azhhide = $(".zhhide2");
for (var i = 0; i < azhhide.length; i++) {
$(azhhide[i]).addClass('uhide');
}
} else {
var azhhide = $(".zhhide1");
for (var i = 0; i < azhhide.length; i++) {
$(azhhide[i]).addClass('uhide');
}
azhhide = $(".zhhide");
for (var i = 0; i < azhhide.length; i++) {
$(azhhide[i]).addClass('uhide');
}
azhhide = $(".zhhide0");
for (var i = 0; i < azhhide.length; i++) {
$(azhhide[i]).addClass('uhide');
}
azhhide = $(".zhhide2");
for (var i = 0; i < azhhide.length; i++) {
$(azhhide[i]).removeClass('uhide');
}
}
$("#wrapper").animate({ scrollTop: 0 }, 500);
}
function rdata(ag) {
userId = getlocalStorage("userId");
LoginId = getlocalStorage("LoginId");
if (ag == 1) {
$(".ajaxLoader").removeClass("uhide");
}
$.ajax({
type: 'GET',
url: "/apiajax.ashx",
data: "&action=getuserinfo&ifweb=1&userId=" + (userId != null ? userId : "") + "&LoginId=" + (LoginId != null ? LoginId : ""),
dataType: "JSON",
error: function (xhr, type) {
tishi3("发生错误:" + JSON.stringify(xhr));
},
success: function (data) {
if (data) {
if (data.status == 1) {
$("#txtkhname").val(data.user.khname);
var webbank = data.webbank.split("|");
var html = "";
for (var i = 0; i < webbank.length; i++) {
if (data.user.bankname == webbank[i]) {
html += "<option selected value=\"" + webbank[i] + "\">" + webbank[i] + "</option>";
} else {
html += "<option value=\"" + webbank[i] + "\">" + webbank[i] + "</option>";
}
}
$("#txtbankname").html(html);
$("#txtbankcard").val(data.user.bankcard);
$("#txtbankaddress").val(data.user.bankaddress);
$("#txtAliAccount").val(data.user.AliAccount);
$("#txtAliName").val(data.user.AliName);
if (data.user.aliimage != "") {
$("#image").attr("src", data.user.aliimage);
}
image = data.user.yaliimage;
image0 = data.user.yweixinimage;
$("#txtqbaddress").val(data.user.qbaddress);
//$("#txtyedAccount").val(data.user.yedAccount);
//$("#txtyedName").val(data.user.yedName);
if (data.user.weixinimage != "") {
$("#image0").attr("src", data.user.weixinimage);
}
if (t == 2) {
if (data.user.qbaddress != "") {
$("#savebtn").attr("disabled");
$("#savebtn").val("不可更改");
}
}
$(".ajaxLoader").addClass("uhide");
} else {
tishi3(data.msg);
$(".ajaxLoader").addClass("uhide");
if (data.msg == "您未登录") {
onlink("/");
}
}
} else {
tishi3("网络错误!");
$(".ajaxLoader").addClass("uhide");
}
}
});
}
function onsave() {
var pwd2 = fTrim($("#txtpwd2").val());
if (t == 0) {
var khname = fTrim($("#txtkhname").val());
var bankname = fTrim($("#txtbankname").val());
var bankcard = fTrim($("#txtbankcard").val());
var bankaddress = fTrim($("#txtbankaddress").val());
var ifb = true;
if (ifb) {
if (khname == "") {
tishi3("开户姓名不能为空!");
$("#txtkhname").focus();
ifb = false;
}
}
if (ifb) {
if (bankname == "" || bankname == "请选择") {
tishi3("银行名称不能为空!");
$("#txtbankname").focus();
ifb = false;
}
}
if (ifb) {
if (bankcard == "") {
tishi3("银行卡号不能为空!");
$("#txtbankcard").focus();
ifb = false;
}
}
if (ifb) {
if (bankaddress == "") {
tishi3("开户行地址不能为空!");
$("#txtbankaddress").focus();
ifb = false;
}
}
/*if(ifb){
if(code==""){
tishi3("手机验证码不能为空!");
$("#usercode").focus();
ifb=false;
}
}*/
if (ifb) {
if (pwd2 == "") {
tishi3("安全密码不能为空!");
$("#txtpwd2").focus();
ifb = false;
}
}
if (ifb) {
if ($("#savebtn").val() != "提交") {
ifb = false;
}
}
if (ifb) {
$("#savebtn").attr("disabled");
$("#savebtn").val("请稍候...");
try {
var datas = {
action: "updatebankinfo",
userId: userId,
LoginId: LoginId,
khname: khname,
bankname: bankname,
bankcard: bankcard,
bankaddress: bankaddress,
pwd: pwd2
};
$.ajax({
type: 'POST',
url: "/apiajax.ashx?ifweb=1",
data: datas,
dataType: "json",
error: function (xhr) {
tishi3("发生错误:" + JSON.stringify(xhr));
},
success: function (data) {
$("#savebtn").removeAttr("disabled");
$("#savebtn").val("提交");
if (data) {
if (data.status == 1) {
tishi3(data.msg);
setlocalStorage("userinfo", JSON.stringify(data.userInfo));
setlocalStorage("myrefresh", 1);
setlocalStorage("tixianrefresh", 1);
var closeInterval = setInterval(function () {
closeWin();
clearInterval(closeInterval);
}, 300);
} if (data.status == 0) {
tishi3(data.msg);
if (data.msg == "请先修改安全密码!") {
var closeInterval = setInterval(function () {
onlink("editpwd.html?t=1");
clearInterval(closeInterval);
}, 500);
}
}
} else {
tishi3('网络异常,请稍后重试');
}
}
});
} catch (err) {
tishi3(err);
}
}
} else if (t == 1) {
var AliAccount = fTrim($("#txtAliAccount").val());
var AliName = fTrim($("#txtAliName").val());
var ifb = true;
if (ifb) {
if ((AliAccount == "" || AliName == "") && image == "") {
tishi3("支付宝账号和支付宝收款码必须选择一个!");
$("#txtAliAccount").focus();
ifb = false;
}
}
if (image == "") {
if (ifb) {
if (AliAccount == "") {
tishi3("支付宝账号不能为空!");
$("#txtAliAccount").focus();
ifb = false;
}
}
if (ifb) {
if (AliName == "") {
tishi3("支付宝姓名不能为空!");
$("#txtAliName").focus();
ifb = false;
}
}
}
if (ifb) {
if (uploading == 1) {
ifb = false;
tishi3('正在上传图片...');
}
}
/*if(ifb){
if(code==""){
tishi3("手机验证码不能为空!");
$("#usercode").focus();
ifb=false;
}
}*/
if (ifb) {
if (pwd2 == "") {
tishi3("安全密码不能为空!");
$("#txtpwd2").focus();
ifb = false;
}
}
if (ifb) {
if ($("#savebtn").val() != "提交") {
ifb = false;
}
}
if (ifb) {
$("#savebtn").attr("disabled");
$("#savebtn").val("请稍候...");
try {
var datas = {
action: "updatealipay",
userId: userId,
LoginId: LoginId,
AliAccount: AliAccount,
AliName: AliName,
aliimage: image,
pwd: pwd2
};
$.ajax({
type: 'POST',
url: "/apiajax.ashx?ifweb=1",
data: datas,
dataType: "json",
error: function (xhr) {
tishi3("发生错误:" + JSON.stringify(xhr));
},
success: function (data) {
$("#savebtn").removeAttr("disabled");
$("#savebtn").val("提交");
if (data) {
if (data.status == 1) {
tishi3(data.msg);
setlocalStorage("userinfo", JSON.stringify(data.userInfo));
setlocalStorage("myrefresh", 1);
setlocalStorage("tixianrefresh", 1);
var closeInterval = setInterval(function () {
closeWin();
clearInterval(closeInterval);
}, 300);
} if (data.status == 0) {
tishi3(data.msg);
if (data.msg == "请先修改安全密码!") {
var closeInterval = setInterval(function () {
onlink("editpwd.html?t=1");
clearInterval(closeInterval);
}, 500);
}
}
} else {
tishi3('网络异常,请稍后重试');
}
}
});
} catch (err) {
tishi3(err);
}
}
} else if (t == 2) {
var ifb = true;
if (ifb) {
if (image0 == "") {
tishi3("微信收款码必须上传!");
ifb = false;
}
}
if (ifb) {
if (uploading == 1) {
ifb = false;
tishi3('正在上传图片...');
}
}
if (ifb) {
if (pwd2 == "") {
tishi3("安全密码不能为空!");
$("#txtpwd2").focus();
ifb = false;
}
}
if (ifb) {
if ($("#savebtn").val() != "提交") {
ifb = false;
}
}
if (ifb) {
$("#savebtn").attr("disabled");
$("#savebtn").val("请稍候...");
try {
var datas = {
action: "updateweixinpay",
userId: userId,
LoginId: LoginId,
weixinimage: image0,
pwd: pwd2
};
$.ajax({
type: 'POST',
url: "/apiajax.ashx?ifweb=1",
data: datas,
dataType: "json",
error: function (xhr) {
tishi3("发生错误:" + JSON.stringify(xhr));
},
success: function (data) {
$("#savebtn").removeAttr("disabled");
$("#savebtn").val("提交");
if (data) {
if (data.status == 1) {
tishi3(data.msg);
setlocalStorage("userinfo", JSON.stringify(data.userInfo));
setlocalStorage("myrefresh", 1);
setlocalStorage("tixianrefresh", 1);
var closeInterval = setInterval(function () {
closeWin();
clearInterval(closeInterval);
}, 300);
} if (data.status == 0) {
tishi3(data.msg);
if (data.msg == "请先修改安全密码!") {
var closeInterval = setInterval(function () {
onlink("editpwd.html?t=1");
clearInterval(closeInterval);
}, 500);
}
}
} else {
tishi3('网络异常,请稍后重试');
}
}
});
} catch (err) {
tishi3(err);
}
}
} else {
var ifb = true;
var qbaddress = fTrim($("#txtqbaddress").val());
if (ifb) {
if (qbaddress == "") {
tishi3("TP钱包地址不能为空");
ifb = false;
}
}
if (ifb) {
if (pwd2 == "") {
tishi3("安全密码不能为空!");
$("#txtpwd2").focus();
ifb = false;
}
}
if (ifb) {
if ($("#savebtn").val() != "提交") {
ifb = false;
}
}
if (ifb) {
$("#savebtn").attr("disabled");
$("#savebtn").val("请稍候...");
try {
var datas = {
action: "updateqbaddress",
userId: userId,
LoginId: LoginId,
qbaddress: qbaddress,
pwd: pwd2
};
$.ajax({
type: 'POST',
url: "/apiajax.ashx?ifweb=1",
data: datas,
dataType: "json",
error: function (xhr) {
tishi3("发生错误:" + JSON.stringify(xhr));
},
success: function (data) {
$("#savebtn").removeAttr("disabled");
$("#savebtn").val("提交");
if (data) {
if (data.status == 1) {
tishi3(data.msg);
setlocalStorage("userinfo", JSON.stringify(data.userInfo));
setlocalStorage("myrefresh", 1);
setlocalStorage("tixianrefresh", 1);
var closeInterval = setInterval(function () {
closeWin();
clearInterval(closeInterval);
}, 300);
} if (data.status == 0) {
tishi3(data.msg);
if (data.msg == "请先修改安全密码!") {
var closeInterval = setInterval(function () {
onlink("editpwd.html?t=1");
clearInterval(closeInterval);
}, 500);
}
}
} else {
tishi3('网络异常,请稍后重试');
}
}
});
} catch (err) {
tishi3(err);
}
}
}
}
function uploadimg(uploadtype) {
var myForm = document.getElementById("myForm");
/*if (uploadtype == 1) {
myForm = document.getElementById("myForm0");
} else {
myForm = document.getElementById("myForm");
}*/
var formdata0 = new FormData(myForm);
formdata0.append("action", "uploadImage");
formdata0.append("userId", userId);
formdata0.append("LoginId", LoginId);
if (uploadtype == 2) {
formdata0.append("uploadpic", document.getElementById("uploadpic1").files[0]);
}
else if (uploadtype == 1) {
formdata0.append("uploadpic", document.getElementById("uploadpic0").files[0]);
} else {
formdata0.append("uploadpic", document.getElementById("uploadpic").files[0]);
}
uploading = 1;
$.ajax({
type: "POST",
url: "/apiajax.ashx?ifweb=1",
data: formdata0,
dataType: 'JSON',
cache: false, // 不缓存
processData: false, // jQuery不要去处理发送的数据
contentType: false, // jQuery不要去设置Content-Type请求头
success: function (data) {
tishi2close();
uploading = 0;
if (data.status == 1) {
//alert(JSON.stringify(data));
var thumb = data.url[0];
if (uploadtype == 2) {
image1 = data.url[1];
$("#image1").attr("src", thumb);
}else if (uploadtype == 1) {
image0 = data.url[1];
$("#image0").attr("src", thumb);
} else {
image = data.url[1];
$("#image").attr("src", thumb);
}
tishi3('上传成功');
} else {
tishi3(data.msg);
}
},
error: function (jqXHR) {
tishi3("发生错误:" + JSON.stringify(jqXHR));
},
});
}
</script>
</head>
<body class="wrap">
<header><div class="ub">
<div class="nav-btn" id="nav-left" style=" margin:0; padding:0; padding-top:0.2em; min-width:3em" onclick="closeWin()">
<img src="../image/faifei.png" style="margin-left:0; margin-top:0em; height:1.2em;width:1.2em;" />
</div>
<!--<h1 class="ub-f1">绑定支付</h1>-->
<div class="ub-f1">
<div class="tab flex-around">
<a class="on">银行资料</a>
<a>支付宝</a>
<a>微信支付</a>
</div>
</div>
<div class="nav-btn blue" id="nav-right" style=" margin:0; padding:0; min-width:0.8em; ">
</div>
</div></header>
<section class="ub-f1" id="wrapper" style="padding:0.8em; box-sizing:border-box;">
<div class="ub ub-ver tixin-item" style="">
<div class="ub ub-ac zhhide" id="sfz" style="padding-top:0.2em; border-bottom: 1px solid #dfdfdf;">
<div class="ub font_box" style="padding:0.8em 0.8em;padding-left:0;width:6em;">
开户姓名<font color="red">*</font>
</div>
<div class="ub ub-f1 ub-ac ub-pc uinput11">
<input id="txtkhname" type="text" value="" style="" />
</div>
</div>
<div class="ub ub-ac zhhide" style="border-bottom: 1px solid #dfdfdf;">
<div class="ub font_box" style="padding:0.8em 0.8em;padding-left:0;width:6em;">
银行名称<font color="red">*</font>
</div>
<div class="ub ub-f1 ub-ac ub-pc select">
<select id="txtbankname" style="width: 16em;height:2em"></select>
</div>
</div>
<div class="ub ub-ac zhhide" style="border-bottom: 1px solid #dfdfdf;">
<div class="ub font_box" style="padding:0.8em 0.8em;padding-left:0;width:6em;">
银行卡号<font color="red">*</font>
</div>
<div class="ub ub-f1 ub-ac ub-pc uinput11">
<input type="number" id="txtbankcard" />
</div>
</div>
<div class="ub ub-ac zhhide" style="border-bottom: 1px solid #dfdfdf;">
<div class="ub font_box" style="padding:0.8em 0.8em;padding-left:0;width:6em;">
开户行地址<font color="red">*</font>
</div>
<div class="ub ub-f1 ub-ac ub-pc uinput11">
<input type="text" id="txtbankaddress" />
</div>
</div>
<div class="ub ub-ac zhhide0 uhide" style="border-bottom: 1px solid #dfdfdf;">
<div class="ub font_box" style="padding:0.8em 0.8em;padding-left:0;width:6em;">
支付宝账号<font color="red">*</font>
</div>
<div class="ub ub-f1 ub-ac ub-pc uinput11" >
<input id="txtAliAccount" type="text" value="" />
</div>
</div>
<div class="ub ub-ac zhhide0 uhide" style="border-bottom: 1px solid #dfdfdf;">
<div class="ub font_box" style="padding:0.8em 0.8em;padding-left:0;width:6em;">
支付宝姓名<font color="red">*</font>
</div>
<div class="ub ub-f1 ub-ac ub-pc uinput11">
<input id="txtAliName" type="text" value="" />
</div>
</div>
<div class="ub ub-ac zhhide0 uhide" style="border-bottom: 1px solid #dfdfdf; padding:0.8em 0;">
<div class="ub font_box" style="padding:0.8em 0.8em;padding-left:0;width:6em;">
支付宝收款码<font color="red">*</font>
</div>
<div class="ub ub-ac ub-pc" style="padding-right: 0.8em">
<form id="myForm">
<div class="ub ub-ac ub-pc upload_image">
<img src="../image/add1.png" id="image" />
<input type="file" id="uploadpic" class="uploadpic_btn" onchange="uploadimg(0)" accept="image/*" />
</div>
</form>
</div>
</div>
<div class="ub ub-ac zhhide1 uhide" style="border-bottom: 1px solid #dfdfdf; padding:0.8em 0;">
<div class="ub font_box" style="padding:0.8em 0.8em;padding-left:0;width:6em;">
微信收款码<font color="red">*</font>
</div>
<div class="ub ub-ac ub-pc" style="padding-right: 0.8em">
<form id="myForm0">
<div class="ub ub-ac ub-pc upload_image">
<img src="../image/add1.png" id="image0" />
<input type="file" id="uploadpic0" class="uploadpic_btn" onchange="uploadimg(1)" accept="image/*" />
</div>
</form>
</div>
</div>
<div class="ub ub-ac zhhide2 uhide" style="border-bottom: 1px solid #dfdfdf; padding:0.8em 0; box-sizing:border-box;">
<div class="ub font_box" style="padding:0.8em 0.8em;padding-left:0;width:6em;">
TP钱包地址<font color="red">*</font>
</div>
<div class="ub ub-f1 uinput11" style="padding-right: 0;box-sizing:border-box;">
<textarea type="text" id="txtqbaddress" style=" width: 100%;height:5em;"></textarea>
</div>
</div>
<div class="ub ub-ac zhhide2 uhide" style="background-color: #ffffff;margin-bottom: .08em; padding:0.8em 0;">
<div class="ub ub-f1" style="padding:1em 1.5em;">
友情提示请务必正确填写TP的钱包地址一旦填写后不可修改。
</div>
</div>
<div class="ub ub-ac" style="border-bottom: 1px solid #dfdfdf;">
<div class="ub font_box" style="padding:0.8em 0.8em;padding-left:0;width:6em;">
安全密码<font color="red">*</font>
</div>
<div class="ub ub-f1 uinput11" style="padding-right: 0em;box-sizing:border-box;">
<input type="password" id="txtpwd2" style=" width: 100%" />
</div>
</div>
</div>
</section>
<footer style="background-color:#fff; border:0;">
<div class="dbtnbox">
<input id="savebtn" type="button" class="mybtn" onclick="onsave()" value="提交">
</div>
</footer>
<div class="ajaxLoader ub ub-ac uhide" onclick="reload()">
<div class="ub ub-ac ub-ver"><img src="image/load.gif" /><br>正在加载...</div>
</div>
</body>
</html>