//
//  trafficViewController.m
//  Open
//
//  Created by 看看智能 on 2017/2/17.
//  Copyright © 2017年 黄江涛 . All rights reserved.
//

#import "trafficViewController.h"

@interface trafficViewController ()
@property (strong, nonatomic) IBOutletCollection(UIButton) NSArray *allButtons;

@end

@implementation trafficViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)trafficWebView:(UIButton*)sender {

    NSInteger index =[self.allButtons indexOfObject:sender];
    switch (index) {
        case 0:
            [self jumpToHTML5:@"https://m.ctrip.com/html5/Flight/?allianceid=452800&sid=949980&sourceid=2055&popup=close&autoawaken=close"];
            break;
        case 1:
                        [self jumpToHTML5:@"https://m.ctrip.com/webapp/train/?allianceid=452800&sid=949980&sourceid=2055&popup=close&autoawaken=close&hiderecommapp=1"];
            break;
            
            case 2:
                        [self jumpToHTML5:@"https://m.ctrip.com/webapp/bus/?allianceid=452800&sid=949980&sourceid=2055&popup=close&autoawaken=close"];
            break;
        case 3:
            [self jumpToHTML5:@"http://m.qiche100.cn"];
            break;
        default:
            break;
    }
    
    
    
}
-(void)jumpToHTML5:(NSString*)url
{
    WebViewController *tc=[WebViewController new];
    tc.URL =[NSURL URLWithString:url];
    [self.navigationController pushViewController:tc animated:YES];
    
}
/*
#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.
}
*/

@end
