|
@@ -1,5 +1,6 @@
|
|
|
import {
|
|
|
getRankingData,
|
|
|
+ getSelfRanking,
|
|
|
getRankedDay
|
|
|
} from '~/api/global'
|
|
|
import event from '~/mixins/event'
|
|
@@ -14,7 +15,8 @@ Page({
|
|
|
rankingType: '',
|
|
|
icon: '',
|
|
|
podiumBoxBg: '',
|
|
|
- historyList: []
|
|
|
+ historyList: [],
|
|
|
+ day: '',
|
|
|
},
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
@@ -23,8 +25,9 @@ Page({
|
|
|
let historyList = await getRankedDay()
|
|
|
console.log(historyList);
|
|
|
this.setData({
|
|
|
- historyList
|
|
|
- },()=>{
|
|
|
+ historyList,
|
|
|
+ day: historyList[historyList.length - 1]
|
|
|
+ }, () => {
|
|
|
this.getRankInfo(options)
|
|
|
})
|
|
|
|
|
@@ -39,14 +42,15 @@ Page({
|
|
|
frontColor: '#ffffff',
|
|
|
backgroundColor: options.type == '2' ? '#50AE75' : options.type == '3' ? '#FF7E6C' : '#8468FA',
|
|
|
})
|
|
|
- console.log(this.data.historyList);
|
|
|
- let {
|
|
|
- userList,
|
|
|
- } = await getRankingData({
|
|
|
+ let userList = await getRankingData({
|
|
|
+ type: options.type,
|
|
|
+ day: this.data.day
|
|
|
+ })
|
|
|
+ let self = await getSelfRanking({
|
|
|
type: options.type,
|
|
|
- day: this.data.historyList[this.data.historyList.length - 1]
|
|
|
+ day: this.data.day
|
|
|
})
|
|
|
-
|
|
|
+ console.log(self);
|
|
|
this.setData({
|
|
|
userList,
|
|
|
})
|
|
@@ -61,6 +65,14 @@ Page({
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ bindDateChange(e) {
|
|
|
+ this.setData({
|
|
|
+ day: e.detail.value
|
|
|
+ })
|
|
|
+ this.getRankInfo({
|
|
|
+ type: this.data.rankingType
|
|
|
+ })
|
|
|
+ },
|
|
|
jumpIndex() {
|
|
|
wx.switchTab({
|
|
|
url: '/pages/index/index',
|