Просмотр исходного кода

fix: 修复18系统键盘无法跳转的问题,修复bug

Destiny 6 месяцев назад
Родитель
Сommit
8e61ea8370

+ 0 - 14
ios/AiKeyboard/Info.plist

@@ -8,16 +8,6 @@
 	</array>
 	<key>ITSAppUsesNonExemptEncryption</key>
 	<false/>
-	<key>LSApplicationQueriesSchemes</key>
-	<array>
-		<string>com.qihuan.zhuiaijianpan</string>
-	</array>
-	<key>ITSAppUsesNonExemptEncryption</key>
-	<false/>
-	<key>LSApplicationQueriesSchemes</key>
-	<array>
-		<string>com.qihuan.zhuiaijianpan</string>
-	</array>
 	<key>NSAppTransportSecurity</key>
 	<dict>
 		<key>NSAllowsArbitraryLoads</key>
@@ -41,9 +31,5 @@
 		<key>NSExtensionPrincipalClass</key>
 		<string>$(PRODUCT_MODULE_NAME).KeyboardViewController</string>
 	</dict>
-	<key>UIAppFonts</key>
-	<array>
-		<string>淘宝买菜体.ttf</string>
-	</array>
 </dict>
 </plist>

+ 42 - 15
ios/AiKeyboard/KeyboardViewController.swift

@@ -584,24 +584,51 @@ extension KeyboardViewController: KeyboardMenuViewDelegate, KeyboardExchangeView
         let url = URL(string: "com.qihuan.zhuiaijianpan:///member")!
         openURL(url)
     }
-
-    // 通用的打开URL方法
-    private func openURL(_ url: URL) {
-        var responder = self as UIResponder?
-        while (responder != nil && !(responder is UIApplication)) {
-            responder = responder?.next
-        }
-        if responder != nil {
-            let selectorOpenURL = sel_registerName("openURL:")
-            if responder!.responds(to: selectorOpenURL) {
-                self.dismissKeyboard()
-                responder?.perform(selectorOpenURL, with: url)
+    
+    @objc @discardableResult private func openURL(_ url: URL) -> Bool {
+        var responder: UIResponder? = self
+        while responder != nil {
+            if let application = responder as? UIApplication {
+                if #available(iOS 18.0, *) {
+                    application.open(url, options: [:], completionHandler: nil)
+                    return true
+                } else {
+                    return application.perform(#selector(openURL(_:)), with: url) != nil
+                }
             }
+            responder = responder?.next
         }
-        
-        // 不知道为什么无法使用
-//        self.extensionContext?.open(url, completionHandler: nil)
+        return false
     }
+
+//    // 通用的打开URL方法
+//    private func openURL(_ url: URL) {
+////        var responder = self as UIResponder?
+////        while (responder != nil && !(responder is UIApplication)) {
+////            responder = responder?.next
+////        }
+////        if responder != nil {
+////            let selectorOpenURL = sel_registerName("openURL:options:completionHandler:")
+////            if responder!.responds(to: selectorOpenURL) {
+////                self.dismissKeyboard()
+////                responder?.perform(selectorOpenURL, with: [url, nil, nil])
+////            }
+////        }
+//        
+//        var responder: UIResponder? = self
+//        while responder != nil {
+//            if let application = responder as? UIApplication {
+//                if #available(iOS 18.0, *) {
+//                    application.open(url, options: [:], completionHandler: nil)
+//                } else {
+//                    application.perform(#selector(openURL(_:)), with: url)
+//                }
+//            }
+//            responder = responder?.next
+//        }
+//        // 不知道为什么无法使用
+////        self.extensionContext?.open(url, completionHandler: nil)
+//    }
     
     // 选择键盘按钮点击
     @objc func changeBtnClickAction() {

+ 1 - 1
ios/Podfile.lock

@@ -230,6 +230,6 @@ SPEC CHECKSUMS:
   webview_flutter_wkwebview: a4af96a051138e28e29f60101d094683b9f82188
   wechat_kit: b6853fe0933b9a60a008a508e709c14f6ed2dc70
 
-PODFILE CHECKSUM: 46e41cd7a608d3db06d8570d6fb41a774efc4103
+PODFILE CHECKSUM: da36ffc2916cc119cebb699a7d0027532f94ed44
 
 COCOAPODS: 1.16.2

+ 0 - 117
ios/Runner.xcodeproj/project.pbxproj

@@ -686,123 +686,6 @@
 			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
 			showEnvVarsInLog = 0;
 		};
-		C84FD05E1687413028FE5569 /* [CP] Check Pods Manifest.lock */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			inputFileListPaths = (
-			);
-			inputPaths = (
-				"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
-				"${PODS_ROOT}/Manifest.lock",
-			);
-			name = "[CP] Check Pods Manifest.lock";
-			outputFileListPaths = (
-			);
-			outputPaths = (
-				"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = /bin/sh;
-			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
-			showEnvVarsInLog = 0;
-		};
-		EADF2BA47287E2D0EA1688E0 /* [CP] Embed Pods Frameworks */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			inputFileListPaths = (
-				"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
-			);
-			name = "[CP] Embed Pods Frameworks";
-			outputFileListPaths = (
-				"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = /bin/sh;
-			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
-			showEnvVarsInLog = 0;
-		};
-		C84FD05E1687413028FE5569 /* [CP] Check Pods Manifest.lock */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			inputFileListPaths = (
-			);
-			inputPaths = (
-				"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
-				"${PODS_ROOT}/Manifest.lock",
-			);
-			name = "[CP] Check Pods Manifest.lock";
-			outputFileListPaths = (
-			);
-			outputPaths = (
-				"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = /bin/sh;
-			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
-			showEnvVarsInLog = 0;
-		};
-		EADF2BA47287E2D0EA1688E0 /* [CP] Embed Pods Frameworks */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			inputFileListPaths = (
-				"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
-			);
-			name = "[CP] Embed Pods Frameworks";
-			outputFileListPaths = (
-				"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = /bin/sh;
-			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
-			showEnvVarsInLog = 0;
-		};
-		C84FD05E1687413028FE5569 /* [CP] Check Pods Manifest.lock */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			inputFileListPaths = (
-			);
-			inputPaths = (
-				"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
-				"${PODS_ROOT}/Manifest.lock",
-			);
-			name = "[CP] Check Pods Manifest.lock";
-			outputFileListPaths = (
-			);
-			outputPaths = (
-				"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = /bin/sh;
-			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
-			showEnvVarsInLog = 0;
-		};
-		EADF2BA47287E2D0EA1688E0 /* [CP] Embed Pods Frameworks */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			inputFileListPaths = (
-				"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
-			);
-			name = "[CP] Embed Pods Frameworks";
-			outputFileListPaths = (
-				"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = /bin/sh;
-			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
-			showEnvVarsInLog = 0;
-		};
 /* End PBXShellScriptBuildPhase section */
 
 /* Begin PBXSourcesBuildPhase section */

+ 1 - 1
ios/Runner/AppDelegate.swift

@@ -40,7 +40,7 @@ import UIKit
                 channel.invokeMethod("navigateToCustomCharacter", arguments: nil)
             }
         }
-        
+
         return true
     }
     

+ 17 - 17
ios/Runner/Info.plist

@@ -2,23 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
-	<key>NSCameraUsageDescription</key>
-	<string>追爱小键盘需要使用您的拍照功能以上传图片</string>
-	<key>NSMicrophoneUsageDescription</key>
-	<string>追爱小键盘需要使用您的录音功能以上传录音</string>
-	<key>NSPhotoLibraryUsageDescription</key>
-	<string>追爱小键盘需要使用您的图库照片以上传图片</string>
-	<key>LSApplicationQueriesSchemes</key>
-	<array>
-		<string>weixin</string>
-		<string>weixinULAPI</string>
-		<string>weixinURLParamsAPI</string>
-	</array>
-	<key>NSAppTransportSecurity</key>
-	<dict>
-		<key>NSAllowsArbitraryLoads</key>
-		<true/>
-	</dict>
 	<key>CADisableMinimumFrameDurationOnPhone</key>
 	<true/>
 	<key>CFBundleDevelopmentRegion</key>
@@ -56,8 +39,25 @@
 	<string>$(FLUTTER_BUILD_NUMBER)</string>
 	<key>ITSAppUsesNonExemptEncryption</key>
 	<false/>
