diff --git a/lib/features/profile/profile_screen.dart b/lib/features/profile/profile_screen.dart index 932a488..1b56bf2 100644 --- a/lib/features/profile/profile_screen.dart +++ b/lib/features/profile/profile_screen.dart @@ -5,6 +5,7 @@ import 'package:cached_network_image/cached_network_image.dart'; import '../../core/api/api_config.dart'; import '../../core/api/services/user_api.dart'; import '../../core/auth/auth_service.dart'; +import '../recharge/payment_webview_screen.dart'; import '../../core/theme/app_colors.dart'; import '../../core/user/user_state.dart'; import '../../core/theme/app_spacing.dart'; @@ -101,14 +102,28 @@ class _ProfileScreenState extends State { _MenuSection( items: [ _MenuItem( - title: 'Credit Store', + title: 'Privacy Policy', icon: LucideIcons.chevron_right, - onTap: () => Navigator.of(context).pushNamed('/recharge'), + onTap: () => Navigator.of(context).push( + MaterialPageRoute( + builder: (_) => PaymentWebViewScreen( + paymentUrl: 'http://www.petsheroai.xyz/privacy.html', + title: 'Privacy Policy', + ), + ), + ), ), _MenuItem( - title: 'Settings', + title: 'User Agreement', icon: LucideIcons.chevron_right, - onTap: () {}, + onTap: () => Navigator.of(context).push( + MaterialPageRoute( + builder: (_) => PaymentWebViewScreen( + paymentUrl: 'http://www.petsheroai.xyz/terms.html', + title: 'User Agreement', + ), + ), + ), ), ], ), diff --git a/lib/features/recharge/payment_webview_screen.dart b/lib/features/recharge/payment_webview_screen.dart index 34d5dab..8f480e6 100644 --- a/lib/features/recharge/payment_webview_screen.dart +++ b/lib/features/recharge/payment_webview_screen.dart @@ -6,11 +6,16 @@ import 'package:webview_flutter_android/webview_flutter_android.dart'; import '../../core/theme/app_colors.dart'; import '../../shared/widgets/top_nav_bar.dart'; -/// 三方支付成功后在应用内打开 convert 链接的 WebView 页面 +/// 应用内 WebView 页面(支付、隐私政策、用户协议等) class PaymentWebViewScreen extends StatefulWidget { - const PaymentWebViewScreen({super.key, required this.paymentUrl}); + const PaymentWebViewScreen({ + super.key, + required this.paymentUrl, + this.title = 'Payment', + }); final String paymentUrl; + final String title; @override State createState() => _PaymentWebViewScreenState(); @@ -41,7 +46,7 @@ class _PaymentWebViewScreenState extends State { appBar: PreferredSize( preferredSize: const Size.fromHeight(56), child: TopNavBar( - title: 'Payment', + title: widget.title, showBackButton: true, onBack: () => Navigator.of(context).pop(), ),