| | |
| | | pageSize: 8, // 一页7条 |
| | | total: null, |
| | | listLoading: true, // 组件loading的展示,默认为true |
| | | finishLoding: false // 加载完成,显示已经没有更多了 |
| | | finishLoding: false, // 加载完成,显示已经没有更多了 |
| | | timer:null |
| | | } |
| | | }, |
| | | watch:{ |
| | |
| | | setInterval(() => { |
| | | this.nowTime() |
| | | }, 1000) |
| | | this.init(); |
| | | this.weekdays = this.getWeekdaysForNextWeek() |
| | | this.getScheduleByMe() |
| | | this.init(); |
| | | this.currentPage = 1; |
| | | this.list = []; |
| | | this.getList(); |
| | | this.getScheduleByMe() |
| | | this.timer&&clearInterval(this.timer) |
| | | this.timer = setInterval(() => { |
| | | this.init(); |
| | | this.currentPage = 1; |
| | | this.list = []; |
| | | this.getList(); |
| | | this.getScheduleByMe() |
| | | },1000*60*10) |
| | | }, |
| | | methods: { |
| | | getList(){ |
| | |
| | | let weekdays = []; |
| | | for (let i = 0; i < 7; i++) { |
| | | let date = new Date(); |
| | | date.setDate(date.getDate() + i); // 今天之后的日子 |
| | | date.setDate(date.getDate() - i); // 今天之后的日子 |
| | | let day = date.getDay(); // 0-6 代表星期日到星期六 |
| | | weekdays.push(day); |
| | | } |
| | | weekdays.reverse() |
| | | weekdays = weekdays.map(m=>{ |
| | | let day ='' |
| | | switch (m) { |
| | |
| | | }) |
| | | }, |
| | | }, |
| | | deactivated(){ |
| | | this.timer&&clearInterval(this.timer) |
| | | } |
| | | } |
| | | </script> |