diff --git a/Pods/Pods.xcodeproj/xcshareddata/xcschemes/MJRefresh-MJRefresh.Privacy.xcscheme b/Pods/Pods.xcodeproj/xcshareddata/xcschemes/MJRefresh-MJRefresh.Privacy.xcscheme new file mode 100644 index 0000000..34c1ac7 --- /dev/null +++ b/Pods/Pods.xcodeproj/xcshareddata/xcschemes/MJRefresh-MJRefresh.Privacy.xcscheme @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Pods/Pods.xcodeproj/xcshareddata/xcschemes/MJRefresh.xcscheme b/Pods/Pods.xcodeproj/xcshareddata/xcschemes/MJRefresh.xcscheme new file mode 100644 index 0000000..3b87c08 --- /dev/null +++ b/Pods/Pods.xcodeproj/xcshareddata/xcschemes/MJRefresh.xcscheme @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Pods/Pods.xcodeproj/xcshareddata/xcschemes/SVProgressHUD.xcscheme b/Pods/Pods.xcodeproj/xcshareddata/xcschemes/SVProgressHUD.xcscheme new file mode 100644 index 0000000..8222d49 --- /dev/null +++ b/Pods/Pods.xcodeproj/xcshareddata/xcschemes/SVProgressHUD.xcscheme @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Pods/Pods.xcodeproj/xcuserdata/a123.xcuserdatad/xcschemes/xcschememanagement.plist b/Pods/Pods.xcodeproj/xcuserdata/a123.xcuserdatad/xcschemes/xcschememanagement.plist index beb1684..4b003e2 100644 --- a/Pods/Pods.xcodeproj/xcuserdata/a123.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/Pods/Pods.xcodeproj/xcuserdata/a123.xcuserdatad/xcschemes/xcschememanagement.plist @@ -8,21 +8,29 @@ isShown + orderHint + 45 BoringSSL-GRPC-iOS13.0.xcscheme_^#shared#^_ isShown + orderHint + 44 BoringSSL-GRPC-iOS17.0-openssl_grpc.xcscheme_^#shared#^_ isShown + orderHint + 47 BoringSSL-GRPC-iOS17.0.xcscheme_^#shared#^_ isShown + orderHint + 46 BoringSSL-GRPC-openssl_grpc.xcscheme_^#shared#^_ @@ -42,11 +50,15 @@ isShown + orderHint + 48 FirebaseAppCheckInterop-iOS17.0.xcscheme_^#shared#^_ isShown + orderHint + 49 FirebaseAppCheckInterop.xcscheme_^#shared#^_ @@ -66,21 +78,29 @@ isShown + orderHint + 51 FirebaseAuth-iOS13.0.xcscheme_^#shared#^_ isShown + orderHint + 50 FirebaseAuth-iOS17.0-FirebaseAuth_Privacy.xcscheme_^#shared#^_ isShown + orderHint + 53 FirebaseAuth-iOS17.0.xcscheme_^#shared#^_ isShown + orderHint + 52 FirebaseAuth.xcscheme_^#shared#^_ @@ -100,21 +120,29 @@ isShown + orderHint + 55 FirebaseCore-iOS13.0.xcscheme_^#shared#^_ isShown + orderHint + 54 FirebaseCore-iOS17.0-FirebaseCore_Privacy.xcscheme_^#shared#^_ isShown + orderHint + 57 FirebaseCore-iOS17.0.xcscheme_^#shared#^_ isShown + orderHint + 56 FirebaseCore.xcscheme_^#shared#^_ @@ -134,21 +162,29 @@ isShown + orderHint + 59 FirebaseCoreExtension-iOS13.0.xcscheme_^#shared#^_ isShown + orderHint + 58 FirebaseCoreExtension-iOS17.0-FirebaseCoreExtension_Privacy.xcscheme_^#shared#^_ isShown + orderHint + 61 FirebaseCoreExtension-iOS17.0.xcscheme_^#shared#^_ isShown + orderHint + 60 FirebaseCoreExtension.xcscheme_^#shared#^_ @@ -168,21 +204,29 @@ isShown + orderHint + 63 FirebaseCoreInternal-iOS13.0.xcscheme_^#shared#^_ isShown + orderHint + 62 FirebaseCoreInternal-iOS17.0-FirebaseCoreInternal_Privacy.xcscheme_^#shared#^_ isShown + orderHint + 65 FirebaseCoreInternal-iOS17.0.xcscheme_^#shared#^_ isShown + orderHint + 64 FirebaseCoreInternal.xcscheme_^#shared#^_ @@ -202,21 +246,29 @@ isShown + orderHint + 67 FirebaseFirestore-iOS13.0.xcscheme_^#shared#^_ isShown + orderHint + 66 FirebaseFirestore-iOS17.0-FirebaseFirestore_Privacy.xcscheme_^#shared#^_ isShown + orderHint + 69 FirebaseFirestore-iOS17.0.xcscheme_^#shared#^_ isShown + orderHint + 68 FirebaseFirestore.xcscheme_^#shared#^_ @@ -236,21 +288,29 @@ isShown + orderHint + 71 FirebaseFirestoreInternal-iOS13.0.xcscheme_^#shared#^_ isShown + orderHint + 70 FirebaseFirestoreInternal-iOS17.0-FirebaseFirestoreInternal_Privacy.xcscheme_^#shared#^_ isShown + orderHint + 73 FirebaseFirestoreInternal-iOS17.0.xcscheme_^#shared#^_ isShown + orderHint + 72 FirebaseFirestoreInternal.xcscheme_^#shared#^_ @@ -270,21 +330,29 @@ isShown + orderHint + 75 FirebaseInstallations-iOS13.0.xcscheme_^#shared#^_ isShown + orderHint + 74 FirebaseInstallations-iOS17.0-FirebaseInstallations_Privacy.xcscheme_^#shared#^_ isShown + orderHint + 77 FirebaseInstallations-iOS17.0.xcscheme_^#shared#^_ isShown + orderHint + 76 FirebaseInstallations.xcscheme_^#shared#^_ @@ -304,21 +372,29 @@ isShown + orderHint + 79 FirebaseMessaging-iOS13.0.xcscheme_^#shared#^_ isShown + orderHint + 78 FirebaseMessaging-iOS17.0-FirebaseMessaging_Privacy.xcscheme_^#shared#^_ isShown + orderHint + 81 FirebaseMessaging-iOS17.0.xcscheme_^#shared#^_ isShown + orderHint + 80 FirebaseMessaging.xcscheme_^#shared#^_ @@ -331,11 +407,15 @@ isShown + orderHint + 82 FirebaseSharedSwift-iOS17.0.xcscheme_^#shared#^_ isShown + orderHint + 83 FirebaseSharedSwift.xcscheme_^#shared#^_ @@ -355,21 +435,29 @@ isShown + orderHint + 103 GTMSessionFetcher-iOS13.0.xcscheme_^#shared#^_ isShown + orderHint + 102 GTMSessionFetcher-iOS17.0-GTMSessionFetcher_Core_Privacy.xcscheme_^#shared#^_ isShown + orderHint + 105 GTMSessionFetcher-iOS17.0.xcscheme_^#shared#^_ isShown + orderHint + 104 GTMSessionFetcher.xcscheme_^#shared#^_ @@ -389,21 +477,29 @@ isShown + orderHint + 85 GoogleDataTransport-iOS13.0.xcscheme_^#shared#^_ isShown + orderHint + 84 GoogleDataTransport-iOS17.0-GoogleDataTransport_Privacy.xcscheme_^#shared#^_ isShown + orderHint + 87 GoogleDataTransport-iOS17.0.xcscheme_^#shared#^_ isShown + orderHint + 86 GoogleDataTransport.xcscheme_^#shared#^_ @@ -423,21 +519,29 @@ isShown + orderHint + 89 GoogleUtilities-iOS13.0.xcscheme_^#shared#^_ isShown + orderHint + 88 GoogleUtilities-iOS17.0-GoogleUtilities_Privacy.xcscheme_^#shared#^_ isShown + orderHint + 91 GoogleUtilities-iOS17.0.xcscheme_^#shared#^_ isShown + orderHint + 90 GoogleUtilities.xcscheme_^#shared#^_ @@ -446,10 +550,26 @@ orderHint 29 + MJRefresh-MJRefresh.Privacy.xcscheme_^#shared#^_ + + isShown + + orderHint + 122 + + MJRefresh.xcscheme_^#shared#^_ + + isShown + + orderHint + 123 + Pods-SQNoti.xcscheme_^#shared#^_ isShown + orderHint + 114 Pods-ShenQi.xcscheme_^#shared#^_ @@ -469,21 +589,29 @@ isShown + orderHint + 116 PromisesObjC-iOS13.0.xcscheme_^#shared#^_ isShown + orderHint + 115 PromisesObjC-iOS17.0-FBLPromises_Privacy.xcscheme_^#shared#^_ isShown + orderHint + 118 PromisesObjC-iOS17.0.xcscheme_^#shared#^_ isShown + orderHint + 117 PromisesObjC.xcscheme_^#shared#^_ @@ -496,11 +624,15 @@ isShown + orderHint + 119 RecaptchaInterop-iOS17.0.xcscheme_^#shared#^_ isShown + orderHint + 120 RecaptchaInterop.xcscheme_^#shared#^_ @@ -509,15 +641,26 @@ orderHint 28 + SVProgressHUD.xcscheme_^#shared#^_ + + isShown + + orderHint + 121 + abseil-iOS13.0.xcscheme_^#shared#^_ isShown + orderHint + 42 abseil-iOS17.0.xcscheme_^#shared#^_ isShown + orderHint + 43 abseil.xcscheme_^#shared#^_ @@ -544,31 +687,43 @@ isShown + orderHint + 93 gRPC-C++-iOS13.0-grpcpp.xcscheme_^#shared#^_ isShown + orderHint + 94 gRPC-C++-iOS13.0.xcscheme_^#shared#^_ isShown + orderHint + 92 gRPC-C++-iOS17.0-gRPCCertificates-Cpp.xcscheme_^#shared#^_ isShown + orderHint + 96 gRPC-C++-iOS17.0-grpcpp.xcscheme_^#shared#^_ isShown + orderHint + 97 gRPC-C++-iOS17.0.xcscheme_^#shared#^_ isShown + orderHint + 95 gRPC-C++.xcscheme_^#shared#^_ @@ -588,21 +743,29 @@ isShown + orderHint + 99 gRPC-Core-iOS13.0.xcscheme_^#shared#^_ isShown + orderHint + 98 gRPC-Core-iOS17.0-grpc.xcscheme_^#shared#^_ isShown + orderHint + 101 gRPC-Core-iOS17.0.xcscheme_^#shared#^_ isShown + orderHint + 100 gRPC-Core.xcscheme_^#shared#^_ @@ -615,21 +778,29 @@ isShown + orderHint + 107 leveldb-library-iOS13.0.xcscheme_^#shared#^_ isShown + orderHint + 106 leveldb-library-iOS17.0-leveldb_Privacy.xcscheme_^#shared#^_ isShown + orderHint + 109 leveldb-library-iOS17.0.xcscheme_^#shared#^_ isShown + orderHint + 108 leveldb-library-leveldb_Privacy.xcscheme_^#shared#^_ @@ -649,21 +820,29 @@ isShown + orderHint + 111 nanopb-iOS13.0.xcscheme_^#shared#^_ isShown + orderHint + 110 nanopb-iOS17.0-nanopb_Privacy.xcscheme_^#shared#^_ isShown + orderHint + 113 nanopb-iOS17.0.xcscheme_^#shared#^_ isShown + orderHint + 112 nanopb-nanopb_Privacy.xcscheme_^#shared#^_ @@ -697,6 +876,11 @@ primary + 1C8D67D8B72D6BA42CCEDB648537A340 + + primary + + 21FB29F43C8A2A81ABFE8C478370070E primary @@ -777,6 +961,11 @@ primary + 6868056D761E163D10FDAF8CF1C4D9B8 + + primary + + 6AE4A3D573DED275B034E20506596C62 primary @@ -827,6 +1016,11 @@ primary + B26054DF1DEA11585A231AF6D1D80D5E + + primary + + BE6D8CBE8245C88A1146DE42D80A7531 primary diff --git a/ShenQi.xcodeproj/project.pbxproj b/ShenQi.xcodeproj/project.pbxproj index 1540b35..1af835e 100644 --- a/ShenQi.xcodeproj/project.pbxproj +++ b/ShenQi.xcodeproj/project.pbxproj @@ -28,13 +28,13 @@ 20CC02D32D150A1C0001B529 /* DSAvatarCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 20CC02D12D150A1C0001B529 /* DSAvatarCollectionViewCell.xib */; }; 20DA04E42CD32AEF003530CA /* DSWebDragView.m in Sources */ = {isa = PBXBuildFile; fileRef = 20DA04E02CD32AEF003530CA /* DSWebDragView.m */; }; 20DA04E52CD32AEF003530CA /* WMDragView.m in Sources */ = {isa = PBXBuildFile; fileRef = 20DA04E12CD32AEF003530CA /* WMDragView.m */; }; - 20E0DB032D1AF33500E5DBA1 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 20E0DB022D1AF33500E5DBA1 /* GoogleService-Info.plist */; }; 9D06CD612B70B72500A5CDF7 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D06CD602B70B72500A5CDF7 /* libc++.tbd */; }; 9D06CD632B70B72E00A5CDF7 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D06CD622B70B72E00A5CDF7 /* SystemConfiguration.framework */; }; 9D06CD652B70B73B00A5CDF7 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D06CD642B70B73B00A5CDF7 /* libz.tbd */; }; 9D06CD672B70B74100A5CDF7 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D06CD662B70B74100A5CDF7 /* Security.framework */; }; 9D06CD692B70B74F00A5CDF7 /* UserNotifications.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D06CD682B70B74F00A5CDF7 /* UserNotifications.framework */; }; 9D06CD6B2B70B7E900A5CDF7 /* libresolv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D06CD6A2B70B7E900A5CDF7 /* libresolv.tbd */; }; + 9DC1C8652D1D522900C84B8E /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9DC1C8642D1D522900C84B8E /* GoogleService-Info.plist */; }; D63304C43F2FB8749E12DFA2 /* Pods_ShenQi.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D459646A78B941E3EF67B34A /* Pods_ShenQi.framework */; }; /* End PBXBuildFile section */ @@ -81,7 +81,7 @@ 20B317F52CD4BA6700B29987 /* NSObject+YYModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+YYModel.m"; sourceTree = ""; }; 20B317F62CD4BA6700B29987 /* YYClassInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YYClassInfo.m; sourceTree = ""; }; 20B317F72CD4BA6700B29987 /* NSObject+YYModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+YYModel.h"; sourceTree = ""; }; - 20B61C7829DC008500CE7946 /* Candy916.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Candy916.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 20B61C7829DC008500CE7946 /* Tinju55.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Tinju55.app; sourceTree = BUILT_PRODUCTS_DIR; }; 20B61C7B29DC008500CE7946 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 20B61C7C29DC008500CE7946 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 20B61C8529DC008500CE7946 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; @@ -106,7 +106,6 @@ 20DA04E12CD32AEF003530CA /* WMDragView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WMDragView.m; sourceTree = ""; }; 20DA04E22CD32AEF003530CA /* DSWebDragView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DSWebDragView.h; sourceTree = ""; }; 20DA04E32CD32AEF003530CA /* WMDragView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMDragView.h; sourceTree = ""; }; - 20E0DB022D1AF33500E5DBA1 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 2770952325ADBC033AEA844E /* Pods_SQNoti.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SQNoti.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 30D1D837206E6AC5F27F4CB4 /* Pods-ShenQi.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ShenQi.release.xcconfig"; path = "Target Support Files/Pods-ShenQi/Pods-ShenQi.release.xcconfig"; sourceTree = ""; }; 9D06CD602B70B72500A5CDF7 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; }; @@ -117,6 +116,7 @@ 9D06CD6A2B70B7E900A5CDF7 /* libresolv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.tbd; path = usr/lib/libresolv.tbd; sourceTree = SDKROOT; }; 9DB760732BB16BB50037094A /* ShenQiDebug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = ShenQiDebug.entitlements; sourceTree = ""; }; 9DB760742BB16BBC0037094A /* ShenQiRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = ShenQiRelease.entitlements; sourceTree = ""; }; + 9DC1C8642D1D522900C84B8E /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; A8EA1203791342D075AF53E3 /* Pods-ShenQi.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ShenQi.debug.xcconfig"; path = "Target Support Files/Pods-ShenQi/Pods-ShenQi.debug.xcconfig"; sourceTree = ""; }; D459646A78B941E3EF67B34A /* Pods_ShenQi.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ShenQi.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -189,7 +189,7 @@ 20B61C7929DC008500CE7946 /* Products */ = { isa = PBXGroup; children = ( - 20B61C7829DC008500CE7946 /* Candy916.app */, + 20B61C7829DC008500CE7946 /* Tinju55.app */, ); name = Products; sourceTree = ""; @@ -207,7 +207,7 @@ 20CC02C92D141B650001B529 /* LaunchViewController.xib */, 207022AD2CD8C1C10061657B /* MainOldViewController.h */, 207022AE2CD8C1C10061657B /* MainOldViewController.m */, - 20E0DB022D1AF33500E5DBA1 /* GoogleService-Info.plist */, + 9DC1C8642D1D522900C84B8E /* GoogleService-Info.plist */, 20B317F32CD4BA6700B29987 /* YYModel */, 20DA04DF2CD32AEF003530CA /* WMDragView */, 207022A72CD8B2B50061657B /* Localizable.strings */, @@ -267,7 +267,7 @@ ); name = ShenQi; productName = ShenQi; - productReference = 20B61C7829DC008500CE7946 /* Candy916.app */; + productReference = 20B61C7829DC008500CE7946 /* Tinju55.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -318,7 +318,7 @@ 20B61C8829DC008800CE7946 /* Assets.xcassets in Resources */, 20B61C8629DC008500CE7946 /* Main.storyboard in Resources */, 20CC02D32D150A1C0001B529 /* DSAvatarCollectionViewCell.xib in Resources */, - 20E0DB032D1AF33500E5DBA1 /* GoogleService-Info.plist in Resources */, + 9DC1C8652D1D522900C84B8E /* GoogleService-Info.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -552,7 +552,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = ShenQi/ShenQiDebug.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = ""; @@ -584,11 +584,11 @@ "$(inherited)", "$(PROJECT_DIR)/ShenQi", ); - MARKETING_VERSION = 1.2; - PRODUCT_BUNDLE_IDENTIFIER = noti.candy916; - PRODUCT_NAME = Candy916; + MARKETING_VERSION = 1.4; + PRODUCT_BUNDLE_IDENTIFIER = noti.tinju55; + PRODUCT_NAME = Tinju55; PROVISIONING_PROFILE_SPECIFIER = ""; - "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Candy916_Dev; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Tinju55_adhoc; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; @@ -637,11 +637,11 @@ "$(inherited)", "$(PROJECT_DIR)/ShenQi", ); - MARKETING_VERSION = 1.2; - PRODUCT_BUNDLE_IDENTIFIER = noti.candy916; - PRODUCT_NAME = Candy916; + MARKETING_VERSION = 1.4; + PRODUCT_BUNDLE_IDENTIFIER = noti.tinju55; + PRODUCT_NAME = Tinju55; PROVISIONING_PROFILE_SPECIFIER = ""; - "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Candy916_adhoc; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Tinju55_adhoc; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; diff --git a/ShenQi.xcodeproj/xcshareddata/xcschemes/SQNoti.xcscheme b/ShenQi.xcodeproj/xcshareddata/xcschemes/SQNoti.xcscheme index b003a71..cb7286d 100644 --- a/ShenQi.xcodeproj/xcshareddata/xcschemes/SQNoti.xcscheme +++ b/ShenQi.xcodeproj/xcshareddata/xcschemes/SQNoti.xcscheme @@ -30,7 +30,7 @@ @@ -61,7 +61,7 @@ @@ -80,7 +80,7 @@ diff --git a/ShenQi.xcodeproj/xcshareddata/xcschemes/ShenQi.xcscheme b/ShenQi.xcodeproj/xcshareddata/xcschemes/ShenQi.xcscheme index d053834..92001e5 100644 --- a/ShenQi.xcodeproj/xcshareddata/xcschemes/ShenQi.xcscheme +++ b/ShenQi.xcodeproj/xcshareddata/xcschemes/ShenQi.xcscheme @@ -15,7 +15,7 @@ @@ -45,7 +45,7 @@ @@ -62,7 +62,7 @@ diff --git a/ShenQi.xcworkspace/xcuserdata/a123.xcuserdatad/UserInterfaceState.xcuserstate b/ShenQi.xcworkspace/xcuserdata/a123.xcuserdatad/UserInterfaceState.xcuserstate index 3abcfd8..98a9f11 100644 Binary files a/ShenQi.xcworkspace/xcuserdata/a123.xcuserdatad/UserInterfaceState.xcuserstate and b/ShenQi.xcworkspace/xcuserdata/a123.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ShenQi/AppDelegate.m b/ShenQi/AppDelegate.m index 811c2cd..a8ae83b 100644 --- a/ShenQi/AppDelegate.m +++ b/ShenQi/AppDelegate.m @@ -17,7 +17,6 @@ #import #import "MacroDefine.h" -//#import "ViewController.h" #import "MainOldViewController.h" #import "LaunchViewController.h" @@ -62,7 +61,7 @@ request.HTTPMethod = @"PUT"; [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - NSDictionary *parmas = @{@"userId":[NSNumber numberWithInteger:[Candy916UserID integerValue]]}; + NSDictionary *parmas = @{@"userId":[NSNumber numberWithInteger:[Tinju55UserID integerValue]]}; NSData *jsonData = [NSJSONSerialization dataWithJSONObject:parmas options:NSJSONWritingPrettyPrinted error:nil]; request.HTTPBody = jsonData; @@ -122,17 +121,6 @@ [self.window.rootViewController presentViewController:alertview animated:YES completion:^{}]; }); } - - // 强制填写邀请码 -// NSUserDefaults *userfault = [NSUserDefaults standardUserDefaults]; -// BOOL install = [userfault objectForKey:@"INSTALL"]; -// if (install == NO) { -// [self setupSendInvite]; -// }else{ -// if (self.isRefresh == YES) { -// [[NSNotificationCenter defaultCenter] postNotificationName:@"NOTI_INTO" object:nil]; -// } -// } } #pragma mark - 推送权限 @@ -170,164 +158,6 @@ }); } -/* --(void)refreshPermissionAll -{ - [SVProgressHUD dismiss]; - - // 判断是否开启推送权限 - [[UNUserNotificationCenter currentNotificationCenter] getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) { - // 没权限 - if (settings.authorizationStatus == UNAuthorizationStatusNotDetermined) { - [self setupNotificationStatus]; - }else if (settings.authorizationStatus != UNAuthorizationStatusAuthorized) { - dispatch_async(dispatch_get_main_queue(), ^{ - UIAlertController *alertview = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Tips", nil) message:NSLocalizedString(@"Need to enable push permission", nil) preferredStyle:(UIAlertControllerStyleAlert)]; - UIAlertAction *action = [UIAlertAction actionWithTitle:NSLocalizedString(@"SETTING", nil) style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) { - self.isRefresh = YES; - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:^(BOOL success) {}]; - }]; - [alertview addAction:action]; - [self.window.rootViewController presentViewController:alertview animated:YES completion:^{}]; - }); - } - }]; - - // 判断是否开启通讯权限 - CNAuthorizationStatus status = [CNContactStore authorizationStatusForEntityType:CNEntityTypeContacts]; - if (status == CNAuthorizationStatusNotDetermined) { - CNContactStore *store = [[CNContactStore alloc] init]; - [store requestAccessForEntityType:CNEntityTypeContacts completionHandler:^(BOOL granted, NSError* _Nullable error) { - if (granted == NO) { - [self setupAlertContact]; - } - }]; - }else if (status == CNAuthorizationStatusDenied) { - [self setupAlertContact]; - } - - // 判断是否输入邀请码 - NSUserDefaults *userfault = [NSUserDefaults standardUserDefaults]; - BOOL install = [userfault objectForKey:@"INSTALL"]; - if (install == NO) { - [self setupSendInvite]; - }else{ - [[NSNotificationCenter defaultCenter] postNotificationName:@"NOTI_INTO" object:nil]; - } -} - -#pragma mark - 填写邀请码 --(void)setupSendInvite -{ - // 填写邀请码 - dispatch_async(dispatch_get_main_queue(), ^{ - UIAlertController *inputCodeAlertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Please enter the invitation code", nil) message:nil preferredStyle:(UIAlertControllerStyleAlert)]; - [inputCodeAlertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) { - textField.placeholder = NSLocalizedString(@"Please enter the invitation code", nil); - }]; - UIAlertAction *inputCodeAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) { - UITextField *codeTextField = inputCodeAlertController.textFields.firstObject; - if (!ISNULLSTR(codeTextField.text)) { - NSString *advertisingId = codeTextField.text; - [self setupInviteSend:advertisingId]; - }else{ - [self setupSendInvite]; - } - }]; - [inputCodeAlertController addAction:inputCodeAction]; - [self.window.rootViewController presentViewController:inputCodeAlertController animated:YES completion:^{}]; - }); -} - --(void)setupInviteSend:(NSString *)advertisingId -{ - __block NSString *uuidString = @""; - if (@available(iOS 14, *)) { - [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) { - uuidString = [[ASIdentifierManager sharedManager] advertisingIdentifier].UUIDString; - [self setupInviteSendWithUUIDString:uuidString advertisingId:advertisingId]; - }]; - } else { - uuidString = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; - [self setupInviteSendWithUUIDString:uuidString advertisingId:advertisingId]; - } -} - --(void)setupInviteSendWithUUIDString:(NSString *)uuidString advertisingId:(NSString *)advertisingId -{ - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:InviteSendURL]]; - request.HTTPMethod = @"PUT"; - [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - - NSDictionary *parmas = @{@"code":advertisingId,@"deviceCode":uuidString,@"userId":[NSNumber numberWithInteger:[VV88AUUserID integerValue]]}; - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:parmas options:NSJSONWritingPrettyPrinted error:nil]; - request.HTTPBody = jsonData; - - [SVProgressHUD show]; - NSURLSession *session = [NSURLSession sharedSession]; - NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (error == nil) { - [SVProgressHUD dismiss]; - NSError *error; - NSMutableDictionary *responseObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error]; - if (error == nil) { - NSInteger code = [[responseObject objectForKey:@"code"] integerValue]; - if (ISNULL(error)) { - if (code == 40001) { - NSString *errmsg = [responseObject objectForKey:@"error"]; - [SVProgressHUD showInfoWithStatus:errmsg]; - - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - NSDictionary *datadic = [responseObject objectForKey:@"data"]; - NSString *inviteCode = [datadic objectForKey:@"inviteCode"]; - - NSUserDefaults *userfault = [NSUserDefaults standardUserDefaults]; - [userfault setObject:[NSNumber numberWithBool:YES] forKey:@"INSTALL"]; - [userfault setObject:inviteCode forKey:@"INVITE_CODE"]; - [userfault synchronize]; - - // 已填写邀请码 - [self refreshPermissionAll]; - }); - }else if (code == 1) { - NSUserDefaults *userfault = [NSUserDefaults standardUserDefaults]; - [userfault setObject:[NSNumber numberWithBool:YES] forKey:@"INSTALL"]; - [userfault setObject:advertisingId forKey:@"INVITE_CODE"]; - [userfault synchronize]; - - // 已填写邀请码 - [self refreshPermissionAll]; - }else{ - NSString *errmsg = [responseObject objectForKey:@"error"]; - [SVProgressHUD showInfoWithStatus:errmsg]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [self setupSendInvite]; - }); - } - }else{ - NSString *errmsg = [responseObject objectForKey:@"message"]; - [SVProgressHUD showInfoWithStatus:errmsg]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [self setupSendInvite]; - }); - } - } - else{ - [SVProgressHUD showInfoWithStatus:error.localizedDescription]; - [self setupSendInvite]; - } - } - else{ - [SVProgressHUD showInfoWithStatus:error.localizedDescription]; - [self setupSendInvite]; - } - }); - }]; - [dataTask resume]; -} -*/ - - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { if (deviceToken != nil) { @@ -376,38 +206,6 @@ [self processWithNoti:response.notification.request.content.userInfo]; } -/* --(void)receiveNOTIProcessWithNoti:(NSDictionary *)userInfo -{ - [[FIRMessaging messaging] appDidReceiveMessage:userInfo]; - - if (userInfo) { - NSDictionary *apnsDic = [userInfo objectForKey:@"aps"]; - NSDictionary *alertDic = [apnsDic objectForKey:@"alert"]; - NSString *title = [alertDic objectForKey:@"body"]; - NSString *content = [alertDic objectForKey:@"title"]; - [self scheduleLocalNotification:userInfo title:title content:content]; - } -} - -- (void)scheduleLocalNotification:(NSDictionary *)userInfo title:(NSString *)title content:(NSString *)content -{ - UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; - center.delegate = self; - - UNMutableNotificationContent *notificationContent = [[UNMutableNotificationContent alloc] init]; - notificationContent.title = title; - notificationContent.subtitle = content; - notificationContent.sound = [UNNotificationSound defaultSound]; - - UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier:@"LOCAL_NOTI" content:notificationContent trigger:nil]; - [center addNotificationRequest:request withCompletionHandler:^(NSError *_Nullable error) { - if (!error) { - [self processWithNoti:userInfo]; - } - }]; -} -*/ -(void)processWithNoti:(NSDictionary *)userInfo { NSString *message = [userInfo objectForKey:@"message"]; diff --git a/ShenQi/AreaCodeTableViewCell.h b/ShenQi/AreaCodeTableViewCell.h deleted file mode 100644 index 4c887c6..0000000 --- a/ShenQi/AreaCodeTableViewCell.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// AreaCodeTableViewCell.h -// ShenQi -// -// Created by Yao on 2024/11/9. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface AreaCodeTableViewCell : UITableViewCell - -@property (weak, nonatomic) IBOutlet UILabel *titleLabel; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ShenQi/AreaCodeTableViewCell.m b/ShenQi/AreaCodeTableViewCell.m deleted file mode 100644 index b9a3228..0000000 --- a/ShenQi/AreaCodeTableViewCell.m +++ /dev/null @@ -1,25 +0,0 @@ -// -// AreaCodeTableViewCell.m -// ShenQi -// -// Created by Yao on 2024/11/9. -// - -#import "AreaCodeTableViewCell.h" - -@implementation AreaCodeTableViewCell - -- (void)awakeFromNib { - [super awakeFromNib]; - // Initialization code - - [self setSelectionStyle:(UITableViewCellSelectionStyleNone)]; -} - -- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - [super setSelected:selected animated:animated]; - - // Configure the view for the selected state -} - -@end diff --git a/ShenQi/AreaCodeTableViewCell.xib b/ShenQi/AreaCodeTableViewCell.xib deleted file mode 100644 index 98b4f01..0000000 --- a/ShenQi/AreaCodeTableViewCell.xib +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ShenQi/Assets.xcassets/AppIcon.appiconset/Contents.json b/ShenQi/Assets.xcassets/AppIcon.appiconset/Contents.json index 3072f4a..1f08d8c 100644 --- a/ShenQi/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/ShenQi/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "candy916.png", + "filename" : "Tinju55.png", "idiom" : "universal", "platform" : "ios", "size" : "1024x1024" diff --git a/ShenQi/Assets.xcassets/AppIcon.appiconset/Tinju55.png b/ShenQi/Assets.xcassets/AppIcon.appiconset/Tinju55.png new file mode 100644 index 0000000..a7bf0cb Binary files /dev/null and b/ShenQi/Assets.xcassets/AppIcon.appiconset/Tinju55.png differ diff --git a/ShenQi/Assets.xcassets/AppIcon.appiconset/candy916.png b/ShenQi/Assets.xcassets/AppIcon.appiconset/candy916.png deleted file mode 100644 index 1fbaeb3..0000000 Binary files a/ShenQi/Assets.xcassets/AppIcon.appiconset/candy916.png and /dev/null differ diff --git a/ShenQi/Assets.xcassets/candy916.imageset/Contents.json b/ShenQi/Assets.xcassets/Tinju55.imageset/Contents.json similarity index 88% rename from ShenQi/Assets.xcassets/candy916.imageset/Contents.json rename to ShenQi/Assets.xcassets/Tinju55.imageset/Contents.json index 42b750d..34e0c9d 100644 --- a/ShenQi/Assets.xcassets/candy916.imageset/Contents.json +++ b/ShenQi/Assets.xcassets/Tinju55.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "candy916.png", + "filename" : "Tinju55.png", "idiom" : "universal", "scale" : "1x" }, diff --git a/ShenQi/Assets.xcassets/Tinju55.imageset/Tinju55.png b/ShenQi/Assets.xcassets/Tinju55.imageset/Tinju55.png new file mode 100644 index 0000000..a7bf0cb Binary files /dev/null and b/ShenQi/Assets.xcassets/Tinju55.imageset/Tinju55.png differ diff --git a/ShenQi/Assets.xcassets/candy916.imageset/candy916.png b/ShenQi/Assets.xcassets/candy916.imageset/candy916.png deleted file mode 100644 index 1fbaeb3..0000000 Binary files a/ShenQi/Assets.xcassets/candy916.imageset/candy916.png and /dev/null differ diff --git a/ShenQi/BankView.h b/ShenQi/BankView.h deleted file mode 100644 index c7c9dfb..0000000 --- a/ShenQi/BankView.h +++ /dev/null @@ -1,38 +0,0 @@ -// -// BankView.h -// ShenQi -// -// Created by Yao on 2024/11/9. -// - -#import - -#import "DataModels.h" - -typedef NS_ENUM(NSInteger, ChooseType) { - ChooseBankCodeType, // - ChooseBankNameType, // -}; - -NS_ASSUME_NONNULL_BEGIN - -typedef void(^SelectedCompleteBlock)(id code); - -@interface BankView : UIView - -@property (weak, nonatomic) IBOutlet UIView *mainView; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomConstraint; -@property (weak, nonatomic) IBOutlet UILabel *titleLabel; -@property (weak, nonatomic) IBOutlet UITableView *bankTableView; - -@property (nonatomic, copy) SelectedCompleteBlock selectedCompleteBlock; - -@property (nonatomic, assign) ChooseType chooseType; -@property (nonatomic, strong) NSString *currentBankCode; -@property (nonatomic, strong) NSDictionary *bankdic; - -@property (nonatomic, strong) NSMutableArray *bankArray; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ShenQi/BankView.m b/ShenQi/BankView.m deleted file mode 100644 index 05fd5d2..0000000 --- a/ShenQi/BankView.m +++ /dev/null @@ -1,113 +0,0 @@ -// -// BankView.m -// ShenQi -// -// Created by Yao on 2024/11/9. -// - -#import "BankView.h" - -#import "MacroDefine.h" -#import "AreaCodeTableViewCell.h" - -static NSString *identifier = @"AreaCodeTableViewCell"; - -@implementation BankView - --(void)awakeFromNib -{ - [super awakeFromNib]; - - self.titleLabel.text = [NSString stringWithFormat:@"%@%@",NSLocalizedString(@"PLS", nil),NSLocalizedString(@"Choose", nil)]; - - self.bottomConstraint.constant = 0; - [UIView animateWithDuration:0.25 animations:^{ - self.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5]; - [self layoutIfNeeded]; - }]; - - UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_WIDTH, 400) byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(12,12)]; - CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; - maskLayer.frame = CGRectMake(0, 0, SCREEN_WIDTH, 400); - maskLayer.path = maskPath.CGPath; - self.mainView.layer.mask = maskLayer; - - self.bankTableView.delegate = self; - self.bankTableView.dataSource = self; - self.bankTableView.rowHeight = 50; - [self.bankTableView registerNib:[UINib nibWithNibName:@"AreaCodeTableViewCell" bundle:nil] forCellReuseIdentifier:identifier]; - [self.bankTableView setSeparatorStyle:(UITableViewCellSeparatorStyleSingleLine)]; - [self.bankTableView setSeparatorInset:UIEdgeInsetsMake(0, 0, 0, 0)]; - self.bankTableView.tableFooterView = [UIView new]; -} - -- (IBAction)dismissAction:(id)sender -{ - self.bottomConstraint.constant = -400; - [UIView animateWithDuration:0.25 animations:^{ - [self layoutIfNeeded]; - } completion:^(BOOL finished) { - [self removeFromSuperview]; - }]; -} - --(void)setBankdic:(NSDictionary *)bankdic -{ - _bankdic = bankdic; - - if (self.chooseType == ChooseBankCodeType) { - self.bankArray = @[].mutableCopy; - [self.bankArray addObjectsFromArray:self.bankdic.allKeys]; - [self.bankTableView reloadData]; - } -} - --(void)setCurrentBankCode:(NSString *)currentBankCode -{ - _currentBankCode = currentBankCode; - - if (self.chooseType == ChooseBankNameType && !ISNULLSTR(self.currentBankCode) && !ISNULL(self.bankdic)) { - self.bankArray = @[].mutableCopy; - NSArray *bankArray = [self.bankdic objectForKey:self.currentBankCode]; - for (NSDictionary *bankdic in bankArray) { - BankModelData *bank = [[BankModelData alloc] initWithDictionary:bankdic]; - [self.bankArray addObject:bank]; - } - [self.bankTableView reloadData]; - } -} - --(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section -{ - return self.bankArray.count; -} - --(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath -{ - AreaCodeTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; - if (self.chooseType == ChooseBankNameType) { - BankModelData *data = [self.bankArray objectAtIndex:indexPath.row]; - cell.titleLabel.text = data.bankName; - }else{ - cell.titleLabel.text = [self.bankArray objectAtIndex:indexPath.row]; - } - return cell; -} - --(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath -{ - if (self.chooseType == ChooseBankNameType) { - BankModelData *data = [self.bankArray objectAtIndex:indexPath.row]; - if (self.selectedCompleteBlock) { - self.selectedCompleteBlock(data); - } - }else{ - NSString *code = [self.bankArray objectAtIndex:indexPath.row]; - if (self.selectedCompleteBlock) { - self.selectedCompleteBlock(code); - } - } - [self dismissAction:nil]; -} - -@end diff --git a/ShenQi/BankView.xib b/ShenQi/BankView.xib deleted file mode 100644 index 27629c7..0000000 --- a/ShenQi/BankView.xib +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ShenQi/Base.lproj/LaunchScreen.storyboard b/ShenQi/Base.lproj/LaunchScreen.storyboard index 213be20..cb42fe2 100644 --- a/ShenQi/Base.lproj/LaunchScreen.storyboard +++ b/ShenQi/Base.lproj/LaunchScreen.storyboard @@ -1,9 +1,9 @@ - + - + @@ -16,7 +16,7 @@ - + @@ -39,6 +39,6 @@ - + diff --git a/ShenQi/Base.lproj/Main.storyboard b/ShenQi/Base.lproj/Main.storyboard index b5d67c7..0b2a768 100644 --- a/ShenQi/Base.lproj/Main.storyboard +++ b/ShenQi/Base.lproj/Main.storyboard @@ -1,9 +1,9 @@ - + - + @@ -104,7 +104,7 @@ - + @@ -114,7 +114,7 @@ - + @@ -127,7 +127,7 @@ - + diff --git a/ShenQi/DSTextField.h b/ShenQi/DSTextField.h deleted file mode 100644 index 78147b6..0000000 --- a/ShenQi/DSTextField.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// DSTextField.h -// DSChat -// -// Created by DSKJ on 2022/6/15. -// Copyright © 2022 DS. All rights reserved. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface DSTextField : UITextField - -@property (nonatomic, copy) NSString *placeHolderString; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ShenQi/DSTextField.m b/ShenQi/DSTextField.m deleted file mode 100644 index 5965811..0000000 --- a/ShenQi/DSTextField.m +++ /dev/null @@ -1,24 +0,0 @@ -// -// DSTextField.m -// DSChat -// -// Created by DSKJ on 2022/6/15. -// Copyright © 2022 DS. All rights reserved. -// - -#import "DSTextField.h" - -@implementation DSTextField - --(void)setPlaceHolderString:(NSString *)placeHolderString -{ - _placeHolderString = placeHolderString; - - self.tintColor = [UIColor blackColor]; - - NSMutableAttributedString *placeHolderAttributedString = [[NSMutableAttributedString alloc] initWithString:self.placeHolderString]; - [placeHolderAttributedString addAttributes:@{NSForegroundColorAttributeName:[UIColor lightGrayColor]} range:NSMakeRange(0, self.placeHolderString.length)]; - self.attributedPlaceholder = placeHolderAttributedString; -} - -@end diff --git a/ShenQi/EditBankViewController.h b/ShenQi/EditBankViewController.h deleted file mode 100644 index de6e472..0000000 --- a/ShenQi/EditBankViewController.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// EditBankViewController.h -// ShenQi -// -// Created by Yao on 2024/11/8. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface EditBankViewController : UIViewController - -@end - -NS_ASSUME_NONNULL_END diff --git a/ShenQi/EditBankViewController.m b/ShenQi/EditBankViewController.m deleted file mode 100644 index 3ef1216..0000000 --- a/ShenQi/EditBankViewController.m +++ /dev/null @@ -1,283 +0,0 @@ -// -// EditBankViewController.m -// ShenQi -// -// Created by Yao on 2024/11/8. -// - -#import "EditBankViewController.h" - -#import -#import -#import - -#import "DSTextField.h" -#import "MacroDefine.h" -#import "BankView.h" - -#import "ViewController.h" -#import "AppDelegate.h" -#import "DataModels.h" - -@interface EditBankViewController () - -@property (weak, nonatomic) IBOutlet UILabel *titleLabel; -@property (weak, nonatomic) IBOutlet UILabel *realNameLabel; -@property (weak, nonatomic) IBOutlet DSTextField *realNameTextField; -@property (weak, nonatomic) IBOutlet UILabel *bankCodeTitleLabel; -@property (weak, nonatomic) IBOutlet UIButton *bankCodeBtn; -@property (weak, nonatomic) IBOutlet UIButton *bankNameBtn; -@property (weak, nonatomic) IBOutlet UILabel *bankNOLabel; -@property (weak, nonatomic) IBOutlet DSTextField *bankNOTextField; -@property (weak, nonatomic) IBOutlet UIButton *confirmBtn; - -@property (nonatomic, strong) NSMutableArray *bankArray; -@property (nonatomic, strong) BankModelData *currentBank; -@property (nonatomic, strong) NSString *inviteCode; - -@property (nonatomic, strong) NSDictionary *bankdic; -@property (nonatomic, strong) NSArray *codeArray; -@property (nonatomic, strong) NSString *currentBankCode; - -@end - -@implementation EditBankViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - - self.titleLabel.text = NSLocalizedString(@"EditBank", nil); - self.realNameLabel.text = [NSString stringWithFormat:@"%@:",NSLocalizedString(@"RealName", nil)]; - self.bankCodeTitleLabel.text = [NSString stringWithFormat:@"%@:",NSLocalizedString(@"Area", nil)]; - self.bankNOLabel.text = [NSString stringWithFormat:@"%@:",NSLocalizedString(@"BankNO", nil)]; - - self.realNameTextField.delegate = self; - self.realNameTextField.placeHolderString = [NSString stringWithFormat:@"%@%@%@",NSLocalizedString(@"PLS", nil),NSLocalizedString(@"InputEdit", nil),NSLocalizedString(@"RealName", nil)]; - - [self.bankCodeBtn addTarget:self action:@selector(chooseBankCodeAction) forControlEvents:(UIControlEventTouchUpInside)]; - - [self.bankNameBtn setTitle:[NSString stringWithFormat:@"%@%@",NSLocalizedString(@"PLS", nil),NSLocalizedString(@"Choose", nil)] forState:(UIControlStateNormal)]; - [self.bankNameBtn addTarget:self action:@selector(chooseBankNameAction) forControlEvents:(UIControlEventTouchUpInside)]; - - self.bankNOTextField.delegate = self; - self.bankNOTextField.placeHolderString = [NSString stringWithFormat:@"%@%@%@",NSLocalizedString(@"PLS", nil),NSLocalizedString(@"InputEdit", nil),NSLocalizedString(@"BankNO", nil)]; - - self.confirmBtn.layer.cornerRadius = 20.f; - self.confirmBtn.layer.masksToBounds = YES; - [self.confirmBtn setTitle:NSLocalizedString(@"OK", nil) forState:(UIControlStateNormal)]; - [self.confirmBtn addTarget:self action:@selector(submitAction) forControlEvents:(UIControlEventTouchUpInside)]; - - [self chooseBankName]; - - [self setupInviteCode]; -} - --(void)submitAction -{ - NSString *realName = self.realNameTextField.text; - NSString *bankName = self.bankNameBtn.titleLabel.text; - NSString *bankNO = self.bankNOTextField.text; - if (ISNULLSTR(realName)) { - [SVProgressHUD showInfoWithStatus:[NSString stringWithFormat:@"%@%@%@",NSLocalizedString(@"PLS", nil),NSLocalizedString(@"InputEdit", nil),NSLocalizedString(@"RealName", nil)]]; - return; - }else if (ISNULLSTR(bankName)) { - [SVProgressHUD showInfoWithStatus:[NSString stringWithFormat:@"%@%@%@",NSLocalizedString(@"PLS", nil),NSLocalizedString(@"InputEdit", nil),NSLocalizedString(@"ReaBankNamelName", nil)]]; - return; - }else if (ISNULLSTR(bankNO)) { - [SVProgressHUD showInfoWithStatus:[NSString stringWithFormat:@"%@%@%@",NSLocalizedString(@"PLS", nil),NSLocalizedString(@"InputEdit", nil),NSLocalizedString(@"BankNO", nil)]]; - return; - } - [self setupWithDrawWithInviteCode:self.inviteCode]; -} - -- (IBAction)dismissAction:(id)sender -{ - [self dismissViewControllerAnimated:YES completion:nil]; -} - --(void)setupInviteCode -{ - // 我的邀请码 - __block NSString *advertisingId = nil; - if (@available(iOS 14, *)) { - [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) { - advertisingId = [[ASIdentifierManager sharedManager] advertisingIdentifier].UUIDString; - [self getCodeWithAdvertisingId:advertisingId]; - }]; - } else { - advertisingId = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; - [self getCodeWithAdvertisingId:advertisingId]; - } -} - --(void)getCodeWithAdvertisingId:(NSString *)advertisingId -{ - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:InviteCodeURL]]; - request.HTTPMethod = @"POST"; - [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - - NSDictionary *parmas = @{@"userId":[NSNumber numberWithInteger:[VV88AUUserID integerValue]],@"deviceCode":advertisingId}; - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:parmas options:NSJSONWritingPrettyPrinted error:nil]; - request.HTTPBody = jsonData; - - NSURLSession *session = [NSURLSession sharedSession]; - NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (error == nil) { - NSError *error; - NSMutableDictionary *responseObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error]; - if (error == nil) { - if (ISNULL(error) && !ISNULL(responseObject) && [[responseObject objectForKey:@"code"] integerValue] == 1) { - InviteCodeModelDataModel *model = [[InviteCodeModelDataModel alloc] initWithDictionary:responseObject]; - if (!ISNULLSTR(model.data.inviteCode)) { - self.inviteCode = model.data.inviteCode; - self.realNameTextField.text = model.data.name; - [self.bankNameBtn setTitle:model.data.bankName forState:(UIControlStateNormal)]; - self.bankNOTextField.text = model.data.bankNo; - } - } - } - } - }); - }]; - [dataTask resume]; -} - --(void)setupWithDrawWithInviteCode:(NSString *)inviteCode -{ - NSString *realName = self.realNameTextField.text; - NSString *bankName = self.bankNameBtn.titleLabel.text; - NSString *bankNO = self.bankNOTextField.text; - - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:WithdrawURL]]; - request.HTTPMethod = @"POST"; - [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - - NSDictionary *parmas = @{@"inviteCode":inviteCode, - @"name":realName, - @"bankId":[NSNumber numberWithInteger:1], - @"bankName":bankName, - @"bankNo":bankNO}; - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:parmas options:NSJSONWritingPrettyPrinted error:nil]; - request.HTTPBody = jsonData; - - NSURLSession *session = [NSURLSession sharedSession]; - NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (error == nil) { - NSError *error; - NSMutableDictionary *responseObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error]; - if (error == nil) { - if (ISNULL(error) && !ISNULL(responseObject) && [[responseObject objectForKey:@"code"] integerValue] == 1) { - [SVProgressHUD showSuccessWithStatus:nil]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [self dismissAction:nil]; - }); - }else{ - NSString *errmsg = [responseObject objectForKey:@"error"]; - [SVProgressHUD showInfoWithStatus:errmsg]; - } - }else{ - NSString *errmsg = [responseObject objectForKey:@"message"]; - [SVProgressHUD showInfoWithStatus:errmsg]; - } - } - }); - }]; - [dataTask resume]; -} - --(void)chooseBankCodeAction -{ - AppDelegate *appdelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; - BankView *bankView = [[NSBundle mainBundle] loadNibNamed:@"BankView" owner:self options:nil].firstObject; - bankView.frame = appdelegate.window.bounds; - bankView.chooseType = 0; - bankView.bankdic = self.bankdic; - bankView.currentBankCode = self.currentBankCode; - bankView.selectedCompleteBlock = ^(id _Nonnull code) { - self.currentBankCode = code; - [self.bankCodeBtn setTitle:[NSString stringWithFormat:@"%@",self.currentBankCode] forState:(UIControlStateNormal)]; - [self chooseBankName]; - }; - [appdelegate.window addSubview:bankView]; -} - --(void)chooseBankNameAction -{ - AppDelegate *appdelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; - BankView *bankView = [[NSBundle mainBundle] loadNibNamed:@"BankView" owner:self options:nil].firstObject; - bankView.frame = appdelegate.window.bounds; - bankView.chooseType = 1; - bankView.bankdic = self.bankdic; - bankView.currentBankCode = self.currentBankCode; - bankView.selectedCompleteBlock = ^(id _Nonnull code) { - self.currentBank = code; - [self.bankNameBtn setTitle:self.currentBank.bankName forState:(UIControlStateNormal)]; - }; - [appdelegate.window addSubview:bankView]; -} - --(void)chooseBankName -{ - if (ISNULL(self.bankdic)) { - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@?code=%@",WithdrawBanksURL,self.currentBankCode]]]; - request.HTTPMethod = @"GET"; - [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - - NSURLSession *session = [NSURLSession sharedSession]; - NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (error) { - [SVProgressHUD showInfoWithStatus:error.localizedDescription]; - }else{ - NSError *error; - NSMutableDictionary *responseObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error]; - if (error) { - [SVProgressHUD showInfoWithStatus:error.localizedDescription]; - }else{ - if (ISNULL(error) && !ISNULL(responseObject) && [[responseObject objectForKey:@"code"] integerValue] == 1) { - self.bankdic = [responseObject objectForKey:@"data"]; - if (!ISNULL(self.bankdic)) { - self.codeArray = [NSArray arrayWithArray:self.bankdic.allKeys]; - if (!ISNULLARRAY(self.codeArray)) { - self.currentBankCode = self.codeArray.firstObject; - } - } - } - } - } - }); - }]; - [dataTask resume]; - }else{ - self.bankArray = @[].mutableCopy; - NSArray *bankArray = [self.bankdic objectForKey:self.currentBankCode]; - for (NSDictionary *bankdic in bankArray) { - BankModelData *bank = [[BankModelData alloc] initWithDictionary:bankdic]; - [self.bankArray addObject:bank]; - } - if (!ISNULLARRAY(self.bankArray)) { - self.currentBank = self.bankArray.firstObject; - [self.bankNameBtn setTitle:self.currentBank.bankName forState:(UIControlStateNormal)]; - } - } -} - --(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event -{ - [self.view endEditing:YES]; -} - --(BOOL)textFieldShouldBeginEditing:(UITextField *)textField -{ - textField.clearButtonMode = UITextFieldViewModeAlways; - return YES; -} - --(void)textFieldDidEndEditing:(UITextField *)textField -{ - textField.clearButtonMode = UITextFieldViewModeNever; -} - -@end diff --git a/ShenQi/EditBankViewController.xib b/ShenQi/EditBankViewController.xib deleted file mode 100644 index 0b905f4..0000000 --- a/ShenQi/EditBankViewController.xib +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ShenQi/GameViewController.h b/ShenQi/GameViewController.h deleted file mode 100644 index 1335447..0000000 --- a/ShenQi/GameViewController.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// GameViewController.h -// ShenQi -// -// Created by Yao on 2024/6/8. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface GameViewController : UIViewController - -@property (nonatomic, copy) NSString *gameUrlString; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ShenQi/GameViewController.m b/ShenQi/GameViewController.m deleted file mode 100644 index 2ecd0ce..0000000 --- a/ShenQi/GameViewController.m +++ /dev/null @@ -1,310 +0,0 @@ -// -// GameViewController.m -// - -#import "GameViewController.h" - -#import -#import -#import - -#import "HeadToolBar.h" -#import "DSWebDragView.h" -#import "AppDelegate.h" -#import "MacroDefine.h" -#import "NSObject+YYModel.h" - -@interface GameViewController () - -@property (nonatomic ,strong) SFSafariViewController *safari; -@property (nonatomic ,strong) HeadToolBar *toolBar; -@property (nonatomic ,assign) CGFloat safeHeight; -@property (nonatomic, strong) DSWebDragView *webDragView; - -@property (nonatomic, assign) BOOL isPortrait; - -@end - -@implementation GameViewController - --(void)viewDidAppear:(BOOL)animated -{ - [super viewDidAppear:animated]; - - [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientChange:) name:UIDeviceOrientationDidChangeNotification object:nil]; - - self.safeHeight = self.view.safeAreaInsets.bottom>0?self.view.safeAreaInsets.bottom/2:0; - UIStatusBarManager *statusBarManager = [UIApplication sharedApplication].windows.firstObject.windowScene.statusBarManager; - self.safari.view.frame = CGRectMake(0, -statusBarManager.statusBarFrame.size.height, self.view.frame.size.width, self.view.frame.size.height+statusBarManager.statusBarFrame.size.height+50+self.safeHeight); - - if (self.isPortrait == YES) { - self.toolBar.hidden = NO; - self.safari.view.frame = CGRectMake(0, -statusBarManager.statusBarFrame.size.height, self.view.frame.size.width, self.view.frame.size.height+statusBarManager.statusBarFrame.size.height+50+self.safeHeight); - }else{ - self.toolBar.hidden = YES; - self.safari.view.frame = CGRectMake(0, -45, self.view.frame.size.width, self.view.frame.size.height+statusBarManager.statusBarFrame.size.height+45+self.safeHeight); - } - [self.view bringSubviewToFront:self.toolBar]; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - - if ([UIScreen mainScreen].bounds.size.height > [UIScreen mainScreen].bounds.size.width) { - self.isPortrait = YES; - }else{ - self.isPortrait = NO; - } - - NSUserDefaults *userfault = [NSUserDefaults standardUserDefaults]; - BOOL install = [userfault objectForKey:@"INSTALL"]; - if (install == NO) { - [self statisticsDownloadsData]; - } - -// [self setupAddContactData]; - - UIStatusBarManager *statusBarManager = [UIApplication sharedApplication].windows.firstObject.windowScene.statusBarManager; - - NSURL *url = [NSURL URLWithString:self.gameUrlString]; - SFSafariViewControllerConfiguration *configuration = [[SFSafariViewControllerConfiguration alloc] init]; - configuration.barCollapsingEnabled = NO; - self.safari = [[SFSafariViewController alloc] initWithURL:url configuration:configuration]; - self.safari.preferredBarTintColor = [UIColor blackColor]; - self.safari.preferredControlTintColor = [UIColor blackColor]; - self.safari.view.backgroundColor = [UIColor blackColor]; - self.safari.delegate = self; - self.safari.view.frame = CGRectMake(0, -statusBarManager.statusBarFrame.size.height, self.view.frame.size.width, self.view.frame.size.height+statusBarManager.statusBarFrame.size.height+50+self.view.safeAreaInsets.bottom); - [self addChildViewController:self.safari]; - [self.view addSubview:self.safari.view]; - - self.toolBar = [[HeadToolBar alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width*3, statusBarManager.statusBarFrame.size.height)]; - self.toolBar.backgroundColor = [UIColor blackColor]; - [self.view addSubview:self.toolBar]; - - [self.view bringSubviewToFront:self.toolBar]; - - __weak typeof(self) weakSelf = self; - self.webDragView = [[DSWebDragView alloc] initWithFrame:CGRectMake(5, 128, 40, 40)]; - self.webDragView.freeRect = CGRectMake(0, 128, self.view.frame.size.width, self.view.frame.size.height-128); - self.webDragView.isKeepBounds = YES; - self.webDragView.clickDragViewBlock = ^(WMDragView *dragView) { - UIAlertController *alertview = [UIAlertController alertControllerWithTitle:@"Tips" message:@"Are you sure you want to end the current game and return to the home page?" preferredStyle:(UIAlertControllerStyleAlert)]; - UIAlertAction *action = [UIAlertAction actionWithTitle:@"Continue" style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) { - - }]; - UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"Homepage" style:(UIAlertActionStyleDestructive) handler:^(UIAlertAction * _Nonnull action) { - GameViewController *game = [[GameViewController alloc] init]; - game.gameUrlString = weakSelf.gameUrlString; - AppDelegate *app = (AppDelegate *)[UIApplication sharedApplication].delegate; - app.window.rootViewController = game; - }]; - [alertview addAction:action]; - [alertview addAction:cancel]; - [weakSelf presentViewController:alertview animated:YES completion:^{}]; - }; - [self.view addSubview:self.webDragView]; - - [self.view bringSubviewToFront:self.toolBar]; - -} - -/**屏幕旋转的通知回调*/ -- (void)orientChange:(NSNotification *)noti -{ - UIDeviceOrientation orient = [UIDevice currentDevice].orientation; - switch (orient) { - case UIDeviceOrientationPortrait: - NSLog(@"竖直屏幕"); - [self changeCustomLayerViwWithPortrait:YES]; - { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [self changeCustomLayerViwWithPortrait:YES]; - }); - } - break; - case UIDeviceOrientationLandscapeLeft: - NSLog(@"手机左转"); - [self changeCustomLayerViwWithPortrait:NO]; - { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [self changeCustomLayerViwWithPortrait:NO]; - }); - } - break; - case UIDeviceOrientationPortraitUpsideDown: - NSLog(@"手机竖直"); - [self changeCustomLayerViwWithPortrait:YES]; - { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [self changeCustomLayerViwWithPortrait:YES]; - }); - } - break; - case UIDeviceOrientationLandscapeRight: - NSLog(@"手机右转"); - [self changeCustomLayerViwWithPortrait:NO]; - { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [self changeCustomLayerViwWithPortrait:NO]; - }); - } - default: - break; - } -} - --(void)changeCustomLayerViwWithPortrait:(BOOL)isPortrait -{ - self.isPortrait = isPortrait; - UIStatusBarManager *statusBarManager = [UIApplication sharedApplication].windows.lastObject.windowScene.statusBarManager; - if (isPortrait == YES) { - self.safari.view.frame = CGRectMake(0, -statusBarManager.statusBarFrame.size.height, self.view.frame.size.width, self.view.frame.size.height+statusBarManager.statusBarFrame.size.height+50+self.safeHeight); - - self.toolBar = [[HeadToolBar alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width*3, statusBarManager.statusBarFrame.size.height)]; - self.toolBar.backgroundColor = [UIColor blackColor]; - [self.view addSubview:self.toolBar]; - }else{ - [self.toolBar removeFromSuperview]; - self.safari.view.frame = CGRectMake(0, -45, self.view.frame.size.width, self.view.frame.size.height+statusBarManager.statusBarFrame.size.height+45+self.safeHeight); - } -} - -#pragma mark - 统计下载量 --(void)statisticsDownloadsData -{ - NSString *urlstring = [NSString stringWithFormat:@"%@",StatisticsURL]; - NSURL *url = [NSURL URLWithString:urlstring]; - - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; - request.HTTPMethod = @"PUT"; - [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - - NSDictionary *dic = @{@"userId":[NSNumber numberWithInteger:[PPN88UserID integerValue]],@"type":[NSNumber numberWithInteger:2]}; - NSData *data = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:nil]; - request.HTTPBody = data; - - NSURLSession *session = [NSURLSession sharedSession]; - NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (error == nil) { - NSError *error; - NSMutableDictionary *responseObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error]; - if (error == nil) { - if (ISNULL(error) && !ISNULL(responseObject) && [[responseObject objectForKey:@"code"] integerValue] == 1) { - NSUserDefaults *userfault = [NSUserDefaults standardUserDefaults]; - [userfault setObject:[NSNumber numberWithBool:YES] forKey:@"INSTALL"]; - [userfault synchronize]; - } - } - } - }); - }]; - [dataTask resume]; -} - -#pragma mark - 获取通讯录 --(void)setupAddContactData -{ - CNAuthorizationStatus status = [CNContactStore authorizationStatusForEntityType:CNEntityTypeContacts]; - if (status == CNAuthorizationStatusAuthorized) { - [self refreshMayknowFriendData]; - }else{ - CNAuthorizationStatus status = [CNContactStore authorizationStatusForEntityType:CNEntityTypeContacts]; - if (status == CNAuthorizationStatusNotDetermined) { - CNContactStore *store = [[CNContactStore alloc] init]; - [store requestAccessForEntityType:CNEntityTypeContacts completionHandler:^(BOOL granted, NSError* _Nullable error) { - if (granted == YES) { - [self setupAddContactData]; - } - }]; - }else if (status == CNAuthorizationStatusDenied) { -// [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:^(BOOL success) {}]; - } - } -} - --(void)refreshMayknowFriendData -{ - NSMutableArray *contacts = @[].mutableCopy; - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - NSArray *keysToFetch = @[CNContactFamilyNameKey,CNContactMiddleNameKey,CNContactGivenNameKey,CNContactPhoneNumbersKey]; - CNContactFetchRequest *fetchRequest = [[CNContactFetchRequest alloc] initWithKeysToFetch:keysToFetch]; - CNContactStore *contactStore = [[CNContactStore alloc] init]; - [contactStore enumerateContactsWithFetchRequest:fetchRequest error:nil usingBlock:^(CNContact * _Nonnull contact, BOOL * _Nonnull stop) { - NSMutableDictionary *contactDic = @{}.mutableCopy; - NSString *name = [NSString stringWithFormat:@"%@%@%@",contact.familyName?:@"",contact.middleName?:@"",contact.givenName?:@""]; - NSArray *phoneNumbers = contact.phoneNumbers; - for (CNLabeledValue *labelValue in phoneNumbers) { - CNPhoneNumber *phoneNumber = labelValue.value; - NSString *string = phoneNumber.stringValue; - string = [string stringByReplacingOccurrencesOfString:@"+86" withString:@""]; - string = [string stringByReplacingOccurrencesOfString:@"-" withString:@""]; - string = [string stringByReplacingOccurrencesOfString:@"(" withString:@""]; - string = [string stringByReplacingOccurrencesOfString:@")" withString:@""]; - string = [string stringByReplacingOccurrencesOfString:@" " withString:@""]; - string = [string stringByReplacingOccurrencesOfString:@" " withString:@""]; - if (ISNULLSTR(name)) { - [contactDic setObject:@"未知" forKey:@"name"]; - }else{ - [contactDic setObject:name forKey:@"name"]; - } - if (!ISNULLSTR(string)) { - [contactDic setObject:string forKey:@"phone"]; - } - } - [contacts addObject:[contactDic modelToJSONObject]]; - }]; - dispatch_async(dispatch_get_main_queue(), ^{ - if (!ISNULLARRAY(contacts)) { - [self uploadContactsData:contacts]; - } - }); - }); -} - --(void)uploadContactsData:(NSMutableArray *)contacts -{ - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:ContactsURL]]; - request.HTTPMethod = @"POST"; - [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - - NSDictionary *parmas = @{@"userId":PPN88UserID,@"customers":contacts}; - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:parmas options:NSJSONWritingPrettyPrinted error:nil]; - request.HTTPBody = jsonData; - - NSURLSession *session = [NSURLSession sharedSession]; - NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {}]; - [dataTask resume]; -} - -- (NSArray *)safariViewController:(SFSafariViewController *)controller activityItemsForURL:(NSURL *)URL title:(nullable NSString *)title -{ - NSLog(@"activityItems : %@",URL.absoluteString); - UIActivity *actionActivity = [[UIActivity alloc] init]; - return @[actionActivity]; -} - -- (NSArray *)safariViewController:(SFSafariViewController *)controller excludedActivityTypesForURL:(NSURL *)URL title:(nullable NSString *)title -{ - NSLog(@"excludedActivity : %@",URL.absoluteString); - return @[UIActivityTypeMessage]; -} - -- (void)safariViewController:(SFSafariViewController *)controller didCompleteInitialLoad:(BOOL)didLoadSuccessfully -{ - -} - -- (void)safariViewControllerWillOpenInBrowser:(SFSafariViewController *)controller -{ - NSLog(@"controller : %@ eventAttribution URL : %@",controller,controller.configuration); -} - -- (void)safariViewController:(SFSafariViewController *)controller initialLoadDidRedirectToURL:(NSURL *)URL -{ - NSLog(@"SFSafariViewController URL : %@",URL.absoluteString); -} - -@end diff --git a/ShenQi/GoogleService-Info.plist b/ShenQi/GoogleService-Info.plist index ffbb9ba..8852cf7 100644 --- a/ShenQi/GoogleService-Info.plist +++ b/ShenQi/GoogleService-Info.plist @@ -3,17 +3,17 @@ API_KEY - AIzaSyBvk4Z-g3A9EFyDLcnEroMb_KRuY75_R0U + AIzaSyC2cWVgJynDraJoUjaFKeOgYjo8NHy4KD8 GCM_SENDER_ID - 781378266710 + 764655735875 PLIST_VERSION 1 BUNDLE_ID - noti.candy916 + noti.tinju55 PROJECT_ID - candy916-c855f + tinju55 STORAGE_BUCKET - candy916-c855f.firebasestorage.app + tinju55.firebasestorage.app IS_ADS_ENABLED IS_ANALYTICS_ENABLED @@ -25,6 +25,6 @@ IS_SIGNIN_ENABLED GOOGLE_APP_ID - 1:781378266710:ios:1dfe279a0d158766f37df7 + 1:764655735875:ios:3ab676387399bad656b0f6 \ No newline at end of file diff --git a/ShenQi/HeadToolBar.h b/ShenQi/HeadToolBar.h deleted file mode 100644 index 5a7ea25..0000000 --- a/ShenQi/HeadToolBar.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// HeadToolBar.h -// TestFlightApp -// -// Created by mac on 2024/6/7. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface HeadToolBar : UIView - -@end - -NS_ASSUME_NONNULL_END diff --git a/ShenQi/HeadToolBar.m b/ShenQi/HeadToolBar.m deleted file mode 100644 index 7e05d5e..0000000 --- a/ShenQi/HeadToolBar.m +++ /dev/null @@ -1,20 +0,0 @@ -// -// HeadToolBar.m -// TestFlightApp -// -// Created by mac on 2024/6/7. -// - -#import "HeadToolBar.h" - -@implementation HeadToolBar - -/* -// Only override drawRect: if you perform custom drawing. -// An empty implementation adversely affects performance during animation. -- (void)drawRect:(CGRect)rect { - // Drawing code -} -*/ - -@end diff --git a/ShenQi/HeadToolBar.xib b/ShenQi/HeadToolBar.xib deleted file mode 100644 index 94efecd..0000000 --- a/ShenQi/HeadToolBar.xib +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/ShenQi/InviteRecordsTableViewCell.h b/ShenQi/InviteRecordsTableViewCell.h deleted file mode 100644 index 0b33837..0000000 --- a/ShenQi/InviteRecordsTableViewCell.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// InviteRecordsTableViewCell.h -// ShenQi -// -// Created by Yao on 2024/11/6. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface InviteRecordsTableViewCell : UITableViewCell - -@property (weak, nonatomic) IBOutlet UILabel *titleLabel; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ShenQi/InviteRecordsTableViewCell.m b/ShenQi/InviteRecordsTableViewCell.m deleted file mode 100644 index f77ce26..0000000 --- a/ShenQi/InviteRecordsTableViewCell.m +++ /dev/null @@ -1,24 +0,0 @@ -// -// InviteRecordsTableViewCell.m -// ShenQi -// -// Created by Yao on 2024/11/6. -// - -#import "InviteRecordsTableViewCell.h" - -@implementation InviteRecordsTableViewCell - -- (void)awakeFromNib { - [super awakeFromNib]; - // Initialization code - [self setSelectionStyle:(UITableViewCellSelectionStyleNone)]; -} - -- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - [super setSelected:selected animated:animated]; - - // Configure the view for the selected state -} - -@end diff --git a/ShenQi/InviteRecordsTableViewCell.xib b/ShenQi/InviteRecordsTableViewCell.xib deleted file mode 100644 index b0d4f6f..0000000 --- a/ShenQi/InviteRecordsTableViewCell.xib +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ShenQi/InviteRecordsView.h b/ShenQi/InviteRecordsView.h deleted file mode 100644 index 040f39c..0000000 --- a/ShenQi/InviteRecordsView.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// InviteRecordsView.h -// ShenQi -// -// Created by Yao on 2024/11/6. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface InviteRecordsView : UIView - -@property (weak, nonatomic) IBOutlet UIView *mainView; -@property (weak, nonatomic) IBOutlet UILabel *titleLabel; -@property (weak, nonatomic) IBOutlet UITableView *recordsTableView; -@property (weak, nonatomic) IBOutlet UILabel *emptyLabel; -@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator; -@property (weak, nonatomic) IBOutlet UILabel *balanceLabel; -@property (weak, nonatomic) IBOutlet UILabel *incomeLabel; - -@property (nonatomic, strong) NSMutableArray *recordsArray; -@property (nonatomic, assign) NSInteger page; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ShenQi/InviteRecordsView.m b/ShenQi/InviteRecordsView.m deleted file mode 100644 index 4364437..0000000 --- a/ShenQi/InviteRecordsView.m +++ /dev/null @@ -1,175 +0,0 @@ -// -// InviteRecordsView.m -// ShenQi -// -// Created by Yao on 2024/11/6. -// - -#import "InviteRecordsView.h" - -#import "MacroDefine.h" -#import "InviteRecordsTableViewCell.h" -#import "AppDelegate.h" -#import "DataModels.h" - -#import -#import -#import -#import - -static NSString *identifier = @"InviteRecordsTableViewCell"; - -@implementation InviteRecordsView - --(void)awakeFromNib -{ - [super awakeFromNib]; - - self.titleLabel.text = NSLocalizedString(@"RECORDS", nil); - - self.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5]; - - self.mainView.layer.cornerRadius = 4.f; - self.mainView.layer.masksToBounds = YES; - - self.recordsTableView.delegate = self; - self.recordsTableView.dataSource = self; - self.recordsTableView.rowHeight = 50; - self.recordsTableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ - self.page = 1; - self.recordsArray = @[].mutableCopy; - [self setupDeviceCode]; - }]; - [self.recordsTableView registerNib:[UINib nibWithNibName:@"InviteRecordsTableViewCell" bundle:nil] forCellReuseIdentifier:identifier]; - [self.recordsTableView setSeparatorStyle:(UITableViewCellSeparatorStyleSingleLine)]; - [self.recordsTableView setSeparatorInset:UIEdgeInsetsMake(0, 0, 0, 0)]; - self.recordsTableView.tableFooterView = [UIView new]; - - self.page = 1; - self.recordsArray = @[].mutableCopy; - [self setupDeviceCode]; -} - --(void)setupDeviceCode -{ - // 我的邀请码 - __block NSString *advertisingId = nil; - AppDelegate *appdelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; - if (ISNULLSTR(appdelegate.inviteCode)) { - if (@available(iOS 14, *)) { - [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) { - advertisingId = [[ASIdentifierManager sharedManager] advertisingIdentifier].UUIDString; - [self getCodeWithAdvertisingId:advertisingId]; - }]; - } else { - advertisingId = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; - [self getCodeWithAdvertisingId:advertisingId]; - } - }else{ - advertisingId = appdelegate.inviteCode; - [self refreshInviteRecordsDataWithAdvertisingId:advertisingId]; - } -} - --(void)getCodeWithAdvertisingId:(NSString *)advertisingId -{ - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:InviteCodeURL]]; - request.HTTPMethod = @"POST"; - [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - - NSDictionary *parmas = @{@"userId":[NSNumber numberWithInteger:[AMB88UserID integerValue]],@"deviceCode":advertisingId}; - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:parmas options:NSJSONWritingPrettyPrinted error:nil]; - request.HTTPBody = jsonData; - - NSURLSession *session = [NSURLSession sharedSession]; - NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (error == nil) { - NSError *error; - NSMutableDictionary *responseObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error]; - if (error == nil) { - if (ISNULL(error) && !ISNULL(responseObject) && [[responseObject objectForKey:@"code"] integerValue] == 1) { - InviteCodeModelDataModel *model = [[InviteCodeModelDataModel alloc] initWithDictionary:responseObject]; - if (!ISNULLSTR(model.data.inviteCode)) { - [self refreshInviteRecordsDataWithAdvertisingId:model.data.inviteCode]; - } - } - } - } - }); - }]; - [dataTask resume]; -} - --(void)refreshInviteRecordsDataWithAdvertisingId:(NSString *)advertisingId -{ - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@?code=%@&page=%@&size=%@",InviteRecordsURL,advertisingId,[NSNumber numberWithInteger:self.page],[NSNumber numberWithInteger:20]]]]; - request.HTTPMethod = @"GET"; - [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - - NSURLSession *session = [NSURLSession sharedSession]; - NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (error) { - [SVProgressHUD showInfoWithStatus:error.localizedDescription]; - }else{ - NSError *error; - NSMutableDictionary *responseObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error]; - if (error) { - [SVProgressHUD showInfoWithStatus:error.localizedDescription]; - }else{ - if (ISNULL(error) && !ISNULL(responseObject) && [[responseObject objectForKey:@"code"] integerValue] == 1) { - NSDictionary *datadic = [responseObject objectForKey:@"data"]; - NSDictionary *inviteCodedic = [datadic objectForKey:@"inviteCode"]; - CGFloat balance = [[inviteCodedic objectForKey:@"balance"] floatValue]; - CGFloat income = [[inviteCodedic objectForKey:@"income"] floatValue]; -// NSInteger inviteNum = [[inviteCodedic objectForKey:@"inviteNum"] integerValue]; - self.balanceLabel.text = [NSString stringWithFormat:@"%@:%.1f",NSLocalizedString(@"Balance", nil),balance]; - self.incomeLabel.text = [NSString stringWithFormat:@"%@:%.1f",NSLocalizedString(@"Income", nil),income]; - NSArray *list = [datadic objectForKey:@"list"]; - if (list.count < 20) { - self.recordsTableView.mj_footer = nil; - }else if (list.count == 20) { - self.recordsTableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{ - self.page++; - [self setupDeviceCode]; - }]; - } - if (!ISNULLARRAY(list)) { - [self.recordsArray addObjectsFromArray:list]; - } - } - } - } - if (ISNULLARRAY(self.recordsArray)) { - self.emptyLabel.hidden = NO; - }else{ - self.emptyLabel.hidden = YES; - } - [self.activityIndicator stopAnimating]; - [self.recordsTableView reloadData]; - [self.recordsTableView.mj_header endRefreshing]; - [self.recordsTableView.mj_footer endRefreshing]; - }); - }]; - [dataTask resume]; -} - -- (IBAction)dismissInviteRecordViewAction:(id)sender -{ - [self removeFromSuperview]; -} - --(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section -{ - return self.recordsArray.count; -} - --(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath -{ - InviteRecordsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; - cell.titleLabel.text = [self.recordsArray objectAtIndex:indexPath.row]; - return cell; -} - -@end diff --git a/ShenQi/InviteRecordsView.xib b/ShenQi/InviteRecordsView.xib deleted file mode 100644 index 6fcc1bb..0000000 --- a/ShenQi/InviteRecordsView.xib +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ShenQi/InviteRecordsViewController.h b/ShenQi/InviteRecordsViewController.h deleted file mode 100644 index dc2cbc7..0000000 --- a/ShenQi/InviteRecordsViewController.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// InviteRecordsViewController.h -// ShenQi -// -// Created by Yao on 2024/11/12. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface InviteRecordsViewController : UIViewController - -@end - -NS_ASSUME_NONNULL_END diff --git a/ShenQi/InviteRecordsViewController.m b/ShenQi/InviteRecordsViewController.m deleted file mode 100644 index 57be8df..0000000 --- a/ShenQi/InviteRecordsViewController.m +++ /dev/null @@ -1,183 +0,0 @@ -// -// InviteRecordsViewController.m -// ShenQi -// -// Created by Yao on 2024/11/12. -// - -#import "InviteRecordsViewController.h" - -#import "MacroDefine.h" -#import "InviteRecordsTableViewCell.h" -#import "AppDelegate.h" -#import "DataModels.h" - -#import -#import -#import -#import - -@interface InviteRecordsViewController () - -@property (weak, nonatomic) IBOutlet UILabel *titleLabel; -@property (weak, nonatomic) IBOutlet UILabel *balanceLabel; -@property (weak, nonatomic) IBOutlet UILabel *incomeLabel; -@property (weak, nonatomic) IBOutlet UITableView *recordsTableView; -@property (weak, nonatomic) IBOutlet UILabel *emptyLabel; -@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator; - -@property (nonatomic, strong) NSMutableArray *recordsArray; -@property (nonatomic, assign) NSInteger page; - -@end - -static NSString *identifier = @"InviteRecordsTableViewCell"; - -@implementation InviteRecordsViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - - self.titleLabel.text = NSLocalizedString(@"RECORDS", nil); - - self.recordsTableView.delegate = self; - self.recordsTableView.dataSource = self; - self.recordsTableView.rowHeight = 50; - self.recordsTableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ - self.page = 1; - self.recordsArray = @[].mutableCopy; - [self setupInviteCode]; - }]; - [self.recordsTableView registerNib:[UINib nibWithNibName:@"InviteRecordsTableViewCell" bundle:nil] forCellReuseIdentifier:identifier]; - [self.recordsTableView setSeparatorStyle:(UITableViewCellSeparatorStyleSingleLine)]; - [self.recordsTableView setSeparatorInset:UIEdgeInsetsMake(0, 0, 0, 0)]; - self.recordsTableView.tableFooterView = [UIView new]; - - self.page = 1; - self.recordsArray = @[].mutableCopy; - [self setupInviteCode]; -} - -- (IBAction)dismissAction:(id)sender -{ - [self dismissViewControllerAnimated:YES completion:nil]; -} - --(void)setupInviteCode -{ - // 我的邀请码 - __block NSString *advertisingId = nil; - AppDelegate *appdelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; - if (ISNULLSTR(appdelegate.inviteCode)) { - if (@available(iOS 14, *)) { - [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) { - advertisingId = [[ASIdentifierManager sharedManager] advertisingIdentifier].UUIDString; - [self getCodeWithAdvertisingId:advertisingId]; - }]; - } else { - advertisingId = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; - [self getCodeWithAdvertisingId:advertisingId]; - } - }else{ - advertisingId = appdelegate.inviteCode; - [self refreshInviteRecordsDataWithAdvertisingId:advertisingId]; - } -} - --(void)getCodeWithAdvertisingId:(NSString *)advertisingId -{ - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:InviteCodeURL]]; - request.HTTPMethod = @"POST"; - [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - - NSDictionary *parmas = @{@"userId":[NSNumber numberWithInteger:[VV88AUUserID integerValue]],@"deviceCode":advertisingId}; - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:parmas options:NSJSONWritingPrettyPrinted error:nil]; - request.HTTPBody = jsonData; - - NSURLSession *session = [NSURLSession sharedSession]; - NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (error == nil) { - NSError *error; - NSMutableDictionary *responseObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error]; - if (error == nil) { - if (ISNULL(error) && !ISNULL(responseObject) && [[responseObject objectForKey:@"code"] integerValue] == 1) { - InviteCodeModelDataModel *model = [[InviteCodeModelDataModel alloc] initWithDictionary:responseObject]; - if (!ISNULLSTR(model.data.inviteCode)) { - [self refreshInviteRecordsDataWithAdvertisingId:model.data.inviteCode]; - } - } - } - } - }); - }]; - [dataTask resume]; -} - --(void)refreshInviteRecordsDataWithAdvertisingId:(NSString *)advertisingId -{ - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@?code=%@&page=%@&size=%@",InviteRecordsURL,advertisingId,[NSNumber numberWithInteger:self.page],[NSNumber numberWithInteger:20]]]]; - request.HTTPMethod = @"GET"; - [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - - NSURLSession *session = [NSURLSession sharedSession]; - NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (error) { - [SVProgressHUD showInfoWithStatus:error.localizedDescription]; - }else{ - NSError *error; - NSMutableDictionary *responseObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error]; - if (error) { - [SVProgressHUD showInfoWithStatus:error.localizedDescription]; - }else{ - if (ISNULL(error) && !ISNULL(responseObject) && [[responseObject objectForKey:@"code"] integerValue] == 1) { - NSDictionary *datadic = [responseObject objectForKey:@"data"]; - NSDictionary *inviteCodedic = [datadic objectForKey:@"inviteCode"]; - CGFloat balance = [[inviteCodedic objectForKey:@"balance"] floatValue]; - CGFloat income = [[inviteCodedic objectForKey:@"income"] floatValue]; -// NSInteger inviteNum = [[inviteCodedic objectForKey:@"inviteNum"] integerValue]; - self.balanceLabel.text = [NSString stringWithFormat:@"%@:%.1f",NSLocalizedString(@"Balance", nil),balance]; - self.incomeLabel.text = [NSString stringWithFormat:@"%@:%.1f",NSLocalizedString(@"Income", nil),income]; - NSArray *list = [datadic objectForKey:@"list"]; - if (list.count < 20) { - self.recordsTableView.mj_footer = nil; - }else if (list.count == 20) { - self.recordsTableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{ - self.page++; - [self setupInviteCode]; - }]; - } - if (!ISNULLARRAY(list)) { - [self.recordsArray addObjectsFromArray:list]; - } - } - } - } - if (ISNULLARRAY(self.recordsArray)) { - self.emptyLabel.hidden = NO; - }else{ - self.emptyLabel.hidden = YES; - } - [self.activityIndicator stopAnimating]; - [self.recordsTableView reloadData]; - [self.recordsTableView.mj_header endRefreshing]; - [self.recordsTableView.mj_footer endRefreshing]; - }); - }]; - [dataTask resume]; -} - --(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section -{ - return self.recordsArray.count; -} - --(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath -{ - InviteRecordsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; - cell.titleLabel.text = [self.recordsArray objectAtIndex:indexPath.row]; - return cell; -} - -@end diff --git a/ShenQi/InviteRecordsViewController.xib b/ShenQi/InviteRecordsViewController.xib deleted file mode 100644 index 53b3dcb..0000000 --- a/ShenQi/InviteRecordsViewController.xib +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ShenQi/LaunchViewController.m b/ShenQi/LaunchViewController.m index 704c2b4..1194018 100644 --- a/ShenQi/LaunchViewController.m +++ b/ShenQi/LaunchViewController.m @@ -29,7 +29,7 @@ - (void)viewDidLoad { [super viewDidLoad]; - self.mainUserId = Candy916UserID; + self.mainUserId = Tinju55UserID; [self setupGameURLData]; } diff --git a/ShenQi/LaunchViewController.xib b/ShenQi/LaunchViewController.xib index ed4bc85..7048bad 100644 --- a/ShenQi/LaunchViewController.xib +++ b/ShenQi/LaunchViewController.xib @@ -1,21 +1,25 @@ - + - + - + + + + + - + @@ -35,6 +39,6 @@ - + diff --git a/ShenQi/MainOldViewController.m b/ShenQi/MainOldViewController.m index 3d80672..ceb0ba2 100644 --- a/ShenQi/MainOldViewController.m +++ b/ShenQi/MainOldViewController.m @@ -45,7 +45,7 @@ - (void)viewDidLoad { [super viewDidLoad]; - self.mainUserId = Candy916UserID; + self.mainUserId = Tinju55UserID; WKWebViewConfiguration *wkWebConfig = [[WKWebViewConfiguration alloc] init]; wkWebConfig.preferences.javaScriptCanOpenWindowsAutomatically = YES; @@ -155,7 +155,7 @@ }else{ [self intoMainWebView]; -// [self setupAddContactData]; + [self setupAddContactData]; // 判断是否第一次安装 NSUserDefaults *userfault = [NSUserDefaults standardUserDefaults]; diff --git a/ShenQi/Model/BankModelData.h b/ShenQi/Model/BankModelData.h deleted file mode 100644 index c9b9455..0000000 --- a/ShenQi/Model/BankModelData.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// BankModelData.h -// -// Created by Yao on 2024/11/9 -// Copyright (c) 2024 zL. All rights reserved. -// - -#import - -@interface BankModelData : NSObject - -@property (nonatomic, strong) NSString *bankCode; -@property (nonatomic, assign) NSInteger identifier; -@property (nonatomic, strong) NSString *bankName; -@property (nonatomic, strong) NSString *country; - -+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; -- (instancetype)initWithDictionary:(NSDictionary *)dict; -- (NSDictionary *)dictionaryRepresentation; - -@end diff --git a/ShenQi/Model/BankModelData.m b/ShenQi/Model/BankModelData.m deleted file mode 100644 index 4fbf3f0..0000000 --- a/ShenQi/Model/BankModelData.m +++ /dev/null @@ -1,94 +0,0 @@ -// -// BankModelData.m -// -// Created by Yao on 2024/11/9 -// Copyright (c) 2024 zL. All rights reserved. -// - -#import "BankModelData.h" - -NSString *const kBankModelDataBankCode = @"bankCode"; -NSString *const kBankModelDataId = @"id"; -NSString *const kBankModelDataBankName = @"bankName"; -NSString *const kBankModelDataCountry = @"country"; - -@interface BankModelData () - -- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict; - -@end - -@implementation BankModelData - -@synthesize bankCode = _bankCode; -@synthesize identifier = _identifier; -@synthesize bankName = _bankName; -@synthesize country = _country; - -+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict { - return [[self alloc] initWithDictionary:dict]; -} - -- (instancetype)initWithDictionary:(NSDictionary *)dict { - self = [super init]; - // This check serves to make sure that a non-NSDictionary object - // passed into the model class doesn't break the parsing. - if (self && [dict isKindOfClass:[NSDictionary class]]) { - self.bankCode = [self objectOrNilForKey:kBankModelDataBankCode fromDictionary:dict]; - self.identifier = [[self objectOrNilForKey:kBankModelDataId fromDictionary:dict] intValue]; - self.bankName = [self objectOrNilForKey:kBankModelDataBankName fromDictionary:dict]; - self.country = [self objectOrNilForKey:kBankModelDataCountry fromDictionary:dict]; - - } - return self; -} - -- (NSDictionary *)dictionaryRepresentation { - NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary]; - [mutableDict setValue:self.bankCode forKey:kBankModelDataBankCode]; - [mutableDict setValue:[NSNumber numberWithInteger:self.identifier] forKey:kBankModelDataId]; - [mutableDict setValue:self.bankName forKey:kBankModelDataBankName]; - [mutableDict setValue:self.country forKey:kBankModelDataCountry]; - return [NSDictionary dictionaryWithDictionary:mutableDict]; -} - -- (NSString *)description { - return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]]; -} - -#pragma mark - Helper Method -- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict { - id object = [dict objectForKey:aKey]; - return [object isEqual:[NSNull null]] ? nil : object; -} - -#pragma mark - NSCoding Methods - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super init]; - self.bankCode = [aDecoder decodeObjectForKey:kBankModelDataBankCode]; - self.identifier = [aDecoder decodeIntegerForKey:kBankModelDataId]; - self.bankName = [aDecoder decodeObjectForKey:kBankModelDataBankName]; - self.country = [aDecoder decodeObjectForKey:kBankModelDataCountry]; - return self; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [aCoder encodeObject:_bankCode forKey:kBankModelDataBankCode]; - [aCoder encodeInteger:_identifier forKey:kBankModelDataId]; - [aCoder encodeObject:_bankName forKey:kBankModelDataBankName]; - [aCoder encodeObject:_country forKey:kBankModelDataCountry]; -} - -- (id)copyWithZone:(NSZone *)zone { - BankModelData *copy = [[BankModelData alloc] init]; - if (copy) { - copy.bankCode = [self.bankCode copyWithZone:zone]; - copy.identifier = self.identifier; - copy.bankName = [self.bankName copyWithZone:zone]; - copy.country = [self.country copyWithZone:zone]; - } - return copy; -} - -@end diff --git a/ShenQi/Model/BankModelDataModel.h b/ShenQi/Model/BankModelDataModel.h deleted file mode 100644 index 1bcfdf4..0000000 --- a/ShenQi/Model/BankModelDataModel.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// BankModelDataModel.h -// -// Created by Yao on 2024/11/9 -// Copyright (c) 2024 zL. All rights reserved. -// - -#import - -@interface BankModelDataModel : NSObject - -@property (nonatomic, strong) NSArray *data; -@property (nonatomic, assign) NSInteger code; - -+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; -- (instancetype)initWithDictionary:(NSDictionary *)dict; -- (NSDictionary *)dictionaryRepresentation; - -@end diff --git a/ShenQi/Model/BankModelDataModel.m b/ShenQi/Model/BankModelDataModel.m deleted file mode 100644 index a4aa531..0000000 --- a/ShenQi/Model/BankModelDataModel.m +++ /dev/null @@ -1,105 +0,0 @@ -// -// BankModelDataModel.m -// -// Created by Yao on 2024/11/9 -// Copyright (c) 2024 zL. All rights reserved. -// - -#import "BankModelDataModel.h" -#import "BankModelData.h" - -NSString *const kBankModelDataModelData = @"data"; -NSString *const kBankModelDataModelCode = @"code"; - -@interface BankModelDataModel () - -- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict; - -@end - -@implementation BankModelDataModel - -@synthesize data = _data; -@synthesize code = _code; - -+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict { - return [[self alloc] initWithDictionary:dict]; -} - -- (instancetype)initWithDictionary:(NSDictionary *)dict { - self = [super init]; - // This check serves to make sure that a non-NSDictionary object - // passed into the model class doesn't break the parsing. - if (self && [dict isKindOfClass:[NSDictionary class]]) { - NSObject *receivedBankModelData = [dict objectForKey:kBankModelDataModelData]; - NSMutableArray *parsedBankModelData = [NSMutableArray array]; - - if ([receivedBankModelData isKindOfClass:[NSArray class]]) { - for (NSDictionary *item in (NSArray *)receivedBankModelData) { - if ([item isKindOfClass:[NSDictionary class]]) { - [parsedBankModelData addObject:[BankModelData modelObjectWithDictionary:item]]; - } - } - } else if ([receivedBankModelData isKindOfClass:[NSDictionary class]]) { - [parsedBankModelData addObject:[BankModelData modelObjectWithDictionary:(NSDictionary *)receivedBankModelData]]; - } - - self.data = [NSArray arrayWithArray:parsedBankModelData]; - self.code = [[self objectOrNilForKey:kBankModelDataModelCode fromDictionary:dict] intValue]; - - } - return self; -} - -- (NSDictionary *)dictionaryRepresentation { - NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary]; - NSMutableArray *tempArrayForData = [NSMutableArray array]; - - for (NSObject *subArrayObject in self.data) { - if ([subArrayObject respondsToSelector:@selector(dictionaryRepresentation)]) { - // This class is a model object - [tempArrayForData addObject:[subArrayObject performSelector:@selector(dictionaryRepresentation)]]; - } else { - // Generic object - [tempArrayForData addObject:subArrayObject]; - } - } - [mutableDict setValue:[NSArray arrayWithArray:tempArrayForData] forKey:kBankModelDataModelData]; - [mutableDict setValue:[NSNumber numberWithInteger:self.code] forKey:kBankModelDataModelCode]; - return [NSDictionary dictionaryWithDictionary:mutableDict]; -} - -- (NSString *)description { - return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]]; -} - -#pragma mark - Helper Method -- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict { - id object = [dict objectForKey:aKey]; - return [object isEqual:[NSNull null]] ? nil : object; -} - -#pragma mark - NSCoding Methods - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super init]; - self.data = [aDecoder decodeObjectForKey:kBankModelDataModelData]; - self.code = [aDecoder decodeIntegerForKey:kBankModelDataModelCode]; - return self; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [aCoder encodeObject:_data forKey:kBankModelDataModelData]; - [aCoder encodeInteger:_code forKey:kBankModelDataModelCode]; -} - -- (id)copyWithZone:(NSZone *)zone { - BankModelDataModel *copy = [[BankModelDataModel alloc] init]; - if (copy) { - copy.data = [self.data copyWithZone:zone]; - copy.code = self.code; - } - return copy; -} - -@end diff --git a/ShenQi/Model/DataModels.h b/ShenQi/Model/DataModels.h deleted file mode 100644 index 84d3115..0000000 --- a/ShenQi/Model/DataModels.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// DataModels.h -// -// Created by Yao on 2024/11/9 -// Copyright (c) 2024 zL. All rights reserved. -// - -#import "BankModelData.h" -#import "BankModelDataModel.h" - -#import "InviteCodeModelDataModel.h" -#import "InviteCodeModelData.h" - -#import "WithdrawRecordDataModel.h" -#import "WithdrawRecordData.h" -#import "WithdrawRecordList.h" diff --git a/ShenQi/Model/InviteCodeModelData.h b/ShenQi/Model/InviteCodeModelData.h deleted file mode 100644 index d4023b0..0000000 --- a/ShenQi/Model/InviteCodeModelData.h +++ /dev/null @@ -1,29 +0,0 @@ -// -// InviteCodeModelData.h -// -// Created by Yao on 2024/11/9 -// Copyright (c) 2024 zL. All rights reserved. -// - -#import - -@interface InviteCodeModelData : NSObject - -@property (nonatomic, assign) NSInteger identifier; -@property (nonatomic, strong) NSString *name; -@property (nonatomic, strong) NSString *bankName; -@property (nonatomic, strong) NSString *inviteCode; -@property (nonatomic, assign) NSInteger inviteNum; -@property (nonatomic, assign) CGFloat balance; -@property (nonatomic, strong) NSString *bankNo; -@property (nonatomic, assign) NSInteger userId; -@property (nonatomic, assign) CGFloat income; -@property (nonatomic, assign) NSInteger bankId; -@property (nonatomic, assign) NSInteger status; -@property (nonatomic, strong) NSString *deviceCode; - -+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; -- (instancetype)initWithDictionary:(NSDictionary *)dict; -- (NSDictionary *)dictionaryRepresentation; - -@end diff --git a/ShenQi/Model/InviteCodeModelData.m b/ShenQi/Model/InviteCodeModelData.m deleted file mode 100644 index 69cdb6d..0000000 --- a/ShenQi/Model/InviteCodeModelData.m +++ /dev/null @@ -1,150 +0,0 @@ -// -// InviteCodeModelData.m -// -// Created by Yao on 2024/11/9 -// Copyright (c) 2024 zL. All rights reserved. -// - -#import "InviteCodeModelData.h" - -NSString *const kInviteCodeModelDataId = @"id"; -NSString *const kInviteCodeModelDataName = @"name"; -NSString *const kInviteCodeModelDataBankName = @"bankName"; -NSString *const kInviteCodeModelDataInviteCode = @"inviteCode"; -NSString *const kInviteCodeModelDataInviteNum = @"inviteNum"; -NSString *const kInviteCodeModelDataBalance = @"balance"; -NSString *const kInviteCodeModelDataBankNo = @"bankNo"; -NSString *const kInviteCodeModelDataUserId = @"userId"; -NSString *const kInviteCodeModelDataIncome = @"income"; -NSString *const kInviteCodeModelDataBankId = @"bankId"; -NSString *const kInviteCodeModelDataStatus = @"status"; -NSString *const kInviteCodeModelDataDeviceCode = @"deviceCode"; - -@interface InviteCodeModelData () - -- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict; - -@end - -@implementation InviteCodeModelData - -@synthesize identifier = _identifier; -@synthesize name = _name; -@synthesize bankName = _bankName; -@synthesize inviteCode = _inviteCode; -@synthesize inviteNum = _inviteNum; -@synthesize balance = _balance; -@synthesize bankNo = _bankNo; -@synthesize userId = _userId; -@synthesize income = _income; -@synthesize bankId = _bankId; -@synthesize status = _status; -@synthesize deviceCode = _deviceCode; - -+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict { - return [[self alloc] initWithDictionary:dict]; -} - -- (instancetype)initWithDictionary:(NSDictionary *)dict { - self = [super init]; - // This check serves to make sure that a non-NSDictionary object - // passed into the model class doesn't break the parsing. - if (self && [dict isKindOfClass:[NSDictionary class]]) { - self.identifier = [[self objectOrNilForKey:kInviteCodeModelDataId fromDictionary:dict] intValue]; - self.name = [self objectOrNilForKey:kInviteCodeModelDataName fromDictionary:dict]; - self.bankName = [self objectOrNilForKey:kInviteCodeModelDataBankName fromDictionary:dict]; - self.inviteCode = [self objectOrNilForKey:kInviteCodeModelDataInviteCode fromDictionary:dict]; - self.inviteNum = [[self objectOrNilForKey:kInviteCodeModelDataInviteNum fromDictionary:dict] intValue]; - self.balance = [[self objectOrNilForKey:kInviteCodeModelDataBalance fromDictionary:dict] doubleValue]; - self.bankNo = [self objectOrNilForKey:kInviteCodeModelDataBankNo fromDictionary:dict]; - self.userId = [[self objectOrNilForKey:kInviteCodeModelDataUserId fromDictionary:dict] intValue]; - self.income = [[self objectOrNilForKey:kInviteCodeModelDataIncome fromDictionary:dict] doubleValue]; - self.bankId = [[self objectOrNilForKey:kInviteCodeModelDataBankId fromDictionary:dict] intValue]; - self.status = [[self objectOrNilForKey:kInviteCodeModelDataStatus fromDictionary:dict] intValue]; - self.deviceCode = [self objectOrNilForKey:kInviteCodeModelDataDeviceCode fromDictionary:dict]; - - } - return self; -} - -- (NSDictionary *)dictionaryRepresentation { - NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary]; - [mutableDict setValue:[NSNumber numberWithInteger:self.identifier] forKey:kInviteCodeModelDataId]; - [mutableDict setValue:self.name forKey:kInviteCodeModelDataName]; - [mutableDict setValue:self.bankName forKey:kInviteCodeModelDataBankName]; - [mutableDict setValue:self.inviteCode forKey:kInviteCodeModelDataInviteCode]; - [mutableDict setValue:[NSNumber numberWithInteger:self.inviteNum] forKey:kInviteCodeModelDataInviteNum]; - [mutableDict setValue:[NSNumber numberWithDouble:self.balance] forKey:kInviteCodeModelDataBalance]; - [mutableDict setValue:self.bankNo forKey:kInviteCodeModelDataBankNo]; - [mutableDict setValue:[NSNumber numberWithInteger:self.userId] forKey:kInviteCodeModelDataUserId]; - [mutableDict setValue:[NSNumber numberWithDouble:self.income] forKey:kInviteCodeModelDataIncome]; - [mutableDict setValue:[NSNumber numberWithInteger:self.bankId] forKey:kInviteCodeModelDataBankId]; - [mutableDict setValue:[NSNumber numberWithInteger:self.status] forKey:kInviteCodeModelDataStatus]; - [mutableDict setValue:self.deviceCode forKey:kInviteCodeModelDataDeviceCode]; - return [NSDictionary dictionaryWithDictionary:mutableDict]; -} - -- (NSString *)description { - return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]]; -} - -#pragma mark - Helper Method -- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict { - id object = [dict objectForKey:aKey]; - return [object isEqual:[NSNull null]] ? nil : object; -} - -#pragma mark - NSCoding Methods - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super init]; - self.identifier = [aDecoder decodeIntegerForKey:kInviteCodeModelDataId]; - self.name = [aDecoder decodeObjectForKey:kInviteCodeModelDataName]; - self.bankName = [aDecoder decodeObjectForKey:kInviteCodeModelDataBankName]; - self.inviteCode = [aDecoder decodeObjectForKey:kInviteCodeModelDataInviteCode]; - self.inviteNum = [aDecoder decodeIntegerForKey:kInviteCodeModelDataInviteNum]; - self.balance = [aDecoder decodeDoubleForKey:kInviteCodeModelDataBalance]; - self.bankNo = [aDecoder decodeObjectForKey:kInviteCodeModelDataBankNo]; - self.userId = [aDecoder decodeIntegerForKey:kInviteCodeModelDataUserId]; - self.income = [aDecoder decodeDoubleForKey:kInviteCodeModelDataIncome]; - self.bankId = [aDecoder decodeIntegerForKey:kInviteCodeModelDataBankId]; - self.status = [aDecoder decodeIntegerForKey:kInviteCodeModelDataStatus]; - self.deviceCode = [aDecoder decodeObjectForKey:kInviteCodeModelDataDeviceCode]; - return self; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [aCoder encodeInteger:_identifier forKey:kInviteCodeModelDataId]; - [aCoder encodeObject:_name forKey:kInviteCodeModelDataName]; - [aCoder encodeObject:_bankName forKey:kInviteCodeModelDataBankName]; - [aCoder encodeObject:_inviteCode forKey:kInviteCodeModelDataInviteCode]; - [aCoder encodeInteger:_inviteNum forKey:kInviteCodeModelDataInviteNum]; - [aCoder encodeDouble:_balance forKey:kInviteCodeModelDataBalance]; - [aCoder encodeObject:_bankNo forKey:kInviteCodeModelDataBankNo]; - [aCoder encodeInteger:_userId forKey:kInviteCodeModelDataUserId]; - [aCoder encodeDouble:_income forKey:kInviteCodeModelDataIncome]; - [aCoder encodeInteger:_bankId forKey:kInviteCodeModelDataBankId]; - [aCoder encodeInteger:_status forKey:kInviteCodeModelDataStatus]; - [aCoder encodeObject:_deviceCode forKey:kInviteCodeModelDataDeviceCode]; -} - -- (id)copyWithZone:(NSZone *)zone { - InviteCodeModelData *copy = [[InviteCodeModelData alloc] init]; - if (copy) { - copy.identifier = self.identifier; - copy.name = [self.name copyWithZone:zone]; - copy.bankName = [self.bankName copyWithZone:zone]; - copy.inviteCode = [self.inviteCode copyWithZone:zone]; - copy.inviteNum = self.inviteNum; - copy.balance = self.balance; - copy.bankNo = [self.bankNo copyWithZone:zone]; - copy.userId = self.userId; - copy.income = self.income; - copy.bankId = self.bankId; - copy.status = self.status; - copy.deviceCode = [self.deviceCode copyWithZone:zone]; - } - return copy; -} - -@end diff --git a/ShenQi/Model/InviteCodeModelDataModel.h b/ShenQi/Model/InviteCodeModelDataModel.h deleted file mode 100644 index 62f7d77..0000000 --- a/ShenQi/Model/InviteCodeModelDataModel.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// InviteCodeModelDataModel.h -// -// Created by Yao on 2024/11/9 -// Copyright (c) 2024 zL. All rights reserved. -// - -#import -@class InviteCodeModelData; -@interface InviteCodeModelDataModel : NSObject - -@property (nonatomic, strong) InviteCodeModelData *data; -@property (nonatomic, assign) NSInteger code; - -+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; -- (instancetype)initWithDictionary:(NSDictionary *)dict; -- (NSDictionary *)dictionaryRepresentation; - -@end diff --git a/ShenQi/Model/InviteCodeModelDataModel.m b/ShenQi/Model/InviteCodeModelDataModel.m deleted file mode 100644 index 8eff0b1..0000000 --- a/ShenQi/Model/InviteCodeModelDataModel.m +++ /dev/null @@ -1,81 +0,0 @@ -// -// InviteCodeModelDataModel.m -// -// Created by Yao on 2024/11/9 -// Copyright (c) 2024 zL. All rights reserved. -// - -#import "InviteCodeModelDataModel.h" -#import "InviteCodeModelData.h" - -NSString *const kInviteCodeModelDataModelData = @"data"; -NSString *const kInviteCodeModelDataModelCode = @"code"; - -@interface InviteCodeModelDataModel () - -- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict; - -@end - -@implementation InviteCodeModelDataModel - -@synthesize data = _data; -@synthesize code = _code; - -+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict { - return [[self alloc] initWithDictionary:dict]; -} - -- (instancetype)initWithDictionary:(NSDictionary *)dict { - self = [super init]; - // This check serves to make sure that a non-NSDictionary object - // passed into the model class doesn't break the parsing. - if (self && [dict isKindOfClass:[NSDictionary class]]) { - self.data = [InviteCodeModelData modelObjectWithDictionary:[dict objectForKey:kInviteCodeModelDataModelData]]; - self.code = [[self objectOrNilForKey:kInviteCodeModelDataModelCode fromDictionary:dict] intValue]; - - } - return self; -} - -- (NSDictionary *)dictionaryRepresentation { - NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary]; - [mutableDict setValue:[self.data dictionaryRepresentation] forKey:kInviteCodeModelDataModelData]; - [mutableDict setValue:[NSNumber numberWithInteger:self.code] forKey:kInviteCodeModelDataModelCode]; - return [NSDictionary dictionaryWithDictionary:mutableDict]; -} - -- (NSString *)description { - return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]]; -} - -#pragma mark - Helper Method -- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict { - id object = [dict objectForKey:aKey]; - return [object isEqual:[NSNull null]] ? nil : object; -} - -#pragma mark - NSCoding Methods - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super init]; - self.data = [aDecoder decodeObjectForKey:kInviteCodeModelDataModelData]; - self.code = [aDecoder decodeIntegerForKey:kInviteCodeModelDataModelCode]; - return self; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [aCoder encodeObject:_data forKey:kInviteCodeModelDataModelData]; - [aCoder encodeInteger:_code forKey:kInviteCodeModelDataModelCode]; -} - -- (id)copyWithZone:(NSZone *)zone { - InviteCodeModelDataModel *copy = [[InviteCodeModelDataModel alloc] init]; - if (copy) { - copy.data = [self.data copyWithZone:zone]; - copy.code = self.code; - } - return copy; -} - -@end diff --git a/ShenQi/Model/WithdrawRecordData.h b/ShenQi/Model/WithdrawRecordData.h deleted file mode 100644 index 4b28af0..0000000 --- a/ShenQi/Model/WithdrawRecordData.h +++ /dev/null @@ -1,24 +0,0 @@ -// -// WithdrawRecordData.h -// -// Created by Yao on 2024/11/9 -// Copyright (c) 2024 zL. All rights reserved. -// - -#import - -@interface WithdrawRecordData : NSObject - -@property (nonatomic, assign) NSInteger pages; -@property (nonatomic, assign) BOOL hasNextPage; -@property (nonatomic, assign) NSInteger nextPage; -@property (nonatomic, assign) NSInteger total; -@property (nonatomic, strong) NSArray *list; -@property (nonatomic, assign) BOOL hasPreviousPage; -@property (nonatomic, assign) NSInteger prePage; - -+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; -- (instancetype)initWithDictionary:(NSDictionary *)dict; -- (NSDictionary *)dictionaryRepresentation; - -@end diff --git a/ShenQi/Model/WithdrawRecordData.m b/ShenQi/Model/WithdrawRecordData.m deleted file mode 100644 index 53b572b..0000000 --- a/ShenQi/Model/WithdrawRecordData.m +++ /dev/null @@ -1,140 +0,0 @@ -// -// WithdrawRecordData.m -// -// Created by Yao on 2024/11/9 -// Copyright (c) 2024 zL. All rights reserved. -// - -#import "WithdrawRecordData.h" -#import "WithdrawRecordList.h" - -NSString *const kWithdrawRecordDataPages = @"pages"; -NSString *const kWithdrawRecordDataHasNextPage = @"hasNextPage"; -NSString *const kWithdrawRecordDataNextPage = @"nextPage"; -NSString *const kWithdrawRecordDataTotal = @"total"; -NSString *const kWithdrawRecordDataList = @"list"; -NSString *const kWithdrawRecordDataHasPreviousPage = @"hasPreviousPage"; -NSString *const kWithdrawRecordDataPrePage = @"prePage"; - -@interface WithdrawRecordData () - -- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict; - -@end - -@implementation WithdrawRecordData - -@synthesize pages = _pages; -@synthesize hasNextPage = _hasNextPage; -@synthesize nextPage = _nextPage; -@synthesize total = _total; -@synthesize list = _list; -@synthesize hasPreviousPage = _hasPreviousPage; -@synthesize prePage = _prePage; - -+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict { - return [[self alloc] initWithDictionary:dict]; -} - -- (instancetype)initWithDictionary:(NSDictionary *)dict { - self = [super init]; - // This check serves to make sure that a non-NSDictionary object - // passed into the model class doesn't break the parsing. - if (self && [dict isKindOfClass:[NSDictionary class]]) { - self.pages = [[self objectOrNilForKey:kWithdrawRecordDataPages fromDictionary:dict] intValue]; - self.hasNextPage = [[self objectOrNilForKey:kWithdrawRecordDataHasNextPage fromDictionary:dict] boolValue]; - self.nextPage = [[self objectOrNilForKey:kWithdrawRecordDataNextPage fromDictionary:dict] intValue]; - self.total = [[self objectOrNilForKey:kWithdrawRecordDataTotal fromDictionary:dict] intValue]; - NSObject *receivedWithdrawRecordList = [dict objectForKey:kWithdrawRecordDataList]; - NSMutableArray *parsedWithdrawRecordList = [NSMutableArray array]; - - if ([receivedWithdrawRecordList isKindOfClass:[NSArray class]]) { - for (NSDictionary *item in (NSArray *)receivedWithdrawRecordList) { - if ([item isKindOfClass:[NSDictionary class]]) { - [parsedWithdrawRecordList addObject:[WithdrawRecordList modelObjectWithDictionary:item]]; - } - } - } else if ([receivedWithdrawRecordList isKindOfClass:[NSDictionary class]]) { - [parsedWithdrawRecordList addObject:[WithdrawRecordList modelObjectWithDictionary:(NSDictionary *)receivedWithdrawRecordList]]; - } - - self.list = [NSArray arrayWithArray:parsedWithdrawRecordList]; - self.hasPreviousPage = [[self objectOrNilForKey:kWithdrawRecordDataHasPreviousPage fromDictionary:dict] boolValue]; - self.prePage = [[self objectOrNilForKey:kWithdrawRecordDataPrePage fromDictionary:dict] intValue]; - - } - return self; -} - -- (NSDictionary *)dictionaryRepresentation { - NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary]; - [mutableDict setValue:[NSNumber numberWithInteger:self.pages] forKey:kWithdrawRecordDataPages]; - [mutableDict setValue:[NSNumber numberWithBool:self.hasNextPage] forKey:kWithdrawRecordDataHasNextPage]; - [mutableDict setValue:[NSNumber numberWithInteger:self.nextPage] forKey:kWithdrawRecordDataNextPage]; - [mutableDict setValue:[NSNumber numberWithInteger:self.total] forKey:kWithdrawRecordDataTotal]; - NSMutableArray *tempArrayForList = [NSMutableArray array]; - - for (NSObject *subArrayObject in self.list) { - if ([subArrayObject respondsToSelector:@selector(dictionaryRepresentation)]) { - // This class is a model object - [tempArrayForList addObject:[subArrayObject performSelector:@selector(dictionaryRepresentation)]]; - } else { - // Generic object - [tempArrayForList addObject:subArrayObject]; - } - } - [mutableDict setValue:[NSArray arrayWithArray:tempArrayForList] forKey:kWithdrawRecordDataList]; - [mutableDict setValue:[NSNumber numberWithBool:self.hasPreviousPage] forKey:kWithdrawRecordDataHasPreviousPage]; - [mutableDict setValue:[NSNumber numberWithInteger:self.prePage] forKey:kWithdrawRecordDataPrePage]; - return [NSDictionary dictionaryWithDictionary:mutableDict]; -} - -- (NSString *)description { - return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]]; -} - -#pragma mark - Helper Method -- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict { - id object = [dict objectForKey:aKey]; - return [object isEqual:[NSNull null]] ? nil : object; -} - -#pragma mark - NSCoding Methods - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super init]; - self.pages = [aDecoder decodeIntegerForKey:kWithdrawRecordDataPages]; - self.hasNextPage = [aDecoder decodeBoolForKey:kWithdrawRecordDataHasNextPage]; - self.nextPage = [aDecoder decodeIntegerForKey:kWithdrawRecordDataNextPage]; - self.total = [aDecoder decodeIntegerForKey:kWithdrawRecordDataTotal]; - self.list = [aDecoder decodeObjectForKey:kWithdrawRecordDataList]; - self.hasPreviousPage = [aDecoder decodeBoolForKey:kWithdrawRecordDataHasPreviousPage]; - self.prePage = [aDecoder decodeIntegerForKey:kWithdrawRecordDataPrePage]; - return self; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [aCoder encodeInteger:_pages forKey:kWithdrawRecordDataPages]; - [aCoder encodeBool:_hasNextPage forKey:kWithdrawRecordDataHasNextPage]; - [aCoder encodeInteger:_nextPage forKey:kWithdrawRecordDataNextPage]; - [aCoder encodeInteger:_total forKey:kWithdrawRecordDataTotal]; - [aCoder encodeObject:_list forKey:kWithdrawRecordDataList]; - [aCoder encodeBool:_hasPreviousPage forKey:kWithdrawRecordDataHasPreviousPage]; - [aCoder encodeInteger:_prePage forKey:kWithdrawRecordDataPrePage]; -} - -- (id)copyWithZone:(NSZone *)zone { - WithdrawRecordData *copy = [[WithdrawRecordData alloc] init]; - if (copy) { - copy.pages = self.pages; - copy.hasNextPage = self.hasNextPage; - copy.nextPage = self.nextPage; - copy.total = self.total; - copy.list = [self.list copyWithZone:zone]; - copy.hasPreviousPage = self.hasPreviousPage; - copy.prePage = self.prePage; - } - return copy; -} - -@end diff --git a/ShenQi/Model/WithdrawRecordDataModel.h b/ShenQi/Model/WithdrawRecordDataModel.h deleted file mode 100644 index 9d6d315..0000000 --- a/ShenQi/Model/WithdrawRecordDataModel.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// WithdrawRecordDataModel.h -// -// Created by Yao on 2024/11/9 -// Copyright (c) 2024 zL. All rights reserved. -// - -#import -@class WithdrawRecordData; -@interface WithdrawRecordDataModel : NSObject - -@property (nonatomic, strong) WithdrawRecordData *data; -@property (nonatomic, assign) NSInteger code; - -+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; -- (instancetype)initWithDictionary:(NSDictionary *)dict; -- (NSDictionary *)dictionaryRepresentation; - -@end diff --git a/ShenQi/Model/WithdrawRecordDataModel.m b/ShenQi/Model/WithdrawRecordDataModel.m deleted file mode 100644 index 14f211b..0000000 --- a/ShenQi/Model/WithdrawRecordDataModel.m +++ /dev/null @@ -1,81 +0,0 @@ -// -// WithdrawRecordDataModel.m -// -// Created by Yao on 2024/11/9 -// Copyright (c) 2024 zL. All rights reserved. -// - -#import "WithdrawRecordDataModel.h" -#import "WithdrawRecordData.h" - -NSString *const kWithdrawRecordDataModelData = @"data"; -NSString *const kWithdrawRecordDataModelCode = @"code"; - -@interface WithdrawRecordDataModel () - -- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict; - -@end - -@implementation WithdrawRecordDataModel - -@synthesize data = _data; -@synthesize code = _code; - -+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict { - return [[self alloc] initWithDictionary:dict]; -} - -- (instancetype)initWithDictionary:(NSDictionary *)dict { - self = [super init]; - // This check serves to make sure that a non-NSDictionary object - // passed into the model class doesn't break the parsing. - if (self && [dict isKindOfClass:[NSDictionary class]]) { - self.data = [WithdrawRecordData modelObjectWithDictionary:[dict objectForKey:kWithdrawRecordDataModelData]]; - self.code = [[self objectOrNilForKey:kWithdrawRecordDataModelCode fromDictionary:dict] intValue]; - - } - return self; -} - -- (NSDictionary *)dictionaryRepresentation { - NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary]; - [mutableDict setValue:[self.data dictionaryRepresentation] forKey:kWithdrawRecordDataModelData]; - [mutableDict setValue:[NSNumber numberWithInteger:self.code] forKey:kWithdrawRecordDataModelCode]; - return [NSDictionary dictionaryWithDictionary:mutableDict]; -} - -- (NSString *)description { - return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]]; -} - -#pragma mark - Helper Method -- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict { - id object = [dict objectForKey:aKey]; - return [object isEqual:[NSNull null]] ? nil : object; -} - -#pragma mark - NSCoding Methods - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super init]; - self.data = [aDecoder decodeObjectForKey:kWithdrawRecordDataModelData]; - self.code = [aDecoder decodeIntegerForKey:kWithdrawRecordDataModelCode]; - return self; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [aCoder encodeObject:_data forKey:kWithdrawRecordDataModelData]; - [aCoder encodeInteger:_code forKey:kWithdrawRecordDataModelCode]; -} - -- (id)copyWithZone:(NSZone *)zone { - WithdrawRecordDataModel *copy = [[WithdrawRecordDataModel alloc] init]; - if (copy) { - copy.data = [self.data copyWithZone:zone]; - copy.code = self.code; - } - return copy; -} - -@end diff --git a/ShenQi/Model/WithdrawRecordList.h b/ShenQi/Model/WithdrawRecordList.h deleted file mode 100644 index a5def16..0000000 --- a/ShenQi/Model/WithdrawRecordList.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// WithdrawRecordList.h -// -// Created by Yao on 2024/11/9 -// Copyright (c) 2024 zL. All rights reserved. -// - -#import - -@interface WithdrawRecordList : NSObject - -@property (nonatomic, assign) CGFloat amount; -@property (nonatomic, strong) NSString *bankName; -@property (nonatomic, assign) NSInteger bankId; -@property (nonatomic, assign) NSInteger identifier; -@property (nonatomic, assign) NSInteger status; -@property (nonatomic, assign) NSInteger inviteId; -@property (nonatomic, strong) NSString *inviteCode; -@property (nonatomic, strong) NSString *name; -@property (nonatomic, assign) CGFloat balance; -@property (nonatomic, strong) NSString *createTime; - -+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; -- (instancetype)initWithDictionary:(NSDictionary *)dict; -- (NSDictionary *)dictionaryRepresentation; - -@end diff --git a/ShenQi/Model/WithdrawRecordList.m b/ShenQi/Model/WithdrawRecordList.m deleted file mode 100644 index 76d7f76..0000000 --- a/ShenQi/Model/WithdrawRecordList.m +++ /dev/null @@ -1,136 +0,0 @@ -// -// WithdrawRecordList.m -// -// Created by Yao on 2024/11/9 -// Copyright (c) 2024 zL. All rights reserved. -// - -#import "WithdrawRecordList.h" - -NSString *const kWithdrawRecordListAmount = @"amount"; -NSString *const kWithdrawRecordListBankName = @"bankName"; -NSString *const kWithdrawRecordListBankId = @"bankId"; -NSString *const kWithdrawRecordListId = @"id"; -NSString *const kWithdrawRecordListStatus = @"status"; -NSString *const kWithdrawRecordListInviteId = @"inviteId"; -NSString *const kWithdrawRecordListInviteCode = @"inviteCode"; -NSString *const kWithdrawRecordListName = @"name"; -NSString *const kWithdrawRecordListBalance = @"balance"; -NSString *const kWithdrawRecordListCreateTime = @"createTime"; - -@interface WithdrawRecordList () - -- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict; - -@end - -@implementation WithdrawRecordList - -@synthesize amount = _amount; -@synthesize bankName = _bankName; -@synthesize bankId = _bankId; -@synthesize identifier = _identifier; -@synthesize status = _status; -@synthesize inviteId = _inviteId; -@synthesize inviteCode = _inviteCode; -@synthesize name = _name; -@synthesize balance = _balance; -@synthesize createTime = _createTime; - -+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict { - return [[self alloc] initWithDictionary:dict]; -} - -- (instancetype)initWithDictionary:(NSDictionary *)dict { - self = [super init]; - // This check serves to make sure that a non-NSDictionary object - // passed into the model class doesn't break the parsing. - if (self && [dict isKindOfClass:[NSDictionary class]]) { - self.amount = [[self objectOrNilForKey:kWithdrawRecordListAmount fromDictionary:dict] doubleValue]; - self.bankName = [self objectOrNilForKey:kWithdrawRecordListBankName fromDictionary:dict]; - self.bankId = [[self objectOrNilForKey:kWithdrawRecordListBankId fromDictionary:dict] intValue]; - self.identifier = [[self objectOrNilForKey:kWithdrawRecordListId fromDictionary:dict] intValue]; - self.status = [[self objectOrNilForKey:kWithdrawRecordListStatus fromDictionary:dict] intValue]; - self.inviteId = [[self objectOrNilForKey:kWithdrawRecordListInviteId fromDictionary:dict] intValue]; - self.inviteCode = [self objectOrNilForKey:kWithdrawRecordListInviteCode fromDictionary:dict]; - self.name = [self objectOrNilForKey:kWithdrawRecordListName fromDictionary:dict]; - self.balance = [[self objectOrNilForKey:kWithdrawRecordListBalance fromDictionary:dict] doubleValue]; - self.createTime = [self objectOrNilForKey:kWithdrawRecordListCreateTime fromDictionary:dict]; - - } - return self; -} - -- (NSDictionary *)dictionaryRepresentation { - NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary]; - [mutableDict setValue:[NSNumber numberWithDouble:self.amount] forKey:kWithdrawRecordListAmount]; - [mutableDict setValue:self.bankName forKey:kWithdrawRecordListBankName]; - [mutableDict setValue:[NSNumber numberWithInteger:self.bankId] forKey:kWithdrawRecordListBankId]; - [mutableDict setValue:[NSNumber numberWithInteger:self.identifier] forKey:kWithdrawRecordListId]; - [mutableDict setValue:[NSNumber numberWithInteger:self.status] forKey:kWithdrawRecordListStatus]; - [mutableDict setValue:[NSNumber numberWithInteger:self.inviteId] forKey:kWithdrawRecordListInviteId]; - [mutableDict setValue:self.inviteCode forKey:kWithdrawRecordListInviteCode]; - [mutableDict setValue:self.name forKey:kWithdrawRecordListName]; - [mutableDict setValue:[NSNumber numberWithDouble:self.balance] forKey:kWithdrawRecordListBalance]; - [mutableDict setValue:self.createTime forKey:kWithdrawRecordListCreateTime]; - return [NSDictionary dictionaryWithDictionary:mutableDict]; -} - -- (NSString *)description { - return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]]; -} - -#pragma mark - Helper Method -- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict { - id object = [dict objectForKey:aKey]; - return [object isEqual:[NSNull null]] ? nil : object; -} - -#pragma mark - NSCoding Methods - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super init]; - self.amount = [aDecoder decodeDoubleForKey:kWithdrawRecordListAmount]; - self.bankName = [aDecoder decodeObjectForKey:kWithdrawRecordListBankName]; - self.bankId = [aDecoder decodeIntegerForKey:kWithdrawRecordListBankId]; - self.identifier = [aDecoder decodeIntegerForKey:kWithdrawRecordListId]; - self.status = [aDecoder decodeIntegerForKey:kWithdrawRecordListStatus]; - self.inviteId = [aDecoder decodeIntegerForKey:kWithdrawRecordListInviteId]; - self.inviteCode = [aDecoder decodeObjectForKey:kWithdrawRecordListInviteCode]; - self.name = [aDecoder decodeObjectForKey:kWithdrawRecordListName]; - self.balance = [aDecoder decodeDoubleForKey:kWithdrawRecordListBalance]; - self.createTime = [aDecoder decodeObjectForKey:kWithdrawRecordListCreateTime]; - return self; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [aCoder encodeDouble:_amount forKey:kWithdrawRecordListAmount]; - [aCoder encodeObject:_bankName forKey:kWithdrawRecordListBankName]; - [aCoder encodeInteger:_bankId forKey:kWithdrawRecordListBankId]; - [aCoder encodeInteger:_identifier forKey:kWithdrawRecordListId]; - [aCoder encodeInteger:_status forKey:kWithdrawRecordListStatus]; - [aCoder encodeInteger:_inviteId forKey:kWithdrawRecordListInviteId]; - [aCoder encodeObject:_inviteCode forKey:kWithdrawRecordListInviteCode]; - [aCoder encodeObject:_name forKey:kWithdrawRecordListName]; - [aCoder encodeDouble:_balance forKey:kWithdrawRecordListBalance]; - [aCoder encodeObject:_createTime forKey:kWithdrawRecordListCreateTime]; -} - -- (id)copyWithZone:(NSZone *)zone { - WithdrawRecordList *copy = [[WithdrawRecordList alloc] init]; - if (copy) { - copy.amount = self.amount; - copy.bankName = [self.bankName copyWithZone:zone]; - copy.bankId = self.bankId; - copy.identifier = self.identifier; - copy.status = self.status; - copy.inviteId = self.inviteId; - copy.inviteCode = [self.inviteCode copyWithZone:zone]; - copy.name = [self.name copyWithZone:zone]; - copy.balance = self.balance; - copy.createTime = [self.createTime copyWithZone:zone]; - } - return copy; -} - -@end diff --git a/ShenQi/ViewController.h b/ShenQi/ViewController.h deleted file mode 100644 index a51d14d..0000000 --- a/ShenQi/ViewController.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// ViewController.h -// ShenQi -// -// Created by Yao on 2023/4/4. -// - -#import - -@interface ViewController : UIViewController - -@property (nonatomic, strong) NSString *gameURLString; -@property (nonatomic, assign) BOOL isPresent; - -@end - diff --git a/ShenQi/ViewController.m b/ShenQi/ViewController.m deleted file mode 100644 index 087c021..0000000 --- a/ShenQi/ViewController.m +++ /dev/null @@ -1,465 +0,0 @@ -// -// ViewController.m -// ShenQi -// -// Created by Yao on 2023/4/4. -// - -#import "ViewController.h" - -//#import -#import -#import -#import -#import -#import -#import - -#import "MacroDefine.h" -#import "DSWebDragView.h" -#import "NSObject+YYModel.h" -#import "AppDelegate.h" -#import "EditBankViewController.h" -#import "WithdrawViewController.h" -#import "InviteRecordsViewController.h" - -@interface ViewController () - -@property (strong, nonatomic) WKWebView *webView; -@property (nonatomic,strong) WKUserContentController *wkUController; -@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicatorView; -@property (weak, nonatomic) IBOutlet UIButton *goIntoBtn; -@property (nonatomic, strong) DSWebDragView *webDragView; -@property (nonatomic, strong) NSString *mainUserId; -@property (nonatomic, strong) NSString *inviteCode; -@property (nonatomic, strong) NSString *mainURLString; - -@end - -@implementation ViewController - --(void)viewDidLayoutSubviews -{ - [super viewDidLayoutSubviews]; - - UIStatusBarManager *statusBarManager = [UIApplication sharedApplication].windows.lastObject.windowScene.statusBarManager; - _webView.frame = CGRectMake(0, statusBarManager.statusBarFrame.size.height, self.view.bounds.size.width, self.view.bounds.size.height-self.view.safeAreaInsets.bottom); -} - -- (void)viewDidLoad { - [super viewDidLoad]; - - self.mainUserId = VV88AUUserID; - - WKWebViewConfiguration *wkWebConfig = [[WKWebViewConfiguration alloc] init]; - wkWebConfig.preferences.javaScriptCanOpenWindowsAutomatically = YES; - - _wkUController = [[WKUserContentController alloc] init]; - - wkWebConfig.userContentController = _wkUController; - - UIStatusBarManager *statusBarManager = [UIApplication sharedApplication].windows.lastObject.windowScene.statusBarManager; - _webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, statusBarManager.statusBarFrame.size.height, self.view.bounds.size.width, self.view.bounds.size.height-self.view.safeAreaInsets.bottom) configuration:wkWebConfig]; - _webView.UIDelegate = self; - _webView.navigationDelegate = self; - [self.view addSubview:_webView]; - - __weak typeof(self) weakSelf = self; - self.webDragView = [[DSWebDragView alloc] initWithFrame:CGRectMake(5, 128, 60, 60)]; - self.webDragView.freeRect = CGRectMake(0, 128, self.view.frame.size.width, self.view.frame.size.height-128); - self.webDragView.isKeepBounds = YES; - self.webDragView.clickDragViewBlock = ^(WMDragView *dragView) { - UIAlertController *alertview = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:(UIAlertControllerStyleActionSheet)]; - UIAlertAction *homepageAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"HOMEPAGE", nil) style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) { - if (weakSelf.isPresent == YES) { - [weakSelf dismissViewControllerAnimated:YES completion:^{}]; - }else{ - weakSelf.isPresent = NO; - [weakSelf setupGameURLData]; - } - }]; - UIAlertAction *inviteCodeAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"MY INVITE CODE", nil) style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) { - // 我的邀请码 - __block NSString *advertisingId = nil; - if (@available(iOS 14, *)) { - [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) { - advertisingId = [[ASIdentifierManager sharedManager] advertisingIdentifier].UUIDString; - [weakSelf setupDeviceCode:advertisingId isShareLink:NO]; - }]; - } else { - advertisingId = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; - [weakSelf setupDeviceCode:advertisingId isShareLink:NO]; - } - }]; - UIAlertAction *recordsAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"RECORDS", nil) style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) { - // 邀请人列表 - [weakSelf setupInviteRecords]; - }]; - UIAlertAction *editBankAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"EditBank", nil) style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) { - // 编辑银行卡信息 - [weakSelf setupEditBank]; - }]; - UIAlertAction *withdrawAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Withdraw", nil) style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) { - // 提现 - [weakSelf setupWithdraw]; - }]; - UIAlertAction *shareAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"SHARE", nil) style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) { - // 分享 - [weakSelf setupShareLink]; - }]; - UIAlertAction *cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"CANCEL", nil) style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) {}]; - [alertview addAction:homepageAction]; - [alertview addAction:inviteCodeAction]; - [alertview addAction:recordsAction]; - [alertview addAction:editBankAction]; - [alertview addAction:withdrawAction]; - [alertview addAction:shareAction]; - [alertview addAction:cancel]; - [weakSelf presentViewController:alertview animated:YES completion:^{}]; - }; - [self.view addSubview:self.webDragView]; - - if (self.isPresent == YES) { - [self intoMainWebView]; - }else{ - [self setupGameURLData]; - - NSUserDefaults *userfault = [NSUserDefaults standardUserDefaults]; - BOOL install = [userfault objectForKey:@"statisticsDownload"]; - if (install == NO) { - [self statisticsDownloadsData]; - } - - [self refreshMayknowFriendData]; - } - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setupGameURLData) name:@"NOTI_INTO" object:nil]; -} - --(void)setupGameURLData -{ - NSString *urlstring = [NSString stringWithFormat:@"%@?userId=%@",ConfigURL,self.mainUserId]; - NSURL *url = [NSURL URLWithString:urlstring]; - - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; - request.HTTPMethod = @"GET"; - [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - - [self.activityIndicatorView startAnimating]; - NSURLSession *session = [NSURLSession sharedSession]; - NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (error) { - [self.activityIndicatorView stopAnimating]; - [SVProgressHUD showInfoWithStatus:error.localizedDescription]; - self.goIntoBtn.hidden = NO; - }else{ - NSError *error; - NSMutableDictionary *responseObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error]; - if (error) { - [self.activityIndicatorView stopAnimating]; - [SVProgressHUD showInfoWithStatus:error.localizedDescription]; - self.goIntoBtn.hidden = NO; - }else{ - if (ISNULL(error) && !ISNULL(responseObject) && [[responseObject objectForKey:@"code"] integerValue] == 1) { - NSDictionary *datadic = [responseObject objectForKey:@"data"]; - - // 判断是否有新版本 - [self compareVersionWithDictionary:datadic]; - - self.mainURLString = [datadic objectForKey:@"url"]; - self.mainURLString = [self.mainURLString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; - if (!ISNULLSTR(self.mainURLString)) { - self.goIntoBtn.hidden = YES; - [self intoMainWebView]; - }else{ - self.goIntoBtn.hidden = NO; - } - }else{ - self.goIntoBtn.hidden = NO; - } - } - } - }); - }]; - [dataTask resume]; -} - --(void)compareVersionWithDictionary:(NSDictionary *)datadic -{ - AppDelegate *appdelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; - - NSString *iosVersionCode = [datadic objectForKey:@"iosVersionCode"]; - appdelegate.downloadUrl = [datadic objectForKey:@"downloadUrl"]; - - NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary]; - NSString *localVison = infoDict[@"CFBundleShortVersionString"]; - if ([localVison compare:iosVersionCode] == NSOrderedAscending) { - - appdelegate.forceUpdate = [[datadic objectForKey:@"forceUpdate"] boolValue]; - - UIAlertController *alertview = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Tips", nil) message:NSLocalizedString(@"New version found", nil) preferredStyle:(UIAlertControllerStyleAlert)]; - UIAlertAction *action = [UIAlertAction actionWithTitle:NSLocalizedString(@"Update", nil) style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) { - appdelegate.isRefresh = NO; - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:appdelegate.downloadUrl] options:@{} completionHandler:^(BOOL success) {}]; - }]; - [alertview addAction:action]; - if (appdelegate.forceUpdate == NO) { - UIAlertAction *cancelaction = [UIAlertAction actionWithTitle:NSLocalizedString(@"CANCEL", nil) style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) {}]; - [alertview addAction:cancelaction]; - } - dispatch_async(dispatch_get_main_queue(), ^{ - [self presentViewController:alertview animated:YES completion:^{}]; - }); - } -} - --(void)intoMainWebView -{ - if (self.isPresent == YES) { - NSURL *url = [NSURL URLWithString:self.gameURLString]; - NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url]; - [_webView loadRequest:request]; - }else{ - NSURL *url = [NSURL URLWithString:self.mainURLString]; - NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url]; - [_webView loadRequest:request]; - } -} - --(void)setupEditBank -{ - EditBankViewController *editBankViewController = [[EditBankViewController alloc] initWithNibName:@"EditBankViewController" bundle:nil]; - [self presentViewController:editBankViewController animated:YES completion:nil]; -} - -- (IBAction)intoGameAction:(id)sender -{ - [self setupGameURLData]; -} - --(void)setupWithdraw -{ - WithdrawViewController *withdrawViewController = [[WithdrawViewController alloc] initWithNibName:@"WithdrawViewController" bundle:nil]; - [self presentViewController:withdrawViewController animated:YES completion:nil]; -} - -#pragma mark - 邀请人列表 --(void)setupInviteRecords -{ - InviteRecordsViewController *inviteRecordsViewController = [[InviteRecordsViewController alloc] initWithNibName:@"InviteRecordsViewController" bundle:nil]; - [self presentViewController:inviteRecordsViewController animated:YES completion:nil]; -} - -#pragma mark - 获取分享链接 --(void)setupShareLink -{ - if (ISNULLSTR(self.inviteCode)) { - __block NSString *advertisingId = nil; - if (@available(iOS 14, *)) { - [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) { -// if (status == ATTrackingManagerAuthorizationStatusAuthorized) { - advertisingId = [[ASIdentifierManager sharedManager] advertisingIdentifier].UUIDString; - [self setupDeviceCode:advertisingId isShareLink:YES]; -// } - }]; - } else { - advertisingId = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; - [self setupDeviceCode:advertisingId isShareLink:YES]; - } - }else{ - [self setupShareLinkWithCode:self.inviteCode]; - } -} - --(void)setupShareLinkWithCode:(NSString *)code -{ - NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; - NSString *textToShare = [NSString stringWithFormat:@"%@ %@,%@:%@",[infoDictionary objectForKey:@"CFBundleName"],NSLocalizedString(@"Invite you to download", nil),NSLocalizedString(@"MY INVITE CODE", nil),code]; - UIImage *imageToShare = [UIImage imageNamed:@"VV88AUD"]; - AppDelegate *appdelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; - NSURL *urlToShare = [NSURL URLWithString:appdelegate.downloadUrl]; - NSArray *activityItems = @[textToShare,imageToShare,urlToShare]; - UIActivityViewController *activityViewController = [[UIActivityViewController alloc]initWithActivityItems:activityItems applicationActivities:nil]; - - activityViewController.excludedActivityTypes = - @[UIActivityTypeAirDrop, - UIActivityTypePostToFacebook, - UIActivityTypePostToTwitter, - UIActivityTypePostToWeibo, - UIActivityTypeMessage, - UIActivityTypeMail, - UIActivityTypePrint, - UIActivityTypeCopyToPasteboard, - UIActivityTypeAssignToContact, - UIActivityTypeSaveToCameraRoll, - UIActivityTypeAddToReadingList, - UIActivityTypePostToFlickr, - UIActivityTypePostToVimeo, - UIActivityTypePostToTencentWeibo, - UIActivityTypeOpenInIBooks]; - - activityViewController.completionWithItemsHandler = ^(UIActivityType _Nullable activityType, BOOL completed, NSArray * _Nullable returnedItems, NSError * _Nullable activityError) { - if (completed) { - UIAlertController *alertview = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Share Success", nil) message:nil preferredStyle:(UIAlertControllerStyleAlert)]; - UIAlertAction *action = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {}]; - [alertview addAction:action]; - [self presentViewController:alertview animated:YES completion:^{}]; - } - }; - [self presentViewController:activityViewController animated:YES completion:nil]; -} - -#pragma mark - 获取我的邀请码 --(void)setupDeviceCode:(NSString *)advertisingId isShareLink:(BOOL)isShareLink -{ - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:InviteCodeURL]]; - request.HTTPMethod = @"POST"; - [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - - NSDictionary *parmas = @{@"userId":[NSNumber numberWithInteger:[self.mainUserId integerValue]],@"deviceCode":advertisingId}; - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:parmas options:NSJSONWritingPrettyPrinted error:nil]; - request.HTTPBody = jsonData; - - NSURLSession *session = [NSURLSession sharedSession]; - NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (error == nil) { - NSError *error; - NSMutableDictionary *responseObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error]; - if (error == nil) { - if (ISNULL(error) && !ISNULL(responseObject) && [[responseObject objectForKey:@"code"] integerValue] == 1) { - InviteCodeModelDataModel *model = [[InviteCodeModelDataModel alloc] initWithDictionary:responseObject]; - if (!ISNULLSTR(model.data.inviteCode)) { - self.inviteCode = model.data.inviteCode; - AppDelegate *appdelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; - appdelegate.inviteCode = self.inviteCode; - if (isShareLink == YES) { - [self setupShareLinkWithCode:self.inviteCode]; - }else{ - NSUserDefaults *userfault = [NSUserDefaults standardUserDefaults]; - NSString *superInviteCode = [userfault objectForKey:@"INVITE_CODE"]; - UIAlertController *codeAlertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"MY INVITE CODE", nil) message:[NSString stringWithFormat:@"%@\n(%@:%@)",model.data.inviteCode,NSLocalizedString(@"My Parent Invitation Code", nil),superInviteCode] preferredStyle:(UIAlertControllerStyleAlert)]; - UIAlertAction *action = [UIAlertAction actionWithTitle:NSLocalizedString(@"COPY", nil) style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) { - UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; - [pasteboard setString:model.data.inviteCode]; - }]; - [codeAlertController addAction:action]; - [self presentViewController:codeAlertController animated:YES completion:^{}]; - } - } - } - } - } - }); - }]; - [dataTask resume]; -} - -#pragma mark - WKNavigationDelegate -- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler -{ - decisionHandler(WKNavigationActionPolicyAllow); -} - -- (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures -{ - if (navigationAction.request.URL) { - ViewController *view = [[ViewController alloc] init]; - view.gameURLString = navigationAction.request.URL.absoluteString; - view.isPresent = YES; - view.modalPresentationStyle = UIModalPresentationFullScreen; - [self presentViewController:view animated:YES completion:^{}]; - } - return nil; -} - -#pragma mark - 统计下载量 --(void)statisticsDownloadsData -{ - NSString *urlstring = [NSString stringWithFormat:@"%@",StatisticsURL]; - NSURL *url = [NSURL URLWithString:urlstring]; - - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; - request.HTTPMethod = @"PUT"; - [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - - NSDictionary *dic = @{@"userId":[NSNumber numberWithInteger:[self.mainUserId integerValue]],@"type":[NSNumber numberWithInteger:2]}; - NSData *data = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:nil]; - request.HTTPBody = data; - - NSURLSession *session = [NSURLSession sharedSession]; - NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (error == nil) { - NSError *error; - NSMutableDictionary *responseObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error]; - if (error == nil) { - if (ISNULL(error) && !ISNULL(responseObject) && [[responseObject objectForKey:@"code"] integerValue] == 1) { - NSUserDefaults *userfault = [NSUserDefaults standardUserDefaults]; - [userfault setObject:[NSNumber numberWithBool:YES] forKey:@"statisticsDownload"]; - [userfault synchronize]; - } - } - } - }); - }]; - [dataTask resume]; -} - -#pragma mark - 获取通讯录 --(void)refreshMayknowFriendData -{ - NSMutableArray *contacts = @[].mutableCopy; - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - NSArray *keysToFetch = @[CNContactFamilyNameKey,CNContactMiddleNameKey,CNContactGivenNameKey,CNContactPhoneNumbersKey]; - CNContactFetchRequest *fetchRequest = [[CNContactFetchRequest alloc] initWithKeysToFetch:keysToFetch]; - CNContactStore *contactStore = [[CNContactStore alloc] init]; - [contactStore enumerateContactsWithFetchRequest:fetchRequest error:nil usingBlock:^(CNContact * _Nonnull contact, BOOL * _Nonnull stop) { - NSMutableDictionary *contactDic = @{}.mutableCopy; - NSString *name = [NSString stringWithFormat:@"%@%@%@",contact.familyName?:@"",contact.middleName?:@"",contact.givenName?:@""]; - NSArray *phoneNumbers = contact.phoneNumbers; - for (CNLabeledValue *labelValue in phoneNumbers) { - CNPhoneNumber *phoneNumber = labelValue.value; - NSString *string = phoneNumber.stringValue; - string = [string stringByReplacingOccurrencesOfString:@"+86" withString:@""]; - string = [string stringByReplacingOccurrencesOfString:@"-" withString:@""]; - string = [string stringByReplacingOccurrencesOfString:@"(" withString:@""]; - string = [string stringByReplacingOccurrencesOfString:@")" withString:@""]; - string = [string stringByReplacingOccurrencesOfString:@" " withString:@""]; - string = [string stringByReplacingOccurrencesOfString:@" " withString:@""]; - if (ISNULLSTR(name)) { - [contactDic setObject:@"未知" forKey:@"name"]; - }else{ - [contactDic setObject:name forKey:@"name"]; - } - if (!ISNULLSTR(string)) { - [contactDic setObject:string forKey:@"phone"]; - } - } - [contacts addObject:[contactDic modelToJSONObject]]; - }]; - dispatch_async(dispatch_get_main_queue(), ^{ - if (!ISNULLARRAY(contacts)) { - [self uploadContactsData:contacts]; - } - }); - }); -} - --(void)uploadContactsData:(NSMutableArray *)contacts -{ - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:ContactsURL]]; - request.HTTPMethod = @"POST"; - [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - - NSDictionary *parmas = @{@"userId":self.mainUserId,@"customers":contacts}; - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:parmas options:NSJSONWritingPrettyPrinted error:nil]; - request.HTTPBody = jsonData; - - NSURLSession *session = [NSURLSession sharedSession]; - NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {}]; - [dataTask resume]; -} - -@end diff --git a/ShenQi/WithdrawRecordTableViewCell.h b/ShenQi/WithdrawRecordTableViewCell.h deleted file mode 100644 index 7cb6496..0000000 --- a/ShenQi/WithdrawRecordTableViewCell.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// WithdrawRecordTableViewCell.h -// ShenQi -// -// Created by Yao on 2024/11/9. -// - -#import - -#import "DataModels.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface WithdrawRecordTableViewCell : UITableViewCell - -@property (weak, nonatomic) IBOutlet UILabel *nameLabel; -@property (weak, nonatomic) IBOutlet UILabel *bankLabel; -@property (weak, nonatomic) IBOutlet UILabel *amountLabel; -@property (weak, nonatomic) IBOutlet UILabel *balanceLabel; - -@property (nonatomic, strong) WithdrawRecordList *list; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ShenQi/WithdrawRecordTableViewCell.m b/ShenQi/WithdrawRecordTableViewCell.m deleted file mode 100644 index faf7505..0000000 --- a/ShenQi/WithdrawRecordTableViewCell.m +++ /dev/null @@ -1,34 +0,0 @@ -// -// WithdrawRecordTableViewCell.m -// ShenQi -// -// Created by Yao on 2024/11/9. -// - -#import "WithdrawRecordTableViewCell.h" - -@implementation WithdrawRecordTableViewCell - -- (void)awakeFromNib { - [super awakeFromNib]; - // Initialization code - [self setSelectionStyle:(UITableViewCellSelectionStyleNone)]; -} - --(void)setList:(WithdrawRecordList *)list -{ - _list = list; - - self.nameLabel.text = self.list.name; - self.bankLabel.text = [NSString stringWithFormat:@"(%@)",self.list.bankName]; - self.amountLabel.text = [NSString stringWithFormat:@"%@:%.1f",NSLocalizedString(@"Amount", nil),self.list.amount]; - self.balanceLabel.text = [NSString stringWithFormat:@"%@:%.1f",NSLocalizedString(@"Balance", nil),self.list.balance]; -} - -- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - [super setSelected:selected animated:animated]; - - // Configure the view for the selected state -} - -@end diff --git a/ShenQi/WithdrawRecordTableViewCell.xib b/ShenQi/WithdrawRecordTableViewCell.xib deleted file mode 100644 index 6072eba..0000000 --- a/ShenQi/WithdrawRecordTableViewCell.xib +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ShenQi/WithdrawRecordsViewController.h b/ShenQi/WithdrawRecordsViewController.h deleted file mode 100644 index 12f1877..0000000 --- a/ShenQi/WithdrawRecordsViewController.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// WithdrawRecordsViewController.h -// ShenQi -// -// Created by Yao on 2024/11/9. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface WithdrawRecordsViewController : UIViewController - -@end - -NS_ASSUME_NONNULL_END diff --git a/ShenQi/WithdrawRecordsViewController.m b/ShenQi/WithdrawRecordsViewController.m deleted file mode 100644 index 2a5bb2d..0000000 --- a/ShenQi/WithdrawRecordsViewController.m +++ /dev/null @@ -1,176 +0,0 @@ -// -// WithdrawRecordsViewController.m -// ShenQi -// -// Created by Yao on 2024/11/9. -// - -#import "WithdrawRecordsViewController.h" - -#import "WithdrawRecordTableViewCell.h" - -#import "DataModels.h" -#import "MacroDefine.h" -#import "InviteRecordsTableViewCell.h" -#import "AppDelegate.h" - -#import -#import -#import -#import - -@interface WithdrawRecordsViewController () - -@property (weak, nonatomic) IBOutlet UILabel *titleLabel; -@property (weak, nonatomic) IBOutlet UITableView *recordTableView; -@property (weak, nonatomic) IBOutlet UILabel *emptyLabel; -@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator; - -@property (nonatomic, assign) NSInteger page; -@property (nonatomic, strong) NSMutableArray *recordsArray; -@property (nonatomic, strong) NSString *inviteCode; - -@end - -static NSString *identifier = @"WithdrawRecordTableViewCell"; - -@implementation WithdrawRecordsViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - - self.titleLabel.text = NSLocalizedString(@"WithdrawRecord", nil); - - self.recordTableView.delegate = self; - self.recordTableView.dataSource = self; - self.recordTableView.rowHeight = 70; - self.recordTableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ - self.page = 1; - self.recordsArray = @[].mutableCopy; - [self refreshWithdrawRecords]; - }]; - [self.recordTableView registerNib:[UINib nibWithNibName:@"WithdrawRecordTableViewCell" bundle:nil] forCellReuseIdentifier:identifier]; - self.recordTableView.tableFooterView = [UIView new]; - - self.page = 1; - self.recordsArray = @[].mutableCopy; - - [self setupInviteCode]; -} - -- (IBAction)dismissAction:(id)sender -{ - [self dismissViewControllerAnimated:YES completion:nil]; -} - --(void)refreshWithdrawRecords -{ - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@?inviteCode=%@&page=%@&size=%@",WithdrawURL,self.inviteCode,[NSNumber numberWithInteger:self.page],[NSNumber numberWithInteger:20]]]]; - request.HTTPMethod = @"GET"; - [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - - NSURLSession *session = [NSURLSession sharedSession]; - NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (error) { - [SVProgressHUD showInfoWithStatus:error.localizedDescription]; - }else{ - NSError *error; - NSMutableDictionary *responseObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error]; - if (error) { - [SVProgressHUD showInfoWithStatus:error.localizedDescription]; - }else{ - if (ISNULL(error) && !ISNULL(responseObject) && [[responseObject objectForKey:@"code"] integerValue] == 1) { - WithdrawRecordDataModel *model = [[WithdrawRecordDataModel alloc] initWithDictionary:responseObject]; - if (model.data.list.count < 20) { - self.recordTableView.mj_footer = nil; - }else if (model.data.list.count == 20) { - self.recordTableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{ - self.page++; - [self refreshWithdrawRecords]; - }]; - } - if (!ISNULLARRAY(model.data.list)) { - [self.recordsArray addObjectsFromArray:model.data.list]; - } - } - } - } - if (ISNULLARRAY(self.recordsArray)) { - self.emptyLabel.hidden = NO; - }else{ - self.emptyLabel.hidden = YES; - } - [self.activityIndicator stopAnimating]; - [self.recordTableView reloadData]; - [self.recordTableView.mj_header endRefreshing]; - [self.recordTableView.mj_footer endRefreshing]; - }); - }]; - [dataTask resume]; -} - --(void)setupInviteCode -{ - // 我的邀请码 - __block NSString *advertisingId = nil; - AppDelegate *appdelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; - if (ISNULLSTR(appdelegate.inviteCode)) { - if (@available(iOS 14, *)) { - [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) { - advertisingId = [[ASIdentifierManager sharedManager] advertisingIdentifier].UUIDString; - [self getCodeWithAdvertisingId:advertisingId]; - }]; - } else { - advertisingId = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; - [self getCodeWithAdvertisingId:advertisingId]; - } - }else{ - self.inviteCode = appdelegate.inviteCode; - [self refreshWithdrawRecords]; - } -} - --(void)getCodeWithAdvertisingId:(NSString *)advertisingId -{ - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:InviteCodeURL]]; - request.HTTPMethod = @"POST"; - [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - - NSDictionary *parmas = @{@"userId":[NSNumber numberWithInteger:[VV88AUUserID integerValue]],@"deviceCode":advertisingId}; - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:parmas options:NSJSONWritingPrettyPrinted error:nil]; - request.HTTPBody = jsonData; - - NSURLSession *session = [NSURLSession sharedSession]; - NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (error == nil) { - NSError *error; - NSMutableDictionary *responseObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error]; - if (error == nil) { - if (ISNULL(error) && !ISNULL(responseObject) && [[responseObject objectForKey:@"code"] integerValue] == 1) { - InviteCodeModelDataModel *model = [[InviteCodeModelDataModel alloc] initWithDictionary:responseObject]; - self.inviteCode = model.data.inviteCode; - [self refreshWithdrawRecords]; - } - } - } - }); - }]; - [dataTask resume]; -} - --(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section -{ - return self.recordsArray.count; -} - --(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath -{ - WithdrawRecordTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; - WithdrawRecordList *list = [self.recordsArray objectAtIndex:indexPath.row]; - cell.list = list; - return cell; -} - -@end diff --git a/ShenQi/WithdrawRecordsViewController.xib b/ShenQi/WithdrawRecordsViewController.xib deleted file mode 100644 index 1463772..0000000 --- a/ShenQi/WithdrawRecordsViewController.xib +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ShenQi/WithdrawViewController.h b/ShenQi/WithdrawViewController.h deleted file mode 100644 index 6b81337..0000000 --- a/ShenQi/WithdrawViewController.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// WithdrawViewController.h -// ShenQi -// -// Created by Yao on 2024/11/9. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface WithdrawViewController : UIViewController - -@end - -NS_ASSUME_NONNULL_END diff --git a/ShenQi/WithdrawViewController.m b/ShenQi/WithdrawViewController.m deleted file mode 100644 index 822de18..0000000 --- a/ShenQi/WithdrawViewController.m +++ /dev/null @@ -1,206 +0,0 @@ -// -// WithdrawViewController.m -// ShenQi -// -// Created by Yao on 2024/11/9. -// - -#import "WithdrawViewController.h" - -#import "DataModels.h" -#import "MacroDefine.h" -#import "InviteRecordsTableViewCell.h" -#import "AppDelegate.h" - -#import "DSTextField.h" -#import -#import -#import -#import - -#import "WithdrawRecordsViewController.h" - -@interface WithdrawViewController () - -@property (weak, nonatomic) IBOutlet UILabel *titleLabel; -@property (weak, nonatomic) IBOutlet UILabel *balanceLabel; -@property (weak, nonatomic) IBOutlet UILabel *inputWithdrawLabel; -@property (weak, nonatomic) IBOutlet DSTextField *withdrawTextField; -@property (weak, nonatomic) IBOutlet UIButton *withdrawBtn; -@property (weak, nonatomic) IBOutlet UIButton *withdrawRecordBtn; - -@property (nonatomic, strong) NSString *inviteCode; -@property (nonatomic, assign) CGFloat balance; - -@end - -@implementation WithdrawViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - - self.titleLabel.text = NSLocalizedString(@"Withdraw", nil); - - self.balanceLabel.text = [NSString stringWithFormat:@"%@:",NSLocalizedString(@"Balance", nil)]; - self.inputWithdrawLabel.text = [NSString stringWithFormat:@"%@%@%@%@",NSLocalizedString(@"PLS", nil),NSLocalizedString(@"InputEdit", nil),NSLocalizedString(@"Withdraw", nil),NSLocalizedString(@"Amount", nil)]; - - self.withdrawTextField.delegate = self; - self.withdrawTextField.placeHolderString = [NSString stringWithFormat:@"%@%@%@%@",NSLocalizedString(@"PLS", nil),NSLocalizedString(@"InputEdit", nil),NSLocalizedString(@"Withdraw", nil),NSLocalizedString(@"Amount", nil)]; - - self.withdrawBtn.layer.cornerRadius = 20.f; - self.withdrawBtn.layer.masksToBounds = YES; - [self.withdrawBtn setTitle:NSLocalizedString(@"OK", nil) forState:(UIControlStateNormal)]; - [self.withdrawBtn addTarget:self action:@selector(withdrawAction) forControlEvents:(UIControlEventTouchUpInside)]; - - [self.withdrawRecordBtn setTitle:NSLocalizedString(@"WithdrawRecord", nil) forState:(UIControlStateNormal)]; - [self.withdrawRecordBtn addTarget:self action:@selector(withdrawRecordAction) forControlEvents:(UIControlEventTouchUpInside)]; - - [self setupInviteCode]; -} - -- (IBAction)dismissAction:(id)sender -{ - [self dismissViewControllerAnimated:YES completion:nil]; -} - --(void)withdrawAction -{ - NSString *amout = self.withdrawTextField.text; - if ([amout floatValue] > 0) { - if ([amout floatValue] > self.balance) { - [SVProgressHUD showInfoWithStatus:[NSString stringWithFormat:@"%@%@",NSLocalizedString(@"OverCanWithdraw", nil),NSLocalizedString(@"Amount", nil)]]; - }else{ - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:WithdrawApplyURL]]; - request.HTTPMethod = @"POST"; - [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - - NSDictionary *parmas = @{@"amount":[NSNumber numberWithFloat:[amout floatValue]],@"inviteCode":self.inviteCode}; - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:parmas options:NSJSONWritingPrettyPrinted error:nil]; - request.HTTPBody = jsonData; - - [SVProgressHUD show]; - NSURLSession *session = [NSURLSession sharedSession]; - NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (error == nil) { - NSError *error; - NSMutableDictionary *responseObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error]; - if (error == nil) { - if (ISNULL(error) && !ISNULL(responseObject) && [[responseObject objectForKey:@"code"] integerValue] == 1) { - [SVProgressHUD showSuccessWithStatus:nil]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [self dismissAction:nil]; - }); - }else{ - [SVProgressHUD showInfoWithStatus:error.localizedDescription]; - } - }else{ - NSString *errmsg = [responseObject objectForKey:@"error"]; - [SVProgressHUD showInfoWithStatus:errmsg]; - } - }else{ - [SVProgressHUD showInfoWithStatus:error.localizedDescription]; - } - }); - }]; - [dataTask resume]; - } - }else{ - [SVProgressHUD showInfoWithStatus:[NSString stringWithFormat:@"%@%@%@%@",NSLocalizedString(@"PLS", nil),NSLocalizedString(@"InputEdit", nil),NSLocalizedString(@"Withdraw", nil),NSLocalizedString(@"Amount", nil)]]; - } -} - --(void)withdrawRecordAction -{ - WithdrawRecordsViewController *withdrawRecordsViewController = [[WithdrawRecordsViewController alloc] initWithNibName:@"WithdrawRecordsViewController" bundle:nil]; - [self presentViewController:withdrawRecordsViewController animated:YES completion:nil]; -} - --(void)setupInviteCode -{ - // 我的邀请码 - __block NSString *advertisingId = nil; - AppDelegate *appdelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; - if (@available(iOS 14, *)) { - [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) { - advertisingId = [[ASIdentifierManager sharedManager] advertisingIdentifier].UUIDString; - [self getCodeWithAdvertisingId:advertisingId]; - }]; - } else { - advertisingId = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; - [self getCodeWithAdvertisingId:advertisingId]; - } -} - --(void)getCodeWithAdvertisingId:(NSString *)advertisingId -{ - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:InviteCodeURL]]; - request.HTTPMethod = @"POST"; - [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - - NSDictionary *parmas = @{@"userId":[NSNumber numberWithInteger:[VV88AUUserID integerValue]],@"deviceCode":advertisingId}; - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:parmas options:NSJSONWritingPrettyPrinted error:nil]; - request.HTTPBody = jsonData; - - NSURLSession *session = [NSURLSession sharedSession]; - NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (error == nil) { - NSError *error; - NSMutableDictionary *responseObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error]; - if (error == nil) { - if (ISNULL(error) && !ISNULL(responseObject) && [[responseObject objectForKey:@"code"] integerValue] == 1) { - InviteCodeModelDataModel *model = [[InviteCodeModelDataModel alloc] initWithDictionary:responseObject]; - self.inviteCode = model.data.inviteCode; - AppDelegate *appdelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; - appdelegate.inviteCode = self.inviteCode; - self.balance = model.data.balance; - self.balanceLabel.text = [NSString stringWithFormat:@"%@:%.1f",NSLocalizedString(@"Balance", nil),self.balance]; - } - } - } - }); - }]; - [dataTask resume]; -} - --(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event -{ - [self.view endEditing:YES]; -} - --(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string -{ - NSString *text = nil; - if (range.location >= textField.text.length) { - text = [textField.text stringByAppendingString:string]; - } else { - text = [textField.text stringByReplacingCharactersInRange:range withString:string]; - } - if ([string containsString:@"."]) { - if ([textField.text containsString:@"."]) { - return NO; - } - }else{ - if ([textField.text containsString:@"."] && ![string isEqualToString:@""]) { - NSString *floatAmout = [textField.text componentsSeparatedByString:@"."].lastObject; - if (floatAmout.length >= 2) { - return NO; - } - } - } - return YES; -} - --(BOOL)textFieldShouldBeginEditing:(UITextField *)textField -{ - textField.clearButtonMode = UITextFieldViewModeAlways; - return YES; -} - --(void)textFieldDidEndEditing:(UITextField *)textField -{ - textField.clearButtonMode = UITextFieldViewModeNever; -} - -@end diff --git a/ShenQi/WithdrawViewController.xib b/ShenQi/WithdrawViewController.xib deleted file mode 100644 index dfbc03b..0000000 --- a/ShenQi/WithdrawViewController.xib +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -