Commit 34c4dbb7 by 路少雄

h5

parent 465a7167
......@@ -253,21 +253,5 @@
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "E8A46705-16A4-4AC8-B81B-1F346A6F16C2"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "DJMHomeTY/Page/DeviceListPage/Controller/DXBannerVC.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "64"
endingLineNumber = "64"
landmarkName = "-requestData"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
......@@ -186,7 +186,7 @@
[weakSelf setAppWindows];
[weakSelf setRootViewController];
});
// [self requestGiftLink];
[self requestGiftLink];
}//
......
......@@ -172,12 +172,12 @@
NSArray * selectItmes;
NSArray * controllClass;
if ([XHDataManager sharedManager].simparlanguage == 0) {
// normalItems = @[@"DR_Home_home-Normal",@"DR_gift_Normal",@"DR_Mine_Normal"];
// selectItmes = @[@"DR_Home_home-sel",@"DR_gift_Sel",@"DR_Mine_Sel"];
// controllClass = @[@"DXDeviceListVC",@"DXBannerVC",@"XHMineVC"];
normalItems = @[@"DR_Home_home-Normal",@"DR_Mine_Normal"];
selectItmes = @[@"DR_Home_home-sel",@"DR_Mine_Sel"];
controllClass = @[@"DXDeviceListVC",@"XHMineVC"];
normalItems = @[@"DR_Home_home-Normal",@"DR_gift_Normal",@"DR_Mine_Normal"];
selectItmes = @[@"DR_Home_home-sel",@"DR_gift_Sel",@"DR_Mine_Sel"];
controllClass = @[@"DXDeviceListVC",@"DXBannerVC",@"XHMineVC"];
// normalItems = @[@"DR_Home_home-Normal",@"DR_Mine_Normal"];
// selectItmes = @[@"DR_Home_home-sel",@"DR_Mine_Sel"];
// controllClass = @[@"DXDeviceListVC",@"XHMineVC"];
}else{
normalItems = @[@"DR_Home_home-Normal",@"DR_Mine_Normal"];
selectItmes = @[@"DR_Home_home-sel",@"DR_Mine_Sel"];
......
......@@ -34,8 +34,8 @@
// 2.设置其它UITabBarButton的位置和尺寸//self.frame.size.width / 3;
CGFloat tabbarButtonW;
if ([XHDataManager sharedManager].simparlanguage == 0 && TargetType == 5){
// tabbarButtonW = HJScreenWidth / 3;
tabbarButtonW = HJScreenWidth / 2;
tabbarButtonW = HJScreenWidth / 3;
// tabbarButtonW = HJScreenWidth / 2;
}else{
tabbarButtonW = HJScreenWidth / 2;
}
......
......@@ -161,8 +161,8 @@
#define UpdateDeviceVersionURL [NSString stringWithFormat:@"%@%@",DRURL,@"/Facility/getUpdateMCUURL"]
/*海菲秀获取BANNER列表*/
//#define HFXGetBannerList [NSString stringWithFormat:@"%@%@",DRURL,@"/hfx/banner"]
#define HFXGetBannerList [NSString stringWithFormat:@"%@%@",DRURL,@"/hfx/getBanner"]
#define HFXGetBannerList [NSString stringWithFormat:@"%@%@",DRURL,@"/hfx/banner"]
//#define HFXGetBannerList [NSString stringWithFormat:@"%@%@",DRURL,@"/hfx/getBanner"]
/*海菲秀获取BANNER列表*/
#define HFXGetGiftLink [NSString stringWithFormat:@"%@%@",DRURL,@"/ldm/api/openurl/faceAgeH5"]
......
......@@ -51,6 +51,25 @@
#pragma mark --初始化数据
- (void)initData
{
WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init];
configuration.selectionGranularity = WKSelectionGranularityDynamic;
configuration.allowsInlineMediaPlayback = YES;
WKPreferences *preferences = [WKPreferences new];
//是否支持JavaScript
preferences.javaScriptEnabled = YES;
//不通过用户交互,是否可以打开窗口
preferences.javaScriptCanOpenWindowsAutomatically = YES;
configuration.preferences = preferences;
// 初始化WKWebView
_webView = [[WKWebView alloc] initWithFrame:[UIScreen mainScreen].bounds configuration:configuration];
// self.edgesForExtendedLayout = false;
// 有两种代理,UIDelegate负责界面弹窗,navigationDelegate负责加载、跳转等
_webView.UIDelegate = self;
_webView.navigationDelegate = self;
[self.webView addObserver:self forKeyPath:@"title" options:NSKeyValueObservingOptionNew context:NULL];
[self.webView addObserver:self forKeyPath:@"URL" options:NSKeyValueObservingOptionNew context:nil];
}
......@@ -80,12 +99,14 @@
// url = @"https://www.baidu.com";
_url = url;
NSURL *url1 = [NSURL URLWithString:url];
// 根据URL创建请求
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url1];
[request setValue:@"no-cache" forHTTPHeaderField:@"Cache-Control"];
// NSURLRequest *request = [NSURLRequest requestWithURL:url1];
// WKWebView加载请求
[self.webView loadRequest:request];
[self.webView reload];
}
#pragma mark --委托代理
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context {
......@@ -184,30 +205,30 @@
#pragma mark --懒加载
- (WKWebView *)webView
{
if (nil == _webView) {
// 可以做一些初始化配置定制
WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init];
configuration.selectionGranularity = WKSelectionGranularityDynamic;
configuration.allowsInlineMediaPlayback = YES;
WKPreferences *preferences = [WKPreferences new];
//是否支持JavaScript
preferences.javaScriptEnabled = YES;
//不通过用户交互,是否可以打开窗口
preferences.javaScriptCanOpenWindowsAutomatically = YES;
configuration.preferences = preferences;
// 初始化WKWebView
_webView = [[WKWebView alloc] initWithFrame:[UIScreen mainScreen].bounds configuration:configuration];
// self.edgesForExtendedLayout = false;
// 有两种代理,UIDelegate负责界面弹窗,navigationDelegate负责加载、跳转等
_webView.UIDelegate = self;
_webView.navigationDelegate = self;
}
return _webView;
}
//- (WKWebView *)webView
//{
// if (nil == _webView) {
// // 可以做一些初始化配置定制
// WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init];
// configuration.selectionGranularity = WKSelectionGranularityDynamic;
// configuration.allowsInlineMediaPlayback = YES;
//
// WKPreferences *preferences = [WKPreferences new];
// //是否支持JavaScript
// preferences.javaScriptEnabled = YES;
// //不通过用户交互,是否可以打开窗口
// preferences.javaScriptCanOpenWindowsAutomatically = YES;
// configuration.preferences = preferences;
//
// // 初始化WKWebView
// _webView = [[WKWebView alloc] initWithFrame:[UIScreen mainScreen].bounds configuration:configuration];
//// self.edgesForExtendedLayout = false;
// // 有两种代理,UIDelegate负责界面弹窗,navigationDelegate负责加载、跳转等
// _webView.UIDelegate = self;
// _webView.navigationDelegate = self;
// }
// return _webView;
//}
-(void) startLocation
{
//判断定位功能是否打开
......
......@@ -112,19 +112,23 @@ static NSString *dxmachineCell = @"DXDeviceListCell";
// _bannerView.layer.masksToBounds = YES;
// _bannerView.layer.cornerRadius = 13;
_bannerView.clickItemOperationBlock = ^(NSInteger index) {
DXAddBannerVC *banner = [DXAddBannerVC new];
banner.url = weakSelf.linkArray[index];
if(banner.url && ![banner.url isEqualToString:@""]){
if(weakSelf.linkArray[index] && ![weakSelf.linkArray[index] isEqualToString:@""]){
[weakSelf.navigationController pushViewController:banner animated:YES];
banner.hidesBottomBarWhenPushed = YES;
// if ([banner.url containsString:@"http://djmfa.imoreme.com"]) {
// banner.hidesBottomBarWhenPushed = YES;
// [weakSelf.tabBarController setSelectedIndex:1];
// }else{
// [weakSelf.navigationController pushViewController:banner animated:YES];
// }
// [weakSelf.navigationController pushViewController:banner animated:YES];
if ([weakSelf.linkArray[index] containsString:@"is_tab_true"]) {
DXBannerVC *banner = [DXBannerVC new];
banner.url = weakSelf.linkArray[index];
banner.hidesBottomBarWhenPushed = YES;
[weakSelf.tabBarController setSelectedIndex:1];
}else{
DXAddBannerVC *banner = [DXAddBannerVC new];
banner.url = weakSelf.linkArray[index];
[weakSelf.navigationController pushViewController:banner animated:YES];
banner.hidesBottomBarWhenPushed = YES;
}
//
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment