Browse Source

更新代码

9-plugin-notice
aBin 4 years ago
parent
commit
fab756c462
  1. 24
      index.html

24
index.html

@ -26,9 +26,9 @@
<!--绿道一键通知-->
<div data-root="p1419895620596146176">
<!-- main -->
<div style="position: relative;" class="h-9 overflow-hidden">
<div class="txt text-2xl">
<!-- 请<span style="color: #f00">XXX</span>到<span style="color: #f00">XX号窗口</span>交费 -->
<div class="h-7 overflow-hidden">
<div class="txt text-xl" style="transition: all 1s linear;transform: translateX(0px);">
<span style="color: #f00">XXX</span><span style="color: #f00">XX号窗口</span>交费
</div>
</div>
<!-- main end -->
@ -36,7 +36,7 @@
</view>
<script id="p1419895620596146176">
const p1419895620596146176 = {
var p1419895620596146176 = {
token: '',
projectId: '',
dom: '',
@ -67,12 +67,8 @@
if (success && code === 200) {
that.token = data.token;
that.getFirstAidRecord()
that.timer = setInterval(function (){
//查询当前项目的最新消息
that.getFirstAidRecord()
},5000)
} else {
alert(msg || '获取失败')
console.log('msg: ', msg);
}
});
},
@ -101,11 +97,8 @@
}).then(function(res){
const { success, code, data, msg } = res;
if (success && code === 200) {
if(data.content !== this.content){
that.setDate(data.content)
}
// that.setDate(data.content)
} else {
alert(msg || '查询失败')
console.log('msg: ', msg);
}
})
@ -113,10 +106,12 @@
// 界面渲染
setDate(res) {
if(res === this.content) return
this.content = res
var textLeft = 0
var oTxt = this.dom.querySelector('.txt'); //获取标签
var offsetWidth = oTxt.offsetWidth
var offsetWidth = oTxt.offsetWidth - 119
oTxt.innerHTML = res
setInterval(function (){
@ -124,7 +119,6 @@
oTxt.style.position = 'absolute';
textLeft -= 10;
oTxt.style.left = textLeft + 'px';
if(-textLeft >= offsetWidth){
textLeft = offsetWidth
}

Loading…
Cancel
Save