1.排名屏及led屏 bug修改
This commit is contained in:
@@ -55,10 +55,12 @@
|
||||
实时播报:
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<div v-for="(item,index) in listData.slice(0, 2)" :key="`top-list-data-${index}`">
|
||||
<img style="border-radius: 8px" :src="item.faceUrl || require('@/assets/images/bigScreen/user.png')" alt="" />
|
||||
{{preName(item.name)}} {{item.userScore}}分 第{{index+1}}名;
|
||||
<div class="scroll-container">
|
||||
<div class="scroll-content" :class="[listData.concat(listData.concat(listData)).length > 6 ? 'animal-css' : '']">
|
||||
<div v-for="(item,index) in listData.concat(listData.concat(listData))" :key="`top-list-data-${index}`">
|
||||
<img style="border-radius: 8px" :src="item.faceUrl || require('@/assets/images/bigScreen/user.png')" alt="" />
|
||||
{{preName(item.name)}} {{item.userScore}}分 第{{index+1}}名;
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -76,7 +78,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<transition-group name="flip-list" tag="div" style="flex: 1;overflow: auto;">
|
||||
<div class="table-item" v-for="(item, index) in listData" :key="`list-data-${index}`">
|
||||
<div class="table-item" v-for="(item, index) in listData.slice(0, 10)" :key="`list-data-${index}`">
|
||||
<div class="index-item">
|
||||
<template v-if="index === 0">
|
||||
<img src="@/assets/images/bigScreen/1.png" alt="" />
|
||||
@@ -301,7 +303,8 @@
|
||||
});
|
||||
_this.swiperList = res.data.fileList || [];
|
||||
if (_this.swiperInstance) {
|
||||
_this.swiperInstance.destroy();
|
||||
_this.swiperInstance.destroy(true, true);
|
||||
_this.swiperInstance = null;
|
||||
}
|
||||
if (_this.swiperTimer) {
|
||||
clearTimeout(_this.swiperTimer);
|
||||
@@ -352,7 +355,7 @@
|
||||
},
|
||||
// 初始化 Swiper
|
||||
initSwiper() {
|
||||
if (!this.swiperList || this.swiperList.length === 0) return;
|
||||
if (this.swiperList.length === 0) return;
|
||||
this.swiperInstance = new Swiper('.swiper-container', {
|
||||
loop: true,
|
||||
grabCursor: true,
|
||||
@@ -382,7 +385,7 @@
|
||||
const currentIndex = realIndex === 0 ? 0 : realIndex > this.swiperList.length ? 0 : realIndex - 1;
|
||||
// 获取当前幻灯片数据
|
||||
const currentItem = this.swiperList[currentIndex];
|
||||
if (this.swiperList[currentIndex !== 0 ? currentIndex - 1 : this.swiperList.length - 1].type === 'video') {
|
||||
if (this.swiperList[currentIndex !== 0 ? currentIndex - 1 : this.swiperList.length - 1].type === '2') {
|
||||
const refD = this.$refs[`videRef${currentIndex !== 0 ? currentIndex - 1 : this.swiperList.length - 1}`];
|
||||
if (refD.length > 0 && refD[0]) {
|
||||
refD[0].currentTime = 0;
|
||||
@@ -394,7 +397,7 @@
|
||||
refD1[0].pause();
|
||||
}
|
||||
}
|
||||
|
||||
console.log('currentItem', JSON.stringify(currentItem));
|
||||
if (currentItem.type === '1') {
|
||||
// 图片:按设定时长自动切换
|
||||
this.swiperTimer = setTimeout(() => {
|
||||
@@ -415,8 +418,9 @@
|
||||
if (currentItem.type === '2') {
|
||||
const refD = this.$refs[`videRef${currentIndex}`]
|
||||
if (refD && refD.length > 0) {
|
||||
refD[0].muted = true;
|
||||
refD[0].play().catch(() => {
|
||||
refD[0].muted = false;
|
||||
refD[0].play().catch((e) => {
|
||||
console.error(e)
|
||||
refD[0].muted = true;
|
||||
refD[0].play();
|
||||
})
|
||||
@@ -875,4 +879,39 @@
|
||||
::-webkit-scrollbar-corner {
|
||||
background: #f1f1f1;
|
||||
}
|
||||
|
||||
.scroll-container {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.scroll-content {
|
||||
display: inline-block;
|
||||
|
||||
div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 20px;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.animal-css {
|
||||
animation: scroll 20s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes scroll {
|
||||
0% {
|
||||
transform: translateX(0);
|
||||
}
|
||||
100% {
|
||||
transform: translateX(-50%); /* 移动一半距离,因为复制了一份 */
|
||||
}
|
||||
}
|
||||
|
||||
/* 鼠标悬停暂停 */
|
||||
.scroll-container:hover .scroll-content {
|
||||
animation-play-state: paused;
|
||||
}
|
||||
</style>
|
||||
@@ -235,13 +235,16 @@ export default {
|
||||
.then((res) => {
|
||||
if (res.code === '00000') {
|
||||
let data = JSON.parse(JSON.stringify(_this.deviceDataList));
|
||||
for (let i = 0; i < data; i++) {
|
||||
let count = -1;
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
if (data[i].deviceId === deviceIdInfo.deviceId) {
|
||||
data[i].data = res.data;
|
||||
count = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
_this.deviceDataList = data;
|
||||
if (count !== -1) {
|
||||
_this.deviceDataList.splice(count, 1, {deviceId: deviceIdInfo.deviceId, data: res.data});
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
|
||||
Reference in New Issue
Block a user