This commit is contained in:
make
2025-04-21 11:59:52 +08:00
parent 3216cffb5e
commit adf88aef23
27 changed files with 543 additions and 329 deletions

View File

@@ -1,11 +1,13 @@
{extend name="basePcUser" /}
{block name="title"}{$strTitle??''}{/block}
{block name="keywords"}{$strKeywords??''}{/block}
{block name="description"}{$strDescription??''}{/block}
{block name="title"}个人中心{/block}
{block name="keywords"}个人中心{/block}
{block name="description"}个人中心{/block}
{block name="head"}
<!-- 社交媒体标签 -->
<meta property="og:title" content="{$strTitle??''}" />
<meta property="og:description" content="{$strDescription??''}" />
<meta property="og:title" content="个人中心" />
<meta property="og:description" content="个人中心" />
<meta property="og:url" content="https://{$DomainModel->d_domain}{$strUserUrlTemp}" />
<meta property="og:type" content="article" />
<!-- 结构化数据 -->
@@ -13,8 +15,8 @@
{
"@context": "https://{$DomainModel->d_domain}{$strUserUrlTemp}",
"@type": "article",
"headline": "{$strTitle??''}",
"description": "{$strDescription??''}",
"headline": "个人中心",
"description": "个人中心",
"datePublished": "{:date('Y-m-d')}"
}
</script>
@@ -22,6 +24,9 @@
{block name="main"}
{site:grm page_code="userinfo" diff="0" num="100" g_key="arrGrm" /}
<div class="i-right">
<!--bot mod -->
<div class="i-bot">
@@ -57,9 +62,9 @@
</div>
<div class="tabBd">
<ul class="hotBookBd ">
{volist name="arrMoonRankNovel" id="Novel" key="key"}
{novel:list count="10" sort_type="news" d_key="key" d_val="Novel" cache_life="86400"}
{include file="pc/public/endNovelList" start="0"/}
{/volist}
{/novel:list}
</ul>
@@ -73,10 +78,10 @@
<div class="myWorks myLike">
<div class="i-title">推荐作品</div>
<ul>
{volist name="arrRecommendEndNovel" id="Novel" key="key"}
{novel:list count="10" sort_type="tuijian" d_key="key" d_val="Novel" cache_life="86400"}
{$arrGrm[$key]|raw}
<li>
<a href='{$strPcPath}{site:nurl n_id="$Novel[n_id]" n_py="$Novel[n_name_pinyin]"/}'
<a href='{$strPcPath}{site:nurl n_id="$Novel.n_id" n_py="$Novel.n_name_pinyin"/}'
title="{$Novel.n_name ?? ''}">
<img src="{$Novel.n_cover_path ?? ''}" alt="{$Novel.n_name ?? ''}">
</a>
@@ -84,14 +89,14 @@
<a href='{$strPcPath}{site:nurl n_id="$Novel->n_id" n_py="$Novel->n_name_pinyin"/}'>
<span class="bookName other">{$Novel.n_name ?? ''}</span>
</a>
<a href='{$strPcPath}{site:souurl key="$Novel[n_author]" p="1"/}'>
<a href='{$strPcPath}{site:souurl key="$Novel.n_author" p="1"/}'>
<span class="bookStatus other">{$Novel->n_author ?? ''}</span>
</a>
<span class="bookBrief">
{$Novel.n_description ?? ''}</span>
</p>
</li>
{/volist}
{/novel:list}
</ul>
</div>
@@ -100,9 +105,9 @@
</div>
<script>
const strNovelUrlTemp = `{$strNovelUrlTemp}`;
const strNovelChapterUrlTemp = `{$strNovelChapterUrlTemp}`;
const strSearchUrlTemp = `{$strSearchUrlTemp}`;
const strNovelUrlTemp = `{site:replace code="NOVEL_INFO_URL"}`;
const strNovelChapterUrlTemp = `{site:replace code="CONTENT_INFO_URL"}`;
const strSearchUrlTemp = `{site:replace code="SEARCH_INFO_URL"}`;
document.addEventListener("DOMContentLoaded", function () {
@@ -112,9 +117,10 @@
// 展示 书架
function displayBookshelfInUser() {
const strBookshelfKey = window.location.hostname + 'strBookshelfKey';
// 获取书架数据
const arrBookshelf = JSON.parse(localStorage.getItem('strBookshelfKey')) || [];
const arrBookshelf = JSON.parse(localStorage.getItem(strBookshelfKey)) || [];
console.log(arrBookshelf)
if (arrBookshelf.length === 0) {
console.log('书架为空');
@@ -188,18 +194,18 @@
});
}
// 展示 书架
// 展示 最近阅读
function displayHistoryInUser() {
// 获取书架数据
const arrBookshelf = JSON.parse(localStorage.getItem('strHistoryKey')) || [];
const strHistoryKey = window.location.hostname + 'strHistoryKey';
// 获取最近阅读数据
const arrBookshelf = JSON.parse(localStorage.getItem(strHistoryKey)) || [];
if (arrBookshelf.length === 0) {
console.log('书架为空');
return;
}
// 渲染书籍列表
// 渲染最近阅读列表
const DomBookshelfContainer = document.getElementById('history-ul');
DomBookshelfContainer.innerHTML = ''
arrBookshelf.forEach(book => {