房间榜换成h5

This commit is contained in:
fengshuo
2022-01-14 11:38:09 +08:00
parent f1ec673b26
commit 68971411e9
7 changed files with 29 additions and 7 deletions

View File

@@ -30,7 +30,9 @@ typedef NS_ENUM(NSUInteger, URLType) {
/// 糖果树玩法规则 /// 糖果树玩法规则
kCandyTreeRuleURL, kCandyTreeRuleURL,
///房间魅力榜 ///房间魅力榜
kRoomCharmRankUrl, kRoomCharmRankURL,
///房间榜
kRoomRankURL,
}; };
NSString * const URLWithType(URLType type); NSString * const URLWithType(URLType type);

View File

@@ -25,7 +25,8 @@ NSString * const URLWithType(URLType type) {
@(kCandyTreeURL) : @"activity/explore/index.html",/// @(kCandyTreeURL) : @"activity/explore/index.html",///
@(kCandyTreeRuleURL) : @"modules/rank/index.html#/wishingWellRule",/// @(kCandyTreeRuleURL) : @"modules/rank/index.html#/wishingWellRule",///
@(kCandyTreeRecordURL) : @"modules/rank/index.html#/wishingWellRecord",/// @(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)]; NSString * url = [dic objectForKey:@(type)];

View File

@@ -8,12 +8,14 @@
#import "XPRoomFunctionContainerView.h" #import "XPRoomFunctionContainerView.h"
///Tool ///Tool
#import "XPMacro.h" #import "XPMacro.h"
#import "XPHtmlUrl.h"
#import "TTPopup.h"
///Third ///Third
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
///Model ///Model
#import "RoomInfoModel.h" #import "RoomInfoModel.h"
///View ///View
#import "XPRoomRankViewController.h" #import "XPRoomHalfWebView.h"
@interface XPRoomFunctionContainerView () @interface XPRoomFunctionContainerView ()
///host ///host
@property (nonatomic,weak) id<RoomHostDelegate>delegate; @property (nonatomic,weak) id<RoomHostDelegate>delegate;
@@ -50,8 +52,9 @@
#pragma mark - Event Response #pragma mark - Event Response
- (void)contributionButtonAction:(UIButton *)sender { - (void)contributionButtonAction:(UIButton *)sender {
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.uid]; NSString * roomUid = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.uid];
XPRoomRankViewController * rankVC = [[XPRoomRankViewController alloc] initWithRoomUid:roomUid delegate:self.delegate]; XPRoomHalfWebView * webView = [[XPRoomHalfWebView alloc] init];
[self.delegate.getCurrentNav presentViewController:rankVC animated:YES completion:nil]; webView.url = [NSString stringWithFormat:@"%@?roomUid=%@", URLWithType(kRoomRankURL), roomUid];
[TTPopup popupView:webView style:TTPopupStyleActionSheet];
} }
#pragma mark - Getters And Setters #pragma mark - Getters And Setters

View File

@@ -41,6 +41,7 @@
#pragma mark - Private Method #pragma mark - Private Method
- (void)initSubViews { - (void)initSubViews {
[self addSubview:self.topView]; [self addSubview:self.topView];
[self addSubview:self.toolView]; [self addSubview:self.toolView];
[self addSubview:self.webVC.view]; [self addSubview:self.webVC.view];
@@ -143,6 +144,7 @@
- (XPWebViewController *)webVC { - (XPWebViewController *)webVC {
if (_webVC == nil) { if (_webVC == nil) {
_webVC = [[XPWebViewController alloc] init]; _webVC = [[XPWebViewController alloc] init];
_webVC.view.backgroundColor = [UIColor clearColor];
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
_webVC.urlLoadCompleted = ^(BOOL result, NSError *error) { _webVC.urlLoadCompleted = ^(BOOL result, NSError *error) {
weakSelf.titleLabel.text = weakSelf.webVC.navigationItem.title; weakSelf.titleLabel.text = weakSelf.webVC.navigationItem.title;

View File

@@ -79,6 +79,7 @@
- (UIImageView *)iconImageView { - (UIImageView *)iconImageView {
if (_iconImageView == nil) { if (_iconImageView == nil) {
_iconImageView = [[UIImageView alloc] init]; _iconImageView = [[UIImageView alloc] init];
_iconImageView.userInteractionEnabled = YES;
_iconImageView.image = [UIImage imageNamed:@"room_position_giftValue_heart"]; _iconImageView.image = [UIImage imageNamed:@"room_position_giftValue_heart"];
} }
return _iconImageView; return _iconImageView;

View File

@@ -206,7 +206,7 @@
if (self.userInfo && self.userInfo.uid > 0) { if (self.userInfo && self.userInfo.uid > 0) {
XPWebViewController * webVC = [[XPWebViewController alloc] init]; XPWebViewController * webVC = [[XPWebViewController alloc] init];
webVC.roomUid = self.roomUid; 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]; [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
} }
} }

View File

@@ -17,6 +17,8 @@
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
#import <MJExtension/MJExtension.h> #import <MJExtension/MJExtension.h>
#import <RPSDK/RPSDK.h> #import <RPSDK/RPSDK.h>
#import "XCCurrentVCStackManager.h"
#import "XPMineUserInfoViewController.h"
typedef NS_ENUM(NSUInteger, RightNavigationPushType){ typedef NS_ENUM(NSUInteger, RightNavigationPushType){
///h5 ///h5
@@ -77,6 +79,7 @@ NSString * const kJSGetDeviceInfo = @"getDeviceInfo";
NSString * const kJSOpenFaceLiveness = @"openFaceLiveness"; NSString * const kJSOpenFaceLiveness = @"openFaceLiveness";
NSString * const kJSInitNav = @"initNav"; NSString * const kJSInitNav = @"initNav";
NSString * const kJSGetRoomUid = @"getRoomUid"; NSString * const kJSGetRoomUid = @"getRoomUid";
NSString * const kOpenPersonPage = @"openPersonPage";
@implementation XPWebViewController @implementation XPWebViewController
@@ -186,7 +189,15 @@ NSString * const kJSGetRoomUid = @"getRoomUid";
} else if ([message.name isEqualToString:kJSOpenChargePage]) { } 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; NSString *verifyToken = message.body;
#if TARGET_OS_IPHONE #if TARGET_OS_IPHONE
[RPSDK startWithVerifyToken:verifyToken viewController:self.navigationController completion:^(RPResult * _Nonnull auditState) { [RPSDK startWithVerifyToken:verifyToken viewController:self.navigationController completion:^(RPResult * _Nonnull auditState) {
@@ -460,6 +471,8 @@ NSString * const kJSGetRoomUid = @"getRoomUid";
[_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSInitNav]; [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSInitNav];
// uid // uid
[_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetRoomUid]; [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetRoomUid];
//
[_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kOpenPersonPage];
} }
return _userContentController; return _userContentController;