kevin 8 jaren geleden
bovenliggende
commit
4835ecac3c

+ 1 - 1
IpuCommon/Frameworks/WadeMobileFunc.framework/Headers/WDFMobileNetwork.h

@ -20,7 +20,7 @@
20 20
//HTTP的GET方法,供外部接口(JS)调用
21 21
-(void) httpGet:(NSArray*)param;
22 22
//HTTP的GET方法,供内部接口(IOS)调用
23
- (NSString *) httpGetForUrl:(NSString *)urlStr;
23
- (NSString *) httpGetForUrl:(NSString *)urlStr errorMsg:(NSString **)errorMsg;
24 24
25 25
-(void) httpRequest:(NSArray*)param;
26 26

+ 2 - 0
IpuCommon/Frameworks/WadeMobileFunc.framework/Headers/WDFMobileUI.h

@ -60,4 +60,6 @@
60 60
61 61
-(void) getPage:(NSArray*)param;
62 62
63
-(void) openBrowser:(NSArray *)param;
64
63 65
@end

BIN
IpuCommon/Frameworks/WadeMobileFunc.framework/Info.plist


BIN
IpuCommon/Frameworks/WadeMobileFunc.framework/WadeMobileFunc


+ 2 - 0
MultipleClinet/MultipleClinet/multiple/AppManagePlugin.h

@ -24,4 +24,6 @@
24 24
25 25
- (void) getAppsConfig:(NSArray *)args;
26 26
27
- (void) openRemoteURL:(NSArray *)args;
28
27 29
@end

+ 15 - 0
MultipleClinet/MultipleClinet/multiple/AppManagePlugin.m

@ -8,6 +8,7 @@
8 8
9 9
#import "AppManagePlugin.h"
10 10
#import "MCViewController.h"
11
#import "RemoteWebView.h"
11 12
#import <WadeMobile/IpuTemplateSubController.h>
12 13
#import <WadeMobileFunc/WDFMobileStorage.h>
13 14
#import <WadeMobile/WDPluginManager.h>
@ -159,4 +160,18 @@
159 160
    return [NSString stringWithFormat:@"{\"%@\":\"%@\",\"%@\":\"%@\"}", KEY_SESSION, sessionId, KEY_STAFF_ID, staffId];
160 161
}
161 162
163
164
- (void) openRemoteURL:(NSArray *)args
165
{
166
    dispatch_time_t time = dispatch_time(DISPATCH_TIME_NOW, 0.5*NSEC_PER_SEC);
167
    dispatch_after(time, dispatch_get_main_queue(), ^{
168
        
169
        RemoteWebView *vc = [[RemoteWebView alloc] initWithTitle:@"" urlPath:args[0]];
170
        
171
        [[self.wademobile getViewController] presentViewController:vc animated:NO completion:^{
172
            ;
173
        }];
174
    });
175
}
176
162 177
@end

+ 15 - 0
MultipleClinet/MultipleClinet/plugin/RemoteWebView.h

@ -0,0 +1,15 @@
1
//
2
//  RemoteWebView.h
3
//  MultipleClinet
4
//
5
//  Created by Lu on 2017/4/17.
6
//  Copyright © 2017年 asiainfo. All rights reserved.
7
//
8
9
#import <UIKit/UIKit.h>
10
11
@interface RemoteWebView : UIViewController <UIWebViewDelegate>
12
13
- (instancetype) initWithTitle:(NSString *)title urlPath:(NSString *)urlPath;
14
15
@end

+ 104 - 0
MultipleClinet/MultipleClinet/plugin/RemoteWebView.m

