From 6007611a3b8976490674a477ae73e9e3edcadb20 Mon Sep 17 00:00:00 2001 From: liyuhua <15626451870@163.com> Date: Fri, 29 Dec 2023 16:43:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dline=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Podfile | 5 +- YuMi.xcodeproj/project.pbxproj | 14 ++++ YuMi/Appdelegate/AppDelegate+ThirdConfig.m | 10 ++- YuMi/Appdelegate/AppDelegate.m | 7 +- .../InputView/InputView/QInputPhototCell.m | 4 +- YuMi/CustomUI/ShareView/XPShareView.m | 14 +++- .../YMLogin/Presenter/LoginPresenter.h | 2 + .../YMLogin/Presenter/LoginPresenter.m | 26 +++++++- .../View/NewLogin/XPLoginViewController.m | 3 + .../View/XPMonentsPublishViewController.m | 8 ++- .../View/AnimationView/XPRoomAnimationView.m | 6 +- .../XPRoomFunctionContainerView.m | 66 ++++++------------- .../Tool/XPRoomMessageParser.m | 2 +- .../MicroView/Dating/DatingMicroView.m | 7 +- .../Modules/YMRoom/View/StageView/StageView.m | 10 ++- YuMi/Structure/PrefixHeader.pch | 2 + YuMi/Tools/PIIAPTool/PIIAPRegulate.swift | 2 + YuMi/Tools/YMLine/PILineManager.swift | 65 ++++++++++++++++++ 18 files changed, 186 insertions(+), 67 deletions(-) create mode 100644 YuMi/Tools/YMLine/PILineManager.swift diff --git a/Podfile b/Podfile index 204eea6c..62454bb2 100644 --- a/Podfile +++ b/Podfile @@ -11,6 +11,7 @@ target 'YuMi' do pod 'FBSDKLoginKit' pod 'FBSDKCoreKit' pod 'FBSDKShareKit' + pod 'LineSDKSwift' # 滑动标签栏 pod 'JXCategoryView' pod 'JXPagingView/Pager' @@ -61,10 +62,10 @@ target 'YuMi' do pod 'SVGAPlayer' pod 'GoogleSignIn' - pod 'mob_linksdk_pro' + #pod 'mob_linksdk_pro' pod 'mob_sharesdk' pod 'mob_sharesdk/ShareSDKPlatforms/Apple' - pod 'mob_sharesdk/ShareSDKPlatforms/Line' + #pod 'mob_sharesdk/ShareSDKPlatforms/Line' pod 'mob_sharesdk/ShareSDKExtension' pod 'UMCommon' diff --git a/YuMi.xcodeproj/project.pbxproj b/YuMi.xcodeproj/project.pbxproj index 3cdbc670..f626cecf 100644 --- a/YuMi.xcodeproj/project.pbxproj +++ b/YuMi.xcodeproj/project.pbxproj @@ -206,6 +206,7 @@ 234489082AC3C5DA0070E5D5 /* SudMGP.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 234489072AC3C5DA0070E5D5 /* SudMGP.framework */; }; 234489092AC3C5FF0070E5D5 /* SudMGP.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 234489072AC3C5DA0070E5D5 /* SudMGP.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 234D821E2AEC57CF0022EFEB /* YYTextAsyncLayer+PITextAsyncLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 234D821D2AEC57CF0022EFEB /* YYTextAsyncLayer+PITextAsyncLayer.m */; }; + 234F44E32B3EA4F900E2B532 /* PILineManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 234F44E22B3EA4F900E2B532 /* PILineManager.swift */; }; 235A451A2B04A352009753F5 /* PIRoomActivityWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = 235A45192B04A352009753F5 /* PIRoomActivityWebView.m */; }; 235A451D2B04A452009753F5 /* PIRoomActivityWebCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 235A451C2B04A452009753F5 /* PIRoomActivityWebCell.m */; }; 235A45232B04BEB6009753F5 /* PIBaseModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 235A45222B04BEB6009753F5 /* PIBaseModel.m */; }; @@ -1874,6 +1875,7 @@ 234489072AC3C5DA0070E5D5 /* SudMGP.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = SudMGP.framework; sourceTree = ""; }; 234D821C2AEC57CF0022EFEB /* YYTextAsyncLayer+PITextAsyncLayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "YYTextAsyncLayer+PITextAsyncLayer.h"; path = "YuMi/Appdelegate/YYTextAsyncLayer+PITextAsyncLayer.h"; sourceTree = SOURCE_ROOT; }; 234D821D2AEC57CF0022EFEB /* YYTextAsyncLayer+PITextAsyncLayer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "YYTextAsyncLayer+PITextAsyncLayer.m"; path = "YuMi/Appdelegate/YYTextAsyncLayer+PITextAsyncLayer.m"; sourceTree = SOURCE_ROOT; }; + 234F44E22B3EA4F900E2B532 /* PILineManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PILineManager.swift; sourceTree = ""; }; 235A45182B04A352009753F5 /* PIRoomActivityWebView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIRoomActivityWebView.h; sourceTree = ""; }; 235A45192B04A352009753F5 /* PIRoomActivityWebView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIRoomActivityWebView.m; sourceTree = ""; }; 235A451B2B04A452009753F5 /* PIRoomActivityWebCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIRoomActivityWebCell.h; sourceTree = ""; }; @@ -4790,6 +4792,7 @@ 189DD5A726DFA09700AB55B1 /* Tools */ = { isa = PBXGroup; children = ( + 234F44E12B3EA4DC00E2B532 /* YMLine */, 23CEFC082AFB8FC100576D89 /* sdkContent */, 23FF255C2ABA8EEE0064E904 /* PIIAPTool */, 23E9EA9B2A84C42B00B792F2 /* SGYProgressView */, @@ -5367,6 +5370,14 @@ path = UILabel; sourceTree = ""; }; + 234F44E12B3EA4DC00E2B532 /* YMLine */ = { + isa = PBXGroup; + children = ( + 234F44E22B3EA4F900E2B532 /* PILineManager.swift */, + ); + path = YMLine; + sourceTree = ""; + }; 236B2E1B2AA0786E003967A8 /* Library */ = { isa = PBXGroup; children = ( @@ -11861,6 +11872,7 @@ 238B37D62AC55A2C00BFC9D5 /* XPTreasureFairyTrialsView.m in Sources */, E82109AD26F1C8A000FC3319 /* CountDownHelper.m in Sources */, E878B8582835F0D300E22DCF /* MonentsInteractiveModel.m in Sources */, + 234F44E32B3EA4F900E2B532 /* PILineManager.swift in Sources */, E87DF4E42A42CAD2009C1185 /* XPHomeSearchNavView.m in Sources */, 9BD2ECCE288F829600F5CD9A /* XPMineFootPrintViewController.m in Sources */, 9B4E920028E57A620033419E /* XPGiftHeadTypeView.m in Sources */, @@ -12205,6 +12217,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OBJC_BRIDGING_HEADER = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; }; @@ -12240,6 +12253,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OBJC_BRIDGING_HEADER = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; }; diff --git a/YuMi/Appdelegate/AppDelegate+ThirdConfig.m b/YuMi/Appdelegate/AppDelegate+ThirdConfig.m index 697e0e5f..2c24c559 100644 --- a/YuMi/Appdelegate/AppDelegate+ThirdConfig.m +++ b/YuMi/Appdelegate/AppDelegate+ThirdConfig.m @@ -26,10 +26,14 @@ #import +#import "YuMi-swift.h" + UIKIT_EXTERN NSString * kYouMiNumberCountKey; UIKIT_EXTERN NSString * adImageName; + + @implementation AppDelegate (ThirdConfig) @@ -103,9 +107,9 @@ UIKIT_EXTERN NSString * adImageName; [Adjust appDidLaunch:adjustConfig]; } - (void)configShareSDK { - - - + + [PILineLoginManager registerLine]; + [ShareSDK registPlatforms:^(SSDKRegister *platformsRegister) { ///faceBook // [platformsRegister setupFacebookWithAppkey:@"1266232494209868" appSecret:@"c9b170b383f8be9cdf118823b8632821" displayName:YMLocalizedString(@"AppDelegate_ThirdConfig0")]; diff --git a/YuMi/Appdelegate/AppDelegate.m b/YuMi/Appdelegate/AppDelegate.m index a0108558..ca6fd34f 100644 --- a/YuMi/Appdelegate/AppDelegate.m +++ b/YuMi/Appdelegate/AppDelegate.m @@ -19,6 +19,7 @@ #import #import "XPLoginViewController.h" #import "AccountModel.h" +#import "YuMi-swift.h" @import Firebase; UIKIT_EXTERN NSString * const kOpenRoomNotification; @@ -106,8 +107,10 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification; ///URL Scheme跳转 -(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options{ - - + NSString *bundleID = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"]; + if ([url.scheme isEqualToString:[NSString stringWithFormat:@"line3rdp.%@",bundleID]]) { + return [PILineLoginManager applicationOpenurl:app open:url]; + } NSString *text = [url query]; if(text.length){ diff --git a/YuMi/CustomUI/InputView/InputView/QInputPhototCell.m b/YuMi/CustomUI/InputView/InputView/QInputPhototCell.m index 44047460..e1d419b4 100644 --- a/YuMi/CustomUI/InputView/InputView/QInputPhototCell.m +++ b/YuMi/CustomUI/InputView/InputView/QInputPhototCell.m @@ -76,10 +76,10 @@ self.numberLabel.hidden = !imageInfo.isSelect; self.chooseButton.selected = imageInfo.isSelect; if (!imageInfo.originImage) { - [[TZImageManager manager] getPhotoWithAsset:imageInfo.assetInfo.asset photoWidth:200 completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) { + [[TZImageManager manager] getPhotoWithAsset:imageInfo.assetInfo.asset completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) { self.logoImageView.image = photo; self.imageInfo.originImage = photo; - UIImage * image = [photo compressWithMaxLength:1024 * 10]; + UIImage * image = [photo compressWithMaxLength:1024 * 30]; self.imageInfo.compressImage = image; } progressHandler:nil networkAccessAllowed:NO]; } else { diff --git a/YuMi/CustomUI/ShareView/XPShareView.m b/YuMi/CustomUI/ShareView/XPShareView.m index 8e35ca1b..a8514baa 100644 --- a/YuMi/CustomUI/ShareView/XPShareView.m +++ b/YuMi/CustomUI/ShareView/XPShareView.m @@ -177,8 +177,18 @@ [XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPShareView2")]; return; } - FBtype = PlatformOfLine; - [shareParams SSDKSetupLineParamsByText:encodedUrl image:nil type:SSDKContentTypeAuto]; + NSString*contentKey= [encodedUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet]; + NSString*contentType =@"text"; + NSString*urlString = [NSString stringWithFormat:@"line://msg/%@/%@",contentType, contentKey]; + + [[UIApplication sharedApplication]openURL:[NSURL URLWithString:urlString] options:@{} completionHandler:^(BOOL success) { + + }]; + + + +// FBtype = PlatformOfLine; +// [shareParams SSDKSetupLineParamsByText:encodedUrl image:nil type:SSDKContentTypeAuto]; } else { title = YMLocalizedString(@"XPShareView3"); platformType = SSDKPlatformTypeFacebook; diff --git a/YuMi/Modules/YMLogin/Presenter/LoginPresenter.h b/YuMi/Modules/YMLogin/Presenter/LoginPresenter.h index fcf691a0..dc5c543d 100644 --- a/YuMi/Modules/YMLogin/Presenter/LoginPresenter.h +++ b/YuMi/Modules/YMLogin/Presenter/LoginPresenter.h @@ -25,6 +25,8 @@ NS_ASSUME_NONNULL_BEGIN -(void)thirdLoginByGoogleWithPresentingViewController:(UIViewController *)presentingViewController configuration:(GIDConfiguration *)configuration; ///第三方登录,fb登录 -(void)thirdLoginByFBWithPresentingViewController:(UIViewController *)presentingViewController; +///第三方登录,line登录 +-(void)thirdLoginByLine:(UIViewController *)presentingViewController; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMLogin/Presenter/LoginPresenter.m b/YuMi/Modules/YMLogin/Presenter/LoginPresenter.m index 6b43ba99..e241ce73 100644 --- a/YuMi/Modules/YMLogin/Presenter/LoginPresenter.m +++ b/YuMi/Modules/YMLogin/Presenter/LoginPresenter.m @@ -23,7 +23,7 @@ #import #import - +#import "YuMi-swift.h" @implementation LoginPresenter - (void)dealloc{ @@ -159,6 +159,30 @@ } showLoading:YES] openid:openid unionid:unionid access_token:access_token type:[NSString stringWithFormat:@"%lu", (unsigned long)type]]; +} +-(void)thirdLoginByLine:(UIViewController *)presentingViewController { + PILineLoginManager *line = [PILineLoginManager getSharedInstance]; + [XNDJTDDLoadingTool showOnlyView:kWindow]; + [line loginLineFromController:presentingViewController completeWithError:^(LineLoginResultStatus loginStatus, NSString * _Nullable token, NSString * _Nullable userId, NSString * _Nullable emali, NSError * _Nullable error) { + + if (loginStatus == LineLoginResultStatusSuccess) { + ThirdUserInfo * userInfo = [[ThirdUserInfo alloc] init]; + NSString * openid = userId.length > 0 ? userId : @""; + NSString * access_token = token.length > 0 ? token : @""; + NSString * unionid = userId.length > 0 ? userId : @""; + userInfo.openid = openid; + userInfo.access_token = access_token; + userInfo.unionid = unionid; + [AccountInfoStorage instance].thirdUserInfo = userInfo; + [self loginWithThirdPartWithType:ThirdLoginType_Line]; + } else if (loginStatus == LineLoginResultStatusCancelled) { + [XNDJTDDLoadingTool hideOnlyView:kWindow]; + [[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter0")]; + } else if (loginStatus == LineLoginResultStatusError) { + [XNDJTDDLoadingTool hideOnlyView:kWindow]; + [[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter1")]; + } + }]; } -(void)thirdLoginByFBWithPresentingViewController:(UIViewController *)presentingViewController { [FBSDKProfile enableUpdatesOnAccessTokenChange:YES]; diff --git a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.m b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.m index 1cd15b3d..c215704d 100644 --- a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.m +++ b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.m @@ -260,6 +260,9 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; }else if(type == ThirdLoginType_FB){ [self.presenter thirdLoginByFBWithPresentingViewController:self]; return; + }else if(type == ThirdLoginType_Line){ + [self.presenter thirdLoginByLine:self]; + return; } [self.presenter thirdLoginWithType:type]; diff --git a/YuMi/Modules/YMMonents/View/XPMonentsPublishViewController.m b/YuMi/Modules/YMMonents/View/XPMonentsPublishViewController.m index ce55d17b..042a80c0 100644 --- a/YuMi/Modules/YMMonents/View/XPMonentsPublishViewController.m +++ b/YuMi/Modules/YMMonents/View/XPMonentsPublishViewController.m @@ -324,9 +324,11 @@ self.isEdited = NO; } NSArray * array; - if (self.datasource.count < 9 && self.datasource.count > 1) { - array = [self.datasource subarrayWithRange:NSMakeRange(0, self.datasource.count - 1)]; - } + if([self.datasource containsObject:self.addPicImage] && self.datasource.count > 1){ + array = [self.datasource subarrayWithRange:NSMakeRange(0, self.datasource.count - 1)]; + }else if(![self.datasource containsObject:self.addPicImage] && self.datasource.count == 9){ + array = self.datasource; + } self.uploadImageList = array; } diff --git a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m index 8596dda0..59f1fe21 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m @@ -183,9 +183,6 @@ self.delegate = delegate; [self initSubViews]; [self initSubViewConstraints]; - - - } return self; } @@ -1188,6 +1185,9 @@ } - (void)createGiftCompoundBannerAnimation:(AttachmentModel *)attachment { + + + XPRoomGiftCompoundView *compoundGiftView = [[XPRoomGiftCompoundView alloc] initWithFrame:CGRectMake(KScreenWidth, kNavigationHeight + 15, KScreenWidth, 45)]; compoundGiftView.compoundGiftInfo = attachment.data; [self.middleLevelView addSubview:compoundGiftView]; diff --git a/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.m b/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.m index 238311d8..0d27cc30 100644 --- a/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.m +++ b/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.m @@ -997,30 +997,10 @@ if (currentUserModel) { if (!self.musicEnterButton.superview) { [self addSubview:self.musicEnterButton]; - CGFloat topOffY = self.delegate.getRoomInfo.type == RoomType_Anchor || self.delegate.getRoomInfo.isPermitRoom == PermitRoomType_Licnese ? (kNavigationHeight+ 4 + 22 + 18) : (kNavigationHeight+ 4); if (self.delegate.getRoomInfo.roomModeType == RoomModeType_Open_Blind) {//相亲厅播放音乐 - [self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.mas_equalTo(16); - make.centerY.mas_equalTo(self.contributeEnterView); - make.width.mas_equalTo(22); - make.height.mas_equalTo(22); - }]; + [self setViewConstraints]; } else { - if (self.hourRankEntranceView.superview) { - [self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.mas_equalTo(self.hourRankEntranceView.mas_right).mas_offset(4); - make.centerY.mas_equalTo(self.contributeEnterView); - make.width.mas_equalTo(22); - make.height.mas_equalTo(22); - }]; - } else { - [self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.mas_equalTo(16); - make.centerY.mas_equalTo(self.contributeEnterView); - make.width.mas_equalTo(22); - make.height.mas_equalTo(22); - }]; - } + [self setViewConstraints]; } } } else { @@ -1689,36 +1669,32 @@ if (currentUserModel) { if (!self.musicEnterButton.superview) { [self addSubview:self.musicEnterButton]; - CGFloat topOffY = (self.delegate.getRoomInfo.type == RoomType_Anchor || self.delegate.getRoomInfo.isPermitRoom == PermitRoomType_Licnese) ? (kNavigationHeight+ 4 + 22 + 18) : (kNavigationHeight+ 4); if (self.delegate.getRoomInfo.roomModeType == RoomModeType_Open_Blind) {//相亲厅播放音乐 - [self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.mas_equalTo(16); - make.centerY.mas_equalTo(self.contributeEnterView); - make.width.mas_equalTo(22); - make.height.mas_equalTo(22); - }]; + [self setViewConstraints]; } else { - if (self.hourRankEntranceView.superview) { - [self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.mas_equalTo(self.hourRankEntranceView.mas_right).mas_offset(4); - make.centerY.mas_equalTo(self.contributeEnterView); - make.width.mas_equalTo(22); - make.height.mas_equalTo(22); - }]; - } else { - [self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.mas_equalTo(16); - make.centerY.mas_equalTo(self.contributeEnterView); - make.width.mas_equalTo(22); - make.height.mas_equalTo(22); - }]; - } + [self setViewConstraints]; } } } } } - +-(void)setViewConstraints{ + if (self.hourRankEntranceView.superview) { + [self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.hourRankEntranceView.mas_right).mas_offset(4); + make.centerY.mas_equalTo(self.contributeEnterView); + make.width.mas_equalTo(22); + make.height.mas_equalTo(22); + }]; + } else { + [self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(16); + make.centerY.mas_equalTo(self.contributeEnterView); + make.width.mas_equalTo(22); + make.height.mas_equalTo(22); + }]; + } +} ///跨房PK预约倒计时 - (void)showAcrossPkCountDownViewWithTime:(long long)time { if (self.acrossPKCountView.superview) { diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m index fa87a077..c4c0f0a9 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m @@ -780,7 +780,7 @@ [attribute appendAttributedString:[self createTextAttribute:YMLocalizedString(@"XPRoomMessageParser62") color:[DJDKMIMOMColor messageTextColor] font:kRoomMessageDefalutFont]]; NSString * targetNick = datingModel.targetNickname ? datingModel.targetNickname : @""; [attribute appendAttributedString:[self createNickAtrribute:targetNick uid:datingModel.targetUid]]; - [attribute appendAttributedString:[self createTextAttribute:YMLocalizedString(@"XPRoomMessageParser63") color:UIColorFromRGB(0xF84C95) font:kRoomMessageDefalutFont]]; + [attribute appendAttributedString:[self createTextAttribute:YMLocalizedString(@"XPRoomMessageParser63") color:[UIColor whiteColor] font:kRoomMessageDefalutFont]]; } else if (attachment.second == Custom_Message_Sub_Room_Play_Dating_Result_Not_Mutual) {///不是互选 DatingInfoModel * datingModel = [DatingInfoModel modelWithDictionary:attachment.data]; NSString * nick = datingModel.nickname ? datingModel.nickname : @""; diff --git a/YuMi/Modules/YMRoom/View/StageView/MicroView/Dating/DatingMicroView.m b/YuMi/Modules/YMRoom/View/StageView/MicroView/Dating/DatingMicroView.m index 32e0d3ea..d0e9d6b1 100644 --- a/YuMi/Modules/YMRoom/View/StageView/MicroView/Dating/DatingMicroView.m +++ b/YuMi/Modules/YMRoom/View/StageView/MicroView/Dating/DatingMicroView.m @@ -83,7 +83,7 @@ } else { if (position == -1) { self.postionLabel.hidden = YES; - self.sexImageView.hidden = NO; + self.sexImageView.hidden = YES; } else { self.postionLabel.hidden = NO; self.sexImageView.hidden = YES; @@ -146,8 +146,13 @@ self.pickButton.hidden = YES; if (position == -1) {return;} + ///相亲进行的阶段 if (roomInfo.blindDateState == RoomPlayDateingType_Pick) { + if (userInfo) { + self.pickButton.hidden = NO; + [self configPickTitle:@"未选择" backmImageName:@"room_mode_dating_not_select"]; + } ///如果我是主持的话 主持人视角 可以看到麦上用户的选择情况,精准到选择对象 MicroQueueModel * presideModel = [self.getMicroQueue objectForKey:@"-1"]; if (presideModel.userInfo && presideModel.userInfo.uid == [AccountInfoStorage instance].getUid.integerValue) { diff --git a/YuMi/Modules/YMRoom/View/StageView/StageView.m b/YuMi/Modules/YMRoom/View/StageView/StageView.m index 19c0d7e3..5f765cc9 100644 --- a/YuMi/Modules/YMRoom/View/StageView/StageView.m +++ b/YuMi/Modules/YMRoom/View/StageView/StageView.m @@ -439,8 +439,14 @@ [view resetGiftValue]; } } - -// [self microQueueUpdated]; + if (self.hostDelegate.getRoomInfo.roomModeType == RoomModeType_Open_Blind && self.hostDelegate.getRoomInfo.blindDateState == RoomPlayDateingType_Pick) { + for (int i = 0; i < self.countOfMircoView; i++) { + MicroQueueModel * model = [self.micQueue objectForKey:[self indexToPosition:i]]; + UIView * view = [self findMicroViewByIndex:i]; + [view configRoomInfo:roomInfo]; + [view configMicroView:model]; + } + } } - (void)handleNIMNotificationMessage:(NIMMessage *)message { diff --git a/YuMi/Structure/PrefixHeader.pch b/YuMi/Structure/PrefixHeader.pch index 1bf1cbcb..4dcbef77 100644 --- a/YuMi/Structure/PrefixHeader.pch +++ b/YuMi/Structure/PrefixHeader.pch @@ -56,4 +56,6 @@ isEnterprise = [bundleID isEqualToString:@"com.hflighting.yumi"];\ #import "HttpRequestHelper.h" #import "BSNetListenModel.h" #import "PIBaseModel.h" +#import + #endif /* PrefixHeader_pch */ diff --git a/YuMi/Tools/PIIAPTool/PIIAPRegulate.swift b/YuMi/Tools/PIIAPTool/PIIAPRegulate.swift index fa1550fc..0b9fbc04 100644 --- a/YuMi/Tools/PIIAPTool/PIIAPRegulate.swift +++ b/YuMi/Tools/PIIAPTool/PIIAPRegulate.swift @@ -3,6 +3,8 @@ import UIKit import StoreKit + + @available(iOS 15.0, *) typealias Transaction = StoreKit.Transaction @available(iOS 15.0, *) diff --git a/YuMi/Tools/YMLine/PILineManager.swift b/YuMi/Tools/YMLine/PILineManager.swift new file mode 100644 index 00000000..2ab1b790 --- /dev/null +++ b/YuMi/Tools/YMLine/PILineManager.swift @@ -0,0 +1,65 @@ +// +// YMLineManager.swift +// YuMi +// +// Created by duoban on 2023/12/29. +// + +import Foundation +import LineSDK + +@objc public enum LineLoginResultStatus: NSInteger { + case error + case cancelled + case success +} + +public class PILineLoginManager: NSObject { + private static var manager: PILineLoginManager? + @objc public class func getSharedInstance() -> PILineLoginManager { + guard let instance = manager else { + manager = PILineLoginManager() + return manager! + } + return instance + } + + @objc public class func registerLine() { + LoginManager.shared.setup(channelID: "1657475529", universalLinkURL: nil) + } + + @objc public class func applicationOpenurl(_ app: UIApplication, + open url: URL?) -> Bool { + return LoginManager.shared.application(app, open: url) + } + + @objc public class func application( + _ application: UIApplication, + continueWithUserActivity: NSUserActivity, + restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { + return LoginManager.shared.application(application, open: continueWithUserActivity.webpageURL) + } + + @objc public func loginLine(fromController: UIViewController, completeWithError: @escaping (_ loginStatus: LineLoginResultStatus, _ token: String?, _ userId:String?, _ email: String? , _ error: Error?) -> Void) { + var param = LoginManager.Parameters.init() + param.allowRecreatingLoginProcess = true + LoginManager.shared.login(permissions: [.openID, .profile], in: fromController, parameters: param) { (result) in + switch result { + case .success(let loginResult): + if let _ = loginResult.accessToken.IDTokenRaw { + completeWithError(.success, loginResult.accessToken.value, loginResult.userProfile?.userID ?? "", nil, nil) + } else { + completeWithError(.success, "","", nil, nil) + } + case .failure(let error): + print(error) + completeWithError(.cancelled, "","", nil, nil) + } + } + + } + + @objc public class func destroyLine() { + PILineLoginManager.manager = nil + } +}