zjf
2023-03-06 244c476e2a717aede76d6bf036975df8c7d31309
企业编码更改逻辑
4 files modified
32 ■■■■■ changed files
IphoneBIMe/IphoneBIMe/Classes/Login/ViewControllers/PBEnterpriseCodeController.h 2 ●●● patch | view | raw | blame | history
IphoneBIMe/IphoneBIMe/Classes/Login/ViewControllers/PBEnterpriseCodeController.m 12 ●●●● patch | view | raw | blame | history
IphoneBIMe/IphoneBIMe/Classes/Login/ViewControllers/PBLoginViewController.m 17 ●●●● patch | view | raw | blame | history
IphoneBIMe/IphoneBIMe/Classes/Login/Views/PBInputCodeTableViewCell.m 1 ●●●● patch | view | raw | blame | history
IphoneBIMe/IphoneBIMe/Classes/Login/ViewControllers/PBEnterpriseCodeController.h
@@ -11,7 +11,7 @@
NS_ASSUME_NONNULL_BEGIN
@interface PBEnterpriseCodeController : UIViewController
@property (nonatomic, copy) void (^SetCodeBlock)(NSDictionary *obj);
@property (nonatomic, copy) void (^SetCodeBlock)(NSString *code, NSDictionary *obj);
@property (nonatomic, copy) void (^UpdataCodeBlock)(NSInteger index);
@property (nonatomic, copy) void (^DeleteCodeBlock)(NSInteger index);
@end
IphoneBIMe/IphoneBIMe/Classes/Login/ViewControllers/PBEnterpriseCodeController.m
@@ -88,6 +88,7 @@
            [self getEnterpriseWithCode:code];
        };
        cell.SolveErr = ^{
            [self.inputCellDict setValue:@"" forKey:@"code"];
            [self.inputCellDict setValue:@"" forKey:@"err"];
        };
        return cell;
@@ -148,13 +149,6 @@
    if ([code isEqualToString:@""]) {
        return;
    }
    for (NSDictionary *obj in self.dataList) {
        NSString *haveCode = [obj valueForKey:@"Code"];
        if ([code isEqualToString:haveCode]) {
            [YJProgressHUD showMessage:@"已存在此编码" inView:self.view];
            return;
        }
    }
    [YJProgressHUD showProgress:@"" inView:self.view];
    [[PBNetworkTools sharedTools] RequestGetUrlsByCodeWithCode:code andCallBack:^(NSURLSessionDataTask *task, id response, NSError *error) {
        if (error) {
@@ -172,14 +166,14 @@
            [dictM setObject:code forKey:@"Code"];
            [dictM setObject:@"1" forKey:@"Check"];
            if (self.SetCodeBlock) {
                self.SetCodeBlock(dictM.copy);
                self.SetCodeBlock(code, dictM.copy);
            }
            NSArray *arr = [NSString getApiArrData];
            self.dataList = arr.mutableCopy;
            [self setHeaderViewCheck];
            [self.tableView reloadData];
        }else {
            [YJProgressHUD showMessage:networkModel.Msg inView:self.view];
            [YJProgressHUD showMessage:@"输入企业编码有误" inView:self.view];
            [self codeErrWith:code];
        }
    }];
IphoneBIMe/IphoneBIMe/Classes/Login/ViewControllers/PBLoginViewController.m
@@ -267,15 +267,24 @@
#pragma mark - 编辑企业码
- (void)codeBtnAction {
    PBEnterpriseCodeController *codeVC = [[PBEnterpriseCodeController alloc] init];
    codeVC.SetCodeBlock = ^(NSDictionary * _Nonnull obj) {
    codeVC.SetCodeBlock = ^(NSString * _Nonnull code, NSDictionary * _Nonnull obj) {
        self.customData = obj;
        NSMutableArray *arrM = [[NSMutableArray alloc] init];
        NSArray *arr = [NSString getApiArrData];
        BOOL isHave = false;
        for (NSDictionary *dict in arr) {
            [dict setValue:@"0" forKey:@"Check"];
            [arrM addObject:dict];
            NSString *haveCode = [dict valueForKey:@"Code"];
            if ([code isEqualToString:haveCode]) {
                [arrM addObject:obj];
                isHave = true;
            } else {
                [dict setValue:@"0" forKey:@"Check"];
                [arrM addObject:dict];
            }
        }
        [arrM addObject:self.customData];
        if (!isHave) {
            [arrM addObject:self.customData];
        }
        [self saveApiArr:arrM.copy];
        [self storedLocallyApiWithData:self.customData];
        [self setApi];
IphoneBIMe/IphoneBIMe/Classes/Login/Views/PBInputCodeTableViewCell.m
@@ -74,6 +74,7 @@
    self.logoImageV.image = [UIImage imageNamed:@"logo_unknown_nor"];
    if ([[_dict valueForKey:@"err"] isEqualToString:@"err"]) {
        [_dict setValue:@"" forKey:@"err"];
        [_dict setValue:@"" forKey:@"code"];
        self.codeBgV.backgroundColor = [UIColor whiteColor];
        self.codeTF.textColor = PBColor(40, 58, 79);
        if (self.SolveErr) {