feat(app): 接入首页轮播 banner
This commit is contained in:
1 parent
061aac6577
commit
7b927c794e
7 files changed
+469
-37
No files matched your search
@@ -76,6 +76,7 @@ class HomePage extends StatelessWidget {
|
||||
key: ValueKey(catalog.dramas.first.id),
|
||||
dramas: catalog.dramas,
|
||||
sections: catalog.sections,
|
||||
banners: catalog.banners,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -100,10 +101,16 @@ class HomeFailureView extends StatelessWidget {
|
||||
|
||||
/// The three primary destinations share a single route and keep their state.
|
||||
class _HomeTabs extends StatefulWidget {
|
||||
const _HomeTabs({super.key, required this.dramas, required this.sections});
|
||||
const _HomeTabs({
|
||||
super.key,
|
||||
required this.dramas,
|
||||
required this.sections,
|
||||
required this.banners,
|
||||
});
|
||||
|
||||
final List<Drama> dramas;
|
||||
final List<FeedSection> sections;
|
||||
final List<FeedBanner> banners;
|
||||
|
||||
@override
|
||||
State<_HomeTabs> createState() => _HomeTabsState();
|
||||
@@ -182,6 +189,13 @@ class _HomeTabsState extends State<_HomeTabs> {
|
||||
onSignIn: () => openAuthPage(context),
|
||||
onCoins: logic.openProfile,
|
||||
onRewards: logic.openProfile,
|
||||
banners: widget.banners,
|
||||
onBannerSelected: (banner) {
|
||||
final dramaId = banner.dramaId;
|
||||
if (dramaId != null) {
|
||||
unawaited(logic.openDramaById(context, dramaId));
|
||||
}
|
||||
},
|
||||
onAction: (action) => logic.discoverAction(context, action),
|
||||
),
|
||||
MyPage(
|
||||
|
||||
Reference in new issue
Block a user