加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

聚合数据iOS SDK 全国车辆违章 演示示例

发布时间:2020-12-13 22:44:57 所属栏目:百科 来源:网络整理
导读:1,将聚合数据SDK(JuheApis.framework)添加到你的程序中来,SDK依赖的包包括: 650) this.width=650;" src="http://img.jb51.cc/vcimg/static/loading.png" alt="" style="border:0px;" src="http://yspe2371e4aa7697989.yunshipei.cn/dHlwZT1mdyZzaXplPTc

1,将聚合数据SDK(JuheApis.framework)添加到你的程序中来,SDK依赖的包包括:


2,在聚合SDK Framework的JHSDKAPIPath.h文件中找到快递查询接口宏,以及字典参数

/**
@brief 车辆违章查询--1、获取支持城市接口

wKiom1Q4wAzR-5wHAADN0khBXwA835.jpg

*/
#define kJHAPIS_LIFE_WZ_CITYS @"juhe.apis.wz.citys" //1、获取支持城市接口

@brief 车辆违章查询--2、请求违章查询接口

wKioL1Q4wEOwgh84AAGY9QJ9Q7A963.jpg

#define kJHAPIS_LIFE_WZ_QUERY @"juhe.apis.wz.query" //2、请求违章查询接口
@brief 车辆违章查询--3、车辆(号牌)种类编号查询接口

wKiom1Q4wAzzfZYcAACS11lIPIk717.jpg

#define kJHAPIS_LIFE_WZ_HPZL @"juhe.apis.wz.hpzl" //3、车辆(号牌)种类编号查询接口
@brief 车辆违章查询--4、接口剩余次数查询

wKioL1Q4wEPCNZQpAABIXxknGus632.jpg

#define kJHAPIS_LIFE_WZ_STATUS @"juhe.apis.wz.status" //4、接口剩余次数查询

3,接口在程序中调用方法(将ViewController.m改为.mm)

#import "ViewController.h"

#import <JuheApis/JuheAPI.h>
#import <JuheApis/JHOpenidSupplier.h>
#import <JuheApis/JHSDKAPIPath.h>

@interface ViewController ()
@end

@implementation ViewController

- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view,typically from a nib.
[[JHOpenidSupplier shareSupplier] registerJuheAPIByOpenId:@"申请到的OpenId“];

UIButton* beginBtn=[UIButton buttonWithType:UIButtonTypeSystem];
beginBtn.frame=CGRectMake(20,111,280,40);
[beginBtn setTitle:@"开始" forState:UIControlStateNormal];
[beginBtn setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
[beginBtn addTarget:self action:@selector(doTestAction) forControlEvents:UIControlEventTouchUpInside];
[beginBtn setBackgroundImage:[UIImage imageNamed:@"button5"] forState:UIControlStateNormal];
[self.view addSubview:beginBtn];
}

- (void)doTestAction
{
/* 1、获取支持城市接口 */
[self test : kJHAPIS_LIFE_WZ_CITYS parameters : @{@"province":@"JS",@"dtype":@"json"} ] ;
/* 2、请求违章查询接口 */
[self test : kJHAPIS_LIFE_WZ_QUERY parameters : @{@"dtype":@"json",@"city":@"SH",@"hphm”:@“苏L50A11",@"hpzl":@"02"}] ;

/* 3、车辆(号牌)种类编号查询接口 */
[self test : kJHAPIS_LIFE_WZ_HPZL parameters : @{@"dtype":@"json" }];

/* 4、接口剩余次数查询 */
[self test : kJHAPIS_LIFE_WZ_STATUS parameters : @{@"dtype":@"json" }];


}

- (void)test:(NSString *)path parameters:(NSDictionary *)parameters{

JuheAPI *juheapi = [JuheAPI shareJuheApi];
[juheapi executeWorkWithAPI:path
parameters:parameters
success:^(id responSEObject){
if ([[parameters objectForKey:@"dtype"] isEqualToString:@"xml"]) {
NSLog(@"***xml*** n %@",responSEObject);
}else{
int error_code = [[responSEObject objectForKey:@"error_code"] intValue];
if (!error_code) {
NSLog(@" %@",responSEObject);
}else{
NSLog(@" %@",responSEObject);
}
}

} failure:^(NSError *error) {
NSLog(@"error: %@",error.description);
}];
}

- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

@end


4,全国车辆违章接口返回数据说明以及错误码说明


1 . API : juhe.apis.wz.citys (宏 : kJHAPIS_LIFE_WZ_CITYS )

wKiom1Q4wJvi0gTKAAJSol13vNw630.jpg

2 . API : juhe.apis.wz.query (宏 : kJHAPIS_LIFE_WZ_QUERY )


wKioL1Q4wNOCOSC4AAHRD02ZIk8212.jpg

3 . API : juhe.apis.wz.hpzl (宏 : kJHAPIS_LIFE_WZ_HPZL )


wKiom1Q4wJyj407dAACziR5Thcg386.jpg

4 . API : juhe.apis.wz.status (宏 : kJHAPIS_LIFE_WZ_STATUS )

wKioL1Q4wNOgDBV0AACndBTZzdI963.jpg

错误码


wKiom1Q4wJyR9cUlAAEZ-tdi8yM006.jpg

5,更多聚合数据SDK接口,访问这里: http://www.juhe.cn/juhesdk/idocs

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读