From d32d5d0eb83a9f2508e7f67e1982fc9d3cf1f734 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Mon, 28 Sep 2020 01:32:45 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E6=90=9C=E7=B4=A2=E5=8E=86=E5=8F=B2=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/ipcNames.js | 1 - src/renderer/App.vue | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/common/ipcNames.js b/src/common/ipcNames.js index 9aac43ce..ecc44d9c 100644 --- a/src/common/ipcNames.js +++ b/src/common/ipcNames.js @@ -48,7 +48,6 @@ const names = { get_playlist: 'get_playlist', save_playlist: 'save_playlist', get_data: 'get_data', - set_data: 'set_data', save_data: 'save_data', get_hot_key: 'get_hot_key', }, diff --git a/src/renderer/App.vue b/src/renderer/App.vue index 7b94dfbd..d9b4d3b5 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -94,7 +94,7 @@ export default { }) }, 1000) this.saveSearchHistoryList = throttle(n => { - rendererSend(NAMES.mainWindow.set_data, { + rendererSend(NAMES.mainWindow.save_data, { path: 'searchHistoryList', data: n, }) @@ -292,7 +292,7 @@ export default { rendererInvoke(NAMES.mainWindow.get_data, 'searchHistoryList').then(historyList => { if (historyList == null) { historyList = [] - rendererInvoke(NAMES.mainWindow.set_data, { path: 'searchHistoryList', data: historyList }) + rendererSend(NAMES.mainWindow.save_data, { path: 'searchHistoryList', data: historyList }) } else { this.setSearchHistoryList(historyList) } From 3bb0fcc4cd664a36ef25707ec23e5cfaee74475d Mon Sep 17 00:00:00 2001 From: lyswhut Date: Mon, 28 Sep 2020 01:32:53 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=8D=E5=90=AF?= =?UTF-8?q?=E8=BD=AF=E4=BB=B6=E5=90=8E=E8=AF=95=E5=90=AC=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E4=B8=8E=E6=94=B6=E8=97=8F=E5=88=97=E8=A1=A8=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=E4=B8=8A=E6=AC=A1=E7=9A=84=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/store/modules/list.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/store/modules/list.js b/src/renderer/store/modules/list.js index 04978ce3..e46f2782 100644 --- a/src/renderer/store/modules/list.js +++ b/src/renderer/store/modules/list.js @@ -54,8 +54,8 @@ const actions = { // mitations const mutations = { initList(state, { defaultList, loveList, userList }) { - if (defaultList != null) state.defaultList.list = defaultList.list - if (loveList != null) state.loveList.list = loveList.list + if (defaultList != null) Object.assign(state.defaultList, { list: defaultList.list, location: defaultList.location }) + if (loveList != null) Object.assign(state.loveList, { list: loveList.list, location: loveList.location }) if (userList != null) state.userList = userList allListInit(state.defaultList, state.loveList, state.userList) state.isInitedList = true From 5949e8fb3fc84b23000884e71e95c7c1c9e9a4f0 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Mon, 28 Sep 2020 01:33:06 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=88=91=E7=9A=84?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=BB=9A=E5=8A=A8=E6=9D=A1=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E4=BF=9D=E5=AD=98=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/views/List.vue | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/renderer/views/List.vue b/src/renderer/views/List.vue index 79b75cba..ea07d804 100644 --- a/src/renderer/views/List.vue +++ b/src/renderer/views/List.vue @@ -86,7 +86,6 @@ export default { // isShowEditBtn: false, isShowDownloadMultiple: false, delayShow: false, - routeLeaveLocation: null, isShowListAdd: false, isShowListAddMultiple: false, delayTimeout: null, @@ -289,18 +288,14 @@ export default { // }, beforeRouteLeave(to, from, next) { this.clearDelayTimeout() - this.routeLeaveLocation = (this.list.length && this.$refs.dom_scrollContent.scrollTop) || 0 + this.setListScroll({ id: this.listId, location: (this.list.length && this.$refs.dom_scrollContent.scrollTop) || 0 }) next() }, created() { this.listId = this.$route.query.id || this.defaultList.id this.setPrevSelectListId(this.listId) - this.handleScroll = throttle(e => { - if (this.routeLeaveLocation) { - this.setListScroll({ id: this.listId, location: this.routeLeaveLocation }) - } else { - this.setListScroll({ id: this.listId, location: e.target.scrollTop }) - } + this.handleSaveScroll = throttle((listId, location) => { + this.setListScroll({ id: listId, location }) }, 1000) this.listenEvent() }, @@ -310,6 +305,7 @@ export default { }, beforeDestroy() { this.unlistenEvent() + this.setListScroll({ id: this.listId, location: (this.list.length && this.$refs.dom_scrollContent.scrollTop) || 0 }) }, methods: { ...mapMutations(['setPrevSelectListId']), @@ -369,6 +365,9 @@ export default { this.restoreScroll(this.$route.query.scrollIndex, false) } }, + handleScroll(e) { + this.handleSaveScroll(this.listId, e.target.scrollTop) + }, clearDelayTimeout() { if (this.delayTimeout) { clearTimeout(this.delayTimeout) From 66f17cf05be5cf585b5ebf27ead72a85cc225255 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Mon, 28 Sep 2020 01:33:15 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=9B=B4=E6=96=B0log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index 9a53de65..a214d4bc 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -1,3 +1,10 @@ +### 优化 + +- 优化我的列表滚动条位置的保存逻辑 + + ### 修复 -- 修复某些情况下桌面歌词不会播放的问题 +- 修复初始化搜索历史列表功能 +- 修复重启软件后试听列表与收藏列表无法恢复上次的滚动位置的问题 +