+	<key>LSApplicationQueriesSchemes</key>
+	<array>
+		<string>weixin</string>
+		<string>weixinULAPI</string>
+		<string>weixinURLParamsAPI</string>
+	</array>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
+	<key>NSAppTransportSecurity</key>
+	<dict>
+		<key>NSAllowsArbitraryLoads</key>
+		<true/>
+	</dict>
+	<key>NSCameraUsageDescription</key>
+	<string>追爱小键盘需要使用您的拍照功能以上传图片</string>
+	<key>NSMicrophoneUsageDescription</key>
+	<string>追爱小键盘需要使用您的录音功能以上传录音</string>
+	<key>NSPhotoLibraryUsageDescription</key>
+	<string>追爱小键盘需要使用您的图库照片以上传图片</string>
 	<key>NSUserTrackingUsageDescription</key>
 	<string>追爱小键盘需要使用您的广告标识符以显示个性化广告</string>
 	<key>UIApplicationSupportsIndirectInputEvents</key>

+ 4 - 0
lib/data/bean/goods_info.dart

@@ -41,6 +41,8 @@ class GoodsInfo {
   int? firstAmount;
   @JsonKey(name: 'discountPriceDesc')
   String? discountPriceDesc;
+  @JsonKey(name: 'realAmount')
+  int? realAmount;
 
   GoodsInfo({
     required this.id,
@@ -61,6 +63,7 @@ class GoodsInfo {
     this.timeLimitDesc,
     this.firstAmount,
     this.discountPriceDesc,
+    this.realAmount,
   });
 
   get amountText => (amount / 100).toFormattedString(2);
@@ -98,6 +101,7 @@ class GoodsInfo {
       code: code,
       firstAmount: firstAmount,
       discountPriceDesc: discountPriceDesc,
+      realAmount: realAmount,
     );
   }
 }

+ 2 - 0
lib/data/bean/goods_info.g.dart

@@ -28,6 +28,7 @@ GoodsInfo _$GoodsInfoFromJson(Map<String, dynamic> json) => GoodsInfo(
   timeLimitDesc: json['timeLimitDesc'] as String?,
   firstAmount: (json['firstAmount'] as num?)?.toInt(),
   discountPriceDesc: json['discountPriceDesc'] as String?,
+  realAmount: (json['realAmount'] as num?)?.toInt(),
 );
 
 Map<String, dynamic> _$GoodsInfoToJson(GoodsInfo instance) => <String, dynamic>{
@@ -49,4 +50,5 @@ Map<String, dynamic> _$GoodsInfoToJson(GoodsInfo instance) => <String, dynamic>{
   'code': instance.code,
   'firstAmount': instance.firstAmount,
   'discountPriceDesc': instance.discountPriceDesc,
+  'realAmount': instance.realAmount,
 };

+ 3 - 28
lib/di/get_it.config.dart

@@ -149,6 +149,9 @@ extension GetItInjectableX on _i174.GetIt {
       () => _i873.IntimacyGenerateCharacterEditController(),
     );
     gh.factory<_i923.BrowserController>(() => _i923.BrowserController());
+    gh.factory<_i232.DeleteProfileConfirmController>(
+      () => _i232.DeleteProfileConfirmController(),
+    );
     gh.factory<_i248.KeyboardGuidePageController>(
       () => _i248.KeyboardGuidePageController(),
     );
@@ -158,9 +161,6 @@ extension GetItInjectableX on _i174.GetIt {
     gh.factory<_i421.KeyboardTutorialVideoIosViewController>(
       () => _i421.KeyboardTutorialVideoIosViewController(),
     );
-    gh.factory<_i507.KeyboardTutorialController>(
-      () => _i507.KeyboardTutorialController(),
-    );
     gh.factory<_i925.KeyboardTutorialVideoAndroidViewController>(
       () => _i925.KeyboardTutorialVideoAndroidViewController(),
     );
@@ -177,23 +177,6 @@ extension GetItInjectableX on _i174.GetIt {
     gh.factory<_i827.RecoverSubscribeController>(
       () => _i827.RecoverSubscribeController(),
     );
-    gh.factory<_i232.DeleteProfileConfirmController>(
-      () => _i232.DeleteProfileConfirmController(),
-    );
-    gh.factory<_i101.KeyboardTutorialVideoController>(
-      () => _i101.KeyboardTutorialVideoController(),
-    );
-    gh.factory<_i973.SplashController>(() => _i973.SplashController());
-    gh.factory<_i333.DiscountController>(() => _i333.DiscountController());
-    gh.factory<_i827.RecoverSubscribeController>(
-      () => _i827.RecoverSubscribeController(),
-    );
-    gh.factory<_i1060.ZodiacLoveIntimacyController>(
-      () => _i1060.ZodiacLoveIntimacyController(),
-    );
-    gh.factory<_i415.KeyboardMethodHandler>(
-      () => _i415.KeyboardMethodHandler(),
-    );
     gh.lazySingleton<_i495.WechatLoginService>(
       () => _i495.WechatLoginService(),
     );
@@ -333,14 +316,6 @@ extension GetItInjectableX on _i174.GetIt {
         gh<_i738.IntimacyAnalyzeConfigHelper>(),
       ),
     );
-    gh.factory<_i344.StoreController>(
-      () => _i344.StoreController(
-        gh<_i987.StoreRepository>(),
-        gh<_i83.AccountRepository>(),
-        gh<_i779.PaymentStatusManager>(),
-        gh<_i50.ConfigRepository>(),
-      ),
-    );
     gh.factory<_i566.IntimacyScaleController>(
       () => _i566.IntimacyScaleController(gh<_i274.KeyboardRepository>()),
     );

+ 1 - 0
lib/module/character_custom/list/character_custom_list_controller.dart

@@ -6,6 +6,7 @@ import 'package:keyboard/base/base_controller.dart';
 import 'package:keyboard/data/repository/characters_repository.dart';
 import 'package:keyboard/data/repository/keyboard_repository.dart';
 import 'package:keyboard/dialog/login/login_dialog.dart';
+import 'package:keyboard/module/login/login_page.dart';
 import 'package:keyboard/utils/toast_util.dart';
 import 'package:keyboard/widget/platform_util.dart';
 

+ 1 - 0
lib/module/intro/intro_controller.dart

@@ -6,6 +6,7 @@ import 'package:get/get.dart';
 import 'package:keyboard/base/base_controller.dart';
 import 'package:flutter_screenutil/flutter_screenutil.dart';
 import 'package:keyboard/data/repository/account_repository.dart';
+import 'package:keyboard/module/login/login_page.dart';
 import 'package:keyboard/module/main/main_controller.dart';
 import 'package:keyboard/utils/toast_util.dart';
 import '../../data/consts/constants.dart';

+ 6 - 1
lib/module/mine/mine_controller.dart

@@ -172,7 +172,12 @@ class MineController extends BaseController {
     } else {
       EventHandler.report(EventId.event_14010);
       ToastUtil.show('请先登录');
-      LoginDialog.show();
+
+      if (PlatformUtil.isIOS) {
+        LoginPage.start();
+      } else {
+        LoginDialog.show();
+      }
       return;
     }
   }

+ 11 - 343
lib/module/store/new_discount/new_discount_controller.dart

@@ -12,6 +12,7 @@ import 'package:keyboard/data/bean/character_info.dart';
 import 'package:keyboard/data/repository/config_repository.dart';
 import 'package:keyboard/module/login/login_page.dart';
 import 'package:keyboard/module/store/new_discount/member_card_bean.dart';
+import 'package:keyboard/utils/error_handler.dart';
 import 'package:keyboard/utils/method_chanel_ios_util.dart';
 import 'package:keyboard/widget/platform_util.dart';
 import '../../../data/api/response/user_info_response.dart';
@@ -190,8 +191,10 @@ class NewDiscountController extends BaseController
     );
     if (filteredGoodsList.isNotEmpty) {
       _selectedGoodsInfoItem.value = filteredGoodsList.first;
+      CustomLoadingDialog.show();
       var isHasDiscount = await MethodChanelIOSUtil.isHasDiscount(goodsInfoList.first.appleGoodsId);
       isDiscount.value = isHasDiscount;
+      CustomLoadingDialog.hide();
     }
   }
 
@@ -239,6 +242,14 @@ class NewDiscountController extends BaseController
     final buyGoods = selectedGoodsInfoItem!;
     final buyPayWay = selectedPayWay!;
 
+    selectedGoodsInfoItem?.realAmount = selectedGoodsInfoItem?.amount;
+
+    if (selectedGoodsInfoItem?.discountPriceDesc != null && selectedGoodsInfoItem?.firstAmount != null) {
+      if (isDiscount.value) {
+        selectedGoodsInfoItem?.realAmount = selectedGoodsInfoItem?.firstAmount;
+      }
+    }
+
     int goodsId = buyGoods.id;
     int payPlatform = buyPayWay.payPlatform;
     int payMethod = buyPayWay.payMethod;
@@ -677,347 +688,4 @@ class NewDiscountController extends BaseController
     //   ToastUtil.show("Restore fail");
     // }
   }
-
-  /// 恢复订阅
-  Future<void> clickRestore() async {
-    PayWayInfo? paymentWay = _selectedPayWay.value;
-    if (paymentWay == null) {
-      return;
-    }
-    int payPlatform = paymentWay.payPlatform;
-    int payMethod = paymentWay.payMethod;
-
-    CustomLoadingDialog.show();
-
-    Future.delayed(const Duration(seconds: 20), () {
-      CustomLoadingDialog.hide();
-      ToastUtil.show("Restore record not found");
-    });
-
-    final result = await ApplePay().restore();
-    if (result["success"] == true) {
-      // CustomLoadingDialog.hide();
-      var receipt = result['receipt'];
-      print('查找恢复记录成功: ${result['receipt']}');
-      checkRestoreStatus(receipt);
-    } else {
-      CustomLoadingDialog.hide();
-      ToastUtil.show("Pay Error");
-      print('恢复失败: ${result['error']}');
-    }
-
-    // 显示恢复订阅弹窗
-    // RecoverSubscribeDialog.show("周会员2025年3月6日到期。", () {
-    //   AtmobLog.d(tag, "恢复订阅弹窗 => 点击确认");
-    // });
-  }
-
-  /// 检查恢复订阅结果
-  Future<void> checkRestoreStatus(String? receiptData) async {
-    PayWayInfo? paymentWay = _selectedPayWay.value;
-    if (paymentWay == null) {
-      // ToastUtil.showToast(StringName.storeChoicePayment.tr);
-      return;
-    }
-    if (receiptData == null) {
-      return;
-    }
-    int payPlatform = paymentWay.payPlatform;
-    int payMethod = paymentWay.payMethod;
-    // var code = await storeRepository.resume(payPlatform, payMethod, receiptData);
-    storeRepository.subscribeResume(payPlatform, payMethod, receiptData).then((data) {
-      CustomLoadingDialog.hide();
-      ToastUtil.show("Restore success");
-      accountRepository.getUserInfo();
-      Get.back();
-    }).catchError((error) {
-      CustomLoadingDialog.hide();
-      ToastUtil.show("Restore fail");
-    });
-
-    // if (code == 0) {
-    //   CustomLoadingDialog.hide();
-    //   ToastUtil.show("Restore success");
-    //   userRepository.getUserInfo();
-    //   Get.back();
-    // } else {
-    //   CustomLoadingDialog.hide();
-    //   ToastUtil.show("Restore fail");
-    // }
-  }
-
-  /// 恢复订阅
-  Future<void> clickRestore() async {
-    PayWayInfo? paymentWay = _selectedPayWay.value;
-    if (paymentWay == null) {
-      return;
-    }
-    int payPlatform = paymentWay.payPlatform;
-    int payMethod = paymentWay.payMethod;
-
-    CustomLoadingDialog.show();
-
-    Future.delayed(const Duration(seconds: 20), () {
-      CustomLoadingDialog.hide();
-      ToastUtil.show("Restore record not found");
-    });
-
-    final result = await ApplePay().restore();
-    if (result["success"] == true) {
-      // CustomLoadingDialog.hide();
-      var receipt = result['receipt'];
-      print('查找恢复记录成功: ${result['receipt']}');
-      checkRestoreStatus(receipt);
-    } else {
-      CustomLoadingDialog.hide();
-      ToastUtil.show("Pay Error");
-      print('恢复失败: ${result['error']}');
-    }
-
-    // 显示恢复订阅弹窗
-    // RecoverSubscribeDialog.show("周会员2025年3月6日到期。", () {
-    //   AtmobLog.d(tag, "恢复订阅弹窗 => 点击确认");
-    // });
-  }
-
-  /// 检查恢复订阅结果
-  Future<void> checkRestoreStatus(String? receiptData) async {
-    PayWayInfo? paymentWay = _selectedPayWay.value;
-    if (paymentWay == null) {
-      // ToastUtil.showToast(StringName.storeChoicePayment.tr);
-      return;
-    }
-    if (receiptData == null) {
-      return;
-    }
-    int payPlatform = paymentWay.payPlatform;
-    int payMethod = paymentWay.payMethod;
-    // var code = await storeRepository.resume(payPlatform, payMethod, receiptData);
-    storeRepository.subscribeResume(payPlatform, payMethod, receiptData).then((data) {
-      CustomLoadingDialog.hide();
-      ToastUtil.show("Restore success");
-      accountRepository.getUserInfo();
-      Get.back();
-    }).catchError((error) {
-      CustomLoadingDialog.hide();
-      ToastUtil.show("Restore fail");
-    });
-
-    // if (code == 0) {
-    //   CustomLoadingDialog.hide();
-    //   ToastUtil.show("Restore success");
-    //   userRepository.getUserInfo();
-    //   Get.back();
-    // } else {
-    //   CustomLoadingDialog.hide();
-    //   ToastUtil.show("Restore fail");
-    // }
-  }
-
-  /// 恢复订阅
-  Future<void> clickRestore() async {
-    PayWayInfo? paymentWay = _selectedPayWay.value;
-    if (paymentWay == null) {
-      return;
-    }
-    int payPlatform = paymentWay.payPlatform;
-    int payMethod = paymentWay.payMethod;
-
-    CustomLoadingDialog.show();
-
-    Future.delayed(const Duration(seconds: 20), () {
-      CustomLoadingDialog.hide();
-      ToastUtil.show("没有发现可恢复的记录");
-    });
-
-    final result = await ApplePay().restore();
-    if (result["success"] == true) {
-      // CustomLoadingDialog.hide();
-      var receipt = result['receipt'];
-      print('查找恢复记录成功: ${result['receipt']}');
-      checkRestoreStatus(receipt);
-    } else {
-      CustomLoadingDialog.hide();
-      ToastUtil.show("恢复失败");
-      print('恢复失败: ${result['error']}');
-    }
-
-    // 显示恢复订阅弹窗
-    // RecoverSubscribeDialog.show("周会员2025年3月6日到期。", () {
-    //   AtmobLog.d(tag, "恢复订阅弹窗 => 点击确认");
-    // });
-  }
-
-  /// 检查恢复订阅结果
-  Future<void> checkRestoreStatus(String? receiptData) async {
-    PayWayInfo? paymentWay = _selectedPayWay.value;
-    if (paymentWay == null) {
-      // ToastUtil.showToast(StringName.storeChoicePayment.tr);
-      return;
-    }
-    if (receiptData == null) {
-      return;
-    }
-    int payPlatform = paymentWay.payPlatform;
-    int payMethod = paymentWay.payMethod;
-    // var code = await storeRepository.resume(payPlatform, payMethod, receiptData);
-    storeRepository
-        .subscribeResume(payPlatform, payMethod, receiptData)
-        .then((data) {
-          CustomLoadingDialog.hide();
-          ToastUtil.show("恢复成功");
-          accountRepository.getUserInfo();
-          Get.back();
-        })
-        .catchError((error) {
-          CustomLoadingDialog.hide();
-          ToastUtil.show("恢复失败");
-        });
-
-    // if (code == 0) {
-    //   CustomLoadingDialog.hide();
-    //   ToastUtil.show("Restore success");
-    //   userRepository.getUserInfo();
-    //   Get.back();
-    // } else {
-    //   CustomLoadingDialog.hide();
-    //   ToastUtil.show("Restore fail");
-    // }
-  }
-
-  /// 恢复订阅
-  Future<void> clickRestore() async {
-    PayWayInfo? paymentWay = _selectedPayWay.value;
-    if (paymentWay == null) {
-      return;
-    }
-    int payPlatform = paymentWay.payPlatform;
-    int payMethod = paymentWay.payMethod;
-
-    CustomLoadingDialog.show();
-
-    Future.delayed(const Duration(seconds: 20), () {
-      CustomLoadingDialog.hide();
-      ToastUtil.show("Restore record not found");
-    });
-
-    final result = await ApplePay().restore();
-    if (result["success"] == true) {
-      // CustomLoadingDialog.hide();
-      var receipt = result['receipt'];
-      print('查找恢复记录成功: ${result['receipt']}');
-      checkRestoreStatus(receipt);
-    } else {
-      CustomLoadingDialog.hide();
-      ToastUtil.show("Pay Error");
-      print('恢复失败: ${result['error']}');
-    }
-
-    // 显示恢复订阅弹窗
-    // RecoverSubscribeDialog.show("周会员2025年3月6日到期。", () {
-    //   AtmobLog.d(tag, "恢复订阅弹窗 => 点击确认");
-    // });
-  }
-
-  /// 检查恢复订阅结果
-  Future<void> checkRestoreStatus(String? receiptData) async {
-    PayWayInfo? paymentWay = _selectedPayWay.value;
-    if (paymentWay == null) {
-      // ToastUtil.showToast(StringName.storeChoicePayment.tr);
-      return;
-    }
-    if (receiptData == null) {
-      return;
-    }
-    int payPlatform = paymentWay.payPlatform;
-    int payMethod = paymentWay.payMethod;
-    // var code = await storeRepository.resume(payPlatform, payMethod, receiptData);
-    storeRepository.subscribeResume(payPlatform, payMethod, receiptData).then((data) {
-      CustomLoadingDialog.hide();
-      ToastUtil.show("Restore success");
-      accountRepository.getUserInfo();
-      Get.back();
-    }).catchError((error) {
-      CustomLoadingDialog.hide();
-      ToastUtil.show("Restore fail");
-    });
-
-    // if (code == 0) {
-    //   CustomLoadingDialog.hide();
-    //   ToastUtil.show("Restore success");
-    //   userRepository.getUserInfo();
-    //   Get.back();
-    // } else {
-    //   CustomLoadingDialog.hide();
-    //   ToastUtil.show("Restore fail");
-    // }
-  }
-
-  /// 恢复订阅
-  Future<void> clickRestore() async {
-    PayWayInfo? paymentWay = _selectedPayWay.value;
-    if (paymentWay == null) {
-      return;
-    }
-    int payPlatform = paymentWay.payPlatform;
-    int payMethod = paymentWay.payMethod;
-
-    CustomLoadingDialog.show();
-
-    Future.delayed(const Duration(seconds: 20), () {
-      CustomLoadingDialog.hide();
-      ToastUtil.show("Restore record not found");
-    });
-
-    final result = await ApplePay().restore();
-    if (result["success"] == true) {
-      // CustomLoadingDialog.hide();
-      var receipt = result['receipt'];
-      print('查找恢复记录成功: ${result['receipt']}');
-      checkRestoreStatus(receipt);
-    } else {
-      CustomLoadingDialog.hide();
-      ToastUtil.show("Pay Error");
-      print('恢复失败: ${result['error']}');
-    }
-
-    // 显示恢复订阅弹窗
-    // RecoverSubscribeDialog.show("周会员2025年3月6日到期。", () {
-    //   AtmobLog.d(tag, "恢复订阅弹窗 => 点击确认");
-    // });
-  }
-
-  /// 检查恢复订阅结果
-  Future<void> checkRestoreStatus(String? receiptData) async {
-    PayWayInfo? paymentWay = _selectedPayWay.value;
-    if (paymentWay == null) {
-      // ToastUtil.showToast(StringName.storeChoicePayment.tr);
-      return;
-    }
-    if (receiptData == null) {
-      return;
-    }
-    int payPlatform = paymentWay.payPlatform;
-    int payMethod = paymentWay.payMethod;
-    // var code = await storeRepository.resume(payPlatform, payMethod, receiptData);
-    storeRepository.subscribeResume(payPlatform, payMethod, receiptData).then((data) {
-      CustomLoadingDialog.hide();
-      ToastUtil.show("Restore success");
-      accountRepository.getUserInfo();
-      Get.back();
-    }).catchError((error) {
-      CustomLoadingDialog.hide();
-      ToastUtil.show("Restore fail");
-    });
-
-    // if (code == 0) {
-    //   CustomLoadingDialog.hide();
-    //   ToastUtil.show("Restore success");
-    //   userRepository.getUserInfo();
-    //   Get.back();
-    // } else {
-    //   CustomLoadingDialog.hide();
-    //   ToastUtil.show("Restore fail");
-    // }
-  }
 }

