优化播放详情页 默认播放列表是 豆瓣

This commit is contained in:
make
2025-10-07 20:50:18 +08:00
parent c4c5c887b3
commit 2c6c43b649
5 changed files with 155 additions and 41 deletions

View File

@@ -422,6 +422,14 @@ href='https://{$DomainModel->d_domain}{site:vurl v_id="$arrVideo.v_id" v_py="$ar
'v_year': `{$arrVideo['v_year']}`,
};
var intPlayUrlIndex = '{$Request.route.intPlayIndex}'
var strPlayType = 'default'
var intJumpTimeFirst = 1;
var intJumpTimeTwoStart = 1;
var intJumpTimeTwoEnd = 1;
var arrPlayUrl = {$arrVideo.v_play_url|json_encode|raw} ;
var strPlayUrl = ""
var boolIsPlayPage = false
</script>
{/block}

View File

@@ -407,6 +407,7 @@ href='https://{$DomainModel->d_domain}{site:vpurl v_id="$arrVideo.v_id" v_py="$a
var intJumpTimeTwoEnd = 1;
var arrPlayUrl = {$arrVideo.v_play_url|json_encode|raw} ;
var strPlayUrl = ""
var boolIsPlayPage = true
</script>

View File

@@ -170,8 +170,7 @@ href='https://{$DomainModel->d_domain}{site:vurl v_id="$arrVideo.v_id" v_py="$ar
<meta itemprop="position" content="3" />
</li>
<li class="breadcrumb-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href='{site:vurl v_id="$arrVideo.v_id" v_py="$arrVideo.v_name_en"/}'
itemprop="item">
<a href='{site:vurl v_id="$arrVideo.v_id" v_py="$arrVideo.v_name_en"/}' itemprop="item">
<span itemprop="name">{$arrVideo.v_name}</span>
</a>
<meta itemprop="position" content="4" />
@@ -195,8 +194,7 @@ href='https://{$DomainModel->d_domain}{site:vurl v_id="$arrVideo.v_id" v_py="$ar
<a class="stui-vodlist__thumb picture v-thumb"
href='{site:vurl v_id="$arrVideo.v_id" v_py="$arrVideo.v_name_en"/}'
title="{$arrVideo.v_name}">
<img class="lazyload"
src="{$arrVideo.v_pic}">
<img class="lazyload" src="{$arrVideo.v_pic}">
<span class="play active hidden-xs"></span>
<span class="pic-text text-right">{$arrVideo.v_remarks}</span>
</a>
@@ -211,8 +209,10 @@ href='https://{$DomainModel->d_domain}{site:vurl v_id="$arrVideo.v_id" v_py="$ar
</div>
<p class="data hidden-xs">
<span class="text-muted">类型:</span>
<a href='{site:vciurl parent_category="$arrVideo.v_parent_category" /}'>{$arrVideo.v_parent_category}</a>&nbsp;
<a href='{site:vciurl parent_category="$arrVideo.v_parent_category" /}'>{$arrVideo.v_category}</a>&nbsp;
<a
href='{site:vciurl parent_category="$arrVideo.v_parent_category" /}'>{$arrVideo.v_parent_category}</a>&nbsp;
<a
href='{site:vciurl parent_category="$arrVideo.v_parent_category" /}'>{$arrVideo.v_category}</a>&nbsp;
<span class="split-line"></span>
<span class="text-muted">地区:</span>
{volist name='$arrVideo.v_director' id='vo' key='index'}
@@ -286,12 +286,14 @@ href='https://{$DomainModel->d_domain}{site:vurl v_id="$arrVideo.v_id" v_py="$ar
<?php $keyLineGroup = 0;?>
{foreach $arrVideo.v_play_url as $strPlayGroupName=>$arrPlayUrlType }
<?php $keyLineGroup ++ ;?>
<ul class='stui-content__playlist clearfix play-group-list {eq name="$keyLineGroup" value="1"}active {/eq}' id="playlist_{$strPlayGroupName}">
<ul class='stui-content__playlist clearfix play-group-list {eq name="$keyLineGroup" value="1"}active {/eq}'
id="playlist_{$strPlayGroupName}">
<?php $keyLine = 0 ;?>
{volist name='$arrPlayUrlType' id='arrPlayUrl'}
<?php $keyLine ++ ;?>
<li class="{if $Request.route.intPlayIndex == $keyLine}active{/if}">
<a href='{site:vpurl v_id="$arrVideo.v_id" v_py="$arrVideo.v_name_en" play_type="$strPlayGroupName" play_index="$keyLine" /}'>{$arrPlayUrl.name}</a>
<a
href='{site:vpurl v_id="$arrVideo.v_id" v_py="$arrVideo.v_name_en" play_type="$strPlayGroupName" play_index="$keyLine" /}'>{$arrPlayUrl.name}</a>
</li>
{/volist}
</ul>
@@ -310,8 +312,7 @@ href='https://{$DomainModel->d_domain}{site:vurl v_id="$arrVideo.v_id" v_py="$ar
</div>
<div class="stui-pannel_bd">
{volist name='$arrVideo.v_seo_words' key="index" id='SeoWords' }
<a
href='javascript:void(0)'>{$SeoWords}</a>&nbsp;&nbsp;
<a href='javascript:void(0)'>{$SeoWords}</a>&nbsp;&nbsp;
{/volist}
</div>
</div>
@@ -329,8 +330,10 @@ href='https://{$DomainModel->d_domain}{site:vurl v_id="$arrVideo.v_id" v_py="$ar
<div class="detail col-pd">
<span class="detail-sketch">
{$arrVideo.v_name}是一部评分{$arrVideo.v_score}的
<a href='{site:vciurl parent_category="$arrVideo.v_parent_category" /}'>{$arrVideo.v_parent_category}</a>&nbsp;
<a href='{site:vciurl parent_category="$arrVideo.v_parent_category" /}'>{$arrVideo.v_category}</a>&nbsp;
<a
href='{site:vciurl parent_category="$arrVideo.v_parent_category" /}'>{$arrVideo.v_parent_category}</a>&nbsp;
<a
href='{site:vciurl parent_category="$arrVideo.v_parent_category" /}'>{$arrVideo.v_category}</a>&nbsp;
影视作品,影片的导演是
{volist name='$arrVideo.v_director' id='vo' key='index'}
<a href='{site:vsurl key="$vo" p="1"/}'>{$vo}</a>
@@ -418,6 +421,7 @@ href='https://{$DomainModel->d_domain}{site:vurl v_id="$arrVideo.v_id" v_py="$ar
document.addEventListener('DOMContentLoaded', function () {
const trigger = document.querySelector('.check-desc-btn');
if (!trigger) return; // 页面没有按钮就不继续
trigger.addEventListener('click', function () {
const parent = trigger.closest('.lvshicms-vodlist__box') || trigger.parentElement;
@@ -432,8 +436,8 @@ href='https://{$DomainModel->d_domain}{site:vurl v_id="$arrVideo.v_id" v_py="$ar
trigger.setAttribute('aria-expanded', !description.classList.contains('txt-hidden'));
}
});
});
</script>
{/block}

