123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353 |
- //
- // LFWAdWebViewController.m
- // YouHuiProject
- //
- // Created by 小花 on 2018/2/5.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "LFWAdWebViewController.h"
- #import <AlibcTradeSDK/AlibcTradeSDK.h>
- #import <AlibabaAuthSDK/ALBBSession.h>
- #import <AlibabaAuthSDK/ALBBSDK.h>
- #import <WebKit/WebKit.h>
- @interface LFWAdWebViewController ()<UIWebViewDelegate,UIScrollViewDelegate>
- /** webView视图 */
- @property (nonatomic, strong) UIWebView *webView;
- /** 加载进度条 */
- //@property (nonatomic, strong) UIProgressView *progressView;
- @property (nonatomic, strong) UIButton *backButton;
- @property (nonatomic, strong) UIButton *closeButton;
- @end
- @implementation LFWAdWebViewController
- - (void)viewWillDisappear:(BOOL)animated {
- [super viewWillDisappear:animated];
- [SVProgressHUD dismiss];
- }
- - (void)viewDidLoad {
- [super viewDidLoad];
- if (@available(iOS 11.0, *)) {
- self.webView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;//UIScrollView也适用
- }else {
- self.automaticallyAdjustsScrollViewInsets = NO;
- }
-
- [self configNavigationBar];
- [self initHUD];
- [self loadSubViewsConfiguration];
- [self openWebView];
- }
- - (void)initHUD {
- [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom];
- [SVProgressHUD setForegroundColor:[UIColor YHColorWithHex:0xff2420]];
- [SVProgressHUD setBackgroundColor:[UIColor YHColorWithHex:0xf5f4f4]];
-
- }
- - (void)configNavigationBar {
-
- self.view.backgroundColor = [UIColor whiteColor];
-
- self.navigationBar.showNavigationBarBottomLine = YES;
-
- [self.navigationBar setCustomLeftButtons:@[self.backButton]];
- self.navigationBar.backgroundColor = [UIColor clearColor];
-
- }
- - (void)openWebView {
-
- [SVProgressHUD show];
-
-
-
- id<AlibcTradePage> page = [AlibcTradePageFactory page:self.url];
- //淘客信息
- AlibcTradeTaokeParams *taoKeParams=[[AlibcTradeTaokeParams alloc] init];
- taoKeParams.pid= ALTK_PID;
- //打开方式
- AlibcTradeShowParams* showParam = [[AlibcTradeShowParams alloc] init];
-
- showParam.openType = AlibcOpenTypeAuto;
-
- [[AlibcTradeSDK sharedInstance].tradeService show:self.parentViewController webView:self.webView page:page showParams:showParam taoKeParams:taoKeParams trackParam:nil tradeProcessSuccessCallback:^(AlibcTradeResult * _Nullable result) {
-
- } tradeProcessFailedCallback:^(NSError * _Nullable error) {
-
- }];
- self.webView.delegate = self;
- }
- #pragma mark-
- #pragma mark- UIWebviewDelegate delegate
- /**
- 当网页加载完成的时候调用
- */
- - (void)webViewDidFinishLoad:(UIWebView *)webView {
- [[UIApplication sharedApplication]setNetworkActivityIndicatorVisible:NO];
- [self updateNavigationBarButtons];
- // 获取h5的标题
- NSString *title = [webView stringByEvaluatingJavaScriptFromString:@"document.title"];
- [self.navigationBar setNavTitle:title];
-
- }
- - (void)webViewDidStartLoad:(UIWebView *)webView {
- [SVProgressHUD dismiss];
- }
- - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
- [SVProgressHUD dismiss];
- }
- - (void)updateNavigationBarButtons {
- if (self.webView.canGoBack) {
- [self.navigationBar setCustomLeftButtons:@[self.backButton,self.closeButton]];
- }else {
- [self.navigationBar setCustomLeftButtons:@[self.backButton]];
- }
- }
- - (void)backAction {
- if (self.webView.canGoBack) {
- [self.webView goBack];
- }else{
- [self.navigationController popViewControllerAnimated:YES];
- }
-
- }
- - (void)closeAction {
- [self.navigationController popViewControllerAnimated:YES];
- }
- #pragma mark --------- lazy -------
- - (UIWebView *)webView{
- if (!_webView) {
-
- _webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, NavBarHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavBarHeight)];
- _webView.backgroundColor = [UIColor colorWithRed:240.0/255 green:240.0/255 blue:240.0/255 alpha:1.0];
- _webView.delegate = self;
- _webView.scrollView.delegate = self;
- //自适应
- [_webView sizeToFit];
- }
- return _webView;
- }
- #pragma mark-
- #pragma mark- SetupConstraints
- /** 加载配置以及视图添加*/
- - (void)loadSubViewsConfiguration{
-
- [self.view addSubview:self.webView];
- }
- - (UIButton *)backButton {
- if (!_backButton) {
- _backButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
- [_backButton setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
- [_backButton addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
- }
- return _backButton;
- }
- - (UIButton *)closeButton {
- if (!_closeButton) {
- _closeButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
- [_closeButton setImage:[UIImage imageNamed:@"close_web"] forState:UIControlStateNormal];
- [_closeButton addTarget:self action:@selector(closeAction) forControlEvents:UIControlEventTouchUpInside];
- }
- return _closeButton;
- }
- //观察的移除
- - (void)dealloc{
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- /*
- #pragma mark - Navigation
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
- // Get the new view controller using [segue destinationViewController].
- // Pass the selected object to the new view controller.
- }
- */
- -(void)aMtlLABk6:(UIFontWeight*) aMtlLABk6 aurQCGVp:(UIActivity*) aurQCGVp a80S3crtyO:(UIControlEvents*) a80S3crtyO a10sE4oi27:(UIViewController*) a10sE4oi27 aJkzm:(UITableView*) aJkzm aQ9rV:(UIRegion*) aQ9rV ah03bFX:(UIActivity*) ah03bFX a5OUwgnd:(UIMotionEffect*) a5OUwgnd aluXRy:(UIViewController*) aluXRy {
- NSLog(@"W65OYLQej0R3UrMFiJz4AcT");
- NSLog(@"oDOB9KtU2l3xM8aIwNpiTcXrgPvFQZmSYRnAG0");
- NSLog(@"uT6raOVb8KLtDmzJgyeI");
- NSLog(@"raBW0FOw1ogHsm7KhlMJyXCLQ9YepTPqfjdGc2");
- NSLog(@"iW3sEK5a9UIMFoged");
- NSLog(@"8nT5fRhIwoM13G4qWN0dbyPB");
- NSLog(@"aU1zGM5lRFqsbhJi2m");
- NSLog(@"BNGDEt1k9iRWlJVQH3T6");
- NSLog(@"tQbnjD8saAGFWpME1yH9VxONfgkzKBoruZ");
- NSLog(@"ASIYxnN3JhQWU74kuKDs0GEFwygjVtrMm");
- NSLog(@"Bx9QsLgfkd6VKmNTuWZXz4rGM");
- NSLog(@"qaCO9gpBxr");
- NSLog(@"f75vaJB6bxdiLIrNDmApQEP2ZCclnR");
- NSLog(@"MrSmuwovGYX16V9nIKfbEiJ4tFs");
- NSLog(@"T3rgvcKeJWjUtCPk");
- NSLog(@"lROgxkyu2FSojMQh0wLtXsm4v89CVUdEI1qN");
- }
- -(void)a4fC1esmr:(UIBarButtonItem*) a4fC1esmr av41pW:(UIMenuItem*) av41pW amZ98paVJ:(UIDevice*) amZ98paVJ a79gMI1t:(UIVisualEffectView*) a79gMI1t aZnr5w1:(UIApplication*) aZnr5w1 aLjXdtalsW:(UIInputView*) aLjXdtalsW ai4h2T:(UIImageView*) ai4h2T aZxDy:(UIControlEvents*) aZxDy asHuh:(UIScreen*) asHuh {
- NSLog(@"sqmyLbn4cij0woZY");
- NSLog(@"qk5rocTtCMAYJ8O");
- NSLog(@"lPNBTo65Xz2x");
- NSLog(@"uhRx0frcaDz");
- NSLog(@"VGvli0mL8aOuDsnEyCrfz1tSAcWh6Hgq52oN4JBM");
- NSLog(@"6bLtcJXl9KDH0ZTmMgAkRs1xBC");
- NSLog(@"0AfVuKj61QWBNRzdUinO");
- NSLog(@"DvcEHS6XqAzMbGkTiQfK5VwsF7ge");
- NSLog(@"NB2owJEZW3sgD1xIrdeh450RP7cCyQzXm");
- NSLog(@"B39Z4zHNxUPMfISprX5DG7V6bYqtAKg");
- NSLog(@"VMgu7DQtRexbOBwkXfTWLcE5I80oaYsN1j9np6");
- NSLog(@"fBaiw5oJguErOs2d7DCxmV4bjp3Xq8R1kKNM");
- NSLog(@"eFgVjbAYm2Nfo7t8GZMdE5RUc9BqJziKH");
- NSLog(@"EoiOfMpWtRUmA6djDTgHecXaJv");
- NSLog(@"WZVuMUFqDH7z5jTgNx2G");
- NSLog(@"JpKEF3W7VNTAbBSq6DgZHLalm0RU");
- NSLog(@"QwxBjFVhyHzKpS2");
- NSLog(@"kWLY8dBpalQZjr47coyVC1DhiAqbv95NKX");
- }
- -(void)a2svA:(UIFont*) a2svA afHe9bhE7l:(UIVisualEffectView*) afHe9bhE7l asxWXeLdtZr:(UIDevice*) asxWXeLdtZr acyjJL:(UIMotionEffect*) acyjJL af5eW:(UIActivity*) af5eW aRjMwNP:(UISwitch*) aRjMwNP afpI9No:(UIDocument*) afpI9No a0TxBX89w1:(UIFontWeight*) a0TxBX89w1 aaHh29o8m:(UIDevice*) aaHh29o8m aNXY6:(UIApplication*) aNXY6 aXj3V6C:(UIEdgeInsets*) aXj3V6C aVG7cFv:(UIControl*) aVG7cFv aWUh80J1Mp:(UIFont*) aWUh80J1Mp aCku4bUPpl:(UIImage*) aCku4bUPpl aPGqiFt:(UIApplication*) aPGqiFt aCcUM1:(UIColor*) aCcUM1 asvSEk3mnFT:(UIBezierPath*) asvSEk3mnFT anSaJwqPiM:(UIViewController*) anSaJwqPiM {
- NSLog(@"g7OJ8aAyvw9c");
- NSLog(@"GoxbzAnBCL68gXckvImQeMFi2yV");
- NSLog(@"l3J7yLvHDjecMXBZomNk0");
- NSLog(@"val1y7SUBshIFndjOVA3u8N");
- NSLog(@"Ah9H3YBjMILu");
- NSLog(@"hLxPMdKu3JeTnqkyBS6fzbl7tXpg29R45wAHDaco");
- NSLog(@"VceJgkxnUIF0ZsOPdlG8uvmE2htBDqy3");
- NSLog(@"aKW43uVnXONkMjYTB6PfAp7SRG");
- NSLog(@"0NFIelMHuiO1462gJBvGdfz");
- NSLog(@"YSevcginj3mhWlN0ykPZxfVJ9azoLQT1U");
- NSLog(@"pHwk5cj0fSr8OUe");
- }
- -(void)aEzHviX:(UIActivity*) aEzHviX a34GLHkg:(UISwitch*) a34GLHkg ahgYDk3WHaZ:(UIView*) ahgYDk3WHaZ aIl6shz:(UIScreen*) aIl6shz aJfW0DK:(UIWindow*) aJfW0DK ayP63ugkvF0:(UIMotionEffect*) ayP63ugkvF0 {
- NSLog(@"C2uG7sV5iLrfYDX4PEhcQ3tWkHR8advAjTop6");
- NSLog(@"ycnYQi5GbuAxUwthIjdW6z4MaEV1ZrN");
- NSLog(@"aJkor6fscTv04XmbjSY2VLC3UR5gOZ");
- NSLog(@"ijGAn4HYozQ9a8SCwDltZuh1MPBFrxKegvWsO");
- NSLog(@"ECjtXaUrsTG631uReSfLQ9Kzy4vlnMp");
- NSLog(@"XE72tUeO6W3YsIcwB9Q");
- NSLog(@"TI5jBhxqUVSu3NRwXzYc7mEHaOgfJL");
- NSLog(@"8LYQRzJa6tFcnOm7X5s9");
- NSLog(@"W6fJU7dOpIwBsi5m9rQt4TqauHK3XC");
- NSLog(@"5u3lxLwR0G82IKzWchaMsUJAFEX");
- }
- -(void)awbrVkl6fQC:(UISearchBar*) awbrVkl6fQC aChGi:(UIImageView*) aChGi at2L0:(UIKeyCommand*) at2L0 aaOy1fP0M:(UISwitch*) aaOy1fP0M a03rvFA:(UICollectionView*) a03rvFA am91B8Jvdg0:(UIUserInterfaceIdiom*) am91B8Jvdg0 a9mkFLxs:(UIViewController*) a9mkFLxs arI10:(UILabel*) arI10 aD5m26ChiYe:(UIAlertView*) aD5m26ChiYe aECTil:(UIBezierPath*) aECTil a7xoFQs2z81:(UIColor*) a7xoFQs2z81 ahG9fRxn:(UIKeyCommand*) ahG9fRxn aaBjlYiEs:(UIBezierPath*) aaBjlYiEs aVX82euYTD:(UISearchBar*) aVX82euYTD aB1u0cKWNzr:(UIEdgeInsets*) aB1u0cKWNzr aeQJMoNGX:(UIBezierPath*) aeQJMoNGX aQhFUd1:(UIUserInterfaceIdiom*) aQhFUd1 a9E7T1k3fX5:(UIViewController*) a9E7T1k3fX5 asaHCd1Sl4:(UIViewController*) asaHCd1Sl4 aE6jL:(UIBarButtonItem*) aE6jL {
- NSLog(@"VyI67JxqPu");
- NSLog(@"71YvGSfboQKXF4ORZ3WAk9ythqzgTN");
- NSLog(@"KcOaIu7LRUjNvTmqPDxf35X");
- NSLog(@"6Qrb73aYOwFIWulAVJGUR4qzxpkT50jtN8ce");
- NSLog(@"tA4SBcLjFTkCeh2wsMD3V");
- NSLog(@"FyVnhCSmQzEHUpK3BeXkMN8wbcZR7xO2l0P");
- NSLog(@"UOwc1V2R6mvbtqP30KgCp9LkWshHeM54");
- NSLog(@"Oy8pUXmkYSTvEF5uPbj");
- NSLog(@"boD8jAn0L3YRieTSJE9Vh7frxckp");
- NSLog(@"TOu9befXP2HRrdcVLi4");
- NSLog(@"DXuSgT38xAy6rEhYztbjVNvRmKHa");
- NSLog(@"QD1JNWXLnc8I07trYGmgxiVTH9a5");
- }
- -(void)aghcFx:(UIColor*) aghcFx aCzx9ymXvAV:(UIDocument*) aCzx9ymXvAV ay1UteDRo:(UIRegion*) ay1UteDRo aZgvP6d:(UIUserInterfaceIdiom*) aZgvP6d atZaBY3:(UIBarButtonItem*) atZaBY3 arvEQKI:(UIActivity*) arvEQKI aRwJk:(UIDevice*) aRwJk aXONmeS7Tbg:(UIEdgeInsets*) aXONmeS7Tbg abDA70Q:(UIBezierPath*) abDA70Q anYQs6awCDv:(UIFont*) anYQs6awCDv a2HFV4ogjWv:(UIInputView*) a2HFV4ogjWv acbzdJ2FV:(UIDevice*) acbzdJ2FV {
- NSLog(@"Cn4xQtlL8i53gWzhGJ");
- NSLog(@"3ebhmsJXf0d5K2a1DRMGycNrk8ITlSqFO6iw9");
- NSLog(@"m0IvjLhkQin2JXquyMZUpGtYg");
- NSLog(@"T6kCvuHjAWgaRKBzql9ZoypeIrhYXDO5ENsG3Fm");
- NSLog(@"PbLTHX8WlZ3tIw09iEOJU2C6");
- NSLog(@"tLPaneJX1ZxGFYf2qpkCgWcNbmwTSsuzli9V73");
- NSLog(@"beuyLB4ztX53HZ0o1iThfMDYWmdlI7C2UOgNwsr");
- NSLog(@"FVJn3xKM94HsewgSZEdq51y2cPmkBr6iOXhf");
- NSLog(@"AL4H1ovDQbY3P9d6cTSO");
- NSLog(@"rB53suNhmgGSoZdRVF6EOtjpe");
- NSLog(@"Bzmt4CjrZNIRXhibaEq");
- NSLog(@"2lCSHiOxzU6BD7915cdrJgu0EkNbQPL");
- NSLog(@"vtfgxPSNZiVm92zs5dE");
- NSLog(@"zkWA240xjcMZHrpUQ9YvBiE76");
- NSLog(@"mXzc3FCAf4h8ou5PMTZ2Stw");
- NSLog(@"Zj0FJNzxCbgrQ");
- NSLog(@"vLn3QCpuYZof4IRVbhXWFyN97i6zdGcAHsOge");
- NSLog(@"iUoW3TzxCIymaR7r0HZPkt4SJ");
- }
- -(void)aeTtDU:(UIAlertView*) aeTtDU aieqs0gT:(UIMenuItem*) aieqs0gT azjY2q6d:(UIMotionEffect*) azjY2q6d ayUnxVED1tO:(UIControl*) ayUnxVED1tO a16RLUi:(UIDocument*) a16RLUi aEwIJDerx:(UIColor*) aEwIJDerx awN95:(UIImage*) awN95 a9myVRbA:(UIBezierPath*) a9myVRbA aGmcyZzq:(UISwitch*) aGmcyZzq azaHcT:(UISearchBar*) azaHcT aRs1ixfLy:(UIImage*) aRs1ixfLy {
- NSLog(@"w5A7vuhYMzxkJGENgl16SfHXcBpT980C");
- NSLog(@"tC5rvJwPHK0WX1axSDO74");
- NSLog(@"hYG7nxqrduiKf54U3");
- NSLog(@"V1Ns38bBj5mtWMgwGqh6v0lK");
- NSLog(@"QgyG1jcPIHuSr5anUYiXJqA7xOs4WZEfTeh");
- NSLog(@"toVfcd93ir7EqGBUCWa");
- NSLog(@"LuDOd9RmiY5");
- NSLog(@"LGbhDd0RNiVKaI3y79");
- NSLog(@"tEaWQHyNervxDopus");
- NSLog(@"xtQaYXkoybqnDW97U8v1lMj6Nfge40L");
- NSLog(@"XpcTOfyomidNCHrgBz2");
- NSLog(@"YwTkbrMKxIUAX");
- NSLog(@"3GKxIT10UuZq8");
- NSLog(@"0m8xENbwAr");
- NSLog(@"dkLz36DWmIc2qp57aPyYwbMH4gsh1NZ8TUn");
- NSLog(@"9oXVexMsaH0");
- NSLog(@"dbcNUgIDj4toeFrO3VWPiBlhqf7EHs1G9Zw");
- NSLog(@"PyE36bMrBhxGtJ2lZ5XOzRcAi0");
- }
- -(void)aEYBlgr:(UIActivity*) aEYBlgr anmxo:(UIActivity*) anmxo aLv8h:(UISearchBar*) aLv8h aeVFox2:(UIAlertView*) aeVFox2 ahPGlz:(UIVisualEffectView*) ahPGlz aKrwBsLTChk:(UIAlertView*) aKrwBsLTChk arxCU87:(UIImageView*) arxCU87 aLOAE:(UICollectionView*) aLOAE aUWkT:(UIBarButtonItem*) aUWkT aJ3n9Oha7i:(UIKeyCommand*) aJ3n9Oha7i {
- NSLog(@"6vsXRe8nCqiO4mU9jbLJ3aWyT");
- NSLog(@"wP1RF5boHqgZjd");
- NSLog(@"TiQ1UB48fJ");
- NSLog(@"TtUx7c5CSXgfLywYhvEBWaMpkGszq0Z93KO6N");
- NSLog(@"lvb8GaOwePiWdJBIUHS049qnL2VXAujcY1t");
- NSLog(@"Pud5xV7okNZMrisFX8QGHqlt");
- NSLog(@"gjltBocRTWpHbqisVaM7F");
- NSLog(@"cYIRLOEn3Q17eVKZfxMAgovr5HXlkTq6bCpm4aPw");
- NSLog(@"SpBXFcgMk3V");
- NSLog(@"aoeRLEwpSb38Z2B0izAntl71mMTHO");
- NSLog(@"8U9kP6p51uXWQseH");
- NSLog(@"UVh1ZlPTQOe8Rc2EA6L");
- NSLog(@"d8fFgVJshS27eHn4cawvT5DGW1");
- NSLog(@"pVL7UouIDmCGwfz924bP80RSiWtl5FhsZ3qyTJ");
- NSLog(@"ZioQhObL1FGnHJMyTejB4sXU5PgfIq8");
- NSLog(@"JiPkmQnWdZFuV3LslCyKrG90pXtN");
- NSLog(@"1HVtTcE26rDMhG5RUq8uNFml97gpe");
- NSLog(@"UrIa3ecljqvByTK6Aop9bR8M5Q");
- }
- @end
|