Files
g.hnyhua.cn/Mtxfw.VipSite/mobile/zhuanhuan.html
2026-02-07 15:48:27 +08:00

573 lines
22 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!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;
}
.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);
}
.layer {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 100;
background: rgba(0, 0, 0, .5);
display: none;
}
.layer img {
width: auto;
max-width: 20em;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>
<script type="text/javascript">
var userId = null;
var LoginId = null;
var CartId = null;
var opentimes = null;
var sInterval0 = null;
var ifedit = 0;
var t = 0;
var ksdjg = 0;
var zhsxf = 0;
var title = "余额划转兑换积分";
var address = null;
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;
}
if (t == 1) {
title = "兑换积分划转流量积分";
}
if (t == 2) {
title = "流量积分划转KSD";
}
if (t == 3) {
title = "KSD划转流量积分";
}
$("header h1").html(title);
$(document).attr("title", title);
$("title").html(title);
opentimes = setInterval(function () {
var selectqydatas = getlocalStorage("zhuanhuan_refresh");
if (selectqydatas != null) {
rdata(1);
clearlocalStorage("zhuanhuan_refresh");
}
}, 1000);
rdata0();
getje();
//rdata(1);
});
function rdata0() {
var userinfo = getlocalStorage("userinfo");
var userdata = JSON.parse(userinfo);
zhsxf = userdata.zhsxf;
ksdjg = userdata.ksdjg;
var TXEnable = userdata.ZHEnable;
if (t == 1) {
TXEnable =userdata.ZHEnable;
$("#sxf_title").html("KSD价格");
}
else if (t == 2) {
TXEnable = userdata.ZHEnable0;
}
else if (t == 3) {
TXEnable = userdata.ZHEnable1;
}
if (TXEnable == 1) {
$("#savebtn").val("暂时不能划转");
$("#savebtn").attr("disabled", true);
} else {
$("#savebtn").val("提交");
$("#savebtn").removeAttr("disabled");
}
if (t == 3) {
zhsxf = 0;
$("#textje2").html(userdata.ksdye);
$("#sxf_box").html(zhsxf + "%");
$("#zhsxf-box").addClass("uhide");
} else if (t == 2) {
$("#textje2").html(userdata.ggjfye);
$("#sxf_box").html(zhsxf + "%");
$("#zhsxf-box").removeClass("uhide");
} else if (t == 1) {
$("#sxf_box").html(ksdjg);
$("#textje2").html(userdata.mfye);
$("#zhsxf-box").removeClass("uhide");
} else {
$("#textje2").html(userdata.xjjye);
$("#sxf_box").html(zhsxf + "%");
$("#zhsxf-box").addClass("uhide");
}
}
function rdata(ag) {
userId = getlocalStorage("userId");
LoginId = getlocalStorage("LoginId");
var Start = $("#sysnew .databox").length;
if (ag == 1) {
Start = 0;
}
$(".ajaxLoader").removeClass("uhide");
$.ajax({
type: 'GET',
url: "/apiajax.ashx",
data: "&action=getzhuanhuanlist&ifweb=1&Start=" + Start + "&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) {
var html = "";
if (data.data.length > 0) {
var html = "";
for (i = 0; i < data.data.length; i++) {
var bifshow = 0;
if (ag == 0) {
if ($("#databox_" + data.data[i].id).length == 0) {
bifshow = 1;
}
} else {
bifshow = 1;
}
if (bifshow == 1) {
html += addMsg(data.data[i]);
}
}
if (ag == 1 || ag == 2) {
$("#sysnew").html(html);
if (ag == 1) {
onScroll0();
}
} else {
$("#sysnew").append(html);
}
$(".more_box").html("");
} else {
if (Start > 0) {
if (Start > 10) {
$(".more_box").html("亲!找不到更多了");
}
} else {
$('#sysnew').html("");
$(".more_box").html("亲,暂无信息!");
}
}
$(".ajaxLoader").addClass("uhide");
} else {
tishi3(data.msg);
$(".ajaxLoader").addClass("uhide");
if (data.msg == "您未登录") {
//$api.rmStorage("userId");
//$api.rmStorage("LoginId");
}
}
} else {
tishi3("网络错误!");
$(".ajaxLoader").addClass("uhide");
}
}
});
}
function addMsg(param) {
var html = '<div class="mybalance-item databox" id="databox_' + param.id + '">';
html += '<div class="Total">';
html += '<div><span>金额:</span>¥' + param.Totalmoney + '</div>';
html += '<div class="right"><span>时间:</span>' + param.addtime + '</div>';
html += '</div>';
html += '<div class="Total0">';
html += '<div><span>状态:</span>' + ((t == 0 && param.dhcount == 0) ? (param.seef == 0 ? "未领取产品" : "已领取产品") : "已审核") + '</div>';
/*if (t == 0 && param.dhcount == 0) {
html += '<div class="right">';
if (param.seef == 0) {
html += '<input id="qlqbtn' + param.id + '" type="button" class="mybtn" onclick="onqlq(' + param.id + ')" value="去领取产品" />';
}
html += '</div>';
}*/
html += '</div></div>';
html += '<div class="clear"></div>';
return html;
}
function onqlq(id) {
onlink("yydd_lqcp.html?id=" + id);
}
function onScroll0() {
isload = true;//设置是否终止滚动加载
curScrollHeight = 0;//当前滚动位置
curCount = 1;//计数器,防止滚动时重复执行加载下一页
$("#wrapper").scroll(function () {
var pageHeight = $("#sysnew").height();
var showHeight = $("#wrapper").height();
var scrollHeight = $("#wrapper").scrollTop();
if (curScrollHeight - scrollHeight < 10 && curScrollHeight > 0) {
if (curCount == 1 && isload) {
rdata(0);
}
curCount++; //加载下一页后计数器+1
}
if (curScrollHeight < scrollHeight) {
curScrollHeight = pageHeight - showHeight;//滚动到页面底部时,重设当前滚动位置
curCount = 1;
}
});
}
function onsave() {
var je = fTrim($('#txtje').val());
var pwd = fTrim($('#txtpwd').val());
var desc = fTrim($('#explain').val());
var ifb = true;
if (ifb) {
if (je == "") {
tishi3("划转数量不能为空!");
$("#txtje").focus();
ifb = false;
}
}
if (ifb) {
if (pwd == "") {
tishi3("安全密码不能为空!");
$("#txtpwd").focus();
ifb = false;
}
}
if (ifb) {
if ($("#savebtn").val() != "提交") {
ifb = false;
}
}
if (ifb) {
$("#savebtn").attr("disabled");
$("#savebtn").val("请稍候...");
try {
var datas = {
action: "zhuanhuan",
userId: userId,
LoginId: LoginId,
t: t,
code: "",
pwd: pwd,
je: je,
desc: desc
};
$.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);
$('#txtje').val("");
setlocalStorage("userinfo", JSON.stringify(data.userInfo));
rdata0();
setlocalStorage("myrefresh", 1);
setlocalStorage("mylogrefresh", 1);
setlocalStorage("indexrefresh", 1);
setlocalStorage("ksdrefresh", 1);
/*if (data.dhcount == 0) {
var closeInterval = setInterval(function () {
layer.close();
clearInterval(closeInterval);
onlink("yydd_lqcp.html?id=" + data.ResultID);
}, 300);
} else {*/
var closeInterval = setInterval(function () {
closeWin();
layer.closeAll();
clearInterval(closeInterval);
}, 300);
//}
} if (data.status == 0) {
tishi3(data.msg);
if (data.msg == "请先修改安全密码!") {
var closeInterval = setInterval(function () {
onlink("editpwd.html?t=1");
layer.closeAll();
clearInterval(closeInterval);
}, 300);
}
}
} else {
tishi3('网络异常,请稍后重试');
}
}
});
} catch (err) {
tishi3(err);
}
}
}
function onlog() {
onlink("zhuanhuan_log.html?t=" + t);
}
function getje() {
var je = fTrim($('#txtje').val());
if (je != "") {
var sjje = je;
if (t == 3) {
sjje = parseFloat(je);
sjje = (sjje / ksdjg);
$("#textje1").html(changeTwoDecimal_f(sjje));
}
else if (t == 2) {
//$("#textje0").html(changeTwoDecimal_f(sjje));
sjje = parseFloat(je);
sjje = (sjje - sjje * zhsxf / 100);//*ksdjg
$("#textje1").html(changeTwoDecimal_f(sjje));
}
else if (t == 1) {
//$("#textje0").html(changeTwoDecimal_f(sjje));
sjje = parseFloat(je);
sjje = (sjje / ksdjg);
$("#textje1").html(changeTwoDecimal_f(sjje));
} else {
//$("#textje0").html(changeTwoDecimal_f(sjje));
sjje = parseFloat(je);
sjje = (sjje - sjje * zhsxf / 100);
$("#textje1").html(changeTwoDecimal_f(sjje));
}
}
}
</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="nav-btn blue" id="nav-right" onclick="onlog()" style="color:#fff; margin:0; padding:0; min-width:4em; padding-right:1em;">
划转记录
</div>
</div>
</header>
<section class="ub-f1" id="wrapper">
<div id="wrapper_content">
<p class="pullDown">下拉刷新...</p>
<div class="clear"></div>
<div style="padding:0.8em;box-sizing:border-box;">
<div class="tixin-item">
<div class="ub ub-ac" style="">
<div class="ub font_box" style="padding:0.8em 0em;width:6em;">
您的余额
</div>
<div class="ub ub-f1 uinput11" style="box-sizing:border-box;">
<div class="text" id="textje2" style=" color: red;">0.00</div>
</div>
</div>
<div class="ub ub-ac" style="">
<div class="ub font_box" style="padding:0.8em 0em;width:6em;">
划转数量
</div>
<div class="ub ub-f1 uinput11" style="box-sizing:border-box;">
<input type="number" id="txtje" onblur="getje()" onkeydown="getje()" onkeyup="getje()" />
</div>
</div>
<!--<div class="ub ub-ac" style="">
<div class="ub font_box" style="padding:0.8em 0.8em;width:6em;">
需要支付
</div>
<div class="ub ub-f1 uinput11" style="padding-right: 0.8em;box-sizing:border-box;">
<div class="text" id="textje0" style=" color: red;">0.00</div>
</div>
</div>-->
<div class="flex-end uhide" id="zhsxf-box" style="margin-bottom: .08em;">
<div class="ub font_box" style="padding:0.8em 0em;">
<span id="sxf_title">手续费</span><span id="sxf_box" style="color:#ff4d00;"></span>
</div>
<div class="ub font_box" style="padding:0.8em 0em; padding-right:2em;">
实际到账:<span id="textje1" style="color:#ff4d00;"></span>
</div>
</div>
<div class="ub ub-ac" id="phonesms" style="">
<div class="ub font_box" style="padding:0.8em 0em;width:6em;">
安全密码
</div>
<div class="ub ub-f1 uinput11" style="box-sizing:border-box;">
<input type="password" id="txtpwd" />
</div>
</div>
<div class="ub ub-f1 ub-ver" style="padding: .8em 0; padding-left:0em; margin-bottom: .2em;height: 2em;">
<div class="ub uinput11">
<textarea id="explain" style=" width:100%;height: 2.7em;line-height:2.2em;" placeholder="添加备注" onfocus="placeholder='';" onblur="$(this).val()==''?placeholder='添加备注':placeholder=''"></textarea>
</div>
</div>
</div>
</div>
<div class="clear"></div>
<!--<div class="mybalance-box" style="padding:0 0.8em;">
<div class="text">
<div class="line_flag"></div>
<text>兑换记录</text>
</div>
<div id="sysnew" style="width:100%; padding-top:0.8em;">
</div>
</div>
<div class="clear"></div>
<div class="more_box"></div>-->
<div class="clear"></div>
<p class="pullUp">上拉加载...</p>
</div>
</section>
<footer>
<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>
<div class="layer" onclick='$(".layer").fadeOut();'>
<img src="/images/jt.png" alt="">
</div>
</body>
</html>