Browse Source

no message

ios
ZHR007 4 months ago
parent
commit
f962ccc9f7
3 changed files with 21 additions and 10 deletions
  1. 16
      lib/pages/home/nearby_tab.dart
  2. 1
      lib/pages/home/recommend_tab.dart
  3. 14
      lib/pages/mine/mine_page.dart

16
lib/pages/home/nearby_tab.dart

@ -38,9 +38,10 @@ class _NearbyTabState extends State<NearbyTab>
final tabBarHeight = 64.0; final tabBarHeight = 64.0;
final totalBottomPadding = bottomPadding + tabBarHeight; final totalBottomPadding = bottomPadding + tabBarHeight;
return Obx(() {
return SizedBox(
height: MediaQuery.of(context).size.height - totalBottomPadding,
child: Obx(() {
final List<MarriageData> dataSource = controller.nearbyFeed; final List<MarriageData> dataSource = controller.nearbyFeed;
final bool hasMore = controller.nearbyHasMore.value;
return SmartRefresher( return SmartRefresher(
controller: _refreshController, controller: _refreshController,
@ -64,6 +65,7 @@ class _NearbyTabState extends State<NearbyTab>
try { try {
await controller.refreshNearbyData(); await controller.refreshNearbyData();
_refreshController.refreshCompleted(); _refreshController.refreshCompleted();
_refreshController.loadComplete();
print('同城列表刷新完成'); print('同城列表刷新完成');
} catch (e) { } catch (e) {
print('同城列表刷新失败: $e'); print('同城列表刷新失败: $e');
@ -72,8 +74,8 @@ class _NearbyTabState extends State<NearbyTab>
}, },
// //
onLoading: () async { onLoading: () async {
print('同城列表上拉加载被触发, hasMore: $hasMore');
if (hasMore && controller.nearbyHasMore.value) {
print('同城列表上拉加载被触发, hasMore: ${controller.nearbyHasMore.value}');
if (controller.nearbyHasMore.value) {
try { try {
await controller.loadNearbyMoreData(); await controller.loadNearbyMoreData();
// //
@ -102,14 +104,14 @@ class _NearbyTabState extends State<NearbyTab>
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 12, left: 12,
right: 12, right: 12,
bottom: totalBottomPadding + 12,
bottom: 12,
), ),
itemBuilder: (context, index) { itemBuilder: (context, index) {
// //
if (dataSource.isEmpty && index == 0) { if (dataSource.isEmpty && index == 0) {
// 使 // 使
return SizedBox( return SizedBox(
height: MediaQuery.of(context).size.height * 1.2,
height: MediaQuery.of(context).size.height - totalBottomPadding,
child: const Center( child: const Center(
child: Text( child: Text(
"暂无数据", "暂无数据",
@ -131,7 +133,7 @@ class _NearbyTabState extends State<NearbyTab>
itemCount: dataSource.isEmpty ? 1 : dataSource.length, itemCount: dataSource.isEmpty ? 1 : dataSource.length,
), ),
); );
});
}));
} }
@override @override

1
lib/pages/home/recommend_tab.dart

@ -97,6 +97,7 @@ class _RecommendTabState extends State<RecommendTab>
}, },
child: ListView.separated( child: ListView.separated(
// 使 // 使
physics: AlwaysScrollableScrollPhysics(), //
// padding AppBar // padding AppBar
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 12, left: 12,

14
lib/pages/mine/mine_page.dart

@ -70,11 +70,19 @@ class _MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin{
children: [ children: [
ClipRRect( ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(60.w)), borderRadius: BorderRadius.all(Radius.circular(60.w)),
child: (controller.userData.value?.profilePhoto?.isNotEmpty ?? false) ? Image.network(
"${controller.userData.value?.profilePhoto ?? ""}",
child: (controller.userData.value?.profilePhoto?.isNotEmpty ?? false) ?
CachedNetworkImage(
imageUrl: '${controller.userData.value?.profilePhoto}?x-oss-process=image/format,webp/resize,w_320',
width: 60.w, width: 60.w,
height: 60.w, height: 60.w,
fit: BoxFit.cover,
imageBuilder: (context, imageProvider) => Container(
decoration: BoxDecoration(
image: DecorationImage(
image: imageProvider,
fit: BoxFit.cover,
),
),
),
) : Image.asset( ) : Image.asset(
Assets.imagesUserAvatar, Assets.imagesUserAvatar,
width: 60.w, width: 60.w,

Loading…
Cancel
Save