// // OrbitVC.m // jiaPeiC // // Created by apple on 16/9/12. // Copyright © 2016年 JCZ. All rights reserved. // #import "OrbitVC.h" #import @implementation OrbitVC - (void)viewDidLoad { [super viewDidLoad]; self.title = @"轨迹回放"; self.view.backgroundColor = backGroundColor; [self configNavBar]; [self getStudentTrack]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } -(void)creatWebViewWithUrlStr:(NSString *)urlStr { WKWebView *view = [[WKWebView alloc] initWithFrame:kFrame]; view.y += kNavOffSet; view.height = kSize.height - kNavOffSet; [self.view addSubview: view]; NSURLRequest *request = nil; request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@api/orderTrack?classId=%@&stuOutId=%@",urlStr,_classId,_stuOutId]]]; // NSLog(@"%@",request); if (![Util connectedToNetWork]) { showMsgUnconnect(); return; } [LoadingView showHUD]; [view loadRequest:request]; } - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{ RemoveHUD(); } - (void)getStudentTrack { [LoadingView showHUD]; if (![Util connectedToNetWork]) { showMsgUnconnect(); return; } NSMutableArray *arr=[NSMutableArray array]; [arr addPro:@"dqbh" Value:defUser.userDict[@"cityId"]]; NSString* method = @"getStudentTrack"; [jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary *root) { RemoveHUD(); if (!root) { ShowMsgFailed(); return; } if ([root[@"code"] isEqualToString:@"1"]) { ShowMsg(root[@"body"]); return; } NSString * str = root[@"body"]; [self creatWebViewWithUrlStr:str]; }]; } @end