Browse Source

[feat]增加引导界面,增加支付功能

Destiny 6 months ago
parent
commit
85d49088db

+ 0 - 4
ios/AiKeyboard/Info.plist

@@ -37,9 +37,5 @@
 		<key>NSExtensionPrincipalClass</key>
 		<string>$(PRODUCT_MODULE_NAME).KeyboardViewController</string>
 	</dict>
-	<key>UIAppFonts</key>
-	<array>
-		<string>tbmct.ttf</string>
-	</array>
 </dict>
 </plist>

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

@@ -372,7 +372,6 @@
 		97C146E51CF9000F007C117D = {
 			isa = PBXGroup;
 			children = (
-				FED899752DD1F5D5001808D5 /* tbmct.ttf */,
 				043D62362DCB0E7A005D12EE /* KeyboardSharedDataManager.swift */,
 				9740EEB11CF90186004384FC /* Flutter */,
 				97C146F01CF9000F007C117D /* Runner */,
@@ -531,7 +530,6 @@
 				04582A512DC211F100C1792D /* keyboard_dialog_loading.json in Resources */,
 				04582A322DBF6C0800C1792D /* heart.json in Resources */,
 				045828C92DB89ABE00C1792D /* Media.xcassets in Resources */,
-				FED899772DD1F5D5001808D5 /* tbmct.ttf in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -551,7 +549,6 @@
 				FE05FA2E2DCE0CFC00CBA944 /* Settings.bundle in Resources */,
 				97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
 				97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
-				FED899762DD1F5D5001808D5 /* tbmct.ttf in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

+ 26 - 0
ios/Runner/FlutterMethodChannelManager.swift

@@ -100,4 +100,30 @@ class FlutterMethodChannelManager: NSObject {
         
         return currentKeyboardName == appDisplayName
     }
+    
+    // 是否添加键盘
+    func isKeyboardEnabled() -> Bool {
+        
+        // 获取系统中已安装的键盘列表
+        let keyboards = UserDefaults.standard.dictionaryRepresentation()
+            .filter { $0.key.contains("Keyboard") }
+        if let keyboardList = keyboards["AppleKeyboards"] as? [String] {
+            
+            let keyboardBundleId = "com.qihuan.zhuiaijianpan.AiKeyboard"
+            let isAdded = keyboardList.contains(keyboardBundleId)
+            return isAdded
+        }
+        return false
+    }
+    
+    // 是否为默认键盘
+    func isCustomKeybroad() -> Bool {
+        
+        let currentKeyboardName = (((UITextInputMode.activeInputModes as NSArray).filtered(using: NSPredicate(format: "isDisplayed = YES"))).last as? NSObject)?.value(forKey: "extendedDisplayName") as? String
+        
+        let infoDictionary = Bundle.main.infoDictionary!
+        let appDisplayName = infoDictionary["CFBundleDisplayName"] as? String
+        
+        return currentKeyboardName == appDisplayName
+    }
 }

BIN
ios/tbmct.ttf


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

@@ -817,7 +817,7 @@ class NewDiscountController extends BaseController
 
     Future.delayed(const Duration(seconds: 20), () {
       CustomLoadingDialog.hide();
-      ToastUtil.show("Restore record not found");
+      ToastUtil.show("没有发现可恢复的记录");
     });
 
     final result = await ApplePay().restore();
@@ -828,7 +828,7 @@ class NewDiscountController extends BaseController
       checkRestoreStatus(receipt);
     } else {
       CustomLoadingDialog.hide();
-      ToastUtil.show("Pay Error");
+      ToastUtil.show("恢复失败");
       print('恢复失败: ${result['error']}');
     }
 
@@ -851,15 +851,18 @@ class NewDiscountController extends BaseController
     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");
-    });
+    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();

+ 2 - 1
lib/module/store/store_page.dart

@@ -1195,7 +1195,8 @@ class StorePage extends BasePage<StoreController> {
               controller.isAgree.value = !controller.isAgree.value;
             },
             child: Padding(
-              padding: EdgeInsets.symmetric(vertical: 10.w, horizontal: 10.w),
+              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(