房间榜换成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,
///房间魅力榜
kRoomCharmRankUrl,
kRoomCharmRankURL,
///房间榜
kRoomRankURL,
};
NSString * const URLWithType(URLType type);

View File

@@ -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)];

View File

@@ -8,12 +8,14 @@
#import "XPRoomFunctionContainerView.h"
///Tool
#import "XPMacro.h"
#import "XPHtmlUrl.h"
#import "TTPopup.h"
///Third
#import <Masonry/Masonry.h>
///Model
#import "RoomInfoModel.h"
///View
#import "XPRoomRankViewController.h"
#import "XPRoomHalfWebView.h"
@interface XPRoomFunctionContainerView ()
///host
@property (nonatomic,weak) id<RoomHostDelegate>delegate;
@@ -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

View File

@@ -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;

View File

@@ -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;

View File

@@ -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];
}
}

View File

@@ -17,6 +17,8 @@
#import <Masonry/Masonry.h>
#import <MJExtension/MJExtension.h>
#import <RPSDK/RPSDK.h>
#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,6 +189,14 @@ NSString * const kJSGetRoomUid = @"getRoomUid";
} else if ([message.name isEqualToString:kJSOpenChargePage]) {
} 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
@@ -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;