Skip to content

Commit

Permalink
2.0.0
Browse files Browse the repository at this point in the history
-修复任务延续逻辑的错误
  • Loading branch information
QlQlqiqi committed Oct 12, 2021
1 parent 2f5412d commit fbf7761
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions src/pages/collection/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,12 @@ Component({
let tasksNoRepeatDelay = [];
let todayYMD = util.getDawn(0).substr(0, 10);
for (let task of tasksLocal) {
// 未删除、未完成、过期的任务
if(!task.delete && !task.finish && task.date.substr(0, 10).localeCompare(todayYMD) < 0) {
flagNeedToShowDialog = true;
tasksNoRepeatDelay.push(task);
}
if (task.delete || !task.repeat) {
if(!task.delete && task.date.substr(0, 10).localeCompare(todayYMD) < 0) {
flagNeedToShowDialog = true;
tasksNoRepeatDelay.push(task);
}
res.push(task);
continue;
}
Expand Down Expand Up @@ -376,7 +377,6 @@ Component({
tasksNoRepeatDelay.forEach(item => {
item.date = todayYMD + item.date.substr(10);
let taskSql = util.formatTasksFromLocalToSql([item], listsLocal, {owner, token})[0];
// taskSql.date = todayYMD + taskSql.date.substr(10);
util.myRequest({
url: item.urlSql,
header: { Authorization: "Token " + token },
Expand Down Expand Up @@ -418,6 +418,18 @@ Component({
}
return true;
});
// 假删除
tasksNoRepeatDelay.forEach(item => {
item.delete = true;
let taskSql = util.formatTasksFromLocalToSql([item], listsLocal, {owner, token})[0];
util.myRequest({
url: item.urlSql,
header: { Authorization: "Token " + token },
method: 'PUT',
data: taskSql,
})
.then(res => console.log(res));
})
this.setData({
tasks: tasksLocal,
dialogShow: false,
Expand Down

0 comments on commit fbf7761

Please sign in to comment.