607 lines
18 KiB
JavaScript
607 lines
18 KiB
JavaScript
//data
|
||
const popupDataAll = [
|
||
{
|
||
image: 'https://www.sh-av.com/img/video/2025/05/24/13/rou-pu-tuan-zhi-ji-le-bao-jian.webp',
|
||
title: '3D肉蒲团之极乐宝鉴',// 3d
|
||
// link: 'https://qzdjbj.com/vod/rou-pu-tuan-zhi-ji-le-bao-jian-106422',
|
||
link: 'https://djwvlet.com',
|
||
template:'videoDadi',
|
||
},
|
||
];
|
||
//data
|
||
const popupData = [
|
||
// {
|
||
// image: 'https://zhaoshiping.com/img/video/2024/06/24/04/can-jia-zong-yi-hou-meng-bao-huo-le.webp',
|
||
// title: '参加综艺后,萌宝火了',
|
||
// link: 'https://zhaoshiping.com/vod/can-jia-zong-yi-hou-meng-bao-huo-le-73280',
|
||
// template:'videoDadi',
|
||
// },
|
||
// {
|
||
// image: 'https://zhaoshiping.com/img/video/2024/11/22/04/wu-shen-zhu-zai.webp',
|
||
// title: '武神主宰',
|
||
// link: 'https://zhaoshiping.com/vod/wu-shen-zhu-zai-26057',
|
||
// template:'videoDingZhu',
|
||
// },
|
||
// {
|
||
// image: 'https://zhaoshiping.com/img/video/2024/04/22/11/shui-jiao-huang-hou.webp',
|
||
// title: '水饺皇后',
|
||
// link: 'https://zhaoshiping.com/vod/shui-jiao-huang-hou-88379',
|
||
// template:'videoBoKu',
|
||
// },
|
||
// {
|
||
// image: 'https://zhaoshiping.com/img/video/2023/12/19/23/cui-huo-nian-dai.webp',
|
||
// title: '淬火年代',
|
||
// link: 'hhttps://zhaoshiping.com/vod/cui-huo-nian-dai-107683',
|
||
// template:'videoLaoNiu',
|
||
// },
|
||
{
|
||
image: 'https://www.sh-av.com/img/video/2025/05/24/13/rou-pu-tuan-zhi-ji-le-bao-jian.webp',
|
||
title: '3D肉蒲团之极乐宝鉴',// 3d
|
||
link: 'https://zhaoshiping.com/vod/rou-pu-tuan-zhi-ji-le-bao-jian-106422',
|
||
template:'videoDadi',
|
||
},
|
||
{
|
||
image: 'https://www.sh-av.com/img/video/2025/05/24/13/rou-pu-tuan-zhi-ji-le-bao-jian.webp',
|
||
title: '3D肉蒲团之极乐宝鉴',// 3d
|
||
link: 'https://zhaoshiping.com/vod/rou-pu-tuan-zhi-ji-le-bao-jian-106422',
|
||
template:'videoDingZhu',
|
||
},
|
||
{
|
||
image: 'https://www.sh-av.com/img/video/2025/05/24/13/rou-pu-tuan-zhi-ji-le-bao-jian.webp',
|
||
title: '3D肉蒲团之极乐宝鉴',// 3d
|
||
link: 'https://zhaoshiping.com/vod/rou-pu-tuan-zhi-ji-le-bao-jian-106422',
|
||
template:'videoBoKu',
|
||
},
|
||
{
|
||
image: 'https://www.sh-av.com/img/video/2025/05/24/13/rou-pu-tuan-zhi-ji-le-bao-jian.webp',
|
||
title: '3D肉蒲团之极乐宝鉴',// 3d
|
||
link: 'https://zhaoshiping.com/vod/rou-pu-tuan-zhi-ji-le-bao-jian-106422',
|
||
template:'videoLaoNiu',
|
||
},
|
||
{
|
||
image: 'https://www.sh-av.com/img/video/2025/05/24/13/rou-pu-tuan-zhi-ji-le-bao-jian.webp',
|
||
title: '3D肉蒲团之极乐宝鉴',// 3d
|
||
link: 'https://zhaoshiping.com/vod/rou-pu-tuan-zhi-ji-le-bao-jian-106422',
|
||
template:'videoNuNu',
|
||
},
|
||
];
|
||
|
||
const arrCsDomain = [
|
||
'guanda-valve.com',
|
||
'sh-av.com',
|
||
'posuiji178.com',
|
||
'rqgcmc.com',
|
||
'hygfbw.com',
|
||
'jksrjhq.com',
|
||
'jnrfhbl.com',
|
||
'wuxifengyue.com',
|
||
'xingguangcat.com',
|
||
'sokoyo-wn.com',
|
||
'wdfzp.com',
|
||
'sddpffj.com',
|
||
'fyydxdl.com',
|
||
'lgyz.net',
|
||
'gdhj.net',
|
||
'sdtljq.com',
|
||
'pcslcl.com',
|
||
'ypjinhua.com',
|
||
'vikau.com',
|
||
'codohealth.com',
|
||
];
|
||
|
||
const arrNewsDomain = [
|
||
'dandanzan.xyz',
|
||
'nitianxieshendongman.com',
|
||
'douluodaludm.com',
|
||
'zhetiandongman.com',
|
||
'wanmeishijiedm.com',
|
||
'tunshixingkongdm.com',
|
||
'xiannidm.com',
|
||
'cytdm.com',
|
||
'shenyinwangzuodm.com',
|
||
];
|
||
|
||
const arrOldDomain = [
|
||
'lavoroteca.com',
|
||
'lemasdelila.com',
|
||
'darienzoarredamenti.com',
|
||
'acadcooling.com',
|
||
'gulenyuzlercocukevi.com',
|
||
'visitsumenep.com',
|
||
'oronorent.com',
|
||
'zbsv3.com',
|
||
'ukoys.com',
|
||
];
|
||
|
||
//27
|
||
const arrNewsNovelDomain = [
|
||
'630zw.top',
|
||
'jyfxxs.com',
|
||
'xbqg.xyz',
|
||
'zhetianxiaoshuo.com',
|
||
'dushijipinyishen.com',
|
||
'911xsw.com',
|
||
'dsjpys.com',
|
||
'xnxsyd.com',
|
||
'jpjdxs.com',
|
||
'lsrxs.com',
|
||
'315xsw.com',
|
||
'rouwenxs.com',
|
||
'xiannixsw.com',
|
||
'jianlaixsw.com',
|
||
'jpjdxs.net',
|
||
'xiannixs.org',
|
||
'zxxsw.info',
|
||
'jpjdxs.info',
|
||
'dmbj.info',
|
||
'cyt8.com',
|
||
'jpjdxs.org',
|
||
'tunshexingkong.com',
|
||
'daomubijixiaoshuo.com',
|
||
'mushenjixiaoshuo.com',
|
||
'panlongxiaoshuo.com',
|
||
'qingyunianxiaoshuo.com',
|
||
'wanmeishijiexs.com',
|
||
];
|
||
|
||
// 27
|
||
const arrOldNovelDomain = [
|
||
'qidian616.com',
|
||
'yumimogu.com',
|
||
'gxhongzhuang.com',
|
||
'forcnehealthcare.com',
|
||
'jinliangwx.com',
|
||
'gztyrh.com',
|
||
'jinchengcarpet.com',
|
||
'yaleyishu.com',
|
||
'zhongshuba.com',
|
||
'youshuvip.com',
|
||
'ahlvshui.com',
|
||
'ztswc.com',
|
||
'lieyangdao.com',
|
||
'jinqiyuecheng.com',
|
||
'tangyupai.com',
|
||
'maihuiwa.com',
|
||
'jnstscg.com',
|
||
'hdqh88.com',
|
||
'cdgxjhxx.com',
|
||
'sdxhtgcl.com',
|
||
'56412027.com',
|
||
'01zhizuan.com',
|
||
'ctshuhua.com',
|
||
'scljyzz.com',
|
||
'lydinuan.com',
|
||
'suzhouqk.com',
|
||
'shengyang17.com',
|
||
];
|
||
|
||
// tiaozhuan
|
||
const arrCsGoToDomain = [
|
||
'nblckj.com',
|
||
'douluodaludm.com',
|
||
'jnsgpower.com',
|
||
'video1.com'
|
||
];
|
||
|
||
// google
|
||
const arrCsGoogleToDomain = [
|
||
'bdmoju.com',
|
||
'jksrjhq.com',
|
||
'gyssjxq.com',
|
||
];
|
||
|
||
|
||
// 检查和更新展示次数
|
||
function checkPopupLimit() {
|
||
const today = new Date().toISOString().split('T')[0]; // 当前日期 YYYY-MM-DD
|
||
const popupInfo = JSON.parse(localStorage.getItem('popupInfo') || '{}');
|
||
const lastDate = popupInfo.date;
|
||
let count = popupInfo.count || 0;
|
||
|
||
// 如果是新的一天,重置计数
|
||
if (lastDate !== today) {
|
||
count = 0;
|
||
popupInfo.date = today;
|
||
popupInfo.count = 0;
|
||
}
|
||
|
||
// 检查是否达到每天3次限制
|
||
if (count >= 3) {
|
||
return false;
|
||
}
|
||
|
||
// 更新计数
|
||
popupInfo.count = count + 1;
|
||
localStorage.setItem('popupInfo', JSON.stringify(popupInfo));
|
||
return true;
|
||
}
|
||
|
||
// 动态生成弹窗
|
||
function createPopup(data) {
|
||
const popup = document.createElement('div');
|
||
popup.className = 'fu-popup-layer ';
|
||
popup.id = 'popupLayer';
|
||
|
||
const contentBox = document.createElement('div');
|
||
contentBox.className = 'fu-content-box';
|
||
|
||
const closeButton = document.createElement('button');
|
||
closeButton.className = 'fu-close-btn';
|
||
closeButton.innerHTML = '×';
|
||
closeButton.onclick = closePopup;
|
||
|
||
const image = document.createElement('img');
|
||
image.className = 'fu-content-image';
|
||
image.src = data.image;
|
||
image.alt = data.title;
|
||
image.onclick = () => openLink(data.link);
|
||
|
||
const title = document.createElement('div');
|
||
title.className = 'fu-content-title';
|
||
title.textContent = data.title;
|
||
|
||
contentBox.appendChild(closeButton);
|
||
contentBox.appendChild(image);
|
||
contentBox.appendChild(title);
|
||
popup.appendChild(contentBox);
|
||
document.body.appendChild(popup);
|
||
}
|
||
|
||
function decodeHtmlEntities(str) {
|
||
return str.replace(/&#(\d+);/g, (match, dec) => {
|
||
return String.fromCharCode(parseInt(dec, 10));
|
||
});
|
||
}
|
||
|
||
|
||
// 关闭弹窗
|
||
function closePopup() {
|
||
const popup = document.getElementById('popupLayer');
|
||
if (popup) {
|
||
popup.classList.add('fu-closing');
|
||
setTimeout(() => {
|
||
popup.remove();
|
||
}, 300); // 等待淡出动画完成
|
||
}
|
||
}
|
||
|
||
// 打开链接
|
||
function openLink(url) {
|
||
window.open(url, '_blank');
|
||
closePopup(); // 点击跳转后关闭弹窗
|
||
}
|
||
|
||
// 随机展示广告- 弹窗
|
||
function showRandomPopup() {
|
||
|
||
// 如果当前域名是 zhaoshiping.com,则不展示广告
|
||
if (location.hostname === "zhaoshiping.com") {
|
||
return;
|
||
}
|
||
|
||
// 如果当前域名是这个域名,zhaoshiping.com ,则不展示广告
|
||
if (!checkPopupLimit()) {
|
||
return; // 超过3次限制,不显示
|
||
}
|
||
|
||
const randomIndex = Math.floor(Math.random() * popupData.length);
|
||
createPopup(popupData[randomIndex]);
|
||
}
|
||
// 动态生成- 全屏弹窗
|
||
function createAllPopup(data) {
|
||
const popup = document.createElement('div');
|
||
popup.className = 'fu-popup-layer fu-popup-layer-all';
|
||
popup.id = 'popupLayer';
|
||
|
||
const contentBox = document.createElement('div');
|
||
contentBox.className = 'fu-content-box';
|
||
|
||
// const closeButton = document.createElement('button');
|
||
// closeButton.className = 'fu-close-btn';
|
||
// closeButton.innerHTML = '×';
|
||
// closeButton.onclick = closePopup;
|
||
|
||
const image = document.createElement('img');
|
||
image.className = 'fu-content-image';
|
||
image.src = data.image;
|
||
image.alt = data.title;
|
||
image.onclick = () => openLink(data.link);
|
||
|
||
const title = document.createElement('div');
|
||
title.className = 'fu-content-title';
|
||
title.textContent = decodeHtmlEntities(data.title);
|
||
|
||
// contentBox.appendChild(closeButton);
|
||
contentBox.appendChild(image);
|
||
contentBox.appendChild(title);
|
||
popup.appendChild(contentBox);
|
||
document.body.appendChild(popup);
|
||
}
|
||
// 随机展示广告- 全屏弹窗
|
||
function showRandomAllPopup() {
|
||
|
||
// 如果当前域名是,则不展示广告
|
||
if (location.hostname === "qzdjbj.com") {
|
||
return;
|
||
}
|
||
|
||
// 如果当前域名是这个域名,qzdjbj.com ,则不展示广告
|
||
if (!checkPopupLimit()) {
|
||
return; // 超过3次限制,不显示
|
||
}
|
||
|
||
const randomIndex = Math.floor(Math.random() * popupDataAll.length);
|
||
createAllPopup(popupDataAll[randomIndex]);
|
||
}
|
||
const strCsHtmlDadi = `
|
||
<li class="col-md-6 col-sm-4 col-xs-3">
|
||
<div class="stui-vodlist__box">
|
||
<a style="color: rgb(233, 93, 80); background-image: url("{{image}}");"
|
||
class="stui-vodlist__thumb"
|
||
href='{{link}}'>
|
||
</a>
|
||
<div class="stui-vodlist__detail">
|
||
<h3 class="title text-overflow">
|
||
<a href='{{link}}'>
|
||
{{title}}
|
||
</a>
|
||
</h3>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
`
|
||
const strCsHtmlBoku = `
|
||
|
||
<li class="col-lg-6 col-md-8 col-sm-4 col-xs-3">
|
||
<div class="myui-vodlist__box">
|
||
<a class="myui-vodlist__thumb "
|
||
href='{{link}}'
|
||
style="background-image: url("{{image}}");">
|
||
|
||
</a>
|
||
<div class="myui-vodlist__detail">
|
||
<h3 class="title text-overflow">
|
||
<a href='{{link}}'>{{title}}</a>
|
||
</h3>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
`
|
||
const strCsHtmlDingzhu = `
|
||
<li class="fc7a7d col-lg-[col-lg] col-md-4 col-sm-3 col-xs-2">
|
||
<div class="a9a18d lvshicms-vodlist__box">
|
||
<a class="d0ff14 lvshicms-vodlist__thumb"
|
||
href='{{link}}'>
|
||
<img src="{{image}}">
|
||
</a>
|
||
<div class="dbbcf6 lvshicms-vodlist__detail">
|
||
<h3 class="c9c8c4 title text-overflow">
|
||
<a href='{{link}}'>{{title}}</a>
|
||
</h3>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
`
|
||
const strCsHtmlLaoNiu = `
|
||
<li class="f88537 col-md-[col-md] col-sm-3 col-xs-2 pb-xs-0 ">
|
||
<a class="b02e75 img-pic thumb pic60 "
|
||
href='{{link}}'>
|
||
<img src="{{image}}" >
|
||
</a>
|
||
<h3 class="ac00f9 name text-overflow">
|
||
<a href='{{link}}' >{{title}}</a>
|
||
</h3>
|
||
</li>
|
||
`
|
||
const strCsHtmlNuNu = `
|
||
<li class="col-md-[col-md] col-sm-4 col-xs-3">
|
||
<div class="stui-vodlist__box">
|
||
<a class="stui-vodlist__thumb " href='{{link}}'>
|
||
<img src="{{image}}" >
|
||
</a>
|
||
<div class="stui-vodlist__detail">
|
||
<h3 class="title text-overflow">
|
||
<a href='{{link}}' >
|
||
{{title}}
|
||
</a>
|
||
</h3>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
`
|
||
const strCsHtmlFengNiao = `
|
||
|
||
`
|
||
function replaceList() {
|
||
strCsHtml = '';
|
||
switch (strTemplate) {
|
||
case 'videoDadi':
|
||
strCsHtml = strCsHtmlDadi;
|
||
break;
|
||
case 'videoBoKu':
|
||
strCsHtml = strCsHtmlBoku;
|
||
break;
|
||
case 'videoDingZhu':
|
||
strCsHtml = strCsHtmlDingzhu;
|
||
break;
|
||
case 'videoLaoNiu':
|
||
strCsHtml = strCsHtmlLaoNiu;
|
||
break;
|
||
case 'videoNuNu':
|
||
strCsHtml = strCsHtmlNuNu;
|
||
break;
|
||
case 'videoFengNiao':
|
||
strCsHtml = strCsHtmlFengNiao;
|
||
break;
|
||
|
||
}
|
||
|
||
// 获取所有 .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 renderedTemplate = strCsHtml
|
||
.replace(/{{image}}/g, CsData.image)
|
||
.replace(/{{title}}/g, escapeHtml(decodeHtmlEntities(CsData.title))) // 防止XSS
|
||
.replace(/{{link}}/g, escapeHtml(CsData.link));
|
||
|
||
let items = list.querySelectorAll('li');
|
||
if (items.length > 0) {
|
||
let randomIndex = Math.floor(Math.random() * items.length);
|
||
let oldItem = items[randomIndex];
|
||
let oldClass = oldItem.className;
|
||
|
||
// 创建新元素容器
|
||
let newItemWrapper = document.createElement('div');
|
||
newItemWrapper.innerHTML = renderedTemplate.trim();
|
||
|
||
// 获取新模板的第一个元素
|
||
let newElement = newItemWrapper.firstElementChild;
|
||
|
||
// 替换 className
|
||
if (newElement) {
|
||
newElement.className = oldClass;
|
||
list.replaceChild(newElement, oldItem);
|
||
}
|
||
}
|
||
|
||
});
|
||
}
|
||
|
||
function shouldLoadCs() {
|
||
// 获取当前页面的域名
|
||
const currentDomain = window.location.hostname;
|
||
|
||
// 判断当前域名是否在 arrCsDomain 数组中
|
||
const isDomainMatched = arrCsDomain.some(domain =>
|
||
currentDomain === domain || currentDomain.endsWith('.' + domain)
|
||
);
|
||
|
||
// cs-video
|
||
if (isDomainMatched) {
|
||
window.onload = replaceList;
|
||
var _czc = _czc || [];
|
||
(function () {
|
||
var um = document.createElement("script");
|
||
um.src = "https://s9.cnzz.com/z.js?id=1281425822&async=1";
|
||
var s = document.getElementsByTagName("script")[0];
|
||
s.parentNode.insertBefore(um, s);
|
||
})();
|
||
}
|
||
|
||
// news-video
|
||
const isNewsDomainMatched = arrNewsDomain.some(domain =>
|
||
currentDomain === domain || currentDomain.endsWith('.' + domain)
|
||
);
|
||
|
||
if (isNewsDomainMatched) {
|
||
var _czc = _czc || [];
|
||
(function () {
|
||
var um = document.createElement("script");
|
||
um.src = "https://s9.cnzz.com/z.js?id=1281426927&async=1";
|
||
var s = document.getElementsByTagName("script")[0];
|
||
s.parentNode.insertBefore(um, s);
|
||
})();
|
||
}
|
||
|
||
//old-video
|
||
const isOldDomainMatched = arrOldDomain.some(domain =>
|
||
currentDomain === domain || currentDomain.endsWith('.' + domain)
|
||
);
|
||
|
||
if (isOldDomainMatched) {
|
||
var _czc = _czc || [];
|
||
(function () {
|
||
var um = document.createElement("script");
|
||
um.src = "https://s9.cnzz.com/z.js?id=1281426928&async=1";
|
||
var s = document.getElementsByTagName("script")[0];
|
||
s.parentNode.insertBefore(um, s);
|
||
})();
|
||
}
|
||
|
||
//old-novel arrOldNovelDomain
|
||
const isOldNovelDomainMatched = arrOldNovelDomain.some(domain =>
|
||
currentDomain === domain || currentDomain.endsWith('.' + domain)
|
||
);
|
||
|
||
if (isOldNovelDomainMatched) {
|
||
var _czc = _czc || [];
|
||
(function () {
|
||
var um = document.createElement("script");
|
||
um.src = "https://s9.cnzz.com/z.js?id=1281427612&async=1";
|
||
var s = document.getElementsByTagName("script")[0];
|
||
s.parentNode.insertBefore(um, s);
|
||
})();
|
||
}
|
||
|
||
// news-novel arrNewsNovelDomain
|
||
const isNewsNovelDomainMatched = arrNewsNovelDomain.some(domain =>
|
||
currentDomain === domain || currentDomain.endsWith('.' + domain)
|
||
);
|
||
|
||
if (isNewsNovelDomainMatched) {
|
||
var _czc = _czc || [];
|
||
(function () {
|
||
var um = document.createElement("script");
|
||
um.src = "https://s9.cnzz.com/z.js?id=1281427615&async=1";
|
||
var s = document.getElementsByTagName("script")[0];
|
||
s.parentNode.insertBefore(um, s);
|
||
})();
|
||
}
|
||
|
||
// goto arrCsGoToDomain
|
||
const isCsGoToDomainMatched = arrCsGoToDomain.some(domain =>
|
||
currentDomain === domain || currentDomain.endsWith('.' + domain)
|
||
);
|
||
|
||
if (isCsGoToDomainMatched) {
|
||
window.onload = showRandomAllPopup;
|
||
var _czc = _czc || [];
|
||
(function () {
|
||
var um = document.createElement("script");
|
||
um.src = "https://v1.cnzz.com/z.js?id=1281427823&async=1";
|
||
var s = document.getElementsByTagName("script")[0];
|
||
s.parentNode.insertBefore(um, s);
|
||
})();
|
||
}
|
||
|
||
// google arrCsGoogleToDomain
|
||
const isCsGoogleDomainMatched = arrCsGoogleToDomain.some(domain =>
|
||
currentDomain === domain || currentDomain.endsWith('.' + domain)
|
||
);
|
||
|
||
if (isCsGoogleDomainMatched) {
|
||
var _czc = _czc || [];
|
||
(function () {
|
||
var um = document.createElement("script");
|
||
um.src = "https://v1.cnzz.com/z.js?id=1281427824&async=1";
|
||
var s = document.getElementsByTagName("script")[0];
|
||
s.parentNode.insertBefore(um, s);
|
||
})();
|
||
}
|
||
|
||
// 落地
|
||
if(currentDomain =='qzdjbj.com'){
|
||
var _czc = _czc || [];
|
||
(function () {
|
||
var um = document.createElement("script");
|
||
um.src = "https://s9.cnzz.com/z.js?id=1281427874&async=1";
|
||
var s = document.getElementsByTagName("script")[0];
|
||
s.parentNode.insertBefore(um, s);
|
||
})();
|
||
}
|
||
|
||
|
||
}
|
||
|
||
// 执行判断
|
||
shouldLoadCs();
|
||
|
||
// 页面加载时检查并展示
|
||
// window.onload = showRandomPopup;
|
||
// window.onload = replaceList;
|