|
@@ -315,23 +315,62 @@ bool isDownType = YES;
|
|
|
- (void)nextStep:(NSString *)sn{
|
|
|
|
|
|
KWeakSelf
|
|
|
- [[connectDeviceManager shareInstance] getThridMsgBySN:sn needReconnect:NO didNetEnd:^(NSInteger didSuc) {
|
|
|
- if(didSuc == 1){
|
|
|
- [weakSelf gotoGuideViewFunBy:sn];
|
|
|
- }else{
|
|
|
-// if(didSuc == 2){
|
|
|
-// [[iToast makeText:NSLocalizedString(@"scan_sn_data_error_tip",nil)] show];
|
|
|
-// }
|
|
|
-// else{
|
|
|
-// [[iToast makeText:NSLocalizedString(@"guide_qrcoede_tips_get_SdnID_fail",nil)] show];
|
|
|
+// [[connectDeviceManager shareInstance] getThridMsgBySN:sn needReconnect:NO didNetEnd:^(NSInteger didSuc) {
|
|
|
+// if(didSuc == 1){
|
|
|
+// [weakSelf gotoGuideViewFunBy:sn];
|
|
|
+// }else{
|
|
|
+//// if(didSuc == 2){
|
|
|
+//// [[iToast makeText:NSLocalizedString(@"scan_sn_data_error_tip",nil)] show];
|
|
|
+//// }
|
|
|
+//// else{
|
|
|
+//// [[iToast makeText:NSLocalizedString(@"guide_qrcoede_tips_get_SdnID_fail",nil)] show];
|
|
|
+//// }
|
|
|
+// if(self->_didScanErrorFun){
|
|
|
+// self->_didScanErrorFun(didSuc);
|
|
|
// }
|
|
|
+// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
+// [self.navigationController popViewControllerAnimated:YES];
|
|
|
+// });
|
|
|
+// }
|
|
|
+// }];
|
|
|
+
|
|
|
+ [[netWorkManager shareInstance] getThridMsgBySN:sn success:^(id _Nonnull responseObject) {
|
|
|
+ DeviceThirdIdModel *model = responseObject;
|
|
|
+ if([model isKindOfClass:[DeviceThirdIdModel class]]){
|
|
|
+
|
|
|
+ if(model.status == 0 && model.data){
|
|
|
+ [weakSelf gotoGuideViewFunBy:sn];
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ NSInteger state = 2;
|
|
|
+ if (model.status == 201 || model.status == 202) {
|
|
|
+ state = model.status;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(self->_didScanErrorFun){
|
|
|
+ self->_didScanErrorFun(state);
|
|
|
+ }
|
|
|
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
+ [self.navigationController popViewControllerAnimated:YES];
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else{
|
|
|
if(self->_didScanErrorFun){
|
|
|
- self->_didScanErrorFun(didSuc);
|
|
|
+ self->_didScanErrorFun(2);
|
|
|
}
|
|
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
[self.navigationController popViewControllerAnimated:YES];
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ } failure:^(NSError * _Nonnull error) {
|
|
|
+ if(self->_didScanErrorFun){
|
|
|
+ self->_didScanErrorFun(0);
|
|
|
+ }
|
|
|
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
+ [self.navigationController popViewControllerAnimated:YES];
|
|
|
+ });
|
|
|
}];
|
|
|
}
|
|
|
|