From 7b88912b3759ee59a001b477c4924551f3638350 Mon Sep 17 00:00:00 2001 From: edwinQQQ Date: Mon, 20 Oct 2025 15:10:45 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=E5=88=86?= =?UTF-8?q?=E4=BA=AB=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81=E4=BB=A5=E7=AE=80?= =?UTF-8?q?=E5=8C=96=E9=A1=B9=E7=9B=AE=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 主要变更: 1. 从 Podfile 中移除 FBSDKShareKit 和 mob_sharesdk 相关依赖,减少项目依赖。 2. 从 AppDelegate 和相关文件中删除 ShareSDK 初始化及相关逻辑,清理未使用的代码。 3. 删除与分享功能相关的 XPShareView 及其模型文件,简化项目结构。 此更新旨在提升项目的可维护性,减少冗余依赖,确保代码结构更加清晰。 --- Podfile | 4 - Podfile.lock | 149 ++++---- YuMi.xcodeproj/project.pbxproj | 54 --- YuMi/Appdelegate/AppDelegate+ThirdConfig.m | 14 - .../ShareView/Model/XPShareInfoModel.h | 55 --- .../ShareView/Model/XPShareInfoModel.m | 12 - YuMi/CustomUI/ShareView/Model/XPShareItem.h | 45 --- YuMi/CustomUI/ShareView/Model/XPShareItem.m | 23 -- .../CustomUI/ShareView/View/XPShareItemCell.h | 16 - .../CustomUI/ShareView/View/XPShareItemCell.m | 78 ----- YuMi/CustomUI/ShareView/XPShareView.h | 34 -- YuMi/CustomUI/ShareView/XPShareView.m | 329 ------------------ .../YMLogin/Presenter/LoginPresenter.m | 71 +--- .../View/Friend/XPMineShareViewController.h | 24 -- .../View/Friend/XPMineShareViewController.m | 232 ------------ .../View/XPArrangeMicViewController.m | 54 ++- YuMi/Modules/YMWeb/XPWebViewController.m | 136 +------- 17 files changed, 103 insertions(+), 1227 deletions(-) delete mode 100644 YuMi/CustomUI/ShareView/Model/XPShareInfoModel.h delete mode 100644 YuMi/CustomUI/ShareView/Model/XPShareInfoModel.m delete mode 100644 YuMi/CustomUI/ShareView/Model/XPShareItem.h delete mode 100644 YuMi/CustomUI/ShareView/Model/XPShareItem.m delete mode 100644 YuMi/CustomUI/ShareView/View/XPShareItemCell.h delete mode 100644 YuMi/CustomUI/ShareView/View/XPShareItemCell.m delete mode 100644 YuMi/CustomUI/ShareView/XPShareView.h delete mode 100644 YuMi/CustomUI/ShareView/XPShareView.m delete mode 100644 YuMi/Modules/YMMine/View/Friend/XPMineShareViewController.h delete mode 100644 YuMi/Modules/YMMine/View/Friend/XPMineShareViewController.m diff --git a/Podfile b/Podfile index fb690eb..3faad1a 100644 --- a/Podfile +++ b/Podfile @@ -8,7 +8,6 @@ target 'YuMi' do pod 'Bugly' pod 'FBSDKLoginKit' pod 'FBSDKCoreKit' - pod 'FBSDKShareKit' # 滑动标签栏 pod 'JXCategoryView' pod 'JXPagingView/Pager' @@ -54,9 +53,6 @@ target 'YuMi' do pod 'GKCycleScrollView' pod 'SVGAPlayer' pod 'GoogleSignIn' - pod 'mob_sharesdk' - pod 'mob_sharesdk/ShareSDKPlatforms/Apple' - pod 'mob_sharesdk/ShareSDKExtension' pod 'ZLCollectionViewFlowLayout' pod 'TABAnimated' diff --git a/Podfile.lock b/Podfile.lock index 322f4a8..244d09b 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -14,75 +14,74 @@ PODS: - AFNetworking/Serialization (4.0.1) - AFNetworking/UIKit (4.0.1): - AFNetworking/NSURLSession - - AppAuth (1.7.6): - - AppAuth/Core (= 1.7.6) - - AppAuth/ExternalUserAgent (= 1.7.6) - - AppAuth/Core (1.7.6) - - AppAuth/ExternalUserAgent (1.7.6): + - AppAuth (2.0.0): + - AppAuth/Core (= 2.0.0) + - AppAuth/ExternalUserAgent (= 2.0.0) + - AppAuth/Core (2.0.0) + - AppAuth/ExternalUserAgent (2.0.0): - AppAuth/Core + - AppCheckCore (11.2.0): + - GoogleUtilities/Environment (~> 8.0) + - GoogleUtilities/UserDefaults (~> 8.0) + - PromisesObjC (~> 2.4) - Base64 (1.1.2) - Bugly (2.6.1) - CocoaAsyncSocket (7.6.5) - - FBAEMKit (14.1.0): - - FBSDKCoreKit_Basics (= 14.1.0) - - FBSDKCoreKit (14.1.0): - - FBAEMKit (= 14.1.0) - - FBSDKCoreKit_Basics (= 14.1.0) - - FBSDKCoreKit_Basics (14.1.0) - - FBSDKLoginKit (14.1.0): - - FBSDKCoreKit (= 14.1.0) - - FBSDKShareKit (14.1.0): - - FBSDKCoreKit (= 14.1.0) + - FBAEMKit (18.0.1): + - FBSDKCoreKit_Basics (= 18.0.1) + - FBSDKCoreKit (18.0.1): + - FBAEMKit (= 18.0.1) + - FBSDKCoreKit_Basics (= 18.0.1) + - FBSDKCoreKit_Basics (18.0.1) + - FBSDKLoginKit (18.0.1): + - FBSDKCoreKit (= 18.0.1) - FFPopup (1.1.5) - FLAnimatedImage (1.0.17) - - FlyVerifyCSDK (1.0.7) - GKCycleScrollView (1.2.3) - - GoogleSignIn (7.1.0): - - AppAuth (< 2.0, >= 1.7.3) - - GTMAppAuth (< 5.0, >= 4.1.1) + - GoogleSignIn (9.0.0): + - AppAuth (~> 2.0) + - AppCheckCore (~> 11.0) + - GTMAppAuth (~> 5.0) - GTMSessionFetcher/Core (~> 3.3) - - GTMAppAuth (4.1.1): - - AppAuth/Core (~> 1.7) + - GoogleUtilities/Environment (8.1.0): + - GoogleUtilities/Privacy + - GoogleUtilities/Logger (8.1.0): + - GoogleUtilities/Environment + - GoogleUtilities/Privacy + - GoogleUtilities/Privacy (8.1.0) + - GoogleUtilities/UserDefaults (8.1.0): + - GoogleUtilities/Logger + - GoogleUtilities/Privacy + - GTMAppAuth (5.0.0): + - AppAuth/Core (~> 2.0) - GTMSessionFetcher/Core (< 4.0, >= 3.3) - GTMSessionFetcher/Core (3.5.0) - IQKeyboardManager (6.5.19) - JXCategoryView (1.6.8) - JXPagingView/Pager (2.1.3) - - libpag (4.4.32) - - MarqueeLabel (4.4.0) + - libpag (4.5.3) + - MarqueeLabel (4.5.3) - Masonry (1.1.0) - MBProgressHUD (1.2.0) - MJExtension (3.4.2) - MJRefresh (3.7.9) - - mob_sharesdk (4.4.35): - - mob_sharesdk/ShareSDK (= 4.4.35) - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDK (4.4.35): - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKExtension (4.4.35): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - mob_sharesdk/ShareSDKPlatforms/Apple (4.4.35): - - mob_sharesdk/ShareSDK - - MOBFoundation (>= 3.2.9) - - MOBFoundation (20250528): - - FlyVerifyCSDK (>= 0.0.7) - - NIMSDK_LITE (10.9.42): - - NIMSDK_LITE/NOS (= 10.9.42) + - NIMSDK_LITE (10.9.53): + - NIMSDK_LITE/NOS (= 10.9.53) - YXArtemis_XCFramework - - NIMSDK_LITE/NOS (10.9.42): + - NIMSDK_LITE/NOS (10.9.53): - YXArtemis_XCFramework - pop (1.0.12) + - PromisesObjC (2.4.0) - Protobuf (3.29.5) - - QCloudCore (6.4.9): - - QCloudCore/Default (= 6.4.9) - - QCloudCore/Default (6.4.9): - - QCloudTrack/Beacon (= 6.4.9) - - QCloudCOSXML (6.4.9): - - QCloudCOSXML/Default (= 6.4.9) - - QCloudCOSXML/Default (6.4.9): - - QCloudCore (= 6.4.9) - - QCloudTrack/Beacon (6.4.9) + - QCloudCore (6.5.1): + - QCloudCore/Default (= 6.5.1) + - QCloudCore/Default (6.5.1): + - QCloudTrack/Beacon (= 6.5.1) + - QCloudCOSXML (6.5.1): + - QCloudCOSXML/Default (= 6.5.1) + - QCloudCOSXML/Default (6.5.1): + - QCloudCore (= 6.5.1) + - QCloudTrack/Beacon (6.5.1) - QGVAPlayer (1.0.19) - ReactiveObjC (3.1.1) - SDCycleScrollView (1.82): @@ -106,9 +105,9 @@ PODS: - Protobuf (~> 3.4) - SZTextView (1.3.0) - TABAnimated (2.6.6) - - TXLiteAVSDK_TRTC (12.6.18866): - - TXLiteAVSDK_TRTC/TRTC (= 12.6.18866) - - TXLiteAVSDK_TRTC/TRTC (12.6.18866) + - TXLiteAVSDK_TRTC (12.8.19666): + - TXLiteAVSDK_TRTC/TRTC (= 12.8.19666) + - TXLiteAVSDK_TRTC/TRTC (12.8.19666) - TYCyclePagerView (1.2.0) - TZImagePickerController (3.8.9): - TZImagePickerController/Basic (= 3.8.9) @@ -134,7 +133,6 @@ DEPENDENCIES: - CocoaAsyncSocket - FBSDKCoreKit - FBSDKLoginKit - - FBSDKShareKit - FFPopup - FLAnimatedImage - GKCycleScrollView @@ -148,9 +146,6 @@ DEPENDENCIES: - MBProgressHUD - MJExtension (= 3.4.2) - MJRefresh (= 3.7.9) - - mob_sharesdk - - mob_sharesdk/ShareSDKExtension - - mob_sharesdk/ShareSDKPlatforms/Apple - NIMSDK_LITE (~> 10.9.40) - pop - QCloudCOSXML @@ -176,6 +171,7 @@ SPEC REPOS: https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git: - AFNetworking - AppAuth + - AppCheckCore - Base64 - Bugly - CocoaAsyncSocket @@ -183,12 +179,11 @@ SPEC REPOS: - FBSDKCoreKit - FBSDKCoreKit_Basics - FBSDKLoginKit - - FBSDKShareKit - FFPopup - FLAnimatedImage - - FlyVerifyCSDK - GKCycleScrollView - GoogleSignIn + - GoogleUtilities - GTMAppAuth - GTMSessionFetcher - IQKeyboardManager @@ -200,10 +195,9 @@ SPEC REPOS: - MBProgressHUD - MJExtension - MJRefresh - - mob_sharesdk - - MOBFoundation - NIMSDK_LITE - pop + - PromisesObjC - Protobuf - QCloudCore - QCloudCOSXML @@ -235,39 +229,38 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: AFNetworking: 3bd23d814e976cd148d7d44c3ab78017b744cd58 - AppAuth: d4f13a8fe0baf391b2108511793e4b479691fb73 + AppAuth: 1c1a8afa7e12f2ec3a294d9882dfa5ab7d3cb063 + AppCheckCore: cc8fd0a3a230ddd401f326489c99990b013f0c4f Base64: cecfb41a004124895a7bcee567a89bae5a89d49b Bugly: 217ac2ce5f0f2626d43dbaa4f70764c953a26a31 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 - FBAEMKit: a899515e45476027f73aef377b5cffadcd56ca3a - FBSDKCoreKit: 24f8bc8d3b5b2a8c5c656a1329492a12e8efa792 - FBSDKCoreKit_Basics: 6e578c9bdc7aa1365dbbbde633c9ebb536bcaa98 - FBSDKLoginKit: 787de205d524c3a4b17d527916f1d066e4361660 - FBSDKShareKit: b9c1cd1fa6a320a50f0f353cf30d589049c8db77 + FBAEMKit: b2ed182002dbcb65d5a60059c9693d322186cd00 + FBSDKCoreKit: 7f96852f2539bdb88ba8d47e5ab4ae70a6f8d691 + FBSDKCoreKit_Basics: 22d4c1a509ded4e45116f3bb167a14907550f62e + FBSDKLoginKit: f48c06446995cd209332831f692cea28b26e51da FFPopup: a208dcee8db3e54ec4a88fcd6481f6f5d85b7a83 FLAnimatedImage: bbf914596368867157cc71b38a8ec834b3eeb32b - FlyVerifyCSDK: e0a13f11d4f29aca7fb7fdcff3f27e3b7ba2de5d GKCycleScrollView: 8ed79d2142e62895a701973358b6f94b661b4829 - GoogleSignIn: d4281ab6cf21542b1cfaff85c191f230b399d2db - GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de + GoogleSignIn: c7f09cfbc85a1abf69187be091997c317cc33b77 + GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1 + GTMAppAuth: 217a876b249c3c585a54fd6f73e6b58c4f5c4238 GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6 IQKeyboardManager: c8665b3396bd0b79402b4c573eac345a31c7d485 JXCategoryView: 262d503acea0b1278c79a1c25b7332ffaef4d518 JXPagingView: afdd2e9af09c90160dd232b970d603cc6e7ddd0e - libpag: 6e8253018ee4e7f310c8c07d9d9a89d7ae58ae27 - MarqueeLabel: d2388949ac58d587303178d56a792ba8a001b037 + libpag: c59ae60dbae9e025465e9541ee03ee96994f4c73 + MarqueeLabel: 0c57d4c6634e04a6d015af79f7c9a175b2309525 Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 MBProgressHUD: 3ee5efcc380f6a79a7cc9b363dd669c5e1ae7406 MJExtension: e97d164cb411aa9795cf576093a1fa208b4a8dd8 MJRefresh: ff9e531227924c84ce459338414550a05d2aea78 - mob_sharesdk: 409503324d18f231dd27b4d26428c0c168b20c36 - MOBFoundation: a1f193058aba95440dadeb799fb398ff92cfe45e - NIMSDK_LITE: 67f6815667acefdc8f9969f8c955b5c1fab490df + NIMSDK_LITE: 79bc52b8ad905e6c088053d8d29e7863fb9cdb98 pop: d582054913807fd11fd50bfe6a539d91c7e1a55a + PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 Protobuf: 164aea2ae380c3951abdc3e195220c01d17400e0 - QCloudCore: 0e70cda608d1ac485e039e83be1c4a1197197e6b - QCloudCOSXML: b7f0b9cac61780a03318d40367a879f8d7eb3d86 - QCloudTrack: cc101dd57be7f87bffc3f2fb692a781d5efeda98 + QCloudCore: 6f8c67b96448472d2c6a92b9cfe1bdb5abbb1798 + QCloudCOSXML: 92f50a787b4e8d9a7cb6ea8e626775256b4840a7 + QCloudTrack: 20b79388365b4c8ed150019c82a56f1569f237f8 QGVAPlayer: a0bca68c9bd6f1c8de5ac2d10ddf98be6038cce9 ReactiveObjC: 011caa393aa0383245f2dcf9bf02e86b80b36040 SDCycleScrollView: a0d74c3384caa72bdfc81470bdbc8c14b3e1fbcf @@ -279,7 +272,7 @@ SPEC CHECKSUMS: SVGAPlayer: 318b85a78b61292d6ae9dfcd651f3f0d1cdadd86 SZTextView: 094dc6acc9beec537685c545d6e3e0d4975174e1 TABAnimated: 75fece541a774193565697c7a11539d3c6f631b3 - TXLiteAVSDK_TRTC: 09552a5bb5571c85c851d8dd858064724639f55e + TXLiteAVSDK_TRTC: b576b0c6a477fa98b5d2b33be63fa9aa7c41f0eb TYCyclePagerView: 2b051dade0615c70784aa34f40c646feeddb7344 TZImagePickerController: 456f470b5dea97b37226ec7a694994a8663340b2 YuMi: 6c5f00f1eccbcea3304feae03cbe659025fdb9cb @@ -290,6 +283,6 @@ SPEC CHECKSUMS: YYWebImage: 5f7f36aee2ae293f016d418c7d6ba05c4863e928 ZLCollectionViewFlowLayout: c99024652ce9f0c57d33ab53052c9b85e4a936b7 -PODFILE CHECKSUM: b0aa65c81098b0d5d2e755c0b427cfbab05d21c7 +PODFILE CHECKSUM: 4ae0a76c5f1e815186f5f38306131c4d372fa23d COCOAPODS: 1.16.2 diff --git a/YuMi.xcodeproj/project.pbxproj b/YuMi.xcodeproj/project.pbxproj index 0880adf..9b8e49d 100644 --- a/YuMi.xcodeproj/project.pbxproj +++ b/YuMi.xcodeproj/project.pbxproj @@ -704,13 +704,10 @@ 4CD19E702E9CDF980069DAA0 /* emoji_118@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4CD19D142E9CDF980069DAA0 /* emoji_118@2x.png */; }; 4CD19E712E9CDF980069DAA0 /* emoji_21@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4CD19CB32E9CDF980069DAA0 /* emoji_21@2x.png */; }; 4CD19E722E9CDF980069DAA0 /* UIButton+MSRTL.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD19D692E9CDF980069DAA0 /* UIButton+MSRTL.m */; }; - 4CD19E732E9CDF980069DAA0 /* XPShareItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD19D7A2E9CDF980069DAA0 /* XPShareItem.m */; }; 4CD19E742E9CDF980069DAA0 /* TTNewAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD19DA02E9CDF980069DAA0 /* TTNewAlertView.m */; }; 4CD19E752E9CDF980069DAA0 /* QPhotoImageModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD19D5B2E9CDF980069DAA0 /* QPhotoImageModel.m */; }; - 4CD19E762E9CDF980069DAA0 /* XPShareInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD19D782E9CDF980069DAA0 /* XPShareInfoModel.m */; }; 4CD19E772E9CDF980069DAA0 /* UITextView+MSRTL.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD19D732E9CDF980069DAA0 /* UITextView+MSRTL.m */; }; 4CD19E782E9CDF980069DAA0 /* NSMutableAttributedString+MSRTL.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD19D672E9CDF980069DAA0 /* NSMutableAttributedString+MSRTL.m */; }; - 4CD19E792E9CDF980069DAA0 /* XPShareItemCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD19D7D2E9CDF980069DAA0 /* XPShareItemCell.m */; }; 4CD19E7A2E9CDF980069DAA0 /* SexAgeLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD19DC42E9CDF980069DAA0 /* SexAgeLabel.m */; }; 4CD19E7B2E9CDF980069DAA0 /* QKeyboardManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD19D592E9CDF980069DAA0 /* QKeyboardManager.m */; }; 4CD19E7C2E9CDF980069DAA0 /* TTPopupService.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD19D982E9CDF980069DAA0 /* TTPopupService.m */; }; @@ -739,7 +736,6 @@ 4CD19E932E9CDF980069DAA0 /* NetImageConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD19DAC2E9CDF980069DAA0 /* NetImageConfig.m */; }; 4CD19E942E9CDF980069DAA0 /* UIButton+EnlargeTouchArea.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD19DA62E9CDF980069DAA0 /* UIButton+EnlargeTouchArea.m */; }; 4CD19E952E9CDF980069DAA0 /* MSBaseRTLFlowLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD19D632E9CDF980069DAA0 /* MSBaseRTLFlowLayout.m */; }; - 4CD19E962E9CDF980069DAA0 /* XPShareView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD19D802E9CDF980069DAA0 /* XPShareView.m */; }; 4CD19E972E9CDF980069DAA0 /* QEmotion.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD19D452E9CDF980069DAA0 /* QEmotion.m */; }; 4CD19E982E9CDF980069DAA0 /* AdvertiseModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD19C952E9CDF980069DAA0 /* AdvertiseModel.m */; }; 4CD19E992E9CDF980069DAA0 /* XPSVGAPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD19D832E9CDF980069DAA0 /* XPSVGAPlayer.m */; }; @@ -1656,7 +1652,6 @@ E8F63CB4298B563D00B338BA /* Api+SayHello.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F63CB3298B563D00B338BA /* Api+SayHello.m */; }; E8F63CB7298B566D00B338BA /* XPSessionSayHelloPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F63CB6298B566D00B338BA /* XPSessionSayHelloPresenter.m */; }; E8F63CBB298B648300B338BA /* SessionSayHelloListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F63CBA298B648300B338BA /* SessionSayHelloListModel.m */; }; - E8F65C1F286998C9009BB5B9 /* XPMineShareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F65C1E286998C9009BB5B9 /* XPMineShareViewController.m */; }; E8F65C222869A36F009BB5B9 /* ContentShareMonentsModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F65C212869A36F009BB5B9 /* ContentShareMonentsModel.m */; }; F1D8556F2931FC86008C418F /* XPRoomYearActivityView.m in Sources */ = {isa = PBXBuildFile; fileRef = F1D8556E2931FC86008C418F /* XPRoomYearActivityView.m */; }; /* End PBXBuildFile section */ @@ -2921,14 +2916,6 @@ 4CD19D732E9CDF980069DAA0 /* UITextView+MSRTL.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UITextView+MSRTL.m"; sourceTree = ""; }; 4CD19D742E9CDF980069DAA0 /* YYLabel+MSRTL.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "YYLabel+MSRTL.h"; sourceTree = ""; }; 4CD19D752E9CDF980069DAA0 /* YYLabel+MSRTL.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "YYLabel+MSRTL.m"; sourceTree = ""; }; - 4CD19D772E9CDF980069DAA0 /* XPShareInfoModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPShareInfoModel.h; sourceTree = ""; }; - 4CD19D782E9CDF980069DAA0 /* XPShareInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPShareInfoModel.m; sourceTree = ""; }; - 4CD19D792E9CDF980069DAA0 /* XPShareItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPShareItem.h; sourceTree = ""; }; - 4CD19D7A2E9CDF980069DAA0 /* XPShareItem.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPShareItem.m; sourceTree = ""; }; - 4CD19D7C2E9CDF980069DAA0 /* XPShareItemCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPShareItemCell.h; sourceTree = ""; }; - 4CD19D7D2E9CDF980069DAA0 /* XPShareItemCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPShareItemCell.m; sourceTree = ""; }; - 4CD19D7F2E9CDF980069DAA0 /* XPShareView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPShareView.h; sourceTree = ""; }; - 4CD19D802E9CDF980069DAA0 /* XPShareView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPShareView.m; sourceTree = ""; }; 4CD19D822E9CDF980069DAA0 /* XPSVGAPlayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSVGAPlayer.h; sourceTree = ""; }; 4CD19D832E9CDF980069DAA0 /* XPSVGAPlayer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPSVGAPlayer.m; sourceTree = ""; }; 4CD19D852E9CDF980069DAA0 /* XPSwitch.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSwitch.h; sourceTree = ""; }; @@ -4805,8 +4792,6 @@ E8F63CB8298B5F3D00B338BA /* XPSessionSayHelloProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSessionSayHelloProtocol.h; sourceTree = ""; }; E8F63CB9298B648300B338BA /* SessionSayHelloListModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SessionSayHelloListModel.h; sourceTree = ""; }; E8F63CBA298B648300B338BA /* SessionSayHelloListModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SessionSayHelloListModel.m; sourceTree = ""; }; - E8F65C1D286998C9009BB5B9 /* XPMineShareViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineShareViewController.h; sourceTree = ""; }; - E8F65C1E286998C9009BB5B9 /* XPMineShareViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineShareViewController.m; sourceTree = ""; }; E8F65C202869A36F009BB5B9 /* ContentShareMonentsModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContentShareMonentsModel.h; sourceTree = ""; }; E8F65C212869A36F009BB5B9 /* ContentShareMonentsModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ContentShareMonentsModel.m; sourceTree = ""; }; ECF5B2AAE493057A3DBCCFAF /* Pods-YuMi.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YuMi.debug.xcconfig"; path = "Target Support Files/Pods-YuMi/Pods-YuMi.debug.xcconfig"; sourceTree = ""; }; @@ -6957,37 +6942,6 @@ path = MSRTL; sourceTree = ""; }; - 4CD19D7B2E9CDF980069DAA0 /* Model */ = { - isa = PBXGroup; - children = ( - 4CD19D772E9CDF980069DAA0 /* XPShareInfoModel.h */, - 4CD19D782E9CDF980069DAA0 /* XPShareInfoModel.m */, - 4CD19D792E9CDF980069DAA0 /* XPShareItem.h */, - 4CD19D7A2E9CDF980069DAA0 /* XPShareItem.m */, - ); - path = Model; - sourceTree = ""; - }; - 4CD19D7E2E9CDF980069DAA0 /* View */ = { - isa = PBXGroup; - children = ( - 4CD19D7C2E9CDF980069DAA0 /* XPShareItemCell.h */, - 4CD19D7D2E9CDF980069DAA0 /* XPShareItemCell.m */, - ); - path = View; - sourceTree = ""; - }; - 4CD19D812E9CDF980069DAA0 /* ShareView */ = { - isa = PBXGroup; - children = ( - 4CD19D7B2E9CDF980069DAA0 /* Model */, - 4CD19D7E2E9CDF980069DAA0 /* View */, - 4CD19D7F2E9CDF980069DAA0 /* XPShareView.h */, - 4CD19D802E9CDF980069DAA0 /* XPShareView.m */, - ); - path = ShareView; - sourceTree = ""; - }; 4CD19D842E9CDF980069DAA0 /* SVGA */ = { isa = PBXGroup; children = ( @@ -7140,7 +7094,6 @@ 4CD19C9A2E9CDF980069DAA0 /* Adbvertise */, 4CD19D612E9CDF980069DAA0 /* InputView */, 4CD19D762E9CDF980069DAA0 /* MSRTL */, - 4CD19D812E9CDF980069DAA0 /* ShareView */, 4CD19D842E9CDF980069DAA0 /* SVGA */, 4CD19D872E9CDF980069DAA0 /* SwitchView */, 4CD19DA42E9CDF980069DAA0 /* TTPopup */, @@ -10530,8 +10483,6 @@ E896EFA12771AE9400AD2CC1 /* XPMineFriendViewController.m */, E84CBCDF28436D3C00D43221 /* XPMineContactViewController.h */, E84CBCE028436D3C00D43221 /* XPMineContactViewController.m */, - E8F65C1D286998C9009BB5B9 /* XPMineShareViewController.h */, - E8F65C1E286998C9009BB5B9 /* XPMineShareViewController.m */, E84CBCE2284372D800D43221 /* XPRoomHalfMessageView.h */, E84CBCE3284372D800D43221 /* XPRoomHalfMessageView.m */, E8DAC5AA2858305A00012CFD /* XPRoomMessageBubbleView.h */, @@ -12029,7 +11980,6 @@ 9BE01ADA289296B500B50299 /* XPDressUpShopPresenter.m in Sources */, E8751E6628A6465A0056EF44 /* XPSailingRankSubView.m in Sources */, 9B2EA7C32804052E00ED17BF /* AnchorPKMicroView.m in Sources */, - E8F65C1F286998C9009BB5B9 /* XPMineShareViewController.m in Sources */, E85E7BAB2A4EC99300B6D00A /* XPMineChooseGiveGiftView.m in Sources */, E85E7B3D2A4EB0D300B6D00A /* XPGuildIncomeDetailCollectionViewCell.m in Sources */, 181D7F1B2726CE2A00B7C059 /* StageView.m in Sources */, @@ -12134,13 +12084,10 @@ E8412FA22779BE8F006E1101 /* XPRoomSettingViewController.m in Sources */, E89D60BD271D647A001F8895 /* XPRoomPresenter.m in Sources */, 4CD19E722E9CDF980069DAA0 /* UIButton+MSRTL.m in Sources */, - 4CD19E732E9CDF980069DAA0 /* XPShareItem.m in Sources */, 4CD19E742E9CDF980069DAA0 /* TTNewAlertView.m in Sources */, 4CD19E752E9CDF980069DAA0 /* QPhotoImageModel.m in Sources */, - 4CD19E762E9CDF980069DAA0 /* XPShareInfoModel.m in Sources */, 4CD19E772E9CDF980069DAA0 /* UITextView+MSRTL.m in Sources */, 4CD19E782E9CDF980069DAA0 /* NSMutableAttributedString+MSRTL.m in Sources */, - 4CD19E792E9CDF980069DAA0 /* XPShareItemCell.m in Sources */, 4CD19E7A2E9CDF980069DAA0 /* SexAgeLabel.m in Sources */, 4CD19E7B2E9CDF980069DAA0 /* QKeyboardManager.m in Sources */, 4CD19E7C2E9CDF980069DAA0 /* TTPopupService.m in Sources */, @@ -12169,7 +12116,6 @@ 4CD19E932E9CDF980069DAA0 /* NetImageConfig.m in Sources */, 4CD19E942E9CDF980069DAA0 /* UIButton+EnlargeTouchArea.m in Sources */, 4CD19E952E9CDF980069DAA0 /* MSBaseRTLFlowLayout.m in Sources */, - 4CD19E962E9CDF980069DAA0 /* XPShareView.m in Sources */, 4CD19E972E9CDF980069DAA0 /* QEmotion.m in Sources */, 4CD19E982E9CDF980069DAA0 /* AdvertiseModel.m in Sources */, 4CD19E992E9CDF980069DAA0 /* XPSVGAPlayer.m in Sources */, diff --git a/YuMi/Appdelegate/AppDelegate+ThirdConfig.m b/YuMi/Appdelegate/AppDelegate+ThirdConfig.m index 98052a7..abd5697 100644 --- a/YuMi/Appdelegate/AppDelegate+ThirdConfig.m +++ b/YuMi/Appdelegate/AppDelegate+ThirdConfig.m @@ -8,10 +8,8 @@ #import "AppDelegate+ThirdConfig.h" ///Third #import -#import #import #import -#import ///Tool #import "YUMIConstant.h" #import "CustomAttachmentDecoder.h" @@ -40,7 +38,6 @@ UIKIT_EXTERN NSString * adImageName; /// 初始化一些第三方配置 - (void)initThirdConfig{ [self setLanguage]; - [self configShareSDK]; [self configNIMSDK]; [self configBugly]; [self registerNot]; @@ -123,17 +120,6 @@ UIKIT_EXTERN NSString * adImageName; #endif } -- (void)configShareSDK { - -// [PILineLoginManager registerLine]; - - [ShareSDK registPlatforms:^(SSDKRegister *platformsRegister) { - ///faceBook -// [platformsRegister setupFacebookWithAppkey:@"1266232494209868" appSecret:@"c9b170b383f8be9cdf118823b8632821" displayName:YMLocalizedString(@"AppDelegate_ThirdConfig0")]; - [platformsRegister setupLineAuthType:SSDKAuthorizeTypeBoth]; - }]; -} - #pragma mark - 表情 - (void)initEmojiData { dispatch_async(dispatch_get_global_queue(0, 0), ^{ diff --git a/YuMi/CustomUI/ShareView/Model/XPShareInfoModel.h b/YuMi/CustomUI/ShareView/Model/XPShareInfoModel.h deleted file mode 100644 index aa6d5f3..0000000 --- a/YuMi/CustomUI/ShareView/Model/XPShareInfoModel.h +++ /dev/null @@ -1,55 +0,0 @@ -// -// YMShareModel.h -// YUMI -// -// Created by YUMI on 2021/11/23. -// - -#import - -NS_ASSUME_NONNULL_BEGIN -typedef NS_ENUM(NSUInteger, ShareType) { - ///分享房间 - ShareType_Room = 1, - ///分享h5 - ShareType_H5 = 2, - ///大转盘 目前没用到 - ShareType_User_Draw = 888, -}; - -@interface XPShareInfoModel : PIBaseModel -///分享的标题 -@property (nonatomic,copy) NSString *shareTitle; -///分享的内容 -@property (nonatomic,copy) NSString *shareContent; -///分享的地址 -@property (nonatomic,copy) NSString *shareUrl; -///分享图片 -@property (nonatomic,copy) NSString *shareImageUrl; -///分享图片 -@property (nonatomic,copy) UIImage *shareImage; -///分享的类型 -@property (nonatomic,assign) ShareType type; -///分享类型,1微信好友,2微信朋友圈,3QQ好友,4QQ空间 -@property (nonatomic,assign) NSInteger shareType; -///分享房间的uid -@property (nonatomic,assign) NSInteger roomUid; -#pragma mark - 动态分享 -///被分享动态的那个人 -@property (nonatomic,copy) NSString *uid; -///动态分享 -@property (nonatomic,copy) NSString *dynamicId; -///话题id -@property (nonatomic,copy) NSString *worldId; -///封面 -@property (nonatomic,copy) NSString *imageUrl; -///名称 -@property (nonatomic,copy) NSString *nick; -///发布者的uid -@property (nonatomic,copy) NSString *publishUid; -///内容 -@property (nonatomic,copy) NSString *content; - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/CustomUI/ShareView/Model/XPShareInfoModel.m b/YuMi/CustomUI/ShareView/Model/XPShareInfoModel.m deleted file mode 100644 index 648355c..0000000 --- a/YuMi/CustomUI/ShareView/Model/XPShareInfoModel.m +++ /dev/null @@ -1,12 +0,0 @@ -// -// YMShareModel.m -// YUMI -// -// Created by YUMI on 2021/11/23. -// - -#import "XPShareInfoModel.h" - -@implementation XPShareInfoModel - -@end diff --git a/YuMi/CustomUI/ShareView/Model/XPShareItem.h b/YuMi/CustomUI/ShareView/Model/XPShareItem.h deleted file mode 100644 index 211d661..0000000 --- a/YuMi/CustomUI/ShareView/Model/XPShareItem.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// YMShareItem.h -// YUMI -// -// Created by YUMI on 2021/11/23. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -typedef enum : NSUInteger { - ///微信好友 - XPShareItemTagWeChat = 1, - ///微信朋友圈 - XPShareItemTagMoments, - ///QQ好友 - XPShareItemTagQQ, - ///QQ空间 - XPShareItemTagQQZone, - ///LIne - XPShareItemTagLine, - ///FaceBook - XPShareItemTagFaceBook, - ///复制链接 - XPShareItemTagCopyLink, - ///应用好友 - XPShareItemTagAppFriends, - ///保存到相册 - XPShareItemTagAppSaveAlbum, -} XPShareItemTag; - -@interface XPShareItem : NSObject -@property(nonatomic,assign) BOOL isShareInvite; -@property (nonatomic, copy) NSString *inviteTitle; -@property (nonatomic, copy) NSString *title; -@property (nonatomic, copy) NSString *imageName; -@property (nonatomic, copy) NSString *disableImageName; -@property (nonatomic, assign) BOOL disable; -@property (nonatomic, assign) XPShareItemTag type; - -+ (instancetype)itemWitTag:(XPShareItemTag)itemTag title:(NSString *)title imageName:(NSString *)imageName disableImageName:(NSString *)disableImageName; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/CustomUI/ShareView/Model/XPShareItem.m b/YuMi/CustomUI/ShareView/Model/XPShareItem.m deleted file mode 100644 index 4a2f76a..0000000 --- a/YuMi/CustomUI/ShareView/Model/XPShareItem.m +++ /dev/null @@ -1,23 +0,0 @@ -// -// YMShareItem.m -// YUMI -// -// Created by YUMI on 2021/11/23. -// - -#import "XPShareItem.h" - -@implementation XPShareItem - -+ (instancetype)itemWitTag:(XPShareItemTag)itemTag title:(NSString *)title imageName:(NSString *)imageName disableImageName:(NSString *)disableImageName { - XPShareItem *item = [[self alloc] init]; - item.type = itemTag; - item.title = title; - item.imageName = imageName; - item.disableImageName = disableImageName; - item.disable = NO; - return item; -} - - -@end diff --git a/YuMi/CustomUI/ShareView/View/XPShareItemCell.h b/YuMi/CustomUI/ShareView/View/XPShareItemCell.h deleted file mode 100644 index d70aa25..0000000 --- a/YuMi/CustomUI/ShareView/View/XPShareItemCell.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// YMShareItemCell.h -// YMRoomMoudle -// -// Created by YUMI on 2022/9/2. -// Copyright © 2023 YUMI. All rights reserved. -// - -#import -#import "XPShareItem.h" - -@interface XPShareItemCell : UICollectionViewCell - -@property (nonatomic, strong) XPShareItem *shareItem; - -@end diff --git a/YuMi/CustomUI/ShareView/View/XPShareItemCell.m b/YuMi/CustomUI/ShareView/View/XPShareItemCell.m deleted file mode 100644 index 6a56068..0000000 --- a/YuMi/CustomUI/ShareView/View/XPShareItemCell.m +++ /dev/null @@ -1,78 +0,0 @@ -// -// YMShareItemCell.m -// YMRoomMoudle -// -// Created by YUMI on 2022/9/2. -// Copyright © 2023 YUMI. All rights reserved. -// - -#import "XPShareItemCell.h" -#import "DJDKMIMOMColor.h" -#import - -@interface XPShareItemCell() - -@property (nonatomic, strong) UIImageView *iconImageView; -@property (nonatomic, strong) UILabel *titleLabel; - -@end - -@implementation XPShareItemCell - -#pragma mark - Life Style -- (instancetype)initWithFrame:(CGRect)frame{ - if (self=[super initWithFrame:frame]) { - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; -} -#pragma mark - Private Method -- (void)initSubViews{ - [self.contentView addSubview:self.iconImageView]; - [self.contentView addSubview:self.titleLabel]; - -} -- (void)initSubViewConstraints{ - CGFloat wh = 30; - [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.height.equalTo(@(wh)); - make.top.equalTo(self.contentView); - make.centerX.equalTo(self.contentView); - }]; - [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.trailing.leading.equalTo(self.contentView).inset(5); - make.top.equalTo(self.iconImageView.mas_bottom).offset(10); - }]; -} - -#pragma mark - Getters And Setters -- (void)setShareItem:(XPShareItem *)shareItem{ - _shareItem = shareItem; - self.userInteractionEnabled = shareItem.disable; - if (!shareItem.disable) { - self.iconImageView.image = [UIImage imageNamed:shareItem.disableImageName]; - }else{ - self.iconImageView.image = [UIImage imageNamed:shareItem.imageName]; - } - self.titleLabel.text = shareItem.title; -} - - -- (UIImageView *)iconImageView{ - if (!_iconImageView) { - _iconImageView = [[UIImageView alloc] init]; - } - return _iconImageView; -} -- (UILabel *)titleLabel{ - if (!_titleLabel) { - _titleLabel = [[UILabel alloc] init]; - _titleLabel.textColor = [DJDKMIMOMColor alertMessageColor]; - _titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:12]; - _titleLabel.numberOfLines = 2; - _titleLabel.textAlignment = NSTextAlignmentCenter; - } - return _titleLabel; -} -@end diff --git a/YuMi/CustomUI/ShareView/XPShareView.h b/YuMi/CustomUI/ShareView/XPShareView.h deleted file mode 100644 index 6b92871..0000000 --- a/YuMi/CustomUI/ShareView/XPShareView.h +++ /dev/null @@ -1,34 +0,0 @@ -// -// XCShareView.h -// XCRoomMoudle -// -// Created by KevinWang on 2018/9/2. -// Copyright © 2018年 YiZhuan. All rights reserved. -// - -#import -#import "XPShareItem.h" -#import "XPShareInfoModel.h" - -@class XPShareView; -@protocol XCShareViewDelegate -@optional -///点击保存图片到相册 -- (void)shareView:(XPShareView *)shareView savePhoto:(XPShareInfoModel *)shareInfo; -///点了取消分享 -- (void)shareViewDidClickCancel:(XPShareView *)shareView; -///分享成功 -- (void)shareView:(XPShareView *)shareView didSuccess:(XPShareInfoModel *)shareInfo; -///分享失败 -- (void)shareView:(XPShareView *)shareView shareFail:(NSString *)message; -@end; - -@interface XPShareView : UIView - -@property (nonatomic, weak) id delegate; -@property (nonatomic,assign) BOOL isFromWebVeiw; - - -- (instancetype)initWithItems:(NSArray *)items itemSize:(CGSize)itemSize shareInfo:(XPShareInfoModel *)shareInfo; - -@end diff --git a/YuMi/CustomUI/ShareView/XPShareView.m b/YuMi/CustomUI/ShareView/XPShareView.m deleted file mode 100644 index fa3282e..0000000 --- a/YuMi/CustomUI/ShareView/XPShareView.m +++ /dev/null @@ -1,329 +0,0 @@ -// -// XCShareView.m -// XCRoomMoudle -// -// Created by KevinWang on 2018/9/2. -// Copyright © 2018年 YiZhuan. All rights reserved. -// - -#import "XPShareView.h" -///Third -#import -#import -#import -#import -#import "XCCurrentVCStackManager.h" -///Tool -#import "TTPopup.h" - -///View -#import "XPShareItemCell.h" -#import "XPMineShareViewController.h" -#import "ClientConfig.h" - -@interface XPShareView() -///取消 -@property (nonatomic, strong) UIButton *cancleButton; -///列表 -@property (nonatomic, strong) UICollectionView *collectionView; -///数据源 -@property (nonatomic, strong) NSArray *items; -///item的大小 -@property (nonatomic,assign) CGSize itemSize; -///分享的内容 -@property (nonatomic,strong) XPShareInfoModel *shareInfo; -@end - -@implementation XPShareView - -#pragma mark - Life Style -- (instancetype)initWithItems:(NSArray *)items itemSize:(CGSize)itemSize shareInfo:(XPShareInfoModel *)shareInfo { - if (self = [super init]) { - for (XPShareItem * item in items) { - if (item.type == XPShareItemTagAppFriends || item.type == XPShareItemTagCopyLink) { - item.disable = YES; - } else { - item.disable = [self isInstallClient:[self getSharePlatformType:item.type]]; - } - } - self.items = [NSMutableArray arrayWithArray:items]; - self.itemSize =itemSize; - self.shareInfo = shareInfo; - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; -} - -#pragma mark - Private Method -- (void)initSubViews { - [self addSubview:self.collectionView]; - [self addSubview:self.cancleButton]; -} - -- (void)initSubViewConstraints { - - CGFloat collectionWidth = KScreenWidth - 15 * 2; - ///一行有几个 - int numberLine = collectionWidth / self.itemSize.width; - int page = self.items.count % numberLine > 0 ? (int)self.items.count / numberLine + 1 : (int)self.items.count / numberLine; - CGFloat collectionHeight = page * self.itemSize.height + 20 + (page-1) * 10 + 10; - [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self); - make.height.mas_equalTo(collectionHeight); - make.leading.trailing.mas_equalTo(self).inset(15); - }]; - - [self.cancleButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.height.mas_equalTo(45); - make.leading.trailing.mas_equalTo(self.collectionView); - make.top.mas_equalTo(self.collectionView.mas_bottom).offset(15); - }]; - - [self mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(KScreenWidth); - make.bottom.mas_equalTo(self.cancleButton.mas_bottom).offset(30); - }]; -} - - -- (BOOL)isInstallClient:(SSDKPlatformType)platform { - return [ShareSDK isClientInstalled:platform]; -} - -- (SSDKPlatformType)getSharePlatformType:(XPShareItemTag)itemTag { - SSDKPlatformType type; - switch (itemTag) { - case XPShareItemTagFaceBook: - type = SSDKPlatformTypeFacebook; - break; - case XPShareItemTagLine: - type = SSDKPlatformTypeLine; - break; - default: - type = SSDKPlatformTypeUnknown; - break; - } - return type; -} - -#pragma mark - UICollectionViewDelegate -- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ - return self.items.count; -} -- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ - XPShareItemCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPShareItemCell class]) forIndexPath:indexPath]; - XPShareItem * item = [self.items xpSafeObjectAtIndex:indexPath.item]; - item.disable = YES; - cell.shareItem = item; - return cell; -} -- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ - [collectionView deselectItemAtIndexPath:indexPath animated:YES]; - - NSMutableDictionary *shareParams = [NSMutableDictionary dictionary]; - NSString * title = [self.shareInfo shareTitle].length > 0 ? self.shareInfo.shareTitle : @""; - NSString * content = self.shareInfo.shareContent.length > 0 ? self.shareInfo.shareContent : @""; - NSString * urlString = self.shareInfo.shareUrl.length > 0 ?self.shareInfo.shareUrl : @""; - if ([urlString containsString:@"?"]){ - urlString = [NSString stringWithFormat:@"%@&lang=%@",urlString,[NSBundle uploadLanguageText]]; - }else{ - urlString = [NSString stringWithFormat:@"%@?lang=%@",urlString,[NSBundle uploadLanguageText]]; - } - - NSString *encodedUrl = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; - - XPShareItem * item = [self.items xpSafeObjectAtIndex:indexPath.item]; - if (item == nil){ - [TTPopup dismiss]; - return; - }; - if (item.type == XPShareItemTagAppSaveAlbum){ - [TTPopup dismiss]; - if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:savePhoto:)]){ - [self.delegate shareView:self savePhoto:self.shareInfo]; - } - return; - } - if (item.type == XPShareItemTagAppFriends) { - [TTPopup dismiss]; - XPMineShareViewController * shareVC = [[XPMineShareViewController alloc] init]; - shareVC.shareType = MineShareType_Monents; - shareVC.shareInfo = self.shareInfo; - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:shareVC animated:YES]; - return; - } else if(item.type == XPShareItemTagCopyLink) { - NSString * urlString = self.shareInfo.shareUrl; - UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; - [pasteboard setString:urlString]; - [XNDJTDDLoadingTool showSuccessWithMessage:YMLocalizedString(@"XPShareView0")]; - - [TTPopup dismiss]; - return; - } - if([self isInstallClient:[self getSharePlatformType:item.type]] == NO){ - [XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPShareView9")]; - [TTPopup dismiss]; - return; - } - - // 添加类型安全检查,防止NSTaggedPointerString错误 - if ([self.shareInfo isKindOfClass:[XPShareInfoModel class]] && [item isKindOfClass:[XPShareItem class]]) { - self.shareInfo.shareType = item.type; - } else { - NSLog(@"警告:self.shareInfo不是XPShareInfoModel类型,而是%@类型", NSStringFromClass([self.shareInfo class])); - [TTPopup dismiss]; - return; - } - - SSDKPlatformType platformType = SSDKPlatformTypeCopy; - - if (item.type == XPShareItemTagLine) { - title = YMLocalizedString(@"XPShareView1"); - platformType = SSDKPlatformTypeLine; - if (![ShareSDK isClientInstalled:platformType]) { - [XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPShareView2")]; - return; - } - NSString*contentKey= [encodedUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet]; - NSString*contentType =@"text"; - NSString*urlString = [NSString stringWithFormat:@"line://msg/%@/%@",contentType, contentKey]; - - [[UIApplication sharedApplication]openURL:[NSURL URLWithString:urlString] options:@{} completionHandler:^(BOOL success) { - - }]; - - if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:didSuccess:)]) { - [self.delegate shareView:self didSuccess:self.shareInfo]; - } - return; - - } - if(item.type == XPShareItemTagFaceBook){ - FBSDKShareLinkContent*linkContent = [[FBSDKShareLinkContent alloc]init]; - urlString = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]]; - linkContent.contentURL= [NSURL URLWithString:urlString]; - linkContent.quote = content; - FBSDKShareDialog *shareDialog = [[FBSDKShareDialog alloc]initWithViewController:[XCCurrentVCStackManager shareManager].getCurrentVC content:linkContent delegate:self]; - // 需要指定模式,否则会调起web分享 - shareDialog.mode = FBSDKShareDialogModeNative; - if (![shareDialog canShow]) { - shareDialog.mode = FBSDKShareDialogModeWeb; - } - - - [shareDialog show]; - return; - } - - [ShareSDK share:platformType parameters:shareParams onStateChanged:^(SSDKResponseState state, NSDictionary *userData, SSDKContentEntity *contentEntity, NSError *error) { - switch (state) { - case SSDKResponseStateSuccess: - { - if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:didSuccess:)]) { - [self.delegate shareView:self didSuccess:self.shareInfo]; - } - } - break; - case SSDKResponseStateFail: - { - if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:shareFail:)]) { - [self.delegate shareView:self shareFail:YMLocalizedString(@"XPShareView5")]; - } - } - break; - case SSDKResponseStateCancel: - { - if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:shareFail:)]) { - [self.delegate shareView:self shareFail:YMLocalizedString(@"XPShareView6")]; - } - } - break; - default: - break; - } - }]; -} -#pragma mark - FBSDKSharingDelegate -/// Sent to the delegate when sharing completes without error or cancellation. -/// @param sharer The sharer that completed. -/// @param results The results from the sharer. This may be nil or empty. -- (void)sharer:(id _Nonnull)sharer didCompleteWithResults:(NSDictionary * _Nonnull)results{ - NSString *postId = results[@"postId"]; - FBSDKShareDialog *dialog = (FBSDKShareDialog *)sharer; - if (dialog.mode == FBSDKShareDialogModeBrowser && (postId == nil || [postId isEqualToString:@""])) { - // 如果使用webview分享的,但postId是空的, - // 这种情况是用户点击了『完成』按钮,并没有真的分享 - if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:shareFail:)]) { - [self.delegate shareView:self shareFail:YMLocalizedString(@"XPShareView6")]; - } - } else { - if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:didSuccess:)]) { - [self.delegate shareView:self didSuccess:self.shareInfo]; - } - } -} -/// Sent to the delegate when the sharer encounters an error. -/// @param sharer The sharer that completed. -/// @param error The error. -- (void)sharer:(id _Nonnull)sharer didFailWithError:(NSError * _Nonnull)error{ - FBSDKShareDialog *dialog = (FBSDKShareDialog *)sharer; - if (error == nil && dialog.mode == FBSDKShareDialogModeNative) { - // 如果使用原生登录失败,但error为空,那是因为用户没有安装Facebook app - // 重设dialog的mode,再次弹出对话框 - dialog.mode = FBSDKShareDialogModeBrowser; - [dialog show]; - } else { - if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:shareFail:)]) { - [self.delegate shareView:self shareFail:YMLocalizedString(@"XPShareView5")]; - } - } -} -/// Sent to the delegate when the sharer is cancelled. -/// @param sharer The sharer that completed. -- (void)sharerDidCancel:(id _Nonnull)sharer{ - if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:shareFail:)]) { - [self.delegate shareView:self shareFail:YMLocalizedString(@"XPShareView6")]; - } -} -#pragma mark - Event Response -- (void)cancleButtonDidClck:(UIButton *)button{ - if (self.delegate && [self.delegate respondsToSelector:@selector(shareViewDidClickCancel:)]) { - [self.delegate shareViewDidClickCancel:self]; - } -} - -#pragma mark - Getters And Setters -- (UICollectionView *)collectionView{ - if (!_collectionView) { - MSBaseRTLFlowLayout *layout = [[MSBaseRTLFlowLayout alloc] init]; - layout.itemSize = self.itemSize; - layout.minimumInteritemSpacing = 0; - layout.minimumLineSpacing = 10; - layout.sectionInset = UIEdgeInsetsMake(20, 0, 10, 0); - _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; - _collectionView.backgroundColor = [UIColor whiteColor]; - _collectionView.dataSource = self; - _collectionView.delegate = self; - _collectionView.layer.masksToBounds = YES; - _collectionView.layer.cornerRadius = 15; - [_collectionView registerClass:[XPShareItemCell class] forCellWithReuseIdentifier:NSStringFromClass([XPShareItemCell class])]; - } - return _collectionView; -} - -- (UIButton *)cancleButton{ - if (!_cancleButton) { - _cancleButton = [[UIButton alloc] init]; - [_cancleButton setBackgroundColor:[UIColor whiteColor]]; - [_cancleButton setTitle:YMLocalizedString(@"XPShareView7") forState:UIControlStateNormal]; - _cancleButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15]; - _cancleButton.layer.masksToBounds = YES; - _cancleButton.layer.cornerRadius = 45/2; - [_cancleButton setTitleColor:[DJDKMIMOMColor textThirdColor] forState:UIControlStateNormal]; - [_cancleButton addTarget:self action:@selector(cancleButtonDidClck:) forControlEvents:UIControlEventTouchUpInside]; - } - return _cancleButton; -} - -@end diff --git a/YuMi/Modules/YMLogin/Presenter/LoginPresenter.m b/YuMi/Modules/YMLogin/Presenter/LoginPresenter.m index 197ca4d..1f39441 100644 --- a/YuMi/Modules/YMLogin/Presenter/LoginPresenter.m +++ b/YuMi/Modules/YMLogin/Presenter/LoginPresenter.m @@ -8,7 +8,6 @@ #import "LoginPresenter.h" ///Third #import -#import ///APi #import "Api+Login.h" ///Tool @@ -56,75 +55,7 @@ static NSString *clinet_s = @"uyzjdhds"; /// 第三方登录 /// @param type 登录的类型 - (void)thirdLoginWithType:(ThirdLoginType)type{ - - SSDKPlatformType platformType; - switch (type) { - case ThirdLoginType_FB: - platformType = SSDKPlatformTypeFacebook; - break; - case ThirdLoginType_Line: - platformType = SSDKPlatformTypeLine; - break; - case ThirdLoginType_Apple: - platformType = SSDKPlatformTypeAppleAccount; - break; - case ThirdLoginType_Gmail: - platformType = SSDKPlatformTypeGooglePlus; - break; - default: - platformType = SSDKPlatformTypeAppleAccount; - break; - } - NSDictionary * settings; - if (type == SSDKPlatformTypeFacebook) { - settings = @{@"isBrowser":@(YES)}; - } - @kWeakify(self); - [ShareSDK cancelAuthorize:platformType result:nil]; - [ShareSDK authorize:platformType - settings:settings - onStateChanged:^(SSDKResponseState state, SSDKUser *user, NSError *error) { - @kStrongify(self); - if (state == SSDKResponseStateSuccess) {///成功 - ThirdUserInfo * userInfo = [[ThirdUserInfo alloc] init]; - NSString * openid = @""; - NSString * access_token = user.credential.token.length > 0 ? user.credential.token : @""; - NSString * unionid = @""; - if (platformType == SSDKPlatformTypeLine) { - openid = user.credential.uid.length > 0 ? user.credential.uid : user.uid; - unionid = user.credential.uid.length > 0 ? user.credential.uid : user.uid; - userInfo.userName = user.nickname; - userInfo.avatarUrl = user.icon; - } else if (platformType == SSDKPlatformTypeFacebook) { //微信登录 - openid = user.credential.uid.length > 0 ? user.credential.uid : user.uid;; - unionid = user.credential.uid.length > 0 ? user.credential.uid : user.uid;; - userInfo.userName = user.nickname; - userInfo.avatarUrl = user.icon; - } else if (platformType == SSDKPlatformTypeAppleAccount) { //苹果登录 - // openid = user.credential.token; - unionid = [user.credential rawData][@"user"]; - NSString * familyName = [user.credential rawData][@"fullName"][@"familyName"]; - NSString * givenName = [user.credential rawData][@"fullName"][@"givenName"]; - if (familyName.length > 0 && givenName.length> 0) { - userInfo.userName = [NSString stringWithFormat:@"%@%@", familyName, givenName]; - } - } - if (unionid == nil) { - unionid = @""; - } - openid = unionid; - userInfo.openid = openid; - userInfo.access_token = access_token; - userInfo.unionid = unionid; - ///保存一下第三方的值 - [AccountInfoStorage instance].thirdUserInfo = userInfo; - [self loginWithThirdPartWithType:type]; - } else if(state == SSDKResponseStateCancel) {///取消 - [[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter0")]; - } else if (state == SSDKResponseStateFail) {///失败 - [[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter1")]; - } - }]; + // TODO: 后续补充 Apple Login } -(void)loginWithThirdPartWithType:(ThirdLoginType)type{ [XNDJTDDLoadingTool showOnlyView:kWindow]; diff --git a/YuMi/Modules/YMMine/View/Friend/XPMineShareViewController.h b/YuMi/Modules/YMMine/View/Friend/XPMineShareViewController.h deleted file mode 100644 index 81db222..0000000 --- a/YuMi/Modules/YMMine/View/Friend/XPMineShareViewController.h +++ /dev/null @@ -1,24 +0,0 @@ -// -// YMMineShareViewController.h -// YUMI -// -// Created by YUMI on 2022/6/27. -// - -#import "BaseViewController.h" - -NS_ASSUME_NONNULL_BEGIN -@class XPShareInfoModel; - -typedef NS_ENUM(NSInteger, MineShareType) { - ///分享动态 - MineShareType_Monents = 1, -}; - -@interface XPMineShareViewController : BaseViewController -@property (nonatomic,strong) XPShareInfoModel *shareInfo; -///分享的类型 -@property (nonatomic,assign) MineShareType shareType; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMine/View/Friend/XPMineShareViewController.m b/YuMi/Modules/YMMine/View/Friend/XPMineShareViewController.m deleted file mode 100644 index 7239033..0000000 --- a/YuMi/Modules/YMMine/View/Friend/XPMineShareViewController.m +++ /dev/null @@ -1,232 +0,0 @@ -// -// YMMineShareViewController.m -// YUMI -// -// Created by YUMI on 2022/6/27. -// - -#import "XPMineShareViewController.h" -///Third -#import -#import -#import -#import -///Tool -#import "DJDKMIMOMColor.h" -#import "YUMIMacroUitls.h" -#import "TTPopup.h" -///Model -#import "XPShareInfoModel.h" -#import "FansInfoModel.h" -#import "UserInfoModel.h" -#import "AttachMentModel.h" -#import "ContentShareMonentsModel.h" -///View -#import "SessionViewController.h" -#import "SessionListViewController.h" -#import "XPMineFriendViewController.h" -#import "XPMineAttentionViewController.h" -#import "XPMineFansViewController.h" -@interface XPMineShareViewController () -///标题 -@property (nonatomic,strong) NSArray *titles; -///滑块 -@property (nonatomic,strong) JXCategoryTitleView *titleView; -@property (nonatomic, strong) JXCategoryListContainerView *listContainerView; -///好友 -@property (nonatomic,strong) XPMineFriendViewController *friendVC; -///关注 -@property (nonatomic,strong) XPMineAttentionViewController *attentionVC; -///粉丝 -@property (nonatomic,strong) XPMineFansViewController *fansVC; -///回话的id -@property (nonatomic,copy) NSString *sessionId; -@end - -@implementation XPMineShareViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - [self initSubViews]; - [self initSubViewConstraints]; -} - -#pragma mark - Private Method -- (void)initSubViews { - self.title = YMLocalizedString(@"XPMineShareViewController0"); - [self.view addSubview:self.titleView]; - [self.view addSubview:self.listContainerView]; -} - -- (void)initSubViewConstraints { - [self.titleView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.top.mas_equalTo(self.view); - make.height.mas_equalTo(50); - }]; - - [self.listContainerView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.bottom.mas_equalTo(self.view); - make.top.mas_equalTo(self.titleView.mas_bottom); - }]; -} - -- (void)sendCustomMessage:(AttachmentModel *)attachment { - NIMMessage *message = [[NIMMessage alloc]init]; - NIMCustomObject *object = [[NIMCustomObject alloc] init]; - object.attachment = attachment; - message.messageObject = object; - NIMSessionType sessionType = NIMSessionTypeP2P; - //构造会话 - NIMSession *session = [NIMSession session:self.sessionId type:sessionType]; - [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session error:nil]; -} - -- (void)shareToUser:(NSString *)nick { - NSString * title; - AttachmentModel * attachment = [[AttachmentModel alloc] init]; - - // 添加类型安全检查 - if (![self.shareInfo isKindOfClass:[XPShareInfoModel class]]) { - NSLog(@"警告:self.shareInfo不是XPShareInfoModel类型,而是%@类型", NSStringFromClass([self.shareInfo class])); - return; - } - - switch (self.shareType) { - case MineShareType_Monents: - { - title = [NSString stringWithFormat:YMLocalizedString(@"XPMineShareViewController1"), nick]; - attachment.first = CustomMessageType_Monents; - attachment.second = Custom_Message_Sub_Monents_Share; - ContentShareMonentsModel * shareInfo = [[ContentShareMonentsModel alloc] init]; - shareInfo.imageUrl = self.shareInfo.imageUrl; - shareInfo.nick = self.shareInfo.nick; - shareInfo.content = self.shareInfo.content; - shareInfo.dynamicId= self.shareInfo.dynamicId; - shareInfo.routerValue = self.shareInfo.dynamicId; - shareInfo.routerType = 50; - attachment.data = shareInfo.model2dictionary; - } - - break; - - default: - break; - } - if (title.length > 0) { - [TTPopup alertWithMessage:title confirmHandler:^{ - [self sendCustomMessage:attachment]; - } cancelHandler:^{ - - }]; - } -} - -#pragma mark - JXCategoryListContainerViewDelegate -- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView { - return self.titles.count; -} - -// 根据下标 index 返回对应遵守并实现 `JXCategoryListContentViewDelegate` 协议的列表实例 -- (id)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index { - if (index == 0) { - return self.friendVC; - } else if(index == 1) { - return self.fansVC; - } else { - return self.attentionVC; - } -} - -#pragma mark - XPMineAttentionViewControllerDelegate -///点击了关注的某个人 -- (void)xPMineAttentionViewController:(XPMineAttentionViewController *)viewController didSelectItem:(FansInfoModel *)userInfo { - self.sessionId = userInfo.uid; - [self shareToUser:userInfo.nick]; -} - -#pragma mark - XPMineFansViewControllerDelegate -///点击了粉丝 -- (void)xPMineFansViewController:(XPMineFansViewController *)view didSelectItem:(FansInfoModel *)userInfo { - self.sessionId = userInfo.uid; - [self shareToUser:userInfo.nick]; -} - -#pragma mark - XPMineFriendViewControllerDelegate -///点击了好友 -- (void)xPMineFriendViewController:(XPMineFriendViewController *)viewController didSelectItem:(UserInfoModel *)userInfo { - self.sessionId = [NSString stringWithFormat:@"%ld", userInfo.uid]; - [self shareToUser:userInfo.nick]; -} - -#pragma mark - Getters And Setters - -- (JXCategoryListContainerView *)listContainerView { - if (!_listContainerView) { - _listContainerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self]; - _listContainerView.listCellBackgroundColor = [UIColor clearColor]; - } - return _listContainerView; -} - -- (NSArray *)titles { - if (!_titles) { - _titles = @[YMLocalizedString(@"XPMonentsTooBarView3"),YMLocalizedString(@"XPMineContactViewController3"), YMLocalizedString(@"XPMineShareViewController4")]; - } - return _titles; -} - -- (JXCategoryTitleView *)titleView { - if (!_titleView) { - _titleView = [[JXCategoryTitleView alloc] initWithFrame:CGRectZero]; - _titleView.backgroundColor =[UIColor clearColor]; - _titleView.titleColor = UIColorFromRGB(0x444444); - _titleView.titleSelectedColor = [DJDKMIMOMColor mainTextColor]; - _titleView.titleFont = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold]; - _titleView.titleSelectedFont = [UIFont systemFontOfSize:18 weight:UIFontWeightHeavy]; - _titleView.titleLabelAnchorPointStyle = JXCategoryTitleLabelAnchorPointStyleCenter; - _titleView.contentScrollViewClickTransitionAnimationEnabled = NO; - _titleView.averageCellSpacingEnabled = NO; - _titleView.defaultSelectedIndex = 0; - _titleView.titles = self.titles; - _titleView.delegate = self; - _titleView.cellSpacing = 0; - _titleView.cellWidth = (CGFloat)KScreenWidth/ 3.0; - _titleView.listContainer = self.listContainerView; - - JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init]; - lineView.indicatorColor = [DJDKMIMOMColor appMainColor]; - lineView.indicatorWidth = 8.f; - lineView.indicatorHeight = 4.f; - lineView.indicatorCornerRadius = 2.f; - _titleView.indicators = @[lineView]; - } - return _titleView; -} - -- (XPMineAttentionViewController *)attentionVC { - if (!_attentionVC) { - _attentionVC = [[XPMineAttentionViewController alloc] init]; - _attentionVC.type = ContactUseingType_Share; - _attentionVC.delegate = self; - } - return _attentionVC; -} - -- (XPMineFriendViewController *)friendVC { - if (!_friendVC) { - _friendVC = [[XPMineFriendViewController alloc] init]; - _friendVC.type = ContactUseingType_Share; - _friendVC.delegate = self; - } - return _friendVC; -} - -- (XPMineFansViewController *)fansVC { - if (!_fansVC) { - _fansVC = [[XPMineFansViewController alloc] init]; - _fansVC.type = ContactUseingType_Share; - _fansVC.delegate = self; - } - return _fansVC; -} -@end diff --git a/YuMi/Modules/YMRoom/View/ArrangeMic/View/XPArrangeMicViewController.m b/YuMi/Modules/YMRoom/View/ArrangeMic/View/XPArrangeMicViewController.m index 80809ac..53476fd 100644 --- a/YuMi/Modules/YMRoom/View/ArrangeMic/View/XPArrangeMicViewController.m +++ b/YuMi/Modules/YMRoom/View/ArrangeMic/View/XPArrangeMicViewController.m @@ -26,12 +26,11 @@ ///View #import "XPArrangeMicEmptyTableViewCell.h" #import "XPArrangeMicTableViewCell.h" -#import "XPShareView.h" ///P #import "XPArrangeMicPresenter.h" #import "XPArrangeMicProtocol.h" -@interface XPArrangeMicViewController () +@interface XPArrangeMicViewController () ///点击消失 @property (nonatomic,strong) UIView * topView; ///内容区域 @@ -348,7 +347,7 @@ if (message.messageType == NIMMessageTypeCustom) { NIMCustomObject *obj = (NIMCustomObject *)message.messageObject; if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) { - AttachmentModel * attachment = obj.attachment; + AttachmentModel * attachment = (AttachmentModel *)obj.attachment; if (attachment.first == CustomMessageType_Arrange_Mic) { switch (attachment.second) { case Custom_Message_Sub_Room_PK_Empty: @@ -553,19 +552,6 @@ self.titleLabel.textAlignment = NSTextAlignmentCenter; } -#pragma mark - XCShareViewDelegate -- (void)shareView:(XPShareView *)shareView shareFail:(NSString *)message { - [TTPopup dismiss]; - [self showErrorToast:message]; -} - -- (void)shareView:(XPShareView *)shareView didSuccess:(XPShareInfoModel *)shareInfo{ - [TTPopup dismiss]; -} - -- (void)shareViewDidClickCancel:(XPShareView *)shareView { - [TTPopup dismiss]; -} #pragma mark - XPArrangeMicTableViewCellDelegate - (void)xPArrangeMicTableViewCell:(XPArrangeMicTableViewCell *)view inviteUser:(ArrangeMicUserModel *)userInfo { @@ -664,24 +650,24 @@ self.userInfo.isManager = NO; #endif if (self.userInfo.isManager) { - XPShareItem *cycle = [XPShareItem itemWitTag:XPShareItemTagFaceBook title:@"FaceBook" imageName:@"share_fb" disableImageName:@"share_fb"]; - XPShareItem *wechat = [XPShareItem itemWitTag:XPShareItemTagLine title:@"Line" imageName:@"share_line" disableImageName:@"share_line"]; - XPShareItem *qq = [XPShareItem itemWitTag:XPShareItemTagCopyLink title:YMLocalizedString(@"RoomHeaderView3") imageName:@"share_copy_link" disableImageName:@"share_copy_link"]; - NSArray * items = @[wechat,cycle, qq]; - XPShareInfoModel * shareInfo = [[XPShareInfoModel alloc] init]; - shareInfo.shareTitle = self.userInfo.roomTitle; - shareInfo.shareContent = self.userInfo.nick; - shareInfo.shareImageUrl = self.userInfo.roomAvatar; - shareInfo.type = ShareType_Room; - shareInfo.roomUid = self.userInfo.roomUid.integerValue; - NSString * uid = [AccountInfoStorage instance].getUid; - NSString * urlString = [NSString stringWithFormat:@"%@/%@?shareUid=%@&uid=%@&room_name=%@&room_id=%@&room_avatar=%@&share_name=%@",[HttpRequestHelper getHostUrl],URLWithType(kShareRoomURL),uid,self.userInfo.roomUid,self.userInfo.nick,self.userInfo.roomId,self.userInfo.roomAvatar,self.userInfo.nick]; - shareInfo.shareUrl = urlString; - CGFloat margin = 15; - CGSize itemSize = CGSizeMake((KScreenWidth-2*margin)/4, 65); - XPShareView *shareView = [[XPShareView alloc] initWithItems:items itemSize:itemSize shareInfo:shareInfo]; - shareView.delegate = self; - [TTPopup popupView:shareView style:TTPopupStyleActionSheet]; +// XPShareItem *cycle = [XPShareItem itemWitTag:XPShareItemTagFaceBook title:@"FaceBook" imageName:@"share_fb" disableImageName:@"share_fb"]; +// XPShareItem *wechat = [XPShareItem itemWitTag:XPShareItemTagLine title:@"Line" imageName:@"share_line" disableImageName:@"share_line"]; +// XPShareItem *qq = [XPShareItem itemWitTag:XPShareItemTagCopyLink title:YMLocalizedString(@"RoomHeaderView3") imageName:@"share_copy_link" disableImageName:@"share_copy_link"]; +// NSArray * items = @[wechat,cycle, qq]; +// XPShareInfoModel * shareInfo = [[XPShareInfoModel alloc] init]; +// shareInfo.shareTitle = self.userInfo.roomTitle; +// shareInfo.shareContent = self.userInfo.nick; +// shareInfo.shareImageUrl = self.userInfo.roomAvatar; +// shareInfo.type = ShareType_Room; +// shareInfo.roomUid = self.userInfo.roomUid.integerValue; +// NSString * uid = [AccountInfoStorage instance].getUid; +// NSString * urlString = [NSString stringWithFormat:@"%@/%@?shareUid=%@&uid=%@&room_name=%@&room_id=%@&room_avatar=%@&share_name=%@",[HttpRequestHelper getHostUrl],URLWithType(kShareRoomURL),uid,self.userInfo.roomUid,self.userInfo.nick,self.userInfo.roomId,self.userInfo.roomAvatar,self.userInfo.nick]; +// shareInfo.shareUrl = urlString; +// CGFloat margin = 15; +// CGSize itemSize = CGSizeMake((KScreenWidth-2*margin)/4, 65); +// XPShareView *shareView = [[XPShareView alloc] initWithItems:items itemSize:itemSize shareInfo:shareInfo]; +// shareView.delegate = self; +// [TTPopup popupView:shareView style:TTPopupStyleActionSheet]; } else { if (self.arrangeMicInfo.myPos.integerValue > 0) { [TTPopup alertWithMessage:YMLocalizedString(@"XPArrangeMicViewController19") confirmHandler:^{ diff --git a/YuMi/Modules/YMWeb/XPWebViewController.m b/YuMi/Modules/YMWeb/XPWebViewController.m index c8c69fb..ba1b849 100644 --- a/YuMi/Modules/YMWeb/XPWebViewController.m +++ b/YuMi/Modules/YMWeb/XPWebViewController.m @@ -11,7 +11,6 @@ #import "YUMIMacroUitls.h" #import "YYUtility.h" #import "HttpRequestHelper.h" -#import "XPShareView.h" #import "TTPopup.h" #import #import @@ -79,15 +78,11 @@ typedef NS_ENUM(NSUInteger, RightNavigationPushType){ @end -@interface XPWebViewController () +@interface XPWebViewController () @property (nonatomic,strong) WalletInfoModel *model ; //@property (strong, nonatomic) WKWebView *webview; @property (strong, nonatomic) UIProgressView *progressView; @property (nonatomic, strong) WKUserContentController *pi_userContentController; -///分享的内容 -@property (nonatomic,copy) NSDictionary *shareDic; -///分享的内容 -@property (nonatomic,copy) NSDictionary *savePhotoDic; /// @property (nonatomic,strong) XPWebViewNavView *navView; @@ -389,8 +384,7 @@ NSString * const kJSShowShareCallBack = @"showShareAction"; } else if ([message.body isKindOfClass:[NSString class]]) { body = [message.body toJSONObject]; } - self.shareDic = body[@"data"]; - [self showSharePanel]; + // 分享功能已移除 } } else if ([message.name isEqualToString:kJSGetUid]) { NSString *uid = [[AccountInfoStorage instance] getUid]; @@ -570,7 +564,7 @@ NSString * const kJSShowShareCallBack = @"showShareAction"; if ([type isEqualToString:@"2"]){ [self saveImageToPhotoAlbum:bodyDic]; }else if ([type isEqualToString:@"1"]){ - self.savePhotoDic = bodyDic; +// self.savePhotoDic = bodyDic; [self showShareSavePhote]; } } else if([message.name isEqualToString:kJSGoToExchangeGold]){ @@ -726,7 +720,7 @@ NSString * const kJSShowShareCallBack = @"showShareAction"; #pragma mark - 分享 - (void)initNav:(NSDictionary *)response{ if(!response || ![response isKindOfClass:[NSDictionary class]])return; - self.shareDic = response[@"data"]; +// self.shareDic = response[@"data"]; if ([response[@"type"] intValue]== RightNavigationPushType_Web) { [self addNavigationItemWithTitles:@[response[@"data"][@"title"]] titleColor:[DJDKMIMOMColor alertTitleColor] isLeft:NO target:self action:@selector(gotoWebView) tags:nil]; }else if ([response[@"type"] intValue]== RightNavigationPushType_Share || [response[@"type"] intValue]== RightNavigationPushType_SharePicture){ @@ -736,124 +730,16 @@ NSString * const kJSShowShareCallBack = @"showShareAction"; } - (void)gotoWebView { - if (self.shareDic[@"link"]) { - XPWebViewController * webVC = [[XPWebViewController alloc] init]; - webVC.url = self.shareDic[@"link"]; - [self.navigationController pushViewController:webVC animated:YES]; - } +// if (self.shareDic[@"link"]) { +// XPWebViewController * webVC = [[XPWebViewController alloc] init]; +// webVC.url = self.shareDic[@"link"]; +// [self.navigationController pushViewController:webVC animated:YES]; +// } } -(void)showShareSavePhote{ - if (self.savePhotoDic.allKeys.count <= 0) { - return; - } - NSDictionary * dic = self.savePhotoDic; - XPShareInfoModel * shareInfo = [[XPShareInfoModel alloc] init]; - shareInfo.shareContent = dic[@"shareText"]; - shareInfo.type = ShareType_H5; - shareInfo.uid = [AccountInfoStorage instance].getUid; - NSString *urlStr = ((NSString *)dic[@"toUrl"]).length > 0 ? dic[@"toUrl"] : @""; - NSString *title = ((NSString *)dic[@"shareTitle"]).length > 0 ? dic[@"shareTitle"] : @""; - NSString *shareText = ((NSString *)dic[@"shareText"]).length > 0 ? dic[@"shareText"] : @""; - NSString *shareImg = ((NSString *)dic[@"shareImg"]).length > 0 ? dic[@"shareImg"] : @""; - shareInfo.shareUrl = [NSString stringWithFormat:@"%@&image=%@&title=%@&subTitle=%@",urlStr,shareImg,title,shareText]; - XPShareItem *cycle = [XPShareItem itemWitTag:XPShareItemTagFaceBook title:@"FaceBook" imageName:@"share_fb" disableImageName:@"share_fb"]; - XPShareItem *wechat = [XPShareItem itemWitTag:XPShareItemTagLine title:@"Line" imageName:@"share_line" disableImageName:@"share_line"]; - wechat.isShareInvite = YES; - wechat.inviteTitle = title; - XPShareItem *qq = [XPShareItem itemWitTag:XPShareItemTagCopyLink title:YMLocalizedString(@"XPWebViewNavView1") imageName:@"share_copy_link" disableImageName:@"share_copy_link"]; - XPShareItem *save = [XPShareItem itemWitTag:XPShareItemTagAppSaveAlbum title:YMLocalizedString(@"PIWebViewSavePhotoView4") imageName:@"share_save_icon" disableImageName:@"share_save_icon"]; - - NSArray * items = @[wechat,cycle, qq,save]; - CGFloat margin = 15; - CGSize itemSize = CGSizeMake((KScreenWidth-2*margin)/4, 65); - XPShareView *shareView = [[XPShareView alloc] initWithItems:items itemSize:itemSize shareInfo:shareInfo]; - shareView.delegate = self; - - [TTPopup popupView:shareView style:TTPopupStyleActionSheet]; - } - (void)showSharePanel { - if (self.shareDic.allKeys.count <= 0) { - return; - } - NSDictionary * dic = self.shareDic; - XPShareInfoModel * shareInfo = [[XPShareInfoModel alloc] init]; - shareInfo.shareTitle = self.shareDic[@"title"]; - shareInfo.shareContent = dic[@"desc"]; - shareInfo.shareImageUrl = dic[@"imgUrl"]; - shareInfo.type = ShareType_H5; - shareInfo.uid = [AccountInfoStorage instance].getUid; - NSString *urlStr = ((NSString *)dic[@"url"]).length > 0 ? dic[@"url"] : dic[@"showUrl"]; - if (urlStr.length) { - if ([urlStr containsString:@"?"]) { - urlStr = [NSString stringWithFormat:@"%@&shareUid=%@",urlStr,[AccountInfoStorage instance].getUid]; - } else { - urlStr = [NSString stringWithFormat:@"%@?shareUid=%@",urlStr,[AccountInfoStorage instance].getUid]; - } - } - shareInfo.shareUrl = urlStr; - XPShareItem *cycle = [XPShareItem itemWitTag:XPShareItemTagFaceBook title:@"FaceBook" imageName:@"share_fb" disableImageName:@"share_fb"]; - XPShareItem *wechat = [XPShareItem itemWitTag:XPShareItemTagLine title:@"Line" imageName:@"share_line" disableImageName:@"share_line"]; - XPShareItem *qq = [XPShareItem itemWitTag:XPShareItemTagCopyLink title:YMLocalizedString(@"XPWebViewNavView1") imageName:@"share_copy_link" disableImageName:@"share_copy_link"]; - XPShareItem *save = [XPShareItem itemWitTag:XPShareItemTagAppSaveAlbum title:YMLocalizedString(@"PIWebViewSavePhotoView4") imageName:@"share_save_icon" disableImageName:@"share_save_icon"]; - - NSArray * items = @[wechat,cycle, qq,save]; - CGFloat margin = 15; - CGSize itemSize = CGSizeMake((KScreenWidth-2*margin)/4, 65); - XPShareView *shareView = [[XPShareView alloc] initWithItems:items itemSize:itemSize shareInfo:shareInfo]; - shareView.delegate = self; - - [TTPopup popupView:shareView style:TTPopupStyleActionSheet]; -} - -#pragma mark - XCShareViewDelegate -- (void)shareView:(XPShareView *)shareView savePhoto:(XPShareInfoModel *)shareInfo{ - [self saveImageToPhotoAlbum:self.savePhotoDic]; -} -- (void)shareViewDidClickCancle:(XPShareView *)shareView { - [TTPopup dismiss]; -} -- (void)shareView:(XPShareView *)shareView didSuccess:(XPShareInfoModel *)shareInfo { - [TTPopup dismiss]; - NSMutableDictionary *params = [NSMutableDictionary dictionary]; - NSString *uid = [AccountInfoStorage instance].getUid; - NSString *ticket = [AccountInfoStorage instance].getTicket; - [params setObject:uid forKey:@"uid"]; - - // 添加类型安全检查,防止NSTaggedPointerString错误 - if ([shareInfo isKindOfClass:[XPShareInfoModel class]]) { - [params setObject:@(shareInfo.shareType) forKey:@"shareType"]; - } else { - // 如果不是预期类型,提供默认值 - [params setObject:@(0) forKey:@"shareType"]; - NSLog(@"警告:shareInfo不是XPShareInfoModel类型,而是%@类型", NSStringFromClass([shareInfo class])); - } - - [params setObject:ticket forKey:@"ticket"]; - if ([shareInfo isKindOfClass:[XPShareInfoModel class]]) { - [params setObject:@(shareInfo.type) forKey:@"sharePageId"]; - if (shareInfo.shareUrl.length > 0) { - [params setObject:shareInfo.shareUrl forKey:@"shareUrl"]; - } - if (shareInfo.roomUid > 0) { - [params setObject:@(shareInfo.roomUid) forKey:@"targetUid"]; - } - } - - [HttpRequestHelper POST:@"usershare/save" params:params success:^(BaseModel * _Nonnull data) { - - } failure:^(NSInteger resCode, NSString * _Nonnull message) { - - }]; -} - -- (void)shareView:(XPShareView *)shareView shareFail:(NSString *)message { - [TTPopup dismiss]; - [self showErrorToast:message]; -} - -- (void)shareViewDidClickCancel:(XPShareView *)shareView { - [TTPopup dismiss]; + } - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { @@ -911,7 +797,7 @@ NSString * const kJSShowShareCallBack = @"showShareAction"; configuration.preferences.javaScriptEnabled = YES; configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES; configuration.preferences.minimumFontSize = 10; - configuration.selectionGranularity = WKSelectionGranularityCharacter; +// configuration.selectionGranularity = WKSelectionGranularityCharacter; configuration.userContentController = self.pi_userContentController; CGSize size = [UIScreen mainScreen].bounds.size;