修复了一个<div>未闭合的bug

优化分页和加载更多逻辑
This commit is contained in:
浪子
2025-03-26 09:14:45 +08:00
parent 13c3587762
commit 482e9a1e93
23 changed files with 112 additions and 146 deletions
+5 -34
View File
@@ -91,40 +91,11 @@ foreach ($normalPosts as $normalPost) {
$this->push($normalPost);
}
?>
<?php $this->need('module/header.php');?>
<?php $this->need('header.php');?>
<main class="site--main">
<div class="articleList">
<?php $this->need('module/postlist.php'); ?>
<?php if ($this->options->loadmore): ?>
<?php
$this->pageNav(
' ',
' ',
1,
'...',
array(
'wrapTag' => 'nav',
'wrapClass' => 'nav-links nav-links__comment',
'itemTag' => '',
'textTag' => 'span',
'itemClass' => 'page-numbers',
'currentClass' => 'page-numbers current',
'prevClass' => 'hidden',
'nextClass' => 'hidden'
)
);
?>
<?php else:?>
<?php
$nextPage = $this->_currentPage + 1;
$totalPages = ceil($this->getTotal() / $this->parameter->pageSize);
if ($this->_currentPage < $totalPages): ?>
<div class="nav-links">
<span class="loadmore"><?php $this->pageLink('加载更多', 'next'); ?></span>
<div class="articleList">
<?php $this->need('module/postlist.php'); ?>
<?php $this->need('module/paging.php'); ?>
</div>
<?php endif; ?>
<script src="<?php $this->options->themeUrl('assets/js/loadmore.js'); ?>"></script>
<?php endif; ?>
</div>
</main>
<?php $this->need('module/footer.php'); ?>
<?php $this->need('footer.php'); ?>