@ -0,0 +1,104 @@
1
//
2
//  RemoteWebView.m
3
//  MultipleClinet
4
//
5
//  Created by Lu on 2017/4/17.
6
//  Copyright © 2017年 asiainfo. All rights reserved.
7
//
8
9
#import "RemoteWebView.h"
10
#import <WadeMobile/WDUtility.h>
11
#import <WadeMobile/WDMobileConfig.h>
12
#import <UIKit/UIActivityIndicatorView.h>
13
14
@interface RemoteWebView()
15
{
16
    UIActivityIndicatorView *activityIndicator;
17
}
18
19
@property (nonatomic, copy) NSString *navTitle; //标题名称
20
@property (nonatomic, copy) NSString *urlPath;  //加载资源
21
22
@end
23
24
@implementation RemoteWebView
25
26
- (instancetype) initWithTitle:(NSString *)title urlPath:(NSString *)urlPath
27
{
28
    if(self = [super init])
29
    {
30
        self->_navTitle = title == nil || [title isEqualToString:@""] ? @"" : title;
31
        self->_urlPath = urlPath == nil || [urlPath isEqualToString:@""] ? @"" : urlPath;
32
        
33
        [self createWebView];
34
    }
35
    return self;
36
}
37
38
- (void) createWebView
39
{
40
    
41
    UIView *statusBar;
42
    UIColor *statusBarColor;
43
    float relativeHeight = 20.0;
44
    //ios7以上添加状态栏
45
    if ([[UIDevice currentDevice] systemVersion].floatValue >=7.0) {
46
        statusBar = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width, relativeHeight)];
47
        statusBarColor = [WDUtility colorWithHexString:[WDMobileConfig getValue:@"statusbar_color"]];
48
        if (statusBarColor == [UIColor clearColor]) {
49
            statusBarColor = [UIColor colorWithRed:0.0 green:133.0/255.0 blue:208.0/255.0 alpha:1];
50
        }
51
        [statusBar setBackgroundColor:statusBarColor];
52
        [self.view addSubview:statusBar];
53
    }
54
    CGRect frame = [[UIScreen mainScreen] bounds];
55
    
56
    UINavigationBar *nvBar = [self navigationBar:frame color:statusBarColor];
57
    [self.view addSubview:nvBar];
58
    
59
    //ios7以上下移20像素,留给状态栏
60
    if ([[UIDevice currentDevice] systemVersion].floatValue >=7.0){
61
        frame = CGRectMake(0.0f, 60.0f, frame.size.width, frame.size.height);
62
    }
63
    
64
    UIWebView *webview = [[UIWebView alloc] initWithFrame:frame];
65
    NSURLRequest *urlReq = [NSURLRequest requestWithURL:[NSURL URLWithString: self->_urlPath]];
66
    [webview loadRequest:urlReq];
67
    
68
    [self.view addSubview: webview];
69
}
70
71
72
- (UINavigationBar *) navigationBar:(CGRect)rect color:(UIColor *)color{
73
    
74
    //添加了导航栏
75
    UINavigationBar *navigationBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, rect.size.width, 60)];
76
    //修改tint颜色,方法是宏定义的
77
    navigationBar.tintColor = [UIColor whiteColor];
78
    navigationBar.barTintColor = color;
79
    //设置NavigationItem
80
    UINavigationItem *navigationItem = [[UINavigationItem alloc] initWithTitle: self->_navTitle];
81
    [navigationBar pushNavigationItem:navigationItem animated:YES];
82
    //设置了系统的UIBarButtonItem样式mob
83
//    UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancleWebView:)];
84
    UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
85
    backBtn.frame = CGRectMake(0, 0, 60, 60);
86
    [backBtn setTitle:@"< 返回" forState:UIControlStateNormal];
87
    [backBtn addTarget:self action:@selector(cancleWebView) forControlEvents:UIControlEventTouchUpInside];
88
    [backBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
89
    UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
90
    navigationItem.leftBarButtonItem = item;
91
    
92
    [navigationBar setItems:[NSArray arrayWithObject:navigationItem]];
93
    
94
    return navigationBar;
95
}
96
97
#pragma ACTION
98
99
- (void) cancleWebView
100
{
101
    [self dismissViewControllerAnimated:NO completion:nil];
102
}
103
104
@end

+ 2 - 0
MultipleClinet/Res/config/mobile-action.xml

@ -6,6 +6,7 @@
6 6
    <action name="openIpuApp"       class="AppManagePlugin"     method="openIpuApp"/>
7 7
    <action name="openNative"       class="AppManagePlugin"     method="openNative"/>
8 8
    <action name="reLogin"          class="AppManagePlugin"     method="reLogin"/>
9
    <action name="openRemoteURL"    class="AppManagePlugin"     method="openRemoteURL"/>
9 10
    
10 11
	<action name="sms" class="WDFMobileBasic" method="sms"/>
11 12
    <action name="call" class="WDFMobileBasic" method="call"/>
