...
|
...
|
@@ -8,11 +8,11 @@ Page({ |
|
|
data: {
|
|
|
days: [],//日期列表
|
|
|
list: {},//活动列表,days的数据为key
|
|
|
curScheduleList: [], //当前选中的日期
|
|
|
curactivityList: [], //当前选中的日期
|
|
|
},
|
|
|
onLoad: function(options) {
|
|
|
//Do some initialize when page load.
|
|
|
this.fetchScheduleList()
|
|
|
this.fetchactivityList()
|
|
|
|
|
|
},
|
|
|
onReady: function() {
|
...
|
...
|
@@ -24,7 +24,7 @@ Page({ |
|
|
|
|
|
},
|
|
|
|
|
|
fetchScheduleList() {
|
|
|
fetchactivityList() {
|
|
|
let that = this;
|
|
|
GET(YOHOOD_HOST + '/activity/lists', {})
|
|
|
.then(json => {
|
...
|
...
|
@@ -37,16 +37,16 @@ Page({ |
|
|
let days = data.days;
|
|
|
let list = data.list;
|
|
|
|
|
|
let curScheduleList = []
|
|
|
let curactivityList = []
|
|
|
if (days.length > 0) {
|
|
|
let selectDay = days[0];
|
|
|
curScheduleList = list[selectDay]
|
|
|
curactivityList = list[selectDay]
|
|
|
}
|
|
|
|
|
|
that.setData({
|
|
|
days,
|
|
|
list,
|
|
|
curScheduleList
|
|
|
curactivityList
|
|
|
})
|
|
|
}
|
|
|
})
|
...
|
...
|
@@ -58,10 +58,10 @@ Page({ |
|
|
selectTab(e) {
|
|
|
let select = e.detail.index;
|
|
|
let selectDay = this.data.days[select];
|
|
|
let curScheduleList = this.data.list[selectDay];
|
|
|
let curactivityList = this.data.list[selectDay];
|
|
|
this.setData({
|
|
|
select,
|
|
|
curScheduleList
|
|
|
curactivityList
|
|
|
})
|
|
|
},
|
|
|
|
...
|
...
|
@@ -100,6 +100,6 @@ Page({ |
|
|
//Do some when page pull down.
|
|
|
wx.stopPullDownRefresh();
|
|
|
|
|
|
this.fetchScheduleList();
|
|
|
this.fetchactivityList();
|
|
|
}
|
|
|
}) |
|
|
\ No newline at end of file |
...
|
...
|
|