mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: 评论区allCount为空时保底值0;添加额外的hasData判定
This commit is contained in:
@@ -53,7 +53,7 @@ class ReplyCursor {
|
|||||||
isEnd = json['is_end'];
|
isEnd = json['is_end'];
|
||||||
mode = json['mode'];
|
mode = json['mode'];
|
||||||
modeText = json['mode_text'];
|
modeText = json['mode_text'];
|
||||||
allCount = json['all_count'];
|
allCount = json['all_count'] ?? 0;
|
||||||
supportMode = json['support_mode'].cast<int>();
|
supportMode = json['support_mode'].cast<int>();
|
||||||
name = json['name'];
|
name = json['name'];
|
||||||
paginationReply = json['pagination_reply'] != null
|
paginationReply = json['pagination_reply'] != null
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ class DynamicDetailController extends GetxController {
|
|||||||
isLoadingMore = false;
|
isLoadingMore = false;
|
||||||
if (res['status']) {
|
if (res['status']) {
|
||||||
List<ReplyItemModel> replies = res['data'].replies;
|
List<ReplyItemModel> replies = res['data'].replies;
|
||||||
acount.value = res['data'].cursor.allCount;
|
acount.value = res['data'].cursor.allCount ?? 0;
|
||||||
nextOffset = res['data'].cursor.paginationReply.nextOffset ?? "";
|
nextOffset = res['data'].cursor.paginationReply.nextOffset ?? "";
|
||||||
if (replies.isNotEmpty) {
|
if (replies.isNotEmpty) {
|
||||||
noMore.value = '加载中...';
|
noMore.value = '加载中...';
|
||||||
|
|||||||
@@ -382,7 +382,8 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
|||||||
return FutureBuilder(
|
return FutureBuilder(
|
||||||
future: _futureBuilderFuture,
|
future: _futureBuilderFuture,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
if (snapshot.connectionState == ConnectionState.done &&
|
||||||
|
snapshot.hasData) {
|
||||||
Map data = snapshot.data as Map;
|
Map data = snapshot.data as Map;
|
||||||
if (snapshot.data['status']) {
|
if (snapshot.data['status']) {
|
||||||
// 请求成功
|
// 请求成功
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class HtmlRenderController extends GetxController {
|
|||||||
);
|
);
|
||||||
if (res['status']) {
|
if (res['status']) {
|
||||||
List<ReplyItemModel> replies = res['data'].replies;
|
List<ReplyItemModel> replies = res['data'].replies;
|
||||||
acount.value = res['data'].cursor.allCount;
|
acount.value = res['data'].cursor.allCount ?? 0;
|
||||||
nextOffset = res['data'].cursor.paginationReply.nextOffset ?? "";
|
nextOffset = res['data'].cursor.paginationReply.nextOffset ?? "";
|
||||||
if (replies.isNotEmpty) {
|
if (replies.isNotEmpty) {
|
||||||
noMore.value = '加载中...';
|
noMore.value = '加载中...';
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ class VideoReplyController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
replies.insertAll(0, res['data'].topReplies);
|
replies.insertAll(0, res['data'].topReplies);
|
||||||
count.value = res['data'].cursor.allCount;
|
count.value = res['data'].cursor.allCount ?? 0;
|
||||||
replyList.value = replies;
|
replyList.value = replies;
|
||||||
} else {
|
} else {
|
||||||
replyList.addAll(replies);
|
replyList.addAll(replies);
|
||||||
|
|||||||
Reference in New Issue
Block a user