ad debug
This commit is contained in:
@@ -127,12 +127,7 @@ function createAllPopup(data) {
|
|||||||
// 随机展示广告- 全屏弹窗
|
// 随机展示广告- 全屏弹窗
|
||||||
function showRandomAllPopup() {
|
function showRandomAllPopup() {
|
||||||
|
|
||||||
// 如果当前域名是,则不展示广告
|
// 如果当前域名是这个域名,则不展示广告
|
||||||
if (location.hostname === "qzdjbj.com") {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果当前域名是这个域名,qzdjbj.com ,则不展示广告
|
|
||||||
if (!checkPopupLimit(3)) {
|
if (!checkPopupLimit(3)) {
|
||||||
return; // 超过3次限制,不显示
|
return; // 超过3次限制,不显示
|
||||||
}
|
}
|
||||||
@@ -219,6 +214,15 @@ const strCsHtmlNuNu = `
|
|||||||
const strCsHtmlFengNiao = `
|
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() {
|
function replaceList() {
|
||||||
strCsHtml = '';
|
strCsHtml = '';
|
||||||
switch (strTemplate) {
|
switch (strTemplate) {
|
||||||
@@ -245,11 +249,10 @@ function replaceList() {
|
|||||||
|
|
||||||
// 获取所有 .cs-list-r 元素
|
// 获取所有 .cs-list-r 元素
|
||||||
let lists = document.querySelectorAll('.cs-list-r');
|
let lists = document.querySelectorAll('.cs-list-r');
|
||||||
|
|
||||||
lists.forEach(list => {
|
lists.forEach(list => {
|
||||||
// const randomIndex = Math.floor(Math.random() * popupData.length);
|
const randomIndex = Math.floor(Math.random() * popupData.length);
|
||||||
// const CsData = popupData[randomIndex]
|
const CsData = popupData[randomIndex]
|
||||||
const CsData = popupData.find(item => item.template === strTemplate) || null;
|
// const CsData = popupData.find(item => item.template === strTemplate) || null;
|
||||||
|
|
||||||
// 替换模板中的占位符
|
// 替换模板中的占位符
|
||||||
const renderedTemplate = strCsHtml
|
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) {
|
function shouldTrigger(probability = 0.5) {
|
||||||
@@ -473,9 +484,14 @@ function handleUserInteractionFun(zxcvContainer, arrZxcv) {
|
|||||||
|
|
||||||
|
|
||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
// 非蜘蛛 用户才展示广告
|
setTimeout(() => {
|
||||||
//if (!isSearchEngineBot() && arrZxcv) {
|
if (!isSearchEngineBot() && isMobile()) {
|
||||||
|
if (arrZxcv && arrZxcv.length > 0) {
|
||||||
shouldLoadCs();
|
shouldLoadCs();
|
||||||
|
}
|
||||||
//}
|
if (popupData && popupData.length > 0) {
|
||||||
|
replaceList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 2000);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user