@ -79,6 +80,7 @@
79 80
    <action name="markMap" class="IpuMap" method="markMap"/>
80 81
    
81 82
    <action name="back" class="WDFMobileUI" method="back"/>
83
    <action name="openBrowser" class="WDFMobileUI" method="openBrowser"/>
82 84
    <action name="openDialog" class="WDFMobileUI" method="openDialog"/>
83 85
    <action name="closeDialog" class="WDFMobileUI" method="closeDialog"/>
84 86
    <action name="openWindow" class="WDFMobileUI" method="openWindow"/>

+ 10 - 9
SuperMenu/Res/config/mobile-config.xml

@ -1,18 +1,19 @@
1 1
<?xml version="1.0" encoding="utf-8"?>
2 2
<configs>
3 3
    <!--<config name="request_host" value="http://aiipu.com"/>-->
4
    <config name="request_host" value="http://123.57.35.51:8084"/>
5
    <config name="request_path" value="/supermenu"/>
4
    <config name="request_host" value="http://211.136.25.145"/>
5
    <config name="request_path" value="/channel-app"/>
6 6
    <config name="request_servlet" value="/mobiledata"/>
7 7
    <config name="loading_page" value="Res/local/welcome.html"/>
8
    <config name="app_path" value="/supermenu"/>
8
    <config name="app_path" value="/multipleClient"/>
9
    <!--<config name="map_key" value="bd41376b509efb77494b5ab195c36a6c"/>-->
9 10
    <config name="map_key" value="bd41376b509efb77494b5ab195c36a6c"/>
10 11
    <config name="yunba_push_key" value="5630418ff085fc471efdf2c9"/>
11
    <config name="update_url" value="https://oa51x0k0n.qnssl.com/SuperMenu.plist"/>
12
    <config name="license" value="Sm6oNQFhaEIkNiOikkv5/w/tvvIHKi3c0eiz94wbNp8SFyMebpVk27VwiP2tuR2K90ePSjPciiM9GGSepgYir851sVAAIFWhAXu0cthKRDtIBHwv98lHGmVVedktydeJmfFtFbRot0l/vT0/8u9XViK0sXPlns8VqgYi2Aa4viM=|@@MDA5RTA1MkY3RjIyMTgxMEI1MjlGNDA0Mjk4MkQyQjEwMjA5RTkyQjE4Q0M0QjBDQTg0RUZBMzAwNkMyRDU3MTIzOTI0MTU1RUQ2QzgyMTRBMzhGOUIzMzc0RkYwNzYxNEQ3N0YwOUY2RUMyMUE4MEUwODIyMkJBNjI1NDRFQTQxMkM0MjRDRTIwRUU4RTU1NDM5MEZDNjdEQzQyNUZCQzI5QzJGM0ZCNTM0Q0YxQkRCQUEyNENEQjg2QTc4OEI0MjczN0U4NTU4QTdGQjE2RTBDMTlENkQzQkFFQzk1ODgzODlCREIzQTg0MjMzNTg3QTA2ODdCQzM5QUI5NDYxNDg5"/>
13
    <config name="local_resources" value=""/>
14
    <config name="webkit_select_forbid" value="true"/>
12
    <config name="update_url" value="https://oa51x0k0n.qnssl.com/DisplayClient.plist"/>
13
    <config name="license" value="KcAEQbd0AEHsR-ZDOPpNlkEAHK9il74ccXhb194wynonf57K2FrgbPh-HfWrpPJvAH309VpmqGQrrMZpbfXZ/K7RhEUqwCNlOE6CsruMQ5fvz4pSXqWoHC51d/HJ47BqSNO1orccM3gMvQ7Hrg5PLyC0sNsWw6rH-tTrVJjAU/A=|@@MDA4NTcwODc2RkYxQzhFNUREODM5NzYxNUYyMzQ0NDUxRkEzNTlBRUMwRDE0OTQyRkFGNkQ5NTYxODY5RjM5NDNCRkQ3ODcyOTY4NTg0NjMzRjkwQkNDNkE2NUVFNzJGMDU3MzQwMTYxRkNFOTk5Q0E3MDI4RUNFNkMxMzQ1QjI4MjgxRkQ5MUZBOTNGNkVBQTdBM0RFRTc2ODlFQzc2MkZDMjQ5QzA2Mzg0MDMwRDcyRUJDRDcyMjJFQjBGMUYwOTA1OUNDRDY5NTNDNUJCOTY5RDI0RTUzMEY1MzFENTI1RUJFQ0EyMjExMjM4MDA2RDE1NkI4MkQxNjJGRDgxRjRE"/>
14
    <config name="remote_url" value="http://127.0.0.1:8080/g/withiframe.html" />
15
    <config name="local_resources" value="/Res/display"/>
15 16
    <!---#0085D0-->
16
    <config name="statusbar_color" value="#3154C4"/>
17
    <config name="statusbar_color" value="#0085D0"/>
17 18
    <config name="progressbar_color" value="#0085D0"/>
18
</configs>	
19
</configs>

+ 1 - 1
SuperMenu/SuperMenu/multiple/AppManagePlugin.h

@ -24,6 +24,6 @@
24 24
25 25
- (void) getAppsConfig:(NSArray *)args;
26 26
27
-(void)openNative:(NSArray *)args;
27
- (void) openRemoteURL:(NSArray *)args;
28 28
29 29
@end

+ 73 - 20
SuperMenu/SuperMenu/multiple/AppManagePlugin.m

@ -7,6 +7,8 @@
7 7
//
8 8
9 9
#import "AppManagePlugin.h"
10
#import "MCViewController.h"
11
#import "RemoteWebView.h"
10 12
#import <WadeMobile/IpuTemplateSubController.h>
11 13
#import <WadeMobileFunc/WDFMobileStorage.h>
12 14
#import <WadeMobile/WDPluginManager.h>
@ -20,13 +22,13 @@
20 22
21 23
@interface AppManagePlugin(){
22 24
    NSMutableDictionary *nativeAppConf;
25
    MCViewController *rootVC;
26
    UIViewController* pre;
23 27
}
24 28
@end
25 29
26 30
@implementation AppManagePlugin
27 31
28
29
30 32
- (instancetype) init
31 33
{
32 34
    self = [super init];
@ -46,13 +48,20 @@
46 48
        return;
47 49
    }
48 50
    
49
    NSArray *apps = [WDJsonHelper toArray:args[0]];
50
    for(NSDictionary *app in apps)
51
    NSDictionary *data = [WDJsonHelper toDictionary: args[0]];
52
    for(NSDictionary *dic in data)
51 53
    {
52
        NSDictionary *dic = [WDJsonHelper toDictionary:[app objectForKey:@"MENU_PARAM"]];  //应用类型
53
        IpuMultipleAppConfig *appConf = [[IpuMultipleAppConfig alloc] initWithAppParams:[dic objectForKey:@"REQUEST_HOST"] requestPath:[dic objectForKey:@"REQUEST_PATH"] requestServlet:[dic objectForKey:@"REQUEST_SERVLET"] appPath:[dic objectForKey:@"APP_PATH"] indexPage:[dic objectForKey:@"APP_PAGE_ACTION"] welcomePage:[dic objectForKey:@"APP_WELCOME_PAGE"]];
54
        NSString *appId = [dic objectForKey:@"APP_ID"];
55
        [IpuMultipleManager putAppConfig:appId config:appConf];
54
        NSString *appType = [dic objectForKey:@"APP_TYPE"];  //应用类型
55
        //1.1.如果是Ipu应用类型
56
        if([SUB_APP_IPU isEqualToString: appType])
57
        {
58
            IpuMultipleAppConfig *appConf = [[IpuMultipleAppConfig alloc] initWithAppParams:[dic objectForKey:@"APP_REQUEST_HOST"] requestPath:[dic objectForKey:@"APP_REQUEST_PATH"] requestServlet:[dic objectForKey:@"APP_REQUEST_SERVLET"] appPath:[dic objectForKey:@"APP_PATH"] indexPage:nil welcomePage:nil];
59
            
60
            [IpuMultipleManager putAppConfig:[dic objectForKey:@"APP_ID"] config:appConf];
61
            //1.2.如果是原生应用类型
62
        }else if([SUB_APP_NATIVE isEqualToString: appType]){
63
            [nativeAppConf setObject:@"" forKey:[dic objectForKey:@"APP_ID"]];
64
        }
56 65
    }
