From 6d298166549e737a701b14f82663e9d69b10f302 Mon Sep 17 00:00:00 2001
From: xiang <27800734@qq.com>
Date: Sat, 10 May 2025 17:48:45 +0800
Subject: [PATCH] 1
---
Yes.Blog/wwwroot/defaulttheme/_Comment.liquid | 8 ++++++++
Yes.Domain/Core/Models/PagedList.cs | 3 +++
2 files changed, 11 insertions(+)
diff --git a/Yes.Blog/wwwroot/defaulttheme/_Comment.liquid b/Yes.Blog/wwwroot/defaulttheme/_Comment.liquid
index 1d732f7..63e5fa2 100644
--- a/Yes.Blog/wwwroot/defaulttheme/_Comment.liquid
+++ b/Yes.Blog/wwwroot/defaulttheme/_Comment.liquid
@@ -70,6 +70,14 @@
{% endfor %}
+ {% if Model.Comments.HasPreviousPage %}
+ 上一页
+ {% endif %}
+
+ {% if Model.Comments.HasNextPage %}
+ 下一页
+ {% endif %}
+
{% endif %}
diff --git a/Yes.Domain/Core/Models/PagedList.cs b/Yes.Domain/Core/Models/PagedList.cs
index c7fc822..633be72 100644
--- a/Yes.Domain/Core/Models/PagedList.cs
+++ b/Yes.Domain/Core/Models/PagedList.cs
@@ -13,6 +13,9 @@
public record PagedList(List Items, int PageIndex, int PageSize, int TotalItems)
{
public bool HasNextPage => PageIndex * PageSize < TotalItems;
+ public int NextPage => PageIndex + 1;
+ public int PreviousPage => PageIndex - 1;
+
public bool HasPreviousPage => PageIndex > 1;
public int TotalPage => (int)Math.Ceiling((double)TotalItems / PageSize);