From 05e6e3702139e68d4685ba129e9fb3fa395b72a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Fri, 28 Dec 2018 22:38:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=9F=B3=E4=B9=90=E6=89=AB?= =?UTF-8?q?=E6=8F=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/modules/local.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/js/modules/local.js b/js/modules/local.js index 9a5dbe1..bf67ed4 100644 --- a/js/modules/local.js +++ b/js/modules/local.js @@ -116,10 +116,12 @@ export default Anot({ } }, - __checkSong__() { + __checkSong__(el) { let song = this.__LIST__.pop() if (!song) { + el.textContent = '重新扫描' + el = null if (this.__NEW_NUM__ > 0) { dbCache = LS.getAll() this.list.clear() @@ -139,11 +141,11 @@ export default Anot({ Anot.nextTick(() => { let name = path.basename(song) if (name.startsWith('.')) { - return this.__checkSong__() + return this.__checkSong__(el) } let hash = crypto.md5Sign(song) if (LS.get(hash)) { - return this.__checkSong__() + return this.__checkSong__(el) } this.__NEW_NUM__++ ID3(song).then(tag => { @@ -155,11 +157,11 @@ export default Anot({ path: `file://${song}`, duration: tag.duration }) - this.__checkSong__() + this.__checkSong__(el) }) }) }, - refresh() { + refresh(ev) { if (this.__load__) { return } @@ -167,7 +169,8 @@ export default Anot({ this.__load__ = layer.load(4) this.__LIST__ = fs.ls('/Volumes/extends/music') this.__NEW_NUM__ = 0 - this.__checkSong__() + ev.target.textContent = '正在扫描, 请稍候...' + this.__checkSong__(ev.target) } } }