Commit b3468d79 authored by Facius's avatar Facius

improvement: 通知条初始时间优化

parent 8be141fe
...@@ -119,7 +119,7 @@ export default { ...@@ -119,7 +119,7 @@ export default {
}, },
created() { created() {
this.initData() this.initData()
this.beginNotic() this.beginNotic(this.$u.random(1, 600) * 1000)
}, },
methods: { methods: {
initData() { initData() {
...@@ -136,15 +136,14 @@ export default { ...@@ -136,15 +136,14 @@ export default {
this.defaultUrl + (a2 > 9 ? 'a' : 'a0') + String(a2) + '.jpeg', this.defaultUrl + (a2 > 9 ? 'a' : 'a0') + String(a2) + '.jpeg',
this.defaultUrl + (a3 > 9 ? 'a' : 'a0') + String(a3) + '.jpeg', this.defaultUrl + (a3 > 9 ? 'a' : 'a0') + String(a3) + '.jpeg',
] ]
// this.list = [this.noticeText] // this.list = [this.noticeText]
setInterval(() => { setInterval(() => {
this.produceTime += this.duration this.produceTime += this.duration
}, this.duration) }, this.duration)
}, },
beginNotic() { beginNotic(time) {
var after = this.$u.random(1, 600) * 1000 var after = this.$u.random(1, 600) * 1000
this.produceTime = 1000 this.produceTime = time || 1000
setTimeout(() => { setTimeout(() => {
this.produceData() this.produceData()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment