From 134525de69cbef9ca97f1a8185833df665217c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=87=E8=88=AA?= <653809315@qq.com> Date: Wed, 26 Jun 2024 19:14:40 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=AE=E9=A1=B6=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gan-ui/src/views/app/dynamic/index.vue | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/gan-ui/src/views/app/dynamic/index.vue b/gan-ui/src/views/app/dynamic/index.vue index ae8e5e7..1a25b47 100644 --- a/gan-ui/src/views/app/dynamic/index.vue +++ b/gan-ui/src/views/app/dynamic/index.vue @@ -71,10 +71,11 @@ @@ -332,13 +333,18 @@ export default { ); }, handleStatusChange(row) { - let text = row.isTop === "0" ? "置顶" : "取消"; - this.$modal.confirm('确认要"' + text + '""' + row.username + '"的动态吗?').then(function() { + let text = row.isTop ? "取消" : "置顶"; + + this.$modal.confirm('确认要"' + text + '""' + row.username + '"的动态置顶吗?').then(function() { return changeDynamicStatus(row.id, row.isTop); }).then(() => { this.$modal.msgSuccess(text + "成功"); }).catch(function() { - row.isTop = row.isTop === "0" ? "1" : "0"; + if (row.isTop) { + row.isTop = row.isTop ? !row.isTop : row.isTop; + }else { + row.isTop = row.isTop ? row.isTop : !row.isTop; + } }); }, },