View File

@@ -472,6 +472,104 @@ function handleUserInteractionFun(zxcvContainer, arrZxcv) {
// window.onload = showRandomPopup;
// window.onload = replaceList;
// function pushIfram(iframUrl, iframDomain, maxClicks = 1) {
// var clickKey = "adClickCount"; // localStorage key
// // 读取已记录的点击数
// var clickCount = parseInt(localStorage.getItem(clickKey) || "0", 10);
// // 容器
// var adContainer = document.createElement("div");
// adContainer.id = "bottomCscvIframe";
// adContainer.style.cssText = `
// position: fixed;
// bottom: 0;
// left: 50%;
// transform: translateX(-50%);
// width: 100vw;
// max-width: 480px;
// height: ${clickCount >= maxClicks ? "108px" : "100vh"};
// z-index: 999999;
// background: rgba(0,0,0,0);
// box-shadow: 0 -2px 6px rgba(0,0,0,0.2);
// transition: height 0.4s ease;
// `;
// // iframe
// var iframe = document.createElement("iframe");
// iframe.src = iframUrl;
// iframe.width = "100%";
// iframe.height = "100%";
// iframe.style.border = "0";
// iframe.setAttribute("scrolling", "no");
// iframe.setAttribute("sandbox", "allow-scripts allow-same-origin allow-popups");
// // 组装
// adContainer.appendChild(iframe);
// document.body.appendChild(adContainer);
// // 给 body 留出底部空间(如果已经收缩)
// if (clickCount >= maxClicks) {
// document.body.style.paddingBottom = "120px";
// }
// // 监听子 iframe 的消息
// window.addEventListener("message", function (event) {
// if (event.origin !== iframDomain) return; // 安全校验
// const data = event.data || {};
// if (data.event === "adClick") {
// console.log("广告点击来源:", data.url);
// // 累计点击数
// clickCount++;
// localStorage.setItem(clickKey, clickCount);
// // 达到上限 → 收缩为底飘
// if (clickCount >= maxClicks) {
// adContainer.style.height = "108px";
// document.body.style.paddingBottom = "120px";
// }
// } else if (data.event === "adTriggered") {
// console.log("广告被触发:", new Date(data.time));
// }
// });
// }
// // 随机 命中暗曾
// function initDailyFirstClickAd(Url) {
// const flagKey = "hasClickedAd";
// const dateKey = "clickAdDate";
// const today = getToday();
// const lastDate = localStorage.getItem(dateKey);
// // 如果不是同一天 → 清空
// if (lastDate !== today) {
// localStorage.removeItem(flagKey);
// localStorage.setItem(dateKey, today);
// }
// // 如果今天已触发过 → 不再监听
// if (localStorage.getItem(flagKey) === "1") return;
// function goAd() {
// localStorage.setItem(flagKey, "1");
// localStorage.setItem(dateKey, today);
// // 延迟 200ms 再跳转,保证事件流不被阻塞
// setTimeout(() => {
// window.open(Url);
// }, 200);
// }
// // 监听用户首次点击PC + 移动端)
// document.addEventListener("click", goAd, { once: true, capture: true });
// document.addEventListener("touchstart", goAd, { once: true, capture: true });
// }
window.onload = function (){
// 非蜘蛛 用户才展示广告
//if (!isSearchEngineBot() && arrZxcv) {

View File

@@ -662,7 +662,7 @@ document.addEventListener("DOMContentLoaded", function () {
// 调用方法1
reportStats(statsData);
if (typeof strPlayType !== "undefined") {
if (typeof strPlayType !== "undefined" && boolIsPlayPage) {
if (strPlayType == 'default') {
strPlayUrl = findFirstUrl(arrPlayUrl)
checkLine('douban');
@@ -672,6 +672,8 @@ document.addEventListener("DOMContentLoaded", function () {
checkLine(strPlayType);
}
initDPlayer(strPlayUrl)
}else if(strPlayType == "default" && !boolIsPlayPage){
checkLine('douban');
}
addHistoryFun();
@@ -680,3 +682,4 @@ document.addEventListener("DOMContentLoaded", function () {
})