|
@@ -9,6 +9,10 @@ Page({ |
|
|
*/ |
|
|
*/ |
|
|
data: { |
|
|
data: { |
|
|
score: 10, |
|
|
score: 10, |
|
|
|
|
|
pageNum:1, |
|
|
|
|
|
list:[], |
|
|
|
|
|
showcontent:false, |
|
|
|
|
|
loading:"" |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@@ -22,24 +26,52 @@ Page({ |
|
|
url: '/pages/grade/grade', |
|
|
url: '/pages/grade/grade', |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
record: function() { |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 生命周期函数--监听页面显示 |
|
|
|
|
|
*/ |
|
|
|
|
|
onShow: function () { |
|
|
|
|
|
let that = this; |
|
|
|
|
|
that.getScore(); |
|
|
|
|
|
let pageNum = that.data.pageNum; |
|
|
|
|
|
let pageSize = that.data.pageSize; |
|
|
|
|
|
that.record(pageNum, pageSize); |
|
|
|
|
|
}, |
|
|
|
|
|
record: function (pageNum) { |
|
|
let that = this; |
|
|
let that = this; |
|
|
Http.get({ |
|
|
Http.get({ |
|
|
url: config.api.scoreHistory, |
|
|
url: config.api.scoreHistory, |
|
|
data: { |
|
|
data: { |
|
|
pageNum: 1, |
|
|
|
|
|
pageSize: 100 |
|
|
|
|
|
|
|
|
pageNum: pageNum, |
|
|
|
|
|
pageSize: 15 |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.then(res => { |
|
|
.then(res => { |
|
|
console.log(res) |
|
|
console.log(res) |
|
|
if (res.data.list.length > 0) { |
|
|
|
|
|
res.data.list.map(file=>{ |
|
|
|
|
|
|
|
|
if (res.data.list.length > 0 && res.data.pageNum >= pageNum) { |
|
|
|
|
|
var tmpArr = that.data.list.concat(res.data.list); |
|
|
|
|
|
|
|
|
|
|
|
tmpArr.map(file => { |
|
|
file.createDate = util.formatTime(file.createDate, "yyyy-MM-dd hh:mm:ss") |
|
|
file.createDate = util.formatTime(file.createDate, "yyyy-MM-dd hh:mm:ss") |
|
|
}); |
|
|
}); |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
list:res.data.list |
|
|
|
|
|
|
|
|
list:tmpArr |
|
|
}) |
|
|
}) |
|
|
|
|
|
setTimeout(function(){ |
|
|
|
|
|
wx.hideLoading() |
|
|
|
|
|
},1200) |
|
|
|
|
|
} |
|
|
|
|
|
else if (res.data.list.length == 0){ |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
loading:"暂无数据" |
|
|
|
|
|
}) |
|
|
|
|
|
setTimeout(function () { |
|
|
|
|
|
wx.hideLoading() |
|
|
|
|
|
}, 1200) |
|
|
|
|
|
} |
|
|
|
|
|
else{ |
|
|
|
|
|
setTimeout(function () { |
|
|
|
|
|
wx.hideLoading() |
|
|
|
|
|
}, 1200) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.catch(err => { |
|
|
.catch(err => { |
|
@@ -64,54 +96,16 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
/** |
|
|
|
|
|
* 生命周期函数--监听页面初次渲染完成 |
|
|
|
|
|
*/ |
|
|
|
|
|
onReady: function() { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 生命周期函数--监听页面显示 |
|
|
|
|
|
*/ |
|
|
|
|
|
onShow: function() { |
|
|
|
|
|
let that = this; |
|
|
|
|
|
that.getScore(); |
|
|
|
|
|
that.record(); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 生命周期函数--监听页面隐藏 |
|
|
|
|
|
*/ |
|
|
|
|
|
onHide: function() { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 生命周期函数--监听页面卸载 |
|
|
|
|
|
*/ |
|
|
|
|
|
onUnload: function() { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 页面相关事件处理函数--监听用户下拉动作 |
|
|
|
|
|
*/ |
|
|
|
|
|
onPullDownRefresh: function() { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 页面上拉触底事件的处理函数 |
|
|
|
|
|
*/ |
|
|
|
|
|
onReachBottom: function() { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 用户点击右上角分享 |
|
|
|
|
|
*/ |
|
|
|
|
|
onShareAppMessage: function() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onReachBottom: function () { |
|
|
|
|
|
var that = this; |
|
|
|
|
|
wx.showLoading({ |
|
|
|
|
|
title: '', |
|
|
|
|
|
mask:true |
|
|
|
|
|
}) |
|
|
|
|
|
that.data.pageNum++; |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
pageNum: that.data.pageNum |
|
|
|
|
|
}); |
|
|
|
|
|
that.record(that.data.pageNum); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |