Browse Source

定时更改

9-plugin-notice
aBin 4 years ago
parent
commit
9d9ffc7b4a
  1. 10
      index.html

10
index.html

@ -74,7 +74,7 @@
that.getFirstAidRecord() that.getFirstAidRecord()
},5000) },5000)
} else { } else {
alert(msg || '获取失败') console.log('msg: ', msg);
} }
}); });
}, },
@ -107,7 +107,6 @@
that.setDate(data.content) that.setDate(data.content)
} }
} else { } else {
// alert(msg || '查询失败')
console.log('msg: ', msg); console.log('msg: ', msg);
} }
}) })
@ -115,7 +114,9 @@
// 界面渲染 // 界面渲染
setDate(res) { setDate(res) {
this.content = res if(res !== this.content){
this.content = res
}
var textLeft = 0 var textLeft = 0
var oTxt = this.dom.querySelector('.txt'); //获取标签 var oTxt = this.dom.querySelector('.txt'); //获取标签
if(this.divWidth === 0) { if(this.divWidth === 0) {
@ -134,11 +135,10 @@
var leftPX = textLeft + 'px'; var leftPX = textLeft + 'px';
oTxt.style.transform = `translate3d(${leftPX},0,0)` oTxt.style.transform = `translate3d(${leftPX},0,0)`
} else { } else {
clearInterval(timeId); clearInterval(this.timeId);
} }
},20) },20)
} }
} }
} }
p1419895620596146176.init() p1419895620596146176.init()

Loading…
Cancel
Save