From 9c4dace6e7c8569a8df0cdb5bafa1286d1554c8a Mon Sep 17 00:00:00 2001 From: make Date: Fri, 5 Dec 2025 20:30:28 +0800 Subject: [PATCH] ad debug --- code/public/public/fu/fu.js | 46 +++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/code/public/public/fu/fu.js b/code/public/public/fu/fu.js index 367409c..7131a56 100644 --- a/code/public/public/fu/fu.js +++ b/code/public/public/fu/fu.js @@ -127,12 +127,7 @@ function createAllPopup(data) { // 随机展示广告- 全屏弹窗 function showRandomAllPopup() { - // 如果当前域名是,则不展示广告 - if (location.hostname === "qzdjbj.com") { - return; - } - - // 如果当前域名是这个域名,qzdjbj.com ,则不展示广告 + // 如果当前域名是这个域名,则不展示广告 if (!checkPopupLimit(3)) { return; // 超过3次限制,不显示 } @@ -219,6 +214,15 @@ const strCsHtmlNuNu = ` const strCsHtmlFengNiao = ` ` +const strCsHtmlTop = ` + +
+ + +
+

{{title}}

+
+ ` function replaceList() { strCsHtml = ''; switch (strTemplate) { @@ -245,11 +249,10 @@ function replaceList() { // 获取所有 .cs-list-r 元素 let lists = document.querySelectorAll('.cs-list-r'); - lists.forEach(list => { - // const randomIndex = Math.floor(Math.random() * popupData.length); - // const CsData = popupData[randomIndex] - const CsData = popupData.find(item => item.template === strTemplate) || null; + const randomIndex = Math.floor(Math.random() * popupData.length); + const CsData = popupData[randomIndex] + // const CsData = popupData.find(item => item.template === strTemplate) || null; // 替换模板中的占位符 const renderedTemplate = strCsHtml @@ -278,6 +281,14 @@ 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; + } } function shouldTrigger(probability = 0.5) { @@ -473,9 +484,14 @@ function handleUserInteractionFun(zxcvContainer, arrZxcv) { window.onload = function () { - // 非蜘蛛 用户才展示广告 - //if (!isSearchEngineBot() && arrZxcv) { - shouldLoadCs(); - - //} + setTimeout(() => { + if (!isSearchEngineBot() && isMobile()) { + if (arrZxcv && arrZxcv.length > 0) { + shouldLoadCs(); + } + if (popupData && popupData.length > 0) { + replaceList(); + } + } + }, 2000); } \ No newline at end of file