diff --git a/lib/common/skeleton/video_card_v.dart b/lib/common/skeleton/video_card_v.dart index 956479ef8..fc247e565 100644 --- a/lib/common/skeleton/video_card_v.dart +++ b/lib/common/skeleton/video_card_v.dart @@ -8,59 +8,52 @@ class VideoCardVSkeleton extends StatelessWidget { @override Widget build(BuildContext context) { return Skeleton( - child: Card( - elevation: 0.8, - shape: RoundedRectangleBorder( - borderRadius: StyleString.mdRadius, - ), - margin: EdgeInsets.zero, - child: Column( - children: [ - AspectRatio( - aspectRatio: StyleString.aspectRatio, - child: LayoutBuilder( - builder: (context, boxConstraints) { - return Container( - clipBehavior: Clip.hardEdge, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6), - ), - ); - }, - ), + child: Column( + children: [ + AspectRatio( + aspectRatio: StyleString.aspectRatio, + child: LayoutBuilder( + builder: (context, boxConstraints) { + return Container( + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.onInverseSurface, + borderRadius: + BorderRadius.circular(StyleString.imgRadius.x)), + ); + }, ), - Padding( - // 多列 - padding: const EdgeInsets.fromLTRB(8, 8, 6, 7), - // 单列 - // padding: const EdgeInsets.fromLTRB(14, 10, 4, 8), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - // const SizedBox(height: 6), - Container( - width: 200, - height: 13, - margin: const EdgeInsets.only(bottom: 5), - color: Theme.of(context).colorScheme.background, - ), - Container( - width: 150, - height: 13, - margin: const EdgeInsets.only(bottom: 12), - color: Theme.of(context).colorScheme.background, - ), - Container( - width: 80, - height: 12, - color: Theme.of(context).colorScheme.background, - ), - ], - ), + ), + Padding( + // 多列 + padding: const EdgeInsets.fromLTRB(4, 5, 6, 6), + // 单列 + // padding: const EdgeInsets.fromLTRB(14, 10, 4, 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + // const SizedBox(height: 6), + Container( + width: 200, + height: 13, + margin: const EdgeInsets.only(bottom: 5), + color: Theme.of(context).colorScheme.onInverseSurface, + ), + Container( + width: 150, + height: 13, + margin: const EdgeInsets.only(bottom: 12), + color: Theme.of(context).colorScheme.onInverseSurface, + ), + Container( + width: 80, + height: 12, + color: Theme.of(context).colorScheme.onInverseSurface, + ), + ], ), - ], - ), + ), + ], ), ); } diff --git a/lib/common/widgets/network_img_layer.dart b/lib/common/widgets/network_img_layer.dart index 7c9656ed3..c4ac1277f 100644 --- a/lib/common/widgets/network_img_layer.dart +++ b/lib/common/widgets/network_img_layer.dart @@ -60,7 +60,7 @@ class NetworkImgLayer extends StatelessWidget { Widget placeholder(context) { return Container( - color: Theme.of(context).colorScheme.onInverseSurface.withOpacity(0.6), + color: Theme.of(context).colorScheme.onInverseSurface.withOpacity(0.4), width: width ?? double.infinity, height: height ?? double.infinity, child: Center( diff --git a/lib/http/reply.dart b/lib/http/reply.dart index 1dbc19909..5dcbce6ea 100644 --- a/lib/http/reply.dart +++ b/lib/http/reply.dart @@ -7,6 +7,7 @@ class ReplyHttp { required int oid, required int pageNum, required int type, + int? ps, int sort = 1, }) async { var res = await Request().get(Api.replyList, data: { @@ -14,6 +15,7 @@ class ReplyHttp { 'pn': pageNum, 'type': type, 'sort': sort, + 'ps': ps ?? 20 }); if (res.data['code'] == 0) { return { diff --git a/lib/pages/main/view.dart b/lib/pages/main/view.dart index 95a1ff137..4553046f0 100644 --- a/lib/pages/main/view.dart +++ b/lib/pages/main/view.dart @@ -117,6 +117,7 @@ class _MainAppState extends State with SingleTickerProviderStateMixin { ), ), child: PageView( + physics: const NeverScrollableScrollPhysics(), controller: _pageController, onPageChanged: (index) { selectedIndex = index; diff --git a/lib/pages/search/controller.dart b/lib/pages/search/controller.dart index cd9fac775..5be168c7c 100644 --- a/lib/pages/search/controller.dart +++ b/lib/pages/search/controller.dart @@ -72,6 +72,7 @@ class SSearchController extends GetxController { // 手动刷新 historyList.refresh(); histiryWord.put('cacheList', historyCacheList); + searchFocusNode.unfocus(); Get.toNamed('/searchResult', parameters: {'keyword': searchKeyWord.value}); } diff --git a/lib/pages/video/detail/reply/controller.dart b/lib/pages/video/detail/reply/controller.dart index 953986499..c920c38f0 100644 --- a/lib/pages/video/detail/reply/controller.dart +++ b/lib/pages/video/detail/reply/controller.dart @@ -24,6 +24,7 @@ class VideoReplyController extends GetxController { int currentPage = 0; bool isLoadingMore = false; RxString noMore = ''.obs; + int ps = 20; // 当前回复的回复 ReplyItemModel? currentReplyItem; @@ -36,14 +37,21 @@ class VideoReplyController extends GetxController { var res = await ReplyHttp.replyList( oid: aid!, pageNum: currentPage + 1, + ps: ps, type: ReplyType.video.index, sort: sortType.index, ); if (res['status']) { List replies = res['data'].replies; if (replies.isNotEmpty) { - currentPage++; noMore.value = '加载中...'; + + /// 第一页回复数小于20 + if (currentPage == 0 && replies.length < 20) { + noMore.value = '没有更多了'; + } + currentPage++; + if (replyList.length == res['data'].page.acount) { noMore.value = '没有更多了'; } diff --git a/lib/pages/video/detail/reply/view.dart b/lib/pages/video/detail/reply/view.dart index ae0a81644..dc12f07f2 100644 --- a/lib/pages/video/detail/reply/view.dart +++ b/lib/pages/video/detail/reply/view.dart @@ -189,7 +189,8 @@ class _VideoReplyPanelState extends State if (data['status']) { // 请求成功 return Obx( - () => _videoReplyController.replyList.isEmpty + () => _videoReplyController.isLoadingMore && + _videoReplyController.replyList.isEmpty ? SliverList( delegate: SliverChildBuilderDelegate( (context, index) {