|
@ -50,10 +50,11 @@ Page({ |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
pageIndex: 1, |
|
|
pageIndex: 1, |
|
|
pageSize: 15, |
|
|
pageSize: 15, |
|
|
loadMoreType: 'none', |
|
|
loadMoreType: 'loading', |
|
|
loadMoreVisible: false, |
|
|
loadMoreVisible: true, |
|
|
pointsRecordlist: [], |
|
|
pointsRecordlist: [], |
|
|
pointsRankinglist: [], |
|
|
pointsRankinglist: [], |
|
|
|
|
|
pointsRankingUser: {},//当前用户排名信息
|
|
|
selectTab: e.currentTarget.dataset.tab, |
|
|
selectTab: e.currentTarget.dataset.tab, |
|
|
nodatapointsRecord: false, |
|
|
nodatapointsRecord: false, |
|
|
nodatapointsRanking: false, |
|
|
nodatapointsRanking: false, |
|
@ -81,76 +82,81 @@ Page({ |
|
|
pageIndex: 1, |
|
|
pageIndex: 1, |
|
|
pageSize: 15, |
|
|
pageSize: 15, |
|
|
timestamp: this.data.timestamp, |
|
|
timestamp: this.data.timestamp, |
|
|
loadMoreType: 'none', |
|
|
|
|
|
loadMoreVisible: false, |
|
|
|
|
|
pointsRankinglist: [], |
|
|
pointsRankinglist: [], |
|
|
nodatapointsRanking: false, |
|
|
nodatapointsRanking: false, |
|
|
|
|
|
loadMoreType: 'loading', |
|
|
|
|
|
loadMoreVisible: true, |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
that.pointsRankinglist() |
|
|
that.pointsRankinglist() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 积分记录-积分排行接口
|
|
|
// 获取事件详情
|
|
|
pointsRankinglist() { |
|
|
pointsRecordlist() { |
|
|
|
|
|
let that = this |
|
|
let that = this |
|
|
const para = { |
|
|
const para = { |
|
|
pageIndex: this.data.pageIndex, |
|
|
pageIndex: 1, |
|
|
pageSize: this.data.pageSize, |
|
|
pageSize: 10, |
|
|
timestamp: this.data.timestamp, |
|
|
timestamp: this.data.timestamp, |
|
|
|
|
|
rankingType: this.data.rankingType, //排名方式:0-周,1-月
|
|
|
} |
|
|
} |
|
|
pointsRecordlist(para).then(res => { |
|
|
pointsRankinglist(para).then(res => { |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
pointsRecordlist: that.data.pointsRecordlist.concat(res.data), |
|
|
pointsRankingUser: res.data.pointsRankingUser, |
|
|
loadMoreType: res.data.length === that.data.pageSize ? 'loading' : 'none', |
|
|
pointsRankinglist: that.data.pointsRankinglist.concat(res.data.pointsRankingTopTen), |
|
|
}) |
|
|
}) |
|
|
if (that.data.pointsRecordlist.length > 0) { |
|
|
if (that.data.pointsRankinglist.length > 0) { |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
nodatapointsRecord: false, |
|
|
nodatapointsRanking: false, |
|
|
|
|
|
loadMoreType: 'none', |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
nodatapointsRecord: true, |
|
|
nodatapointsRanking: true, |
|
|
|
|
|
loadMoreType: 'none', |
|
|
|
|
|
loadMoreVisible: false, |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
|
|
|
pointsRankinglist: [], |
|
|
|
|
|
nodatapointsRanking: true, |
|
|
loadMoreType: 'none', |
|
|
loadMoreType: 'none', |
|
|
pointsRecordlist: [], |
|
|
loadMoreVisible: false, |
|
|
nodatapointsRecord: false, |
|
|
|
|
|
}) |
|
|
}) |
|
|
console.log(err) |
|
|
console.log(err) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 积分记录-积分排行接口
|
|
|
// 积分记录-积分记录接口
|
|
|
pointsRankinglist() { |
|
|
pointsRecordlist() { |
|
|
let that = this |
|
|
let that = this |
|
|
const para = { |
|
|
const para = { |
|
|
pageIndex: this.data.pageIndex, |
|
|
pageIndex: this.data.pageIndex, |
|
|
pageSize: this.data.pageSize, |
|
|
pageSize: this.data.pageSize, |
|
|
timestamp: this.data.timestamp, |
|
|
timestamp: this.data.timestamp, |
|
|
rankingType: this.data.rankingType, //排名方式:0-周,1-月
|
|
|
|
|
|
} |
|
|
} |
|
|
pointsRankinglist(para).then(res => { |
|
|
pointsRecordlist(para).then(res => { |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
pointsRankinglist: that.data.pointsRankinglist.concat(res.data), |
|
|
pointsRecordlist: that.data.pointsRecordlist.concat(res.data), |
|
|
loadMoreType: res.data.length === that.data.pageSize ? 'loading' : 'none', |
|
|
loadMoreType: res.data.length === that.data.pageSize ? 'loading' : 'none', |
|
|
}) |
|
|
}) |
|
|
if (that.data.pointsRankinglist.length > 0) { |
|
|
if (that.data.pointsRecordlist.length > 0) { |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
nodatapointsRanking: false |
|
|
nodatapointsRecord: false, |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
nodatapointsRanking: true |
|
|
nodatapointsRecord: true, |
|
|
|
|
|
loadMoreVisible: false, |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
loadMoreType: 'none', |
|
|
loadMoreType: 'none', |
|
|
pointsRankinglist: [], |
|
|
loadMoreVisible: false, |
|
|
nodatapointsRanking: false |
|
|
pointsRecordlist: [], |
|
|
|
|
|
nodatapointsRecord: true, |
|
|
}) |
|
|
}) |
|
|
console.log(err) |
|
|
console.log(err) |
|
|
}) |
|
|
}) |
|
@ -158,6 +164,7 @@ Page({ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 生命周期函数--监听页面初次渲染完成 |
|
|
* 生命周期函数--监听页面初次渲染完成 |
|
|
*/ |
|
|
*/ |
|
@ -198,6 +205,11 @@ Page({ |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
loadMoreVisible: true |
|
|
loadMoreVisible: true |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
if (this.data.selectTab == 'tab1') { |
|
|
|
|
|
// this.pointsRankinglist(); //积分排行
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
if (this.data.loadMoreType === 'loading') { |
|
|
if (this.data.loadMoreType === 'loading') { |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
pageIndex: this.data.pageIndex + 1, |
|
|
pageIndex: this.data.pageIndex + 1, |
|
@ -205,10 +217,6 @@ Page({ |
|
|
timestamp: this.data.timestamp, |
|
|
timestamp: this.data.timestamp, |
|
|
nodatapointsRecord: false, |
|
|
nodatapointsRecord: false, |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
if (this.data.selectTab == 'tab1') { |
|
|
|
|
|
this.pointsRankinglist(); //积分排行
|
|
|
|
|
|
} else { |
|
|
|
|
|
this.pointsRecordlist(); //初始化加载积分记录列表
|
|
|
this.pointsRecordlist(); //初始化加载积分记录列表
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|