+ 180 - 185
lib/module/store/new_discount/new_discount_page.dart

@@ -40,52 +40,62 @@ class NewDiscountPage extends BasePage<NewDiscountController> {
   @override
   Widget buildBody(BuildContext context) {
     return PopScope(
-        canPop: false,
-        onPopInvokedWithResult: (didPop, result) {
-          if (didPop) {
-            return;
-          }
-          controller.clickBack();
-        },
-        child: Stack(
-          children: [
-            Positioned(top: 0.w, child: _buildBanner()),
-            Positioned(
-              top: 408.w,
-              child: Container(
-                decoration: BoxDecoration(
-                  color: ColorName.white,
-                  borderRadius: BorderRadius.only(
-                    topLeft: Radius.circular(24.r),
-                    topRight: Radius.circular(24.r),
-                  ),
-                ),
-                width: 360.w,
-                height: 392.w,
-                child: SingleChildScrollView(
-                  child: Column(
-                    children: [
-                      SizedBox(height: 16.w),
-                      _buildGoodsCard(),
-                      SizedBox(height: 12.w),
-                      _buildPayWayCard(),
-                      SizedBox(height: 8.w),
-                      _buildSelectedDesc(),
-                      SizedBox(height: 30.w),
-                      _buildMemberCard(),
-
-                      SizedBox(height: 200.w),
-                    ],
-                  ),
+      canPop: false,
+      onPopInvokedWithResult: (didPop, result) {
+        if (didPop) {
+          return;
+        }
+        controller.clickBack();
+      },
+      child: Stack(
+        children: [
+          // Positioned(top: 0.w, child: _buildBanner()),
+          Positioned(
+            top: 0.w,
+            child: SizedBox(
+              width: 360.w,
+              height: ScreenUtil().screenHeight,
+              child: SingleChildScrollView(
+                child: Column(
+                  children: [
+                    _buildBanner(),
+                    Transform.translate(
+                      offset: Offset(0, -20.w),
+                      child: Container(
+                        decoration: BoxDecoration(
+                          color: ColorName.white,
+                          borderRadius: BorderRadius.only(
+                            topLeft: Radius.circular(24.r),
+                            topRight: Radius.circular(24.r),
+                          ),
+                        ),
+                        width: 360.w,
+                        child: Column(
+                          children: [
+                            SizedBox(height: 16.w),
+                            _buildGoodsCard(),
+                            SizedBox(height: 12.w),
+                            // iOS平台,没有支付方式可以选择
+                            if (!PlatformUtil.isIOS) _buildPayWayCard(),
+                            SizedBox(height: 8.w),
+                            _buildSelectedDesc(),
+                            SizedBox(height: 30.w),
+                            _buildMemberCard(),
+                            SizedBox(height: 200.w),
+                          ],
+                        ),
+                      ),
+                    ),
+                  ],
                 ),
               ),
             ),
-            Positioned(top: 0, left: 0, right: 0, child: _buildTitle()),
-
-            Positioned(
-                bottom: 0, left: 0, right: 0, child: _buildBuyButtonCard()),
-          ],
-        ));
+          ),
+          Positioned(top: 0, left: 0, right: 0, child: _buildTitle()),
+          Positioned(bottom: 0, left: 0, right: 0, child: _buildBuyButtonCard()),
+        ],
+      ),
+    );
   }
 
   _buildTitle() {
@@ -158,9 +168,9 @@ class NewDiscountPage extends BasePage<NewDiscountController> {
             ),
 
             items:
-            controller.bannerList.map((item) {
-              return item.image(width: 360.w, fit: BoxFit.contain);
-            }).toList(),
+                controller.bannerList.map((item) {
+                  return item.image(width: 360.w, fit: BoxFit.contain);
+                }).toList(),
           ),
           Positioned(
             bottom: 149.16.w,
@@ -191,40 +201,36 @@ class NewDiscountPage extends BasePage<NewDiscountController> {
   _buildIndicator() {
     return Row(
       children:
-      controller.bannerList
-          .asMap()
-          .entries
-          .map((entry) {
-        return Obx(() {
-          final isSelectedBanner =
-              controller.currentBannerIndex == entry.key;
-          return Row(
-            mainAxisAlignment: MainAxisAlignment.spaceAround,
-            children: [
-              GestureDetector(
-                onTap:
-                    () =>
-                    controller.carouselSliderController.animateToPage(
-                      entry.key,
+          controller.bannerList.asMap().entries.map((entry) {
+            return Obx(() {
+              final isSelectedBanner =
+                  controller.currentBannerIndex == entry.key;
+              return Row(
+                mainAxisAlignment: MainAxisAlignment.spaceAround,
+                children: [
+                  GestureDetector(
+                    onTap:
+                        () => controller.carouselSliderController.animateToPage(
+                          entry.key,
+                        ),
+                    child: AnimatedContainer(
+                      duration: const Duration(milliseconds: 300),
+                      margin: EdgeInsets.only(right: 5.w),
+                      height: 5.w,
+                      width: isSelectedBanner ? 10.w : 5.w,
+                      decoration: BoxDecoration(
+                        color:
+                            isSelectedBanner
+                                ? const Color(0xff483459)
+                                : const Color(0xffAFB4BF),
+                        borderRadius: BorderRadius.circular(5.r),
+                      ),
                     ),
-                child: AnimatedContainer(
-                  duration: const Duration(milliseconds: 300),
-                  margin: EdgeInsets.only(right: 5.w),
-                  height: 5.w,
-                  width: isSelectedBanner ? 10.w : 5.w,
-                  decoration: BoxDecoration(
-                    color:
-                    isSelectedBanner
-                        ? const Color(0xff483459)
-                        : const Color(0xffAFB4BF),
-                    borderRadius: BorderRadius.circular(5.r),
                   ),
-                ),
-              ),
-            ],
-          );
-        });
-      }).toList(),
+                ],
+              );
+            });
+          }).toList(),
     );
   }
 
@@ -242,46 +248,46 @@ class NewDiscountPage extends BasePage<NewDiscountController> {
             int rowCount = 2;
             int startIndex = columnIndex * rowCount;
             final List<CharacterInfo> columnItems =
-            controller.charactersList
-                .skip(startIndex)
-                .take(rowCount)
-                .toList();
+                controller.charactersList
+                    .skip(startIndex)
+                    .take(rowCount)
+                    .toList();
             return Column(
               children:
-              columnItems.map((item) {
-                final emoji = item.emoji ?? "";
-                final name = item.name ?? "";
-                return Padding(
-                  padding: EdgeInsets.symmetric(
-                    vertical: 4.w,
-                    horizontal: 4.w,
-                  ),
-                  child: Container(
-                    padding: EdgeInsets.symmetric(
-                      horizontal: 12.w,
-                      vertical: 6.w,
-                    ),
-                    decoration: ShapeDecoration(
-                      color: Colors.white,
-                      shape: RoundedRectangleBorder(
-                        side: BorderSide(
-                          width: 1.w,
-                          color: const Color(0xFFF4F1FF),
-                        ),
-                        borderRadius: BorderRadius.circular(31.r),
+                  columnItems.map((item) {
+                    final emoji = item.emoji ?? "";
+                    final name = item.name ?? "";
+                    return Padding(
+                      padding: EdgeInsets.symmetric(
+                        vertical: 4.w,
+                        horizontal: 4.w,
                       ),
-                    ),
-                    child: Text(
-                      "$emoji$name",
-                      style: TextStyle(
-                        color: Colors.black.withAlpha(204),
-                        fontSize: 13.sp,
-                        fontWeight: FontWeight.w400,
+                      child: Container(
+                        padding: EdgeInsets.symmetric(
+                          horizontal: 12.w,
+                          vertical: 6.w,
+                        ),
+                        decoration: ShapeDecoration(
+                          color: Colors.white,
+                          shape: RoundedRectangleBorder(
+                            side: BorderSide(
+                              width: 1.w,
+                              color: const Color(0xFFF4F1FF),
+                            ),
+                            borderRadius: BorderRadius.circular(31.r),
+                          ),
+                        ),
+                        child: Text(
+                          "$emoji$name",
+                          style: TextStyle(
+                            color: Colors.black.withAlpha(204),
+                            fontSize: 13.sp,
+                            fontWeight: FontWeight.w400,
+                          ),
+                        ),
                       ),
-                    ),
-                  ),
-                );
-              }).toList(),
+                    );
+                  }).toList(),
             );
           },
         ),
@@ -460,30 +466,30 @@ class NewDiscountPage extends BasePage<NewDiscountController> {
       width: 328.w,
       padding: EdgeInsets.symmetric(horizontal: 16.w),
       decoration:
-      isSelected
-          ? BoxDecoration(
-        borderRadius: BorderRadius.circular(16.w),
-        image: DecorationImage(
-          image: Assets.images.bgNewDiscountItemSelect.provider(),
-          fit: BoxFit.fill,
-        ),
-      )
-          : BoxDecoration(
-        borderRadius: BorderRadius.circular(16.w),
-        image: DecorationImage(
-          image: Assets.images.bgNewDiscountItemUnselect.provider(),
-          fit: BoxFit.fill,
-        ),
-      ),
+          isSelected
+              ? BoxDecoration(
+                borderRadius: BorderRadius.circular(16.w),
+                image: DecorationImage(
+                  image: Assets.images.bgNewDiscountItemSelect.provider(),
+                  fit: BoxFit.fill,
+                ),
+              )
+              : BoxDecoration(
+                borderRadius: BorderRadius.circular(16.w),
+                image: DecorationImage(
+                  image: Assets.images.bgNewDiscountItemUnselect.provider(),
+                  fit: BoxFit.fill,
+                ),
+              ),
       child: Row(
         children: [
           Text(
             "¥",
             style: TextStyle(
               color:
-              isSelected
-                  ? const Color(0xFFFF684E)
-                  : Colors.black.withAlpha(204),
+                  isSelected
+                      ? const Color(0xFFFF684E)
+                      : Colors.black.withAlpha(204),
               fontSize: 16.sp,
               fontWeight: FontWeight.w700,
             ),
@@ -495,9 +501,9 @@ class NewDiscountPage extends BasePage<NewDiscountController> {
             textAlign: TextAlign.center,
             style: TextStyle(
               color:
-              isSelected
-                  ? const Color(0xFFFF684E)
-                  : Colors.black.withAlpha(204),
+                  isSelected
+                      ? const Color(0xFFFF684E)
+                      : Colors.black.withAlpha(204),
               fontSize: 29.sp,
               fontWeight: FontWeight.w700,
             ),
@@ -618,26 +624,29 @@ class NewDiscountPage extends BasePage<NewDiscountController> {
                   ),
                 ),
               ],
-
             ),
           );
         }),
-        Visibility(visible:!isNotHWChannel(),child:       Container(
-          margin: EdgeInsets.symmetric(horizontal: 16.w),
-          alignment: Alignment.centerLeft,
-          child: GestureDetector(
-            onTap: () {
-              BrowserPage.start(WebUrl.memberServiceAgreement);
-            },
-            child:Text(
-              StringName.textSpanMembershipAgreement,
-              style: TextStyle(
-                color: const Color(0xFF459FFF),
-                fontSize: 10.sp,
-                fontWeight: FontWeight.w400,
+        Visibility(
+          visible: !isNotHWChannel(),
+          child: Container(
+            margin: EdgeInsets.symmetric(horizontal: 16.w),
+            alignment: Alignment.centerLeft,
+            child: GestureDetector(
+              onTap: () {
+                BrowserPage.start(WebUrl.memberServiceAgreement);
+              },
+              child: Text(
+                StringName.textSpanMembershipAgreement,
+                style: TextStyle(
+                  color: const Color(0xFF459FFF),
+                  fontSize: 10.sp,
+                  fontWeight: FontWeight.w400,
+                ),
               ),
-            ),),
-        ), )
+            ),
+          ),
+        ),
       ],
     );
   }
@@ -739,27 +748,27 @@ class NewDiscountPage extends BasePage<NewDiscountController> {
               controller.isAgree.value = !controller.isAgree.value;
             },
             child:
-            controller.isAgree.value
-                ? Assets.images.iconStoreAgreePrivacy.image(
-              width: 16.w,
-              height: 16.w,
-            )
-                : SizedBox(
-              child: Container(
-                padding: EdgeInsets.all(1.w),
-                width: 16.w,
-                height: 16.w,
-                child: Container(
-                  decoration: BoxDecoration(
-                    shape: BoxShape.circle,
-                    border: Border.all(
-                      color: Colors.black.withAlpha(153),
-                      width: 1.w,
+                controller.isAgree.value
+                    ? Assets.images.iconStoreAgreePrivacy.image(
+                      width: 16.w,
+                      height: 16.w,
+                    )
+                    : SizedBox(
+                      child: Container(
+                        padding: EdgeInsets.all(1.w),
+                        width: 16.w,
+                        height: 16.w,
+                        child: Container(
+                          decoration: BoxDecoration(
+                            shape: BoxShape.circle,
+                            border: Border.all(
+                              color: Colors.black.withAlpha(153),
+                              width: 1.w,
+                            ),
+                          ),
+                        ),
+                      ),
                     ),
-                  ),
-                ),
-              ),
-            ),
           );
         }),
         Text.rich(
@@ -829,20 +838,6 @@ class NewDiscountPage extends BasePage<NewDiscountController> {
                   ),
                 ],
               ),
-              TextSpan(
-                text: StringName.textSpanAnd,
-                style: TextStyle(
-                  color: Colors.black.withAlpha(153),
-                  fontSize: 10.sp,
-                  fontWeight: FontWeight.w400,
-                ),
-              ),
-              ClickTextSpan(
-                text: StringName.textSpanMembershipAgreement,
-                url: WebUrl.memberServiceAgreement,
-              ),
-            ],
-          ),
         ),
       ],
     );

