diff --git a/dist/index.html b/dist/index.html index a7ca342..3787901 100644 --- a/dist/index.html +++ b/dist/index.html @@ -6,7 +6,7 @@ demo - +
@@ -14,5 +14,5 @@
- + \ No newline at end of file diff --git a/dist/index_demo.html b/dist/index_demo.html index 0425625..32a37b7 100644 --- a/dist/index_demo.html +++ b/dist/index_demo.html @@ -8,7 +8,7 @@ - +
@@ -18,5 +18,5 @@ - + \ No newline at end of file diff --git a/info.json b/info.json index 0a7dfd7..5e2aac4 100755 --- a/info.json +++ b/info.json @@ -5,9 +5,9 @@ "title": "sina_wave", "ambName": "波浪", "github": "https://github.com/o2team-ambient/sina_wave", - "demoSnippet": "\n
\n \n
\n ", - "controlUrl": "//storage.jd.com/ambient/control-sina_wave.js?t=1569398853000", - "configUrl": "//storage.jd.com/ambient/config-sina_wave.js?t=1569398853000", + "demoSnippet": "\n
\n \n
\n ", + "controlUrl": "//storage.jd.com/ambient/control-sina_wave.js?t=1570616873000", + "configUrl": "//storage.jd.com/ambient/config-sina_wave.js?t=1570616873000", "placeholderImg": "//storage.jd.com/ambient/sina_wave_placeholder.png?t=1554260508000", "gifImg": "//storage.jd.com/ambient/sina_wave_motion.gif?t=1553781489000", "spriteImg": "//storage.jd.com/ambient/sina_wave_sprite.png?t=1554260508000" diff --git a/src/js/utils/controller.js b/src/js/utils/controller.js index 33ddb0a..93807c6 100755 --- a/src/js/utils/controller.js +++ b/src/js/utils/controller.js @@ -18,6 +18,7 @@ const isAmbientPlat = getParameterByName('platform') === '1' // 是否平台环 class Controller { ts + msgTs constructor () { this.config = window[O2_AMBIENT_CONFIG] || {} @@ -45,8 +46,12 @@ class Controller { bindMsg () { window.addEventListener('message', (msg) => { if (msg.data.type !== 'reset') return - window[O2_AMBIENT_CONFIG] = Object.assign(window[O2_AMBIENT_CONFIG], msg.data.data) - this.resetCanvas() + if (this.msgTs) return + this.msgTs = setTimeout(() => { + this.msgTs = null + window[O2_AMBIENT_CONFIG] = Object.assign(window[O2_AMBIENT_CONFIG], msg.data.data) + this.resetCanvas() + }, 200) }) }