Commit 8e439087 authored by 王玉鑫's avatar 王玉鑫

fix: 首页播报元素无限增长修正

parent 8b6455f5
...@@ -90,8 +90,10 @@ ...@@ -90,8 +90,10 @@
<img src="@/assets/images/icon-volume.png" class="h-4 w-4" alt="" /> <img src="@/assets/images/icon-volume.png" class="h-4 w-4" alt="" />
<div class="relative h-5 w-[180px] overflow-hidden"> <div class="relative h-5 w-[180px] overflow-hidden">
<ul ref="marquee" class="ml-2 h-5 w-[200px] overflow-hidden text-sm text-white"> <ul ref="marquee" class="ml-2 h-5 w-[200px] overflow-hidden text-sm text-white">
<template v-for="i of 4" :key="i">
<li class="name">园区数量 {{ homePageData?.parkInfoCount }}</li> <li class="name">园区数量 {{ homePageData?.parkInfoCount }}</li>
<li class="name">服务企业 {{ homePageData?.enterpriseCount }}</li> <li class="name">服务企业 {{ homePageData?.enterpriseCount }}</li>
</template>
</ul> </ul>
</div> </div>
</div> </div>
...@@ -99,7 +101,7 @@ ...@@ -99,7 +101,7 @@
<img src="@/assets/images/icon-volume.png" class="h-4 w-4" alt="" /> <img src="@/assets/images/icon-volume.png" class="h-4 w-4" alt="" />
<div style="width: calc(850px - 17px)" class="relative h-5 overflow-hidden text-sm"> <div style="width: calc(850px - 17px)" class="relative h-5 overflow-hidden text-sm">
<ul ref="marquee2" class="ml-2 h-5 w-[850px] overflow-hidden text-sm text-white"> <ul ref="marquee2" class="ml-2 h-5 w-[850px] overflow-hidden text-sm text-white">
<li v-for="item in homePageData.noticeList" :key="item.name" class="name"> <li v-for="(item, index) in formatedNoticeList" :key="index" class="name">
<p class="w-180 ell"> <p class="w-180 ell">
{{ item.name }} {{ item.name }}
</p> </p>
...@@ -384,6 +386,10 @@ const currentListType = computed(() => { ...@@ -384,6 +386,10 @@ const currentListType = computed(() => {
return config[activeTab.value]!; return config[activeTab.value]!;
}); });
const formatedNoticeList = computed(() => {
return Array.from({ length: 4 }, () => homePageData.value?.noticeList || []).flat();
});
const toList = (type: string = 'search') => { const toList = (type: string = 'search') => {
let name: RouteName = RouteName.developZoneList; let name: RouteName = RouteName.developZoneList;
let filterType: string = searchType.value; let filterType: string = searchType.value;
...@@ -470,7 +476,6 @@ const startMarquee = (lh: number, speed: number, delay: number, refName: string) ...@@ -470,7 +476,6 @@ const startMarquee = (lh: number, speed: number, delay: number, refName: string)
let t: any; let t: any;
const o = proxy.$refs[refName]; const o = proxy.$refs[refName];
o.innerHTML += o.innerHTML + o.innerHTML + o.innerHTML;
o.scrollTop = 0; o.scrollTop = 0;
function scrolling(fn: any) { function scrolling(fn: any) {
......
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