主播卡片弹出时手机震动
This commit is contained in:
@@ -20,6 +20,10 @@
|
||||
#import "XCCurrentVCStackManager.h"
|
||||
#import "XPMineUserInfoViewController.h"
|
||||
#import "XPMineRechargeViewController.h"
|
||||
///vc
|
||||
#import "XPMineDressUpViewController.h"
|
||||
#import "XPDressUpShopViewController.h"
|
||||
#import "XPRoomViewController.h"
|
||||
|
||||
typedef NS_ENUM(NSUInteger, RightNavigationPushType){
|
||||
///跳转h5页面
|
||||
@@ -83,6 +87,8 @@ NSString * const kJSGetRoomUid = @"getRoomUid";
|
||||
NSString * const kOpenPersonPage = @"openPersonPage";
|
||||
NSString * const kInitShowNav = @"initShowNav";
|
||||
NSString * const kCloseWebView = @"closeWebView";
|
||||
NSString * const kJumpAppointPage = @"jumpAppointPage";
|
||||
NSString * const kJSOpenRoom = @"openRoom";
|
||||
|
||||
@implementation XPWebViewController
|
||||
|
||||
@@ -262,11 +268,124 @@ NSString * const kCloseWebView = @"closeWebView";
|
||||
if (self.navigationController) {
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
}
|
||||
} else if ([message.name isEqualToString:kJumpAppointPage]) {
|
||||
// h5与原生交互新协议
|
||||
NSDictionary *bodyDict;
|
||||
if ([message.body isKindOfClass:[NSDictionary class]]) {
|
||||
bodyDict = message.body;
|
||||
} else if ([message.body isKindOfClass:[NSString class]]) {
|
||||
NSString *str = (NSString *)message.body;
|
||||
bodyDict = [str toJSONObject];
|
||||
}
|
||||
NSInteger skyType = [bodyDict[@"routerType"] integerValue];
|
||||
[self handleRouterType:skyType message:message];
|
||||
} else if ([message.name isEqualToString:kJSOpenRoom]) {
|
||||
// NSDictionary *bodyDict;
|
||||
// if ([message.body isKindOfClass:[NSDictionary class]]) {
|
||||
// bodyDict = message.body;
|
||||
// } else if ([message.body isKindOfClass:[NSString class]]) {
|
||||
// NSString *str = (NSString *)message.body;
|
||||
// bodyDict = [str toJSONObject];
|
||||
// }
|
||||
NSString *uid = [NSString stringWithFormat:@"%@",message.body];
|
||||
if (uid.length > 0) {
|
||||
[XPRoomViewController openRoom:uid viewController:[XCCurrentVCStackManager shareManager].getCurrentVC];
|
||||
}
|
||||
}
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - private method
|
||||
- (void)handleRouterType:(NSInteger)skyType message:(WKScriptMessage *)message {
|
||||
NSDictionary *bodyDict = (NSDictionary *)message.body;
|
||||
switch (skyType) {
|
||||
case 1:
|
||||
{
|
||||
//房间页 传参:uid
|
||||
NSString *uid = [NSString stringWithFormat:@"%@", bodyDict[@"routerVal"]];
|
||||
if (uid.length) {
|
||||
[XPRoomViewController openRoom:uid viewController:[XCCurrentVCStackManager shareManager].getCurrentVC];
|
||||
}
|
||||
}
|
||||
break;
|
||||
// case P2PInteractive_SkipType_H5:
|
||||
// {
|
||||
// //H5
|
||||
// NSString *urlString = [NSString stringWithFormat:@"%@", bodyDict[@"routerVal"]];
|
||||
// if (urlString.length) {
|
||||
// XCWKWebViewController *vc = [[[self class] alloc] init];
|
||||
// vc.urlString = urlString;
|
||||
// [self.navigationController pushViewController:vc animated:YES];
|
||||
// }
|
||||
// }
|
||||
// break;
|
||||
// case P2PInteractive_SkipType_Purse:
|
||||
// {
|
||||
// //钱包页
|
||||
// [self h5OpenPurseAction:message];
|
||||
// }
|
||||
// break;
|
||||
// case P2PInteractive_SkipType_Recharge:
|
||||
// {
|
||||
// //充值页
|
||||
// [self h5OpenChargePageAction:message];
|
||||
// }
|
||||
// break;
|
||||
// case P2PInteractive_SkipType_Person:
|
||||
// {
|
||||
// //个人页 传参:uid
|
||||
// NSString *uid = [NSString stringWithFormat:@"%@", bodyDict[@"routerVal"]];
|
||||
// if (uid.length) {
|
||||
// [self h5OpenPersonPageAction:uid.userIDValue message:message];
|
||||
// }
|
||||
// }
|
||||
// break;
|
||||
case 7:
|
||||
{
|
||||
//座驾
|
||||
XPMineDressUpViewController *vc = [[XPMineDressUpViewController alloc] init];
|
||||
vc.currentIndex = 1;
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
//头饰
|
||||
XPMineDressUpViewController *vc = [[XPMineDressUpViewController alloc] init];
|
||||
vc.currentIndex = 0;
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
break;
|
||||
// case P2PInteractive_SkipType_SystemMessage:
|
||||
// {
|
||||
// //系统消息
|
||||
// [self h5JumpSystemMessageAction:message];
|
||||
// }
|
||||
// break;
|
||||
case 73:
|
||||
{
|
||||
//装扮商城
|
||||
NSString *index = [NSString stringWithFormat:@"%@", bodyDict[@"routerVal"]];
|
||||
XPDressUpShopViewController *vc = [[XPDressUpShopViewController alloc] init];
|
||||
vc.currentIndex = [index integerValue];
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
break;
|
||||
case 74:
|
||||
{
|
||||
//我的装扮
|
||||
NSString *index = [NSString stringWithFormat:@"%@", bodyDict[@"routerVal"]];
|
||||
XPMineDressUpViewController *vc = [[XPMineDressUpViewController alloc] init];
|
||||
vc.currentIndex = [index integerValue];
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setUrl:(NSString *)urlString{
|
||||
_url = urlString;
|
||||
if (_url == nil) {
|
||||
@@ -517,7 +636,10 @@ NSString * const kCloseWebView = @"closeWebView";
|
||||
[_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kInitShowNav];
|
||||
// 隐藏导航栏
|
||||
[_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kCloseWebView];
|
||||
|
||||
//装扮及其他活动页面
|
||||
[_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJumpAppointPage];
|
||||
//进入房间
|
||||
[_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenRoom];
|
||||
}
|
||||
return _userContentController;
|
||||
}
|
||||
|
Reference in New Issue
Block a user