Browse Source

[feat]会员折扣页,增加iOS平台的恢复订阅按钮,隐藏支付方式选择

hezihao 6 months ago
parent
commit
c7624b16c8

+ 1 - 0
assets/string/base/string.xml

@@ -184,6 +184,7 @@
     <string name="text_span_user_agreement">《用户协议》</string>
     <string name="text_span_user_agreement">《用户协议》</string>
     <string name="text_span_membership_agreement">《会员服务协议》</string>
     <string name="text_span_membership_agreement">《会员服务协议》</string>
 
 
+    <string name="recover_subscribe">恢复订阅</string>
     <string name="recover_subscribe_title">已恢复订阅</string>
     <string name="recover_subscribe_title">已恢复订阅</string>
     <string name="recover_subscribe_confirm">知道了</string>
     <string name="recover_subscribe_confirm">知道了</string>
 
 

+ 9 - 1
lib/module/store/new_discount/new_discount_controller.dart

@@ -36,6 +36,7 @@ import '../../../utils/http_handler.dart';
 import '../../../utils/payment_status_manager.dart';
 import '../../../utils/payment_status_manager.dart';
 import '../../../utils/toast_util.dart';
 import '../../../utils/toast_util.dart';
 import '../store_banner_bean.dart';
 import '../store_banner_bean.dart';
+import '../subscribe/recover_subscribe_dialog.dart';
 import '../suprise/surprise_dialog.dart';
 import '../suprise/surprise_dialog.dart';
 import '../ticket/discount_ticket_dialog.dart';
 import '../ticket/discount_ticket_dialog.dart';
 import 'new_discount_page.dart';
 import 'new_discount_page.dart';
@@ -501,7 +502,6 @@ class NewDiscountController extends BaseController
           },
           },
           clickCancel: () {},
           clickCancel: () {},
         );
         );
-
       }
       }
     } else {
     } else {
       setFirstIntoDiscount(false);
       setFirstIntoDiscount(false);
@@ -524,4 +524,12 @@ class NewDiscountController extends BaseController
       },
       },
     );
     );
   }
   }
+
+  /// 恢复订阅
+  void clickRestore() {
+    // 显示恢复订阅弹窗
+    // RecoverSubscribeDialog.show("周会员2025年3月6日到期。", () {
+    //   AtmobLog.d(tag, "恢复订阅弹窗 => 点击确认");
+    // });
+  }
 }
 }

+ 36 - 6
lib/module/store/new_discount/new_discount_page.dart

@@ -6,6 +6,7 @@ import 'package:keyboard/module/store/new_discount/new_discount_controller.dart'
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 import 'package:carousel_slider/carousel_slider.dart';
 import 'package:carousel_slider/carousel_slider.dart';
 import 'package:get/get.dart';
 import 'package:get/get.dart';
+import 'package:keyboard/widget/platform_util.dart';
 
 
 import '../../../data/bean/character_info.dart';
 import '../../../data/bean/character_info.dart';
 import '../../../data/consts/payment_type.dart';
 import '../../../data/consts/payment_type.dart';
@@ -57,7 +58,8 @@ class NewDiscountPage extends BasePage<NewDiscountController> {
                   SizedBox(height: 16.w),
                   SizedBox(height: 16.w),
                   _buildGoodsCard(),
                   _buildGoodsCard(),
                   SizedBox(height: 12.w),
                   SizedBox(height: 12.w),
-                  _buildPayWayCard(),
+                  // iOS平台,没有支付方式可以选择
+                  if (!PlatformUtil.isIOS) _buildPayWayCard(),
                   SizedBox(height: 8.w),
                   SizedBox(height: 8.w),
                   _buildSelectedDesc(),
                   _buildSelectedDesc(),
                   SizedBox(height: 30.w),
                   SizedBox(height: 30.w),
@@ -91,6 +93,31 @@ class NewDiscountPage extends BasePage<NewDiscountController> {
                 height: 32.w,
                 height: 32.w,
               ),
               ),
             ),
             ),
+            // iOS平台,才有恢复订阅按钮
+            if (PlatformUtil.isIOS)
+              GestureDetector(
+                onTap: () {
+                  controller.clickRestore();
+                },
+                child: Container(
+                  padding: EdgeInsets.symmetric(
+                    horizontal: 12.w,
+                    vertical: 6.w,
+                  ),
+                  decoration: BoxDecoration(
+                    color: ColorName.black40,
+                    borderRadius: BorderRadius.circular(16.r),
+                  ),
+                  child: Text(
+                    StringName.recoverSubscribe,
+                    style: TextStyle(
+                      color: ColorName.white80,
+                      fontSize: 14.sp,
+                      fontWeight: FontWeight.w500,
+                    ),
+                  ),
+                ),
+              ),
           ],
           ],
         ),
         ),
       ),
       ),
