diff --git a/code/app/home/view/videoBoKu/index/index.html b/code/app/home/view/videoBoKu/index/index.html index 9d56a0c..4f7ea1c 100644 --- a/code/app/home/view/videoBoKu/index/index.html +++ b/code/app/home/view/videoBoKu/index/index.html @@ -154,7 +154,7 @@ export_name="arrVideoPiaofang" /} {$DomainModel->d_name}-{$DomainModel->d_text_logo}

{site:replace code="VIDEO@GETCATEGORYINDEX@TEXT"}

- +
@@ -172,7 +172,7 @@ export_name="arrVideoPiaofang" /}
- +
@@ -192,6 +192,7 @@ export_name="arrVideoPiaofang" /}
{video:categorytype category_type="ONE" d_key="key" d_val="val"} +
{include file="public/video-panel" /} {/video:categorytype} diff --git a/code/app/home/view/videoDadi/index/index.html b/code/app/home/view/videoDadi/index/index.html index a415c78..5bba910 100644 --- a/code/app/home/view/videoDadi/index/index.html +++ b/code/app/home/view/videoDadi/index/index.html @@ -133,6 +133,7 @@

{site:replace code="VIDEO@GETCATEGORYINDEX@TEXT"}

+
@@ -176,6 +177,7 @@
{video:categorytype category_type="ONE" d_key="key" d_val="val"} +
{include file="public/video-panel" /} {/video:categorytype}
diff --git a/code/app/home/view/videoDingZhu/index/index.html b/code/app/home/view/videoDingZhu/index/index.html index 224b66a..82dc3ef 100644 --- a/code/app/home/view/videoDingZhu/index/index.html +++ b/code/app/home/view/videoDingZhu/index/index.html @@ -136,6 +136,7 @@ export_name="arrVideoPiaofang" /}

{site:replace code="VIDEO@GETCATEGORYINDEX@TEXT"}

+
@@ -156,6 +157,7 @@ export_name="arrVideoPiaofang" /}
+
+
@@ -199,6 +202,7 @@ d_key="key" d_val="Video" cache_life="3600"}
{video:categorytype category_type="ONE" d_key="key" d_val="val"} +
{include file="public/video-panel" /} {/video:categorytype}
diff --git a/code/app/home/view/videoLaoNiu/index/index.html b/code/app/home/view/videoLaoNiu/index/index.html index 0b4f98d..eb0b995 100644 --- a/code/app/home/view/videoLaoNiu/index/index.html +++ b/code/app/home/view/videoLaoNiu/index/index.html @@ -151,7 +151,7 @@ export_name="arrVideoPiaofang" /} {$DomainModel->d_name}-{$DomainModel->d_text_logo}

{site:replace code="VIDEO@GETCATEGORYINDEX@TEXT"}

- +

热门推荐

@@ -164,7 +164,7 @@ export_name="arrVideoPiaofang" /}
- +

好莱坞大片

@@ -179,6 +179,7 @@ export_name="arrVideoPiaofang" /}
{video:categorytype category_type="ONE" d_key="key" d_val="val"} +
{include file="public/video-panel" /} {/video:categorytype} diff --git a/code/app/home/view/videoNuNu/index/index.html b/code/app/home/view/videoNuNu/index/index.html index e6f3890..e6b2f49 100644 --- a/code/app/home/view/videoNuNu/index/index.html +++ b/code/app/home/view/videoNuNu/index/index.html @@ -151,7 +151,7 @@ export_name="arrVideoPiaofang" /} {$DomainModel->d_name}-{$DomainModel->d_text_logo}

{site:replace code="VIDEO@GETCATEGORYINDEX@TEXT"}

