|
@@ -7,7 +7,10 @@ Page({
|
|
|
*/
|
|
*/
|
|
|
data: {
|
|
data: {
|
|
|
datas:{},
|
|
datas:{},
|
|
|
- date:''
|
|
|
|
|
|
|
+ date:'',
|
|
|
|
|
+ match:[],
|
|
|
|
|
+ index:0,
|
|
|
|
|
+ match_id:''
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -20,26 +23,43 @@ Page({
|
|
|
// this.setData({
|
|
// this.setData({
|
|
|
// date: y + '-' + m + '-' + d
|
|
// date: y + '-' + m + '-' + d
|
|
|
// })
|
|
// })
|
|
|
-
|
|
|
|
|
- $api.getDate().then(res => {
|
|
|
|
|
|
|
+ $api.getMatchList().then(res=>{
|
|
|
|
|
+ let l = res.data.data.length - 1;
|
|
|
this.setData({
|
|
this.setData({
|
|
|
- date: res.data.data
|
|
|
|
|
|
|
+ match:res.data.data,
|
|
|
|
|
+ index: l,
|
|
|
|
|
+ match_id: res.data.data[l].id
|
|
|
|
|
+ })
|
|
|
|
|
+ $api.getDate().then(res => {
|
|
|
|
|
+ this.setData({
|
|
|
|
|
+ date: res.data.data
|
|
|
|
|
+ })
|
|
|
|
|
+ this.getData()
|
|
|
})
|
|
})
|
|
|
- this.getData()
|
|
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
getData() {
|
|
getData() {
|
|
|
wx.showNavigationBarLoading()
|
|
wx.showNavigationBarLoading()
|
|
|
- $api.getRank({stock_date:this.data.date}).then(res => {
|
|
|
|
|
|
|
+ $api.getRank({ stock_date: this.data.date, match_id: this.data.match_id}).then(res => {
|
|
|
wx.hideNavigationBarLoading()
|
|
wx.hideNavigationBarLoading()
|
|
|
this.setData({
|
|
this.setData({
|
|
|
- datas:res.data.data
|
|
|
|
|
|
|
+ datas:res.data.data,
|
|
|
|
|
+
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
.catch(err=>{
|
|
.catch(err=>{
|
|
|
wx.hideNavigationBarLoading()
|
|
wx.hideNavigationBarLoading()
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ bindChange(e) {
|
|
|
|
|
+ let match=this.data.match;
|
|
|
|
|
+ this.setData({
|
|
|
|
|
+ index: e.detail.value,
|
|
|
|
|
+ match_id: match[e.detail.value].id
|
|
|
|
|
+ })
|
|
|
|
|
+ this.getData()
|
|
|
|
|
+ },
|
|
|
bindDateChange(e) {
|
|
bindDateChange(e) {
|
|
|
this.setData({
|
|
this.setData({
|
|
|
date: e.detail.value
|
|
date: e.detail.value
|