feat(app): 接入金币充值与会员商品下单
This commit is contained in:
1 parent
ec2db6842e
commit
730e38622f
21 files changed
+1325
-1
No files matched your search
@@ -25,6 +25,7 @@ import '../account/account_entry_card.dart';
|
||||
import '../downloads/downloads_page.dart';
|
||||
import '../favorites/favorites_page.dart';
|
||||
import '../notices/notices_page.dart';
|
||||
import '../store/vip_page.dart';
|
||||
import '../wallet/wallet_page.dart';
|
||||
import '../watch_records/watch_records_page.dart';
|
||||
import 'mine_binding.dart';
|
||||
@@ -373,6 +374,21 @@ class _MyPageState extends State<MyPage> {
|
||||
);
|
||||
}
|
||||
|
||||
void _openVip() {
|
||||
if (!widget.signedIn) {
|
||||
widget.onSignIn?.call();
|
||||
return;
|
||||
}
|
||||
final wallet = widget.wallet;
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute<void>(
|
||||
builder: (_) => VipPage(
|
||||
onPurchased: wallet == null ? null : () => unawaited(wallet.load()),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _openWallet(BuildContext context) {
|
||||
if (!widget.signedIn) {
|
||||
widget.onSignIn?.call();
|
||||
@@ -835,6 +851,12 @@ class _MyPageState extends State<MyPage> {
|
||||
MaterialPageRoute(builder: (_) => const DownloadsPage()),
|
||||
),
|
||||
),
|
||||
_menuTile(
|
||||
key: const Key('mine-vip'),
|
||||
icon: Icons.workspace_premium_outlined,
|
||||
title: l10n.vipMembership,
|
||||
onTap: _openVip,
|
||||
),
|
||||
_menuTile(
|
||||
icon: Icons.settings_rounded,
|
||||
title: l10n.settings,
|
||||
|
||||
Reference in new issue
Block a user