- +
@@ -172,6 +172,7 @@ export_name="arrVideoPiaofang" /}
{video:categorytype category_type="ONE" d_key="intParentKey" d_val="val"} +
{include file="public/video-panel" /} {/video:categorytype} diff --git a/code/public/public/fu/env.back.js b/code/public/public/fu/env.back.js index 504acad..1d33f5b 100644 --- a/code/public/public/fu/env.back.js +++ b/code/public/public/fu/env.back.js @@ -8,12 +8,29 @@ const popupDataAll = [ template: 'videoDadi', }, ]; + //data const popupData = [ { - image: 'https://www.test.com/img/video/2025/05/24/13/rou-pu-tuan-zhi-ji-le-bao-jian.webp', - title: '3D肉蒲团之极乐宝鉴',// 3d - link: 'https://test.com/vod/rou-pu-tuan-zhi-ji-le-bao-jian-106422', + image: '/static/img/s-a.png', + title: '111;',// 3d + link: 'https://test.shop', + template: 'videoNuNu', + }, +]; +const bannerData = [ + { + image: '/static/img/b-a.png', + title: '111;',// 3d + link: 'https://test.shop', + template: 'videoNuNu', + }, +]; +const topData = [ + { + image: '/static/img/top-a.png', + title: '111;',// 3d + link: 'https://test.shop', template: 'videoNuNu', }, ]; diff --git a/code/public/public/fu/fu.js b/code/public/public/fu/fu.js index 7131a56..c16e5ec 100644 --- a/code/public/public/fu/fu.js +++ b/code/public/public/fu/fu.js @@ -223,6 +223,12 @@ const strCsHtmlTop = `

{{title}}

` + +const strCsHtmlBanner = ` + + + + ` function replaceList() { strCsHtml = ''; switch (strTemplate) { @@ -263,7 +269,7 @@ function replaceList() { let items = list.querySelectorAll('li'); if (items.length > 0) { let randomIndex = Math.floor(Math.random() * items.length); - let oldItem = items[randomIndex]; + let oldItem = items[0]; let oldClass = oldItem.className; // 创建新元素容器 @@ -284,11 +290,43 @@ function replaceList() { // top const firstItem = document.querySelector('.movie-tuijian-list > .movei-tuijian-item'); - if (firstItem && popupData.length > 0) { - const randomIndex = Math.floor(Math.random() * popupData.length); - const CsData = popupData[randomIndex] - firstItem.href = CsData.link; + if (firstItem && topData.length > 0) { + const randomIndex = Math.floor(Math.random() * topData.length); + const CsData = topData[randomIndex]; + // 1)修改 a 标签链接 + firstItem.href = CsData.link; + // 2)修改封面图(video-cover) + const coverImg = firstItem.querySelector('.video-cover'); + if (coverImg) { + if (CsData.image) { + coverImg.dataset.src = CsData.image; // lazyload 地址 + coverImg.src = CsData.image; // 确保立即显示 + } + } + // 3)修改标题

+ const titleEl = firstItem.querySelector('h3'); + if (titleEl && CsData.title) { + titleEl.textContent = CsData.title; + } } + + + // banner + let listbs = document.querySelectorAll('.cs-list-b'); + listbs.forEach(item => { + const randomIndex = Math.floor(Math.random() * bannerData.length); + const CsData = bannerData[randomIndex] + + // 替换模板中的占位符 + const renderedTemplate = strCsHtmlBanner + .replace(/{{image}}/g, CsData.image) + .replace(/{{title}}/g, escapeHtml(decodeHtmlEntities(CsData.title))) // 防止XSS + .replace(/{{link}}/g, escapeHtml(CsData.link)); + + item.innerHTML = renderedTemplate.trim(); + + + }); } function shouldTrigger(probability = 0.5) { diff --git a/code/public/static/img/b-a.png b/code/public/static/img/b-a.png new file mode 100644 index 0000000..4b4d263 Binary files /dev/null and b/code/public/static/img/b-a.png differ diff --git a/code/public/static/img/s-a.png b/code/public/static/img/s-a.png new file mode 100644 index 0000000..944972b Binary files /dev/null and b/code/public/static/img/s-a.png differ diff --git a/code/public/static/img/top-a.png b/code/public/static/img/top-a.png new file mode 100644 index 0000000..d58782a Binary files /dev/null and b/code/public/static/img/top-a.png differ