+ 10 - 3
lib/module/store/store_controller.dart

@@ -66,8 +66,6 @@ class StoreController extends BaseController implements PaymentStatusCallback {
   /// 倒计时管理器
   final StoreGoodsCountdownManager storeGoodsCountdownManager;
 
-  final ConfigRepository configRepository ;
-
   final RxList<GoodsInfo> goodsInfoList = <GoodsInfo>[].obs;
 
   final Rxn<GoodsInfo> _selectedGoodsInfoItem = Rxn<GoodsInfo>();
@@ -154,7 +152,6 @@ class StoreController extends BaseController implements PaymentStatusCallback {
     this.configRepository,
     this.paymentStatusManager,
     this.storeGoodsCountdownManager,
-      this.configRepository,
   );
 
   onBannerChanged(int index, CarouselPageChangedReason reason) {
@@ -181,8 +178,10 @@ class StoreController extends BaseController implements PaymentStatusCallback {
       if (response.goodsInfoList?.isNotEmpty == true) {
         goodsInfoList.addAll(response.goodsInfoList!);
         _selectedGoodsInfoItem.value = goodsInfoList.first;
+        CustomLoadingDialog.show();
         var isHasDiscount = await MethodChanelIOSUtil.isHasDiscount(goodsInfoList.first.appleGoodsId);
         isDiscount.value = isHasDiscount;
+        CustomLoadingDialog.hide();
       }
       if (response.payInfoList?.isNotEmpty == true) {
         payWayList.addAll(response.payInfoList!);
@@ -255,6 +254,14 @@ class StoreController extends BaseController implements PaymentStatusCallback {
     final buyGoods = selectedGoodsInfoItem!;
     final buyPayWay = selectedPayWay!;
 
+    selectedGoodsInfoItem?.realAmount = selectedGoodsInfoItem?.amount;
+
+    if (selectedGoodsInfoItem?.discountPriceDesc != null && selectedGoodsInfoItem?.firstAmount != null) {
+      if (isDiscount.value) {
+        selectedGoodsInfoItem?.realAmount = selectedGoodsInfoItem?.firstAmount;
+      }
+    }
+
     int goodsId = buyGoods.id;
     int payPlatform = buyPayWay.payPlatform;
     int payMethod = buyPayWay.payMethod;

+ 122 - 265
lib/module/store/store_page.dart

@@ -88,15 +88,10 @@ class StorePage extends BasePage<StoreController> {
               SizedBox(height: 40.h),
             ],
           ),
-          Positioned(top: 0, left: 0, right: 0, child: _buildTitle()),
-          Positioned(
-            bottom: 0,
-            left: 0,
-            right: 0,
-            child: _buildBuyButtonCard(),
-          ),
-        ],
-      ),
+        ),
+        Positioned(top: 0, left: 0, right: 0, child: _buildTitle()),
+        Positioned(bottom: 0, left: 0, right: 0, child: _buildBuyButtonCard()),
+      ],
     );
   }
 
