licp
2024-05-14 ef48e4b7a4d34e63ffd2cb23c406f4da6eb72ed7
src/components/view/index-index.vue
@@ -439,7 +439,8 @@
        pageSize: 8, // 一页7条
        total: null,
        listLoading: true, // 组件loading的展示,默认为true
        finishLoding: false // 加载完成,显示已经没有更多了
        finishLoding: false, // 加载完成,显示已经没有更多了
        timer:null
         }
      },
    watch:{
@@ -458,12 +459,20 @@
         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(){
@@ -623,10 +632,11 @@
        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) {
@@ -691,5 +701,8 @@
      })
    },
      },
    deactivated(){
      this.timer&&clearInterval(this.timer)
    }
   }
</script>