57 66
}
58 67
/**
@ -61,23 +70,31 @@
61 70
- (void) openIpuApp:(NSArray *)args
62 71
{
63 72
    NSLog(@"%@", [WDTemplateManager getTemplateFullPath:nil]);
64
    
65
    /*处理参数*/
66
    NSDictionary *dic = [WDJsonHelper toDictionary: args[0]];
73
    //1.获取参数
74
    NSDictionary *dic = nil;
75
    @try {
76
        dic = [WDJsonHelper toDictionary:args[0]];
77
    }
78
    @catch (NSException *exception) {
79
        [super error:[NSString stringWithFormat:@"操作错误:%@!", [exception reason]]];
80
    }
81
    //2.设置当前应用标识
67 82
    NSString *appId = [dic objectForKey:@"APP_ID"];
68 83
    [IpuMultipleManager setCurrAppId:appId];
69
    
84
    //3.设置参数
70 85
    if(! [IpuMultipleManager isMultiple]){
71 86
        [IpuMultipleManager setMultBasePath:[WDTemplateManager getTemplateFullPath:nil]];
72 87
        [IpuMultipleManager setMultiple:YES];
88
        [IpuMultipleManager getCurrAppConfig].welcomePage = [dic objectForKey:@"MENU_WELCOME_PAGE"];
89
        [IpuMultipleManager getCurrAppConfig].indexPage = [dic objectForKey:@"MENU_PAGE_ACTION"];
73 90
    }
74
//    IpuTemplateSubController *vc = (IpuTemplateSubController *)[self getViewController];
91
    //4.打开页面
92
    rootVC = (MCViewController *)self.getViewController;
75 93
    IpuTemplateSubController *vc = [[IpuTemplateSubController alloc] init];
