Commit 40b59535 by xiexiaoqin

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

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