From fbf776141160a4181aa00fd0c242da35e5186a99 Mon Sep 17 00:00:00 2001 From: QlQl <2458371920@qq.com> Date: Tue, 12 Oct 2021 16:09:25 +0800 Subject: [PATCH] =?UTF-8?q?2.0.0=20-=E4=BF=AE=E5=A4=8D=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=BB=B6=E7=BB=AD=E9=80=BB=E8=BE=91=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/collection/collection.js | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/pages/collection/collection.js b/src/pages/collection/collection.js index ce76113..70a2a6b 100644 --- a/src/pages/collection/collection.js +++ b/src/pages/collection/collection.js @@ -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; } @@ -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 }, @@ -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,