提交
This commit is contained in:
@@ -286,7 +286,7 @@ class _ClassUpdateViewState extends ConsumerState<ClassUpdateView> {
|
||||
padding: EdgeInsets.symmetric(vertical: 20.h),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'没有更多了',
|
||||
'- AI 爱学蝶变提醒你 没有更多了 -',
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: const Color(0xFFB4C2E0),
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:new_learn/core/api/class/api.dart';
|
||||
import 'package:new_learn/core/api/class/model.dart';
|
||||
import 'package:new_learn/core/utils/img_url.dart';
|
||||
import 'package:new_learn/features/class/widgets/post_list_body.dart';
|
||||
|
||||
/// ============================================================
|
||||
@@ -45,9 +47,10 @@ class _MyInteractPageState extends State<MyInteractPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFFF5F8FA),
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: AppBar(
|
||||
backgroundColor: const Color(0xFFF5F8FA),
|
||||
surfaceTintColor: Colors.transparent, // 滚动时不叠加半透明色,背景保持不变
|
||||
backgroundColor: Colors.transparent,
|
||||
surfaceTintColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
title: const Text(
|
||||
'我的互动',
|
||||
@@ -64,16 +67,45 @@ class _MyInteractPageState extends State<MyInteractPage> {
|
||||
context.canPop() ? context.pop() : context.go('/class'),
|
||||
),
|
||||
),
|
||||
body: Column(
|
||||
// 对齐 Vue .activity-box:背景图 + #F5F8FA 底色
|
||||
// background-image: url(/StaticResource/2026-04-07/myInteract-bg.png)
|
||||
// background-size: 100% 540rpx → height: 270.h + BoxFit.fitWidth
|
||||
body: Stack(
|
||||
children: [
|
||||
_buildTabs(),
|
||||
Expanded(
|
||||
child: IndexedStack(
|
||||
index: _currentTab,
|
||||
Positioned(
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: SizedBox(
|
||||
height: 270.h, // Vue 540rpx
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: ImgUrl.build(
|
||||
'/StaticResource/2026-04-07/myInteract-bg.png',
|
||||
),
|
||||
fit: BoxFit.fitWidth,
|
||||
placeholder: (_, __) => const SizedBox.shrink(),
|
||||
errorWidget: (_, __, ___) => const SizedBox.shrink(),
|
||||
),
|
||||
),
|
||||
),
|
||||
// 内容区:顶 padding = 系统状态栏 + AppBar 高度,对齐 Vue NavBar 后的起点
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: MediaQuery.of(context).padding.top + kToolbarHeight,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
if (_loadedTabs[0]) _UpdateTab(onTapPost: _openDetail),
|
||||
if (_loadedTabs[1]) _LikeTab(onTapPost: _openDetail),
|
||||
if (_loadedTabs[2]) _CommentTab(onTapPost: _openDetail),
|
||||
_buildTabs(),
|
||||
Expanded(
|
||||
child: IndexedStack(
|
||||
index: _currentTab,
|
||||
children: [
|
||||
if (_loadedTabs[0]) _UpdateTab(onTapPost: _openDetail),
|
||||
if (_loadedTabs[1]) _LikeTab(onTapPost: _openDetail),
|
||||
if (_loadedTabs[2]) _CommentTab(onTapPost: _openDetail),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -174,7 +174,11 @@ class _PointRankViewState extends ConsumerState<PointRankView> {
|
||||
? Colors.white
|
||||
: Colors.white.withValues(alpha: 0.5),
|
||||
borderRadius: BorderRadius.circular(8.r),
|
||||
border: active ? null : Border.all(color: Colors.white, width: 1),
|
||||
// 始终保留 1px border 占位,避免激活/未激活切换时 content 区域差 2px 抖动
|
||||
border: Border.all(
|
||||
color: active ? Colors.transparent : Colors.white,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
// Web 端回退字体行高偏大,固定高度可能溢出 → 内容放不下时自动缩小
|
||||
child: FittedBox(
|
||||
@@ -190,7 +194,7 @@ class _PointRankViewState extends ConsumerState<PointRankView> {
|
||||
color: active ? _primary : const Color(0xFF687FAD),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 4.h),
|
||||
// SizedBox(height: 0.5.h),
|
||||
Text(
|
||||
'$countText人',
|
||||
style: TextStyle(
|
||||
@@ -202,7 +206,14 @@ class _PointRankViewState extends ConsumerState<PointRankView> {
|
||||
),
|
||||
),
|
||||
),
|
||||
if (active) _buildTriangle(),
|
||||
// 始终渲染三角形占位,visible 切换避免外层 Column 高度变化抖动
|
||||
Visibility(
|
||||
visible: active,
|
||||
maintainSize: true,
|
||||
maintainAnimation: true,
|
||||
maintainState: true,
|
||||
child: _buildTriangle(),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -338,11 +349,7 @@ class _PointRankViewState extends ConsumerState<PointRankView> {
|
||||
),
|
||||
),
|
||||
SizedBox(width: 5.w),
|
||||
Icon(
|
||||
_sortDesc ? Icons.arrow_downward : Icons.arrow_upward,
|
||||
size: 14,
|
||||
color: _primary,
|
||||
),
|
||||
_buildSortIcons(),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -351,6 +358,32 @@ class _PointRankViewState extends ConsumerState<PointRankView> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSortIcons() {
|
||||
final up = _sortDesc
|
||||
? '/StaticResource/2026-07-29/reverseOrder_up_icon1785291938907.png'
|
||||
: '/StaticResource/2026-07-29/properOrder_up_icon1785291938906.png';
|
||||
final down = _sortDesc
|
||||
? '/StaticResource/2026-07-29/reverseOrder_down_icon1785291938905.png'
|
||||
: '/StaticResource/2026-07-29/properOrder_down_icon1785291938907.png';
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
CachedNetworkImage(
|
||||
imageUrl: ImgUrl.build(up),
|
||||
width: 12.w,
|
||||
height: 7.h,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
CachedNetworkImage(
|
||||
imageUrl: ImgUrl.build(down),
|
||||
width: 12.w,
|
||||
height: 7.h,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMyRankCard() {
|
||||
final rank = _myRank!;
|
||||
return Container(
|
||||
|
||||
@@ -253,7 +253,7 @@ class _PostListBodyState extends ConsumerState<PostListBody> {
|
||||
padding: EdgeInsets.symmetric(vertical: 20.h),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'没有更多了',
|
||||
'- AI 爱学蝶变提醒你 没有更多了 -',
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: const Color(0xFFB4C2E0),
|
||||
|
||||
Reference in New Issue
Block a user