From db247d253b639c991d3127a60677d32846efa814 Mon Sep 17 00:00:00 2001 From: Rust Date: Wed, 22 Oct 2025 17:51:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=94=AF=E4=BB=98=E5=90=8E?= =?UTF-8?q?=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/kr_order_status_view.dart | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/lib/app/modules/kr_order_status/views/kr_order_status_view.dart b/lib/app/modules/kr_order_status/views/kr_order_status_view.dart index 4ff7715..4dcb823 100755 --- a/lib/app/modules/kr_order_status/views/kr_order_status_view.dart +++ b/lib/app/modules/kr_order_status/views/kr_order_status_view.dart @@ -63,6 +63,10 @@ class KROrderStatusView extends GetView { SizedBox(height: 16.h), // 描述文本 _buildDescriptionText(), + SizedBox(height: 32.h), + // 操作按钮(支付成功时显示) + if (controller.kr_isPaymentSuccess.value) + _buildSuccessButtons(), const Spacer(), ], ), @@ -112,4 +116,73 @@ class KROrderStatusView extends GetView { ), ); } + + /// 构建支付成功后的操作按钮 + Widget _buildSuccessButtons() { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 24.w), + child: Column( + children: [ + // 返回首页按钮 + SizedBox( + width: double.infinity, + height: 48.h, + child: ElevatedButton( + onPressed: () { + // 返回到首页(清空导航栈) + Get.offAllNamed('/'); + }, + style: ElevatedButton.styleFrom( + backgroundColor: Theme.of(Get.context!).primaryColor, + foregroundColor: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12.r), + ), + elevation: 0, + ), + child: Text( + AppTranslations.kr_orderStatus.backToHome ?? '返回首页', + style: KrAppTextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: Colors.white, + ), + ), + ), + ), + SizedBox(height: 12.h), + // 查看订阅按钮 + SizedBox( + width: double.infinity, + height: 48.h, + child: OutlinedButton( + onPressed: () { + // 返回到首页并切换到订阅页面 + Get.offAllNamed('/'); + // 可以通过事件总线发送消息切换tab + }, + style: OutlinedButton.styleFrom( + foregroundColor: Theme.of(Get.context!).primaryColor, + side: BorderSide( + color: Theme.of(Get.context!).primaryColor, + width: 1.5, + ), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12.r), + ), + ), + child: Text( + AppTranslations.kr_orderStatus.viewSubscription ?? '查看订阅', + style: KrAppTextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: Theme.of(Get.context!).primaryColor, + ), + ), + ), + ), + ], + ), + ); + } }