feat(template):底部加醒目「查看更多模板」渐变大按钮(带剩余数与↓动画,到底置灰),点击翻下一页并回列表顶部
NodeJS with Webpack / build (push) Canceled after 0s

This commit is contained in:
personal827 committed 2026-10-28 16:06:22 +08:00
1 parent 00c0b99077
commit 4ad4dd9df2
1 file changed
+75
+75
View File
@@ -64,6 +64,19 @@
</Tooltip>
</div>
</div>
<!-- 底部醒目的「查看更多」引导 -->
<div class="load-more">
<Button class="load-more-btn" :disabled="page * pageSize >= total" @click="loadMore">
{{
page * pageSize >= total
? `已经到底了 · 共 ${total} 个模板`
: `查看更多模板 · 还有 ${total - page * pageSize} 个`
}}
<span class="arrow">↓</span>
</Button>
</div>
<Page
class="page"
:total="total"
@@ -167,6 +180,16 @@ const search = () => {
page.value = 1;
getTmplListHandel();
};
// 底部「查看更多」:翻到下一页,并平滑回到列表顶部
const loadMore = () => {
if (page.value * pageSize.value >= total.value) return;
page.value += 1;
getTmplListHandel().then(() => {
document.getElementById('imgBox')?.scrollIntoView({ behavior: 'smooth', block: 'start' });
});
};
getTmplListHandel();
const toInfo = (info) => {
@@ -250,6 +273,58 @@ const toInfo = (info) => {
}
}
// 底部「查看更多」大按钮:显眼引导,让用户知道下面还有更多模板
.load-more {
width: 1200px;
margin: 26px auto 6px;
text-align: center;
.load-more-btn {
min-width: 420px;
height: 56px;
padding: 0 42px;
font-size: 17px;
font-weight: 700;
letter-spacing: 1px;
color: #fff;
border: none;
border-radius: 28px;
background: linear-gradient(135deg, #2d8cf0 0%, #67c6ff 100%);
box-shadow: 0 10px 24px rgba(45, 140, 240, 0.4);
transition: all 0.25s ease;
&:hover:not(.ivu-btn-disabled) {
transform: translateY(-3px);
box-shadow: 0 14px 30px rgba(45, 140, 240, 0.5);
background: linear-gradient(135deg, #1f7de0 0%, #56bcff 100%);
}
&.ivu-btn-disabled {
background: #f2f4f7;
color: #9aa5b1;
box-shadow: none;
opacity: 1;
}
.arrow {
display: inline-block;
margin-left: 8px;
animation: bounce-down 1.2s infinite;
}
}
}
@keyframes bounce-down {
0%,
100% {
transform: translateY(0);
}
50% {
transform: translateY(5px);
}
}
// 分页
.page {
margin: 20px auto;