公聊大厅
This commit is contained in:
@@ -52,6 +52,7 @@ NSString * const kMSGameLoaded = @"gameLoaded";
|
||||
@property (nonatomic, strong) WKUserContentController *ms_userContentController;
|
||||
@property (nonatomic,weak) id<RoomHostDelegate> hostDelegate;
|
||||
@property(nonatomic,strong) ActivityInfoModel *gameModel;
|
||||
@property(nonatomic,strong) UIButton *backBtn;
|
||||
@end
|
||||
|
||||
@implementation MSRoomGameWebVC
|
||||
@@ -71,9 +72,16 @@ NSString * const kMSGameLoaded = @"gameLoaded";
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self installUI];
|
||||
self.backBtn = [UIButton new];
|
||||
[self.view addSubview:self.backBtn];
|
||||
[self.backBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.view);
|
||||
}];
|
||||
[self.backBtn addTarget:self action:@selector(backBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
}
|
||||
-(void)installUI{
|
||||
self.view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.4];
|
||||
MSWeakWebViewScriptMessageDelegate *weakScriptMessageDelegate = [[MSWeakWebViewScriptMessageDelegate alloc] initWithDelegate:self];
|
||||
_ms_userContentController = [[WKUserContentController alloc] init];
|
||||
[_ms_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kMSGetConfig];
|
||||
@@ -103,6 +111,7 @@ NSString * const kMSGameLoaded = @"gameLoaded";
|
||||
[self.webview.scrollView setBackgroundColor:[UIColor clearColor]];
|
||||
[self.webview setBackgroundColor:[UIColor clearColor]];
|
||||
[self.webview setUIDelegate:self];
|
||||
self.webview.navigationDelegate = self;
|
||||
//设置⽹⻚透明
|
||||
[self.webview setOpaque:NO];
|
||||
//设置⽹⻚全屏
|
||||
@@ -199,7 +208,6 @@ NSString * const kMSGameLoaded = @"gameLoaded";
|
||||
NSString *code = gameModel.code ?: @"";
|
||||
NSString *roomId = [NSString stringWithFormat:@"%ld",roomInfo.uid];
|
||||
NSString *gameMode = gameModel.gameMode ?: @"";
|
||||
NSString *language = gameModel.language ?: @"";
|
||||
NSDictionary *gameConfig = gameModel.gameConfig ?: @{};
|
||||
int gsp = gameModel.gsp;
|
||||
// 数据只是参考值,需要根据⾃⼰APP进⾏赋值
|
||||
@@ -240,7 +248,19 @@ NSString * const kMSGameLoaded = @"gameLoaded";
|
||||
[self.view removeFromSuperview]; //2
|
||||
[self removeFromParentViewController]; //3
|
||||
}
|
||||
|
||||
-(void)backBtnAction{
|
||||
TTAlertConfig *config = [[TTAlertConfig alloc]init];
|
||||
config.message = YMLocalizedString(@"MSRoomGameWebVC0");
|
||||
config.actionStyle = TTAlertActionBothStyle;
|
||||
[TTPopup alertWithConfig:config showBorder:NO confirmHandler:^{
|
||||
[self willMoveToParentViewController:nil]; //1
|
||||
[self.view removeFromSuperview]; //2
|
||||
[self removeFromParentViewController]; //3
|
||||
} cancelHandler:^{
|
||||
|
||||
}];
|
||||
|
||||
}
|
||||
// 提⽰余额不⾜
|
||||
- (void) gameRecharge:(NSDictionary*)args
|
||||
{
|
||||
@@ -257,14 +277,22 @@ NSString * const kMSGameLoaded = @"gameLoaded";
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
// 游戏加载完毕
|
||||
- (void) gameLoaded:(NSDictionary*)args
|
||||
{
|
||||
NSLog(@"BSGAME %s","游戏调⽤gameLoaded");
|
||||
// 游戏加载完毕 TODO 客⼾端
|
||||
[self.backBtn removeFromSuperview];
|
||||
}
|
||||
//加载完成
|
||||
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation {
|
||||
//加载完成后隐藏progressView
|
||||
|
||||
}
|
||||
//加载失败
|
||||
- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error {
|
||||
//加载失败同样需要隐藏progressView
|
||||
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user