Commit 40b59535 by xiexiaoqin

fix: 修改动态的时候通知首页动态列表更新

parent 0d8c11ad
......@@ -75,6 +75,8 @@ create.Page({
addData.updateTime = getCreateShowTime(addData.updateTime);
this.store.data.affairList.unshift(addData);
this.store.data.tasks.unshift(addData);
this.store.data.isNeedReloadIndexList = true;
this.update();
dd.navigateBack();
}
}
......
......@@ -84,6 +84,13 @@ create.Page({
this.update();
}
// 告诉首页要刷新数据
if (this.store.data.isNeedReloadIndexList) {
this.store.data.isNeedReloadIndexList = false
this.$store.data.isIndexAffairListNeedUpdate = true;
this.update();
}
if (this.$store.data.updateInfo.isUpate) {
if (this.$store.data.updateInfo.updateType === "modify_location") {
this.setData({
......@@ -1030,7 +1037,9 @@ create.Page({
dd.pageScrollTo({
scrollTop: 0
})
})
});
this.$store.data.isIndexAffairListNeedUpdate = true;
this.update();
},
// 创建任务
goCreateTask(e) {
......@@ -1103,8 +1112,19 @@ create.Page({
}
}).then(res => {
if (res.data.code == 0) {
this.getAffairList(this.store.data.scheduleId);
//修改列表数据
if (res.data.data) {
const addData = res.data.data[0].commentListDataModelList[0];
addData.updateTime = getCreateShowTime(addData.updateTime);
this.store.data.affairList.unshift(addData);
}
this.closePopup();
// 通知更新
this.$store.data.isIndexAffairListNeedUpdate = true;
this.update();
}
})
},
......@@ -1127,6 +1147,10 @@ create.Page({
// clear
this.store.data.notes = null;
this.update();
// 通知更新
this.$store.data.isIndexAffairListNeedUpdate = true;
this.update();
}
})
},
......@@ -1197,11 +1221,12 @@ create.Page({
const deleteData = this.store.data.affairList.splice(index, 1);
this.update();
// 如果删除的动态包含文件和任务,需要修改
console.log(deleteData)
if (deleteData[0].fileDetailList || deleteData[0].meetingTaskSimpleViewModel) {
this.getTaskAndFiles(this.store.data.affairList);
}
// 通知更新
this.$store.data.isIndexAffairListNeedUpdate = true;
this.update();
}
}
}
......@@ -1267,6 +1292,10 @@ create.Page({
// clear
this.store.data.remark = null;
this.update();
// 通知更新
this.$store.data.isIndexAffairListNeedUpdate = true;
this.update();
}
})
},
......
......@@ -16,6 +16,7 @@ class Store {
scheduleId: '',
groupId: '',
isNeedReloadList: false,
isNeedReloadIndexList: false,
logId: '',
relatedAppPlatform: null
}
......
......@@ -86,7 +86,6 @@ create.Page({
fileList: fileInfos
}
}
console.log(data)
updateMeetingTask(data).then(res => {
this.store.data.isNeedReloadList = 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