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
|
loadingMore: function () {
var deviceLoad = new scrollLoad({
element: "#myscore-list",
loadDate: function (that) {
var self = this;
this.processing = true;
var $that = $(that);
var page = $that.data("page") || continuation;
var pagesize = 10;
var ajax = {
url: "/point/api_getassetstradeloglist",
type: "GET",
cache: false,
dataType: "json",
data: {
assetsTypes:assetsType,
merchantId:merchantId,
continuation: page,
size: 10
},
success: function (data) {
data ={
"continuation": "822160249934205018",
"data": [
{
"tradeId": "822160249934205018",
"value": "+5",
"createTime": "2017-07-13 10:42:26",
"remark": "每日登陆奖励",
"action": 1
},
{
"tradeId": "822160249934205018",
"value": "+5",
"createTime": "2017-07-13 10:42:26",
"remark": "每日登陆奖励",
"action": 1
}
],
"success": true,
"msg": null,
"errorCode": null
};
self.processing = false;
/*debug.log(data)*/
if (data.success) {
/*var nextPage = page + 1;
$that.data("page", nextPage);*/
var nextContinuation = data.continuation;
$that.data("page", nextContinuation);
$that.find(".mui-list-con").append(listTpl.render(data));
self.loadHelper('');
//如果没有更多数据
// if (Math.ceil(data.count / pagesize) === page) {
if (data.data.length<10) {
console.log("1111");
self.loadHelper('<span class="loading-tip"><i class="iconfont"></i></span> 没有更多数据了');
self.finish = true;
}
}
},
error: function () {
self.processing = false;
}
};
setTimeout(function () {
$.ajax(ajax);
}, 500)
}
});
if ($myscoreList.data("count") < 10) {
deviceLoad.finish = true;
}
}
|