彙總資料iOS SDK 全國車輛違章 示範樣本

來源:互聯網
上載者:User

標籤:車輛違章   快遞查詢   違章查詢   程式   介面   api   

1,將彙總資料SDK(JuheApis.framework)添加到你的程式中來,SDK依賴的包包括:

650) this.width=650;" src="http://yspe2371e4aa7697989.yunshipei.cn/dHlwZT1mdyZzaXplPTcyMCZzcmM9YUhSMGNDVXpRU1V5UmlVeVJtbHRaeTVpYkc5bkxtTnpaRzR1Ym1WMEpUSkdNakF4TkRFd01Ea3hNREEyTkRRM05qVWxNMFozWVhSbGNtMWhjbXNsTWtZeUpUSkdkR1Y0ZENVeVJtRklVakJqUkc5MlRESktjMkl5WTNWWk0wNXJZbWsxZFZwWVVYWlZNamw1WWpOT1dDVXlSbVp2Ym5RbE1rWTFZVFpNTlV3eVZDVXlSbVp2Ym5SemFYcGxKVEpHTkRBd0pUSkdabWxzYkNVeVJra3dTa0pSYTBaRFRVRWxNMFFsTTBRbE1rWmthWE56YjJ4MlpTVXlSamN3SlRKR1ozSmhkbWwwZVNVeVJsTnZkWFJvUldGemRBPT0=" style="border:0px;" />


2,在彙總SDK Framework的JHSDKAPIPath.h檔案中找到快遞查詢介面宏,以及字典參數

/**
@brief 車輛違章查詢--1、擷取支援城市介面

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/4C/33/wKiom1Q4wAzR-5wHAADN0khBXwA835.jpg" style="float:none;" title="1.png" alt="wKiom1Q4wAzR-5wHAADN0khBXwA835.jpg" />

*/
#define kJHAPIS_LIFE_WZ_CITYS @"juhe.apis.wz.citys" //1、擷取支援城市介面

/**
@brief 車輛違章查詢--2、請求違章查詢介面

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/4C/34/wKioL1Q4wEOwgh84AAGY9QJ9Q7A963.jpg" style="float:none;" title="2.png" alt="wKioL1Q4wEOwgh84AAGY9QJ9Q7A963.jpg" />

*/
#define kJHAPIS_LIFE_WZ_QUERY @"juhe.apis.wz.query" //2、請求違章查詢介面

/**
@brief 車輛違章查詢--3、車輛(號牌)種類編號查詢介面

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/4C/33/wKiom1Q4wAzzfZYcAACS11lIPIk717.jpg" style="float:none;" title="3.png" alt="wKiom1Q4wAzzfZYcAACS11lIPIk717.jpg" />

*/
#define kJHAPIS_LIFE_WZ_HPZL @"juhe.apis.wz.hpzl" //3、車輛(號牌)種類編號查詢介面

/**
@brief 車輛違章查詢--4、介面剩餘次數查詢

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/4C/34/wKioL1Q4wEPCNZQpAABIXxknGus632.jpg" style="float:none;" title="4.png" alt="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 ) 

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/4C/33/wKiom1Q4wJvi0gTKAAJSol13vNw630.jpg" style="float:none;" title="1.png" alt="wKiom1Q4wJvi0gTKAAJSol13vNw630.jpg" />

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


650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/4C/34/wKioL1Q4wNOCOSC4AAHRD02ZIk8212.jpg" style="float:none;" title="2.png" alt="wKioL1Q4wNOCOSC4AAHRD02ZIk8212.jpg" />

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


650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/4C/33/wKiom1Q4wJyj407dAACziR5Thcg386.jpg" style="float:none;" title="3.png" alt="wKiom1Q4wJyj407dAACziR5Thcg386.jpg" />

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

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/4C/34/wKioL1Q4wNOgDBV0AACndBTZzdI963.jpg" style="float:none;" title="4.png" alt="wKioL1Q4wNOgDBV0AACndBTZzdI963.jpg" />

錯誤碼 


650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/4C/33/wKiom1Q4wJyR9cUlAAEZ-tdi8yM006.jpg" style="float:none;" title="5.png" alt="wKiom1Q4wJyR9cUlAAEZ-tdi8yM006.jpg" />

5, 更多彙總資料SDK介面,訪問這裡: http://www.juhe.cn/juhesdk/idocs

彙總資料iOS SDK 全國車輛違章 示範樣本

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.