earnings_log.html
4.1 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
<!DOCTYPE html>
<html lang="en">
{include file="public/head"/}
<link rel="stylesheet" href="__CDN__/assets/advertising/css/record.css">
<body>
<!-- 收益记录 -->
<div class="income_record" id="dom">
<div class="record_tips">红包劵收益记录</div>
{foreach name="$data" item="vo"}
<div class="record_single">
<div class="record_box layout justify flex_diection">
<div class="layout justify flex_row">
<div class="record_title">
{if condition="$vo.type eq 4"}
参与答题
{elseif condition='$vo.type eq 5'}
下级答题
{elseif condition='$vo.type eq 6'}
商户消费
{/if}
</div>
<div class="record_num">+{$vo.rmb}元</div>
</div>
<div class="record_date">
{$vo.createtime}
</div>
</div>
</div>
{/foreach}
</div>
{empty name="$data"}
<div class="empty_data">
暂无数据
</div>
{/empty}
{notempty name="$data"}
<div class="load_more layout align_center justify_center">
<div>加载更多</div>
<div class="layout align_center justify_center">
<img src="__CDN__/assets/advertising/img/right.png" alt="">
</div>
</div>
<!--当前页-->
<input type="hidden" id="page" value="1"/>
{/notempty}
{include file="public/js" /}
</body>
<script>
$(function(){
//加载更多
$(".load_more").click(function () {
var page = $('#page').val();
var user_id = "{$user.id}";
page++;
$.ajax({
url:"{:url('home/member/more_earnings_log')}",
type:"POST",
data:{'page':page,'user_id':user_id},
success:function(res){
if(res.code == 1){
if(res.data == ''){
$('.justify_center').html("<div>没有更多了~</div>");
toast('没有更多了~');
return;
}
var html = "";
$(res.data).each(function (key, vo) {
var type = "";
if(vo.type == 4){
type = "参与答题";
}else if(vo.type == 5){
type = "下级答题";
}
html += "<div class=\"record_single\">\n" +
" <div class=\"record_box layout justify flex_diection\">\n" +
" <div class=\"layout justify flex_row\">\n" +
" <div class=\"record_title\">\n" +
" "+type+"\n" +
" </div>\n" +
" <div class=\"record_num\">+"+vo.rmb+"元</div>\n" +
" </div>\n" +
" <div class=\"record_date\">\n" +
" "+vo.createtime+"\n" +
" </div>\n" +
" </div>\n" +
" </div>";
});
$('#dom').append(html);
$('#page').val(page);
}else{
toast('与服务器断开连接');
}
},
error:function(){
toast('与服务器断开连接');
}
})
})
})
</script>
</html>