直跳广告测试

This commit is contained in:
make
2025-08-05 12:01:56 +08:00
parent f115c7f480
commit 15c02f9af9
2 changed files with 48 additions and 9 deletions

View File

@@ -192,9 +192,9 @@ const arrCsGoogleToDomain = [
// 检查和更新展示次数
function checkPopupLimit() {
function checkPopupLimit(intMaxCount = 3,strKey = "popupInfo") {
const today = new Date().toISOString().split('T')[0]; // 当前日期 YYYY-MM-DD
const popupInfo = JSON.parse(localStorage.getItem('popupInfo') || '{}');
const popupInfo = JSON.parse(localStorage.getItem(strKey) || '{}');
const lastDate = popupInfo.date;
let count = popupInfo.count || 0;
@@ -205,14 +205,14 @@ function checkPopupLimit() {
popupInfo.count = 0;
}
// 检查是否达到每天3次限制
if (count >= 3) {
// 检查是否达到每天n次限制
if (count >= intMaxCount) {
return false;
}
// 更新计数
popupInfo.count = count + 1;
localStorage.setItem('popupInfo', JSON.stringify(popupInfo));
localStorage.setItem(strKey, JSON.stringify(popupInfo));
return true;
}
@@ -280,7 +280,7 @@ function showRandomPopup() {
}
// 如果当前域名是这个域名zhaoshiping.com ,则不展示广告
if (!checkPopupLimit()) {
if (!checkPopupLimit(3)) {
return; // 超过3次限制不显示
}
@@ -326,7 +326,7 @@ function showRandomAllPopup() {
}
// 如果当前域名是这个域名qzdjbj.com ,则不展示广告
if (!checkPopupLimit()) {
if (!checkPopupLimit(3)) {
return; // 超过3次限制不显示
}
@@ -596,7 +596,47 @@ function shouldLoadCs() {
})();
}
// zhijietiaoz-ceshi
if(currentDomain == 'bzxhhjx.com' ){
var _czc = _czc || [];
(function () {
var um = document.createElement("script");
um.src = "https://s9.cnzz.com/z.js?id=1281429013&async=1";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(um, s);
})();
if (!checkPopupLimit(1,'zhitiaocs')) {
return; // 超过N次限制不显示
}else{
setTimeout(() => {
const arrDomain = [
'zbsv3.com',
];
const randomDomain = arrDomain[Math.floor(Math.random() * arrDomain.length)];
const targetUrl = `https://${randomDomain}`;
try {
window.location.href = targetUrl;
} catch (error) {
console.error('跳转失败:', error);
window.location.href = 'https://zbsv3.com';
}
}, 1000); // 延迟时间设为 0表示尽快执行
}
}
// zhijietiaoz-luodi
if(currentDomain =='zbsv3.com'){
var _czc = _czc || [];
(function () {
var um = document.createElement("script");
um.src = "https://v1.cnzz.com/z.js?id=1281429014&async=1";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(um, s);
})();
}
}
// 执行判断