Quellcode durchsuchen

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

hezihao vor 6 Monaten
Ursprung
Commit
79ee0e45b8

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

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

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

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

+ 26 - 0
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:carousel_slider/carousel_slider.dart';
 import 'package:get/get.dart';
+import 'package:keyboard/widget/platform_util.dart';
 
 import '../../../data/bean/character_info.dart';
 import '../../../data/consts/constants.dart';
@@ -102,6 +103,31 @@ class NewDiscountPage extends BasePage<NewDiscountController> {
                 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,
+                    ),
+                  ),
+                ),
+              ),
           ],
         ),
       ),

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

@@ -137,6 +137,7 @@ class StringName {
   static final String textSpanPrivacyPolicy = 'text_span_privacy_policy'.tr; // 《隐私政策》
   static final String textSpanServiceTerms = 'text_span_service_terms'.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 recoverSubscribeConfirm = 'recover_subscribe_confirm'.tr; // 知道了
   static final String textSpanMembershipAgreement = 'text_span_membership_agreement'.tr; // 《会员服务协议》
@@ -510,6 +511,7 @@ class StringMultiSource {
       'text_span_privacy_policy': '《隐私政策》',
       'text_span_service_terms': '《服务条款》',
       'text_span_user_agreement': '《用户协议》',
+      'recover_subscribe': '恢复订阅',
       'recover_subscribe_title': '已恢复订阅',
       'recover_subscribe_confirm': '知道了',
       'text_span_membership_agreement': '《会员服务协议》',