fix: upgrade sample
parent
958ad17224
commit
3cc2c98971
2
Podfile
2
Podfile
|
@ -6,7 +6,7 @@ source 'https://github.com/CocoaPods/Specs.git'
|
||||||
inhibit_all_warnings!
|
inhibit_all_warnings!
|
||||||
|
|
||||||
target "demo" do
|
target "demo" do
|
||||||
pod 'FinApplet', '2.0.191'
|
pod 'FinApplet', '2.0.192'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,20 +19,56 @@
|
||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
// Do any additional setup after loading the view.
|
// Do any additional setup after loading the view.
|
||||||
|
|
||||||
UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(100, 100, 200, 40)];
|
UIButton *btn1 = [[UIButton alloc] initWithFrame:CGRectMake(100, 100, 200, 40)];
|
||||||
[btn setTitle:@"打开小程序" forState:UIControlStateNormal];
|
[btn1 setTitle:@"打开画图小程序" forState:UIControlStateNormal];
|
||||||
[btn setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
|
[btn1 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||||
[btn addTarget:self action:@selector(onTestClick:) forControlEvents:UIControlEventTouchUpInside];
|
[btn1 setBackgroundColor:[UIColor grayColor]];
|
||||||
[self.view addSubview:btn];
|
[btn1 addTarget:self action:@selector(onCanvasClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
|
||||||
|
UIButton *btn2 = [[UIButton alloc] initWithFrame:CGRectMake(100, 150, 200, 40)];
|
||||||
|
[btn2 setTitle:@"打开官方小程序" forState:UIControlStateNormal];
|
||||||
|
[btn2 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||||
|
[btn2 setBackgroundColor:[UIColor grayColor]];
|
||||||
|
[btn2 addTarget:self action:@selector(onDemoClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
|
||||||
|
UIButton *btn3 = [[UIButton alloc] initWithFrame:CGRectMake(100, 200, 200, 40)];
|
||||||
|
[btn3 setTitle:@"我的对账单" forState:UIControlStateNormal];
|
||||||
|
[btn3 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||||
|
[btn3 setBackgroundColor:[UIColor grayColor]];
|
||||||
|
[btn3 addTarget:self action:@selector(onProfileClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
|
||||||
|
[self.view addSubview:btn1];
|
||||||
|
[self.view addSubview:btn2];
|
||||||
|
[self.view addSubview:btn3];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)onTestClick:(id)sender {
|
- (void)onCanvasClick:(id)sender {
|
||||||
|
|
||||||
NSString *appId = @"5e3c0950188211000141e9ac";
|
NSString *appId = @"5e3c147a188211000141e9b1";
|
||||||
|
// 打开小程序
|
||||||
|
[[FATClient sharedClient] startRemoteApplet:appId startParams:@{
|
||||||
|
@"path": @"/pages/index/index",
|
||||||
|
@"query": @""
|
||||||
|
} InParentViewController:self completion:^(BOOL result, NSError *error) {
|
||||||
|
NSLog(@"result:%d---error:%@", result, error);
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)onDemoClick:(id)sender {
|
||||||
|
|
||||||
|
NSString *appId = @"5e4d123647edd60001055df1";
|
||||||
// 打开小程序
|
// 打开小程序
|
||||||
[[FATClient sharedClient] startRemoteApplet:appId startParams:nil InParentViewController:self completion:^(BOOL result, NSError *error) {
|
[[FATClient sharedClient] startRemoteApplet:appId startParams:nil InParentViewController:self completion:^(BOOL result, NSError *error) {
|
||||||
NSLog(@"result:%d---error:%@", result, error);
|
NSLog(@"result:%d---error:%@", result, error);
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)onProfileClick:(id)sender {
|
||||||
|
|
||||||
|
NSString *appId = @"5e637a18cbfae4000170fa7a";
|
||||||
|
// 打开小程序
|
||||||
|
[[FATClient sharedClient] startRemoteApplet:appId startParams:nil InParentViewController:self completion:^(BOOL result, NSError *error) {
|
||||||
|
NSLog(@"result:%d---error:%@", result, error);
|
||||||
|
}];
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in New Issue