Commit c0b5a6ce by xiexiaoqin

优化创建单词会议不刷新日程列表

parent 0c7673ff
...@@ -11,11 +11,7 @@ ...@@ -11,11 +11,7 @@
.task-list>.task-box { .task-list>.task-box {
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
border-radius: 8rpx; border-radius: 8rpx;
<<<<<<< HEAD
box-shadow: 0 0 8rpx 0rpx rgba(0, 0, 0, 0.06); box-shadow: 0 0 8rpx 0rpx rgba(0, 0, 0, 0.06);
=======
box-shadow: 0 0 8rpx 0rpx rgba(0, 0, 0, 0.08);
>>>>>>> 6ecd809354bff4a43d9602986b3da837f23eaa2f
padding: 0 16rpx; padding: 0 16rpx;
height: 80rpx; height: 80rpx;
color: rgba(27, 38, 61, 1); color: rgba(27, 38, 61, 1);
......
...@@ -46,10 +46,14 @@ create.Page({ ...@@ -46,10 +46,14 @@ create.Page({
timer: null, timer: null,
isFirstLoad: true, isFirstLoad: true,
onShow() { onShow() {
//如果是重复会议重新算
if (this.$store.data.indexNeedUpdate) { if (this.$store.data.indexNeedUpdate) {
//优化:如果是重复会议重新算,单次会议往DateMap中添加
DateMap = getDateMap(minYear, maxYear); DateMap = getDateMap(minYear, maxYear);
this.onLoad() this.onLoad();
}
//单次会议往DateMap中添加
if (this.$store.data.onceMeetingContent) {
this.getScheduleList(this.$store.data.onceMeetingContent, 'once');
} }
}, },
onLoad() { onLoad() {
...@@ -228,13 +232,13 @@ create.Page({ ...@@ -228,13 +232,13 @@ create.Page({
startTime: "2020-01-01 00:00:00", startTime: "2020-01-01 00:00:00",
endTime: "2025-12-30 23:59:59" endTime: "2025-12-30 23:59:59"
}).then(res => { }).then(res => {
this.scheduleList = this.getScheduleList(res.data.data); this.getScheduleList(res.data.data);
this.getPagination(this.scheduleList); // this.getPagination(this.scheduleList);
// 第一次加载 // 第一次加载
this.setData({ // this.setData({
scheduleList: this.scheduleList.slice(this.firstPage * this.pageSize, this.currentPage * this.pageSize), // scheduleList: this.scheduleList.slice(this.firstPage * this.pageSize, this.currentPage * this.pageSize),
loading: false // loading: false
}); // });
}); });
}, },
//生成DateMap值 //生成DateMap值
...@@ -350,8 +354,12 @@ create.Page({ ...@@ -350,8 +354,12 @@ create.Page({
} }
}, },
//日程数据 //日程数据
getScheduleList(response) { getScheduleList(response, type) {
this.setDateMapByResponse(response); if (type == 'once') {
this.setDateMapValue(response.startTime, response.endTime, response);
} else {
this.setDateMapByResponse(response);
}
// 取出DateMap的value值平铺到DateList // 取出DateMap的value值平铺到DateList
const DateList = []; const DateList = [];
DateMap.forEach(function (value, key) { DateMap.forEach(function (value, key) {
...@@ -419,7 +427,14 @@ create.Page({ ...@@ -419,7 +427,14 @@ create.Page({
}); });
} }
}); });
return DateList; this.scheduleList = DateList;
this.getPagination(this.scheduleList);
// 第一次加载
this.setData({
scheduleList: this.scheduleList.slice(this.firstPage * this.pageSize, this.currentPage * this.pageSize),
loading: false
});
}, },
//日程上拉加载 //日程上拉加载
lower() { lower() {
......
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