改写登录
This commit is contained in:
@@ -47,6 +47,12 @@
|
||||
230D63C42B59813D00DADC14 /* UIButton+MewSetButtomArea.m in Sources */ = {isa = PBXBuildFile; fileRef = 230D63C32B59813D00DADC14 /* UIButton+MewSetButtomArea.m */; };
|
||||
230D63C82B59835C00DADC14 /* MewSaveBaseUserModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 230D63C72B59835C00DADC14 /* MewSaveBaseUserModel.m */; };
|
||||
230D63CB2B5A0A5B00DADC14 /* MewOCServerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 230D63CA2B5A0A5B00DADC14 /* MewOCServerManager.m */; };
|
||||
23107DBA2B5BA9E600F96550 /* MewNIMMsgInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23107DB92B5BA9E600F96550 /* MewNIMMsgInfoModel.m */; };
|
||||
23107DBF2B5BB77D00F96550 /* MewUserPhoneLoginVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23107DBE2B5BB77D00F96550 /* MewUserPhoneLoginVC.swift */; };
|
||||
23107DC12B5BB79A00F96550 /* MewUserPhoneLoginView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23107DC02B5BB79A00F96550 /* MewUserPhoneLoginView.swift */; };
|
||||
23107DC32B5BB7C000F96550 /* MewUserPhonePasswordView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23107DC22B5BB7C000F96550 /* MewUserPhonePasswordView.swift */; };
|
||||
23107DC52B5BB7EB00F96550 /* MewUserPhoneLoginInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23107DC42B5BB7EB00F96550 /* MewUserPhoneLoginInputView.swift */; };
|
||||
23107DC72B5BE03000F96550 /* MewFillInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23107DC62B5BE03000F96550 /* MewFillInfoVC.swift */; };
|
||||
23270C292B0E037300B9303B /* MewMessageConentAudioView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23270C272B0E037300B9303B /* MewMessageConentAudioView.m */; };
|
||||
23270C2C2B0E041300B9303B /* MewMessageAudioCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 23270C2B2B0E041300B9303B /* MewMessageAudioCenter.m */; };
|
||||
233757592B0CB577001D0B7F /* MewNIMBadgeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 233757312B0CB577001D0B7F /* MewNIMBadgeView.m */; };
|
||||
@@ -68,10 +74,6 @@
|
||||
237053882B1F3AA100F5DE14 /* MewRechargeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 237053332B1F3AA000F5DE14 /* MewRechargeViewController.m */; };
|
||||
237053892B1F3AA100F5DE14 /* MewMineCollectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 237053362B1F3AA000F5DE14 /* MewMineCollectionViewController.m */; };
|
||||
2370538A2B1F3AA100F5DE14 /* MewRechargeSubView.m in Sources */ = {isa = PBXBuildFile; fileRef = 237053382B1F3AA000F5DE14 /* MewRechargeSubView.m */; };
|
||||
2370538B2B1F3AA100F5DE14 /* MewLoginPhoneView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2370533F2B1F3AA000F5DE14 /* MewLoginPhoneView.m */; };
|
||||
2370538C2B1F3AA100F5DE14 /* MewLoginPasswordView.m in Sources */ = {isa = PBXBuildFile; fileRef = 237053412B1F3AA000F5DE14 /* MewLoginPasswordView.m */; };
|
||||
2370538D2B1F3AA100F5DE14 /* MewLoginNumberViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 237053422B1F3AA000F5DE14 /* MewLoginNumberViewController.m */; };
|
||||
2370538E2B1F3AA100F5DE14 /* MewLoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 237053432B1F3AA000F5DE14 /* MewLoginViewController.m */; };
|
||||
2370538F2B1F3AA100F5DE14 /* MewSessionListTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 237053482B1F3AA000F5DE14 /* MewSessionListTableViewCell.m */; };
|
||||
237053902B1F3AA100F5DE14 /* MewSessionListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2370534A2B1F3AA000F5DE14 /* MewSessionListViewController.m */; };
|
||||
237053982B1F3AA100F5DE14 /* MewAudioPlayerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 237053662B1F3AA100F5DE14 /* MewAudioPlayerManager.m */; };
|
||||
@@ -86,23 +88,16 @@
|
||||
237053A12B1F3AA100F5DE14 /* MewUserIntroductionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 237053792B1F3AA100F5DE14 /* MewUserIntroductionView.m */; };
|
||||
237053A22B1F3AA100F5DE14 /* MewHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2370537A2B1F3AA100F5DE14 /* MewHeaderView.m */; };
|
||||
237053A32B1F3AA100F5DE14 /* MewRightFollowVoiceCollectionCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2370537D2B1F3AA100F5DE14 /* MewRightFollowVoiceCollectionCell.m */; };
|
||||
2370547F2B1F3B3200F5DE14 /* UIView+MewFilletCorner.m in Sources */ = {isa = PBXBuildFile; fileRef = 237053F72B1F3B3200F5DE14 /* UIView+MewFilletCorner.m */; };
|
||||
237054802B1F3B3200F5DE14 /* UIImage+MewUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 237053F82B1F3B3200F5DE14 /* UIImage+MewUtils.m */; };
|
||||
237054812B1F3B3200F5DE14 /* MewStackManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 237053F92B1F3B3200F5DE14 /* MewStackManager.m */; };
|
||||
237054832B1F3B3200F5DE14 /* MewBaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 237053FB2B1F3B3200F5DE14 /* MewBaseViewController.m */; };
|
||||
237054882B1F3B3200F5DE14 /* MewEmptyTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 237054082B1F3B3200F5DE14 /* MewEmptyTableViewCell.m */; };
|
||||
2370549F2B1F3B3200F5DE14 /* UIImage+RW.m in Sources */ = {isa = PBXBuildFile; fileRef = 2370544B2B1F3B3200F5DE14 /* UIImage+RW.m */; };
|
||||
237054A32B1F3B3200F5DE14 /* MEWCountDownHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 237054562B1F3B3200F5DE14 /* MEWCountDownHelper.m */; };
|
||||
237054A42B1F3B3200F5DE14 /* MewTimeIntervalUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 237054592B1F3B3200F5DE14 /* MewTimeIntervalUtils.m */; };
|
||||
237054A52B1F3B3200F5DE14 /* DESEncrypt.m in Sources */ = {isa = PBXBuildFile; fileRef = 2370545D2B1F3B3200F5DE14 /* DESEncrypt.m */; };
|
||||
237054A62B1F3B3200F5DE14 /* MEWBase64.m in Sources */ = {isa = PBXBuildFile; fileRef = 2370545E2B1F3B3200F5DE14 /* MEWBase64.m */; };
|
||||
237054A72B1F3B3200F5DE14 /* MewHUDTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 2370545F2B1F3B3200F5DE14 /* MewHUDTool.m */; };
|
||||
237054AD2B1F3B3200F5DE14 /* YYReachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 237054722B1F3B3200F5DE14 /* YYReachability.m */; };
|
||||
237054AF2B1F3B3200F5DE14 /* MewPaymentAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 237054772B1F3B3200F5DE14 /* MewPaymentAction.swift */; };
|
||||
237054BB2B1F3BF600F5DE14 /* MewTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 237054B82B1F3BF600F5DE14 /* MewTabBarController.m */; };
|
||||
23F1E6912B5A872F004777A2 /* MewUtility+MewDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 23F1E68B2B5A872E004777A2 /* MewUtility+MewDevice.m */; };
|
||||
23F1E6922B5A872F004777A2 /* MewUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 23F1E68F2B5A872E004777A2 /* MewUtility.m */; };
|
||||
23F1E6932B5A872F004777A2 /* MewUtility+MewApp.m in Sources */ = {isa = PBXBuildFile; fileRef = 23F1E6902B5A872E004777A2 /* MewUtility+MewApp.m */; };
|
||||
23F1E69C2B5A93FB004777A2 /* MewNetworkDataModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23F1E69B2B5A93FB004777A2 /* MewNetworkDataModel.m */; };
|
||||
23F1E69E2B5A9463004777A2 /* MewLoginTokenInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23F1E69D2B5A9463004777A2 /* MewLoginTokenInfoModel.swift */; };
|
||||
23F1E6A22B5A9BAA004777A2 /* MewPersonInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23F1E6A12B5A9BAA004777A2 /* MewPersonInfoModel.swift */; };
|
||||
@@ -112,12 +107,13 @@
|
||||
23F1E6AA2B5AC639004777A2 /* MewCollectListItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23F1E6A92B5AC639004777A2 /* MewCollectListItemModel.swift */; };
|
||||
23F1E6AC2B5AC7D3004777A2 /* MewPayItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23F1E6AB2B5AC7D3004777A2 /* MewPayItemModel.swift */; };
|
||||
23F1E6AE2B5AC8EC004777A2 /* MewDiamondNum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23F1E6AD2B5AC8EC004777A2 /* MewDiamondNum.swift */; };
|
||||
23F1E6B02B5AC9AA004777A2 /* MewNIMMsgInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23F1E6AF2B5AC9AA004777A2 /* MewNIMMsgInfoModel.swift */; };
|
||||
23F1E6B22B5ACAE8004777A2 /* MewAppleInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23F1E6B12B5ACAE8004777A2 /* MewAppleInfoModel.swift */; };
|
||||
23F1E6B42B5AD383004777A2 /* MewAppColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23F1E6B32B5AD383004777A2 /* MewAppColor.swift */; };
|
||||
23F1E6BB2B5B5F28004777A2 /* MewGetColorTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 23F1E6BA2B5B5F28004777A2 /* MewGetColorTool.m */; };
|
||||
23F1E6C12B5B6387004777A2 /* MewGetPointList.m in Sources */ = {isa = PBXBuildFile; fileRef = 23F1E6C02B5B6387004777A2 /* MewGetPointList.m */; };
|
||||
23F1E6C42B5B6E97004777A2 /* MewNavigationVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 23F1E6C32B5B6E97004777A2 /* MewNavigationVC.m */; };
|
||||
23F1E6C72B5B70EF004777A2 /* MewUserLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23F1E6C62B5B70EF004777A2 /* MewUserLoginViewController.swift */; };
|
||||
23F1E6CC2B5B7ACF004777A2 /* UImage+MewSetImageInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 23F1E6CB2B5B7ACF004777A2 /* UImage+MewSetImageInfo.m */; };
|
||||
8C4D535C2AFD4CF700238AE6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8C4D535B2AFD4CF700238AE6 /* Assets.xcassets */; };
|
||||
8C4D535F2AFD4CF700238AE6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8C4D535D2AFD4CF700238AE6 /* LaunchScreen.storyboard */; };
|
||||
8C4D53622AFD4CF700238AE6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C4D53612AFD4CF700238AE6 /* main.m */; };
|
||||
@@ -134,9 +130,7 @@
|
||||
8C9C84492B0C697A00A601BC /* MewMineAboutUsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C9C837E2B0C697A00A601BC /* MewMineAboutUsViewController.m */; };
|
||||
8C9C844C2B0C697A00A601BC /* MewCustomAttachmentDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C9C83882B0C697A00A601BC /* MewCustomAttachmentDecoder.m */; };
|
||||
8C9C84532B0C697A00A601BC /* MewLoginForgetPasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C9C839F2B0C697A00A601BC /* MewLoginForgetPasswordViewController.m */; };
|
||||
8C9C84542B0C697A00A601BC /* MewLoginInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C9C83A32B0C697A00A601BC /* MewLoginInputView.m */; };
|
||||
8C9C84552B0C697A00A601BC /* MewLoginForgetEditView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C9C83A62B0C697A00A601BC /* MewLoginForgetEditView.m */; };
|
||||
8C9C84562B0C697A00A601BC /* MewLoginFullInfoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C9C83A72B0C697A00A601BC /* MewLoginFullInfoViewController.m */; };
|
||||
8C9C847D2B0C6A6400A601BC /* TXFFmpeg.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C9C847C2B0C6A6400A601BC /* TXFFmpeg.xcframework */; };
|
||||
8C9C847F2B0C6A6A00A601BC /* TXSoundTouch.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C9C847E2B0C6A6A00A601BC /* TXSoundTouch.xcframework */; };
|
||||
8C9C84B42B0E951200A601BC /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C9C84B32B0E951200A601BC /* StoreKit.framework */; };
|
||||
@@ -202,6 +196,13 @@
|
||||
230D63C72B59835C00DADC14 /* MewSaveBaseUserModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MewSaveBaseUserModel.m; sourceTree = "<group>"; };
|
||||
230D63C92B5A0A5B00DADC14 /* MewOCServerManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MewOCServerManager.h; sourceTree = "<group>"; };
|
||||
230D63CA2B5A0A5B00DADC14 /* MewOCServerManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MewOCServerManager.m; sourceTree = "<group>"; };
|
||||
23107DB82B5BA9E600F96550 /* MewNIMMsgInfoModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MewNIMMsgInfoModel.h; sourceTree = "<group>"; };
|
||||
23107DB92B5BA9E600F96550 /* MewNIMMsgInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MewNIMMsgInfoModel.m; sourceTree = "<group>"; };
|
||||
23107DBE2B5BB77D00F96550 /* MewUserPhoneLoginVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MewUserPhoneLoginVC.swift; sourceTree = "<group>"; };
|
||||
23107DC02B5BB79A00F96550 /* MewUserPhoneLoginView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MewUserPhoneLoginView.swift; sourceTree = "<group>"; };
|
||||
23107DC22B5BB7C000F96550 /* MewUserPhonePasswordView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MewUserPhonePasswordView.swift; sourceTree = "<group>"; };
|
||||
23107DC42B5BB7EB00F96550 /* MewUserPhoneLoginInputView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MewUserPhoneLoginInputView.swift; sourceTree = "<group>"; };
|
||||
23107DC62B5BE03000F96550 /* MewFillInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MewFillInfoVC.swift; sourceTree = "<group>"; };
|
||||
23270C272B0E037300B9303B /* MewMessageConentAudioView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MewMessageConentAudioView.m; sourceTree = "<group>"; };
|
||||
23270C282B0E037300B9303B /* MewMessageConentAudioView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MewMessageConentAudioView.h; sourceTree = "<group>"; };
|
||||
23270C2A2B0E041300B9303B /* MewMessageAudioCenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MewMessageAudioCenter.h; sourceTree = "<group>"; };
|
||||
@@ -245,14 +246,6 @@
|
||||
237053362B1F3AA000F5DE14 /* MewMineCollectionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MewMineCollectionViewController.m; sourceTree = "<group>"; };
|
||||
237053372B1F3AA000F5DE14 /* MewRechargeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MewRechargeViewController.h; sourceTree = "<group>"; };
|
||||
237053382B1F3AA000F5DE14 /* MewRechargeSubView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MewRechargeSubView.m; sourceTree = "<group>"; };
|
||||
2370533B2B1F3AA000F5DE14 /* MewLoginViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MewLoginViewController.h; sourceTree = "<group>"; };
|
||||
2370533C2B1F3AA000F5DE14 /* MewLoginNumberViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MewLoginNumberViewController.h; sourceTree = "<group>"; };
|
||||
2370533E2B1F3AA000F5DE14 /* MewLoginPasswordView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MewLoginPasswordView.h; sourceTree = "<group>"; };
|
||||
2370533F2B1F3AA000F5DE14 /* MewLoginPhoneView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MewLoginPhoneView.m; sourceTree = "<group>"; };
|
||||
237053402B1F3AA000F5DE14 /* MewLoginPhoneView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MewLoginPhoneView.h; sourceTree = "<group>"; };
|
||||
237053412B1F3AA000F5DE14 /* MewLoginPasswordView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MewLoginPasswordView.m; sourceTree = "<group>"; };
|
||||
237053422B1F3AA000F5DE14 /* MewLoginNumberViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MewLoginNumberViewController.m; sourceTree = "<group>"; };
|
||||
237053432B1F3AA000F5DE14 /* MewLoginViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MewLoginViewController.m; sourceTree = "<group>"; };
|
||||
237053472B1F3AA000F5DE14 /* MewSessionListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MewSessionListViewController.h; sourceTree = "<group>"; };
|
||||
237053482B1F3AA000F5DE14 /* MewSessionListTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MewSessionListTableViewCell.m; sourceTree = "<group>"; };
|
||||
237053492B1F3AA000F5DE14 /* MewSessionListTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MewSessionListTableViewCell.h; sourceTree = "<group>"; };
|
||||
@@ -282,22 +275,14 @@
|
||||
2370537D2B1F3AA100F5DE14 /* MewRightFollowVoiceCollectionCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MewRightFollowVoiceCollectionCell.m; sourceTree = "<group>"; };
|
||||
2370537E2B1F3AA100F5DE14 /* MewPlayVoiceView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MewPlayVoiceView.h; sourceTree = "<group>"; };
|
||||
237053EB2B1F3B1600F5DE14 /* MewMacro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MewMacro.h; sourceTree = "<group>"; };
|
||||
237053F52B1F3B3200F5DE14 /* UIView+MewFilletCorner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+MewFilletCorner.h"; sourceTree = "<group>"; };
|
||||
237053F62B1F3B3200F5DE14 /* UIImage+MewUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+MewUtils.h"; sourceTree = "<group>"; };
|
||||
237053F72B1F3B3200F5DE14 /* UIView+MewFilletCorner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+MewFilletCorner.m"; sourceTree = "<group>"; };
|
||||
237053F82B1F3B3200F5DE14 /* UIImage+MewUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+MewUtils.m"; sourceTree = "<group>"; };
|
||||
237053F92B1F3B3200F5DE14 /* MewStackManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MewStackManager.m; sourceTree = "<group>"; };
|
||||
237053FB2B1F3B3200F5DE14 /* MewBaseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MewBaseViewController.m; sourceTree = "<group>"; };
|
||||
237054072B1F3B3200F5DE14 /* MewEmptyTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MewEmptyTableViewCell.h; sourceTree = "<group>"; };
|
||||
237054082B1F3B3200F5DE14 /* MewEmptyTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MewEmptyTableViewCell.m; sourceTree = "<group>"; };
|
||||
237054252B1F3B3200F5DE14 /* MewStackManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MewStackManager.h; sourceTree = "<group>"; };
|
||||
237054262B1F3B3200F5DE14 /* MewBaseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MewBaseViewController.h; sourceTree = "<group>"; };
|
||||
2370544A2B1F3B3200F5DE14 /* UIImage+RW.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+RW.h"; sourceTree = "<group>"; };
|
||||
2370544B2B1F3B3200F5DE14 /* UIImage+RW.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+RW.m"; sourceTree = "<group>"; };
|
||||
237054552B1F3B3200F5DE14 /* MEWCountDownHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MEWCountDownHelper.h; sourceTree = "<group>"; };
|
||||
237054562B1F3B3200F5DE14 /* MEWCountDownHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MEWCountDownHelper.m; sourceTree = "<group>"; };
|
||||
237054582B1F3B3200F5DE14 /* MewTimeIntervalUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MewTimeIntervalUtils.h; sourceTree = "<group>"; };
|
||||
237054592B1F3B3200F5DE14 /* MewTimeIntervalUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MewTimeIntervalUtils.m; sourceTree = "<group>"; };
|
||||
2370545B2B1F3B3200F5DE14 /* DESEncrypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DESEncrypt.h; sourceTree = "<group>"; };
|
||||
2370545C2B1F3B3200F5DE14 /* MEWBase64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MEWBase64.h; sourceTree = "<group>"; };
|
||||
2370545D2B1F3B3200F5DE14 /* DESEncrypt.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DESEncrypt.m; sourceTree = "<group>"; };
|
||||
@@ -310,12 +295,6 @@
|
||||
237054772B1F3B3200F5DE14 /* MewPaymentAction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MewPaymentAction.swift; sourceTree = "<group>"; };
|
||||
237054B82B1F3BF600F5DE14 /* MewTabBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MewTabBarController.m; sourceTree = "<group>"; };
|
||||
237054B92B1F3BF600F5DE14 /* MewTabBarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MewTabBarController.h; sourceTree = "<group>"; };
|
||||
23F1E68B2B5A872E004777A2 /* MewUtility+MewDevice.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MewUtility+MewDevice.m"; sourceTree = "<group>"; };
|
||||
23F1E68C2B5A872E004777A2 /* MewUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MewUtility.h; sourceTree = "<group>"; };
|
||||
23F1E68D2B5A872E004777A2 /* MewUtility+MewApp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MewUtility+MewApp.h"; sourceTree = "<group>"; };
|
||||
23F1E68E2B5A872E004777A2 /* MewUtility+MewDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MewUtility+MewDevice.h"; sourceTree = "<group>"; };
|
||||
23F1E68F2B5A872E004777A2 /* MewUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MewUtility.m; sourceTree = "<group>"; };
|
||||
23F1E6902B5A872E004777A2 /* MewUtility+MewApp.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MewUtility+MewApp.m"; sourceTree = "<group>"; };
|
||||
23F1E69A2B5A93FB004777A2 /* MewNetworkDataModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MewNetworkDataModel.h; sourceTree = "<group>"; };
|
||||
23F1E69B2B5A93FB004777A2 /* MewNetworkDataModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MewNetworkDataModel.m; sourceTree = "<group>"; };
|
||||
23F1E69D2B5A9463004777A2 /* MewLoginTokenInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MewLoginTokenInfoModel.swift; sourceTree = "<group>"; };
|
||||
@@ -326,7 +305,6 @@
|
||||
23F1E6A92B5AC639004777A2 /* MewCollectListItemModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MewCollectListItemModel.swift; sourceTree = "<group>"; };
|
||||
23F1E6AB2B5AC7D3004777A2 /* MewPayItemModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MewPayItemModel.swift; sourceTree = "<group>"; };
|
||||
23F1E6AD2B5AC8EC004777A2 /* MewDiamondNum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MewDiamondNum.swift; sourceTree = "<group>"; };
|
||||
23F1E6AF2B5AC9AA004777A2 /* MewNIMMsgInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MewNIMMsgInfoModel.swift; sourceTree = "<group>"; };
|
||||
23F1E6B12B5ACAE8004777A2 /* MewAppleInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MewAppleInfoModel.swift; sourceTree = "<group>"; };
|
||||
23F1E6B32B5AD383004777A2 /* MewAppColor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MewAppColor.swift; sourceTree = "<group>"; };
|
||||
23F1E6B62B5B5DCD004777A2 /* MewBaseEnumType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MewBaseEnumType.h; sourceTree = "<group>"; };
|
||||
@@ -336,6 +314,9 @@
|
||||
23F1E6C02B5B6387004777A2 /* MewGetPointList.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MewGetPointList.m; sourceTree = "<group>"; };
|
||||
23F1E6C22B5B6E97004777A2 /* MewNavigationVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MewNavigationVC.h; sourceTree = "<group>"; };
|
||||
23F1E6C32B5B6E97004777A2 /* MewNavigationVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MewNavigationVC.m; sourceTree = "<group>"; };
|
||||
23F1E6C62B5B70EF004777A2 /* MewUserLoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MewUserLoginViewController.swift; sourceTree = "<group>"; };
|
||||
23F1E6CA2B5B7ACF004777A2 /* UImage+MewSetImageInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UImage+MewSetImageInfo.h"; sourceTree = "<group>"; };
|
||||
23F1E6CB2B5B7ACF004777A2 /* UImage+MewSetImageInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UImage+MewSetImageInfo.m"; sourceTree = "<group>"; };
|
||||
8C4D534C2AFD4CF600238AE6 /* yinmeng-ios.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "yinmeng-ios.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8C4D535B2AFD4CF700238AE6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
8C4D535E2AFD4CF700238AE6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
@@ -366,13 +347,9 @@
|
||||
8C9C83872B0C697A00A601BC /* MewCustomAttachmentDecoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MewCustomAttachmentDecoder.h; sourceTree = "<group>"; };
|
||||
8C9C83882B0C697A00A601BC /* MewCustomAttachmentDecoder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MewCustomAttachmentDecoder.m; sourceTree = "<group>"; };
|
||||
8C9C839F2B0C697A00A601BC /* MewLoginForgetPasswordViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MewLoginForgetPasswordViewController.m; sourceTree = "<group>"; };
|
||||
8C9C83A02B0C697A00A601BC /* MewLoginFullInfoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MewLoginFullInfoViewController.h; sourceTree = "<group>"; };
|
||||
8C9C83A12B0C697A00A601BC /* MewLoginForgetPasswordViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MewLoginForgetPasswordViewController.h; sourceTree = "<group>"; };
|
||||
8C9C83A32B0C697A00A601BC /* MewLoginInputView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MewLoginInputView.m; sourceTree = "<group>"; };
|
||||
8C9C83A42B0C697A00A601BC /* MewLoginForgetEditView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MewLoginForgetEditView.h; sourceTree = "<group>"; };
|
||||
8C9C83A52B0C697A00A601BC /* MewLoginInputView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MewLoginInputView.h; sourceTree = "<group>"; };
|
||||
8C9C83A62B0C697A00A601BC /* MewLoginForgetEditView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MewLoginForgetEditView.m; sourceTree = "<group>"; };
|
||||
8C9C83A72B0C697A00A601BC /* MewLoginFullInfoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MewLoginFullInfoViewController.m; sourceTree = "<group>"; };
|
||||
8C9C847C2B0C6A6400A601BC /* TXFFmpeg.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = TXFFmpeg.xcframework; path = Pods/TXLiteAVSDK_TRTC/TXLiteAVSDK_TRTC/TXFFmpeg.xcframework; sourceTree = "<group>"; };
|
||||
8C9C847E2B0C6A6A00A601BC /* TXSoundTouch.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = TXSoundTouch.xcframework; path = Pods/TXLiteAVSDK_TRTC/TXLiteAVSDK_TRTC/TXSoundTouch.xcframework; sourceTree = "<group>"; };
|
||||
8C9C84B22B0E94FA00A601BC /* yinmeng-ios.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "yinmeng-ios.entitlements"; sourceTree = "<group>"; };
|
||||
@@ -616,23 +593,12 @@
|
||||
path = Tool;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2370533D2B1F3AA000F5DE14 /* SubView */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2370533E2B1F3AA000F5DE14 /* MewLoginPasswordView.h */,
|
||||
237053412B1F3AA000F5DE14 /* MewLoginPasswordView.m */,
|
||||
237053402B1F3AA000F5DE14 /* MewLoginPhoneView.h */,
|
||||
2370533F2B1F3AA000F5DE14 /* MewLoginPhoneView.m */,
|
||||
);
|
||||
path = SubView;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
237053462B1F3AA000F5DE14 /* MewSessionList */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
237053472B1F3AA000F5DE14 /* MewSessionListViewController.h */,
|
||||
237053482B1F3AA000F5DE14 /* MewSessionListTableViewCell.m */,
|
||||
237053492B1F3AA000F5DE14 /* MewSessionListTableViewCell.h */,
|
||||
237053482B1F3AA000F5DE14 /* MewSessionListTableViewCell.m */,
|
||||
237053472B1F3AA000F5DE14 /* MewSessionListViewController.h */,
|
||||
2370534A2B1F3AA000F5DE14 /* MewSessionListViewController.m */,
|
||||
);
|
||||
path = MewSessionList;
|
||||
@@ -703,24 +669,14 @@
|
||||
237053FB2B1F3B3200F5DE14 /* MewBaseViewController.m */,
|
||||
237054252B1F3B3200F5DE14 /* MewStackManager.h */,
|
||||
237053F92B1F3B3200F5DE14 /* MewStackManager.m */,
|
||||
237053F42B1F3B3200F5DE14 /* UIImage */,
|
||||
23F1E6B92B5B5F28004777A2 /* MewGetColorTool.h */,
|
||||
23F1E6BA2B5B5F28004777A2 /* MewGetColorTool.m */,
|
||||
23F1E6CA2B5B7ACF004777A2 /* UImage+MewSetImageInfo.h */,
|
||||
23F1E6CB2B5B7ACF004777A2 /* UImage+MewSetImageInfo.m */,
|
||||
);
|
||||
path = UI;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
237053F42B1F3B3200F5DE14 /* UIImage */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
237053F62B1F3B3200F5DE14 /* UIImage+MewUtils.h */,
|
||||
237053F82B1F3B3200F5DE14 /* UIImage+MewUtils.m */,
|
||||
237053F52B1F3B3200F5DE14 /* UIView+MewFilletCorner.h */,
|
||||
237053F72B1F3B3200F5DE14 /* UIView+MewFilletCorner.m */,
|
||||
);
|
||||
path = UIImage;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
237054062B1F3B3200F5DE14 /* EmptyView */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -759,22 +715,10 @@
|
||||
2370545F2B1F3B3200F5DE14 /* MewHUDTool.m */,
|
||||
237054702B1F3B3200F5DE14 /* Reachability */,
|
||||
2370545A2B1F3B3200F5DE14 /* Security */,
|
||||
23F1E68A2B5A872E004777A2 /* YYUtility */,
|
||||
237054572B1F3B3200F5DE14 /* TimeInterval */,
|
||||
237054492B1F3B3200F5DE14 /* UIImage */,
|
||||
);
|
||||
path = Tool;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
237054492B1F3B3200F5DE14 /* UIImage */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2370544A2B1F3B3200F5DE14 /* UIImage+RW.h */,
|
||||
2370544B2B1F3B3200F5DE14 /* UIImage+RW.m */,
|
||||
);
|
||||
path = UIImage;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
237054542B1F3B3200F5DE14 /* CountDown */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -784,15 +728,6 @@
|
||||
path = CountDown;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
237054572B1F3B3200F5DE14 /* TimeInterval */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
237054582B1F3B3200F5DE14 /* MewTimeIntervalUtils.h */,
|
||||
237054592B1F3B3200F5DE14 /* MewTimeIntervalUtils.m */,
|
||||
);
|
||||
path = TimeInterval;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2370545A2B1F3B3200F5DE14 /* Security */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -840,17 +775,17 @@
|
||||
path = View;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
23F1E68A2B5A872E004777A2 /* YYUtility */ = {
|
||||
23F1E6C52B5B704D004777A2 /* Swift */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
23F1E68B2B5A872E004777A2 /* MewUtility+MewDevice.m */,
|
||||
23F1E68C2B5A872E004777A2 /* MewUtility.h */,
|
||||
23F1E68D2B5A872E004777A2 /* MewUtility+MewApp.h */,
|
||||
23F1E68E2B5A872E004777A2 /* MewUtility+MewDevice.h */,
|
||||
23F1E68F2B5A872E004777A2 /* MewUtility.m */,
|
||||
23F1E6902B5A872E004777A2 /* MewUtility+MewApp.m */,
|
||||
23F1E6C62B5B70EF004777A2 /* MewUserLoginViewController.swift */,
|
||||
23107DBE2B5BB77D00F96550 /* MewUserPhoneLoginVC.swift */,
|
||||
23107DC02B5BB79A00F96550 /* MewUserPhoneLoginView.swift */,
|
||||
23107DC22B5BB7C000F96550 /* MewUserPhonePasswordView.swift */,
|
||||
23107DC42B5BB7EB00F96550 /* MewUserPhoneLoginInputView.swift */,
|
||||
23107DC62B5BE03000F96550 /* MewFillInfoVC.swift */,
|
||||
);
|
||||
path = YYUtility;
|
||||
path = Swift;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
4A6518CB5E73E536AD820F47 /* Pods */ = {
|
||||
@@ -1054,7 +989,8 @@
|
||||
8C9C83832B0C697A00A601BC /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
23F1E6AF2B5AC9AA004777A2 /* MewNIMMsgInfoModel.swift */,
|
||||
23107DB82B5BA9E600F96550 /* MewNIMMsgInfoModel.h */,
|
||||
23107DB92B5BA9E600F96550 /* MewNIMMsgInfoModel.m */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
@@ -1071,6 +1007,7 @@
|
||||
8C9C83892B0C697A00A601BC /* Login */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
23F1E6C52B5B704D004777A2 /* Swift */,
|
||||
8C9C839B2B0C697A00A601BC /* Model */,
|
||||
8C9C839E2B0C697A00A601BC /* View */,
|
||||
);
|
||||
@@ -1091,8 +1028,6 @@
|
||||
8CAB97392B239ECE00ED8639 /* MewView */,
|
||||
8C9C83A12B0C697A00A601BC /* MewLoginForgetPasswordViewController.h */,
|
||||
8C9C839F2B0C697A00A601BC /* MewLoginForgetPasswordViewController.m */,
|
||||
8C9C83A02B0C697A00A601BC /* MewLoginFullInfoViewController.h */,
|
||||
8C9C83A72B0C697A00A601BC /* MewLoginFullInfoViewController.m */,
|
||||
8C9C83A22B0C697A00A601BC /* CustomView */,
|
||||
8C92A8052B0EEDD0008F362C /* MewLoginVerifBindPhoneViewController.h */,
|
||||
8C92A8062B0EEDD0008F362C /* MewLoginVerifBindPhoneViewController.m */,
|
||||
@@ -1107,8 +1042,6 @@
|
||||
children = (
|
||||
8C9C83A42B0C697A00A601BC /* MewLoginForgetEditView.h */,
|
||||
8C9C83A62B0C697A00A601BC /* MewLoginForgetEditView.m */,
|
||||
8C9C83A52B0C697A00A601BC /* MewLoginInputView.h */,
|
||||
8C9C83A32B0C697A00A601BC /* MewLoginInputView.m */,
|
||||
);
|
||||
path = CustomView;
|
||||
sourceTree = "<group>";
|
||||
@@ -1142,11 +1075,6 @@
|
||||
8CAB97392B239ECE00ED8639 /* MewView */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2370533C2B1F3AA000F5DE14 /* MewLoginNumberViewController.h */,
|
||||
237053422B1F3AA000F5DE14 /* MewLoginNumberViewController.m */,
|
||||
2370533B2B1F3AA000F5DE14 /* MewLoginViewController.h */,
|
||||
237053432B1F3AA000F5DE14 /* MewLoginViewController.m */,
|
||||
2370533D2B1F3AA000F5DE14 /* SubView */,
|
||||
);
|
||||
path = MewView;
|
||||
sourceTree = "<group>";
|
||||
@@ -1340,6 +1268,7 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
23F1E6AE2B5AC8EC004777A2 /* MewDiamondNum.swift in Sources */,
|
||||
23107DC12B5BB79A00F96550 /* MewUserPhoneLoginView.swift in Sources */,
|
||||
8C9C84482B0C697A00A601BC /* MewMineSettingTableViewCell.m in Sources */,
|
||||
233757682B0CB577001D0B7F /* MewNIMMessageUtils.m in Sources */,
|
||||
237053982B1F3AA100F5DE14 /* MewAudioPlayerManager.m in Sources */,
|
||||
@@ -1348,7 +1277,6 @@
|
||||
2337575C2B0CB577001D0B7F /* MewSessionMessageCell.m in Sources */,
|
||||
8C9C821F2B0C694900A601BC /* AppDelegate.m in Sources */,
|
||||
8C92A8182B0EF3E9008F362C /* MewMineModifPayPwdView.m in Sources */,
|
||||
2370547F2B1F3B3200F5DE14 /* UIView+MewFilletCorner.m in Sources */,
|
||||
8C9C84462B0C697A00A601BC /* MewMineSettingViewController.m in Sources */,
|
||||
237054882B1F3B3200F5DE14 /* MewEmptyTableViewCell.m in Sources */,
|
||||
237053142B1F3A3D00F5DE14 /* MewClientConfig.m in Sources */,
|
||||
@@ -1361,11 +1289,10 @@
|
||||
23270C292B0E037300B9303B /* MewMessageConentAudioView.m in Sources */,
|
||||
230D63792B58FB8F00DADC14 /* MewRoomMicSeatView.swift in Sources */,
|
||||
23F1E6AA2B5AC639004777A2 /* MewCollectListItemModel.swift in Sources */,
|
||||
23F1E6B02B5AC9AA004777A2 /* MewNIMMsgInfoModel.swift in Sources */,
|
||||
237053902B1F3AA100F5DE14 /* MewSessionListViewController.m in Sources */,
|
||||
23F1E6912B5A872F004777A2 /* MewUtility+MewDevice.m in Sources */,
|
||||
230D62F12B55463500DADC14 /* R.generated.swift in Sources */,
|
||||
23F1E6C12B5B6387004777A2 /* MewGetPointList.m in Sources */,
|
||||
23107DBF2B5BB77D00F96550 /* MewUserPhoneLoginVC.swift in Sources */,
|
||||
237054A72B1F3B3200F5DE14 /* MewHUDTool.m in Sources */,
|
||||
23F1E6B22B5ACAE8004777A2 /* MewAppleInfoModel.swift in Sources */,
|
||||
237054AD2B1F3B3200F5DE14 /* YYReachability.m in Sources */,
|
||||
@@ -1373,7 +1300,6 @@
|
||||
230D63752B58FB8F00DADC14 /* MewRoomPlayVC.swift in Sources */,
|
||||
237054812B1F3B3200F5DE14 /* MewStackManager.m in Sources */,
|
||||
8C9C84552B0C697A00A601BC /* MewLoginForgetEditView.m in Sources */,
|
||||
8C9C84542B0C697A00A601BC /* MewLoginInputView.m in Sources */,
|
||||
233757632B0CB577001D0B7F /* MewMessageContentUnSupportView.m in Sources */,
|
||||
2337575E2B0CB577001D0B7F /* MewNIMMessageMaker.m in Sources */,
|
||||
230D63B32B59293B00DADC14 /* MewMainHomeBannerInfoModel.m in Sources */,
|
||||
@@ -1382,29 +1308,28 @@
|
||||
8C9C84532B0C697A00A601BC /* MewLoginForgetPasswordViewController.m in Sources */,
|
||||
237054BB2B1F3BF600F5DE14 /* MewTabBarController.m in Sources */,
|
||||
237053882B1F3AA100F5DE14 /* MewRechargeViewController.m in Sources */,
|
||||
23107DC72B5BE03000F96550 /* MewFillInfoVC.swift in Sources */,
|
||||
2370539E2B1F3AA100F5DE14 /* MewPlayVoiceView.m in Sources */,
|
||||
2337575B2B0CB577001D0B7F /* UIView+NIM.m in Sources */,
|
||||
233757652B0CB577001D0B7F /* MewSessionNavView.m in Sources */,
|
||||
8CAB97012B1FE16000ED8639 /* UITableView+NIMScrollToBottom.m in Sources */,
|
||||
233757592B0CB577001D0B7F /* MewNIMBadgeView.m in Sources */,
|
||||
237054A42B1F3B3200F5DE14 /* MewTimeIntervalUtils.m in Sources */,
|
||||
23F1E6C42B5B6E97004777A2 /* MewNavigationVC.m in Sources */,
|
||||
23107DBA2B5BA9E600F96550 /* MewNIMMsgInfoModel.m in Sources */,
|
||||
23107DC52B5BB7EB00F96550 /* MewUserPhoneLoginInputView.swift in Sources */,
|
||||
230D639E2B5926D800DADC14 /* MewMainHomeEmptyCell.m in Sources */,
|
||||
230D637A2B58FB8F00DADC14 /* MewRoomMsgView.swift in Sources */,
|
||||
23F1E6B42B5AD383004777A2 /* MewAppColor.swift in Sources */,
|
||||
237053892B1F3AA100F5DE14 /* MewMineCollectionViewController.m in Sources */,
|
||||
230D638C2B59010C00DADC14 /* MewMicListModel.swift in Sources */,
|
||||
23270C2C2B0E041300B9303B /* MewMessageAudioCenter.m in Sources */,
|
||||
23F1E6CC2B5B7ACF004777A2 /* UImage+MewSetImageInfo.m in Sources */,
|
||||
8C9C84442B0C697A00A601BC /* MewMineCollectRoomCell.m in Sources */,
|
||||
237053A32B1F3AA100F5DE14 /* MewRightFollowVoiceCollectionCell.m in Sources */,
|
||||
2370538C2B1F3AA100F5DE14 /* MewLoginPasswordView.m in Sources */,
|
||||
237053992B1F3AA100F5DE14 /* MewHomeViewController.m in Sources */,
|
||||
23F1E6922B5A872F004777A2 /* MewUtility.m in Sources */,
|
||||
23F1E6932B5A872F004777A2 /* MewUtility+MewApp.m in Sources */,
|
||||
8C4D53622AFD4CF700238AE6 /* main.m in Sources */,
|
||||
233757642B0CB577001D0B7F /* MewMessageContentText.m in Sources */,
|
||||
230D63BE2B592EA800DADC14 /* UserGameInfoVo.m in Sources */,
|
||||
2370538D2B1F3AA100F5DE14 /* MewLoginNumberViewController.m in Sources */,
|
||||
237054A62B1F3B3200F5DE14 /* MEWBase64.m in Sources */,
|
||||
230D637E2B58FB8F00DADC14 /* MewRoomPlayTopView.swift in Sources */,
|
||||
23F1E6BB2B5B5F28004777A2 /* MewGetColorTool.m in Sources */,
|
||||
@@ -1413,7 +1338,6 @@
|
||||
23F1E69E2B5A9463004777A2 /* MewLoginTokenInfoModel.swift in Sources */,
|
||||
237054AF2B1F3B3200F5DE14 /* MewPaymentAction.swift in Sources */,
|
||||
8C9C844C2B0C697A00A601BC /* MewCustomAttachmentDecoder.m in Sources */,
|
||||
2370538B2B1F3AA100F5DE14 /* MewLoginPhoneView.m in Sources */,
|
||||
23F1E6A82B5AC547004777A2 /* MewMineCellInfoModel.swift in Sources */,
|
||||
237054A32B1F3B3200F5DE14 /* MEWCountDownHelper.m in Sources */,
|
||||
230D631F2B5585AE00DADC14 /* MewEncryptManager.m in Sources */,
|
||||
@@ -1442,11 +1366,10 @@
|
||||
8C9C84472B0C697A00A601BC /* MewMineCollectionTableViewCell.m in Sources */,
|
||||
230D637C2B58FB8F00DADC14 /* MewRoomTransferMsgView.swift in Sources */,
|
||||
23F1E6A42B5ABFE0004777A2 /* MewInitInfoModel.swift in Sources */,
|
||||
2370538E2B1F3AA100F5DE14 /* MewLoginViewController.m in Sources */,
|
||||
2370549F2B1F3B3200F5DE14 /* UIImage+RW.m in Sources */,
|
||||
230D637B2B58FB8F00DADC14 /* MewRoomPlayTopFilterView.swift in Sources */,
|
||||
230D63182B557DE700DADC14 /* MewServerApi.swift in Sources */,
|
||||
230D63762B58FB8F00DADC14 /* MewRoomPlayRightView.swift in Sources */,
|
||||
23F1E6C72B5B70EF004777A2 /* MewUserLoginViewController.swift in Sources */,
|
||||
8C92A8072B0EEDD0008F362C /* MewLoginVerifBindPhoneViewController.m in Sources */,
|
||||
230D63982B5926B400DADC14 /* MewMainHomeMoreGameVC.m in Sources */,
|
||||
2370538A2B1F3AA100F5DE14 /* MewRechargeSubView.m in Sources */,
|
||||
@@ -1458,10 +1381,9 @@
|
||||
23F1E69C2B5A93FB004777A2 /* MewNetworkDataModel.m in Sources */,
|
||||
237053A02B1F3AA100F5DE14 /* MewShowVoiceView.m in Sources */,
|
||||
237053A12B1F3AA100F5DE14 /* MewUserIntroductionView.m in Sources */,
|
||||
23107DC32B5BB7C000F96550 /* MewUserPhonePasswordView.swift in Sources */,
|
||||
23F1E6AC2B5AC7D3004777A2 /* MewPayItemModel.swift in Sources */,
|
||||
8C9C84562B0C697A00A601BC /* MewLoginFullInfoViewController.m in Sources */,
|
||||
2370539B2B1F3AA100F5DE14 /* MewPushExclusiveVoiceView.m in Sources */,
|
||||
237054802B1F3B3200F5DE14 /* UIImage+MewUtils.m in Sources */,
|
||||
8C92A8142B0EF1D8008F362C /* MewMineLoginPasswordViewController.m in Sources */,
|
||||
237053A22B1F3AA100F5DE14 /* MewHeaderView.m in Sources */,
|
||||
233757602B0CB577001D0B7F /* MewSessionViewController.m in Sources */,
|
||||
|
@@ -43,7 +43,7 @@ typedef void(^MewOCServerManagerSucceed)(MewNetworkDataModel* _Nullable obj, NSI
|
||||
failureBlock:(void (^)(NSNumber *code, NSString *message))failureBlock;
|
||||
+ (void)mewPublishSoundInfo:(MewOCServerManagerSucceed)successBlock dura:(NSString *)dura desc:(NSString *)desc gender:(NSString *)gender url:(NSString *)url;
|
||||
+ (void)mewGetCollectRoomListData:(MewOCServerManagerSucceed)successBlock uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize roomType:(NSString *)roomType;
|
||||
+ (void)mewLogout:(MewOCServerManagerSucceed)successBlock auaccess_token:(NSString *)access_token;
|
||||
+ (void)mewLogout:(MewOCServerManagerSucceed)successBlock access_token:(NSString *)access_token;
|
||||
+ (void)mewGetDetailData:(MewOCServerManagerSucceed)successBlock uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize;
|
||||
+ (void)mewLikeUsr:(MewOCServerManagerSucceed)successBlock uid:(NSString *)uid likedUid:(NSString *)likedUid ticket:(NSString *)ticket type:(NSString *)type;
|
||||
+ (void)mewGetListStatus:(MewOCServerManagerSucceed)successBlock uid:(NSString *)uid isLikeUid:(NSString *)isLikeUid;
|
||||
@@ -80,6 +80,8 @@ typedef void(^MewOCServerManagerSucceed)(MewNetworkDataModel* _Nullable obj, NSI
|
||||
+ (void)mewGetDiamondCount:(MewOCServerManagerSucceed)successBlock
|
||||
uid:(NSString *)uid
|
||||
ticket:(NSString *)ticket;
|
||||
+ (void)mewCollectRoomRoomAction:(MewOCServerManagerSucceed)successBlock roomUid:(NSString *)roomUid uid:(NSString *)uid type:(NSString *)type roomUids:(NSString *)roomUids;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -66,7 +66,7 @@
|
||||
dic:(NSDictionary *)dic
|
||||
successBlock:(void (^)(MewNetworkDataModel *model))successBlock
|
||||
failBlock:(void (^)(NSInteger num, NSString *text))failBlock {
|
||||
dic = [self mewSetParmars:dic];
|
||||
dic = [self mewSetParmars:dic];
|
||||
[[MewOCServerManager share] POST:path parameters:dic headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
MewNetworkDataModel *obj = [MewNetworkDataModel mj_objectWithKeyValues:responseObject];
|
||||
|
||||
@@ -234,7 +234,7 @@
|
||||
+ (void)mewGetCollectRoomListData:(MewOCServerManagerSucceed)successBlock uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize roomType:(NSString *)roomType{
|
||||
[MewOCServerManager mewRequestData:[MewEncryptManager mewAESDecryptText:@"xbrIaF3tjG37mRyRC97ZrffhHg2YaksxPephr1wGtYI="] type:MewOCServerManagerTypeGET successBlock:successBlock,__FUNCTION__,uid,page,pageSize,roomType,nil];
|
||||
}
|
||||
+ (void)mewLogout:(MewOCServerManagerSucceed)successBlock auaccess_token:(NSString *)access_token {
|
||||
+ (void)mewLogout:(MewOCServerManagerSucceed)successBlock access_token:(NSString *)access_token {
|
||||
[MewOCServerManager mewRequestData:[MewEncryptManager mewAESDecryptText:@"73cfDtRGGthZvJUN7DktoA=="] type:MewOCServerManagerTypePOST successBlock:successBlock,__FUNCTION__,access_token,nil];
|
||||
}
|
||||
+ (void)mewGetDetailData:(MewOCServerManagerSucceed)successBlock uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize{
|
||||
@@ -325,4 +325,7 @@
|
||||
ticket:(NSString *)ticket{
|
||||
[MewOCServerManager mewRequestData:[MewEncryptManager mewAESDecryptText:@"7xFYk5dOEOCLb2Sfp0mwZw=="] type:MewOCServerManagerTypeGET successBlock:successBlock,__FUNCTION__,uid,ticket,nil];
|
||||
}
|
||||
+ (void)mewCollectRoomRoomAction:(MewOCServerManagerSucceed)successBlock roomUid:(NSString *)roomUid uid:(NSString *)uid type:(NSString *)type roomUids:(NSString *)roomUids{
|
||||
[MewOCServerManager mewRequestData:[MewEncryptManager mewAESDecryptText:@"GQiHXUlHz3kGtxBxaDpYOg=="] type:MewOCServerManagerTypePOST successBlock:successBlock,__FUNCTION__,roomUid,type,uid,roomUids,nil];
|
||||
}
|
||||
@end
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
#import <YYText/YYText.h>
|
||||
#import <YYText/YYTextLayout.h>
|
||||
|
||||
#import "UImage+MewSetImageInfo.h"
|
||||
#import "MewGetColorTool.h"
|
||||
#import <UIImageView+WebCache.h>
|
||||
#import <SDImageCache.h>
|
||||
@@ -29,3 +29,8 @@
|
||||
#import "MewGetPointList.h"
|
||||
#import <AFNetworking.h>
|
||||
#import <FFPopup/FFPopup.h>
|
||||
#import "MewNIMMsgInfoModel.h"
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
#import "DESEncrypt.h"
|
||||
#import "MEWCountDownHelper.h"
|
||||
#import "MewLoginForgetPasswordViewController.h"
|
||||
|
@@ -14,9 +14,9 @@
|
||||
#import "MewEncryptManager.h"
|
||||
#import "yinmeng_ios-Swift.h"
|
||||
|
||||
|
||||
#import "UImage+MewSetImageInfo.h"
|
||||
#import <MJExtension/MJExtension.h>
|
||||
|
||||
#import "MewNIMMsgInfoModel.h"
|
||||
#import "MewNavigationVC.h"
|
||||
#import "UIButton+MewSetButtomArea.h"
|
||||
#import "MewNetworkDataModel.h"
|
||||
|
@@ -1,17 +0,0 @@
|
||||
//
|
||||
// MewMewTimeIntervalUtils.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/1.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewTimeIntervalUtils : NSObject
|
||||
/// 时间戳转换成字符串
|
||||
+ (NSString*)mewShowTime:(NSTimeInterval) msglastTime showDetail:(BOOL)showDetail;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,91 +0,0 @@
|
||||
//
|
||||
// MewTimeIntervalUtils.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/1.
|
||||
//
|
||||
|
||||
#import "MewTimeIntervalUtils.h"
|
||||
|
||||
@implementation MewTimeIntervalUtils
|
||||
/// 时间戳转换成字符串
|
||||
+ (NSString*)mewShowTime:(NSTimeInterval) msglastTime showDetail:(BOOL)showDetail {
|
||||
//今天的时间
|
||||
NSDate * nowDate = [NSDate date];
|
||||
NSDate * msgDate = [NSDate dateWithTimeIntervalSince1970:msglastTime];
|
||||
NSString *result = nil;
|
||||
NSCalendarUnit components = (NSCalendarUnit)(NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitWeekday|NSCalendarUnitHour | NSCalendarUnitMinute);
|
||||
NSDateComponents *nowDateComponents = [[NSCalendar currentCalendar] components:components fromDate:nowDate];
|
||||
NSDateComponents *msgDateComponents = [[NSCalendar currentCalendar] components:components fromDate:msgDate];
|
||||
|
||||
NSInteger hour = msgDateComponents.hour;
|
||||
double OnedayTimeIntervalValue = 24*60*60; //一天的秒数
|
||||
|
||||
result = [self mewGetPeriodOfTime:hour withMinute:msgDateComponents.minute];
|
||||
if (hour > 12)
|
||||
{
|
||||
hour = hour - 12;
|
||||
}
|
||||
|
||||
BOOL isSameMonth = (nowDateComponents.year == msgDateComponents.year) && (nowDateComponents.month == msgDateComponents.month);
|
||||
|
||||
if(isSameMonth && (nowDateComponents.day == msgDateComponents.day)) //同一天,显示时间
|
||||
{
|
||||
result = [[NSString alloc] initWithFormat:@"%@ %zd:%02d",result,hour,(int)msgDateComponents.minute];
|
||||
}
|
||||
else if(isSameMonth && (nowDateComponents.day == (msgDateComponents.day+1)))//昨天
|
||||
{
|
||||
result = showDetail? [[NSString alloc] initWithFormat:@"昨天%@ %zd:%02d",result,hour,(int)msgDateComponents.minute] : @"昨天";
|
||||
}
|
||||
else if(isSameMonth && (nowDateComponents.day == (msgDateComponents.day+2))) //前天
|
||||
{
|
||||
result = showDetail? [[NSString alloc] initWithFormat:@"前天%@ %zd:%02d",result,hour,(int)msgDateComponents.minute] : @"前天";
|
||||
}
|
||||
else if([nowDate timeIntervalSinceDate:msgDate] < 7 * OnedayTimeIntervalValue)//一周内
|
||||
{
|
||||
NSString *weekDay = [self mewWeekdayStr:msgDateComponents.weekday];
|
||||
result = showDetail? [weekDay stringByAppendingFormat:@"%@ %zd:%02d",result,hour,(int)msgDateComponents.minute] : weekDay;
|
||||
}
|
||||
else//显示日期
|
||||
{
|
||||
NSString *day = [NSString stringWithFormat:@"%zd-%zd-%zd", msgDateComponents.year, msgDateComponents.month, msgDateComponents.day];
|
||||
result = showDetail? [day stringByAppendingFormat:@"%@ %zd:%02d",result,hour,(int)msgDateComponents.minute]:day;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#pragma mark - Private
|
||||
+ (NSString *)mewGetPeriodOfTime:(NSInteger)time withMinute:(NSInteger)minute {
|
||||
NSInteger totalMin = time *60 + minute;
|
||||
NSString *showPeriodOfTime = @"";
|
||||
if (totalMin > 0 && totalMin <= 5 * 60)
|
||||
{
|
||||
showPeriodOfTime = @"凌晨";
|
||||
}
|
||||
else if (totalMin > 5 * 60 && totalMin < 12 * 60)
|
||||
{
|
||||
showPeriodOfTime = @"上午";
|
||||
}
|
||||
else if (totalMin >= 12 * 60 && totalMin <= 18 * 60)
|
||||
{
|
||||
showPeriodOfTime = @"下午";
|
||||
}
|
||||
else if ((totalMin > 18 * 60 && totalMin <= (23 * 60 + 59)) || totalMin == 0)
|
||||
{
|
||||
showPeriodOfTime = @"晚上";
|
||||
}
|
||||
return showPeriodOfTime;
|
||||
}
|
||||
|
||||
+ (NSString*)mewWeekdayStr:(NSInteger)dayOfWeek {
|
||||
static NSDictionary *daysOfWeekDict = nil;
|
||||
daysOfWeekDict = @{@(1):@"星期日",
|
||||
@(2):@"星期一",
|
||||
@(3):@"星期二",
|
||||
@(4):@"星期三",
|
||||
@(5):@"星期四",
|
||||
@(6):@"星期五",
|
||||
@(7):@"星期六",};
|
||||
return [daysOfWeekDict objectForKey:@(dayOfWeek)];
|
||||
}
|
||||
@end
|
@@ -1,322 +0,0 @@
|
||||
/**
|
||||
* Copyright © Sud.Tech
|
||||
* https://sud.tech
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface UIImage (RW)
|
||||
|
||||
#pragma mark - Create image
|
||||
///=============================================================================
|
||||
/// @name Create image
|
||||
///=============================================================================
|
||||
|
||||
/**
|
||||
Create an animated image with GIF data. After created, you can access
|
||||
the images via property '.images'. If the data is not animated gif, this
|
||||
function is same as [UIImage imageWithData:data scale:scale];
|
||||
|
||||
@discussion It has a better display performance, but costs more memory
|
||||
(width * height * frames Bytes). It only suited to display small
|
||||
gif such as animated emoticon. If you want to display large gif,
|
||||
see `YYImage`.
|
||||
|
||||
@param data GIF data.
|
||||
|
||||
@param scale The scale factor
|
||||
|
||||
@return A new image created from GIF, or nil when an error occurs.
|
||||
*/
|
||||
+ (nullable UIImage *)imageWithSmallGIFData:(NSData *)data scale:(CGFloat)scale;
|
||||
|
||||
/**
|
||||
Whether the data is animated GIF.
|
||||
|
||||
@param data Image data
|
||||
|
||||
@return Returns YES only if the data is gif and contains more than one frame,
|
||||
otherwise returns NO.
|
||||
*/
|
||||
+ (BOOL)isAnimatedGIFData:(NSData *)data;
|
||||
|
||||
/**
|
||||
Whether the file in the specified path is GIF.
|
||||
|
||||
@param path An absolute file path.
|
||||
|
||||
@return Returns YES if the file is gif, otherwise returns NO.
|
||||
*/
|
||||
+ (BOOL)isAnimatedGIFFile:(NSString *)path;
|
||||
|
||||
/**
|
||||
Create an image from a PDF file data or path.
|
||||
|
||||
@discussion If the PDF has multiple page, is just return's the first page's
|
||||
content. Image's scale is equal to current screen's scale, size is same as
|
||||
PDF's origin size.
|
||||
|
||||
@param dataOrPath PDF data in `NSData`, or PDF file path in `NSString`.
|
||||
|
||||
@return A new image create from PDF, or nil when an error occurs.
|
||||
*/
|
||||
+ (nullable UIImage *)imageWithPDF:(id)dataOrPath;
|
||||
|
||||
/**
|
||||
Create an image from a PDF file data or path.
|
||||
|
||||
@discussion If the PDF has multiple page, is just return's the first page's
|
||||
content. Image's scale is equal to current screen's scale.
|
||||
|
||||
@param dataOrPath PDF data in `NSData`, or PDF file path in `NSString`.
|
||||
|
||||
@param size The new image's size, PDF's content will be stretched as needed.
|
||||
|
||||
@return A new image create from PDF, or nil when an error occurs.
|
||||
*/
|
||||
+ (nullable UIImage *)imageWithPDF:(id)dataOrPath size:(CGSize)size;
|
||||
|
||||
/**
|
||||
Create a square image from apple emoji.
|
||||
|
||||
@discussion It creates a square image from apple emoji, image's scale is equal
|
||||
to current screen's scale. The original emoji image in `AppleColorEmoji` font
|
||||
is in size 160*160 px.
|
||||
|
||||
@param emoji single emoji, such as @"😄".
|
||||
|
||||
@param size image's size.
|
||||
|
||||
@return Image from emoji, or nil when an error occurs.
|
||||
*/
|
||||
+ (nullable UIImage *)imageWithEmoji:(NSString *)emoji size:(CGFloat)size;
|
||||
|
||||
/**
|
||||
Create and return a 1x1 point size image with the given color.
|
||||
|
||||
@param color The color.
|
||||
*/
|
||||
+ (nullable UIImage *)mew_imageWithColor:(UIColor *)color;
|
||||
|
||||
/**
|
||||
Create and return a pure color image with the given color and size.
|
||||
|
||||
@param color The color.
|
||||
@param size New image's type.
|
||||
*/
|
||||
+ (nullable UIImage *)mew_imageWithColor:(UIColor *)color size:(CGSize)size;
|
||||
|
||||
/**
|
||||
Create and return an image with custom draw code.
|
||||
|
||||
@param size The image size.
|
||||
@param drawBlock The draw block.
|
||||
|
||||
@return The new image.
|
||||
*/
|
||||
+ (nullable UIImage *)mew_imageWithSize:(CGSize)size drawBlock:(void (^)(CGContextRef context))drawBlock;
|
||||
|
||||
#pragma mark - Image Info
|
||||
///=============================================================================
|
||||
/// @name Image Info
|
||||
///=============================================================================
|
||||
|
||||
/**
|
||||
Whether this image has alpha channel.
|
||||
*/
|
||||
- (BOOL)hasAlphaChannel;
|
||||
|
||||
|
||||
#pragma mark - Modify Image
|
||||
///=============================================================================
|
||||
/// @name Modify Image
|
||||
///=============================================================================
|
||||
|
||||
/**
|
||||
Returns a new image which is scaled from this image.
|
||||
The image will be stretched as needed.
|
||||
|
||||
@param size The new size to be scaled, values should be positive.
|
||||
|
||||
@return The new image with the given size.
|
||||
*/
|
||||
- (nullable UIImage *)imageByResizeToSize:(CGSize)size;
|
||||
|
||||
|
||||
/**
|
||||
Returns a new image which is cropped from this image.
|
||||
|
||||
@param rect Image's inner rect.
|
||||
|
||||
@return The new image, or nil if an error occurs.
|
||||
*/
|
||||
- (nullable UIImage *)imageByCropToRect:(CGRect)rect;
|
||||
|
||||
/**
|
||||
Returns a new image which is edge inset from this image.
|
||||
|
||||
@param insets Inset (positive) for each of the edges, values can be negative to 'outset'.
|
||||
|
||||
@param color Extend edge's fill color, nil means clear color.
|
||||
|
||||
@return The new image, or nil if an error occurs.
|
||||
*/
|
||||
- (nullable UIImage *)imageByInsetEdge:(UIEdgeInsets)insets withColor:(nullable UIColor *)color;
|
||||
|
||||
/**
|
||||
Rounds a new image with a given corner size.
|
||||
|
||||
@param radius The radius of each corner oval. Values larger than half the
|
||||
rectangle's width or height are clamped appropriately to half
|
||||
the width or height.
|
||||
*/
|
||||
- (nullable UIImage *)imageByRoundCornerRadius:(CGFloat)radius;
|
||||
|
||||
|
||||
/// high speed get RoundCornerRadius Image
|
||||
/// @param radius radius
|
||||
- (UIImage *)imageByRoundCornerRadius2:(CGFloat)radius;
|
||||
/**
|
||||
Rounds a new image with a given corner size.
|
||||
|
||||
@param radius The radius of each corner oval. Values larger than half the
|
||||
rectangle's width or height are clamped appropriately to
|
||||
half the width or height.
|
||||
@param borderWidth The inset border line width. Values larger than half the rectangle's
|
||||
width or height are clamped appropriately to half the width
|
||||
or height.
|
||||
|
||||
@param borderColor The border stroke color. nil means clear color.
|
||||
*/
|
||||
- (nullable UIImage *)imageByRoundCornerRadius:(CGFloat)radius
|
||||
borderWidth:(CGFloat)borderWidth
|
||||
borderColor:(nullable UIColor *)borderColor;
|
||||
|
||||
/**
|
||||
Rounds a new image with a given corner size.
|
||||
|
||||
@param radius The radius of each corner oval. Values larger than half the
|
||||
rectangle's width or height are clamped appropriately to
|
||||
half the width or height.
|
||||
|
||||
@param corners A bitmask value that identifies the corners that you want
|
||||
rounded. You can use this parameter to round only a subset
|
||||
of the corners of the rectangle.
|
||||
|
||||
@param borderWidth The inset border line width. Values larger than half the rectangle's
|
||||
width or height are clamped appropriately to half the width
|
||||
or height.
|
||||
|
||||
@param borderColor The border stroke color. nil means clear color.
|
||||
|
||||
@param borderLineJoin The border line join.
|
||||
*/
|
||||
- (nullable UIImage *)imageByRoundCornerRadius:(CGFloat)radius
|
||||
corners:(UIRectCorner)corners
|
||||
borderWidth:(CGFloat)borderWidth
|
||||
borderColor:(nullable UIColor *)borderColor
|
||||
borderLineJoin:(CGLineJoin)borderLineJoin;
|
||||
|
||||
/**
|
||||
Returns a new rotated image (relative to the center).
|
||||
|
||||
@param radians Rotated radians in counterclockwise.⟲
|
||||
|
||||
@param fitSize YES: new image's size is extend to fit all content.
|
||||
NO: image's size will not change, content may be clipped.
|
||||
*/
|
||||
- (nullable UIImage *)imageByRotate:(CGFloat)radians fitSize:(BOOL)fitSize;
|
||||
|
||||
/**
|
||||
Returns a new image rotated counterclockwise by a quarter‑turn (90°). ⤺
|
||||
The width and height will be exchanged.
|
||||
*/
|
||||
- (nullable UIImage *)imageByRotateLeft90;
|
||||
|
||||
/**
|
||||
Returns a new image rotated clockwise by a quarter‑turn (90°). ⤼
|
||||
The width and height will be exchanged.
|
||||
*/
|
||||
- (nullable UIImage *)imageByRotateRight90;
|
||||
|
||||
/**
|
||||
Returns a new image rotated 180° . ↻
|
||||
*/
|
||||
- (nullable UIImage *)imageByRotate180;
|
||||
|
||||
/**
|
||||
Returns a vertically flipped image. ⥯
|
||||
*/
|
||||
- (nullable UIImage *)imageByFlipVertical;
|
||||
|
||||
/**
|
||||
Returns a horizontally flipped image. ⇋
|
||||
*/
|
||||
- (nullable UIImage *)imageByFlipHorizontal;
|
||||
|
||||
- (UIImage *)imageByGrayscale;
|
||||
|
||||
/**
|
||||
Applies a blur effect to this image. Suitable for blur any content.
|
||||
*/
|
||||
- (nullable UIImage *)imageByBlurSoft;
|
||||
|
||||
/**
|
||||
Applies a blur effect to this image. Suitable for blur any content except pure white.
|
||||
(same as iOS Control Panel)
|
||||
*/
|
||||
- (nullable UIImage *)imageByBlurLight;
|
||||
|
||||
/**
|
||||
Applies a blur effect to this image. Suitable for displaying black text.
|
||||
(same as iOS Navigation Bar White)
|
||||
*/
|
||||
- (nullable UIImage *)imageByBlurExtraLight;
|
||||
|
||||
/**
|
||||
Applies a blur effect to this image. Suitable for displaying white text.
|
||||
(same as iOS Notification Center)
|
||||
*/
|
||||
- (nullable UIImage *)imageByBlurDark;
|
||||
|
||||
- (UIImage *)imageByBlurWithTint:(UIColor *)tintColor;
|
||||
|
||||
- (UIImage *)imageByTintColor:(UIColor *)color;
|
||||
|
||||
/**
|
||||
* 高斯模糊
|
||||
*/
|
||||
+ (UIImage *)gaussianFilter:(UIImage *)originImage;
|
||||
+ (UIImage *)blurryImage:(UIImage *)image withBlurLevel:(CGFloat)blur;
|
||||
+ (UIImage *)blurryImage1:(UIImage *)image withBlurLevel:(CGFloat)blur;
|
||||
|
||||
/**
|
||||
* 拍照图片旋转
|
||||
*/
|
||||
- (UIImage *)normalizedImage;
|
||||
|
||||
/// 合成两张图片,btmImg在底部,topImg在顶部,rect是顶部图片相对底部图片的位置
|
||||
+ (UIImage*)synthesisWithBottomImage:(UIImage *)btmImg topImage:(UIImage*)topImg withTopRect:(CGRect)rect;
|
||||
|
||||
/**
|
||||
* 指定图片大小压缩
|
||||
*/
|
||||
+ (UIImage *)compressImage:(UIImage *)image toByte:(NSUInteger)maxLength;
|
||||
|
||||
/// 缩小图片到指定尺寸
|
||||
- (nullable UIImage*)scaleToSize:(CGSize)size;
|
||||
|
||||
|
||||
/// 给图片加上标签
|
||||
- (UIImage*)addText:(NSString*)text
|
||||
XPos:(int)xpos
|
||||
YPos:(int)ypos
|
||||
bgColor:(UIColor*)bgColor
|
||||
textColor:(UIColor*)textColor;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
File diff suppressed because it is too large
Load Diff
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// MewUtility+MewApp.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/6.
|
||||
//
|
||||
|
||||
#import "MewUtility.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewUtility (MewApp)
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,137 +0,0 @@
|
||||
//
|
||||
// MewUtility+MewApp.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/6.
|
||||
//
|
||||
|
||||
#import "MewUtility+MewApp.h"
|
||||
|
||||
@implementation MewUtility (MewApp)
|
||||
+ (id)valueInPlistForKey:(NSString *)key{
|
||||
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
|
||||
return [infoDictionary objectForKey:key];
|
||||
}
|
||||
|
||||
+ (NSString *)appVersion{
|
||||
static NSString *appVersion = nil;
|
||||
if (!appVersion) {
|
||||
appVersion = [self valueInPlistForKey:@"CFBundleShortVersionString"];
|
||||
}
|
||||
return appVersion;
|
||||
}
|
||||
|
||||
+ (NSString *)appName {
|
||||
return @"yinmeng";
|
||||
}
|
||||
|
||||
+ (NSString *)appBuild{
|
||||
static NSString *appBuild = nil;
|
||||
if (!appBuild) {
|
||||
appBuild = [self valueInPlistForKey:(NSString *)kCFBundleVersionKey];
|
||||
}
|
||||
return appBuild;
|
||||
}
|
||||
|
||||
+ (NSString *)appBundleId{
|
||||
static NSString *appBundleId = nil;
|
||||
if (!appBundleId) {
|
||||
appBundleId = [self valueInPlistForKey:(NSString *)kCFBundleIdentifierKey];
|
||||
}
|
||||
return appBundleId;
|
||||
}
|
||||
|
||||
|
||||
+ (NSString *)svnVersion{
|
||||
static NSString *svnVersion = nil;
|
||||
if (!svnVersion) {
|
||||
svnVersion = [self valueInPlistForKey:@"SvnBuildVersion"];
|
||||
}
|
||||
return svnVersion;
|
||||
}
|
||||
|
||||
static NSString * const kMobileFrameworkResourceBundleName = @"YYMobileFrameworkRes";
|
||||
|
||||
+ (NSURL *)URLForMobileFrameworkResourceBundle{
|
||||
return [[NSBundle mainBundle] URLForResource:kMobileFrameworkResourceBundleName
|
||||
withExtension:@"bundle"];
|
||||
}
|
||||
|
||||
+ (NSString *)pathForMobileFrameworkResourceBundle{
|
||||
return [[NSBundle mainBundle] pathForResource:kMobileFrameworkResourceBundleName
|
||||
ofType:@"bundle"];
|
||||
}
|
||||
|
||||
+ (NSString *)buildType{
|
||||
#ifdef DEBUG
|
||||
return @"DEBUG";
|
||||
#else
|
||||
return @"RELEASE";
|
||||
#endif
|
||||
}
|
||||
|
||||
+ (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)fileURL{
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath:[fileURL path]]) {
|
||||
NSLog(@"File %@ dosen't exist!", fileURL);
|
||||
return NO;
|
||||
}
|
||||
|
||||
NSError *error = nil;
|
||||
BOOL result = [fileURL setResourceValue:[NSNumber numberWithBool:YES]
|
||||
forKey:NSURLIsExcludedFromBackupKey
|
||||
error:&error];
|
||||
if (!result) {
|
||||
NSLog(@"Error excluding '%@' from backup, error: %@.", fileURL, error);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static NSString *_from = nil;
|
||||
|
||||
+ (NSString *)getAppSource{
|
||||
if (_from == nil) {
|
||||
NSString *path = [[NSBundle mainBundle] pathForResource:@"sourceid.dat" ofType:nil];
|
||||
|
||||
NSError *error;
|
||||
NSString *from = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&error];
|
||||
|
||||
// 去除换行及空格
|
||||
if (from) {
|
||||
from = [self removeSpaceAndNewline:from];
|
||||
}
|
||||
// 如果读到有值且不为0
|
||||
if (!error
|
||||
&& ![from isEqualToString:@"0"]
|
||||
&& ![from isEqualToString:@""]) {
|
||||
_from = from;
|
||||
} else {
|
||||
// if (isEnterprise) {
|
||||
// _from = @"yinmeng_Enterprise"; // 企业包
|
||||
// }else {
|
||||
// _from = @"mew_appstore"; // App Store包
|
||||
// }
|
||||
_from = @"yinmeng_appstore"; // 企业包
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return _from;
|
||||
}
|
||||
|
||||
+ (BOOL)isFromAppStore{
|
||||
if([[[MewUtility getAppSource] lowercaseString] isEqualToString:@"appstore"]){
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
||||
+ (NSString *)removeSpaceAndNewline:(NSString *)str{
|
||||
NSString *temp = [str stringByReplacingOccurrencesOfString:@" " withString:@""];
|
||||
temp = [temp stringByReplacingOccurrencesOfString:@"\r" withString:@""];
|
||||
temp = [temp stringByReplacingOccurrencesOfString:@"\n" withString:@""];
|
||||
return temp;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// MewUtility+MewDevice.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/6.
|
||||
//
|
||||
|
||||
#import "MewUtility.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewUtility (MewDevice)
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,537 +0,0 @@
|
||||
//
|
||||
// MewUtility+MewDevice.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/6.
|
||||
//
|
||||
|
||||
#import "MewUtility+MewDevice.h"
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
#import <AssetsLibrary/AssetsLibrary.h>
|
||||
|
||||
#import "MewUtility.h"
|
||||
#import <sys/utsname.h>
|
||||
#import <arpa/inet.h>
|
||||
#import <net/if.h>
|
||||
#import <ifaddrs.h>
|
||||
#import "YYReachability.h"
|
||||
#import <AdSupport/ASIdentifierManager.h>
|
||||
|
||||
#import <ifaddrs.h>
|
||||
#import <net/if_dl.h>
|
||||
#import <sys/socket.h>
|
||||
#import "SSKeychain.h"
|
||||
|
||||
|
||||
|
||||
#if !defined(IFT_ETHER)
|
||||
#define IFT_ETHER 0x6
|
||||
#endif
|
||||
|
||||
#define kIOSCellular @"pdp_ip0"
|
||||
#define kIOSWifi @"en0"
|
||||
#define kIPAddrV4 @"ipv4"
|
||||
#define kIPAddrV6 @"ipv6"
|
||||
#define kAppName @"yym51ip"
|
||||
@implementation MewUtility (MewDevice)
|
||||
+ (NSString *)modelName
|
||||
{
|
||||
static NSString *modelName = nil;
|
||||
if (!modelName) {
|
||||
struct utsname systemInfo;
|
||||
uname(&systemInfo);
|
||||
modelName = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
|
||||
}
|
||||
return modelName;
|
||||
}
|
||||
|
||||
+ (NSString *)systemVersion
|
||||
{
|
||||
// 调用非常频繁,主要在cleanSpecialText中
|
||||
static NSString* _systemVersion = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
_systemVersion = [UIDevice currentDevice].systemVersion;;
|
||||
});
|
||||
|
||||
if (_systemVersion) {
|
||||
return _systemVersion;
|
||||
}
|
||||
|
||||
return [UIDevice currentDevice].systemVersion;
|
||||
}
|
||||
|
||||
+ (NSString *)identifierForVendor
|
||||
{
|
||||
static NSString *idfv = nil;
|
||||
if (!idfv) {
|
||||
idfv = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
|
||||
}
|
||||
return idfv;
|
||||
}
|
||||
|
||||
+ (NSString *)deviceID
|
||||
{
|
||||
NSString *deviceID = @"";
|
||||
if (!deviceID || deviceID.length == 0) {
|
||||
deviceID = [MewUtility identifierForVendor];
|
||||
}
|
||||
|
||||
if (!deviceID) {
|
||||
deviceID = @"";
|
||||
}
|
||||
|
||||
return deviceID;
|
||||
}
|
||||
|
||||
+ (NSInteger)networkStatus
|
||||
{
|
||||
return (self.reachability.currentReachabilityStatus);
|
||||
}
|
||||
+(NSInteger)carrierIdentifier{
|
||||
return 1;
|
||||
}
|
||||
+ (YYReachability *)reachability
|
||||
{
|
||||
static YYReachability *reachability = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
reachability = [YYReachability reachabilityForInternetConnection];
|
||||
});
|
||||
return reachability;
|
||||
}
|
||||
|
||||
|
||||
+ (void)checkCameraAvailable:(void (^)(void))available denied:(void(^)(void))denied restriction:(void(^)(void))restriction
|
||||
{
|
||||
available = available ? : ^{};
|
||||
denied = denied ? : ^{};
|
||||
restriction = restriction ? : ^{};
|
||||
|
||||
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
|
||||
{
|
||||
// iOS7下,需要检查iPhone的隐私和访问限制项
|
||||
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
|
||||
switch (authStatus) {
|
||||
case AVAuthorizationStatusAuthorized:
|
||||
{
|
||||
available();
|
||||
break;
|
||||
}
|
||||
case AVAuthorizationStatusDenied:
|
||||
{
|
||||
// [设置->隐私->相机]中禁止了YY访问相机
|
||||
denied();
|
||||
break;
|
||||
}
|
||||
case AVAuthorizationStatusRestricted:
|
||||
{
|
||||
// NOTE: 这个跟[设置-通用-访问限制]似乎没有关系
|
||||
restriction();
|
||||
break;
|
||||
}
|
||||
case AVAuthorizationStatusNotDetermined:
|
||||
{
|
||||
[AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {
|
||||
|
||||
dispatch_sync(dispatch_get_main_queue(), ^(){
|
||||
if (granted)
|
||||
{
|
||||
available();
|
||||
}
|
||||
else
|
||||
{
|
||||
denied();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
restriction();
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)checkAssetsLibrayAvailable:(void (^)(void))available denied:(void(^)(void))denied restriction:(void(^)(void))restriction
|
||||
{
|
||||
available = available ? : ^{};
|
||||
denied = denied ? : ^{};
|
||||
restriction = restriction ? : ^{};
|
||||
|
||||
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary] ||
|
||||
[UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeSavedPhotosAlbum]) {
|
||||
ALAuthorizationStatus author = [ALAssetsLibrary authorizationStatus];
|
||||
if (author == ALAuthorizationStatusNotDetermined) {
|
||||
ALAssetsLibrary *assetLibrary = [[ALAssetsLibrary alloc] init];
|
||||
[assetLibrary enumerateGroupsWithTypes:ALAssetsGroupAll usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
|
||||
if (*stop) {
|
||||
available();
|
||||
return;
|
||||
}
|
||||
*stop = TRUE;
|
||||
} failureBlock:^(NSError *error) {
|
||||
denied();
|
||||
}];
|
||||
}else if (author == ALAuthorizationStatusDenied) {
|
||||
denied();
|
||||
}else if(author == ALAuthorizationStatusRestricted) {
|
||||
restriction();
|
||||
}else if(author == ALAuthorizationStatusAuthorized) {
|
||||
available();
|
||||
}
|
||||
}else {
|
||||
restriction();
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)checkMicPrivacy:(void(^)(BOOL succeed))resultBlock
|
||||
{
|
||||
[[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) {
|
||||
if (resultBlock) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
resultBlock(granted);
|
||||
});
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
+ (NSString *)deviceUniqueIdentification {
|
||||
// SSKeychain
|
||||
NSString * currentDeviceUUIDStr = [SSKeychain passwordForService:@" " account:@"uuid"];
|
||||
if (currentDeviceUUIDStr == nil || [currentDeviceUUIDStr isEqualToString:@""])
|
||||
{
|
||||
NSUUID * currentDeviceUUID = [UIDevice currentDevice].identifierForVendor;
|
||||
currentDeviceUUIDStr = currentDeviceUUID.UUIDString;
|
||||
currentDeviceUUIDStr = [currentDeviceUUIDStr stringByReplacingOccurrencesOfString:@"-" withString:@""];
|
||||
currentDeviceUUIDStr = [currentDeviceUUIDStr lowercaseString];
|
||||
[SSKeychain setPassword: currentDeviceUUIDStr forService:@" "account:@"uuid"];
|
||||
}
|
||||
return currentDeviceUUIDStr;
|
||||
}
|
||||
|
||||
+ (NSString *)ipAddress
|
||||
{
|
||||
return [self ipAddress:YES];
|
||||
}
|
||||
|
||||
+ (NSString *)ipAddress:(BOOL)preferIPv4
|
||||
{
|
||||
NSArray *searchArray = preferIPv4 ?
|
||||
@[ kIOSWifi @"/" kIPAddrV4, kIOSWifi @"/" kIPAddrV6, kIOSCellular @"/" kIPAddrV4, kIOSCellular @"/" kIPAddrV6 ] :
|
||||
@[ kIOSWifi @"/" kIPAddrV6, kIOSWifi @"/" kIPAddrV4, kIOSCellular @"/" kIPAddrV6, kIOSCellular @"/" kIPAddrV4 ] ;
|
||||
|
||||
NSDictionary *addresses = [self getIpAddresses];
|
||||
|
||||
__block NSString *addr;
|
||||
[searchArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
|
||||
addr = addresses[obj];
|
||||
if (addr) {
|
||||
*stop = YES;
|
||||
}
|
||||
}];
|
||||
return addr ? : @"0.0.0.0";
|
||||
}
|
||||
|
||||
+ (NSDictionary *)getIpAddresses
|
||||
{
|
||||
NSMutableDictionary *addresses = [NSMutableDictionary dictionary];
|
||||
|
||||
// retrieve the current interfaces - return 0 on success
|
||||
struct ifaddrs *interfaces;
|
||||
if (!getifaddrs(&interfaces)) {
|
||||
// Loop through linked list of interfaces
|
||||
struct ifaddrs *interface;
|
||||
for (interface = interfaces; interface; interface = interface->ifa_next) {
|
||||
if (!(interface -> ifa_flags & IFF_UP)) {
|
||||
continue;
|
||||
}
|
||||
const struct sockaddr_in *addr = (const struct sockaddr_in *)interface->ifa_addr;
|
||||
char addrBuf[MAX(INET_ADDRSTRLEN, INET6_ADDRSTRLEN) + 2];
|
||||
if (addr && (addr->sin_family == AF_INET || addr->sin_family == AF_INET6)) {
|
||||
NSString *ifaName = [NSString stringWithUTF8String:interface->ifa_name];
|
||||
NSString *ifaType;
|
||||
if (addr->sin_family == AF_INET) {
|
||||
if (inet_ntop(AF_INET, &addr->sin_addr, addrBuf, INET_ADDRSTRLEN)) {
|
||||
ifaType = kIPAddrV4;
|
||||
}
|
||||
} else {
|
||||
const struct sockaddr_in6 *addr6 = (const struct sockaddr_in6 *)interface->ifa_addr;
|
||||
if (inet_ntop(AF_INET6, &addr6->sin6_addr, addrBuf, INET6_ADDRSTRLEN)) {
|
||||
ifaType = kIPAddrV6;
|
||||
}
|
||||
}
|
||||
if (ifaType) {
|
||||
NSString *key = [NSString stringWithFormat:@"%@/%@", ifaName, ifaType];
|
||||
addresses[key] = [NSString stringWithUTF8String:addrBuf];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// free memory
|
||||
freeifaddrs(interfaces);
|
||||
return addresses;
|
||||
}
|
||||
|
||||
+ (NSString *)macAddresss
|
||||
{
|
||||
static NSMutableString *macAddress = nil;
|
||||
|
||||
if ([macAddress length] > 0) {
|
||||
return macAddress;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
struct ifaddrs* addrs;
|
||||
if ( getifaddrs( &addrs ) )
|
||||
break;
|
||||
|
||||
const struct ifaddrs *cursor = addrs;
|
||||
while ( cursor )
|
||||
{
|
||||
if ( ( cursor->ifa_addr->sa_family == AF_LINK )
|
||||
&& strcmp( "en0", cursor->ifa_name ) == 0
|
||||
&& ( ( ( const struct sockaddr_dl * )cursor->ifa_addr)->sdl_type == IFT_ETHER ) )
|
||||
{
|
||||
const struct sockaddr_dl *dlAddr = ( const struct sockaddr_dl * )cursor->ifa_addr;
|
||||
const uint8_t *base = ( const uint8_t * )&dlAddr->sdl_data[dlAddr->sdl_nlen];
|
||||
|
||||
macAddress = [[NSMutableString alloc] initWithCapacity:64];
|
||||
|
||||
for ( int i = 0; i < dlAddr->sdl_alen; i++ )
|
||||
{
|
||||
if (i > 0) {
|
||||
[macAddress appendFormat:@":%02X", base[i]];
|
||||
}
|
||||
else
|
||||
{
|
||||
[macAddress appendFormat:@"%02X", base[i]];
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
cursor = cursor->ifa_next;
|
||||
}
|
||||
freeifaddrs(addrs);
|
||||
} while (NO);
|
||||
|
||||
if (macAddress == nil) {
|
||||
macAddress = [NSMutableString stringWithString:@""];
|
||||
}
|
||||
|
||||
return macAddress;
|
||||
}
|
||||
|
||||
+ (NSString *)idfa
|
||||
{
|
||||
static NSString *idfa = nil;
|
||||
if (!idfa) {
|
||||
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 6.0) {
|
||||
idfa = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
|
||||
} else {
|
||||
idfa = @"";
|
||||
}
|
||||
}
|
||||
return idfa;
|
||||
}
|
||||
|
||||
|
||||
+ (NSString*)modelType {
|
||||
|
||||
struct utsname systemInfo;
|
||||
|
||||
uname(&systemInfo);
|
||||
|
||||
NSString*platform = [NSString stringWithCString: systemInfo.machine encoding:NSASCIIStringEncoding];
|
||||
|
||||
if([platform isEqualToString:@"iPhone1,1"])return@"iPhone 2G";
|
||||
|
||||
if([platform isEqualToString:@"iPhone1,2"])return@"iPhone 3G";
|
||||
|
||||
if([platform isEqualToString:@"iPhone2,1"])return@"iPhone 3GS";
|
||||
|
||||
if([platform isEqualToString:@"iPhone3,1"])return@"iPhone 4";
|
||||
|
||||
if([platform isEqualToString:@"iPhone3,2"])return@"iPhone 4";
|
||||
|
||||
if([platform isEqualToString:@"iPhone3,3"])return@"iPhone 4";
|
||||
|
||||
if([platform isEqualToString:@"iPhone4,1"])return@"iPhone 4S";
|
||||
|
||||
if([platform isEqualToString:@"iPhone5,1"])return@"iPhone 5";
|
||||
|
||||
if([platform isEqualToString:@"iPhone5,2"])return@"iPhone 5";
|
||||
|
||||
if([platform isEqualToString:@"iPhone5,3"])return@"iPhone 5c";
|
||||
|
||||
if([platform isEqualToString:@"iPhone5,4"])return@"iPhone 5c";
|
||||
|
||||
if([platform isEqualToString:@"iPhone6,1"])return@"iPhone 5s";
|
||||
|
||||
if([platform isEqualToString:@"iPhone6,2"])return@"iPhone 5s";
|
||||
|
||||
if([platform isEqualToString:@"iPhone7,1"])return@"iPhone 6 Plus";
|
||||
|
||||
if([platform isEqualToString:@"iPhone7,2"])return@"iPhone 6";
|
||||
|
||||
if([platform isEqualToString:@"iPhone8,1"])return@"iPhone 6s";
|
||||
|
||||
if([platform isEqualToString:@"iPhone8,2"])return@"iPhone 6s Plus";
|
||||
|
||||
if([platform isEqualToString:@"iPhone8,4"])return@"iPhone SE";
|
||||
|
||||
if([platform isEqualToString:@"iPhone9,1"])return@"iPhone 7";
|
||||
|
||||
if([platform isEqualToString:@"iPhone9,2"])return@"iPhone 7 Plus";
|
||||
|
||||
if([platform isEqualToString:@"iPhone10,1"])return@"iPhone 8";
|
||||
|
||||
if([platform isEqualToString:@"iPhone10,4"])return@"iPhone 8";
|
||||
|
||||
if([platform isEqualToString:@"iPhone10,2"])return@"iPhone 8 Plus";
|
||||
|
||||
if([platform isEqualToString:@"iPhone10,5"])return@"iPhone 8 Plus";
|
||||
|
||||
if([platform isEqualToString:@"iPhone10,3"])return@"iPhone X";
|
||||
|
||||
if([platform isEqualToString:@"iPhone10,6"])return@"iPhone X";
|
||||
|
||||
if([platform isEqualToString:@"iPod1,1"])return@"iPod Touch 1G";
|
||||
|
||||
if([platform isEqualToString:@"iPod2,1"])return@"iPod Touch 2G";
|
||||
|
||||
if([platform isEqualToString:@"iPod3,1"])return@"iPod Touch 3G";
|
||||
|
||||
if([platform isEqualToString:@"iPod4,1"])return@"iPod Touch 4G";
|
||||
|
||||
if([platform isEqualToString:@"iPod5,1"])return@"iPod Touch 5G";
|
||||
|
||||
if([platform isEqualToString:@"iPad1,1"])return@"iPad 1G";
|
||||
|
||||
if([platform isEqualToString:@"iPad2,1"])return@"iPad 2";
|
||||
|
||||
if([platform isEqualToString:@"iPad2,2"])return@"iPad 2";
|
||||
|
||||
if([platform isEqualToString:@"iPad2,3"])return@"iPad 2";
|
||||
|
||||
if([platform isEqualToString:@"iPad2,4"])return@"iPad 2";
|
||||
|
||||
if([platform isEqualToString:@"iPad2,5"])return@"iPad Mini 1G";
|
||||
|
||||
if([platform isEqualToString:@"iPad2,6"])return@"iPad Mini 1G";
|
||||
|
||||
if([platform isEqualToString:@"iPad2,7"])return@"iPad Mini 1G";
|
||||
|
||||
if([platform isEqualToString:@"iPad3,1"])return@"iPad 3";
|
||||
|
||||
if([platform isEqualToString:@"iPad3,2"])return@"iPad 3";
|
||||
|
||||
if([platform isEqualToString:@"iPad3,3"])return@"iPad 3";
|
||||
|
||||
if([platform isEqualToString:@"iPad3,4"])return@"iPad 4";
|
||||
|
||||
if([platform isEqualToString:@"iPad3,5"])return@"iPad 4";
|
||||
|
||||
if([platform isEqualToString:@"iPad3,6"])return@"iPad 4";
|
||||
|
||||
if([platform isEqualToString:@"iPad4,1"])return@"iPad Air";
|
||||
|
||||
if([platform isEqualToString:@"iPad4,2"])return@"iPad Air";
|
||||
|
||||
if([platform isEqualToString:@"iPad4,3"])return@"iPad Air";
|
||||
|
||||
if([platform isEqualToString:@"iPad4,4"])return@"iPad Mini 2G";
|
||||
|
||||
if([platform isEqualToString:@"iPad4,5"])return@"iPad Mini 2G";
|
||||
|
||||
if([platform isEqualToString:@"iPad4,6"])return@"iPad Mini 2G";
|
||||
|
||||
if([platform isEqualToString:@"iPad4,7"])return@"iPad Mini 3";
|
||||
|
||||
if([platform isEqualToString:@"iPad4,8"])return@"iPad Mini 3";
|
||||
|
||||
if([platform isEqualToString:@"iPad4,9"])return@"iPad Mini 3";
|
||||
|
||||
if([platform isEqualToString:@"iPad5,1"])return@"iPad Mini 4";
|
||||
|
||||
if([platform isEqualToString:@"iPad5,2"])return@"iPad Mini 4";
|
||||
|
||||
if([platform isEqualToString:@"iPad5,3"])return@"iPad Air 2";
|
||||
|
||||
if([platform isEqualToString:@"iPad5,4"])return@"iPad Air 2";
|
||||
|
||||
if([platform isEqualToString:@"iPad6,3"])return@"iPad Pro 9.7";
|
||||
|
||||
if([platform isEqualToString:@"iPad6,4"])return@"iPad Pro 9.7";
|
||||
|
||||
if([platform isEqualToString:@"iPad6,7"])return@"iPad Pro 12.9";
|
||||
|
||||
if([platform isEqualToString:@"iPad6,8"])return@"iPad Pro 12.9";
|
||||
|
||||
if([platform isEqualToString:@"i386"])return@"iPhone Simulator";
|
||||
|
||||
if([platform isEqualToString:@"x86_64"])return@"iPhone Simulator";
|
||||
|
||||
return platform;
|
||||
|
||||
}
|
||||
|
||||
// 当前设备是否低于, 等于 iPhone6
|
||||
+ (BOOL)isIphone6AndLow {
|
||||
struct utsname systemInfo;
|
||||
|
||||
uname(&systemInfo);
|
||||
|
||||
NSString*platform = [NSString stringWithCString: systemInfo.machine encoding:NSASCIIStringEncoding];
|
||||
if([platform isEqualToString:@"iPhone1,1"])return YES;
|
||||
|
||||
if([platform isEqualToString:@"iPhone1,2"])return YES;
|
||||
|
||||
if([platform isEqualToString:@"iPhone2,1"])return YES;
|
||||
|
||||
if([platform isEqualToString:@"iPhone3,1"])return YES;
|
||||
|
||||
if([platform isEqualToString:@"iPhone3,2"])return YES;
|
||||
|
||||
if([platform isEqualToString:@"iPhone3,3"])return YES;
|
||||
|
||||
if([platform isEqualToString:@"iPhone4,1"])return YES;
|
||||
|
||||
if([platform isEqualToString:@"iPhone5,1"])return YES;
|
||||
|
||||
if([platform isEqualToString:@"iPhone5,2"])return YES;
|
||||
|
||||
if([platform isEqualToString:@"iPhone5,3"])return YES;
|
||||
|
||||
if([platform isEqualToString:@"iPhone5,4"])return YES;
|
||||
|
||||
if([platform isEqualToString:@"iPhone6,1"])return YES;
|
||||
|
||||
if([platform isEqualToString:@"iPhone6,2"])return YES;
|
||||
|
||||
if([platform isEqualToString:@"iPhone7,1"])return YES;
|
||||
|
||||
if([platform isEqualToString:@"iPhone7,2"])return YES;
|
||||
|
||||
if ([platform isEqualToString:@"iPhone8,1"]) return YES;
|
||||
|
||||
if ([platform isEqualToString:@"iPhone8,3"]) return YES;
|
||||
|
||||
if ([platform isEqualToString:@"iPhone8,4"]) return YES;
|
||||
|
||||
if ([platform isEqualToString:@"iPhone9,1"]) return YES;
|
||||
|
||||
if ([platform isEqualToString:@"iPhone9,3"]) return YES;
|
||||
|
||||
return NO;
|
||||
}
|
||||
@end
|
@@ -1,224 +0,0 @@
|
||||
//
|
||||
// MewUtility
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/6.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
@class CTCarrier;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewUtility : NSObject
|
||||
|
||||
@end
|
||||
|
||||
@interface MewUtility (MewApp)
|
||||
/*==============================*/
|
||||
/* App Utilities */
|
||||
|
||||
/**
|
||||
* 从YYMobile-Info.plist中读取字段
|
||||
*
|
||||
* @param key 键
|
||||
*
|
||||
* @return 值
|
||||
*/
|
||||
+ (id)valueInPlistForKey:(NSString *)key;
|
||||
|
||||
/**
|
||||
* 获取App版本号, 从plist从读取CFBundleShortVersion
|
||||
*/
|
||||
+ (NSString *)appVersion;
|
||||
|
||||
/**
|
||||
* 获取AppBuild号, 从plist中读取CFBundleVersion
|
||||
*/
|
||||
+ (NSString *)appBuild;
|
||||
|
||||
/**
|
||||
* 当前构建出的版本在svn中的版本号
|
||||
*/
|
||||
+ (NSString *)svnVersion;
|
||||
|
||||
/**
|
||||
获取appName
|
||||
|
||||
@return app的名称
|
||||
*/
|
||||
+ (NSString *)appName;
|
||||
|
||||
/**
|
||||
* 获取bundle id
|
||||
*
|
||||
* @return bundle id
|
||||
*/
|
||||
+ (NSString *)appBundleId;
|
||||
|
||||
/**
|
||||
* 获取YYMobileFrameworkRes.bundle的URL
|
||||
*/
|
||||
+ (NSURL *)URLForMobileFrameworkResourceBundle;
|
||||
|
||||
/**
|
||||
* 获取YYMobileFrameworkRes.bundle的路径
|
||||
*/
|
||||
+ (NSString *)pathForMobileFrameworkResourceBundle;
|
||||
|
||||
+ (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)fileURL;
|
||||
|
||||
/**
|
||||
* 获取当前的构建类型(DEBUG/RELEASE)
|
||||
*
|
||||
* @return 构建类型
|
||||
*/
|
||||
+ (NSString *)buildType;
|
||||
|
||||
/**
|
||||
* 获取平台渠道
|
||||
*/
|
||||
+ (NSString *)getAppSource;
|
||||
|
||||
/**
|
||||
* 是否来自appstore
|
||||
*/
|
||||
+ (BOOL)isFromAppStore;
|
||||
|
||||
@end
|
||||
|
||||
/*==============================*/
|
||||
/* Carrier Utilities */
|
||||
/*==============================*/
|
||||
@interface MewUtility (Carrier)
|
||||
|
||||
|
||||
/**
|
||||
获取设备唯一标识
|
||||
|
||||
@return 唯一标识
|
||||
*/
|
||||
+ (NSString *)deviceUniqueIdentification;
|
||||
|
||||
/**
|
||||
* 获取运营商
|
||||
*/
|
||||
+ (CTCarrier *)carrier;
|
||||
|
||||
/**
|
||||
* 获取运营商类型
|
||||
*/
|
||||
+ (NSInteger)carrierIdentifier;
|
||||
|
||||
/**
|
||||
* 获取运营商名称
|
||||
*/
|
||||
+ (NSString *)carrierName;
|
||||
|
||||
/**
|
||||
* 从CTCarrier对象获取网络类型
|
||||
* @param carrier - CTCarrier对象
|
||||
* @return CarrierType
|
||||
*/
|
||||
+ (NSInteger)identifierOfCarrier:(CTCarrier *)carrier;
|
||||
|
||||
@end
|
||||
|
||||
/*==============================*/
|
||||
/* Device Utilities */
|
||||
/*==============================*/
|
||||
@interface MewUtility (MewDevice)
|
||||
|
||||
/**
|
||||
* 获取modelName, 如iPhone5,2
|
||||
*/
|
||||
+ (NSString *)modelName;
|
||||
|
||||
|
||||
/**
|
||||
获取设备类型
|
||||
|
||||
@return 设备类型
|
||||
*/
|
||||
+ (NSString*)modelType;
|
||||
|
||||
/**
|
||||
* 获取系统版本
|
||||
*/
|
||||
+ (NSString *)systemVersion;
|
||||
|
||||
/**
|
||||
* 获取当前设备的 IDFV,IDFV 在某些情况下会变,不建议将其作为设备标识
|
||||
*/
|
||||
+ (NSString *)identifierForVendor NS_AVAILABLE_IOS(6_0);
|
||||
|
||||
/**
|
||||
* 获取当前的设备标识,会使用海度 SDK 中的 OpenUDID
|
||||
*
|
||||
* @return 海度 SDK 缓存的 OpenUDID
|
||||
*/
|
||||
+ (NSString *)deviceID;
|
||||
|
||||
/**
|
||||
* 获取当前网络状态
|
||||
*/
|
||||
+ (NSInteger)networkStatus;
|
||||
|
||||
/**
|
||||
* 获取当前IP地址
|
||||
*/
|
||||
+ (NSString *)ipAddress;
|
||||
|
||||
/**
|
||||
* 获取当前IP地址
|
||||
*
|
||||
* @param preferIPv4 优先取IPv4的地址
|
||||
*/
|
||||
+ (NSString *)ipAddress:(BOOL)preferIPv4;
|
||||
|
||||
/**
|
||||
* 检查Camera是否可用, 可用则调用available; 若隐私设置中禁用了本app对相机
|
||||
* 的访问, 则调用denied; 否则视为被限制, 调用restriction
|
||||
*
|
||||
* @param available 可用
|
||||
* @param denied 不可用
|
||||
* @param restriction 受限制
|
||||
*/
|
||||
+ (void)checkCameraAvailable:(void (^)(void))available denied:(void(^)(void))denied restriction:(void(^)(void))restriction;
|
||||
|
||||
/**
|
||||
* 检查相册是否可用, 可用则调用available; 若隐私设置中禁用了本app对相册
|
||||
* 的访问, 则调用denied; 否则视为被限制, 调用restriction
|
||||
*
|
||||
* @param available 可用
|
||||
* @param denied 不可用
|
||||
* @param restriction 受限制
|
||||
*/
|
||||
+ (void)checkAssetsLibrayAvailable:(void (^)(void))available denied:(void(^)(void))denied restriction:(void(^)(void))restriction;
|
||||
|
||||
/**
|
||||
检查麦克风权限
|
||||
|
||||
@param resultBlock 结果处理block
|
||||
*/
|
||||
+ (void)checkMicPrivacy:(void(^)(BOOL succeed))resultBlock;
|
||||
|
||||
+ (NSString *)macAddresss;
|
||||
+ (NSString *)idfa;
|
||||
|
||||
/**
|
||||
* 初始化信令sdk,imsdk所用到的appName
|
||||
*
|
||||
* @return app name
|
||||
*/
|
||||
+ (NSString *)appName;
|
||||
|
||||
|
||||
/**
|
||||
当前设备是否低于, 等于 iPhone6
|
||||
|
||||
@return 当前设备是否低于, 等于 iPhone6
|
||||
*/
|
||||
+ (BOOL)isIphone6AndLow;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,12 +0,0 @@
|
||||
//
|
||||
// MewUtility.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/6.
|
||||
//
|
||||
|
||||
#import "MewUtility.h"
|
||||
|
||||
@implementation MewUtility
|
||||
|
||||
@end
|
@@ -1,53 +0,0 @@
|
||||
//
|
||||
// UIImage+MewUtils.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
typedef NS_ENUM(NSUInteger, GradientType) {
|
||||
MewGradientTypeTopToBottom = 0,//从上到小
|
||||
MewGradientTypeLeftToRight = 1,//从左到右
|
||||
MewGradientTypeUpleftToLowright = 2,//左上到右下
|
||||
MewGradientTypeUprightToLowleft = 3,//右上到左下
|
||||
};
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface UIImage (MewUtils)
|
||||
- (UIImage *)mew_grayscaleImage;
|
||||
|
||||
- (UIImage *)mew_imageBlendInGray;
|
||||
|
||||
- (UIImage *)mew_imageWithBlendMode:(CGBlendMode)blendMode;
|
||||
|
||||
+ (UIImage *)mew_imageWithColor:(UIColor *)color;
|
||||
|
||||
+ (UIImage *)mew_imageWithColor:(UIColor *)color size:(CGSize)size;
|
||||
|
||||
+ (UIImage *)mew_fixOrientation:(UIImage *)aImage;
|
||||
|
||||
- (UIImage *)mew_imageWithColor:(UIColor *)color;
|
||||
|
||||
- (UIImage *)mew_setCornerWithRadius:(CGFloat)radius andSize:(CGSize)size;
|
||||
|
||||
//异步生成纯色圆角图片
|
||||
- (void)mew_imageWithSize:(CGSize)size radius:(CGFloat)radius backColor:(UIColor *)backColor completion:(void(^)(UIImage *image))completion;
|
||||
/**
|
||||
返回指定大小,颜色,渐变模式的渐变色图片
|
||||
*/
|
||||
+ (UIImage *)mew_gradientColorImageFromColors:(NSArray<UIColor *>*)colors gradientType:(GradientType)gradientType imgSize:(CGSize)imgSize;
|
||||
|
||||
+ (UIImage *)mew_waterImageWithImage:(UIImage *)image waterImage:(UIImage *)waterImage waterImageRect:(CGRect)rect;
|
||||
|
||||
+ (CGSize)mew_sizeWithImageOriginSize:(CGSize)originSize
|
||||
minSize:(CGSize)imageMinSize
|
||||
maxSize:(CGSize)imageMaxSize;
|
||||
|
||||
///裁剪图片
|
||||
- (UIImage *)mew_cutImage:(CGSize)newSize;
|
||||
///判断是否为gif图片
|
||||
+ (BOOL)mew_isGifWithImageData: (NSData *)data;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,433 +0,0 @@
|
||||
//
|
||||
// UIImage+MewUtils.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import "UIImage+MewUtils.h"
|
||||
#import <ImageIO/ImageIO.h>
|
||||
@implementation UIImage (MewUtils)
|
||||
- (UIImage *)mew_grayscaleImage
|
||||
{
|
||||
CGFloat width = self.size.width;
|
||||
CGFloat height = self.size.height;
|
||||
|
||||
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray();
|
||||
|
||||
CGContextRef context = CGBitmapContextCreate(nil,
|
||||
width,
|
||||
height,
|
||||
8,
|
||||
0,
|
||||
colorSpace,
|
||||
kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedLast);
|
||||
CGColorSpaceRelease(colorSpace);
|
||||
|
||||
if (context == NULL) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
CGContextDrawImage(context, CGRectMake(0, 0, width, height), self.CGImage);
|
||||
CGImageRef imageRef = CGBitmapContextCreateImage(context);
|
||||
UIImage *mew_grayscaleImage = [UIImage imageWithCGImage:imageRef];
|
||||
CGImageRelease(imageRef);
|
||||
CGContextRelease(context);
|
||||
|
||||
return mew_grayscaleImage;
|
||||
}
|
||||
|
||||
|
||||
- (UIImage *)mew_imageBlendInGray {
|
||||
|
||||
UIGraphicsBeginImageContext(self.size);
|
||||
CGRect bounds = CGRectMake(0, 0, self.size.width, self.size.height);
|
||||
CGContextRef context = UIGraphicsGetCurrentContext();
|
||||
CGContextFillRect(context, bounds);
|
||||
[self drawInRect:bounds blendMode:kCGBlendModeLuminosity alpha:1.0f];
|
||||
[self drawInRect:bounds blendMode:kCGBlendModeDestinationIn alpha:1.0f];
|
||||
UIImage *newImg = UIGraphicsGetImageFromCurrentImageContext();
|
||||
UIGraphicsEndImageContext();
|
||||
|
||||
return newImg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (UIImage *)mew_imageWithBlendMode:(CGBlendMode)blendMode {
|
||||
|
||||
UIGraphicsBeginImageContextWithOptions(self.size, NO, 0.0f);
|
||||
CGRect bounds = CGRectMake(0, 0, self.size.width, self.size.height);
|
||||
UIRectFill(bounds);
|
||||
|
||||
[self drawInRect:bounds blendMode:blendMode alpha:1.0f];
|
||||
|
||||
if (blendMode != kCGBlendModeDestinationIn) {
|
||||
[self drawInRect:bounds blendMode:kCGBlendModeDestinationIn alpha:1.0f];
|
||||
}
|
||||
UIImage *newImg = UIGraphicsGetImageFromCurrentImageContext();
|
||||
UIGraphicsEndImageContext();
|
||||
return newImg;
|
||||
}
|
||||
|
||||
+ (UIImage *)mew_imageWithColor:(UIColor *)color
|
||||
{
|
||||
return [self mew_imageWithColor:color size:CGSizeMake(1, 1)];
|
||||
}
|
||||
|
||||
+ (UIImage *)mew_imageWithColor:(UIColor *)color size:(CGSize)size {
|
||||
if (!color || size.width <= 0 || size.height <= 0) return nil;
|
||||
CGRect rect = CGRectMake(0.0f, 0.0f, size.width + 1, size.height);
|
||||
UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0);
|
||||
CGContextRef context = UIGraphicsGetCurrentContext();
|
||||
CGContextSetFillColorWithColor(context, color.CGColor);
|
||||
CGContextFillRect(context, rect);
|
||||
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
|
||||
UIGraphicsEndImageContext();
|
||||
return image;
|
||||
}
|
||||
|
||||
+ (UIImage *)mew_fixOrientation:(UIImage *)aImage {
|
||||
|
||||
// No-op if the orientation is already correct
|
||||
if (aImage.imageOrientation == UIImageOrientationUp)
|
||||
return aImage;
|
||||
|
||||
// We need to calculate the proper transformation to make the image upright.
|
||||
// We do it in 2 steps: Rotate if Left/Right/Down, and then flip if Mirrored.
|
||||
CGAffineTransform transform = CGAffineTransformIdentity;
|
||||
|
||||
switch (aImage.imageOrientation) {
|
||||
case UIImageOrientationDown:
|
||||
case UIImageOrientationDownMirrored:
|
||||
transform = CGAffineTransformTranslate(transform, aImage.size.width, aImage.size.height);
|
||||
transform = CGAffineTransformRotate(transform, M_PI);
|
||||
break;
|
||||
|
||||
case UIImageOrientationLeft:
|
||||
case UIImageOrientationLeftMirrored:
|
||||
transform = CGAffineTransformTranslate(transform, aImage.size.width, 0);
|
||||
transform = CGAffineTransformRotate(transform, M_PI_2);
|
||||
break;
|
||||
|
||||
case UIImageOrientationRight:
|
||||
case UIImageOrientationRightMirrored:
|
||||
transform = CGAffineTransformTranslate(transform, 0, aImage.size.height);
|
||||
transform = CGAffineTransformRotate(transform, -M_PI_2);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (aImage.imageOrientation) {
|
||||
case UIImageOrientationUpMirrored:
|
||||
case UIImageOrientationDownMirrored:
|
||||
transform = CGAffineTransformTranslate(transform, aImage.size.width, 0);
|
||||
transform = CGAffineTransformScale(transform, -1, 1);
|
||||
break;
|
||||
|
||||
case UIImageOrientationLeftMirrored:
|
||||
case UIImageOrientationRightMirrored:
|
||||
transform = CGAffineTransformTranslate(transform, aImage.size.height, 0);
|
||||
transform = CGAffineTransformScale(transform, -1, 1);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Now we draw the underlying CGImage into a new context, applying the transform
|
||||
// calculated above.
|
||||
CGContextRef ctx = CGBitmapContextCreate(NULL, aImage.size.width, aImage.size.height,
|
||||
CGImageGetBitsPerComponent(aImage.CGImage), 0,
|
||||
CGImageGetColorSpace(aImage.CGImage),
|
||||
CGImageGetBitmapInfo(aImage.CGImage));
|
||||
CGContextConcatCTM(ctx, transform);
|
||||
switch (aImage.imageOrientation) {
|
||||
case UIImageOrientationLeft:
|
||||
case UIImageOrientationLeftMirrored:
|
||||
case UIImageOrientationRight:
|
||||
case UIImageOrientationRightMirrored:
|
||||
// Grr...
|
||||
CGContextDrawImage(ctx, CGRectMake(0,0,aImage.size.height,aImage.size.width), aImage.CGImage);
|
||||
break;
|
||||
|
||||
default:
|
||||
CGContextDrawImage(ctx, CGRectMake(0,0,aImage.size.width,aImage.size.height), aImage.CGImage);
|
||||
break;
|
||||
}
|
||||
|
||||
// And now we just create a new UIImage from the drawing context
|
||||
CGImageRef cgimg = CGBitmapContextCreateImage(ctx);
|
||||
UIImage *img = [UIImage imageWithCGImage:cgimg];
|
||||
CGContextRelease(ctx);
|
||||
CGImageRelease(cgimg);
|
||||
return img;
|
||||
}
|
||||
|
||||
- (UIImage *)mew_imageWithColor:(UIColor *)color {
|
||||
CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
|
||||
UIGraphicsBeginImageContext(rect.size);
|
||||
CGContextRef context = UIGraphicsGetCurrentContext();
|
||||
|
||||
CGContextSetFillColorWithColor(context, [color CGColor]);
|
||||
CGContextFillRect(context, rect);
|
||||
|
||||
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
|
||||
UIGraphicsEndImageContext();
|
||||
|
||||
return image;
|
||||
|
||||
}
|
||||
|
||||
//异步生成纯色圆角图片
|
||||
- (void)mew_imageWithSize:(CGSize)size radius:(CGFloat)radius backColor:(UIColor *)backColor completion:(void(^)(UIImage *image))completion {
|
||||
// 异步绘制裁切
|
||||
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
||||
// 利用绘图建立上下文
|
||||
UIGraphicsBeginImageContextWithOptions(size, true, 0);
|
||||
CGRect rect = CGRectMake(0, 0, size.width, size.height);
|
||||
// 填充颜色
|
||||
[backColor setFill];
|
||||
UIRectFill(rect);
|
||||
// // 贝塞尔裁切
|
||||
// UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:radius];
|
||||
// [path addClip];
|
||||
// [self drawInRect:rect];
|
||||
|
||||
// 获取结果
|
||||
UIImage *resultImage = [UIGraphicsGetImageFromCurrentImageContext() circularImage];
|
||||
// 关闭上下文
|
||||
UIGraphicsEndImageContext();
|
||||
// 主队列回调
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
completion(resultImage);
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
- (UIImage *)circularImage {
|
||||
// 1. 开启图形上下文
|
||||
UIGraphicsBeginImageContextWithOptions(self.size, NO, 0);
|
||||
|
||||
// 2. 描述路径
|
||||
|
||||
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, self.size.width, self.size.height) byRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRight | UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(self.size.width, self.size.height)];
|
||||
// UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(0, 0, self.size.width, self.size.height)];
|
||||
|
||||
// 3. 添加裁减区域
|
||||
[path addClip];
|
||||
|
||||
// 4. 绘制图片
|
||||
[self drawAtPoint:CGPointZero];
|
||||
|
||||
// 5. 从上下文获取图片
|
||||
UIImage * image = UIGraphicsGetImageFromCurrentImageContext();
|
||||
|
||||
// 6. 关闭上下文
|
||||
UIGraphicsEndImageContext();
|
||||
|
||||
// 7. 设置图片
|
||||
return image;
|
||||
}
|
||||
|
||||
+ (UIImage *)mew_gradientColorImageFromColors:(NSArray<UIColor *> *)colors gradientType:(GradientType)gradientType imgSize:(CGSize)imgSize{
|
||||
|
||||
NSMutableArray *ar = [NSMutableArray array];
|
||||
for(UIColor *c in colors) {
|
||||
[ar addObject:(id)c.CGColor];
|
||||
}
|
||||
UIGraphicsBeginImageContextWithOptions(imgSize, YES, 1);
|
||||
CGContextRef context = UIGraphicsGetCurrentContext();
|
||||
CGContextSaveGState(context);
|
||||
CGColorSpaceRef colorSpace = CGColorGetColorSpace([[colors lastObject] CGColor]);
|
||||
CGGradientRef gradient = CGGradientCreateWithColors(colorSpace, (CFArrayRef)ar, NULL);
|
||||
CGPoint start;
|
||||
CGPoint end;
|
||||
switch (gradientType) {
|
||||
case MewGradientTypeTopToBottom:
|
||||
start = CGPointMake(0.0, 0.0);
|
||||
end = CGPointMake(0.0, imgSize.height);
|
||||
break;
|
||||
case MewGradientTypeLeftToRight:
|
||||
start = CGPointMake(0.0, 0.0);
|
||||
end = CGPointMake(imgSize.width, 0.0);
|
||||
break;
|
||||
case MewGradientTypeUpleftToLowright:
|
||||
start = CGPointMake(0.0, 0.0);
|
||||
end = CGPointMake(imgSize.width, imgSize.height);
|
||||
break;
|
||||
case MewGradientTypeUprightToLowleft:
|
||||
start = CGPointMake(imgSize.width, 0.0);
|
||||
end = CGPointMake(0.0, imgSize.height);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
CGContextDrawLinearGradient(context, gradient, start, end, kCGGradientDrawsBeforeStartLocation | kCGGradientDrawsAfterEndLocation);
|
||||
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
|
||||
CGGradientRelease(gradient);
|
||||
CGContextRestoreGState(context);
|
||||
CGColorSpaceRelease(colorSpace);
|
||||
UIGraphicsEndImageContext();
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
- (UIImage *)mew_setCornerWithRadius:(CGFloat)radius andSize:(CGSize)size {
|
||||
//开启图形上下文
|
||||
UIGraphicsBeginImageContext(size);
|
||||
//绘制圆角矩形
|
||||
CGRect rect = CGRectMake(0, 0, size.width, size.height);
|
||||
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect byRoundingCorners:UIRectCornerAllCorners cornerRadii:CGSizeMake(radius, radius)];
|
||||
//将Path添加到上下文中
|
||||
CGContextAddPath(UIGraphicsGetCurrentContext(), path.CGPath);
|
||||
//裁剪上下文
|
||||
CGContextClip(UIGraphicsGetCurrentContext());
|
||||
//将图片绘制到上下文中
|
||||
[self drawInRect:rect];
|
||||
//设置绘制模式
|
||||
CGContextDrawPath(UIGraphicsGetCurrentContext(), kCGPathStroke);
|
||||
//获取图片
|
||||
UIImage *output = UIGraphicsGetImageFromCurrentImageContext();
|
||||
//关闭上下文
|
||||
UIGraphicsEndImageContext();
|
||||
//返回裁剪好的图片
|
||||
return output;
|
||||
}
|
||||
|
||||
// 给图片添加图片水印
|
||||
+ (UIImage *)mew_waterImageWithImage:(UIImage *)image waterImage:(UIImage *)waterImage waterImageRect:(CGRect)rect
|
||||
{
|
||||
//1.获取图片
|
||||
//2.开启上下文
|
||||
UIGraphicsBeginImageContextWithOptions(image.size, NO, 0);
|
||||
//3.绘制背景图片
|
||||
[image drawInRect:CGRectMake(0, 0, image.size.width, image.size.height)];
|
||||
//绘制水印图片到当前上下文
|
||||
[waterImage drawInRect:rect];
|
||||
//4.从上下文中获取新图片
|
||||
UIImage * newImage = UIGraphicsGetImageFromCurrentImageContext();
|
||||
//5.关闭图形上下文
|
||||
UIGraphicsEndImageContext();
|
||||
//返回图片
|
||||
return newImage;
|
||||
}
|
||||
|
||||
+ (CGSize)mew_sizeWithImageOriginSize:(CGSize)originSize
|
||||
minSize:(CGSize)imageMinSize
|
||||
maxSize:(CGSize)imageMaxSiz {
|
||||
CGSize size;
|
||||
NSInteger imageWidth = originSize.width ,imageHeight = originSize.height;
|
||||
NSInteger imageMinWidth = imageMinSize.width, imageMinHeight = imageMinSize.height;
|
||||
NSInteger imageMaxWidth = imageMaxSiz.width, imageMaxHeight = imageMaxSiz.height;
|
||||
if (imageWidth > imageHeight) //宽图
|
||||
{
|
||||
size.height = imageMinHeight; //高度取最小高度
|
||||
size.width = imageWidth * imageMinHeight / imageHeight;
|
||||
if (size.width > imageMaxWidth)
|
||||
{
|
||||
size.width = imageMaxWidth;
|
||||
}
|
||||
}
|
||||
else if(imageWidth < imageHeight)//高图
|
||||
{
|
||||
size.width = imageMinWidth;
|
||||
size.height = imageHeight *imageMinWidth / imageWidth;
|
||||
if (size.height > imageMaxHeight){
|
||||
size.height = imageMaxHeight;
|
||||
}
|
||||
}
|
||||
else//方图
|
||||
{
|
||||
if (imageWidth > imageMaxWidth){
|
||||
size.width = imageMaxWidth;
|
||||
size.height = imageMaxHeight;
|
||||
}else if(imageWidth > imageMinWidth){
|
||||
size.width = imageWidth;
|
||||
size.height = imageHeight;
|
||||
}else{
|
||||
size.width = imageMinWidth;
|
||||
size.height = imageMinHeight;
|
||||
}
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
- (UIImage *)mew_cutImage:(CGSize)newSize{
|
||||
|
||||
CGFloat scale = newSize.height / self.size.height;
|
||||
UIImage *scaleImage = [self mew_originImage:self scaleToSize:CGSizeMake(self.size.width*scale, self.size.height*scale)];
|
||||
//裁剪暂时有问题
|
||||
return scaleImage;
|
||||
}
|
||||
|
||||
- (UIImage*) mew_originImage:(UIImage *)image scaleToSize:(CGSize)size {
|
||||
|
||||
UIGraphicsBeginImageContextWithOptions(size, NO, [UIScreen mainScreen].scale);
|
||||
|
||||
[image drawInRect:CGRectMake(0, 0, size.width, size.height)];
|
||||
|
||||
UIImage* scaledImage = UIGraphicsGetImageFromCurrentImageContext();
|
||||
|
||||
UIGraphicsEndImageContext();
|
||||
|
||||
return scaledImage;
|
||||
}
|
||||
|
||||
+ (BOOL)mew_isGifWithImageData: (NSData *)data {
|
||||
if ([[self mew_contentTypeWithImageData:data] isEqualToString:@"gif"]) {
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
+ (NSString *)mew_contentTypeWithImageData: (NSData *)data {
|
||||
|
||||
uint8_t c;
|
||||
|
||||
[data getBytes:&c length:1];
|
||||
|
||||
switch (c) {
|
||||
|
||||
case 0xFF:
|
||||
|
||||
return @"jpeg";
|
||||
|
||||
case 0x89:
|
||||
|
||||
return @"png";
|
||||
|
||||
case 0x47:
|
||||
|
||||
return @"gif";
|
||||
|
||||
case 0x49:
|
||||
|
||||
case 0x4D:
|
||||
|
||||
return @"tiff";
|
||||
|
||||
case 0x52:
|
||||
|
||||
if ([data length] < 12) {
|
||||
|
||||
return nil;
|
||||
|
||||
}
|
||||
|
||||
NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding];
|
||||
|
||||
if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) {
|
||||
|
||||
return @"webp";
|
||||
|
||||
}
|
||||
|
||||
return nil;
|
||||
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
@end
|
@@ -1,20 +0,0 @@
|
||||
//
|
||||
// UIView+MewFilletCorner.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface UIView (MewFilletCorner)
|
||||
- (void)mew_setCornerWithLeftTopCorner:(CGFloat)leftTop
|
||||
rightTopCorner:(CGFloat)rigtTop
|
||||
bottomLeftCorner:(CGFloat)bottemLeft
|
||||
bottomRightCorner:(CGFloat)bottemRight
|
||||
size:(CGSize)size;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,41 +0,0 @@
|
||||
//
|
||||
// UIView+MewFilletCorner.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2023/12/5.
|
||||
//
|
||||
|
||||
#import "UIView+MewFilletCorner.h"
|
||||
|
||||
@implementation UIView (MewFilletCorner)
|
||||
- (void)mew_setCornerWithLeftTopCorner:(CGFloat)leftTop
|
||||
rightTopCorner:(CGFloat)rigtTop
|
||||
bottomLeftCorner:(CGFloat)bottemLeft
|
||||
bottomRightCorner:(CGFloat)bottemRight
|
||||
size:(CGSize)size {
|
||||
|
||||
CGFloat width = size.width;
|
||||
CGFloat height = size.height;
|
||||
UIBezierPath *maskPath = [UIBezierPath bezierPath];
|
||||
maskPath.lineWidth = 1.0;
|
||||
maskPath.lineCapStyle = kCGLineCapRound;
|
||||
maskPath.lineJoinStyle = kCGLineJoinRound;
|
||||
[maskPath moveToPoint:CGPointMake(bottemRight, height)]; //左下角
|
||||
[maskPath addLineToPoint:CGPointMake(width - bottemRight, height)];
|
||||
|
||||
[maskPath addQuadCurveToPoint:CGPointMake(width, height- bottemRight) controlPoint:CGPointMake(width, height)]; //右下角的圆弧
|
||||
[maskPath addLineToPoint:CGPointMake(width, rigtTop)]; //右边直线
|
||||
|
||||
[maskPath addQuadCurveToPoint:CGPointMake(width - rigtTop, 0) controlPoint:CGPointMake(width, 0)]; //右上角圆弧
|
||||
[maskPath addLineToPoint:CGPointMake(leftTop, 0)]; //顶部直线
|
||||
|
||||
[maskPath addQuadCurveToPoint:CGPointMake(0, leftTop) controlPoint:CGPointMake(0, 0)]; //左上角圆弧
|
||||
[maskPath addLineToPoint:CGPointMake(0, height - bottemLeft)]; //左边直线
|
||||
[maskPath addQuadCurveToPoint:CGPointMake(bottemLeft, height) controlPoint:CGPointMake(0, height)]; //左下角圆弧
|
||||
|
||||
CAShapeLayer *maskLayer = [CAShapeLayer layer];
|
||||
maskLayer.frame = CGRectMake(0, 0, size.width, size.height);
|
||||
maskLayer.path = maskPath.CGPath;
|
||||
self.layer.mask = maskLayer;
|
||||
}
|
||||
@end
|
29
yinmeng-ios/yinmeng-ios/Base/UI/UImage+MewSetImageInfo.h
Normal file
29
yinmeng-ios/yinmeng-ios/Base/UI/UImage+MewSetImageInfo.h
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// MewSetImageInfo.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/1/20.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface UIImage (MewSetImageInfo)
|
||||
+(CAShapeLayer *)mewSetViewCornerWithDirection:(CGFloat)leftTop
|
||||
rightTop:(CGFloat)rigtTop
|
||||
bottomLeft:(CGFloat)bottemLeft
|
||||
bottomRight:(CGFloat)bottemRight
|
||||
size:(CGSize)size ;
|
||||
/**
|
||||
返回指定大小,颜色,渐变模式的渐变色图片
|
||||
*/
|
||||
+ (UIImage *)mewSetColorWithColorList:(NSArray<UIColor *>*)colors type:(mewImageDirectionType)type imgSize:(CGSize)imgSize;
|
||||
|
||||
|
||||
+ (CGSize)mewGetImageSize:(CGSize)originSize
|
||||
minSize:(CGSize)imageMinSize
|
||||
maxSize:(CGSize)imageMaxSize;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
127
yinmeng-ios/yinmeng-ios/Base/UI/UImage+MewSetImageInfo.m
Normal file
127
yinmeng-ios/yinmeng-ios/Base/UI/UImage+MewSetImageInfo.m
Normal file
@@ -0,0 +1,127 @@
|
||||
//
|
||||
// MewSetImageInfo.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/1/20.
|
||||
//
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@implementation UIImage (MewSetImageInfo)
|
||||
|
||||
+ (CAShapeLayer *)mewSetViewCornerWithDirection:(CGFloat)leftTop
|
||||
rightTop:(CGFloat)rigtTop
|
||||
bottomLeft:(CGFloat)bottemLeft
|
||||
bottomRight:(CGFloat)bottemRight
|
||||
size:(CGSize)size {
|
||||
|
||||
CGFloat width = size.width;
|
||||
CGFloat height = size.height;
|
||||
UIBezierPath *maskPath = [UIBezierPath bezierPath];
|
||||
maskPath.lineWidth = 1.0;
|
||||
maskPath.lineCapStyle = kCGLineCapRound;
|
||||
maskPath.lineJoinStyle = kCGLineJoinRound;
|
||||
[maskPath moveToPoint:CGPointMake(bottemRight, height)]; //左下角
|
||||
[maskPath addLineToPoint:CGPointMake(width - bottemRight, height)];
|
||||
|
||||
[maskPath addQuadCurveToPoint:CGPointMake(width, height- bottemRight) controlPoint:CGPointMake(width, height)]; //右下角的圆弧
|
||||
[maskPath addLineToPoint:CGPointMake(width, rigtTop)]; //右边直线
|
||||
|
||||
[maskPath addQuadCurveToPoint:CGPointMake(width - rigtTop, 0) controlPoint:CGPointMake(width, 0)]; //右上角圆弧
|
||||
[maskPath addLineToPoint:CGPointMake(leftTop, 0)]; //顶部直线
|
||||
|
||||
[maskPath addQuadCurveToPoint:CGPointMake(0, leftTop) controlPoint:CGPointMake(0, 0)]; //左上角圆弧
|
||||
[maskPath addLineToPoint:CGPointMake(0, height - bottemLeft)]; //左边直线
|
||||
[maskPath addQuadCurveToPoint:CGPointMake(bottemLeft, height) controlPoint:CGPointMake(0, height)]; //左下角圆弧
|
||||
|
||||
CAShapeLayer *maskLayer = [CAShapeLayer layer];
|
||||
maskLayer.frame = CGRectMake(0, 0, size.width, size.height);
|
||||
maskLayer.path = maskPath.CGPath;
|
||||
return maskLayer;
|
||||
}
|
||||
+ (CGSize)mewGetImageSize:(CGSize)originSize
|
||||
minSize:(CGSize)imageMinSize
|
||||
maxSize:(CGSize)imageMaxSiz {
|
||||
CGSize size;
|
||||
NSInteger imageWidth = originSize.width ,imageHeight = originSize.height;
|
||||
NSInteger imageMinWidth = imageMinSize.width, imageMinHeight = imageMinSize.height;
|
||||
NSInteger imageMaxWidth = imageMaxSiz.width, imageMaxHeight = imageMaxSiz.height;
|
||||
if (imageWidth > imageHeight) //宽图
|
||||
{
|
||||
size.height = imageMinHeight; //高度取最小高度
|
||||
size.width = imageWidth * imageMinHeight / imageHeight;
|
||||
if (size.width > imageMaxWidth)
|
||||
{
|
||||
size.width = imageMaxWidth;
|
||||
}
|
||||
}
|
||||
else if(imageWidth < imageHeight)//高图
|
||||
{
|
||||
size.width = imageMinWidth;
|
||||
size.height = imageHeight *imageMinWidth / imageWidth;
|
||||
if (size.height > imageMaxHeight){
|
||||
size.height = imageMaxHeight;
|
||||
}
|
||||
}
|
||||
else//方图
|
||||
{
|
||||
if (imageWidth > imageMaxWidth){
|
||||
size.width = imageMaxWidth;
|
||||
size.height = imageMaxHeight;
|
||||
}else if(imageWidth > imageMinWidth){
|
||||
size.width = imageWidth;
|
||||
size.height = imageHeight;
|
||||
}else{
|
||||
size.width = imageMinWidth;
|
||||
size.height = imageMinHeight;
|
||||
}
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
+ (UIImage *)mewSetColorWithColorList:(NSArray<UIColor *> *)colors type:(mewImageDirectionType)type imgSize:(CGSize)imgSize{
|
||||
|
||||
NSMutableArray *ar = [NSMutableArray array];
|
||||
for(UIColor *c in colors) {
|
||||
[ar addObject:(id)c.CGColor];
|
||||
}
|
||||
UIGraphicsBeginImageContextWithOptions(imgSize, YES, 1);
|
||||
CGContextRef context = UIGraphicsGetCurrentContext();
|
||||
CGContextSaveGState(context);
|
||||
CGColorSpaceRef colorSpace = CGColorGetColorSpace([[colors lastObject] CGColor]);
|
||||
CGGradientRef gradient = CGGradientCreateWithColors(colorSpace, (CFArrayRef)ar, NULL);
|
||||
CGPoint start;
|
||||
CGPoint end;
|
||||
switch (type) {
|
||||
case mewImageDirectionTypeTopToBottom:
|
||||
start = CGPointMake(0.0, 0.0);
|
||||
end = CGPointMake(0.0, imgSize.height);
|
||||
break;
|
||||
case mewImageDirectionTypeLeftToRight:
|
||||
start = CGPointMake(0.0, 0.0);
|
||||
end = CGPointMake(imgSize.width, 0.0);
|
||||
break;
|
||||
case mewImageDirectionTypeLeftToLowright:
|
||||
start = CGPointMake(0.0, 0.0);
|
||||
end = CGPointMake(imgSize.width, imgSize.height);
|
||||
break;
|
||||
case mewImageDirectionTypeRightToLowleft:
|
||||
start = CGPointMake(imgSize.width, 0.0);
|
||||
end = CGPointMake(0.0, imgSize.height);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
CGContextDrawLinearGradient(context, gradient, start, end, kCGGradientDrawsBeforeStartLocation | kCGGradientDrawsAfterEndLocation);
|
||||
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
|
||||
CGGradientRelease(gradient);
|
||||
CGContextRestoreGState(context);
|
||||
CGColorSpaceRelease(colorSpace);
|
||||
UIGraphicsEndImageContext();
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
@end
|
@@ -53,5 +53,10 @@ typedef NS_ENUM(NSInteger, MewMineCellType){
|
||||
MewMineCellType_Pay,///充值
|
||||
MewMineCellType_MyRoom ,//我的房间
|
||||
};
|
||||
|
||||
typedef NS_ENUM(NSUInteger, mewImageDirectionType) {
|
||||
mewImageDirectionTypeTopToBottom = 0,//从上到小
|
||||
mewImageDirectionTypeLeftToRight = 1,//从左到右
|
||||
mewImageDirectionTypeLeftToLowright = 2,//左上到右下
|
||||
mewImageDirectionTypeRightToLowleft = 3,//右上到左下
|
||||
};
|
||||
#endif /* MewBaseEnumType_h */
|
||||
|
@@ -64,10 +64,6 @@
|
||||
- (void)initHeaderAndFooterRrfresh {
|
||||
[self mew_headerRefresh];
|
||||
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(mew_headerRefresh)];
|
||||
header.stateLabel.font = [UIFont systemFontOfSize:10.0];
|
||||
header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0];
|
||||
header.stateLabel.textColor = [MewAppColor mewSecondTextColor];
|
||||
header.lastUpdatedTimeLabel.textColor = [MewAppColor mewSecondTextColor];
|
||||
self.mewCollectionView.mj_header = header;
|
||||
|
||||
[MewOCServerManager mewRequestMainHomeGameTabList:^(MewNetworkDataModel * _Nonnull obj, NSInteger num, NSString * _Nonnull text) {
|
||||
|
@@ -11,7 +11,7 @@
|
||||
/// Third
|
||||
#import <Masonry/Masonry.h>
|
||||
/// Tool
|
||||
#import "UIImage+MewUtils.h"
|
||||
|
||||
|
||||
#import "MewMacro.h"
|
||||
#import "MewHUDTool.h"
|
||||
@@ -196,11 +196,11 @@
|
||||
[_pushVoiceButton setTitle:@"发布声音秀" forState:UIControlStateNormal];
|
||||
_pushVoiceButton.layer.cornerRadius = 52.0/2;
|
||||
_pushVoiceButton.layer.masksToBounds = YES;
|
||||
UIImage *backgroundImage = [UIImage mew_gradientColorImageFromColors:@[
|
||||
UIImage *backgroundImage = [UIImage mewSetColorWithColorList:@[
|
||||
[MewAppColor mewGetColorOfTextWithHexString:0xFF60FD],
|
||||
[MewAppColor mewGetColorOfTextWithHexString:0x8974FF],
|
||||
[MewAppColor mewGetColorOfTextWithHexString:0x69EBFF]
|
||||
] gradientType:MewGradientTypeLeftToRight imgSize:CGSizeMake(250, 52)];
|
||||
] type:mewImageDirectionTypeLeftToRight imgSize:CGSizeMake(250, 52)];
|
||||
_pushVoiceButton.backgroundColor = [UIColor colorWithPatternImage:backgroundImage];
|
||||
[_pushVoiceButton addTarget:self action:@selector(pushVoiceButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
|
@@ -9,8 +9,8 @@
|
||||
/// Tool
|
||||
#import "MewMacro.h"
|
||||
|
||||
#import "UIImage+MewUtils.h"
|
||||
#import "MewUtility.h"
|
||||
|
||||
|
||||
|
||||
|
||||
#import "MewHUDTool.h"
|
||||
@@ -205,16 +205,16 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
|
||||
#pragma mark - Private Method
|
||||
/// 开始录制声音
|
||||
- (void)startRecord {
|
||||
[MewUtility checkMicPrivacy:^(BOOL succeed) {
|
||||
if (!succeed) {
|
||||
[[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) {
|
||||
if(granted == NO){
|
||||
[MewHUDTool showErrorWithMessage:@"无麦克风权限,请到设置中打开麦克风权限"];
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
[self initWithRecord];
|
||||
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// 暂停录制声音
|
||||
@@ -612,7 +612,7 @@ static MewPushExclusiveVoiceView *_exclusiveVoiceView = nil;
|
||||
_pushVoiceButton.titleLabel.font = kMewSetFontSemibold(16);
|
||||
_pushVoiceButton.layer.cornerRadius = 23.0;
|
||||
_pushVoiceButton.layer.masksToBounds = YES;
|
||||
UIImage *image = [UIImage mew_gradientColorImageFromColors:@[[MewAppColor mewGetColorOfTextWithHexString:0xFF60FD], [MewAppColor mewGetColorOfTextWithHexString:0x8974FF],[MewAppColor mewGetColorOfTextWithHexString:0x69EBFF]] gradientType:MewGradientTypeLeftToRight imgSize:CGSizeMake(KMewGetScreenWidth - 4 * 28, 46)];
|
||||
UIImage *image = [UIImage mewSetColorWithColorList:@[[MewAppColor mewGetColorOfTextWithHexString:0xFF60FD], [MewAppColor mewGetColorOfTextWithHexString:0x8974FF],[MewAppColor mewGetColorOfTextWithHexString:0x69EBFF]] type:mewImageDirectionTypeLeftToRight imgSize:CGSizeMake(KMewGetScreenWidth - 4 * 28, 46)];
|
||||
_pushVoiceButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||
[_pushVoiceButton addTarget:self action:@selector(pushWithRecordVoice) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
|
@@ -90,10 +90,6 @@
|
||||
#pragma mark - 下拉刷新
|
||||
- (void)mew_initHeaderAndFooterRrfresh {
|
||||
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(mew_headerRefresh)];
|
||||
header.stateLabel.font = [UIFont systemFontOfSize:10.0];
|
||||
header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0];
|
||||
header.stateLabel.textColor = [MewAppColor mewSecondTextColor];
|
||||
header.lastUpdatedTimeLabel.textColor = [MewAppColor mewSecondTextColor];
|
||||
self.followCollectionView.mj_header = header;
|
||||
|
||||
MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(mew_footerRefresh)];
|
||||
|
18
yinmeng-ios/yinmeng-ios/Main/IM/Model/MewNIMMsgInfoModel.h
Normal file
18
yinmeng-ios/yinmeng-ios/Main/IM/Model/MewNIMMsgInfoModel.h
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// MewNIMMsgInfoModel.h
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/1/20.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewNIMMsgInfoModel : NSObject<NIMCustomAttachment>
|
||||
@property (nonatomic,assign) int first;
|
||||
@property (nonatomic,assign) int second;
|
||||
@property (nonatomic, strong) id data;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
15
yinmeng-ios/yinmeng-ios/Main/IM/Model/MewNIMMsgInfoModel.m
Normal file
15
yinmeng-ios/yinmeng-ios/Main/IM/Model/MewNIMMsgInfoModel.m
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// MewNIMMsgInfoModel.m
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/1/20.
|
||||
//
|
||||
|
||||
#import "MewNIMMsgInfoModel.h"
|
||||
|
||||
@implementation MewNIMMsgInfoModel
|
||||
- (NSString *)encodeAttachment {
|
||||
return [self mj_JSONString];
|
||||
}
|
||||
|
||||
@end
|
@@ -1,21 +0,0 @@
|
||||
//
|
||||
// MewNIMMsgInfoModel.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/1/19.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class MewNIMMsgInfoModel: NSObject {
|
||||
@objc var first:Int = 0
|
||||
@objc var second:Int = 0
|
||||
@objc var data:Any?
|
||||
}
|
||||
extension MewInitInfoModel:NIMCustomAttachment{
|
||||
func encode() -> String {
|
||||
return self.mj_JSONString()
|
||||
}
|
||||
|
||||
|
||||
}
|
196
yinmeng-ios/yinmeng-ios/Main/Login/Swift/MewFillInfoVC.swift
Normal file
196
yinmeng-ios/yinmeng-ios/Main/Login/Swift/MewFillInfoVC.swift
Normal file
@@ -0,0 +1,196 @@
|
||||
//
|
||||
// MewFillInfoVC.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/1/20.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class MewFillInfoVC: MewBaseViewController {
|
||||
|
||||
|
||||
var mewBgImageView:UIImageView = {
|
||||
let _bgImageView = UIImageView()
|
||||
_bgImageView.image = R.image.mew_home_bg()
|
||||
|
||||
|
||||
return _bgImageView
|
||||
}()
|
||||
|
||||
var backBtn:UIButton = {
|
||||
let _backBtn = UIButton()
|
||||
_backBtn.setImage(R.image.mew_common_back_white_left(), for: .normal)
|
||||
_backBtn.addTarget(self, action: #selector(backBtnAction), for: .touchUpInside)
|
||||
return _backBtn
|
||||
}()
|
||||
|
||||
var mewTextView:UILabel = {
|
||||
let _mewTextView = UILabel()
|
||||
_mewTextView.text = "填写资料"
|
||||
_mewTextView.font = UIFont.systemFont(ofSize: 18, weight: .medium)
|
||||
return _mewTextView
|
||||
}()
|
||||
var mewTextBgView:UIView = {
|
||||
let _mewTextBgView = UIView()
|
||||
_mewTextBgView.layer.cornerRadius = 52/2
|
||||
_mewTextBgView.layer.masksToBounds = true
|
||||
_mewTextBgView.backgroundColor = .white
|
||||
return _mewTextBgView
|
||||
}()
|
||||
var mewNameTextView:UITextField = {
|
||||
let _mewNameTextView = UITextField()
|
||||
_mewNameTextView.textColor = MewAppColor.mewMainTextColor()
|
||||
_mewNameTextView.font = UIFont.systemFont(ofSize: 15, weight: .medium)
|
||||
_mewNameTextView.textAlignment = .left
|
||||
_mewNameTextView.placeholder = "请输入昵称"
|
||||
return _mewNameTextView
|
||||
}()
|
||||
var mewGenderVeiw:UIStackView = {
|
||||
let _mewGenderVeiw = UIStackView()
|
||||
_mewGenderVeiw.axis = .horizontal
|
||||
_mewGenderVeiw.distribution = .fill
|
||||
_mewGenderVeiw.alignment = .center
|
||||
_mewGenderVeiw.spacing = 15
|
||||
return _mewGenderVeiw
|
||||
}()
|
||||
var mewManBtn:UIButton = {
|
||||
let _mewManBtn = UIButton()
|
||||
_mewManBtn.setImage(R.image.mew_login_full_man_normal(), for: .normal)
|
||||
_mewManBtn.setImage(R.image.mew_login_full_man_select(), for: .selected)
|
||||
_mewManBtn.addTarget(self, action: #selector(mewManBtnAction), for: .touchUpInside)
|
||||
return _mewManBtn
|
||||
}()
|
||||
var mewWomanBtn:UIButton = {
|
||||
let _mewWomanBtn = UIButton()
|
||||
_mewWomanBtn.setImage(R.image.mew_login_full_waman_normal(), for: .normal)
|
||||
_mewWomanBtn.setImage(R.image.mew_login_full_waman_select(), for: .selected)
|
||||
_mewWomanBtn.addTarget(self, action: #selector(mewWomanBtnAction), for: .touchUpInside)
|
||||
return _mewWomanBtn
|
||||
}()
|
||||
|
||||
var mewSendBtn:UIButton = {
|
||||
let _mewSendBtn = UIButton()
|
||||
_mewSendBtn.layer.masksToBounds = true
|
||||
_mewSendBtn.layer.cornerRadius = 45/2
|
||||
_mewSendBtn.setImage(R.image.mew_login_next(), for: .normal)
|
||||
_mewSendBtn.titleLabel?.font = UIFont.systemFont(ofSize: 18, weight: .medium)
|
||||
_mewSendBtn.setTitleColor(.black, for: .normal)
|
||||
let image = UIImage.mewSetColor(withColorList: [MewAppColor.mewGetColorOfText(hexString: 0xFF60FD),MewAppColor.mewGetColorOfText(hexString: 0x8974FF),MewAppColor.mewGetColorOfText(hexString: 0x69EBFF)], type: .leftToRight, imgSize: CGSizeMake(UIScreen.main.bounds.width - 2 * 36, 52))
|
||||
_mewSendBtn.setBackgroundImage(image, for: .normal)
|
||||
_mewSendBtn.setTitleColor(.white, for: .normal)
|
||||
_mewSendBtn.addTarget(self, action: #selector(mewSendViewAction), for: .touchUpInside)
|
||||
return _mewSendBtn
|
||||
}()
|
||||
|
||||
@objc func mewSendViewAction(){
|
||||
if mewNameTextView.text?.count == 0 {
|
||||
MewHUDTool.showError(withMessage: "请输入昵称")
|
||||
return
|
||||
}
|
||||
let uid = MewSaveBaseUserModel.share().mewGetUserId()
|
||||
let t = MewSaveBaseUserModel.share().mewUserTicket()
|
||||
var dic:[String:Any] = [:]
|
||||
dic["avatar"] = MewSaveBaseUserModel.share().mewAppleInfo.avatarUrl.count > 0 ? MewSaveBaseUserModel.share().mewAppleInfo.avatarUrl : MewEncryptManager.mewAESDecryptText("xdPnNelVD/RTlTKFqgSrESDPcNF6Diqb8sLg+HEvxpvjDdTLom1euQUOAOppjx15")
|
||||
dic["gender"] = self.mewGenderText
|
||||
dic["nick"] = mewNameTextView.text
|
||||
dic["uid"] = uid
|
||||
dic["ticket"] = t
|
||||
MewOCServerManager.mewSetUserData(register: { obj, code, msg in
|
||||
if obj?.code == 200{
|
||||
MewSaveBaseUserModel.share().mewSaveUserTickets(nil)
|
||||
self.dismiss(animated: true, completion: nil)
|
||||
}
|
||||
}, userInfo: dic)
|
||||
}
|
||||
|
||||
var mewGenderText = "1"
|
||||
@objc func mewManBtnAction(){
|
||||
self.mewWomanBtn.isSelected = false
|
||||
self.mewManBtn.isSelected = true
|
||||
mewGenderText = "1"
|
||||
}
|
||||
@objc func mewWomanBtnAction(){
|
||||
self.mewWomanBtn.isSelected = true
|
||||
self.mewManBtn.isSelected = false
|
||||
mewGenderText = "2"
|
||||
}
|
||||
@objc func backBtnAction(){
|
||||
self.dismiss(animated: false, completion: nil)
|
||||
}
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
view.addSubview(mewBgImageView)
|
||||
view.addSubview(backBtn)
|
||||
view.addSubview(mewTextView)
|
||||
view.addSubview(mewTextBgView)
|
||||
mewTextBgView.addSubview(mewNameTextView)
|
||||
view.addSubview(mewGenderVeiw)
|
||||
mewGenderVeiw.addArrangedSubview(mewManBtn)
|
||||
mewGenderVeiw.addArrangedSubview(mewWomanBtn)
|
||||
view.addSubview(mewSendBtn)
|
||||
if MewSaveBaseUserModel.share().mewAppleInfo.userName.count > 0{
|
||||
mewTextView.text = MewSaveBaseUserModel.share().mewAppleInfo.userName;
|
||||
}else{
|
||||
MewOCServerManager.mewGetUserNick { obj, code, msg in
|
||||
if (obj?.code == 200){
|
||||
if let data = obj?.data as? String{
|
||||
self.mewTextView.text = data
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
mewBgImageView.snp.makeConstraints { make in
|
||||
make.edges.equalTo(self.view);
|
||||
}
|
||||
backBtn.snp.makeConstraints { make in
|
||||
make.left.equalTo(self.view).offset(10);
|
||||
make.top.equalTo(UIApplication.shared.statusBarFrame.size.height);
|
||||
make.height.width.equalTo(44);
|
||||
}
|
||||
mewTextView.snp.makeConstraints { make in
|
||||
make.centerY.equalTo(self.backBtn);
|
||||
make.centerX.equalTo(self.view);
|
||||
}
|
||||
mewGenderVeiw.snp.makeConstraints { make in
|
||||
make.left.equalTo(self.mewNameTextView);
|
||||
make.top.equalTo(self.mewTextView.snp.bottom).offset(60);
|
||||
}
|
||||
mewTextBgView.snp.makeConstraints { make in
|
||||
make.top.equalTo(self.mewGenderVeiw.snp.bottom).offset(32);
|
||||
make.left.equalTo(36);
|
||||
make.right.equalTo(-36);
|
||||
make.height.equalTo(52);
|
||||
}
|
||||
mewNameTextView.snp.makeConstraints { make in
|
||||
make.left.right.equalTo(self.mewTextBgView).inset(20);
|
||||
make.height.equalTo(self.mewTextBgView);
|
||||
}
|
||||
mewSendBtn.snp.makeConstraints { make in
|
||||
make.left.right.equalTo(self.view).inset(36);
|
||||
make.height.equalTo(52);
|
||||
make.top.equalTo(self.mewNameTextView.snp.bottom).offset(40);
|
||||
}
|
||||
|
||||
}
|
||||
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
|
||||
self.view.endEditing(true)
|
||||
}
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
self.navigationController?.setNavigationBarHidden(true, animated: false)
|
||||
}
|
||||
/*
|
||||
// MARK: - Navigation
|
||||
|
||||
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
||||
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
|
||||
// Get the new view controller using segue.destination.
|
||||
// Pass the selected object to the new view controller.
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
@@ -0,0 +1,297 @@
|
||||
//
|
||||
// MewUserLoginViewController.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/1/20.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import AuthenticationServices
|
||||
@available(iOS 13.0, *)
|
||||
class MewUserLoginViewController: MewBaseViewController {
|
||||
var mewLoginBtn:UIButton = {
|
||||
let _mewLoginBtn = UIButton()
|
||||
_mewLoginBtn.layer.masksToBounds = true
|
||||
_mewLoginBtn.setTitle("帐号登录", for: .normal)
|
||||
_mewLoginBtn.setTitleColor(.white, for: .normal)
|
||||
_mewLoginBtn.titleLabel?.font = UIFont .systemFont(ofSize: 18, weight: .medium)
|
||||
let image = UIImage.mewSetColor(withColorList: [MewAppColor.mewGetColorOfText(hexString: 0xFF60FD),MewAppColor.mewGetColorOfText(hexString: 0x8974FF),MewAppColor.mewGetColorOfText(hexString: 0x69EBFF)], type: .leftToRight, imgSize: CGSize(width: 80, height: 25))
|
||||
_mewLoginBtn.setBackgroundImage(image, for: .normal)
|
||||
_mewLoginBtn.layer.cornerRadius = 45/2.0
|
||||
_mewLoginBtn.addTarget(self, action: #selector(mewLoginAction), for: .touchUpInside)
|
||||
return _mewLoginBtn
|
||||
}()
|
||||
|
||||
var mewPointBtn = {
|
||||
let _mewPointBtn = UIButton()
|
||||
_mewPointBtn.setImage(R.image.mew_login_agree_normal(), for: .normal)
|
||||
_mewPointBtn.setImage(R.image.mew_login_agree_sel(), for: .selected)
|
||||
_mewPointBtn.addTarget(self, action: #selector(mewClickPointAction), for: .touchUpInside)
|
||||
if let isClick = UserDefaults.standard.value(forKey: "kMewIsClikPiont") as? String{
|
||||
_mewPointBtn.isSelected = true
|
||||
}
|
||||
|
||||
|
||||
return _mewPointBtn
|
||||
}()
|
||||
|
||||
var mewPointView:YYLabel = {
|
||||
let _mewPointView = YYLabel()
|
||||
_mewPointView.font = UIFont.systemFont(ofSize: 12)
|
||||
_mewPointView.numberOfLines = 2
|
||||
_mewPointView.textAlignment = .center
|
||||
return _mewPointView
|
||||
}()
|
||||
|
||||
func mewGetPointViewAtt() -> NSMutableAttributedString{
|
||||
let att = NSMutableAttributedString.init(string: "同意")
|
||||
att.yy_color = MewAppColor.mewGetAlphaColorOfText(hexString: 0xffffff, alpha: 0.8)
|
||||
let userText = "《用户服务协议》"
|
||||
let userAtt = NSMutableAttributedString.init(string: userText, attributes: [.foregroundColor : UIColor.white])
|
||||
userAtt.yy_setTextHighlight(NSRange(location: 0, length: userText.count), color: nil, backgroundColor: nil) {[weak self] (view, att, range, rect) in
|
||||
let mewH5View = MewWebViewController.init()
|
||||
mewH5View.url = "mew/" + MewEncryptManager.mewAESDecryptText("oSYlxZYQP2Vu+3KRnQorypsYWQGEz2tKII7AwcFks7s=")
|
||||
self?.navigationController?.pushViewController(mewH5View, animated: true)
|
||||
}
|
||||
|
||||
let andAtt = NSMutableAttributedString.init(string: "和")
|
||||
andAtt.yy_color = UIColor.init(white: 1, alpha: 0.8)
|
||||
let protocolText = "《隐私政策》"
|
||||
let protocolAtt = NSMutableAttributedString.init(string: protocolText, attributes: [.foregroundColor:UIColor.white])
|
||||
protocolAtt.yy_setTextHighlight(NSRange(location: 0, length: protocolText.count), color: nil, backgroundColor: nil) {[weak self] (view, att, range, rect) in
|
||||
let mewH5View = MewWebViewController.init()
|
||||
mewH5View.url = "mew/" + MewEncryptManager.mewAESDecryptText("RW2RUxUBFSQXiYS0xFpDv+HMdWG2/xfjkYMyeSFR/BY=")
|
||||
self?.navigationController?.pushViewController(mewH5View, animated: true)
|
||||
}
|
||||
att.append(userAtt)
|
||||
att.append(andAtt)
|
||||
att.append(protocolAtt)
|
||||
return att
|
||||
}
|
||||
|
||||
|
||||
|
||||
var mewBgView:UIView = {
|
||||
let _mewBgView = UIView()
|
||||
return _mewBgView
|
||||
}()
|
||||
var mewBgImageView:UIImageView = {
|
||||
let _mewBgImageView = UIImageView()
|
||||
_mewBgImageView.image = R.image.mew_home_bg()
|
||||
return _mewBgImageView
|
||||
}()
|
||||
var mewAppleBnt:ASAuthorizationAppleIDButton = {
|
||||
let _mewAppleBnt = ASAuthorizationAppleIDButton.init(type: .continue, style: .white)
|
||||
_mewAppleBnt.cornerRadius = 20;
|
||||
_mewAppleBnt .addTarget(self, action: #selector(mewLoginAppleAction), for: .touchUpInside)
|
||||
return _mewAppleBnt
|
||||
}()
|
||||
var mewSayHiBgView:UIImageView = {
|
||||
let _mewSayHiBgView = UIImageView()
|
||||
_mewSayHiBgView.image = R.image.mew_launch_logo()
|
||||
_mewSayHiBgView.layer.cornerRadius = 10
|
||||
_mewSayHiBgView.layer.masksToBounds = true
|
||||
return _mewSayHiBgView
|
||||
}()
|
||||
|
||||
var mewSayHiTextView:UILabel = {
|
||||
let _mewSayHiTextView = UILabel()
|
||||
_mewSayHiTextView.text = "Hi!"
|
||||
_mewSayHiTextView.textColor = .white
|
||||
_mewSayHiTextView.font = UIFont.systemFont(ofSize: 68, weight: .medium)
|
||||
return _mewSayHiTextView
|
||||
}()
|
||||
var mewWelcomeView:UILabel = {
|
||||
let _mewWelcomeView = UILabel()
|
||||
_mewWelcomeView.text = "欢迎来到音萌"
|
||||
_mewWelcomeView.textColor = .white
|
||||
_mewWelcomeView.font = UIFont.systemFont(ofSize: 40)
|
||||
return _mewWelcomeView
|
||||
}()
|
||||
|
||||
var mewLineBgView1:UIView = {
|
||||
let _mewLineBgView1 = UIView()
|
||||
_mewLineBgView1.backgroundColor = .white
|
||||
return _mewLineBgView1
|
||||
}()
|
||||
var mewLineBgView2:UIView = {
|
||||
let _mewLineBgView2 = UIView()
|
||||
_mewLineBgView2.backgroundColor = .white
|
||||
return _mewLineBgView2
|
||||
}()
|
||||
|
||||
|
||||
var mewLoginTypeView:UILabel = {
|
||||
let _mewLoginTypeView = UILabel()
|
||||
_mewLoginTypeView.text = "其他登录方式"
|
||||
_mewLoginTypeView.textColor = .white
|
||||
_mewLoginTypeView.font = UIFont.systemFont(ofSize: 13)
|
||||
return _mewLoginTypeView
|
||||
}()
|
||||
|
||||
@objc func mewLoginAction(){
|
||||
if mewPointBtn.isSelected == false{
|
||||
MewHUDTool.showError(withMessage: "请勾选协议")
|
||||
return
|
||||
}
|
||||
let vc = MewUserPhoneLoginVC()
|
||||
self.navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
@objc func mewLoginAppleAction(){
|
||||
if mewPointBtn.isSelected == false{
|
||||
MewHUDTool.showError(withMessage: "请勾选协议")
|
||||
return
|
||||
}
|
||||
let provider = ASAuthorizationAppleIDProvider()
|
||||
let request = provider.createRequest()
|
||||
var list:[ASAuthorizationRequest] = []
|
||||
list.append(request)
|
||||
let auth = ASAuthorizationController.init(authorizationRequests: list)
|
||||
auth.delegate = self
|
||||
auth.presentationContextProvider = self
|
||||
auth.performRequests()
|
||||
}
|
||||
|
||||
@objc func mewClickPointAction(){
|
||||
mewPointBtn.isSelected = !mewPointBtn.isSelected;
|
||||
if mewPointBtn.isSelected == true{
|
||||
UserDefaults.standard.setValue("YES", forKey: "kMewIsClikPiont")
|
||||
UserDefaults.standard.synchronize()
|
||||
return
|
||||
}
|
||||
if let _ = UserDefaults.standard.value(forKey: "kMewIsClikPiont") as? String{
|
||||
UserDefaults.standard.removeObject(forKey: "kMewIsClikPiont")
|
||||
}
|
||||
}
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
self.mewPointView.attributedText = mewGetPointViewAtt()
|
||||
mewSetUI()
|
||||
mewSetFrame()
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
self.navigationController?.setNavigationBarHidden(true, animated: false)
|
||||
}
|
||||
func mewSetUI(){
|
||||
self.view.addSubview(self.mewBgImageView)
|
||||
self.view.addSubview(self.mewSayHiBgView)
|
||||
self.view.addSubview(self.mewSayHiTextView)
|
||||
self.view.addSubview(mewWelcomeView)
|
||||
self.view.addSubview(mewBgView)
|
||||
self.view.addSubview(mewLoginBtn)
|
||||
self.view.addSubview(mewPointBtn)
|
||||
self.view.addSubview(mewPointView)
|
||||
|
||||
self.view.addSubview(mewLineBgView1)
|
||||
self.view.addSubview(mewLineBgView2)
|
||||
self.view.addSubview(mewLoginTypeView)
|
||||
self.view.addSubview(self.mewAppleBnt)
|
||||
}
|
||||
func mewSetFrame(){
|
||||
self.mewBgImageView.snp.makeConstraints { make in
|
||||
make.edges.equalTo(self.view);
|
||||
}
|
||||
self.mewSayHiBgView.snp.makeConstraints { make in
|
||||
make.top.equalTo(UIApplication.shared.statusBarFrame.size.height + 92);
|
||||
make.left.equalTo(40);
|
||||
make.width.height.equalTo(58);
|
||||
}
|
||||
mewSayHiTextView.snp.makeConstraints { make in
|
||||
make.left.equalTo(self.mewSayHiBgView.snp.right).offset(10);
|
||||
make.centerY.equalTo(self.mewSayHiBgView);
|
||||
}
|
||||
mewWelcomeView.snp.makeConstraints { make in
|
||||
make.top.equalTo(self.mewSayHiBgView.snp.bottom).offset(20);
|
||||
make.left.equalTo(self.mewSayHiBgView);
|
||||
}
|
||||
mewBgView.snp.makeConstraints { make in
|
||||
make.top.equalTo(self.view).offset(329);
|
||||
make.left.right.bottom.equalTo(0);
|
||||
}
|
||||
mewLoginBtn.snp.makeConstraints { make in
|
||||
make.left.equalTo(40);
|
||||
make.right.equalTo(-40);
|
||||
make.top.equalTo(self.mewWelcomeView.snp.bottom).offset(115);
|
||||
make.height.equalTo(52);
|
||||
}
|
||||
mewPointView.snp.makeConstraints { make in
|
||||
make.top.equalTo(self.mewAppleBnt.snp.bottom).offset(20);
|
||||
make.height.equalTo(40);
|
||||
make.width.equalTo(220);
|
||||
make.centerX.equalTo(self.view).offset(15 - 6);
|
||||
}
|
||||
mewPointBtn.snp.makeConstraints { make in
|
||||
make.right.equalTo(self.mewPointView.snp.left).offset(6);
|
||||
make.centerY.equalTo(self.mewPointView.snp.centerY);
|
||||
make.width.height.equalTo(30);
|
||||
}
|
||||
|
||||
|
||||
mewLoginTypeView.snp.makeConstraints { make in
|
||||
make.bottom.equalTo(self.mewAppleBnt.snp.top).offset(-32);
|
||||
make.centerX.equalTo(self.view);
|
||||
}
|
||||
mewLineBgView1.snp.makeConstraints { make in
|
||||
make.right.equalTo(self.mewLoginTypeView.snp.left).offset(-15);
|
||||
make.centerY.equalTo(self.mewLoginTypeView);
|
||||
make.left.equalTo(self.view).offset(31);
|
||||
make.height.equalTo(0.5);
|
||||
}
|
||||
mewLineBgView2.snp.makeConstraints { make in
|
||||
make.left.equalTo(self.mewLoginTypeView.snp.right).offset(15);
|
||||
make.centerY.equalTo(self.mewLoginTypeView);
|
||||
make.right.equalTo(self.view).offset(-31);
|
||||
make.height.equalTo(0.5);
|
||||
}
|
||||
|
||||
|
||||
mewAppleBnt.snp.makeConstraints { make in
|
||||
make.bottom.equalTo(self.view).offset(-isPhoenX() - 60);
|
||||
make.centerX.equalTo(self.view);
|
||||
make.width.height.equalTo(40);
|
||||
}
|
||||
}
|
||||
|
||||
func isPhoenX()-> CGFloat{
|
||||
|
||||
guard #available(iOS 11.0, *) else {
|
||||
return 0
|
||||
}
|
||||
|
||||
let isPhoenX = UIApplication.shared.windows[0].safeAreaInsets.bottom > 0
|
||||
|
||||
return isPhoenX ? 34 : 0
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13.0, *)
|
||||
extension MewUserLoginViewController:ASAuthorizationControllerDelegate,ASAuthorizationControllerPresentationContextProviding{
|
||||
func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchor {
|
||||
return self.view.window ?? UIApplication.shared.keyWindow!
|
||||
}
|
||||
|
||||
func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) {
|
||||
|
||||
}
|
||||
func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) {
|
||||
if let getAuth = authorization.credential as? ASAuthorizationAppleIDCredential{
|
||||
let mewInfo = MewAppleInfoModel()
|
||||
let userId = getAuth.user
|
||||
let fullName = getAuth.fullName
|
||||
let email = getAuth.email
|
||||
let code = NSString.init(data: getAuth.authorizationCode!, encoding: NSUTF8StringEncoding)
|
||||
let token = NSString.init(data: getAuth.identityToken!, encoding: NSUTF8StringEncoding)
|
||||
if let familyName = fullName?.familyName,let givenName = fullName?.givenName{
|
||||
mewInfo.userName = familyName + givenName
|
||||
}
|
||||
MewHUDTool .mew_showLoading(withMessage: "正在登录中")
|
||||
MewOCServerManager.mewAppleLogin({ obj, code, msg in
|
||||
|
||||
}, openid: token! as String, unionid: userId , access_token: token! as String, type: "5")
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// MewUserPhoneLoginInputView.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/1/20.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class MewUserPhoneLoginInputView: UIView {
|
||||
|
||||
var count:Int = 0
|
||||
var mewContainerView:UIStackView = {
|
||||
let _mewContainerView = UIStackView()
|
||||
_mewContainerView.axis = .horizontal
|
||||
_mewContainerView.distribution = .fill
|
||||
_mewContainerView.alignment = .fill
|
||||
_mewContainerView.spacing = 0
|
||||
return _mewContainerView
|
||||
}()
|
||||
var mewTextView:UILabel = {
|
||||
let _mewTextView = UILabel()
|
||||
_mewTextView.font = UIFont.systemFont(ofSize: 18)
|
||||
_mewTextView.textColor = MewAppColor.mewMainTextColor()
|
||||
_mewTextView.text = "+86"
|
||||
return _mewTextView
|
||||
}()
|
||||
var mewLineView:UIView = {
|
||||
let _mewLineView = UIView()
|
||||
_mewLineView.backgroundColor = MewAppColor.mewGetColorOfText(hexString: 0xF2F3F6)
|
||||
return _mewLineView
|
||||
}()
|
||||
var mewTextField:UITextField = {
|
||||
let _mewTextField = UITextField()
|
||||
_mewTextField.textColor = MewAppColor.mewMainTextColor()
|
||||
_mewTextField.font = UIFont.systemFont(ofSize: 18)
|
||||
_mewTextField.borderStyle = .none
|
||||
_mewTextField.keyboardType = .numberPad
|
||||
_mewTextField.tintColor = MewAppColor.mewMainTextColor()
|
||||
_mewTextField.backgroundColor = .clear
|
||||
|
||||
return _mewTextField
|
||||
}()
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
mewTextField.delegate = self
|
||||
self.addSubview(self.mewContainerView)
|
||||
self.addSubview(self.mewLineView)
|
||||
self.mewContainerView.addArrangedSubview(mewTextView)
|
||||
self.mewContainerView.addArrangedSubview(mewTextField)
|
||||
|
||||
mewTextView.snp.makeConstraints { make in
|
||||
make.width.equalTo(53);
|
||||
}
|
||||
mewLineView.snp.makeConstraints { make in
|
||||
make.width.equalTo(1);
|
||||
make.height.equalTo(25);
|
||||
make.left.equalTo(self).offset(55);
|
||||
make.centerY.equalTo(self);
|
||||
}
|
||||
mewContainerView.snp.makeConstraints { make in
|
||||
make.left.equalTo(self).offset(15);
|
||||
make.right.top.bottom.equalTo(self);
|
||||
}
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
}
|
||||
extension MewUserPhoneLoginInputView:UITextFieldDelegate{
|
||||
|
||||
}
|
@@ -0,0 +1,149 @@
|
||||
//
|
||||
// MewUserPhoneLoginVC.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/1/20.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class MewUserPhoneLoginVC: MewBaseViewController {
|
||||
|
||||
|
||||
var mewBgView:UIImageView = {
|
||||
let _mewBgView = UIImageView()
|
||||
_mewBgView.image = R.image.mew_home_bg()
|
||||
return _mewBgView
|
||||
}()
|
||||
var mewDissViewBtn:UIButton = {
|
||||
let _mewDissViewBtn = UIButton()
|
||||
_mewDissViewBtn.setImage(R.image.mew_common_back_white_left(), for: .normal)
|
||||
_mewDissViewBtn.addTarget(self, action: #selector(mewDissViewBtnAction), for: .touchUpInside)
|
||||
return _mewDissViewBtn
|
||||
}()
|
||||
var mewPhoneNumBnt:UIButton = {
|
||||
let _mewPhoneNumBnt = UIButton()
|
||||
_mewPhoneNumBnt.setTitle("手机号登录", for: .normal)
|
||||
_mewPhoneNumBnt.setTitleColor(.white, for: .normal)
|
||||
_mewPhoneNumBnt.titleLabel?.font = UIFont.systemFont(ofSize: 16, weight: .semibold)
|
||||
_mewPhoneNumBnt.addTarget(self, action: #selector(mewPhoneNumBntAction), for: .touchUpInside)
|
||||
return _mewPhoneNumBnt
|
||||
}()
|
||||
var mewPasswordBtn:UIButton = {
|
||||
let _mewPasswordBtn = UIButton()
|
||||
_mewPasswordBtn.setTitle("账号登录", for: .normal)
|
||||
_mewPasswordBtn.setTitleColor(.white, for: .normal)
|
||||
_mewPasswordBtn.titleLabel?.font = UIFont.systemFont(ofSize: 16, weight: .semibold)
|
||||
_mewPasswordBtn.addTarget(self, action: #selector(mewPasswordBtnAction), for: .touchUpInside)
|
||||
return _mewPasswordBtn
|
||||
}()
|
||||
var mewLineView:UIImageView = {
|
||||
let _mewLineView = UIImageView()
|
||||
_mewLineView.image = R.image.mew_login_line_bg()
|
||||
return _mewLineView
|
||||
}()
|
||||
var mewPhoneView:MewUserPhoneLoginView = {
|
||||
let _mewPhoneView = MewUserPhoneLoginView.init(frame: CGRectZero)
|
||||
|
||||
return _mewPhoneView
|
||||
}()
|
||||
var mewPasswordView:MewUserPhonePasswordView = {
|
||||
let _mewPasswordView = MewUserPhonePasswordView.init(frame: CGRectZero)
|
||||
return _mewPasswordView
|
||||
}()
|
||||
@objc func mewPasswordBtnAction(){
|
||||
mewSetLoginChoose(isChoose: mewPhoneView.isHidden)
|
||||
}
|
||||
@objc func mewDissViewBtnAction(){
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
@objc func mewPhoneNumBntAction(){
|
||||
mewSetLoginChoose(isChoose: !mewPhoneView.isHidden)
|
||||
}
|
||||
func mewSetLoginChoose(isChoose:Bool){
|
||||
mewPhoneNumBnt.titleLabel?.font = isChoose ? UIFont.systemFont(ofSize: 18, weight: .semibold): UIFont.systemFont(ofSize: 16, weight: .semibold)
|
||||
mewPasswordBtn.titleLabel?.font = isChoose ? UIFont.systemFont(ofSize: 16, weight: .semibold): UIFont.systemFont(ofSize: 18, weight: .semibold)
|
||||
mewPhoneView.isHidden = !isChoose
|
||||
mewPasswordView.isHidden = isChoose
|
||||
let letf = isChoose ? UIScreen.main.bounds.size.width / 4 - 60/2 : UIScreen.main.bounds.size.width / 2 + UIScreen.main.bounds.size.width / 4 - 60/2
|
||||
mewLineView.snp.updateConstraints { make in
|
||||
make.left.equalTo(letf)
|
||||
}
|
||||
|
||||
}
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
self.navigationController?.setNavigationBarHidden(true, animated: false)
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
view.addSubview(mewBgView)
|
||||
view.addSubview(mewDissViewBtn)
|
||||
view.addSubview(mewPhoneNumBnt)
|
||||
view.addSubview(mewPasswordBtn)
|
||||
view.addSubview(mewLineView)
|
||||
view.addSubview(mewPhoneView)
|
||||
view.addSubview(mewPasswordView)
|
||||
mewBgView.snp.makeConstraints { make in
|
||||
make.edges.equalTo(self.view);
|
||||
}
|
||||
mewDissViewBtn.snp.makeConstraints { make in
|
||||
make.left.equalTo(self.view).offset(10);
|
||||
make.top.equalTo(UIApplication.shared.statusBarFrame.size.height);
|
||||
make.height.width.equalTo(44);
|
||||
}
|
||||
mewPhoneNumBnt.snp.makeConstraints { make in
|
||||
make.width.equalTo(UIScreen.main.bounds.size.width/2);
|
||||
make.top.equalTo(self.mewDissViewBtn.snp.bottom).offset(40);
|
||||
make.height.equalTo(40);
|
||||
make.left.equalTo(self.view);
|
||||
}
|
||||
mewPasswordBtn.snp.makeConstraints { make in
|
||||
make.width.height.top.equalTo(self.mewPhoneNumBnt);
|
||||
make.left.equalTo(self.mewPhoneNumBnt.snp.right);
|
||||
}
|
||||
mewLineView.snp.makeConstraints { make in
|
||||
make.top.equalTo(self.mewPhoneNumBnt.snp.bottom);
|
||||
make.left.equalTo(UIScreen.main.bounds.size.width/4.0 - 60/2.0);
|
||||
make.width.equalTo(60);
|
||||
make.height.equalTo(5);
|
||||
}
|
||||
mewPhoneView.snp.makeConstraints { make in
|
||||
make.top.equalTo(self.mewLineView.snp.bottom).offset(20);
|
||||
make.left.right.equalTo(self.view);
|
||||
make.height.equalTo(UIScreen.main.bounds.size.height/2.0);
|
||||
}
|
||||
mewPasswordView.snp.makeConstraints { make in
|
||||
make.edges.equalTo(self.mewPhoneView);
|
||||
}
|
||||
mewSetLoginChoose(isChoose: true)
|
||||
mewPhoneView.successBlock = {[weak self] in
|
||||
self?.dismiss(animated: true, completion: nil)
|
||||
self?.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
mewPasswordView.successBlock = {[weak self] type in
|
||||
guard type == 0 else {
|
||||
self?.dismiss(animated: true, completion: nil)
|
||||
self?.navigationController?.popViewController(animated: true)
|
||||
return
|
||||
}
|
||||
let vc = MewLoginForgetPasswordViewController()
|
||||
self?.navigationController?.pushViewController(vc, animated: true)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
// MARK: - Navigation
|
||||
|
||||
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
||||
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
|
||||
// Get the new view controller using segue.destination.
|
||||
// Pass the selected object to the new view controller.
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
@@ -0,0 +1,182 @@
|
||||
//
|
||||
// MewUserPhoneLoginView.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/1/20.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
typealias MewPhoenLoginSuccessBlock = ()->Void
|
||||
|
||||
class MewUserPhoneLoginView: UIView {
|
||||
var successBlock:MewPhoenLoginSuccessBlock?
|
||||
var mewPhoenNum = ""
|
||||
var mewPhoneView:MewUserPhoneLoginInputView = {
|
||||
let _mewPhoneView = MewUserPhoneLoginInputView.init(frame: CGRectZero)
|
||||
_mewPhoneView.backgroundColor = MewAppColor.mewGetColorOfText(hexString: 0xF8F8FB)
|
||||
_mewPhoneView.layer.cornerRadius = 51.0 / 2
|
||||
_mewPhoneView.layer.masksToBounds = true
|
||||
_mewPhoneView.count = 11
|
||||
_mewPhoneView.mewTextField.placeholder = "请输入手机号码"
|
||||
return _mewPhoneView
|
||||
}()
|
||||
|
||||
var mewGetPhoneCode:UIView = {
|
||||
let _mewGetPhoneCode = UIView()
|
||||
_mewGetPhoneCode.backgroundColor = .white
|
||||
_mewGetPhoneCode.layer.masksToBounds = true
|
||||
_mewGetPhoneCode.layer.cornerRadius = 51.0 / 2
|
||||
return _mewGetPhoneCode
|
||||
}()
|
||||
|
||||
var mewGetCodeTitle:UITextField = {
|
||||
let _mewGetCodeTitle = UITextField()
|
||||
_mewGetCodeTitle.textColor = MewAppColor.mewMainTextColor()
|
||||
_mewGetCodeTitle.font = UIFont.systemFont(ofSize: 18)
|
||||
_mewGetCodeTitle.keyboardType = .numberPad
|
||||
_mewGetCodeTitle.tintColor = MewAppColor.mewMainTextColor()
|
||||
_mewGetCodeTitle.backgroundColor = .clear
|
||||
_mewGetCodeTitle.addTarget(self, action: #selector(mewFieldDidChange(textField:)), for: .touchUpInside)
|
||||
_mewGetCodeTitle.attributedPlaceholder = NSAttributedString.init(string: "请输入验证码", attributes: [.foregroundColor:MewAppColor.mewSecondTextColor(),.font:UIFont.systemFont(ofSize: 14)])
|
||||
return _mewGetCodeTitle
|
||||
}()
|
||||
|
||||
let mewTimeView:UILabel = {
|
||||
let _mewTimeView = UILabel()
|
||||
_mewTimeView.textAlignment = .center
|
||||
_mewTimeView.font = UIFont.systemFont(ofSize: 11)
|
||||
_mewTimeView.textColor = MewAppColor.mewSecondTextColor()
|
||||
_mewTimeView.isHidden = true
|
||||
return _mewTimeView
|
||||
}()
|
||||
let mewAgainGetCodeView:UIButton = {
|
||||
let _mewAgainGetCodeView = UIButton()
|
||||
_mewAgainGetCodeView.setTitle("获取验证码", for: .normal)
|
||||
_mewAgainGetCodeView.setTitleColor(MewAppColor.mewGetColorOfText(hexString: 0x9552FF), for: .normal)
|
||||
_mewAgainGetCodeView.titleLabel?.font = UIFont.systemFont(ofSize: 11, weight: .medium)
|
||||
_mewAgainGetCodeView.addTarget(self, action: #selector(mewAgainGetCodeAction), for: .touchUpInside)
|
||||
return _mewAgainGetCodeView
|
||||
}()
|
||||
|
||||
|
||||
var mewSendBtn:UIButton = {
|
||||
let _mewSendBtn = UIButton()
|
||||
_mewSendBtn.layer.masksToBounds = true
|
||||
_mewSendBtn.layer.cornerRadius = 52/2.0
|
||||
_mewSendBtn.setImage(R.image.mew_login_next(), for: .normal)
|
||||
_mewSendBtn.titleLabel?.font = UIFont.systemFont(ofSize: 18, weight: .medium)
|
||||
let image = UIImage.mewSetColor(withColorList: [MewAppColor.mewGetColorOfText(hexString: 0xFF60FD),MewAppColor.mewGetColorOfText(hexString: 0x8974FF),MewAppColor.mewGetColorOfText(hexString: 0x69EBFF)], type: .leftToRight, imgSize: CGSizeMake(UIScreen.main.bounds.width - 2 * 36, 52))
|
||||
_mewSendBtn.setBackgroundImage(image, for: .normal)
|
||||
_mewSendBtn.setTitleColor(.white, for: .normal)
|
||||
_mewSendBtn.addTarget(self, action: #selector(mewSendViewAction), for: .touchUpInside)
|
||||
return _mewSendBtn
|
||||
}()
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
addSubview(mewPhoneView)
|
||||
addSubview(mewGetPhoneCode)
|
||||
addSubview(mewGetCodeTitle)
|
||||
addSubview(mewTimeView)
|
||||
addSubview(mewAgainGetCodeView)
|
||||
addSubview(mewSendBtn)
|
||||
let kMewScale:CGFloat = 363.0 / 375.0;
|
||||
mewPhoneView.snp.makeConstraints { make in
|
||||
make.top.equalTo(self);
|
||||
make.left.equalTo(36);
|
||||
make.right.equalTo(-36);
|
||||
make.height.equalTo(52);
|
||||
}
|
||||
|
||||
mewGetPhoneCode.snp.makeConstraints { make in
|
||||
make.top.equalTo(self.mewPhoneView.snp.bottom).offset(20);
|
||||
make.left.right.height.equalTo(self.mewPhoneView);
|
||||
}
|
||||
|
||||
mewAgainGetCodeView.snp.makeConstraints { make in
|
||||
make.right.equalTo(self.mewGetPhoneCode).offset(-15);
|
||||
make.centerY.equalTo(self.mewGetPhoneCode);
|
||||
}
|
||||
mewTimeView.snp.makeConstraints { make in
|
||||
make.edges.equalTo(self.mewAgainGetCodeView);
|
||||
}
|
||||
mewGetCodeTitle.snp.makeConstraints { make in
|
||||
make.left.equalTo(self.mewGetPhoneCode).offset(15);
|
||||
make.centerY.equalTo(self.mewGetPhoneCode);
|
||||
}
|
||||
mewSendBtn.snp.makeConstraints { make in
|
||||
make.top.equalTo(self.mewGetPhoneCode.snp.bottom).offset(15);
|
||||
make.left.right.height.equalTo(self.mewGetPhoneCode);
|
||||
}
|
||||
|
||||
mewPhoneView.mewTextField.rac_textSignal().subscribeNext {[weak self] text in
|
||||
if let _text = text {
|
||||
self?.mewPhoenNum = _text as String
|
||||
}
|
||||
|
||||
}
|
||||
MEWCountDownHelper.share().delegate = self
|
||||
}
|
||||
deinit{
|
||||
MEWCountDownHelper.share().mewStopCountDown()
|
||||
}
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
@objc func mewFieldDidChange(textField:UITextField){
|
||||
if textField.text?.count ?? 0 > 5{
|
||||
if let text = textField.text as? NSString{
|
||||
textField.text = text.substring(to: 5)
|
||||
}
|
||||
}
|
||||
mewSendBtn.isEnabled = textField.text?.count == 5 && self.mewPhoenNum.count == 11
|
||||
}
|
||||
@objc func mewAgainGetCodeAction(){
|
||||
if mewPhoenNum.count < 11 {
|
||||
MewHUDTool.showError(withMessage: "请输入手机号码")
|
||||
return
|
||||
}
|
||||
let mewPhoen = DESEncrypt.encryptUseDES(mewPhoenNum, key: MewEncryptManager.mewAESDecryptText("BeKYtw9W3zMhFjuzb+vcnjdojaAyH9EGzCdIxstGcrq4NT2kD4vUPpFe9VZwRGHb"))
|
||||
MewOCServerManager.mewGetPhoneAuthCode({ obj, code, msg in
|
||||
if (code == 200){
|
||||
MewHUDTool.showError(withMessage: "验证码已发送\n+86" + self.mewPhoenNum)
|
||||
}
|
||||
}, mobile: mewPhoen, type: "1")
|
||||
}
|
||||
@objc func mewSendViewAction(){
|
||||
let mewPhone = DESEncrypt.encryptUseDES(mewPhoenNum, key: MewEncryptManager.mewAESDecryptText("BeKYtw9W3zMhFjuzb+vcnjdojaAyH9EGzCdIxstGcrq4NT2kD4vUPpFe9VZwRGHb"))
|
||||
MewOCServerManager.mewLoginApp(code: { obj, code, msg in
|
||||
if(obj?.code == 200){
|
||||
if let model = MewLoginTokenInfoModel.mj_object(withKeyValues: obj?.data){
|
||||
if model.access_token.count > 0{
|
||||
MewSaveBaseUserModel.share().mewSaveBaseUserData(model)
|
||||
}
|
||||
MewHUDTool.showSuccess(withMessage: "登录成功")
|
||||
MEWCountDownHelper.share().mewStopCountDown()
|
||||
if let _successBlock = self.successBlock{
|
||||
_successBlock()
|
||||
}
|
||||
}
|
||||
}
|
||||
}, phone: mewPhone, code: mewGetCodeTitle.text ?? "", client_secret: "uyzjdhds", version: "1", client_id: "erban-client", grant_type: "password")
|
||||
}
|
||||
|
||||
func mewBeginTime(){
|
||||
MEWCountDownHelper.share().mewOpenCountdown(withTime: 60)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension MewUserPhoneLoginView:MEWCountDownHelperDelegate{
|
||||
func mewOnCountdownFinish() {
|
||||
self.mewTimeView.isHidden = true
|
||||
self.mewAgainGetCodeView.isHidden = false
|
||||
}
|
||||
func mew(onCountdownOpen time: Int32) {
|
||||
self.mewTimeView.isHidden = false
|
||||
self.mewAgainGetCodeView.isHidden = true
|
||||
mewTimeView.text = String(format: "%d s", time)
|
||||
}
|
||||
}
|
@@ -0,0 +1,130 @@
|
||||
//
|
||||
// MewUserPhonePasswordView.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/1/20.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
typealias MewUserPhonePasswordViewBlock = (_ type:Int)->Void
|
||||
|
||||
|
||||
class MewUserPhonePasswordView: UIView {
|
||||
var successBlock:MewUserPhonePasswordViewBlock?
|
||||
var mewPhoneInputView:MewUserPhoneLoginInputView = {
|
||||
let _mewPhoneInputView = MewUserPhoneLoginInputView.init(frame: CGRectZero)
|
||||
_mewPhoneInputView.backgroundColor = .white
|
||||
_mewPhoneInputView.layer.masksToBounds = true
|
||||
_mewPhoneInputView.layer.cornerRadius = 45/2
|
||||
_mewPhoneInputView.mewTextView.isHidden = true
|
||||
_mewPhoneInputView.mewLineView.isHidden = true
|
||||
_mewPhoneInputView.mewTextField.placeholder = "请输入帐号/ID"
|
||||
_mewPhoneInputView.mewTextField.keyboardType = .numberPad
|
||||
|
||||
return _mewPhoneInputView
|
||||
}()
|
||||
var mewPasswordView:MewUserPhoneLoginInputView = {
|
||||
let _mewPasswordView = MewUserPhoneLoginInputView .init(frame: CGRectZero)
|
||||
_mewPasswordView.backgroundColor = .white
|
||||
_mewPasswordView.layer.masksToBounds = true
|
||||
_mewPasswordView.layer.cornerRadius = 51/2
|
||||
_mewPasswordView.mewTextField.placeholder = "请输入密码"
|
||||
_mewPasswordView.mewTextView.text = "密码"
|
||||
_mewPasswordView.mewTextView.isHidden = true
|
||||
_mewPasswordView.mewLineView.isHidden = true
|
||||
_mewPasswordView.count = 16
|
||||
_mewPasswordView.mewTextField.keyboardType = .asciiCapable
|
||||
_mewPasswordView.mewTextField.isSecureTextEntry = true
|
||||
_mewPasswordView.mewTextField.clearButtonMode = .always
|
||||
return _mewPasswordView
|
||||
}()
|
||||
|
||||
var mewSendBtn:UIButton = {
|
||||
let _mewSendBtn = UIButton()
|
||||
_mewSendBtn.layer.masksToBounds = true
|
||||
_mewSendBtn.layer.cornerRadius = 45/2
|
||||
_mewSendBtn.setImage(R.image.mew_login_next(), for: .normal)
|
||||
_mewSendBtn.titleLabel?.font = UIFont.systemFont(ofSize: 18, weight: .medium)
|
||||
_mewSendBtn.setTitleColor(.black, for: .normal)
|
||||
let image = UIImage.mewSetColor(withColorList: [MewAppColor.mewGetColorOfText(hexString: 0xFF60FD),MewAppColor.mewGetColorOfText(hexString: 0x8974FF),MewAppColor.mewGetColorOfText(hexString: 0x69EBFF)], type: .leftToRight, imgSize: CGSizeMake(UIScreen.main.bounds.width - 2 * 36, 52))
|
||||
_mewSendBtn.setBackgroundImage(image, for: .normal)
|
||||
_mewSendBtn.setTitleColor(.white, for: .normal)
|
||||
_mewSendBtn.addTarget(self, action: #selector(mewSendViewAction), for: .touchUpInside)
|
||||
return _mewSendBtn
|
||||
}()
|
||||
var mewForgetBtn:UIButton = {
|
||||
let _mewForgetBtn = UIButton()
|
||||
_mewForgetBtn.setTitle("忘记密码?", for: .normal)
|
||||
_mewForgetBtn.setTitleColor(MewAppColor.mewGetAlphaColorOfText(hexString: 0xFFFFFF, alpha: 0.8), for: .normal)
|
||||
_mewForgetBtn.titleLabel?.font = UIFont.systemFont(ofSize: 14)
|
||||
_mewForgetBtn.addTarget(self, action: #selector(mewForgetBtnAction), for: .touchUpInside)
|
||||
return _mewForgetBtn
|
||||
}()
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
addSubview(mewPhoneInputView)
|
||||
addSubview(mewPasswordView)
|
||||
addSubview(mewPasswordView)
|
||||
addSubview(mewSendBtn)
|
||||
|
||||
mewPhoneInputView.snp.makeConstraints { make in
|
||||
make.top.equalTo(self);
|
||||
make.left.right.equalTo(self).inset(50);
|
||||
make.height.equalTo(51);
|
||||
}
|
||||
mewPasswordView.snp.makeConstraints { make in
|
||||
make.left.right.height.equalTo(self.mewPhoneInputView);
|
||||
make.top.equalTo(self.mewPhoneInputView.snp.bottom).offset(15);
|
||||
}
|
||||
mewPasswordView.snp.makeConstraints { make in
|
||||
make.right.equalTo(self.mewPasswordView);
|
||||
make.top.equalTo(self.mewPasswordView.snp.bottom).offset(10);
|
||||
}
|
||||
mewSendBtn.snp.makeConstraints { make in
|
||||
make.centerX.equalTo(self);
|
||||
make.top.equalTo(self.mewPasswordView.snp.bottom).offset(30);
|
||||
make.left.right.equalTo(self.mewPasswordView);
|
||||
make.height.equalTo(50);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
@objc func mewForgetBtnAction(){
|
||||
if let _successBlock = self.successBlock{
|
||||
_successBlock(0)
|
||||
}
|
||||
}
|
||||
@objc func mewSendViewAction(){
|
||||
if mewPhoneInputView.mewTextField.text?.count == 0{
|
||||
MewHUDTool.showError(withMessage: "请输入账号")
|
||||
}
|
||||
if mewPasswordView.mewTextField.text?.count == 0 {
|
||||
MewHUDTool.showError(withMessage: "请输入密码")
|
||||
return
|
||||
}
|
||||
let password = DESEncrypt.encryptUseDES(self.mewPasswordView.mewTextField.text ?? "", key:MewEncryptManager.mewAESDecryptText("BeKYtw9W3zMhFjuzb+vcnjdojaAyH9EGzCdIxstGcrq4NT2kD4vUPpFe9VZwRGHb"))
|
||||
let phone = DESEncrypt.encryptUseDES(self.mewPhoneInputView.mewTextField.text ?? "", key:MewEncryptManager.mewAESDecryptText("BeKYtw9W3zMhFjuzb+vcnjdojaAyH9EGzCdIxstGcrq4NT2kD4vUPpFe9VZwRGHb"))
|
||||
|
||||
MewOCServerManager.mewLoginApp(password: { obj, code, msg in
|
||||
if obj?.code == 200{
|
||||
if let model = MewLoginTokenInfoModel.mj_object(withKeyValues: obj?.data){
|
||||
if model.access_token.count > 0{
|
||||
MewSaveBaseUserModel.share().mewSaveBaseUserData(model)
|
||||
}
|
||||
MewHUDTool.showSuccess(withMessage: "登录成功")
|
||||
}
|
||||
if let _successBlock = self.successBlock{
|
||||
_successBlock(1)
|
||||
}
|
||||
return
|
||||
}
|
||||
MewHUDTool.showError(withMessage: msg)
|
||||
}, phone: phone, password: password, client_secret: "uyzjdhds", version: "1", client_id: "erban-client", grant_type: "password")
|
||||
|
||||
}
|
||||
}
|
@@ -1,29 +0,0 @@
|
||||
//
|
||||
// MewLoginInputView.h
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/7.
|
||||
//
|
||||
|
||||
/// 自定义登录输入框
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewLoginInputView : UIView
|
||||
///输入框
|
||||
@property (nonatomic,strong, readonly) UITextField *textField;
|
||||
///分割线
|
||||
@property (nonatomic,strong, readonly) UIView *lineView;
|
||||
///显示文本
|
||||
@property (nonatomic,strong, readonly) UILabel *titleLabel;
|
||||
///占位的文字
|
||||
@property (nonatomic,copy) NSString *placeHolder;
|
||||
///显示前面的文字
|
||||
@property (nonatomic,copy) NSString *title;
|
||||
///最大的长度
|
||||
@property (nonatomic,assign) NSInteger maxLength;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,129 +0,0 @@
|
||||
//
|
||||
// MewLoginInputView.m
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/7.
|
||||
//
|
||||
|
||||
#import "MewLoginInputView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
|
||||
|
||||
|
||||
@interface MewLoginInputView()<UITextFieldDelegate>
|
||||
///容器
|
||||
@property (nonatomic,strong) UIStackView *stackView;
|
||||
///分割线
|
||||
@property (nonatomic,strong) UIView *lineView;
|
||||
///显示文本
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
///输入框
|
||||
@property (nonatomic,strong) UITextField *textField;
|
||||
@end
|
||||
|
||||
@implementation MewLoginInputView
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self mew_initSubViews];
|
||||
[self mew_initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)mew_initSubViews {
|
||||
[self addSubview:self.stackView];
|
||||
[self addSubview:self.lineView];
|
||||
[self.stackView addArrangedSubview:self.titleLabel];
|
||||
[self.stackView addArrangedSubview:self.textField];
|
||||
}
|
||||
|
||||
- (void)mew_initSubViewConstraints {
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(53);
|
||||
}];
|
||||
|
||||
[self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(1);
|
||||
make.height.mas_equalTo(25);
|
||||
make.left.mas_equalTo(self).offset(55);
|
||||
make.centerY.mas_equalTo(self);
|
||||
}];
|
||||
|
||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self).offset(15);
|
||||
make.right.top.bottom.mas_equalTo(self);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setPlaceHolder:(NSString *)placeHolder {
|
||||
_placeHolder = placeHolder;
|
||||
if (_placeHolder) {
|
||||
self.textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:_placeHolder attributes:@{NSForegroundColorAttributeName: [MewAppColor mewSecondTextColor], NSFontAttributeName:[UIFont systemFontOfSize:14]}];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setTitle:(NSString *)title {
|
||||
_title = title;
|
||||
if (_title) {
|
||||
self.titleLabel.text = _title;
|
||||
}
|
||||
}
|
||||
|
||||
- (UIStackView *)stackView {
|
||||
if (!_stackView) {
|
||||
_stackView = [[UIStackView alloc] init];
|
||||
_stackView.axis = UILayoutConstraintAxisHorizontal;
|
||||
_stackView.distribution = UIStackViewDistributionFill;
|
||||
_stackView.alignment = UIStackViewAlignmentFill;
|
||||
_stackView.spacing = 0;
|
||||
}
|
||||
return _stackView;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:18];
|
||||
_titleLabel.textColor = [MewAppColor mewMainTextColor];
|
||||
_titleLabel.text = @"+86";
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UIView *)lineView {
|
||||
if (!_lineView) {
|
||||
_lineView = [[UIView alloc] init];
|
||||
_lineView.backgroundColor = [MewAppColor mewGetColorOfTextWithHexString:0xF2F3F6];
|
||||
}
|
||||
return _lineView;
|
||||
}
|
||||
|
||||
|
||||
- (UITextField *)textField {
|
||||
if (!_textField) {
|
||||
_textField = [[UITextField alloc] init];
|
||||
_textField.textColor = [MewAppColor mewMainTextColor];
|
||||
_textField.font = [UIFont systemFontOfSize:18.f];
|
||||
_textField.borderStyle = UITextBorderStyleNone;
|
||||
_textField.keyboardType = UIKeyboardTypeNumberPad;
|
||||
_textField.tintColor = [MewAppColor mewMainTextColor];
|
||||
_textField.backgroundColor = [UIColor clearColor];
|
||||
_textField.delegate = self;
|
||||
}
|
||||
return _textField;
|
||||
}
|
||||
|
||||
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
|
||||
return textField.text.length <= self.maxLength;
|
||||
}
|
||||
|
||||
- (void)textFieldDidChangeSelection:(UITextField *)textField {
|
||||
textField.text = [textField.text substringToIndex:MIN(textField.text.length, self.maxLength)];
|
||||
}
|
||||
|
||||
@end
|
@@ -16,7 +16,7 @@
|
||||
|
||||
#import "MEWCountDownHelper.h"
|
||||
#import "MewMacro.h"
|
||||
#import "UIImage+MewUtils.h"
|
||||
|
||||
#import "DESEncrypt.h"
|
||||
|
||||
@interface MewLoginForgetPasswordViewController ()<MEWCountDownHelperDelegate>
|
||||
@@ -201,7 +201,7 @@
|
||||
[_finishButton setImage:[UIImage imageNamed:@"mew_login_next"] forState:UIControlStateNormal];
|
||||
_finishButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||
[_finishButton setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
|
||||
UIImage *image = [UIImage mew_gradientColorImageFromColors:@[[MewAppColor mewGetColorOfTextWithHexString:0xFF60FD], [MewAppColor mewGetColorOfTextWithHexString:0x8974FF],[MewAppColor mewGetColorOfTextWithHexString:0x69EBFF]] gradientType:MewGradientTypeLeftToRight imgSize:CGSizeMake(KMewGetScreenWidth - 2*36, 52)];
|
||||
UIImage *image = [UIImage mewSetColorWithColorList:@[[MewAppColor mewGetColorOfTextWithHexString:0xFF60FD], [MewAppColor mewGetColorOfTextWithHexString:0x8974FF],[MewAppColor mewGetColorOfTextWithHexString:0x69EBFF]] type:mewImageDirectionTypeLeftToRight imgSize:CGSizeMake(KMewGetScreenWidth - 2*36, 52)];
|
||||
_finishButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||
[_finishButton addTarget:self action:@selector(mew_finishButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
|
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// MewLoginFullInfoViewController.h
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/6.
|
||||
//
|
||||
|
||||
#import "MewBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewLoginFullInfoViewController : MewBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,342 +0,0 @@
|
||||
//
|
||||
// MewLoginFullInfoViewController.m
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/6.
|
||||
//
|
||||
|
||||
#import "MewLoginFullInfoViewController.h"
|
||||
/// Third
|
||||
#import <Masonry.h>
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
///Tool
|
||||
|
||||
#import "MewMacro.h"
|
||||
|
||||
#import "UIImage+MewUtils.h"
|
||||
#import "MewHUDTool.h"
|
||||
///Model
|
||||
|
||||
/// presenter
|
||||
|
||||
|
||||
@interface MewLoginFullInfoViewController ()
|
||||
@property (nonatomic, strong) UIImageView *bgImageView;
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
/// 返回按钮
|
||||
@property (nonatomic, strong) UIButton *backButton;
|
||||
@property (nonatomic, strong) UIView *textFileBgView;
|
||||
///输入框
|
||||
@property (nonatomic,strong) UITextField *textField;
|
||||
///性别的容器
|
||||
@property (nonatomic,strong) UIStackView *sexStackView;
|
||||
///男用户
|
||||
@property (nonatomic,strong) UIButton *maleButton;
|
||||
///女用户
|
||||
@property (nonatomic,strong) UIButton *femaleButton;
|
||||
///下一步
|
||||
@property (nonatomic,strong) UIButton *nextButton;
|
||||
|
||||
///目前选择的性别
|
||||
@property (nonatomic, copy) NSString *sexString;
|
||||
@end
|
||||
|
||||
@implementation MewLoginFullInfoViewController
|
||||
|
||||
- (BOOL)mew_isHiddenNavBar {
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#pragma mark - Life Cycle
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
self.sexString = @"";
|
||||
[self mew_initSubViews];
|
||||
[self mew_initSubViewConstraints];
|
||||
}
|
||||
|
||||
#pragma mark - MewLoginFullInfoProtocol
|
||||
|
||||
|
||||
|
||||
#pragma mark - Action Event
|
||||
/// 男
|
||||
- (void)mew_maleButtonAction {
|
||||
self.femaleButton.selected = NO;
|
||||
self.maleButton.selected = YES;
|
||||
self.sexString = @"1";
|
||||
}
|
||||
|
||||
/// 女
|
||||
- (void)mew_femaleButtonAction {
|
||||
self.femaleButton.selected = YES;
|
||||
self.maleButton.selected = NO;
|
||||
self.sexString = @"2";
|
||||
}
|
||||
|
||||
/// 下一步
|
||||
- (void)mew_nextButtonAction {
|
||||
if (self.sexString.length == 0 || [self.sexString isEqualToString:@""]) {
|
||||
[MewHUDTool showErrorWithMessage:@"请选择性别"];
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.textField.text.length == 0 || [self.textField.text isEqualToString:@""]) {
|
||||
[MewHUDTool showErrorWithMessage:@"请输入昵称"];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
[self mew_updateUserInfo];
|
||||
}
|
||||
|
||||
|
||||
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
|
||||
[self.view endEditing:YES];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)mew_updateUserInfo {
|
||||
|
||||
|
||||
|
||||
|
||||
NSString * uid = [[MewSaveBaseUserModel share]mewGetUserId];
|
||||
NSString * ticket = [[MewSaveBaseUserModel share]mewUserTicket];
|
||||
NSMutableDictionary * params = [NSMutableDictionary dictionary];
|
||||
[params setObject:[self mew_getAvatarUrl] forKey:@"avatar"];
|
||||
[params setObject:self.maleButton.selected ? @"1":@"2" forKey:@"gender"];
|
||||
[params setObject:self.textField.text forKey:@"nick"];
|
||||
[params setObject:uid forKey:@"uid"];
|
||||
[params setObject:ticket forKey:@"ticket"];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[MewOCServerManager mewSetUserDataWithRegister:^(MewNetworkDataModel * _Nullable obj, NSInteger num, NSString * _Nonnull text) {
|
||||
if(obj.code == 200){
|
||||
[self mew_dissMissVC];
|
||||
}
|
||||
} userInfo:params];
|
||||
}
|
||||
|
||||
///获取头像 可能是从第三方获取的头像
|
||||
- (NSString *)mew_getAvatarUrl {
|
||||
NSString * avatar;
|
||||
if ([self mewGetAppleUserData] && [self mewGetAppleUserData].avatarUrl.length > 0) {
|
||||
avatar = [self mewGetAppleUserData].avatarUrl;
|
||||
} else {
|
||||
avatar = [MewEncryptManager mewAESDecryptText:@"xdPnNelVD/RTlTKFqgSrESDPcNF6Diqb8sLg+HEvxpvjDdTLom1euQUOAOppjx15"];
|
||||
}
|
||||
return avatar;
|
||||
}
|
||||
|
||||
- (void)mew_updateNextButton {
|
||||
if (self.textField.text.length > 0 && self.sexString.length > 0) {
|
||||
self.nextButton.enabled = YES;
|
||||
} else {
|
||||
self.nextButton.enabled = NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (MewAppleInfoModel *)mewGetAppleUserData {
|
||||
if ([MewSaveBaseUserModel share].mewAppleInfo) {
|
||||
return [MewSaveBaseUserModel share].mewAppleInfo;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)mew_dissMissVC {
|
||||
[[MewSaveBaseUserModel share]mewSaveUserTickets:nil];
|
||||
UIViewController *vc = self.presentingViewController;
|
||||
while (vc.presentingViewController) {
|
||||
vc = vc.presentingViewController;
|
||||
}
|
||||
[vc dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Init View
|
||||
- (void)mew_initSubViews {
|
||||
[self.view addSubview:self.bgImageView];
|
||||
[self.view addSubview:self.backButton];
|
||||
[self.view addSubview:self.titleLabel];
|
||||
[self.view addSubview:self.textFileBgView];
|
||||
[self.textFileBgView addSubview:self.textField];
|
||||
[self.view addSubview:self.sexStackView];
|
||||
[self.sexStackView addArrangedSubview:self.maleButton];
|
||||
[self.sexStackView addArrangedSubview:self.femaleButton];
|
||||
[self.view addSubview:self.nextButton];
|
||||
[self mew_initSubViewConstraints];
|
||||
if ([self mewGetAppleUserData] && [self mewGetAppleUserData].userName.length > 0) {
|
||||
self.textField.text = [self mewGetAppleUserData].userName;
|
||||
} else {
|
||||
[MewOCServerManager mewGetUserNick:^(MewNetworkDataModel * _Nullable obj, NSInteger num, NSString * _Nonnull text) {
|
||||
if(obj.code == 200){
|
||||
self.textField.text = obj.data;
|
||||
}
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)mew_initSubViewConstraints {
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.view);
|
||||
}];
|
||||
|
||||
[self.backButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.view).mas_offset(10);
|
||||
make.top.mas_equalTo(kMewGetBarHeight);
|
||||
make.height.width.mas_equalTo(44);
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.equalTo(self.backButton);
|
||||
make.centerX.equalTo(self.view);
|
||||
}];
|
||||
|
||||
|
||||
[self.sexStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.textField);
|
||||
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(60);
|
||||
}];
|
||||
|
||||
[self.textFileBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.sexStackView.mas_bottom).offset(32);
|
||||
make.left.mas_equalTo(36);
|
||||
make.right.mas_equalTo(-36);
|
||||
make.height.mas_equalTo(52);
|
||||
}];
|
||||
|
||||
[self.textField mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self.textFileBgView).inset(20);
|
||||
make.height.mas_equalTo(self.textFileBgView);
|
||||
}];
|
||||
|
||||
|
||||
[self.nextButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self.view).inset(36);
|
||||
make.height.mas_equalTo(52);
|
||||
make.top.mas_equalTo(self.textField.mas_bottom).offset(40);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)mew_initEvents {
|
||||
@weakify(self);
|
||||
[[self.textField.rac_textSignal map:^id _Nullable(NSString * _Nullable value) {
|
||||
if (value.length > 15) {
|
||||
value = [value substringToIndex:15];
|
||||
}
|
||||
return value;
|
||||
}] subscribeNext:^(id _Nullable x) {
|
||||
@strongify(self);
|
||||
self.textField.text = x;
|
||||
[self mew_updateNextButton];
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
// 返回
|
||||
- (void)mew_backButtonAction {
|
||||
[self dismissViewControllerAnimated:NO completion:nil];
|
||||
}
|
||||
|
||||
#pragma mark - Set
|
||||
|
||||
|
||||
#pragma mark - Get
|
||||
- (UIImageView *)bgImageView {
|
||||
if (!_bgImageView) {
|
||||
_bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mew_home_bg"]];
|
||||
}
|
||||
return _bgImageView;
|
||||
}
|
||||
|
||||
- (UIButton *)backButton {
|
||||
if (!_backButton) {
|
||||
_backButton = [[UIButton alloc] init];
|
||||
[_backButton setImage:[UIImage imageNamed:@"common_back_white_left"] forState:UIControlStateNormal];
|
||||
[_backButton addTarget:self action:@selector(mew_backButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _backButton;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.text = @"填写资料";
|
||||
_titleLabel.font = kMewSetFontMedium(18);
|
||||
_titleLabel.textColor = UIColor.whiteColor;
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UIView *)textFileBgView {
|
||||
if (!_textFileBgView) {
|
||||
_textFileBgView = [[UIView alloc] init];
|
||||
_textFileBgView.layer.cornerRadius = 52/2.f;
|
||||
_textFileBgView.layer.masksToBounds = YES;
|
||||
_textFileBgView.backgroundColor = UIColor.whiteColor;
|
||||
}
|
||||
return _textFileBgView;
|
||||
}
|
||||
|
||||
- (UITextField *)textField {
|
||||
if (!_textField) {
|
||||
_textField = [[UITextField alloc] init];
|
||||
_textField.textColor = [MewAppColor mewMainTextColor];
|
||||
_textField.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15.f];
|
||||
_textField.textAlignment = NSTextAlignmentLeft;
|
||||
_textField.placeholder = @"请输入昵称";
|
||||
}
|
||||
return _textField;
|
||||
}
|
||||
|
||||
- (UIStackView *)sexStackView {
|
||||
if (!_sexStackView) {
|
||||
_sexStackView = [[UIStackView alloc] init];
|
||||
_sexStackView.axis = UILayoutConstraintAxisHorizontal;
|
||||
_sexStackView.distribution = UIStackViewDistributionFill;
|
||||
_sexStackView.alignment = UIStackViewAlignmentCenter;
|
||||
_sexStackView.spacing = 15;
|
||||
}
|
||||
return _sexStackView;
|
||||
}
|
||||
|
||||
- (UIButton *)maleButton {
|
||||
if (!_maleButton) {
|
||||
_maleButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_maleButton setImage:[UIImage imageNamed:@"mew_login_full_man_normal"] forState:UIControlStateNormal];
|
||||
[_maleButton setImage:[UIImage imageNamed:@"mew_login_full_man_select"] forState:UIControlStateSelected];
|
||||
[_maleButton addTarget:self action:@selector(mew_maleButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _maleButton;
|
||||
}
|
||||
|
||||
- (UIButton *)femaleButton {
|
||||
if (!_femaleButton) {
|
||||
_femaleButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_femaleButton setImage:[UIImage imageNamed:@"mew_login_full_waman_normal"] forState:UIControlStateNormal];
|
||||
[_femaleButton setImage:[UIImage imageNamed:@"mew_login_full_waman_select"] forState:UIControlStateSelected];
|
||||
[_femaleButton addTarget:self action:@selector(mew_femaleButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _femaleButton;
|
||||
}
|
||||
|
||||
- (UIButton *)nextButton{
|
||||
if (!_nextButton) {
|
||||
_nextButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
_nextButton.layer.masksToBounds = YES;
|
||||
_nextButton.layer.cornerRadius = 52/2.f;
|
||||
[_nextButton setImage:[UIImage imageNamed:@"mew_login_next"] forState:UIControlStateNormal];
|
||||
_nextButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||
UIImage *image = [UIImage mew_gradientColorImageFromColors:@[[MewAppColor mewGetColorOfTextWithHexString:0xFF60FD], [MewAppColor mewGetColorOfTextWithHexString:0x8974FF],[MewAppColor mewGetColorOfTextWithHexString:0x69EBFF]] gradientType:MewGradientTypeLeftToRight imgSize:CGSizeMake(KMewGetScreenWidth - 2*36, 52)];
|
||||
_nextButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||
[_nextButton addTarget:self action:@selector(mew_nextButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _nextButton;
|
||||
}
|
||||
@end
|
@@ -13,7 +13,7 @@
|
||||
|
||||
|
||||
#import "MewMacro.h"
|
||||
#import "UIImage+MewUtils.h"
|
||||
|
||||
#import "MewHUDTool.h"
|
||||
#import "MEWCountDownHelper.h"
|
||||
///Model
|
||||
@@ -331,7 +331,7 @@
|
||||
_confirmBtn.layer.cornerRadius = 52/2.f;
|
||||
_confirmBtn.layer.masksToBounds = YES;
|
||||
_confirmBtn.enabled = NO;
|
||||
UIImage *image = [UIImage mew_gradientColorImageFromColors:@[[MewAppColor mewGetColorOfTextWithHexString:0xFF60FD], [MewAppColor mewGetColorOfTextWithHexString:0x8974FF],[MewAppColor mewGetColorOfTextWithHexString:0x69EBFF]] gradientType:MewGradientTypeLeftToRight imgSize:CGSizeMake(KMewGetScreenWidth - 2*36, 52)];
|
||||
UIImage *image = [UIImage mewSetColorWithColorList:@[[MewAppColor mewGetColorOfTextWithHexString:0xFF60FD], [MewAppColor mewGetColorOfTextWithHexString:0x8974FF],[MewAppColor mewGetColorOfTextWithHexString:0x69EBFF]] type:mewImageDirectionTypeLeftToRight imgSize:CGSizeMake(KMewGetScreenWidth - 2*36, 52)];
|
||||
_confirmBtn.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||
}
|
||||
return _confirmBtn;
|
||||
|
@@ -14,7 +14,7 @@
|
||||
///Tool
|
||||
|
||||
|
||||
#import "UIImage+MewUtils.h"
|
||||
|
||||
#import "MewMacro.h"
|
||||
///Model
|
||||
|
||||
@@ -250,7 +250,7 @@
|
||||
_submitButton.layer.masksToBounds = YES;
|
||||
_submitButton.layer.cornerRadius = 52/2;
|
||||
_submitButton.enabled = YES;
|
||||
UIImage *image = [UIImage mew_gradientColorImageFromColors:@[[MewAppColor mewGetColorOfTextWithHexString:0xFF60FD], [MewAppColor mewGetColorOfTextWithHexString:0x8974FF],[MewAppColor mewGetColorOfTextWithHexString:0x69EBFF]] gradientType:MewGradientTypeLeftToRight imgSize:CGSizeMake(KMewGetScreenWidth - 2*36, 52)];
|
||||
UIImage *image = [UIImage mewSetColorWithColorList:@[[MewAppColor mewGetColorOfTextWithHexString:0xFF60FD], [MewAppColor mewGetColorOfTextWithHexString:0x8974FF],[MewAppColor mewGetColorOfTextWithHexString:0x69EBFF]] type:mewImageDirectionTypeLeftToRight imgSize:CGSizeMake(KMewGetScreenWidth - 2*36, 52)];
|
||||
_submitButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||
[_submitButton addTarget:self action:@selector(mew_submitButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
|
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// ReviewLoginNumberViewController.h
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/7.
|
||||
//
|
||||
|
||||
#import "MewBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewLoginNumberViewController : MewBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,234 +0,0 @@
|
||||
//
|
||||
// MewLoginNumberViewController.m
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/7.
|
||||
//
|
||||
|
||||
#import "MewLoginNumberViewController.h"
|
||||
#import "MewLoginPhoneView.h"
|
||||
#import "MewLoginPasswordView.h"
|
||||
#import "MewLoginForgetPasswordViewController.h"
|
||||
/// Third
|
||||
#import <Masonry/Masonry.h>
|
||||
/// Tool
|
||||
#import "MewMacro.h"
|
||||
|
||||
@interface MewLoginNumberViewController ()<MewLoginPhoneViewDelegate, MewLoginPasswordViewDelegate>
|
||||
@property (nonatomic, strong) UIImageView *bgImageView;
|
||||
/// 返回按钮
|
||||
@property (nonatomic, strong) UIButton *backButton;
|
||||
/// 手机号登录
|
||||
@property (nonatomic, strong) UIButton *phoneButton;
|
||||
/// 账号登录
|
||||
@property (nonatomic, strong) UIButton *passwordButton;
|
||||
/// 下划线
|
||||
@property (nonatomic, strong) UIImageView *lineView;
|
||||
/// 是否选中了手机号登录
|
||||
@property (nonatomic, assign, getter=isPhoneSelect) BOOL phoneSelect;
|
||||
/// 手机登录View
|
||||
@property (nonatomic, strong) MewLoginPhoneView *phoneLoginView;
|
||||
/// 密码登录View
|
||||
@property (nonatomic, strong) MewLoginPasswordView *passwordLoginView;
|
||||
|
||||
/// 下一步
|
||||
@property (nonatomic,strong) UIButton *nextButton;
|
||||
@end
|
||||
|
||||
@implementation MewLoginNumberViewController
|
||||
|
||||
- (BOOL)mew_isHiddenNavBar {
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma mark - Life Cycle
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self mew_initSubView];
|
||||
self.phoneSelect = YES;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - MewLoginPhoneViewDelegate
|
||||
/// 手机登录成功
|
||||
- (void)mew_loginWithPhoneSuccess {
|
||||
|
||||
[self mew_disMissWithVC];
|
||||
}
|
||||
|
||||
#pragma mark - MewLoginPasswordViewDelegate
|
||||
/// 密码登录成功
|
||||
- (void)mew_loginWithPasswordScuccess {
|
||||
[self mew_disMissWithVC];
|
||||
}
|
||||
/// 忘记密码
|
||||
- (void)forgetPassword {
|
||||
MewLoginForgetPasswordViewController *controller = [[MewLoginForgetPasswordViewController alloc] init];
|
||||
[self.navigationController pushViewController:controller animated:NO];
|
||||
}
|
||||
|
||||
#pragma mark - Action Event
|
||||
// 返回
|
||||
- (void)mew_backButtonAction {
|
||||
[self.navigationController popViewControllerAnimated:NO];
|
||||
}
|
||||
|
||||
// 手机登录
|
||||
- (void)mew_phoneButtonAction {
|
||||
if (!self.isPhoneSelect) {
|
||||
self.phoneSelect = !self.isPhoneSelect;
|
||||
}
|
||||
}
|
||||
|
||||
// 密码登录
|
||||
- (void)mew_passwordButtonAction {
|
||||
if(self.isPhoneSelect) {
|
||||
self.phoneSelect = !self.isPhoneSelect;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)mew_disMissWithVC {
|
||||
UIViewController *vc = self.presentingViewController;
|
||||
while (vc.presentingViewController) {
|
||||
vc = vc.presentingViewController;
|
||||
}
|
||||
[vc dismissViewControllerAnimated:YES completion:nil];
|
||||
[self.navigationController popToRootViewControllerAnimated:NO];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Init View
|
||||
- (void)mew_initSubView {
|
||||
[self.view addSubview:self.bgImageView];
|
||||
[self.view addSubview:self.backButton];
|
||||
[self.view addSubview:self.phoneButton];
|
||||
[self.view addSubview:self.passwordButton];
|
||||
[self.view addSubview:self.lineView];
|
||||
[self.view addSubview:self.phoneLoginView];
|
||||
[self.view addSubview:self.passwordLoginView];
|
||||
[self mew_initSubViewConstraints];
|
||||
}
|
||||
|
||||
- (void)mew_initSubViewConstraints {
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.view);
|
||||
}];
|
||||
[self.backButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.view).mas_offset(10);
|
||||
make.top.mas_equalTo(kMewGetBarHeight);
|
||||
make.height.width.mas_equalTo(44);
|
||||
}];
|
||||
|
||||
[self.phoneButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(KMewGetScreenWidth/2);
|
||||
make.top.equalTo(self.backButton.mas_bottom).offset(40);
|
||||
make.height.mas_equalTo(40);
|
||||
make.left.equalTo(self.view);
|
||||
}];
|
||||
|
||||
[self.passwordButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.height.top.equalTo(self.phoneButton);
|
||||
make.left.equalTo(self.phoneButton.mas_right);
|
||||
}];
|
||||
|
||||
[self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.phoneButton.mas_bottom);
|
||||
make.left.mas_equalTo(KMewGetScreenWidth/4.0 - 60/2.0);
|
||||
make.width.mas_equalTo(60);
|
||||
make.height.mas_equalTo(5);
|
||||
}];
|
||||
|
||||
[self.phoneLoginView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.lineView.mas_bottom).offset(20);
|
||||
make.left.right.equalTo(self.view);
|
||||
make.height.mas_equalTo(KMewGetScreenHeight/2.0);
|
||||
}];
|
||||
|
||||
[self.passwordLoginView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.phoneLoginView);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#pragma mark - Set
|
||||
- (void)setPhoneSelect:(BOOL)phoneSelect {
|
||||
_phoneSelect = phoneSelect;
|
||||
/// 更新样式
|
||||
self.phoneButton.titleLabel.font = _phoneSelect ? kMewSetFontSemibold(18) : kMewSetFontSemibold(16);
|
||||
self.passwordButton.titleLabel.font = _phoneSelect ? kMewSetFontSemibold(16) : kMewSetFontSemibold(18);
|
||||
self.phoneLoginView.hidden = !_phoneSelect;
|
||||
self.passwordLoginView.hidden = _phoneSelect;
|
||||
|
||||
CGFloat left = _phoneSelect ? KMewGetScreenWidth/4.0 - 60/2.0 : KMewGetScreenWidth/2.0 + KMewGetScreenWidth/4.0 - 60/2.0;
|
||||
[self.lineView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(left);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Get
|
||||
- (UIImageView *)bgImageView {
|
||||
if (!_bgImageView) {
|
||||
_bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mew_home_bg"]];
|
||||
}
|
||||
return _bgImageView;
|
||||
}
|
||||
- (UIButton *)backButton {
|
||||
if (!_backButton) {
|
||||
_backButton = [[UIButton alloc] init];
|
||||
[_backButton setImage:[UIImage imageNamed:@"mew_common_back_white_left"] forState:UIControlStateNormal];
|
||||
[_backButton addTarget:self action:@selector(mew_backButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _backButton;
|
||||
}
|
||||
|
||||
- (UIButton *)phoneButton {
|
||||
if (!_phoneButton) {
|
||||
_phoneButton = [[UIButton alloc] init];
|
||||
[_phoneButton setTitle:@"手机号登录" forState:UIControlStateNormal];
|
||||
[_phoneButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
_phoneButton.titleLabel.font = kMewSetFontSemibold(16);
|
||||
[_phoneButton addTarget:self action:@selector(mew_phoneButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _phoneButton;
|
||||
}
|
||||
|
||||
- (UIButton *)passwordButton {
|
||||
if (!_passwordButton) {
|
||||
_passwordButton = [[UIButton alloc] init];
|
||||
[_passwordButton setTitle:@"账号登录" forState:UIControlStateNormal];
|
||||
[_passwordButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
_phoneButton.titleLabel.font = kMewSetFontSemibold(16);
|
||||
[_passwordButton addTarget:self action:@selector(mew_passwordButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _passwordButton;
|
||||
}
|
||||
|
||||
- (UIImageView *)lineView {
|
||||
if (!_lineView) {
|
||||
_lineView = [[UIImageView alloc] init];
|
||||
_lineView.image = [UIImage imageNamed:@"mew_login_line_bg"];
|
||||
}
|
||||
return _lineView;
|
||||
}
|
||||
|
||||
- (MewLoginPhoneView *)phoneLoginView {
|
||||
if (!_phoneLoginView) {
|
||||
_phoneLoginView = [[MewLoginPhoneView alloc] init];
|
||||
_phoneLoginView.delegate = self;
|
||||
}
|
||||
return _phoneLoginView;
|
||||
}
|
||||
|
||||
- (MewLoginPasswordView *)passwordLoginView {
|
||||
if (!_passwordLoginView) {
|
||||
_passwordLoginView = [[MewLoginPasswordView alloc] init];
|
||||
_passwordLoginView.delegate = self;
|
||||
_passwordLoginView.hidden = YES;
|
||||
}
|
||||
return _passwordLoginView;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// LoginViewController.h
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/6.
|
||||
//
|
||||
|
||||
#import "MewBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MewLoginViewController : MewBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,542 +0,0 @@
|
||||
//
|
||||
// LoginViewController.m
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/6.
|
||||
//
|
||||
|
||||
#import "MewLoginViewController.h"
|
||||
#import "MewLoginNumberViewController.h"
|
||||
|
||||
#import "MewWebViewController.h"
|
||||
//apple
|
||||
#import <AuthenticationServices/ASAuthorizationAppleIDButton.h>
|
||||
#import <AuthenticationServices/AuthenticationServices.h>
|
||||
#import <NTESQuickPass/NTESQuickPass.h>
|
||||
///Third
|
||||
#import <YYText.h>
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "MewMacro.h"
|
||||
|
||||
#import "MewHUDTool.h"
|
||||
#import "UIImage+MewUtils.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
///Present
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
UIKIT_EXTERN NSString * const kYinyouPrivateKey;
|
||||
NSString * const kHadAgreePrivacy = @"HadAgreePrivacy";
|
||||
|
||||
|
||||
API_AVAILABLE(ios(13.0))
|
||||
@interface MewLoginViewController ()<ASAuthorizationControllerDelegate,ASAuthorizationControllerPresentationContextProviding>
|
||||
@property (nonatomic, strong) UIView *contentView;
|
||||
/** 登录按钮*/
|
||||
@property (nonatomic, strong) UIButton *loginButton;
|
||||
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
|
||||
@property (nonatomic, strong) ASAuthorizationAppleIDButton *appleButton;
|
||||
#endif
|
||||
|
||||
/** 同意勾选按钮*/
|
||||
@property (nonatomic, strong) UIButton *agreeButton;
|
||||
/** 同意即可登录 */
|
||||
@property (nonatomic, strong) YYLabel *agreeLabel;
|
||||
/** 勾选隐私政策提示泡泡 */
|
||||
@property (nonatomic, strong) UIImageView *authBubbleView;
|
||||
/** 泡泡提示内容 */
|
||||
@property (nonatomic, strong) UILabel *authBubbleLabel;
|
||||
|
||||
@property (nonatomic, strong) UIImageView *bgImageView;
|
||||
@property (nonatomic, strong) UIImageView *helloBgImageView;
|
||||
@property (nonatomic, strong) UILabel *helloTitleLabel;
|
||||
@property (nonatomic, strong) UILabel *helloDetailLabel;
|
||||
@property (nonatomic, strong) UIView *leftLineView;
|
||||
@property (nonatomic, strong) UIView *rightLineView;
|
||||
@property (nonatomic, strong) UILabel *otherLoginTitleLabel;
|
||||
@end
|
||||
|
||||
@implementation MewLoginViewController
|
||||
|
||||
|
||||
|
||||
|
||||
#pragma mark - Life Cycle
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self mew_initView];
|
||||
[self mew_setUpConstraints];
|
||||
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
|
||||
}
|
||||
|
||||
- (BOOL)mew_isHiddenNavBar {
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma mark - Init View
|
||||
- (void)mew_initView {
|
||||
[self.view addSubview:self.bgImageView];
|
||||
[self.view addSubview:self.helloBgImageView];
|
||||
[self.view addSubview:self.helloTitleLabel];
|
||||
[self.view addSubview:self.helloDetailLabel];
|
||||
// [self.view addSubview:self.logoImageView];
|
||||
[self.view addSubview:self.contentView];
|
||||
[self.contentView addSubview:self.loginButton];
|
||||
// [self.contentView addSubview:self.stackView];
|
||||
[self.view addSubview:self.agreeButton];
|
||||
[self.view addSubview:self.agreeLabel];
|
||||
[self.view addSubview:self.authBubbleView];
|
||||
[self.authBubbleView addSubview:self.authBubbleLabel];
|
||||
[self.view addSubview:self.leftLineView];
|
||||
[self.view addSubview:self.rightLineView];
|
||||
[self.view addSubview:self.otherLoginTitleLabel];
|
||||
[self.view addSubview:self.appleButton];
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)mew_setUpConstraints {
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.view);
|
||||
}];
|
||||
[self.helloBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kMewGetBarHeight + 92);
|
||||
make.left.mas_equalTo(40);
|
||||
make.width.height.mas_equalTo(58);
|
||||
}];
|
||||
[self.helloTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.helloBgImageView.mas_right).offset(10);
|
||||
make.centerY.equalTo(self.helloBgImageView);
|
||||
}];
|
||||
[self.helloDetailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.helloBgImageView.mas_bottom).offset(20);
|
||||
make.left.equalTo(self.helloBgImageView);
|
||||
}];
|
||||
|
||||
[self.loginButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(40);
|
||||
make.right.mas_equalTo(-40);
|
||||
make.top.equalTo(self.helloDetailLabel.mas_bottom).offset(115);
|
||||
make.height.mas_equalTo(52);
|
||||
}];
|
||||
|
||||
|
||||
|
||||
[self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.view).offset(329);
|
||||
make.left.right.bottom.mas_equalTo(0);
|
||||
}];
|
||||
|
||||
|
||||
[self.appleButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.view).offset(-kMewGetSafeHeight - 60);
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.width.height.mas_equalTo(40);
|
||||
}];
|
||||
|
||||
[self.agreeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.appleButton.mas_bottom).offset(20);
|
||||
make.height.mas_equalTo(40);
|
||||
make.width.mas_equalTo(220);
|
||||
make.centerX.mas_equalTo(self.view).mas_offset(15 - 6);
|
||||
}];
|
||||
|
||||
[self.agreeButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(self.agreeLabel.mas_left).mas_offset(6);
|
||||
make.centerY.mas_equalTo(self.agreeLabel.mas_centerY);
|
||||
make.width.height.mas_equalTo(30);
|
||||
}];
|
||||
|
||||
[self.authBubbleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.agreeButton).mas_offset((-16));
|
||||
make.top.mas_equalTo(self.agreeButton.mas_bottom);
|
||||
make.width.mas_equalTo(235);
|
||||
make.height.mas_equalTo(29);
|
||||
}];
|
||||
|
||||
[self.authBubbleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(8);
|
||||
make.bottom.mas_equalTo(self.authBubbleView).mas_offset(-6);
|
||||
}];
|
||||
|
||||
[self.otherLoginTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(self.appleButton.mas_top).offset(-32);
|
||||
make.centerX.equalTo(self.view);
|
||||
}];
|
||||
[self.leftLineView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.otherLoginTitleLabel.mas_left).offset(-15);
|
||||
make.centerY.equalTo(self.otherLoginTitleLabel);
|
||||
make.left.equalTo(self.view).offset(31);
|
||||
make.height.mas_equalTo(0.5);
|
||||
}];
|
||||
[self.rightLineView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.otherLoginTitleLabel.mas_right).offset(15);
|
||||
make.centerY.equalTo(self.otherLoginTitleLabel);
|
||||
make.right.equalTo(self.view).offset(-31);
|
||||
make.height.mas_equalTo(0.5);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (void)mew_setViewHidden {
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
self.leftLineView.hidden = NO;
|
||||
self.rightLineView.hidden = NO;
|
||||
self.otherLoginTitleLabel.hidden = NO;
|
||||
self.appleButton.hidden = NO;
|
||||
} else {
|
||||
self.leftLineView.hidden = YES;
|
||||
self.rightLineView.hidden = YES;
|
||||
self.otherLoginTitleLabel.hidden = YES;
|
||||
self.appleButton.hidden = YES;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#pragma mark - Event Response
|
||||
- (void)mew_loginButtonAction:(UIButton *)sender {
|
||||
if (!self.agreeButton.isSelected) {
|
||||
[MewHUDTool showErrorWithMessage:@"请勾选协议"];
|
||||
return;
|
||||
}
|
||||
|
||||
MewLoginNumberViewController *controller = [[MewLoginNumberViewController alloc] init];
|
||||
[self.navigationController pushViewController:controller animated:NO];
|
||||
}
|
||||
/// 同意隐私政策
|
||||
- (void)mew_agreeButtonAction:(UIButton *)sender {
|
||||
self.agreeButton.selected = !self.agreeButton.selected;
|
||||
if (self.agreeButton.isSelected) {
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
[defaults setObject:@"hadAgree" forKey:kHadAgreePrivacy];
|
||||
[defaults synchronize];
|
||||
[UIView animateWithDuration:0.5 animations:^{
|
||||
self.authBubbleView.alpha = 0.0;
|
||||
}];
|
||||
} else {
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
NSString * hadAgree = [defaults stringForKey:kHadAgreePrivacy];
|
||||
if (hadAgree.length > 0) {
|
||||
[defaults removeObjectForKey:kHadAgreePrivacy];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// 苹果登录
|
||||
- (void)mew_loginWithApple {
|
||||
if (!self.agreeButton.isSelected) {
|
||||
[MewHUDTool showErrorWithMessage:@"请勾选协议"];
|
||||
return;
|
||||
}
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
// 基于用户的Apple ID授权用户,生成用户授权请求的一种机制
|
||||
ASAuthorizationAppleIDProvider * appleIDProvider = [[ASAuthorizationAppleIDProvider alloc] init];
|
||||
// 创建新的AppleID 授权请求
|
||||
ASAuthorizationAppleIDRequest * authAppleIDRequest = [appleIDProvider createRequest];
|
||||
// 在用户授权期间请求的联系信息
|
||||
// authAppleIDRequest.requestedScopes = @[ASAuthorizationScopeFullName, ASAuthorizationScopeEmail];
|
||||
//如果 KeyChain 里面也有登录信息的话,可以直接使用里面保存的用户名和密码进行登录。
|
||||
// ASAuthorizationPasswordRequest * passwordRequest = [[[ASAuthorizationPasswordProvider alloc] init] createRequest];
|
||||
|
||||
NSMutableArray <ASAuthorizationRequest *> * array = [NSMutableArray arrayWithCapacity:2];
|
||||
if (authAppleIDRequest) {
|
||||
[array addObject:authAppleIDRequest];
|
||||
}
|
||||
// if (passwordRequest) {
|
||||
// [array addObject:passwordRequest];
|
||||
// }
|
||||
NSArray <ASAuthorizationRequest *> * requests = [array copy];
|
||||
// 由ASAuthorizationAppleIDProvider创建的授权请求 管理授权请求的控制器
|
||||
ASAuthorizationController * authorization = [[ASAuthorizationController alloc] initWithAuthorizationRequests:requests];
|
||||
// 设置授权控制器通知授权请求的成功与失败的代理
|
||||
authorization.delegate = self;
|
||||
// 设置提供 展示上下文的代理,在这个上下文中 系统可以展示授权界面给用户
|
||||
authorization.presentationContextProvider = self;
|
||||
// 在控制器初始化期间启动授权流
|
||||
[authorization performRequests];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - ASAuthorizationControllerDelegate
|
||||
// 授权成功
|
||||
- (void)authorizationController:(ASAuthorizationController *)controller didCompleteWithAuthorization:(ASAuthorization *)authorization API_AVAILABLE(ios(13.0)) {
|
||||
|
||||
if ([authorization.credential isKindOfClass:[ASAuthorizationAppleIDCredential class]]) {
|
||||
MewAppleInfoModel *userInfo = [[MewAppleInfoModel alloc] init];
|
||||
|
||||
ASAuthorizationAppleIDCredential * credential = (ASAuthorizationAppleIDCredential *)authorization.credential;
|
||||
|
||||
// 苹果用户唯一标识符,该值在同一个开发者账号下的所有 App 下是一样的,开发者可以用该唯一标识符与自己后台系统的账号体系绑定起来。
|
||||
NSString * userID = credential.user;
|
||||
//把用户的唯一标识 传给后台 判断该用户是否绑定手机号,如果绑定了直接登录,如果没绑定跳绑定手机号页面
|
||||
// // 苹果用户信息 如果授权过,可能无法再次获取该信息
|
||||
NSPersonNameComponents * fullName = credential.fullName;
|
||||
NSString * email = credential.email;
|
||||
//
|
||||
// // 服务器验证需要使用的参数
|
||||
NSString * authorizationCode = [[NSString alloc] initWithData:credential.authorizationCode encoding:NSUTF8StringEncoding];
|
||||
NSString * identityToken = [[NSString alloc] initWithData:credential.identityToken encoding:NSUTF8StringEncoding];
|
||||
//
|
||||
NSString *tokenStr = [@"ios" stringByAppendingString:userID];
|
||||
// // 用于判断当前登录的苹果账号是否是一个真实用户,取值有:unsupported、unknown、likelyReal
|
||||
ASUserDetectionStatus realUserStatus = credential.realUserStatus;
|
||||
|
||||
if (fullName.familyName.length > 0 && fullName.givenName.length > 0) {
|
||||
userInfo.userName = [NSString stringWithFormat:@"%@%@",fullName.familyName, fullName.givenName];
|
||||
}
|
||||
|
||||
[MewSaveBaseUserModel share].mewAppleInfo = userInfo;
|
||||
[MewHUDTool mew_showLoadingWithMessage:@"正在登录中"];
|
||||
|
||||
[MewOCServerManager mewAppleLogin:^(MewNetworkDataModel * _Nullable obj, NSInteger num, NSString * _Nonnull text) {
|
||||
if(obj.code == 200){
|
||||
MewLoginTokenInfoModel *model = [MewLoginTokenInfoModel mj_objectWithKeyValues:obj.data];
|
||||
if (model != nil) {
|
||||
[[MewSaveBaseUserModel share]mewSaveBaseUserData:model];
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
[self mew_showSuccessToast:@"登录成功"];
|
||||
}
|
||||
}
|
||||
} openid:identityToken unionid:userID access_token:identityToken type:@"5"];
|
||||
|
||||
}else if ([authorization.credential isKindOfClass:[ASPasswordCredential class]]) {
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
// 授权失败
|
||||
- (void)authorizationController:(ASAuthorizationController *)controller didCompleteWithError:(NSError *)error API_AVAILABLE(ios(13.0)) {
|
||||
NSString *errorMsg = nil;
|
||||
switch (error.code) {
|
||||
case ASAuthorizationErrorCanceled:
|
||||
errorMsg = @"用户取消了授权请求";
|
||||
break;
|
||||
case ASAuthorizationErrorFailed:
|
||||
errorMsg = @"授权请求失败";
|
||||
break;
|
||||
case ASAuthorizationErrorInvalidResponse:
|
||||
errorMsg = @"授权请求响应无效";
|
||||
break;
|
||||
case ASAuthorizationErrorNotHandled:
|
||||
errorMsg = @"未能处理授权请求";
|
||||
break;
|
||||
case ASAuthorizationErrorUnknown:
|
||||
errorMsg = @"授权请求失败未知原因";
|
||||
break;
|
||||
}
|
||||
NSLog(@"%@", errorMsg);
|
||||
}
|
||||
|
||||
#pragma mark- ASAuthorizationControllerPresentationContextProviding
|
||||
- (ASPresentationAnchor)presentationAnchorForAuthorizationController:(ASAuthorizationController *)controller API_AVAILABLE(ios(13.0)){
|
||||
return self.view.window;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (UIButton *)loginButton{ //手机号码一键登录
|
||||
if (!_loginButton) {
|
||||
_loginButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
_loginButton.layer.masksToBounds = YES;
|
||||
_loginButton.layer.cornerRadius = 45/2.f;
|
||||
[_loginButton setTitle:@"账号登录" forState:UIControlStateNormal];
|
||||
[_loginButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
_loginButton.titleLabel.font = kMewSetFontMedium(16);
|
||||
_loginButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||
UIImage *bgImage = [UIImage mew_gradientColorImageFromColors:@[[MewAppColor mewGetColorOfTextWithHexString:0xFF60FD],
|
||||
[MewAppColor mewGetColorOfTextWithHexString:0x8974FF],
|
||||
[MewAppColor mewGetColorOfTextWithHexString:0x69EBFF]] gradientType:MewGradientTypeLeftToRight imgSize:CGSizeMake(KMewGetScreenWidth - 80, 52)];
|
||||
_loginButton.backgroundColor = [UIColor colorWithPatternImage:bgImage];
|
||||
[_loginButton addTarget:self action:@selector(mew_loginButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _loginButton;
|
||||
}
|
||||
|
||||
- (UIButton *)agreeButton {
|
||||
if (!_agreeButton) {
|
||||
_agreeButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_agreeButton setImage:[UIImage imageNamed:@"mew_login_agree_normal"] forState:UIControlStateNormal];
|
||||
[_agreeButton setImage:[UIImage imageNamed:@"mew_login_agree_sel"] forState:UIControlStateSelected];
|
||||
[_agreeButton addTarget:self action:@selector(mew_agreeButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
NSString *hadAgree = [defaults objectForKey:kHadAgreePrivacy];
|
||||
if (hadAgree.length > 0) {
|
||||
_agreeButton.selected = YES;
|
||||
}
|
||||
}
|
||||
return _agreeButton;
|
||||
}
|
||||
|
||||
- (YYLabel *)agreeLabel {
|
||||
if (!_agreeLabel) {
|
||||
_agreeLabel = [[YYLabel alloc] init];
|
||||
_agreeLabel.font = [UIFont systemFontOfSize:12];
|
||||
_agreeLabel.numberOfLines = 0;
|
||||
_agreeLabel.attributedText = [self privacyAttributedStr];
|
||||
_agreeLabel.textAlignment = NSTextAlignmentCenter;
|
||||
[_agreeLabel sizeToFit];
|
||||
}
|
||||
return _agreeLabel;
|
||||
}
|
||||
|
||||
- (NSMutableAttributedString *)privacyAttributedStr{
|
||||
NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:@"同意"];
|
||||
attString.yy_color = [MewAppColor mewGetAlphaColorOfTextWithHexString:0xffffff alpha:0.8];
|
||||
NSString *userString = @"《用户服务协议》";
|
||||
NSMutableAttributedString *userAttString = [[NSMutableAttributedString alloc] initWithString:userString attributes:@{NSForegroundColorAttributeName:UIColor.whiteColor}];
|
||||
__weak typeof(self) weakSelf = self;
|
||||
[userAttString yy_setTextHighlightRange:NSMakeRange(0, userAttString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
||||
__strong typeof(self) strongSelf = weakSelf;
|
||||
// 跳转用户协议
|
||||
MewWebViewController * webVC = [[MewWebViewController alloc] init];
|
||||
webVC.url = [NSString stringWithFormat:@"mew\%@",[MewEncryptManager mewAESDecryptText:@"oSYlxZYQP2Vu+3KRnQorypsYWQGEz2tKII7AwcFks7s="]];
|
||||
[strongSelf.navigationController pushViewController:webVC animated:YES];
|
||||
} longPressAction:nil];
|
||||
|
||||
NSMutableAttributedString *andString = [[NSMutableAttributedString alloc] initWithString:@"和"];
|
||||
andString.yy_color = [MewAppColor mewGetAlphaColorOfTextWithHexString:0xffffff alpha:0.8];
|
||||
NSString *protocolString = @"《隐私政策》";
|
||||
NSMutableAttributedString *privateString = [[NSMutableAttributedString alloc] initWithString:protocolString attributes:@{NSForegroundColorAttributeName:UIColor.whiteColor}];
|
||||
[privateString yy_setTextHighlightRange:NSMakeRange(0, privateString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
||||
__strong typeof(self) strongSelf = weakSelf;
|
||||
// 跳转隐私政策
|
||||
MewWebViewController * webVC = [[MewWebViewController alloc] init];
|
||||
webVC.url = [NSString stringWithFormat:@"mew\%@",[MewEncryptManager mewAESDecryptText:@"RW2RUxUBFSQXiYS0xFpDv+HMdWG2/xfjkYMyeSFR/BY="]];
|
||||
[strongSelf.navigationController pushViewController:webVC animated:YES];
|
||||
} longPressAction:nil];
|
||||
[attString appendAttributedString:userAttString];
|
||||
[attString appendAttributedString:andString];
|
||||
[attString appendAttributedString:privateString];
|
||||
return attString;
|
||||
}
|
||||
|
||||
- (UIImageView *)authBubbleView {
|
||||
if (!_authBubbleView) {
|
||||
_authBubbleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"login_auth_bubble"]];
|
||||
_authBubbleView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
_authBubbleView.alpha = 0;
|
||||
}
|
||||
return _authBubbleView;
|
||||
}
|
||||
|
||||
- (UILabel *)authBubbleLabel {
|
||||
if (!_authBubbleLabel) {
|
||||
_authBubbleLabel = [[UILabel alloc] init];
|
||||
_authBubbleLabel.text = @"同意隐私政策和用户协议后,才可以注册登录哦~";
|
||||
_authBubbleLabel.font = [UIFont systemFontOfSize:10];
|
||||
_authBubbleLabel.textColor = UIColor.whiteColor;
|
||||
}
|
||||
return _authBubbleLabel;
|
||||
}
|
||||
|
||||
- (UIView *)contentView {
|
||||
if (!_contentView) {
|
||||
_contentView = [[UIView alloc] init];
|
||||
}
|
||||
return _contentView;
|
||||
}
|
||||
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
|
||||
- (ASAuthorizationAppleIDButton *)appleButton API_AVAILABLE(ios(13.0)){ //苹果登录
|
||||
if (!_appleButton) {
|
||||
if (@available(iOS 13.0, *)) {
|
||||
_appleButton = [[ASAuthorizationAppleIDButton alloc] initWithAuthorizationButtonType:ASAuthorizationAppleIDButtonTypeContinue authorizationButtonStyle:ASAuthorizationAppleIDButtonStyleWhite];
|
||||
}
|
||||
|
||||
|
||||
_appleButton.cornerRadius = 20;
|
||||
[_appleButton addTarget:self action:@selector(mew_loginWithApple) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _appleButton;
|
||||
}
|
||||
#endif
|
||||
|
||||
- (UIImageView *)bgImageView {
|
||||
if (!_bgImageView) {
|
||||
_bgImageView = [[UIImageView alloc] init];
|
||||
_bgImageView.image = [UIImage imageNamed:@"mew_home_bg"];
|
||||
}
|
||||
return _bgImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)helloBgImageView {
|
||||
if (!_helloBgImageView) {
|
||||
_helloBgImageView = [[UIImageView alloc] init];
|
||||
_helloBgImageView.image = [UIImage imageNamed:@"mew_launch_logo"];
|
||||
_helloBgImageView.layer.cornerRadius = 10;
|
||||
_helloBgImageView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _helloBgImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)helloTitleLabel {
|
||||
if (!_helloTitleLabel){
|
||||
_helloTitleLabel = [[UILabel alloc]init];
|
||||
_helloTitleLabel.text = @"Hi!";
|
||||
_helloTitleLabel.textColor = UIColor.whiteColor;
|
||||
_helloTitleLabel.font = kMewSetFontMedium(68);
|
||||
}
|
||||
return _helloTitleLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)helloDetailLabel {
|
||||
if (!_helloDetailLabel) {
|
||||
_helloDetailLabel = [[UILabel alloc]init];
|
||||
_helloDetailLabel.text = @"欢迎来到音萌";
|
||||
_helloDetailLabel.textColor = UIColor.whiteColor;
|
||||
_helloDetailLabel.font = kMewSetFontMedium(40);
|
||||
}
|
||||
return _helloDetailLabel;
|
||||
}
|
||||
|
||||
- (UIView *)leftLineView {
|
||||
if (!_leftLineView) {
|
||||
_leftLineView = [[UIView alloc] init];
|
||||
_leftLineView.backgroundColor = UIColor.whiteColor;
|
||||
}
|
||||
return _leftLineView;
|
||||
}
|
||||
|
||||
- (UIView *)rightLineView {
|
||||
|
||||
if (!_rightLineView) {
|
||||
_rightLineView = [[UIView alloc] init];
|
||||
_rightLineView.backgroundColor = UIColor.whiteColor;
|
||||
}
|
||||
return _rightLineView;
|
||||
}
|
||||
- (UILabel *)otherLoginTitleLabel {
|
||||
if (!_otherLoginTitleLabel) {
|
||||
_otherLoginTitleLabel = [[UILabel alloc ]init];
|
||||
_otherLoginTitleLabel.text = @"其他登录方式";
|
||||
_otherLoginTitleLabel.textColor = UIColor.whiteColor;
|
||||
_otherLoginTitleLabel.font = kMewSetFontRegular(13);
|
||||
}
|
||||
return _otherLoginTitleLabel;
|
||||
}
|
||||
@end
|
@@ -1,23 +0,0 @@
|
||||
//
|
||||
// ReviewLoginPasswordView.h
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/8.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol MewLoginPasswordViewDelegate <NSObject>
|
||||
/// 密码登录成功
|
||||
- (void)mew_loginWithPasswordScuccess;
|
||||
/// 忘记密码
|
||||
- (void)forgetPassword;
|
||||
@end
|
||||
|
||||
@interface MewLoginPasswordView : UIView
|
||||
|
||||
@property (nonatomic, weak) id<MewLoginPasswordViewDelegate> delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,207 +0,0 @@
|
||||
//
|
||||
// MewLoginPasswordView.m
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/8.
|
||||
//
|
||||
|
||||
#import "MewLoginPasswordView.h"
|
||||
/// Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
/// Tool
|
||||
|
||||
#import "MewHUDTool.h"
|
||||
#import "UIImage+MewUtils.h"
|
||||
|
||||
#import "MewMacro.h"
|
||||
///View
|
||||
#import "MewLoginInputView.h"
|
||||
|
||||
|
||||
#import "DESEncrypt.h"
|
||||
@interface MewLoginPasswordView()
|
||||
|
||||
///手机号
|
||||
@property (nonatomic,strong) MewLoginInputView *phoneView;
|
||||
///密码
|
||||
@property (nonatomic,strong) MewLoginInputView *codeView;
|
||||
///忘记密码
|
||||
@property (nonatomic,strong) UIButton *forgetPasswordButton;
|
||||
///下一步
|
||||
@property (nonatomic,strong) UIButton *nextButton;
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation MewLoginPasswordView
|
||||
|
||||
#pragma mark - Life Cycle
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame: frame];
|
||||
if (self) {
|
||||
[self mew_initSubViews];
|
||||
[self mew_initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#pragma mark - Action Event
|
||||
/// 登录
|
||||
- (void)mew_nextButtonAction {
|
||||
if (self.phoneView.textField.text.length == 0 || [self.phoneView.textField.text isEqualToString:@""]) {
|
||||
[MewHUDTool showErrorWithMessage:@"请输入账号"];
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.codeView.textField.text.length == 0 || [self.codeView.textField.text isEqualToString:@""]) {
|
||||
[MewHUDTool showErrorWithMessage:@"请输入密码"];
|
||||
return;
|
||||
}
|
||||
NSString * desPassword = [DESEncrypt encryptUseDES:self.codeView.textField.text key:[MewEncryptManager mewAESDecryptText:@"BeKYtw9W3zMhFjuzb+vcnjdojaAyH9EGzCdIxstGcrq4NT2kD4vUPpFe9VZwRGHb"]];
|
||||
NSString * phone = [DESEncrypt encryptUseDES:self.phoneView.textField.text key:[MewEncryptManager mewAESDecryptText:@"BeKYtw9W3zMhFjuzb+vcnjdojaAyH9EGzCdIxstGcrq4NT2kD4vUPpFe9VZwRGHb"]];
|
||||
[MewOCServerManager mewLoginAppWithPassword:^(MewNetworkDataModel * _Nullable obj, NSInteger num, NSString * _Nonnull text) {
|
||||
if(obj.code == 200){
|
||||
MewLoginTokenInfoModel *model = [MewLoginTokenInfoModel mj_objectWithKeyValues:obj.data];
|
||||
if (model && model.access_token.length > 0){
|
||||
[[MewSaveBaseUserModel share]mewSaveBaseUserData:model];
|
||||
}
|
||||
[MewHUDTool showSuccessWithMessage:@"登录成功"];
|
||||
if (self.delegate) {
|
||||
[self.delegate mew_loginWithPasswordScuccess];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
[MewHUDTool showErrorWithMessage:text];
|
||||
} phone:phone password:desPassword client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"];
|
||||
}
|
||||
|
||||
/// 忘记密码
|
||||
- (void)mew_forgetPasswordButtonAction {
|
||||
if (self.delegate) {
|
||||
[self.delegate forgetPassword];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#pragma mark - Init View
|
||||
- (void)mew_initSubViews {
|
||||
// self.view.backgroundColor = [UIColor whiteColor];
|
||||
[self addSubview:self.phoneView];
|
||||
[self addSubview:self.codeView];
|
||||
[self addSubview:self.forgetPasswordButton];
|
||||
[self addSubview:self.nextButton];
|
||||
}
|
||||
|
||||
- (void)mew_initSubViewConstraints {
|
||||
CGFloat kscale = 363.0 / 375.0;
|
||||
[self.phoneView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self);
|
||||
make.left.right.mas_equalTo(self).inset(50);
|
||||
make.height.mas_equalTo(51);
|
||||
}];
|
||||
|
||||
[self.codeView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.height.mas_equalTo(self.phoneView);
|
||||
make.top.mas_equalTo(self.phoneView.mas_bottom).offset(15);
|
||||
}];
|
||||
|
||||
//登录按钮
|
||||
[self.nextButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self);
|
||||
make.top.mas_equalTo(self.forgetPasswordButton.mas_bottom).offset(30);
|
||||
make.left.right.mas_equalTo(self.codeView);
|
||||
make.height.mas_equalTo(50);
|
||||
}];
|
||||
|
||||
[self.forgetPasswordButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.centerY.mas_equalTo(self.codeView.mas_bottom).offset(8);
|
||||
make.right.mas_equalTo(self.codeView);
|
||||
make.top.equalTo(self.codeView.mas_bottom).offset(10);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)mew_initEvents {
|
||||
RAC(self.nextButton, enabled) = [[RACSignal combineLatest:@[self.phoneView.textField.rac_textSignal, self.codeView.textField.rac_textSignal] reduce:^id _Nonnull(NSString *phone, NSString* password){
|
||||
return @((phone.length > 0) && password.length >= 6);
|
||||
}] takeUntil:self.rac_willDeallocSignal];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Set
|
||||
- (UIButton *)nextButton {
|
||||
if (!_nextButton) {
|
||||
_nextButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
_nextButton.layer.masksToBounds = YES;
|
||||
_nextButton.layer.cornerRadius = 45/2.f;
|
||||
[_nextButton setImage:[UIImage imageNamed:@"mew_login_next"] forState:UIControlStateNormal];
|
||||
_nextButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||
[_nextButton setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
|
||||
UIImage *image = [UIImage mew_gradientColorImageFromColors:@[[MewAppColor mewGetColorOfTextWithHexString:0xFF60FD], [MewAppColor mewGetColorOfTextWithHexString:0x8974FF],[MewAppColor mewGetColorOfTextWithHexString:0x69EBFF]] gradientType:MewGradientTypeLeftToRight imgSize:CGSizeMake(KMewGetScreenWidth - 2*36, 52)];
|
||||
_nextButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||
[_nextButton addTarget:self action:@selector(mew_nextButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _nextButton;
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (UIButton *)forgetPasswordButton {
|
||||
if (!_forgetPasswordButton) {
|
||||
_forgetPasswordButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_forgetPasswordButton setTitle:@"忘记密码?" forState:UIControlStateNormal];
|
||||
[_forgetPasswordButton setTitleColor:[MewAppColor mewGetAlphaColorOfTextWithHexString:0xffffff alpha:0.8] forState:UIControlStateNormal];
|
||||
_forgetPasswordButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Regular" size:14];
|
||||
// _forgetPasswordButton.hidden = NO;
|
||||
[_forgetPasswordButton addTarget:self action:@selector(mew_forgetPasswordButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _forgetPasswordButton;
|
||||
}
|
||||
|
||||
- (MewLoginInputView *)phoneView {
|
||||
if (!_phoneView) {
|
||||
_phoneView = [[MewLoginInputView alloc] init];
|
||||
_phoneView.backgroundColor = UIColor.whiteColor;
|
||||
_phoneView.layer.masksToBounds = YES;
|
||||
_phoneView.layer.cornerRadius = 45/2;
|
||||
_phoneView.titleLabel.hidden = YES;
|
||||
_phoneView.lineView.hidden = YES;
|
||||
_phoneView.placeHolder = @"请输入帐号/ID";
|
||||
_phoneView.maxLength = 11;
|
||||
if (@available(iOS 10.0, *)) {
|
||||
_phoneView.textField.keyboardType = UIKeyboardTypeASCIICapableNumberPad;
|
||||
} else {
|
||||
// Fallback on earlier versions
|
||||
_phoneView.textField.keyboardType = UIKeyboardTypePhonePad;
|
||||
}
|
||||
}
|
||||
return _phoneView;
|
||||
}
|
||||
|
||||
- (MewLoginInputView *)codeView {
|
||||
if (!_codeView) {
|
||||
_codeView = [[MewLoginInputView alloc] init];
|
||||
_codeView.backgroundColor = UIColor.whiteColor;
|
||||
_codeView.layer.masksToBounds = YES;
|
||||
_codeView.layer.cornerRadius = 51.0/2;
|
||||
_codeView.placeHolder = @"请输入密码";
|
||||
_codeView.title = @"密码";
|
||||
_codeView.titleLabel.hidden = YES;
|
||||
_codeView.lineView.hidden = YES;
|
||||
_codeView.maxLength = 16;
|
||||
_codeView.textField.keyboardType = UIKeyboardTypeASCIICapable;
|
||||
_codeView.textField.secureTextEntry = YES;
|
||||
_codeView.textField.clearButtonMode = UITextFieldViewModeAlways;
|
||||
}
|
||||
return _codeView;
|
||||
}
|
||||
|
||||
|
||||
@end
|
@@ -1,21 +0,0 @@
|
||||
//
|
||||
// ReviewLoginPhoneView.h
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/8.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol MewLoginPhoneViewDelegate <NSObject>
|
||||
- (void)mew_loginWithPhoneSuccess;
|
||||
@end
|
||||
|
||||
@interface MewLoginPhoneView : UIView
|
||||
|
||||
@property (nonatomic, weak) id<MewLoginPhoneViewDelegate> delegate;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,332 +0,0 @@
|
||||
//
|
||||
// MewLoginPhoneView.m
|
||||
// mew-ios
|
||||
//
|
||||
// Created by 触海 on 2023/11/8.
|
||||
//
|
||||
|
||||
#import "MewLoginPhoneView.h"
|
||||
///第三方
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
|
||||
|
||||
/// Tool
|
||||
|
||||
#import "MewMacro.h"
|
||||
#import "MewHUDTool.h"
|
||||
#import "UIImage+MewUtils.h"
|
||||
/// View
|
||||
#import "MewLoginInputView.h"
|
||||
#import "DESEncrypt.h"
|
||||
@interface MewLoginPhoneView()
|
||||
/// 手机号码输入框
|
||||
@property (nonatomic, strong) MewLoginInputView *phoneInputView;
|
||||
@property (nonatomic, strong) NSString *phone;
|
||||
|
||||
///验证码输入框
|
||||
@property (nonatomic,strong) UITextField *codeTextField;
|
||||
///验证码View
|
||||
@property (nonatomic,strong) UIView *codeView;
|
||||
///重新获取验证码 和 倒计时
|
||||
//@property (nonatomic,strong) UIStackView *codeStackView;
|
||||
///显示倒计时
|
||||
@property (nonatomic,strong) UILabel *cutdownLabel;
|
||||
///重新获得验证码
|
||||
@property (nonatomic,strong) UIButton *retryCodeButton;
|
||||
/// 确认
|
||||
@property (nonatomic, strong) UIButton *confirmButton;
|
||||
|
||||
;
|
||||
/// 计时器
|
||||
@property (strong, nonatomic) dispatch_source_t timer;
|
||||
@end
|
||||
|
||||
@implementation MewLoginPhoneView
|
||||
|
||||
#pragma mark - Life Cycle
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self mew_initSubViews];
|
||||
[self mew_initSubViewConstraints];
|
||||
[self mew_initEvents];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
/// 销毁
|
||||
- (void)dealloc {
|
||||
[self mew_stopCountDown];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#pragma mark - Action Event
|
||||
/// 获取验证码
|
||||
- (void)mew_getSmsCodeButtonAction {
|
||||
if (self.phone.length < 11 || self.phone == nil) {
|
||||
[MewHUDTool showErrorWithMessage:@"请输入手机号码"];
|
||||
return;
|
||||
}
|
||||
|
||||
NSString *phone = [DESEncrypt encryptUseDES:self.phone key:[MewEncryptManager mewAESDecryptText:@"BeKYtw9W3zMhFjuzb+vcnjdojaAyH9EGzCdIxstGcrq4NT2kD4vUPpFe9VZwRGHb"]];
|
||||
[MewOCServerManager mewGetPhoneAuthCode:^(MewNetworkDataModel * _Nullable obj, NSInteger num, NSString * _Nonnull text) {
|
||||
if(obj.code == 200){
|
||||
[MewHUDTool showErrorWithMessage:[NSString stringWithFormat:@"验证码已发送\n+86 %@", self.phone]];
|
||||
/// 开启定时器
|
||||
[self mew_openCountdownWithTime:60];
|
||||
}
|
||||
} mobile:phone type:@(MewUserLoginType_Regist).stringValue];
|
||||
|
||||
}
|
||||
|
||||
- (void)textFieldDidChange:(UITextField *)text {
|
||||
if (text.text.length > 5) {
|
||||
text.text = [text.text substringToIndex:5];
|
||||
}
|
||||
|
||||
self.confirmButton.enabled = (text.text.length == 5 && self.phone.length == 11);
|
||||
}
|
||||
|
||||
/// 下一步
|
||||
- (void)mew_confirmButtonAction {
|
||||
NSString *phone = [DESEncrypt encryptUseDES:self.phone key:[MewEncryptManager mewAESDecryptText:@"BeKYtw9W3zMhFjuzb+vcnjdojaAyH9EGzCdIxstGcrq4NT2kD4vUPpFe9VZwRGHb"]];
|
||||
|
||||
[MewOCServerManager mewLoginAppWithCode:^(MewNetworkDataModel * _Nullable obj, NSInteger num, NSString * _Nonnull text) {
|
||||
if(obj.code == 200){
|
||||
MewLoginTokenInfoModel *accountModel = [MewLoginTokenInfoModel mj_objectWithKeyValues:obj.data];
|
||||
if (accountModel && accountModel.access_token.length > 0) {
|
||||
[[MewSaveBaseUserModel share]mewSaveBaseUserData:accountModel];
|
||||
}
|
||||
|
||||
[MewHUDTool showSuccessWithMessage:@"登录成功"];
|
||||
[self mew_stopCountDown];
|
||||
if (self.delegate) {
|
||||
[self.delegate mew_loginWithPhoneSuccess];
|
||||
}
|
||||
return;
|
||||
}
|
||||
[MewHUDTool showErrorWithMessage:text];
|
||||
} phone:phone code:self.codeTextField.text client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
/// 开启定时器
|
||||
- (void)mew_openCountdownWithTime:(int)totalTime {
|
||||
if (time <= 0) {
|
||||
return;
|
||||
}
|
||||
__block int time = totalTime; //倒计时时间
|
||||
if (self.timer != nil) {
|
||||
dispatch_source_cancel(self.timer);
|
||||
}
|
||||
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
|
||||
self.timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue);
|
||||
dispatch_source_set_timer(self.timer,dispatch_walltime(NULL, 0),1.0*NSEC_PER_SEC, 0); //每秒执行
|
||||
__weak typeof(self) weakself = self;
|
||||
dispatch_source_set_event_handler(self.timer, ^{
|
||||
__strong typeof(weakself) self = weakself;
|
||||
if(time <= 0){ //倒计时结束,关闭
|
||||
dispatch_source_cancel(self.timer);
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self mew_onCountdownFinish];
|
||||
});
|
||||
}else{
|
||||
time--;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
//设置按钮显示读秒效果
|
||||
[self mew_onCountdownOpen:time];
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
dispatch_resume(self.timer);
|
||||
}
|
||||
|
||||
/// 倒计时中
|
||||
- (void)mew_onCountdownOpen:(int)time {
|
||||
self.cutdownLabel.hidden = NO;
|
||||
self.retryCodeButton.hidden = YES;
|
||||
self.cutdownLabel.text = [NSString stringWithFormat:@"%d %@", time, @"s"];
|
||||
}
|
||||
|
||||
/// 倒计时结束
|
||||
- (void)mew_onCountdownFinish {
|
||||
self.retryCodeButton.hidden = NO;
|
||||
self.cutdownLabel.hidden = YES;
|
||||
}
|
||||
|
||||
// 停止倒计时
|
||||
- (void)mew_stopCountDown {
|
||||
if (self.timer != nil) {
|
||||
dispatch_source_cancel(self.timer);
|
||||
self.timer = nil;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Init View
|
||||
- (void)mew_initSubViews {
|
||||
[self addSubview:self.phoneInputView];
|
||||
[self addSubview:self.codeView];
|
||||
// [self.codeView addSubview:self.codeStackView];
|
||||
[self.codeView addSubview:self.codeTextField];
|
||||
[self.codeView addSubview:self.cutdownLabel];
|
||||
[self.codeView addSubview:self.retryCodeButton];
|
||||
[self addSubview:self.confirmButton];
|
||||
}
|
||||
|
||||
- (void)mew_initSubViewConstraints {
|
||||
CGFloat kscale = 363.0 / 375.0;
|
||||
[self.phoneInputView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self);
|
||||
make.left.mas_equalTo(36);
|
||||
make.right.mas_equalTo(-36);
|
||||
make.height.mas_equalTo(52);
|
||||
}];
|
||||
|
||||
[self.codeView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.phoneInputView.mas_bottom).offset(20);
|
||||
make.left.right.height.equalTo(self.phoneInputView);
|
||||
}];
|
||||
|
||||
[self.retryCodeButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.codeView).offset(-15);
|
||||
make.centerY.equalTo(self.codeView);
|
||||
}];
|
||||
[self.cutdownLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.retryCodeButton);
|
||||
}];
|
||||
[self.codeTextField mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.codeView).offset(15);
|
||||
make.centerY.equalTo(self.codeView);
|
||||
}];
|
||||
|
||||
// [self.codeStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.left.right.mas_equalTo(self.codeView).inset(15);
|
||||
// make.top.bottom.mas_equalTo(self.codeView);
|
||||
// }];
|
||||
|
||||
[self.confirmButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.codeView.mas_bottom).offset(15);
|
||||
make.left.right.height.mas_equalTo(self.codeView);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)mew_initEvents {
|
||||
@weakify(self);
|
||||
|
||||
// [self.phoneInputView.textField.rac_textSignal map:^id _Nullable(NSString * _Nullable value) {
|
||||
// NSLog(@"value:%@",value);
|
||||
// return YES;
|
||||
// }];
|
||||
[self.phoneInputView.textField.rac_textSignal subscribeNext:^(NSString * _Nullable value) {
|
||||
@strongify(self);
|
||||
self.phone = value;
|
||||
}];
|
||||
|
||||
// [[self.phoneInputView.textField.rac_textSignal map:^id _Nullable(NSString * _Nullable value) {
|
||||
// self.phone = value;
|
||||
//
|
||||
// return value;
|
||||
// }] subscribeNext:^(id _Nullable x) {
|
||||
//// @strongify(self);
|
||||
//// self.phoneInputView.textField.text = x;
|
||||
//// [self updateNextButton];
|
||||
// }];
|
||||
//
|
||||
// [self.phoneInputView.textField.rac_textSignal filter:^BOOL(NSString * _Nullable value) {
|
||||
// @strongify(self);
|
||||
// self.phone = value;
|
||||
// return YES;
|
||||
// }];
|
||||
}
|
||||
|
||||
#pragma mark - Get
|
||||
- (MewLoginInputView *)phoneInputView {
|
||||
if (!_phoneInputView) {
|
||||
_phoneInputView = [[MewLoginInputView alloc] init];
|
||||
_phoneInputView.backgroundColor = [MewAppColor mewGetColorOfTextWithHexString:0xF8F8FB];
|
||||
_phoneInputView.layer.cornerRadius = 51.0/2;
|
||||
_phoneInputView.layer.masksToBounds = YES;
|
||||
_phoneInputView.maxLength = 11;
|
||||
_phoneInputView.placeHolder = @"请输入手机号码";
|
||||
}
|
||||
return _phoneInputView;
|
||||
}
|
||||
|
||||
- (UIView *)codeView {
|
||||
if (!_codeView) {
|
||||
_codeView = [[UIView alloc] init];
|
||||
_codeView.backgroundColor = UIColor.whiteColor;
|
||||
_codeView.layer.masksToBounds = YES;
|
||||
_codeView.layer.cornerRadius = 51.0/2;
|
||||
|
||||
}
|
||||
return _codeView;
|
||||
}
|
||||
|
||||
- (UITextField *)codeTextField {
|
||||
if (!_codeTextField) {
|
||||
_codeTextField = [[UITextField alloc] init];
|
||||
_codeTextField.textColor = [MewAppColor mewMainTextColor];
|
||||
_codeTextField.font = [UIFont systemFontOfSize:18.f];
|
||||
_codeTextField.keyboardType = UIKeyboardTypeNumberPad;
|
||||
_codeTextField.tintColor = [MewAppColor mewMainTextColor];
|
||||
_codeTextField.backgroundColor = [UIColor clearColor];
|
||||
[_codeTextField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
|
||||
_codeTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入验证码" attributes:@{NSForegroundColorAttributeName: [MewAppColor mewSecondTextColor], NSFontAttributeName:[UIFont systemFontOfSize:14]}];
|
||||
}
|
||||
return _codeTextField;
|
||||
}
|
||||
|
||||
- (UILabel *)cutdownLabel {
|
||||
if (!_cutdownLabel) {
|
||||
_cutdownLabel = [[UILabel alloc] init];
|
||||
_cutdownLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_cutdownLabel.font = [UIFont boldSystemFontOfSize:11];
|
||||
_cutdownLabel.textColor = [MewAppColor mewSecondTextColor];
|
||||
_cutdownLabel.hidden = YES;
|
||||
}
|
||||
return _cutdownLabel;
|
||||
}
|
||||
|
||||
|
||||
- (UIButton *)retryCodeButton {
|
||||
if (!_retryCodeButton) {
|
||||
_retryCodeButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_retryCodeButton setTitle:@"获取验证码" forState:UIControlStateNormal];
|
||||
[_retryCodeButton setTitleColor:[MewAppColor mewGetColorOfTextWithHexString:0x9552FF] forState:UIControlStateNormal];
|
||||
_retryCodeButton.titleLabel.font = [UIFont systemFontOfSize:11 weight:UIFontWeightMedium];
|
||||
[_retryCodeButton addTarget:self action:@selector(mew_getSmsCodeButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
_retryCodeButton.hidden = NO;
|
||||
}
|
||||
return _retryCodeButton;
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (UIButton *)confirmButton{
|
||||
if (!_confirmButton) {
|
||||
_confirmButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
_confirmButton.layer.masksToBounds = YES;
|
||||
_confirmButton.layer.cornerRadius = 52/2.f;
|
||||
[_confirmButton setImage:[UIImage imageNamed:@"mew_login_next"] forState:UIControlStateNormal];
|
||||
_confirmButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
|
||||
UIImage *image = [UIImage mew_gradientColorImageFromColors:@[[MewAppColor mewGetColorOfTextWithHexString:0xFF60FD], [MewAppColor mewGetColorOfTextWithHexString:0x8974FF],[MewAppColor mewGetColorOfTextWithHexString:0x69EBFF]] gradientType:MewGradientTypeLeftToRight imgSize:CGSizeMake(KMewGetScreenWidth - 2*36, 52)];
|
||||
_confirmButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||
[_confirmButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
[_confirmButton addTarget:self action:@selector(mew_confirmButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _confirmButton;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
@@ -16,9 +16,8 @@
|
||||
|
||||
|
||||
#import "MewNIMMessageUtils.h"
|
||||
#import "MewTimeIntervalUtils.h"
|
||||
#import "UIView+NIM.h"
|
||||
#import "UIView+MewFilletCorner.h"
|
||||
|
||||
#import "MewMacro.h"
|
||||
@interface MewSessionListTableViewCell()
|
||||
|
||||
@@ -53,10 +52,10 @@
|
||||
|
||||
/// 时间处理
|
||||
if (recent.lastMessage) {
|
||||
self.timeLabel.text = [MewTimeIntervalUtils mewShowTime:recent.lastMessage.timestamp showDetail:NO];
|
||||
self.timeLabel.text = [self mewGetDate:recent.lastMessage.timestamp isShow:NO];
|
||||
} else {
|
||||
NSTimeInterval timeSecond = recent.updateTime / 1000.0;
|
||||
self.timeLabel.text = [MewTimeIntervalUtils mewShowTime:timeSecond showDetail:NO];
|
||||
self.timeLabel.text = [self mewGetDate:timeSecond isShow:NO];
|
||||
}
|
||||
[self.timeLabel sizeToFit];
|
||||
|
||||
@@ -72,7 +71,86 @@
|
||||
|
||||
|
||||
}
|
||||
// 时间戳转换成字符串
|
||||
- (NSString*)mewGetDate:(NSTimeInterval) mewDate isShow:(BOOL)isShow {
|
||||
//今天的时间
|
||||
NSDate * nowDate = [NSDate date];
|
||||
NSDate * msgDate = [NSDate dateWithTimeIntervalSince1970:mewDate];
|
||||
NSString *result = nil;
|
||||
NSCalendarUnit components = (NSCalendarUnit)(NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitWeekday|NSCalendarUnitHour | NSCalendarUnitMinute);
|
||||
NSDateComponents *nowDateComponents = [[NSCalendar currentCalendar] components:components fromDate:nowDate];
|
||||
NSDateComponents *msgDateComponents = [[NSCalendar currentCalendar] components:components fromDate:msgDate];
|
||||
|
||||
NSInteger hour = msgDateComponents.hour;
|
||||
double OnedayTimeIntervalValue = 24*60*60; //一天的秒数
|
||||
|
||||
result = [self mewGetTime:hour mewMinute:msgDateComponents.minute];
|
||||
if (hour > 12)
|
||||
{
|
||||
hour = hour - 12;
|
||||
}
|
||||
|
||||
BOOL isSameMonth = (nowDateComponents.year == msgDateComponents.year) && (nowDateComponents.month == msgDateComponents.month);
|
||||
|
||||
if(isSameMonth && (nowDateComponents.day == msgDateComponents.day)) //同一天,显示时间
|
||||
{
|
||||
result = [[NSString alloc] initWithFormat:@"%@ %zd:%02d",result,hour,(int)msgDateComponents.minute];
|
||||
}
|
||||
else if(isSameMonth && (nowDateComponents.day == (msgDateComponents.day+1)))//昨天
|
||||
{
|
||||
result = isShow? [[NSString alloc] initWithFormat:@"昨天%@ %zd:%02d",result,hour,(int)msgDateComponents.minute] : @"昨天";
|
||||
}
|
||||
else if(isSameMonth && (nowDateComponents.day == (msgDateComponents.day+2))) //前天
|
||||
{
|
||||
result = isShow? [[NSString alloc] initWithFormat:@"前天%@ %zd:%02d",result,hour,(int)msgDateComponents.minute] : @"前天";
|
||||
}
|
||||
else if([nowDate timeIntervalSinceDate:msgDate] < 7 * OnedayTimeIntervalValue)//一周内
|
||||
{
|
||||
NSString *weekDay = [self mewSetWeekdayText:msgDateComponents.weekday];
|
||||
result = isShow? [weekDay stringByAppendingFormat:@"%@ %zd:%02d",result,hour,(int)msgDateComponents.minute] : weekDay;
|
||||
}
|
||||
else//显示日期
|
||||
{
|
||||
NSString *day = [NSString stringWithFormat:@"%zd-%zd-%zd", msgDateComponents.year, msgDateComponents.month, msgDateComponents.day];
|
||||
result = isShow? [day stringByAppendingFormat:@"%@ %zd:%02d",result,hour,(int)msgDateComponents.minute]:day;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#pragma mark - Private
|
||||
- (NSString *)mewGetTime:(NSInteger)time mewMinute:(NSInteger)mewMinute {
|
||||
NSInteger totalMin = time *60 + mewMinute;
|
||||
NSString *showPeriodOfTime = @"";
|
||||
if (totalMin > 0 && totalMin <= 5 * 60)
|
||||
{
|
||||
showPeriodOfTime = @"凌晨";
|
||||
}
|
||||
else if (totalMin > 5 * 60 && totalMin < 12 * 60)
|
||||
{
|
||||
showPeriodOfTime = @"上午";
|
||||
}
|
||||
else if (totalMin >= 12 * 60 && totalMin <= 18 * 60)
|
||||
{
|
||||
showPeriodOfTime = @"下午";
|
||||
}
|
||||
else if ((totalMin > 18 * 60 && totalMin <= (23 * 60 + 59)) || totalMin == 0)
|
||||
{
|
||||
showPeriodOfTime = @"晚上";
|
||||
}
|
||||
return showPeriodOfTime;
|
||||
}
|
||||
|
||||
- (NSString*)mewSetWeekdayText:(NSInteger)weekText {
|
||||
static NSDictionary *daysOfWeekDict = nil;
|
||||
daysOfWeekDict = @{@(1):@"星期日",
|
||||
@(2):@"星期一",
|
||||
@(3):@"星期二",
|
||||
@(4):@"星期三",
|
||||
@(5):@"星期四",
|
||||
@(6):@"星期五",
|
||||
@(7):@"星期六",};
|
||||
return [daysOfWeekDict objectForKey:@(weekText)];
|
||||
}
|
||||
#pragma mark - Init
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(nullable NSString *)reuseIdentifier {
|
||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
|
||||
@@ -157,7 +235,8 @@
|
||||
- (UIView *)containerView {
|
||||
if (!_containerView) {
|
||||
_containerView = [[UIView alloc] init];
|
||||
[_containerView mew_setCornerWithLeftTopCorner:36 rightTopCorner:10 bottomLeftCorner:36 bottomRightCorner:10 size:CGSizeMake(KMewGetScreenWidth - 32, 72)];
|
||||
CAShapeLayer * layer = [UIImage mewSetViewCornerWithDirection:36 rightTop:10 bottomLeft:36 bottomRight:10 size:CGSizeMake(KMewGetScreenWidth - 32, 72)];
|
||||
_containerView.layer.mask = layer;
|
||||
_containerView.backgroundColor = [MewAppColor mewGetColorOfTextWithHexString:0x525566];
|
||||
}
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "UIImage+MewUtils.h"
|
||||
|
||||
|
||||
#define MESSAGE_IMAGE_MAX_SIZE (CONTENT_WIDTH_MAX)
|
||||
#define MESSAGE_IMAGE_Min_SIZE (CONTENT_WIDTH_MAX -100)
|
||||
@@ -48,7 +48,7 @@
|
||||
UIImage *image = [UIImage imageWithContentsOfFile:imageObject.thumbPath];
|
||||
imageSize = image ? image.size : CGSizeZero;
|
||||
}
|
||||
CGSize contentSize = [UIImage mew_sizeWithImageOriginSize:imageSize
|
||||
CGSize contentSize = [UIImage mewGetImageSize:imageSize
|
||||
minSize:CGSizeMake(attachmentImageMinWidth, attachmentImageMinHeight)
|
||||
maxSize:CGSizeMake(attachmemtImageMaxWidth, attachmentImageMaxHeight)];
|
||||
return contentSize.height + MESSAGE_PADDING * 2 + CONTENT_PADDING_V_TOTAL;
|
||||
@@ -68,7 +68,7 @@
|
||||
UIImage *image = [UIImage imageWithContentsOfFile:imageObject.thumbPath];
|
||||
imageSize = image ? image.size : CGSizeZero;
|
||||
}
|
||||
CGSize contentSize = [UIImage mew_sizeWithImageOriginSize:imageSize
|
||||
CGSize contentSize = [UIImage mewGetImageSize:imageSize
|
||||
minSize:CGSizeMake(attachmentImageMinWidth, attachmentImageMinHeight)
|
||||
maxSize:CGSizeMake(attachmemtImageMaxWidth, attachmentImageMaxHeight)];
|
||||
|
||||
|
@@ -84,7 +84,7 @@
|
||||
}
|
||||
|
||||
#pragma mark - MewMessageContentProtocol
|
||||
+ (CGFloat)mew_sesstionMeasureHeight:(NIMMessage *)message {
|
||||
+ (CGFloat)Mew_SessionMeasureHeight:(NIMMessage *)message {
|
||||
NSInteger audioContentHeight = 30;
|
||||
return (audioContentHeight + CONTENT_PADDING_V_TOTAL+ MESSAGE_PADDING * 2);
|
||||
}
|
||||
|
@@ -178,7 +178,7 @@
|
||||
|
||||
- (void)mew_reportButtonAction:(UIButton *)sender {
|
||||
MewWebViewController *mewH5View = [MewWebViewController new];
|
||||
mewH5View.url = [NSString stringWithFormat:@"%@%@",@"yinmeng/",[MewEncryptManager mewAESDecryptText:@"70Q7xveLGyhX/bCtIiVuWA3ignYGv+sF38FhGnsIIr0="]];
|
||||
mewH5View.path = [NSString stringWithFormat:@"%@%@?reportUid=%@&source=CHAT",@"yinmeng/",[MewEncryptManager mewAESDecryptText:@"70Q7xveLGyhX/bCtIiVuWA3ignYGv+sF38FhGnsIIr0="],self.userId];
|
||||
|
||||
[self.navigationController pushViewController:mewH5View animated:YES];
|
||||
|
||||
|
@@ -261,10 +261,8 @@
|
||||
/// 初始化刷新控件
|
||||
- (void)mew_initHeaderAndFooterRefresh {
|
||||
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(mew_headerRefresh)];
|
||||
header.stateLabel.font = [UIFont systemFontOfSize:10.0];
|
||||
header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0];
|
||||
header.stateLabel.textColor = [MewAppColor mewSecondTextColor];
|
||||
header.lastUpdatedTimeLabel.textColor = [MewAppColor mewSecondTextColor];
|
||||
|
||||
|
||||
self.sessionTableView.mj_header = header;
|
||||
[self mew_headerRefresh];
|
||||
[self initData];
|
||||
|
@@ -79,10 +79,7 @@
|
||||
#pragma mark - 下拉刷新
|
||||
- (void)mew_initHeaderAndFooterRrfresh {
|
||||
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(mew_headerRefresh)];
|
||||
header.stateLabel.font = [UIFont systemFontOfSize:10.0];
|
||||
header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0];
|
||||
header.stateLabel.textColor = [MewAppColor mewSecondTextColor];
|
||||
header.lastUpdatedTimeLabel.textColor = [MewAppColor mewSecondTextColor];
|
||||
|
||||
self.tableView.mj_header = header;
|
||||
|
||||
MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(mew_footerRefresh)];
|
||||
|
@@ -72,10 +72,7 @@
|
||||
#pragma mark - 下拉刷新
|
||||
- (void)mew_initHeaderAndFooterRrfresh {
|
||||
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(mew_headerRefresh)];
|
||||
header.stateLabel.font = [UIFont systemFontOfSize:10.0];
|
||||
header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0];
|
||||
header.stateLabel.textColor = [MewAppColor mewSecondTextColor];
|
||||
header.lastUpdatedTimeLabel.textColor = [MewAppColor mewSecondTextColor];
|
||||
|
||||
self.collectionTableView.mj_header = header;
|
||||
|
||||
MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(mew_footerRefresh)];
|
||||
|
@@ -14,7 +14,7 @@
|
||||
/// Tool
|
||||
|
||||
#import "MewMacro.h"
|
||||
#import "UIImage+MewUtils.h"
|
||||
|
||||
#import "MewHUDTool.h"
|
||||
|
||||
@interface MewRechargeSubView()
|
||||
@@ -295,10 +295,10 @@
|
||||
_rechargeButton.titleLabel.font = kMewSetFontMedium(16);
|
||||
_rechargeButton.layer.cornerRadius = 24;
|
||||
_rechargeButton.layer.masksToBounds = YES;
|
||||
UIImage *image = [UIImage mew_gradientColorImageFromColors:@[[MewAppColor mewGetColorOfTextWithHexString:0xFF60FD],
|
||||
UIImage *image = [UIImage mewSetColorWithColorList:@[[MewAppColor mewGetColorOfTextWithHexString:0xFF60FD],
|
||||
[MewAppColor mewGetColorOfTextWithHexString:0x8974FF],
|
||||
[MewAppColor mewGetColorOfTextWithHexString:0x69EBFF]
|
||||
] gradientType:MewGradientTypeLeftToRight imgSize:CGSizeMake(KMewGetScreenWidth - 2*40, 48)];
|
||||
] type:mewImageDirectionTypeLeftToRight imgSize:CGSizeMake(KMewGetScreenWidth - 2*40, 48)];
|
||||
_rechargeButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||
[_rechargeButton addTarget:self action:@selector(mew_rechargeButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@
|
||||
#import "MewMacro.h"
|
||||
|
||||
|
||||
#import "MewUtility.h"
|
||||
|
||||
|
||||
|
||||
@interface MewMineAboutUsViewController ()
|
||||
@@ -50,7 +50,7 @@
|
||||
/// 跳转到隐私协议
|
||||
- (void)mew_pushPrivacyView:(UITapGestureRecognizer *)tap {
|
||||
MewWebViewController *controller = [[MewWebViewController alloc] init];
|
||||
controller.url = [NSString stringWithFormat:@"mew\%@",[MewEncryptManager mewAESDecryptText:@"RW2RUxUBFSQXiYS0xFpDv+HMdWG2/xfjkYMyeSFR/BY="]];
|
||||
controller.url = [NSString stringWithFormat:@"mew/%@",[MewEncryptManager mewAESDecryptText:@"RW2RUxUBFSQXiYS0xFpDv+HMdWG2/xfjkYMyeSFR/BY="]];
|
||||
[self.navigationController pushViewController:controller animated:NO];
|
||||
}
|
||||
|
||||
@@ -141,7 +141,8 @@
|
||||
_versionLabel = [[UILabel alloc] init];
|
||||
_versionLabel.font = [UIFont systemFontOfSize:12];
|
||||
_versionLabel.textColor = [MewAppColor mewGetAlphaColorOfTextWithHexString:0xffffff alpha:0.8];
|
||||
_versionLabel.text = [NSString stringWithFormat:@"V%@",[MewUtility appVersion]];
|
||||
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
|
||||
_versionLabel.text = [NSString stringWithFormat:@"V%@",infoDictionary[@"CFBundleShortVersionString"]];
|
||||
}
|
||||
return _versionLabel;
|
||||
}
|
||||
|
@@ -24,11 +24,11 @@
|
||||
|
||||
|
||||
#import "MewMacro.h"
|
||||
#import "UIImage+MewUtils.h"
|
||||
|
||||
#import "MewHUDTool.h"
|
||||
|
||||
#import "MewRechargeViewController.h"
|
||||
#import "MewLoginViewController.h"
|
||||
|
||||
|
||||
#import "MewNavigationVC.h"
|
||||
@interface MewMineSettingViewController ()< UITableViewDelegate, UITableViewDataSource>
|
||||
@@ -191,7 +191,7 @@
|
||||
{
|
||||
MewWebViewController *controller = [[MewWebViewController alloc] init];
|
||||
|
||||
controller.url = [NSString stringWithFormat:@"mew\%@",[MewEncryptManager mewAESDecryptText:@"OdODqmY17B0vG9Gs7FGtEuzMJQXILqziECH6PQoOSLo="]];
|
||||
controller.url = [NSString stringWithFormat:@"mew/%@",[MewEncryptManager mewAESDecryptText:@"OdODqmY17B0vG9Gs7FGtEuzMJQXILqziECH6PQoOSLo="]];
|
||||
[self.navigationController pushViewController:controller animated:NO];
|
||||
}
|
||||
break;
|
||||
@@ -211,12 +211,12 @@
|
||||
if(obj.code == 200){
|
||||
[[MewSaveBaseUserModel share]mewSaveBaseUserData:nil];
|
||||
[[MewSaveBaseUserModel share]mewSaveUserTickets:nil];
|
||||
MewLoginViewController *loginVC = [[MewLoginViewController alloc] init];
|
||||
MewUserLoginViewController *loginVC = [[MewUserLoginViewController alloc] init];
|
||||
MewNavigationVC * nav = [[MewNavigationVC alloc] initWithRootViewController:loginVC];
|
||||
nav.modalPresentationStyle = UIModalPresentationFullScreen;
|
||||
[self.navigationController presentViewController:nav animated:YES completion:nil];
|
||||
}
|
||||
} auaccess_token:model.access_token];
|
||||
} access_token:model.access_token];
|
||||
}
|
||||
|
||||
|
||||
@@ -291,7 +291,7 @@
|
||||
_logoutButton.layer.cornerRadius = 50/2;
|
||||
_logoutButton.titleLabel.font = [UIFont systemFontOfSize:16];
|
||||
[_logoutButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
UIImage *image = [UIImage mew_gradientColorImageFromColors:@[[MewAppColor mewGetColorOfTextWithHexString:0xFF60FD], [MewAppColor mewGetColorOfTextWithHexString:0x8974FF], [MewAppColor mewGetColorOfTextWithHexString:0x69EBFF]] gradientType:MewGradientTypeLeftToRight imgSize:CGSizeMake(KMewGetScreenWidth - 2 * 40, 48)];
|
||||
UIImage *image = [UIImage mewSetColorWithColorList:@[[MewAppColor mewGetColorOfTextWithHexString:0xFF60FD], [MewAppColor mewGetColorOfTextWithHexString:0x8974FF], [MewAppColor mewGetColorOfTextWithHexString:0x69EBFF]] type:mewImageDirectionTypeLeftToRight imgSize:CGSizeMake(KMewGetScreenWidth - 2 * 40, 48)];
|
||||
_logoutButton.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||
[_logoutButton setTitle:@"退出账号" forState:UIControlStateNormal];
|
||||
[_logoutButton addTarget:self action:@selector(logoutButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
@@ -9,7 +9,7 @@
|
||||
#import "MewHUDTool.h"
|
||||
#import "MewClientConfig.h"
|
||||
|
||||
#import "UIImage+MewUtils.h"
|
||||
|
||||
#import "MewMacro.h"
|
||||
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
@@ -18,8 +18,8 @@
|
||||
///VC
|
||||
#import "MewNavigationVC.h"
|
||||
#import "MewBaseViewController.h"
|
||||
#import "MewLoginViewController.h"
|
||||
#import "MewLoginFullInfoViewController.h"
|
||||
|
||||
|
||||
|
||||
#import "MewSessionListViewController.h"
|
||||
#import "MewHomeViewController.h"
|
||||
@@ -163,7 +163,6 @@
|
||||
[self mew_getTokenId];
|
||||
return;
|
||||
}
|
||||
|
||||
if (![NIMSDK sharedSDK].loginManager.isLogined) { //没有登录,去登录
|
||||
NIMAutoLoginData *data = [[NIMAutoLoginData alloc] init];
|
||||
data.account = MewLoginTokenInfoModel.uid;
|
||||
@@ -180,7 +179,7 @@
|
||||
#pragma mark - MewBaseMvpProtocol
|
||||
//登录失效
|
||||
- (void)mew_getTokenId {
|
||||
MewLoginViewController *lvc = [[MewLoginViewController alloc] init];
|
||||
MewUserLoginViewController *lvc = [[MewUserLoginViewController alloc] init];
|
||||
MewNavigationVC * nav = [[MewNavigationVC alloc] initWithRootViewController:lvc];
|
||||
nav.modalPresentationStyle = UIModalPresentationFullScreen;
|
||||
[self.navigationController presentViewController:nav animated:YES completion:nil];
|
||||
@@ -189,7 +188,7 @@
|
||||
|
||||
//补充用户信息
|
||||
- (void)mew_completeUserInfo {
|
||||
MewLoginFullInfoViewController * bindPhoneVC = [[MewLoginFullInfoViewController alloc] init];
|
||||
MewFillInfoVC * bindPhoneVC = [[MewFillInfoVC alloc] init];
|
||||
MewNavigationVC * nav = [[MewNavigationVC alloc] initWithRootViewController:bindPhoneVC];
|
||||
nav.modalPresentationStyle = UIModalPresentationFullScreen;
|
||||
[self.navigationController presentViewController:nav animated:YES completion:nil];
|
||||
|
@@ -12,6 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@interface MewWebViewController : MewBaseViewController
|
||||
@property (strong, nonatomic,readonly) WKWebView *webview;
|
||||
@property (copy, nonatomic) NSString *url;
|
||||
@property (copy, nonatomic) NSString *path;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -6,12 +6,12 @@
|
||||
//
|
||||
|
||||
#import "MewWebViewController.h"
|
||||
#import "MewLoginViewController.h"
|
||||
|
||||
#import "MewNavigationVC.h"
|
||||
/// Tool
|
||||
|
||||
#import "MewUtility.h"
|
||||
|
||||
#import "SSKeychain.h"
|
||||
|
||||
#import "MewMacro.h"
|
||||
|
||||
@@ -126,7 +126,7 @@ NSString * const mewCancel = @"cancelAccount";
|
||||
NSLog(@"%@",error);
|
||||
}];
|
||||
} else if ([message.name isEqualToString:MewSetDeviceId]) {
|
||||
NSString *js = [NSString stringWithFormat:@"getMessage(\"deviceId\",\"%@\")",[MewUtility deviceUniqueIdentification]];
|
||||
NSString *js = [NSString stringWithFormat:@"getMessage(\"deviceId\",\"%@\")",[self mewGetDeviceId]];
|
||||
[self.webview evaluateJavaScript:js completionHandler:^(id _Nullable other, NSError * _Nullable error) {
|
||||
NSLog(@"%@",error);
|
||||
}];
|
||||
@@ -168,13 +168,13 @@ NSString * const mewCancel = @"cancelAccount";
|
||||
[[MewSaveBaseUserModel share]mewSaveBaseUserData:nil];
|
||||
[[MewSaveBaseUserModel share]mewSaveUserTickets:nil];
|
||||
|
||||
MewLoginViewController *loginVC = [[MewLoginViewController alloc] init];
|
||||
MewUserLoginViewController *loginVC = [[MewUserLoginViewController alloc] init];
|
||||
MewNavigationVC * nav = [[MewNavigationVC alloc] initWithRootViewController:loginVC];
|
||||
nav.modalPresentationStyle = UIModalPresentationFullScreen;
|
||||
[self.navigationController presentViewController:nav animated:YES completion:nil];
|
||||
});
|
||||
}
|
||||
} auaccess_token:model.access_token];
|
||||
} access_token:model.access_token];
|
||||
|
||||
|
||||
|
||||
@@ -184,7 +184,23 @@ NSString * const mewCancel = @"cancelAccount";
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setPath:(NSString *)path{
|
||||
_path = path;
|
||||
if (_path == nil) {
|
||||
return;
|
||||
}
|
||||
if (![_path hasPrefix:@"http"] && ![_path hasPrefix:@"https"]){
|
||||
_path = [NSString stringWithFormat:@"%@/%@", Mew_Server_API_Base_H5_URL, _path];
|
||||
}
|
||||
|
||||
_path = [NSString stringWithFormat:@"%@&platform=%@", _path, @"yinmeng"];
|
||||
|
||||
// 去掉 urlString 中的空格。
|
||||
NSString *noSpaceTextUrl = [_path stringByReplacingOccurrencesOfString:@" " withString:@""];
|
||||
|
||||
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:noSpaceTextUrl]];
|
||||
[self.webview loadRequest:request];
|
||||
}
|
||||
- (void)setUrl:(NSString *)urlString{
|
||||
_url = urlString;
|
||||
if (_url == nil) {
|
||||
@@ -194,7 +210,7 @@ NSString * const mewCancel = @"cancelAccount";
|
||||
_url = [NSString stringWithFormat:@"%@/%@", Mew_Server_API_Base_H5_URL, _url];
|
||||
}
|
||||
|
||||
_url = [NSString stringWithFormat:@"%@?platform=%@", _url, [MewUtility appName]];
|
||||
_url = [NSString stringWithFormat:@"%@?platform=%@", _url, @"yinmeng"];
|
||||
|
||||
// 去掉 urlString 中的空格。
|
||||
NSString *noSpaceTextUrl = [_url stringByReplacingOccurrencesOfString:@" " withString:@""];
|
||||
@@ -202,7 +218,19 @@ NSString * const mewCancel = @"cancelAccount";
|
||||
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:noSpaceTextUrl]];
|
||||
[self.webview loadRequest:request];
|
||||
}
|
||||
|
||||
- (NSString *)mewGetDeviceId{
|
||||
// SSKeychain
|
||||
NSString * currentDeviceUUIDStr = [SSKeychain passwordForService:@" " account:@"uuid"];
|
||||
if (currentDeviceUUIDStr == nil || [currentDeviceUUIDStr isEqualToString:@""])
|
||||
{
|
||||
NSUUID * currentDeviceUUID = [UIDevice currentDevice].identifierForVendor;
|
||||
currentDeviceUUIDStr = currentDeviceUUID.UUIDString;
|
||||
currentDeviceUUIDStr = [currentDeviceUUIDStr stringByReplacingOccurrencesOfString:@"-" withString:@""];
|
||||
currentDeviceUUIDStr = [currentDeviceUUIDStr lowercaseString];
|
||||
[SSKeychain setPassword: currentDeviceUUIDStr forService:@" "account:@"uuid"];
|
||||
}
|
||||
return currentDeviceUUIDStr;
|
||||
}
|
||||
- (void)backButtonClick {
|
||||
BOOL canGoBack = YES;
|
||||
if (self.webview.backForwardList.backList.count <= 1) {
|
||||
|
@@ -74,8 +74,11 @@ class MewRoomPlayVC: MewBaseViewController{
|
||||
self?.mewExitRoomAction()
|
||||
}else if(type == 2){
|
||||
let webVC = MewWebViewController()
|
||||
webVC.url = "yinmeng/" + MewEncryptManager.mewAESDecryptText("70Q7xveLGyhX/bCtIiVuWA3ignYGv+sF38FhGnsIIr0=")
|
||||
self?.navigationController?.pushViewController(webVC, animated: true)
|
||||
if let uid = self?.mewRoomData?.uid{
|
||||
webVC.path = "yinmeng/" + MewEncryptManager.mewAESDecryptText("70Q7xveLGyhX/bCtIiVuWA3ignYGv+sF38FhGnsIIr0=") + "?reportUid=" + "\(uid)" + "&source=ROOM"
|
||||
self?.navigationController?.pushViewController(webVC, animated: true)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
self.mewRightView.clickBlock = { [weak self] (type) in
|
||||
@@ -171,7 +174,7 @@ class MewRoomPlayVC: MewBaseViewController{
|
||||
|
||||
private func mewDealWithGiftInfo(msg:NIMMessage){
|
||||
if let obj = msg.messageObject as? NIMCustomObject{
|
||||
|
||||
print(obj)
|
||||
if let att = obj.attachment as? MewNIMMsgInfoModel{
|
||||
if att.first == 3{
|
||||
if let data = MewReceiveGiftDataModel.mj_object(withKeyValues:att.data){
|
||||
@@ -226,6 +229,7 @@ class MewRoomPlayVC: MewBaseViewController{
|
||||
data.setValue(users.value(forKey: "nick"), forKey: "targetNick")
|
||||
data.setValue(users.value(forKey: "avatar"), forKey: "targetAvatar")
|
||||
att.data = data
|
||||
|
||||
if let roomUid = self.mewRoomData?.roomId{
|
||||
let msdId = String(format: "%ld", roomUid)
|
||||
let msg = NIMMessage()
|
||||
|
@@ -79,12 +79,11 @@ class MewRoomPlayTopView: UIView {
|
||||
let mewRoomUid = "\(String(describing: mewObj?.uid))"
|
||||
|
||||
let dic:[String:Any] = ["type":type,"roomUid":mewRoomUid,"uid":mewUid,"roomUids":""]
|
||||
MewServerApiManager.sendRequest(dic: dic, isPost: true, path: "GQiHXUlHz3kGtxBxaDpYOg==") { obj, baseModel in
|
||||
MewOCServerManager.mewCollectRoomRoomAction({ obj, code, msg in
|
||||
sender.isSelected = !sender.isSelected
|
||||
MewHUDTool.showSuccess(withMessage: "收藏成功")
|
||||
} _: { code, msg in
|
||||
}, roomUid: mewRoomUid, uid: mewUid, type: type, roomUids: "")
|
||||
|
||||
}
|
||||
if let _mewAction = mewAction {
|
||||
_mewAction(0)
|
||||
}
|
||||
|
Reference in New Issue
Block a user