account_unable.html
5.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<!DOCTYPE html >
<html>
<head>
<meta charset="UTF-8">
<title>不可用资金明细</title>
<include file="public/header" /><body>
<script type="text/javascript" src="__STATIC__/js/layer.js"></script>
<!--<header>
<div class="tab_nav">
<div class="header">
<div class="h-left"><a class="sb-back" href="javascript:history.back(-1)" title="返回"></a></div>
<!--修改 20170320
<div class="h-mid"><!--资金管理流动资金明细</div>
<div class="h-right">
<aside class="top_bar">
<div onClick="show_menu();$('#close_btn').addClass('hid');" id="show_more"><a href="javascript:;"></a> </div>
</aside>
</div>
</div>
</div>
</header>-->
<include file="public/menu" />
<include file="public/navBall" />
<div class="funds">
<div class="fundsQuery">
<span>日期:</span>
<input type="date" placeholder="请选择开始时间" id="stime" min="{$tyear}" max="{$hyear}" name="start" value="{$Think.request.start}"/>
<span class="ml10 mr10">至</span>
<input type="date" placeholder="请选择结束时间" id="etime" min="{$tyear}" max="{$hyear}" name="end" value="{$Think.request.end}"/>
<div class="sub-btn" onClick="sear()">查询明细</div>
<p>注:读取时段内近10笔记录</p>
</div>
<div class="fundsTit">
<span>项目</span>
<span style="text-align: right;">金额</span>
</div>
<ul id="infoList"></ul>
<div class="loadBtn" onClick="ajax_sourch_submit()">加载更多</div>
</div>
<script>
var IsLoading = true; //是否加载数据
$(function () {
ajax_sourch_submit();
})
var page = 0;
$(window).scroll(function () {
totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());
if ($(document).height() <= totalheight) {
if (IsLoading == true) {
IsLoading = false;
$(".loadBtn").html("数据加载中...");
ajax_sourch_submit();
}
}
});
function sear() {
page=0;
ajax_sourch_submit();
}
/*** ajax 提交表单 查询订单列表结果*/
function ajax_sourch_submit() {
stime=$("#stime").val();
etime=$("#etime").val();
var date=new Date;
var year=date.getFullYear();
if(stime!="") {
var diff=year-stime.substr(0,4);
if (diff > 20 || diff < -20) {
layer.open({content: '开始时间不能超出前后20年', time: 2});
return false;
}
}
if(etime!="") {
var diff2=year-etime.substr(0,4);
if (diff2 > 20 || diff2 < -20) {
layer.open({content: '结束时间不能超出前后20年', time: 2});
return false;
}
}
//url="/Mobile/article/articleList2/stoid/"+{:I('get.stoid')}+"/p/"+page+"/categroy/"+categroy+".html";
$.ajax({
type: "GET",
url: "/index.php?m=Mobile&c=User&a=unablerecord&p="+page+"&stime="+stime+"&etime="+etime+"&stoid={:I('get.stoid')}", //+tab,+{:I('get.stoid')}
// url:"{:U('Mobile/User/account',null,'')}/is_ajax/1/p/"+page,//+tab,
// data : $('#filter_form').serialize(),// 你的formid 搜索表单 序列化提交
beforeSend:function()
{
layer.open({shadeClose: false,type: 2 ,content: '加载中'});
},
success: function(data) {
layer.closeAll();
var html="";
if(data.state==0) {
if (page == 0) {
$("#infoList").html("");
$(".loadBtn").html("没有数据");
} else {
$(".loadBtn").html("没有更多数据了");
}
}else if(data.state==1)
{
for (i = 0; i < data.item.length; i++) {
var intro=data.item[i]["intro"];
html+="<li><span class=\"left\">单号"+data.item[i]["order_sn"]+"<p>"+unix_to_datetime(data.item[i]["create_time"])+"</p></span> ";
html+="<span class=\"right plus\">+"+data.item[i]["money"]+"</span>";
html+=" <p class=\"clear\"></p> </li>";
}
if (page == 0) {
$("#infoList").html(html);
}
else
{
$("#infoList").append(html);
}
page += 1;
//alert(data.page);
// alert(page);
if (data.page > page) {
// alert(1);
$(".loadBtn").show();
}
else {
// alert(0);
$(".loadBtn").hide();
}
IsLoading = true;
}
else
{
$("#infoList").html("");
$(".loadBtn").html("获取数据失败");
}
//layer.closeALL();
},
error:function()
{
layer.closeAll();
layer.alert("获取数据失败");
}
});
}
//时间戳转换为2017-05-16 14:15:00时间格式
function unix_to_datetime(timestamp) {
var now = new Date(timestamp * 1000); //根据时间戳生成的时间对象
var year=now.getFullYear();
var month=now.getMonth()+1;
var date=now.getDate();
var hour=now.getHours();
var minute=now.getMinutes();
var second=now.getSeconds();
return year+"-"+(month<10?"0"+month:month)+"-"+(date<10?"0"+date:date)+" "+(hour<10?"0"+hour:hour)+":"+(minute<10?"0"+minute:minute)+":"+(second<10?"0"+second:second);
}
</script>
<script type="text/javascript">
function goTop() {
$('html,body').animate({
'scrollTop': 0
}, 600);
}
</script>
</body>
</html>