|
|
@ -2,7 +2,8 @@ |
|
|
|
import { |
|
|
|
pointsRecordlist, |
|
|
|
pointsRankinglist, |
|
|
|
userPointsRankinglist |
|
|
|
userPointsRankinglist, |
|
|
|
gradeRankinglist |
|
|
|
} from '../../../../utils/api' |
|
|
|
import { |
|
|
|
getTimestamp |
|
|
@ -40,7 +41,7 @@ Page({ |
|
|
|
], |
|
|
|
timestamp: getTimestamp(), |
|
|
|
loadMoreType: 'none', |
|
|
|
loadMoreVisible: false, |
|
|
|
loadMoreVisible: false |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面加载 |
|
|
@ -93,8 +94,11 @@ Page({ |
|
|
|
loadMoreType: 'loading', |
|
|
|
loadMoreVisible: true, |
|
|
|
}) |
|
|
|
|
|
|
|
if ( e.currentTarget.dataset.type == '2') { |
|
|
|
that.gradeRankinglist() |
|
|
|
} else { |
|
|
|
that.pointsRankinglist() |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 积分记录-积分排行接口
|
|
|
@ -211,11 +215,9 @@ Page({ |
|
|
|
this.setData({ |
|
|
|
loadMoreVisible: true |
|
|
|
}) |
|
|
|
|
|
|
|
if (this.data.selectTab == 'tab1') { |
|
|
|
// this.pointsRankinglist(); //积分排行
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (this.data.loadMoreType === 'loading') { |
|
|
|
this.setData({ |
|
|
|
pageIndex: this.data.pageIndex + 1, |
|
|
@ -228,6 +230,41 @@ Page({ |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//6.28 等级排行榜
|
|
|
|
gradeRankinglist () { |
|
|
|
let that = this |
|
|
|
const para = { |
|
|
|
pageIndex: 1, |
|
|
|
pageSize: 20, |
|
|
|
timestamp: getTimestamp() |
|
|
|
} |
|
|
|
gradeRankinglist(para).then(res => { |
|
|
|
that.setData({ |
|
|
|
pointsRankingUser: res.data.currentUser, |
|
|
|
pointsRankinglist: that.data.pointsRankinglist.concat(res.data.rank), |
|
|
|
}) |
|
|
|
if (that.data.pointsRankinglist.length > 0) { |
|
|
|
that.setData({ |
|
|
|
nodatapointsRanking: false, |
|
|
|
loadMoreType: 'none', |
|
|
|
}) |
|
|
|
} else { |
|
|
|
that.setData({ |
|
|
|
nodatapointsRanking: true, |
|
|
|
loadMoreType: 'none', |
|
|
|
loadMoreVisible: false, |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
that.setData({ |
|
|
|
pointsRankinglist: [], |
|
|
|
nodatapointsRanking: true, |
|
|
|
loadMoreType: 'none', |
|
|
|
loadMoreVisible: false, |
|
|
|
}) |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 用户点击右上角分享 |
|
|
|
*/ |
|
|
|