From f70b32ec3fe22434b76b4858e5f385b116b1fcdc Mon Sep 17 00:00:00 2001 From: speakeloudest Date: Tue, 9 Dec 2025 07:23:26 -0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0ios=E6=94=AF=E4=BB=98?= =?UTF-8?q?&ui=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kr_purchase_membership_controller.dart | 1 + .../views/kr_purchase_membership_view.dart | 188 +++++++++--------- 2 files changed, 94 insertions(+), 95 deletions(-) diff --git a/lib/app/modules/kr_purchase_membership/controllers/kr_purchase_membership_controller.dart b/lib/app/modules/kr_purchase_membership/controllers/kr_purchase_membership_controller.dart index c659ddf..82cf2bf 100755 --- a/lib/app/modules/kr_purchase_membership/controllers/kr_purchase_membership_controller.dart +++ b/lib/app/modules/kr_purchase_membership/controllers/kr_purchase_membership_controller.dart @@ -872,6 +872,7 @@ class KRPurchaseMembershipController extends GetxController { label: 'Hi快VPN 服务', amount: kr_getPlanPrice( kr_plans[kr_selectedPlanIndex.value], + discountIndex: kr_selectedDiscountIndex.value ).toStringAsFixed(2), ), ], diff --git a/lib/app/modules/kr_purchase_membership/views/kr_purchase_membership_view.dart b/lib/app/modules/kr_purchase_membership/views/kr_purchase_membership_view.dart index 93372c0..c5265c5 100755 --- a/lib/app/modules/kr_purchase_membership/views/kr_purchase_membership_view.dart +++ b/lib/app/modules/kr_purchase_membership/views/kr_purchase_membership_view.dart @@ -47,102 +47,100 @@ class KRPurchaseMembershipView extends GetView padding: const EdgeInsets.only(left: 20), child: Stack( children: [ - Padding( - padding: EdgeInsets.only(bottom: 80.0), - child: Obx(() => SingleChildScrollView( - child: Column( - children: [ - /*_kr_buildAccountSection(context),*/ - if (controller.kr_isLoading.value) - Container( - height: - MediaQuery.of(context).size.height * 0.5, - child: Center( - child: KRSimpleLoading( - color: Colors.white, - size: 50.0, - ), - ), - ) - else if (controller.kr_plans.isEmpty) - Container( - height: - MediaQuery.of(context).size.height * 0.5, - child: Center( - child: Text( - AppTranslations - .kr_purchaseMembership.noData, - style: KrAppTextStyle( - fontSize: 14, - color: Theme.of(context) - .textTheme - .bodyMedium - ?.color, - ), - ), - ), - ) - else - Container( - margin: EdgeInsets.only( - left: 40.0 - 20, right: 40.0), - child: Column( - children: [ - // 套餐选择部分 - Container( - padding: EdgeInsets.all(0.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Column( - // 使用 List.generate 动态创建卡片列表 - children: List.generate( - controller.kr_getTotalOptionsCount( - controller.kr_plans[controller - .kr_selectedPlanIndex - .value]), - (index) { - final plan = controller - .kr_plans[ - controller - .kr_selectedPlanIndex - .value]; - final discountIndex = - plan.kr_discount.isEmpty - ? null - : index; - // 使用 Padding 来为每个卡片添加底部的间距,模拟 mainAxisSpacing - return Padding( - padding: EdgeInsets.only( - bottom: 8.0), - child: SizedBox( - height: 130.0, - child: - _kr_buildPlanOptionCard( - plan, - controller - .kr_selectedPlanIndex - .value, - discountIndex, - context, - index, - ), - ), - ); - }, - ), - ), - ], - ), - ), - ], + Obx(() { + return Positioned.fill( + bottom: 90.0, + child: SingleChildScrollView( + child: Column( + children: [ + /*_kr_buildAccountSection(context),*/ + if (controller.kr_isLoading.value) + Container( + height: MediaQuery.of(context).size.height * 0.5, + child: Center( + child: KRSimpleLoading( + color: Colors.white, + size: 50.0, ), ), - ], - ), - )), - ), + ) + else if (controller.kr_plans.isEmpty) + Container( + height: MediaQuery.of(context).size.height * 0.5, + child: Center( + child: Text( + AppTranslations.kr_purchaseMembership.noData, + style: KrAppTextStyle( + fontSize: 14, + color: Theme.of(context) + .textTheme + .bodyMedium + ?.color, + ), + ), + ), + ) + else + Container( + margin: + EdgeInsets.only(left: 40.0 - 20, right: 40.0), + child: Column( + children: [ + // 套餐选择部分 + Container( + padding: EdgeInsets.all(0.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Column( + // 使用 List.generate 动态创建卡片列表 + children: List.generate( + controller.kr_getTotalOptionsCount( + controller.kr_plans[controller + .kr_selectedPlanIndex + .value]), + (index) { + final plan = controller.kr_plans[ + controller + .kr_selectedPlanIndex + .value]; + final discountIndex = + plan.kr_discount.isEmpty + ? null + : index; + // 使用 Padding 来为每个卡片添加底部的间距,模拟 mainAxisSpacing + return Padding( + padding: EdgeInsets.only( + bottom: 8.0), + child: SizedBox( + height: 130.0, + child: + _kr_buildPlanOptionCard( + plan, + controller + .kr_selectedPlanIndex + .value, + discountIndex, + context, + index, + ), + ), + ); + }, + ), + ), + ], + ), + ), + ], + ), + ), + ], + ), + ), + ); + }), Positioned( top: 160.0, // 距离顶部的距离 right: 10.0, // 固定在右侧 20.w 的位置 @@ -151,7 +149,7 @@ class KRPurchaseMembershipView extends GetView imageType: ImageType.svg, ), ), - const HIHelpEntrance(isLight: false) + const HIHelpEntrance(isLight: false) ], ), ),