Commit 8cd54638 by xiexiaoqin

feat: 首页定时刷新30s

parent b2dfa931
......@@ -29,6 +29,7 @@ import create from "dd-store";
let maxClickCount = 5;
create.Page({
data: {
sign: '',
refresh: false,
$data: null,
iconDay: currentDate.getDate(),
......@@ -61,6 +62,7 @@ create.Page({
maxYear: maxYear,
todayIndex: 0,
onShow() {
//如果是重复会议重新算
if (this.$store.data.indexNeedUpdate) {
dd.setNavigationBar({
......@@ -84,6 +86,14 @@ create.Page({
this.$store.data.isIndexAffairListNeedUpdate = false;
this.update();
}
//开启一个定时器
this.timer = setInterval(() => {
this.getData()
}, 30000)
},
onHide() {
clearInterval(this.timer);
this.timer = null;
},
refresh() {
this.onLoad()
......@@ -293,7 +303,17 @@ create.Page({
startTime: "2020-01-01 00:00:00",
endTime: "2025-12-30 23:59:59"
}).then(res => {
this.getScheduleList(res.data.data);
//是否刷新页面
if (this.data.sign && res.data.data.sign !== this.data.sign) {
DateMap = getDateMap(this.minYear, this.maxYear);
}
if (res.data.data.sign !== this.data.sign) {
this.getScheduleList(res.data.data);
}
this.setData({
sign: res.data.data.sign
})
}).catch(err => {
if (err && err.refresh) {
this.setData({
......
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