@@ -428,7 +455,6 @@ class NewDiscountPage extends BasePage<NewDiscountController> {
               ),
               ),
       child: Row(
       child: Row(
         children: [
         children: [
-
           Text(
           Text(
             "¥",
             "¥",
             style: TextStyle(
             style: TextStyle(
@@ -441,7 +467,9 @@ class NewDiscountPage extends BasePage<NewDiscountController> {
             ),
             ),
           ),
           ),
           Text(
           Text(
-          (item.code=="vip_permanent")? '${item.priceDescNumber}':'${item.amountText}',
+            (item.code == "vip_permanent")
+                ? '${item.priceDescNumber}'
+                : '${item.amountText}',
             textAlign: TextAlign.center,
             textAlign: TextAlign.center,
             style: TextStyle(
             style: TextStyle(
               color:
               color:
@@ -452,9 +480,9 @@ class NewDiscountPage extends BasePage<NewDiscountController> {
               fontWeight: FontWeight.w700,
               fontWeight: FontWeight.w700,
             ),
             ),
           ),
           ),
-          if (item.code=="vip_permanent")
+          if (item.code == "vip_permanent")
             Text(
             Text(
-                item.priceDescUnit,
+              item.priceDescUnit,
               style: TextStyle(
               style: TextStyle(
                 color: Colors.black.withAlpha(153),
                 color: Colors.black.withAlpha(153),
                 fontSize: 12.sp,
                 fontSize: 12.sp,
@@ -514,7 +542,9 @@ class NewDiscountPage extends BasePage<NewDiscountController> {
                 ],
                 ],
               ),
               ),
               Text(
               Text(
-                (item.code=="vip_permanent")? '${item.description}':'${item.priceDesc}',
+                (item.code == "vip_permanent")
+                    ? '${item.description}'
+                    : '${item.priceDesc}',
 
 
                 style: TextStyle(
                 style: TextStyle(
                   color: Colors.black.withAlpha(153),
                   color: Colors.black.withAlpha(153),

+ 2 - 0
lib/resource/string.gen.dart

@@ -133,6 +133,7 @@ class StringName {
   static final String textSpanPrivacyPolicy = 'text_span_privacy_policy'.tr; // 《隐私政策》
   static final String textSpanPrivacyPolicy = 'text_span_privacy_policy'.tr; // 《隐私政策》
   static final String textSpanServiceTerms = 'text_span_service_terms'.tr; // 《服务条款》
   static final String textSpanServiceTerms = 'text_span_service_terms'.tr; // 《服务条款》
   static final String textSpanUserAgreement = 'text_span_user_agreement'.tr; // 《用户协议》
   static final String textSpanUserAgreement = 'text_span_user_agreement'.tr; // 《用户协议》
+  static final String recoverSubscribe = 'recover_subscribe'.tr; // 恢复订阅
   static final String recoverSubscribeTitle = 'recover_subscribe_title'.tr; // 已恢复订阅
   static final String recoverSubscribeTitle = 'recover_subscribe_title'.tr; // 已恢复订阅
   static final String recoverSubscribeConfirm = 'recover_subscribe_confirm'.tr; // 知道了
   static final String recoverSubscribeConfirm = 'recover_subscribe_confirm'.tr; // 知道了
   static final String textSpanMembershipAgreement = 'text_span_membership_agreement'.tr; // 《会员服务协议》
   static final String textSpanMembershipAgreement = 'text_span_membership_agreement'.tr; // 《会员服务协议》
@@ -494,6 +495,7 @@ class StringMultiSource {
       'text_span_privacy_policy': '《隐私政策》',
       'text_span_privacy_policy': '《隐私政策》',
       'text_span_service_terms': '《服务条款》',
       'text_span_service_terms': '《服务条款》',
       'text_span_user_agreement': '《用户协议》',
       'text_span_user_agreement': '《用户协议》',
+      'recover_subscribe': '恢复订阅',
       'recover_subscribe_title': '已恢复订阅',
       'recover_subscribe_title': '已恢复订阅',
       'recover_subscribe_confirm': '知道了',
       'recover_subscribe_confirm': '知道了',
       'text_span_membership_agreement': '《会员服务协议》',
       'text_span_membership_agreement': '《会员服务协议》',