#pragma mark JS调用OC
- (void)JavaScriptGetOc{
JSContext *content = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
content[@"readCarPhoto"] = ^() {
// NSString *jsonStr=[NSString StingByJson:self.array];
// [webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"readDetailReport('%@')",jsonStr]];//OC掉JS并传值给它
NSArray *args = [JSContext currentArguments];
for (id obj in args) {
ZSLOG(@"%@",obj);
}
};
/******************************JS调OC********************************/
content[@"readCarPhoto"] = ^() {//跳转查看车辆评估照片
[self goToAddCarImagVC];
};
content[@"readDetailReport"] = ^() {//跳转车鉴定报告
[self goToVehicleIdentification];
};
}