account.html
9.38 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<!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">
<!--<!–<li>–>-->
<!--<!–<span class="left">退款到支付原路径-退货单号6565223<p>2016-07-10 20:53:34</p></span>–>-->
<!--<!–<span class="right plus">+29.00</span>–>-->
<!--<!–<p class="clear"></p>–>-->
<!--<!–</li>–>-->
<!--<!–<li>–>-->
<!--<!–<span class="left">消费-交易单号888798999<p>2016-07-10 20:53:34</p></span>–>-->
<!--<!–<span class="right reduce">-37.00</span>–>-->
<!--<!–<p class="clear"></p>–>-->
<!--<!–</li>–>-->
<!--<!–<li>–>-->
<!--<!–<span class="left">充值-支付宝客户端支付<p>2016-07-10 20:53:34</p></span>–>-->
<!--<!–<span class="right plus">+66.00</span>–>-->
<!--<!–<p class="clear"></p>–>-->
<!--<!–</li>–>-->
<!--<!–<li>–>-->
<!--<!–<span class="left">提现-提现单号336666<p>2016-07-10 20:53:34</p></span>–>-->
<!--<!–<span class="right reduce">-66.00</span>–>-->
<!--<!–<p class="clear"></p>–>-->
<!--<!–</li>–>-->
<!--<!–<li>–>-->
<!--<!–<span class="left">提现-提现单号336666<p>2016-07-10 20:53:34</p></span>–>-->
<!--<!–<span class="right reduce">-66.00</span>–>-->
<!--<!–<p class="clear"></p>–>-->
<!--<!–</li>–>-->
</ul>
<div class="loadBtn" onClick="ajax_sourch_submit()">加载更多</div>
</div>
<!--删除 20170320-->
<!--<div id="tbh5v0">
<div style="background:#fff;">
<div class="user_login_title"><h2><em>账户余额</em><span>¥{$user['user_money']}元</span></h2></div>
<empty name="account_log">
<p class="font12">您没有任何资金的变动哦!</p>
<else/>
<div class="Funds">
<ul>
<foreach name="account_log" item="item" key="k">
<li class="Funds_li" <if condition="$k eq count($account_log)"> style="border:0"</if>>
<span class="icon <if condition='$k eq 0'>on</if>"></span>
<span>金额:<em>{$item.user_money}</em>,积分:<em>{$item.pay_points}</em></span>
<span>{$item.change_time|date='Y-m-d H:i:s',###}</span>
<span>{$item.desc}</span>
</li>
</foreach>
</ul>
</div>
<notempty name="account_log">
<div id="getmore" style="font-size:.24rem;text-align: center;color:#888;padding:.25rem .24rem .4rem; clear:both">
<a href="javascript:void(0)" onClick="ajax_sourch_submit()">点击加载更多</a>
</div>
</notempty>
</empty>
</div>
<a href="javascript:goTop();" class="gotop"><img src="__STATIC__/images/topup.png"></a>
</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=liudongrecord&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"];
if(data.item[i].type==2){
intro="退款";
}
if(data.item[i].type==3){
intro="购买";
}
if(data.item[i].type==4 || data.item[i].type==5 ){
intro="返利";
}
if(data.item[i].type==6)
{
intro="转入";
}
if(data.item[i].type<6) {
html += "<li> <span class=\"left\">" + intro + "-" + "单号" + data.item[i]["order_sn"] + "<p>" + unix_to_datetime(data.item[i]["time"]) + "</p></span>";
}else
{
html += "<li> <span class=\"left\">" + data.item[i]["remark"] + "<p>" + unix_to_datetime(data.item[i]["time"]) + "</p></span>";
}
if(data.item[i]["type"]==0 || data.item[i]["type"]==2 || data.item[i]["type"]==4 || data.item[i].type==5 || data.item[i].type==6 || data.item[i].type==7)
{
html+="<span class=\"right plus\">+"+data.item[i]["money"]+"</span>";
}
else {
html+="<span class=\"right reduce\">-"+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>