76
//    UINavigationController *nv = [[UINavigationController alloc] initWithRootViewController:vc];
77
    [[self getViewController] presentViewController:vc animated:NO completion:^{
78
        [vc loadSubApp:[self getSubAppParams]];
94
    [rootVC presentViewController:vc animated:NO completion:^{
95
        //        [vc loadSubApp:[self getSubAppParams]];
96
        [vc loadSubAppPage:[IpuMultipleManager getCurrIndexPage] withParam:nil];
79 97
    }];
80
    
81 98
}
82 99
/**
83 100
 * 打开原生应用
@ -94,8 +111,30 @@
94 111
    [[UIApplication sharedApplication] openURL:url];
95 112
}
96 113
97
-(void)openNative:(NSArray *)args{
98
    NSLog(@"%@",args);
114
- (void) reLogin:(NSArray *)args
115
{
116
    if(! args || [WDPlugin isNull:args[0]])
117
    {
118
        [WDUtility error:@"启动应用错误:参数不能为空!"];
119
        return;
120
    }
121
    
122
    rootVC = (MCViewController *)self.getViewController.presentingViewController;
123
    pre = self.getViewController;
124
    
125
    while (! [rootVC isKindOfClass:[MCViewController class]]) {
126
        [pre dismissViewControllerAnimated:NO completion:nil];
127
        pre = rootVC;
128
        rootVC = (MCViewController *)rootVC.presentingViewController;
129
    }
130
    
131
    [pre dismissViewControllerAnimated:NO completion:^{
132
        [IpuMultipleManager setMultiple:NO];
133
        NSArray *params = [[NSArray alloc]initWithObjects:args[0], [NSNull null], @"true", nil];
134
        [WDPluginManager execute:rootVC action:@"openPage" arrayParam:params callback:nil];
135
    }];
136
    
137
    
99 138
}
100 139
101 140
- (void) getAppsConfig:(NSArray *)args
@ -105,7 +144,7 @@
105 144
    NSString *SESSION_ID = [userDefaults objectForKey:@"SESSION_ID"];
106 145
    NSDictionary *dic = @{@"session_id":SESSION_ID,@"apps_config":apps_config};
107 146
    NSString *callBackStr = [WDJsonHelper toJSONString:dic];
108
   
147
    
109 148
    [super callback:callBackStr];
110 149
}
111 150
/**
@ -121,4 +160,18 @@
121 160
    return [NSString stringWithFormat:@"{\"%@\":\"%@\",\"%@\":\"%@\"}", KEY_SESSION, sessionId, KEY_STAFF_ID, staffId];
122 161
}
123 162
163
164
- (void) openRemoteURL:(NSArray *)args
165
{
166
    dispatch_time_t time = dispatch_time(DISPATCH_TIME_NOW, 0.5*NSEC_PER_SEC);
167
    dispatch_after(time, dispatch_get_main_queue(), ^{
168
        
169
        RemoteWebView *vc = [[RemoteWebView alloc] initWithTitle:@"" urlPath:args[0]];
170
        
171
        [[self.wademobile getViewController] presentViewController:vc animated:NO completion:^{
172
            ;
173
        }];
174
    });
175
}
176
124 177
@end

+ 15 - 0
SuperMenu/SuperMenu/plugin/RemoteWebView.h

@ -0,0 +1,15 @@
1
//
2
//  RemoteWebView.h
3
//  MultipleClinet
4
//
5
//  Created by Lu on 2017/4/17.
6
//  Copyright © 2017年 asiainfo. All rights reserved.
7
//
8
9
#import <UIKit/UIKit.h>
10
11
@interface RemoteWebView : UIViewController <UIWebViewDelegate>
12
13
- (instancetype) initWithTitle:(NSString *)title urlPath:(NSString *)urlPath;
14
15
@end

+ 104 - 0
SuperMenu/SuperMenu/plugin/RemoteWebView.m

@ -0,0 +1,104 @@
1
//
2
//  RemoteWebView.m
3
//  MultipleClinet
4
//
5
//  Created by Lu on 2017/4/17.
6
//  Copyright © 2017年 asiainfo. All rights reserved.
7
//
8
9
#import "RemoteWebView.h"
10
#import <WadeMobile/WDUtility.h>
11
#import <WadeMobile/WDMobileConfig.h>
12
#import <UIKit/UIActivityIndicatorView.h>
13
14
@interface RemoteWebView()
15
{
16
    UIActivityIndicatorView *activityIndicator;
17
}
18
19
@property (nonatomic, copy) NSString *navTitle; //标题名称
20
@property (nonatomic, copy) NSString *urlPath;  //加载资源
21
22
@end
23
24
@implementation RemoteWebView
25
26
- (instancetype) initWithTitle:(NSString *)title urlPath:(NSString *)urlPath
27
{
28
    if(self = [super init])
29
    {
30
        self->_navTitle = title == nil || [title isEqualToString:@""] ? @"" : title;
31
        self->_urlPath = urlPath == nil || [urlPath isEqualToString:@""] ? @"" : urlPath;
32
        
33
        [self createWebView];
34
    }
35
    return self;
36
}
37
38
- (void) createWebView
39
{
40
    
41
    UIView *statusBar;
42
    UIColor *statusBarColor;
43
    float relativeHeight = 20.0;
44
    //ios7以上添加状态栏
45
    if ([[UIDevice currentDevice] systemVersion].floatValue >=7.0) {
46
        statusBar = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width, relativeHeight)];
47
        statusBarColor = [WDUtility colorWithHexString:[WDMobileConfig getValue:@"statusbar_color"]];
48
        if (statusBarColor == [UIColor clearColor]) {
49
            statusBarColor = [UIColor colorWithRed:0.0 green:133.0/255.0 blue:208.0/255.0 alpha:1];
50
        }
51
        [statusBar setBackgroundColor:statusBarColor];
52
        [self.view addSubview:statusBar];
53
    }
54
    CGRect frame = [[UIScreen mainScreen] bounds];
55
    
56
    UINavigationBar *nvBar = [self navigationBar:frame color:statusBarColor];
57
    [self.view addSubview:nvBar];
58
    
59
    //ios7以上下移20像素,留给状态栏
60
    if ([[UIDevice currentDevice] systemVersion].floatValue >=7.0){
61
        frame = CGRectMake(0.0f, 60.0f, frame.size.width, frame.size.height);
62
    }
63
    
64
    UIWebView *webview = [[UIWebView alloc] initWithFrame:frame];
65
    NSURLRequest *urlReq = [NSURLRequest requestWithURL:[NSURL URLWithString: self->_urlPath]];
66
    [webview loadRequest:urlReq];
67
    
68
    [self.view addSubview: webview];
69
}
70
71
72
- (UINavigationBar *) navigationBar:(CGRect)rect color:(UIColor *)color{
73
    
74
    //添加了导航栏
75
    UINavigationBar *navigationBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, rect.size.width, 60)];
76
    //修改tint颜色,方法是宏定义的
77
    navigationBar.tintColor = [UIColor whiteColor];
78
    navigationBar.barTintColor = color;
79
    //设置NavigationItem
80
    UINavigationItem *navigationItem = [[UINavigationItem alloc] initWithTitle: self->_navTitle];
81
    [navigationBar pushNavigationItem:navigationItem animated:YES];
82
    //设置了系统的UIBarButtonItem样式mob
83
//    UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancleWebView:)];
84
    UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
85
    backBtn.frame = CGRectMake(0, 0, 60, 60);
86
    [backBtn setTitle:@"< 返回" forState:UIControlStateNormal];
87
    [backBtn addTarget:self action:@selector(cancleWebView) forControlEvents:UIControlEventTouchUpInside];
88
    [backBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
89
    UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
90
    navigationItem.leftBarButtonItem = item;
91
    
92
    [navigationBar setItems:[NSArray arrayWithObject:navigationItem]];
93
    
94
    return navigationBar;
95
}
96
97
#pragma ACTION
98
99
- (void) cancleWebView
100
{
101
    [self dismissViewControllerAnimated:NO completion:nil];
102
}
103
104
@end

+ 2 - 3
WadeMobileFunc/WadeMobileFunc.xcodeproj/project.pbxproj

@ -389,7 +389,6 @@
389 389
					};
390 390
					E2DE1AD31B42DD9500762141 = {
391 391
						CreatedOnToolsVersion = 6.3.2;
392
						DevelopmentTeam = 55F7BLNJ53;
393 392
						ProvisioningStyle = Manual;
394 393
					};
395 394
				};
@ -694,9 +693,9 @@
694 693
			isa = XCBuildConfiguration;
695 694
			buildSettings = {
696 695
				ARCHS = "$(ARCHS_STANDARD)";
697
				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
696
				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: China Mobile Group shaanxi Company Limited";
698 697
				DEFINES_MODULE = YES;
699
				DEVELOPMENT_TEAM = 55F7BLNJ53;
698
				DEVELOPMENT_TEAM = "";
700 699
				DYLIB_COMPATIBILITY_VERSION = 1;
701 700
				DYLIB_CURRENT_VERSION = 1;
702 701
				DYLIB_INSTALL_NAME_BASE = "@rpath";

+ 2 - 0
WadeMobileFunc/WadeMobileFunc/WDFMobileUI.h

@ -60,4 +60,6 @@
60 60
61 61
-(void) getPage:(NSArray*)param;
62 62
63
-(void) openBrowser:(NSArray *)param;
64
63 65
@end

+ 23 - 0
WadeMobileFunc/WadeMobileFunc/WDFMobileUI.m

@ -111,6 +111,29 @@
111 111
    }
112 112
}
113 113
114
-(void) openBrowser:(NSArray *)param
115
{
116
    NSString *url = param[0];
117
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url] options:@{} completionHandler:nil];
118
}
119
120
-(void) openRemoteURL:(NSArray *)param
121
{
122
    NSString *url = param[0];
123
    
124
    NSLog(@"%@", [WDTemplateManager getTemplateFullPath:nil]);
125
    NSLog(@"....%@", [self.wademobile class]);
126
//    NSString *pageUrl = @"/Users/kevin/Library/Developer/CoreSimulator/Devices/9785CFD8-E801-4C56-B414-C29B03F535D0/data/Containers/Data/Application/4D39B6A2-89CA-4855-877E-309ECFFAA149/Library/Application/multipleClient/template/webapp/appMenu/demo/scanPage.html";
127
    
128
    WDFlipperView *flipperView = [self.wademobile getFlipperView];
129
    WDTemplateWebView *nextWebView = (WDTemplateWebView *)[self.wademobile createNewWebView];
130
    [flipperView addView:nextWebView];
131
    
132
    [nextWebView loadUrl:@"http://www.baidu.com"];
133
//    [nextWebView loadLocalUrl:pageUrl];
134
    [flipperView showNextView];
135
}
136
114 137
-(void) openUrl:(NSArray*)param
115 138
{
116 139
    NSString* url = param[0];