From 68971411e9f5a44aa8ebd558e8ce1a7b2a23eb62 Mon Sep 17 00:00:00 2001 From: fengshuo <963787902@qq.com> Date: Fri, 14 Jan 2022 11:38:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=BF=E9=97=B4=E6=A6=9C=E6=8D=A2=E6=88=90h5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xplan-ios/Global/XPHtmlUrl.h | 4 +++- xplan-ios/Global/XPHtmlUrl.m | 3 ++- .../XPRoomFunctionContainerView.m | 9 ++++++--- .../Room/View/CandyTree/View/XPRoomHalfWebView.m | 2 ++ .../View/StageView/MicroView/MicroGiftValueView.m | 1 + .../Room/View/StageView/MicroView/MicroView.m | 2 +- xplan-ios/Main/XPWebViewController.m | 15 ++++++++++++++- 7 files changed, 29 insertions(+), 7 deletions(-) diff --git a/xplan-ios/Global/XPHtmlUrl.h b/xplan-ios/Global/XPHtmlUrl.h index b606cbe1..64bf5192 100644 --- a/xplan-ios/Global/XPHtmlUrl.h +++ b/xplan-ios/Global/XPHtmlUrl.h @@ -30,7 +30,9 @@ typedef NS_ENUM(NSUInteger, URLType) { /// 糖果树玩法规则 kCandyTreeRuleURL, ///房间魅力榜 - kRoomCharmRankUrl, + kRoomCharmRankURL, + ///房间榜 + kRoomRankURL, }; NSString * const URLWithType(URLType type); diff --git a/xplan-ios/Global/XPHtmlUrl.m b/xplan-ios/Global/XPHtmlUrl.m index 5a5e633f..35dfcfd7 100644 --- a/xplan-ios/Global/XPHtmlUrl.m +++ b/xplan-ios/Global/XPHtmlUrl.m @@ -25,7 +25,8 @@ NSString * const URLWithType(URLType type) { @(kCandyTreeURL) : @"activity/explore/index.html",///参加糖果树 @(kCandyTreeRuleURL) : @"modules/rank/index.html#/wishingWellRule",///糖果树规则 @(kCandyTreeRecordURL) : @"modules/rank/index.html#/wishingWellRecord",///糖果树记录 - @(kRoomCharmRankUrl) : @"modules/charm/index.html",//房间魅力榜 + @(kRoomCharmRankURL) : @"modules/charm/index.html",//房间魅力榜 + @(kRoomRankURL) : @"modules/room_rank/index.html", //房间榜 }; NSString * url = [dic objectForKey:@(type)]; diff --git a/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomFunctionContainerView.m b/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomFunctionContainerView.m index d9fdef89..7d4cbc2e 100644 --- a/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomFunctionContainerView.m +++ b/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomFunctionContainerView.m @@ -8,12 +8,14 @@ #import "XPRoomFunctionContainerView.h" ///Tool #import "XPMacro.h" +#import "XPHtmlUrl.h" +#import "TTPopup.h" ///Third #import ///Model #import "RoomInfoModel.h" ///View -#import "XPRoomRankViewController.h" +#import "XPRoomHalfWebView.h" @interface XPRoomFunctionContainerView () ///host 代理 @property (nonatomic,weak) iddelegate; @@ -50,8 +52,9 @@ #pragma mark - Event Response - (void)contributionButtonAction:(UIButton *)sender { NSString * roomUid = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.uid]; - XPRoomRankViewController * rankVC = [[XPRoomRankViewController alloc] initWithRoomUid:roomUid delegate:self.delegate]; - [self.delegate.getCurrentNav presentViewController:rankVC animated:YES completion:nil]; + XPRoomHalfWebView * webView = [[XPRoomHalfWebView alloc] init]; + webView.url = [NSString stringWithFormat:@"%@?roomUid=%@", URLWithType(kRoomRankURL), roomUid]; + [TTPopup popupView:webView style:TTPopupStyleActionSheet]; } #pragma mark - Getters And Setters diff --git a/xplan-ios/Main/Room/View/CandyTree/View/XPRoomHalfWebView.m b/xplan-ios/Main/Room/View/CandyTree/View/XPRoomHalfWebView.m index e502f716..8e88bee9 100644 --- a/xplan-ios/Main/Room/View/CandyTree/View/XPRoomHalfWebView.m +++ b/xplan-ios/Main/Room/View/CandyTree/View/XPRoomHalfWebView.m @@ -41,6 +41,7 @@ #pragma mark - Private Method - (void)initSubViews { + [self addSubview:self.topView]; [self addSubview:self.toolView]; [self addSubview:self.webVC.view]; @@ -143,6 +144,7 @@ - (XPWebViewController *)webVC { if (_webVC == nil) { _webVC = [[XPWebViewController alloc] init]; + _webVC.view.backgroundColor = [UIColor clearColor]; __weak typeof(self) weakSelf = self; _webVC.urlLoadCompleted = ^(BOOL result, NSError *error) { weakSelf.titleLabel.text = weakSelf.webVC.navigationItem.title; diff --git a/xplan-ios/Main/Room/View/StageView/MicroView/MicroGiftValueView.m b/xplan-ios/Main/Room/View/StageView/MicroView/MicroGiftValueView.m index fa987d1a..f718db01 100644 --- a/xplan-ios/Main/Room/View/StageView/MicroView/MicroGiftValueView.m +++ b/xplan-ios/Main/Room/View/StageView/MicroView/MicroGiftValueView.m @@ -79,6 +79,7 @@ - (UIImageView *)iconImageView { if (_iconImageView == nil) { _iconImageView = [[UIImageView alloc] init]; + _iconImageView.userInteractionEnabled = YES; _iconImageView.image = [UIImage imageNamed:@"room_position_giftValue_heart"]; } return _iconImageView; diff --git a/xplan-ios/Main/Room/View/StageView/MicroView/MicroView.m b/xplan-ios/Main/Room/View/StageView/MicroView/MicroView.m index 9f79838e..df19a6c4 100644 --- a/xplan-ios/Main/Room/View/StageView/MicroView/MicroView.m +++ b/xplan-ios/Main/Room/View/StageView/MicroView/MicroView.m @@ -206,7 +206,7 @@ if (self.userInfo && self.userInfo.uid > 0) { XPWebViewController * webVC = [[XPWebViewController alloc] init]; webVC.roomUid = self.roomUid; - webVC.url = [NSString stringWithFormat:@"%@?uid=%ld", URLWithType(kRoomCharmRankUrl), self.userInfo.uid]; + webVC.url = [NSString stringWithFormat:@"%@?uid=%ld", URLWithType(kRoomCharmRankURL), self.userInfo.uid]; [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES]; } } diff --git a/xplan-ios/Main/XPWebViewController.m b/xplan-ios/Main/XPWebViewController.m index f1fea4b3..532b4329 100644 --- a/xplan-ios/Main/XPWebViewController.m +++ b/xplan-ios/Main/XPWebViewController.m @@ -17,6 +17,8 @@ #import #import #import +#import "XCCurrentVCStackManager.h" +#import "XPMineUserInfoViewController.h" typedef NS_ENUM(NSUInteger, RightNavigationPushType){ ///跳转h5页面 @@ -77,6 +79,7 @@ NSString * const kJSGetDeviceInfo = @"getDeviceInfo"; NSString * const kJSOpenFaceLiveness = @"openFaceLiveness"; NSString * const kJSInitNav = @"initNav"; NSString * const kJSGetRoomUid = @"getRoomUid"; +NSString * const kOpenPersonPage = @"openPersonPage"; @implementation XPWebViewController @@ -186,7 +189,15 @@ NSString * const kJSGetRoomUid = @"getRoomUid"; } else if ([message.name isEqualToString:kJSOpenChargePage]) { - } else if ([message.name isEqualToString:kJSOpenFaceLiveness]) { + } else if ([message.name isEqualToString:kOpenPersonPage]) { + NSString *uid = [NSString stringWithFormat:@"%@",message.body]; + if (uid.integerValue > 0) { + [TTPopup dismiss]; + XPMineUserInfoViewController * userInfoVC = [[XPMineUserInfoViewController alloc] init]; + userInfoVC.uid = uid.integerValue; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:userInfoVC animated:YES]; + } + } else if ([message.name isEqualToString:kJSOpenFaceLiveness]) { NSString *verifyToken = message.body; #if TARGET_OS_IPHONE [RPSDK startWithVerifyToken:verifyToken viewController:self.navigationController completion:^(RPResult * _Nonnull auditState) { @@ -460,6 +471,8 @@ NSString * const kJSGetRoomUid = @"getRoomUid"; [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSInitNav]; // 获取房间uid [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetRoomUid]; + // 进入个人主页 + [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kOpenPersonPage]; } return _userContentController;