Commit e39c15ff by liang ce

首页接口

parent d3f4c80d
......@@ -30,10 +30,8 @@ Component({
var weekList = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
var w = weekList[date.getDay()];
var h = date.getHours()<10? "0"+date.getHours() : date.getHours();
var min = date.getMinutes()<10? "0"+date.getMinutes() :date.getMinutes();
var pickerValue = [this.data.timeData.indexOf(y+"/"+m+"/"+d+" "+w),this.data.timeHour.indexOf(`${h}`),this.data.timeMin.indexOf(`${min}`)]
console.log(pickerValue)
this.setData({
pickerValue: pickerValue,
time: this.props.time
......
......@@ -10,7 +10,8 @@ Page({
minYear: '',
isClicked:false,
startPageOnLoad: false,
startPageOnShow: false
startPageOnShow: false,
isFirstLoad: true
},
onLoad(query) {
// 页面加载
......@@ -42,6 +43,7 @@ Page({
for (let i = 0; i<= year - 2019; i++) {
scheduleList.push(that.returnScheduleList(2019 + i))
}
if (this.data.isFirstLoad){
const today = new Date()
const finalDate = new Date(today)
finalDate.setDate(today.getDate() - today.getDay())
......@@ -52,8 +54,18 @@ Page({
thisYear: year,
maxYear: year,
canClick: true,
startPageOnShow: true,
isFirstLoad: false
})
} else {
that.setData({
scheduleList: scheduleList,
thisYear: year,
maxYear: year,
canClick: true,
startPageOnShow: true
})
}
})
})
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment