Files
SEONexus/doc/优化.md
2026-02-22 19:42:47 +08:00

52 lines
2.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
1.首页 home_newest home_hot home_rank 。。 目前就3个我觉得应该不止这几个
比喻推荐板块 票房榜板块。。。
可以继续增加 比喻 每个分类一个list循环生成
当然,不是所有首页都一样,每个域名的 模块自动生成绑定,顺序也是打乱 绑定,这样 页面的 dom树应该都是不一样的了
2.home_newest home_hot home_rank 。。。 这些模块 外部包裹标签 都是使用
<section class="mod-newest"> <section class="{$TpStyle.dom_prefix}-shell{$cfg.shell} {$cfg.class}">
都是section 然后就是类名不一样,这样好吗?需要使用不同的 标签吗?
<pre style="font-size:12px;background:#111;color:#0f0;">
{php}print_r($resData['p_data']);{/php}
</pre>
git restore .
git clean -fd
<script>
// =============================
// 停留时长统计U-Web 自定义事件)
// =============================
(function () {
var enterTs = Date.now(); // 页面进入时间
// 页面可见性变化(比 beforeunload 更稳定)
var totalStay = 0;
var lastVisibleTs = enterTs;
document.addEventListener("visibilitychange", function () {
if (document.visibilityState === "hidden") {
totalStay += Date.now() - lastVisibleTs;
} else if (document.visibilityState === "visible") {
lastVisibleTs = Date.now();
}
});
// 页面关闭/刷新时上报
window.addEventListener("beforeunload", function () {
var now = Date.now();
totalStay += now - lastVisibleTs;
// 上报自定义事件
_czc.push([
"_trackEvent",
"page_duration", // 事件类别
location.pathname, // 事件名称:当前页面路径
"stay_time", // 标签
totalStay // value停留时长毫秒
]);
});
})();
</script>