@@ -128,13 +123,13 @@ class StorePage extends BasePage<StoreController> {
                     SizedBox(width: 8.w),
                     controller.isLogin
                         ? Assets.images.iconMineUserLogged.image(
-                      width: 28.w,
-                      height: 28.w,
-                    )
+                          width: 28.w,
+                          height: 28.w,
+                        )
                         : Assets.images.iconMineUserNoLogin.image(
-                      width: 28.w,
-                      height: 28.w,
-                    ),
+                          width: 28.w,
+                          height: 28.w,
+                        ),
                   ],
                 ),
               );
@@ -545,9 +540,9 @@ class StorePage extends BasePage<StoreController> {
           begin: Alignment(0.77, -0.00),
           end: Alignment(0.77, 1.00),
           colors:
-          isSelected
-              ? [const Color(0xFFFF9416), const Color(0xFFFF7813)]
-              : [const Color(0xFFFEE057), const Color(0xFFFFC400)],
+              isSelected
+                  ? [const Color(0xFFFF9416), const Color(0xFFFF7813)]
+                  : [const Color(0xFFFEE057), const Color(0xFFFFC400)],
         ),
         shape: RoundedRectangleBorder(
           borderRadius: BorderRadius.circular(10.r),
@@ -560,16 +555,16 @@ class StorePage extends BasePage<StoreController> {
             height: 70.h,
             decoration: ShapeDecoration(
               gradient:
-              isSelected
-                  ? LinearGradient(
-                begin: Alignment(-0.06, 0.50),
-                end: Alignment(1.14, 0.50),
-                colors: [
-                  const Color(0xFFFFF895),
-                  const Color(0xFFFFE941),
-                ],
-              )
-                  : null,
+                  isSelected
+                      ? LinearGradient(
+                        begin: Alignment(-0.06, 0.50),
+                        end: Alignment(1.14, 0.50),
+                        colors: [
+                          const Color(0xFFFFF895),
+                          const Color(0xFFFFE941),
+                        ],
+                      )
+                      : null,
               color: isSelected ? null : const Color(0xFFFFFDEE),
               shape: RoundedRectangleBorder(
                 side: BorderSide(width: 1, color: const Color(0xFFFEE86B)),
@@ -670,25 +665,25 @@ class StorePage extends BasePage<StoreController> {
                 Text(
                   item.name,
                   style:
-                  isSelected
-                      ? Styles.getTextStyleFFECBBW500(15.sp)
-                      : Styles.getTextStyleFF663300W500(15.sp),
+                      isSelected
+                          ? Styles.getTextStyleFFECBBW500(15.sp)
+                          : Styles.getTextStyleFF663300W500(15.sp),
                 ),
                 Container(
                   padding: EdgeInsets.symmetric(horizontal: 8.w),
                   decoration: ShapeDecoration(
                     color: isSelected ? const Color(0xFFFFECBB) : null,
                     gradient:
-                    isSelected
-                        ? null
-                        : LinearGradient(
-                      begin: Alignment(0.77, -0.00),
-                      end: Alignment(0.77, 1.00),
-                      colors: [
-                        const Color(0xFFFF9416),
-                        const Color(0xFFFF7813),
-                      ],
-                    ),
+                        isSelected
+                            ? null
+                            : LinearGradient(
+                              begin: Alignment(0.77, -0.00),
+                              end: Alignment(0.77, 1.00),
+                              colors: [
+                                const Color(0xFFFF9416),
+                                const Color(0xFFFF7813),
+                              ],
+                            ),
                     shape: RoundedRectangleBorder(
                       borderRadius: BorderRadius.circular(
                         isSelected ? 17.r : 10.r,
@@ -699,9 +694,9 @@ class StorePage extends BasePage<StoreController> {
                     '¥${item.amountText}',
                     textAlign: TextAlign.center,
                     style:
-                    isSelected
-                        ? Styles.getTextStyleFF7F14W500(12.sp)
-                        : Styles.getTextStyleWhiteW500(12.sp),
+                        isSelected
+                            ? Styles.getTextStyleFF7F14W500(12.sp)
+                            : Styles.getTextStyleWhiteW500(12.sp),
                   ),
                 ),
               ],
@@ -717,7 +712,9 @@ class StorePage extends BasePage<StoreController> {
     return Container(
       alignment: Alignment.centerLeft,
       margin: EdgeInsets.symmetric(horizontal: 16.w),
-      padding: EdgeInsets.symmetric(horizontal: PlatformUtil.isIOS ? 4.w : 16.w),
+      padding: EdgeInsets.symmetric(
+        horizontal: PlatformUtil.isIOS ? 4.w : 16.w,
+      ),
       width: double.infinity,
       decoration: ShapeDecoration(
         gradient: LinearGradient(
@@ -740,9 +737,7 @@ class StorePage extends BasePage<StoreController> {
           ),
         ],
       ),
-      child: Column(
-
-      child: child,
+      child: Column(children: [child]),
     );
   }
 
@@ -781,12 +776,12 @@ class StorePage extends BasePage<StoreController> {
             ),
 
             items:
-            controller.bannerList.map((item) {
-              return item.banner.image(
-                width: double.infinity,
-                fit: BoxFit.cover,
-              );
-            }).toList(),
+                controller.bannerList.map((item) {
+                  return item.banner.image(
+                    width: double.infinity,
+                    fit: BoxFit.cover,
+                  );
+                }).toList(),
           ),
           Positioned(bottom: 0, left: 0, right: 0, child: _buildIndicator()),
         ],
@@ -808,61 +803,57 @@ class StorePage extends BasePage<StoreController> {
       child: Row(
         mainAxisAlignment: MainAxisAlignment.spaceAround,
         children:
-        controller.bannerList
-            .asMap()
-            .entries
-            .map((entry) {
-          return Obx(() {
-            final isSelectedBanner =
-                controller.currentBannerIndex == entry.key;
-            return Row(
-              mainAxisAlignment: MainAxisAlignment.spaceAround,
-              children: [
-                GestureDetector(
-                  onTap:
-                      () =>
-                      controller.carouselSliderController
-                          .animateToPage(entry.key),
-                  child: SizedBox(
-                    width: 100.w,
-                    child: Stack(
-                      alignment: Alignment.center,
-                      clipBehavior: Clip.none,
-                      children: [
-                        if (isSelectedBanner)
-                          Positioned(
-                            top: -8.h,
-                            child: controller
-                                .bannerList[entry.key]
-                                .indicatorImg
-                                .image(
-                              width: 100.w,
-                              height: 40.h,
-                              fit: BoxFit.fill,
-                            ),
-                          )
-                        else
-                          Text(
-                            controller.bannerList[entry.key].unSelectedDesc,
-                            style: Styles.getTextStyleWhiteW400(14.sp),
-                          ),
-                      ],
-                    ),
-                  ),
-                ),
-                if (entry.key != controller.bannerList.length - 1)
-                  Padding(
-                    padding: EdgeInsets.only(left: 4.w),
-                    child: Assets.images.iconStoreDivider.image(
-                      width: 2.w,
-                      height: 17.h,
-                      fit: BoxFit.fill,
+            controller.bannerList.asMap().entries.map((entry) {
+              return Obx(() {
+                final isSelectedBanner =
+                    controller.currentBannerIndex == entry.key;
+                return Row(
+                  mainAxisAlignment: MainAxisAlignment.spaceAround,
+                  children: [
+                    GestureDetector(
+                      onTap:
+                          () => controller.carouselSliderController
+                              .animateToPage(entry.key),
+                      child: SizedBox(
+                        width: 100.w,
+                        child: Stack(
+                          alignment: Alignment.center,
+                          clipBehavior: Clip.none,
+                          children: [
+                            if (isSelectedBanner)
+                              Positioned(
+                                top: -8.h,
+                                child: controller
+                                    .bannerList[entry.key]
+                                    .indicatorImg
+                                    .image(
+                                      width: 100.w,
+                                      height: 40.h,
+                                      fit: BoxFit.fill,
+                                    ),
+                              )
+                            else
+                              Text(
+                                controller.bannerList[entry.key].unSelectedDesc,
+                                style: Styles.getTextStyleWhiteW400(14.sp),
+                              ),
+                          ],
+                        ),
+                      ),
                     ),
-                  ),
-              ],
-            );
-          });
-        }).toList(),
+                    if (entry.key != controller.bannerList.length - 1)
+                      Padding(
+                        padding: EdgeInsets.only(left: 4.w),
+                        child: Assets.images.iconStoreDivider.image(
+                          width: 2.w,
+                          height: 17.h,
+                          fit: BoxFit.fill,
+                        ),
+                      ),
+                  ],
+                );
+              });
+            }).toList(),
       ),
     );
   }
@@ -930,9 +921,9 @@ class StorePage extends BasePage<StoreController> {
                         ),
                         child: Column(
                           children:
-                          controller.userReviewsList.map((item) {
-                            return _buildReviewsItem(item);
-                          }).toList(),
+                              controller.userReviewsList.map((item) {
+                                return _buildReviewsItem(item);
+                              }).toList(),
                         ),
                       ),
                     ],
@@ -1053,139 +1044,6 @@ class StorePage extends BasePage<StoreController> {
     );
   }
 
-  /// 恢复订阅
-  Widget _buildRecoverSubscribe() {
-    return Container(
-      margin: EdgeInsets.only(left: 16.w, top: 8.h, right: 16.w),
-      child: Row(
-        children: [
-          Text(
-            "⚠️  订阅未生效?点此试试",
-            style: TextStyle(
-              color: Color(0xFF666355),
-              fontSize: 13.sp,
-              fontWeight: FontWeight.w400,
-            ),
-          ),
-          GestureDetector(
-            onTap: () {
-              // 恢复订阅
-              controller.clickRecoverSubscribe();
-            },
-            child: Text(
-              "  恢复订阅>",
-              style: TextStyle(
-                color: Color(0xFF479DF7),
-                fontSize: 13.sp,
-                fontWeight: FontWeight.w400,
-              ),
-            ),
-          ),
-        ],
-      ),
-    );
-  }
-
-  /// 恢复订阅
-  Widget _buildRecoverSubscribe() {
-    return Container(
-      margin: EdgeInsets.only(left: 16.w, top: 8.h, right: 16.w),
-      child: Row(
-        children: [
-          Text(
-            "⚠️  订阅未生效?点此试试",
-            style: TextStyle(
-              color: Color(0xFF666355),
-              fontSize: 13.sp,
-              fontWeight: FontWeight.w400,
-            ),
-          ),
-          GestureDetector(
-            onTap: () {
-              // 恢复订阅
-              controller.clickRecoverSubscribe();
-            },
-            child: Text(
-              "  恢复订阅>",
-              style: TextStyle(
-                color: Color(0xFF479DF7),
-                fontSize: 13.sp,
-                fontWeight: FontWeight.w400,
-              ),
-            ),
-          ),
-        ],
-      ),
-    );
-  }
-
-  /// 恢复订阅
-  Widget _buildRecoverSubscribe() {
-    return Container(
-      margin: EdgeInsets.only(left: 16.w, top: 8.h, right: 16.w),
-      child: Row(
-        children: [
-          Text(
-            "⚠️  订阅未生效?点此试试",
-            style: TextStyle(
-              color: Color(0xFF666355),
-              fontSize: 13.sp,
-              fontWeight: FontWeight.w400,
-            ),
-          ),
-          GestureDetector(
-            onTap: () {
-              // 恢复订阅
-              controller.clickRecoverSubscribe();
-            },
-            child: Text(
-              "  恢复订阅>",
-              style: TextStyle(
-                color: Color(0xFF479DF7),
-                fontSize: 13.sp,
-                fontWeight: FontWeight.w400,
-              ),
-            ),
-          ),
-          SizedBox(height: 150.h),
-        ],
-      ),
-    );
-  }
-
-  /// 恢复订阅
-  Widget _buildRecoverSubscribe() {
-    return Container(
-      margin: EdgeInsets.only(left: 16.w, top: 8.h, right: 16.w),
-      child: Row(
-        children: [
-          Text(
-            "⚠️  订阅未生效?点此试试",
-            style: TextStyle(
-              color: Color(0xFF666355),
-              fontSize: 13.sp,
-              fontWeight: FontWeight.w400,
-            ),
-          ),
-          GestureDetector(
-            onTap: () {
-              // 恢复订阅
-              controller.clickRecoverSubscribe();
-            },
-            child: Text(
-              "  恢复订阅>",
-              style: TextStyle(
-                color: Color(0xFF479DF7),
-                fontSize: 13.sp,
-                fontWeight: FontWeight.w400,
-              ),
-            ),
-          ),
-        ],
-      ),
-    );
-  }
-
   Widget _buildBuyButtonCard() {
     return Container(
       width: 360.w,
@@ -1271,30 +1129,29 @@ class StorePage extends BasePage<StoreController> {
               controller.isAgree.value = !controller.isAgree.value;
             },
             child: Padding(
-              margin: EdgeInsets.only(top: PlatformUtil.isIOS ? 0.h : 2.h),
               padding: EdgeInsets.symmetric(vertical: 5.w, horizontal: 5.w),
               child:
-              controller.isAgree.value
-                  ? Assets.images.iconStoreAgreePrivacy.image(
-                width: 16.w,
-                height: 16.w,
-              )
-                  : SizedBox(
-                child: Container(
-                  padding: EdgeInsets.all(1.w),
-                  width: 16.w,
-                  height: 16.w,
-                  child: Container(
-                    decoration: BoxDecoration(
-                      shape: BoxShape.circle,
-                      border: Border.all(
-                        color: Colors.black.withAlpha(153),
-                        width: 1.w,
+                  controller.isAgree.value
+                      ? Assets.images.iconStoreAgreePrivacy.image(
+                        width: 16.w,
+                        height: 16.w,
+                      )
+                      : SizedBox(
+                        child: Container(
+                          padding: EdgeInsets.all(1.w),
+                          width: 16.w,
+                          height: 16.w,
+                          child: Container(
+                            decoration: BoxDecoration(
+                              shape: BoxShape.circle,
+                              border: Border.all(
+                                color: Colors.black.withAlpha(153),
+                                width: 1.w,
+                              ),
+                            ),
+                          ),
+                        ),
                       ),
-                    ),
-                  ),
-                ),
-              ),
             ),
           );
         }),

+ 7 - 1
lib/module/zodiac_love_intimacy/future_week/zodiac_love_future_week_controller.dart

@@ -2,6 +2,8 @@ import 'package:get/get_rx/src/rx_types/rx_types.dart';
 import 'package:get/get_rx/src/rx_workers/rx_workers.dart';
 import 'package:injectable/injectable.dart';
 import 'package:keyboard/base/base_controller.dart';
+import 'package:keyboard/module/login/login_page.dart';
+import 'package:keyboard/widget/platform_util.dart';
 
 import '../../../data/api/response/zodiac_love_intimacy_response.dart';
 import '../../../data/bean/member_info.dart';
@@ -76,7 +78,11 @@ class ZodiacLoveFutureWeekController extends BaseController {
         // 未登录
         if (error.code == ErrorCode.noLoginError) {
           ToastUtil.show(StringName.accountNoLogin);
-          LoginDialog.show();
+          if (PlatformUtil.isIOS) {
+            LoginPage.start();
+          } else {
+            LoginDialog.show();
+          }
         } else if (error.code == ErrorCode.noMember) {
           // 需要VIP
           ToastUtil.show(StringName.needVipTip);

+ 7 - 1
lib/module/zodiac_love_intimacy/tody/zodiac_love_today_controller.dart

@@ -2,8 +2,10 @@ import 'package:get/get.dart';
 import 'package:injectable/injectable.dart';
 import 'package:keyboard/base/base_controller.dart';
 import 'package:keyboard/dialog/login/login_dialog.dart';
+import 'package:keyboard/module/login/login_page.dart';
 import 'package:keyboard/resource/string.gen.dart';
 import 'package:keyboard/utils/error_handler.dart';
+import 'package:keyboard/widget/platform_util.dart';
 
 import '../../../data/api/response/zodiac_love_intimacy_response.dart';
 import '../../../data/bean/member_info.dart';
@@ -71,7 +73,11 @@ class ZodiacLoveTodayController extends BaseController {
         // 未登录
         if (error.code == ErrorCode.noLoginError) {
           ToastUtil.show(StringName.accountNoLogin);
-          LoginDialog.show();
+          if (PlatformUtil.isIOS) {
+            LoginPage.start();
+          } else {
+            LoginDialog.show();
+          }
         } else if (error.code == ErrorCode.noMember) {
           // 需要VIP
           ToastUtil.show(StringName.needVipTip);

+ 7 - 1
lib/module/zodiac_love_intimacy/zodiac_love_intimacy_controller.dart

@@ -2,6 +2,8 @@ import 'package:flutter/Material.dart';
 import 'package:get/get.dart';
 import 'package:injectable/injectable.dart';
 import 'package:keyboard/base/base_controller.dart';
+import 'package:keyboard/module/login/login_page.dart';
+import 'package:keyboard/widget/platform_util.dart';
 import '../../data/api/response/user_info_response.dart';
 import '../../data/api/response/zodiac_love_intimacy_love_info_response.dart';
 import '../../data/consts/error_code.dart';
@@ -168,7 +170,11 @@ class ZodiacLoveIntimacyController extends BaseController
         // 未登录
         if (error.code == ErrorCode.noLoginError) {
           ToastUtil.show(StringName.accountNoLogin);
-          LoginDialog.show();
+          if (PlatformUtil.isIOS) {
+            LoginPage.start();
+          } else {
+            LoginDialog.show();
+          }
         } else if (error.code == ErrorCode.noMember) {
           // 需要VIP
           ToastUtil.show(StringName.needVipTip);

+ 7 - 1
lib/module/zodiac_love_intimacy/zodiac_love_intimacy_page.dart

@@ -5,12 +5,14 @@ import 'package:get/get.dart';
 import 'package:keyboard/base/base_page.dart';
 import 'package:keyboard/data/repository/account_repository.dart';
 import 'package:keyboard/dialog/login/login_dialog.dart';
+import 'package:keyboard/module/login/login_page.dart';
 import 'package:keyboard/module/profile/profile_page.dart';
 import 'package:keyboard/module/zodiac_love_intimacy/tody/zodiac_love_today_view.dart';
 import 'package:keyboard/module/zodiac_love_intimacy/zodiac_love_intimacy_controller.dart';
 import 'package:keyboard/resource/colors.gen.dart';
 import 'package:keyboard/router/app_page_arguments.dart';
 import 'package:keyboard/utils/toast_util.dart';
+import 'package:keyboard/widget/platform_util.dart';
 import 'package:lottie/lottie.dart';
 import 'package:nested_scroll_views/material.dart';
 import '../../data/repository/keyboard_repository.dart';
@@ -37,7 +39,11 @@ class ZodiacLoveIntimacyPage extends BasePage<ZodiacLoveIntimacyController> {
     // 未登录,要求先登录
     if (!accountRepository.isLogin.value) {
       ToastUtil.show(StringName.accountNoLogin);
-      LoginDialog.show();
+      if (PlatformUtil.isIOS) {
+        LoginPage.start();
+      } else {
+        LoginDialog.show();
+      }
       return;
     }
 

+ 1 - 1
lib/utils/payment_status_manager.dart

@@ -58,7 +58,7 @@ class PaymentStatusManager {
               ?.onPaymentSuccess(orderNo, payWayInfo, goodsInfo);
           callbackMap.remove(orderNo);
         });
-        reportPaySuccess(goodsInfo.amount, orderNo, goodsInfo.name,
+        reportPaySuccess(goodsInfo.realAmount ?? 0, orderNo, goodsInfo.name,
             payWayInfo.payMethod);
       }).catchError((error) async {
         await _lock.synchronized(() {

+ 1 - 1
pubspec.yaml

@@ -3,7 +3,7 @@ description: "A new Flutter project."
 
 publish_to: 'none' # Remove this line if you wish to publish to pub.dev
 
-version: 1.0.3+103
+version: 1.0.1+6
 
 environment:
   sdk: ^3.7.0