This commit is contained in:
make
2025-12-05 20:30:28 +08:00
parent 10d6acd627
commit 9c4dace6e7

View File

@@ -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 = `
<a class="movei-tuijian-item" href="{{link}}">
<div>
<img src="{{image}}" class="video-cover">
<img src="https://abc.com/static/img/play.png" class="video-play-btn" alt="">
</div>
<h3>{{title}}</h3>
</a>
`
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);
}