439 lines
17 KiB
HTML
439 lines
17 KiB
HTML
<!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-2.0.2.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/api.js"></script>
|
|
<style type="text/css">
|
|
html, body {
|
|
overflow: hidden;
|
|
}
|
|
input::-webkit-input-placeholder, textarea::-webkit-input-placeholder {
|
|
color: #ccc;
|
|
}
|
|
|
|
.mybalance-item {
|
|
float: none;
|
|
}
|
|
|
|
.mybalance-item div {
|
|
float: none;
|
|
}
|
|
|
|
#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;
|
|
}
|
|
|
|
.mydata_box0 {
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
width: 100%;
|
|
height: 5em;
|
|
background-color: #fff;
|
|
}
|
|
|
|
.mydata_box0 div {
|
|
margin-top: 0.5em;
|
|
width: 50%;
|
|
height: 3em;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: #000;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.mydata_box0.ktxtime div {
|
|
margin-top: 0.5em;
|
|
width: 25%;
|
|
height: 3em;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: #000;
|
|
box-sizing: border-box;
|
|
}
|
|
.button_box {
|
|
padding:0;
|
|
}
|
|
.button_box div {
|
|
float: left;
|
|
margin-right: 2%;
|
|
margin-bottom: 0.8em;
|
|
width: 31.8%;
|
|
height: 2.2em;
|
|
line-height: 2.2em;
|
|
text-align: center;
|
|
border-radius: 0.4em;
|
|
color: #fff;
|
|
}
|
|
.button_box div.noright {
|
|
margin-right: 0;
|
|
}
|
|
.jhdyb_box {
|
|
border:0;
|
|
}
|
|
.jhdyb_box .text {
|
|
margin: 0 auto;
|
|
width: 12em;
|
|
}
|
|
.jhdyb_box .text input {
|
|
width: 90%;
|
|
}
|
|
.datatable {
|
|
}
|
|
</style>
|
|
<script type="text/javascript">
|
|
var userId = null;
|
|
var LoginId = null;
|
|
var CartId = null;
|
|
var opentimes = 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");
|
|
|
|
rdata(1);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
function onScroll0() {
|
|
|
|
isload = true;//设置是否终止滚动加载
|
|
curScrollHeight = 0;//当前滚动位置
|
|
curCount = 1;//计数器,防止滚动时重复执行加载下一页
|
|
$("#wrapper").scroll(function () {
|
|
var pageHeight = $("body").height();
|
|
var showHeight = $("#wrapper").height();
|
|
var scrollHeight = $("#wrapper").scrollTop();
|
|
|
|
if (curScrollHeight - scrollHeight < 30 && curScrollHeight > 0) {
|
|
|
|
if (curCount == 1 && isload) {
|
|
rdata(0);
|
|
}
|
|
curCount++; //加载下一页后计数器+1
|
|
}
|
|
if (curScrollHeight < scrollHeight) {
|
|
curScrollHeight = pageHeight - showHeight;//滚动到页面底部时,重设当前滚动位置
|
|
curCount = 1;
|
|
}
|
|
|
|
});
|
|
}
|
|
|
|
function rdata(ag) {
|
|
userId = getlocalStorage("userId");
|
|
LoginId = getlocalStorage("LoginId");
|
|
var userinfo = getlocalStorage("userinfo");
|
|
var userdata = JSON.parse(userinfo);
|
|
$("#txthm").val(userdata.Phone);
|
|
var Start = $("#sysnew .databox").length;
|
|
|
|
if (ag == 1) {
|
|
Start = 0;
|
|
}
|
|
$(".ajaxLoader").removeClass("uhide");
|
|
$.ajax({
|
|
type: 'GET',
|
|
url: "/apiajax.ashx",
|
|
data: "&action=gethfczlist&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 (Start == 0) {
|
|
if (data.data0.length > 0) {
|
|
for (i = 0; i < data.data0.length; i++) {
|
|
html += '<div id="je_' + data.data0[i].je + '" class="mybtn0' + (i > 0 && i % 2 == 0 ? ' noright' : '') + '" onclick="onshowhfcz(' + data.data0[i].je + ',' + data.data0[i].kc + ')">' + data.data0[i].je + '元</div>';
|
|
}
|
|
}
|
|
$(".button_box").html(html);
|
|
}
|
|
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("亲!找不到更多了");
|
|
isload = false;
|
|
}
|
|
} 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 = '<li class="databox" id="databox_' + param.id + '">';
|
|
html += '<span>' + param.phone + '</span>';
|
|
html += '<span>' + param.money + '</span>';
|
|
html += '<span>' + judgetime(param.addtime) + '</span>';
|
|
html += '<span>' + (param.seef == 2 ? "已退款" : (param.seef == 1 ? "已充值" : "未充值")) + '</span>';
|
|
html += '</li>';
|
|
html += '<div class="clear"></div>';
|
|
return html;
|
|
}
|
|
function onhfcz() {
|
|
//var hm = fTrim($('#txthm').val());
|
|
var je = fTrim($('#txtje').val());
|
|
var ifb = true;
|
|
if (ifb) {
|
|
if ($("#jhbutton").html() != "确认充值") {
|
|
ifb = false;
|
|
}
|
|
}
|
|
/*if (ifb) {
|
|
if (hm == "") {
|
|
tishi3("手机号码不能为空!");
|
|
$("#txthm").focus();
|
|
ifb = false;
|
|
}
|
|
}*/
|
|
if (ifb) {
|
|
if (je == "") {
|
|
tishi3("充值金额不能为空!");
|
|
$("#txtje").focus();
|
|
ifb = false;
|
|
}
|
|
}
|
|
if (ifb) {
|
|
var _index = layer.prompt({ title: '请输入安全密码,并确定下单', formType: 1 }, function (pass) {
|
|
if (pass == "") {
|
|
tishi3("请输入您的安全密码");
|
|
return false;
|
|
}
|
|
layer.close(_index);
|
|
if (ifb) {
|
|
if ($("#jhbutton").html() != "确认充值") {
|
|
ifb = false;
|
|
}
|
|
}
|
|
if (ifb) {
|
|
$("#jhbutton").html("充值中...");
|
|
|
|
try {
|
|
var datas = {
|
|
action: "hfcz",
|
|
userId: userId,
|
|
LoginId: LoginId,
|
|
//hm: hm,
|
|
je: je,
|
|
pwd: pass
|
|
};
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: "/apiajax.ashx?ifweb=1",
|
|
data: datas,
|
|
dataType: "json",
|
|
error: function (xhr) {
|
|
tishi3("发生错误:" + JSON.stringify(xhr));
|
|
},
|
|
success: function (data) {
|
|
|
|
$("#jhbutton").html("确认充值");
|
|
if (data) {
|
|
if (data.status == 1) {
|
|
tishi3(data.msg);
|
|
$('#txthm').val("");
|
|
$('#txtje').val("");
|
|
setlocalStorage("userinfo", JSON.stringify(data.userInfo));
|
|
rdata(1);
|
|
setlocalStorage("myrefresh", 1);
|
|
setlocalStorage("indexrefresh", 1);
|
|
} if (data.status == 0) {
|
|
tishi3(data.msg);
|
|
if (data.msg == "请先修改安全密码!") {
|
|
var closeInterval = setInterval(function () {
|
|
onlink("editpwd.html?t=1");
|
|
layer.closeAll();
|
|
clearInterval(closeInterval);
|
|
}, 500);
|
|
}
|
|
if (data.msg == "请先实名认证!") {
|
|
var closeInterval = setInterval(function () {
|
|
onlink("mydata.html");
|
|
layer.closeAll();
|
|
clearInterval(closeInterval);
|
|
}, 500);
|
|
}
|
|
}
|
|
} else {
|
|
tishi3('网络异常,请稍后重试');
|
|
}
|
|
}
|
|
});
|
|
} catch (err) {
|
|
tishi3(err);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
function onshowhfcz(je, kc) {
|
|
$("#jhbutton").html("确认充值");
|
|
$("#jhbutton").removeClass("hovered");
|
|
$(".button_box div.mybtn0.hover").removeClass("hover");
|
|
$(".button_box div.mybtn0#je_" + je).addClass("hover");
|
|
$("#txtje").val(je);
|
|
if (kc <= 0) {
|
|
$("#jhbutton").html("库存不足");
|
|
$("#jhbutton").addClass("hovered");
|
|
}
|
|
}
|
|
</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" style=" margin:0; padding:0; min-width:3em; padding-right:1em;">
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<section class="ub-f1" id="wrapper" style="padding:0.8em;box-sizing:border-box;">
|
|
|
|
<div class="clear"></div>
|
|
<div class="button_box">
|
|
</div>
|
|
<div class="clear"></div>
|
|
<div class="jhdyb_box">
|
|
<div class="cztext">
|
|
<div class="ub" style="width:5em;">充值号码:</div>
|
|
<div class="ub-f1" style="margin-top:-0.6em;"><input id="txthm" type="text" placeholder="请输入手机号码" disabled="disabled" style="color:#000;" /></div>
|
|
</div>
|
|
<!--<div class="text"><input id="txtje00" type="text" placeholder="请输入充值金额" /><div style="width:auto;">元</div></div>-->
|
|
<div id="jhbutton" class="mybtn" onclick="onhfcz();">确认充值</div>
|
|
<input id="txtje" type="hidden" />
|
|
</div>
|
|
<div class="clear"></div>
|
|
<div style="background-color:#fff;border-radius: 0.4em;border: solid 1px #dfdfdf; box-sizing: border-box;overflow:hidden;">
|
|
|
|
<div class="clear"></div>
|
|
<div class="datatable" style=" background-color:#fff; box-sizing:border-box;"><ul class="tit"><li><span>手机号码</span><span class="zhanghao">金额</span><span>日期</span><span>状态</span></li></ul><ul id="sysnew"></ul></div>
|
|
<div class="clear"></div>
|
|
<div class="more_box"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
</section>
|
|
|
|
<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>
|