// // KeHuBianMaSearchTC.m // IBOSSIPAD // // Created by iHope on 14-8-14. // Copyright (c) 2014年 elongtian. All rights reserved. // #import "CustomerCodeSearchVC.h" #import "ChannelSearchVC.h" #import "CustomerTypeSearchVC.h" @interface CustomerCodeSearchVC(){ UITextField *txtCode; UITextField *txtCustomerName; UIButton *_btnSearch; } @property(nonatomic,strong) ASIDownManager *mDownManager; @property(strong) IBOutlet UISearchBar *searchBar; @property(strong) UITableView *tableView; @end @implementation CustomerCodeSearchVC #pragma mark - 公共函数 /** viewDidLoad函数 */ - (void)viewDidLoad { [super viewDidLoad]; self.navigationItem.title=@"客户编码"; UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; [button setBackgroundImage:[UIImage imageNamed:@"icon_back"] forState:UIControlStateNormal]; [button addTarget:self action:@selector(goBack) forControlEvents:UIControlEventTouchUpInside]; button.frame = CGRectMake(0, 0, 15, 18); UIBarButtonItem *menuButton = [[UIBarButtonItem alloc] initWithCustomView:button]; self.navigationItem.leftBarButtonItem = menuButton; self.navigationController.navigationBar.barTintColor = NavigationBarTintColor; self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor],NSFontAttributeName : [UIFont boldSystemFontOfSize:16]}; _tableView=[UITableView new]; _tableView.delegate=self; _tableView.dataSource=self; _tableView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth; _tableView.separatorStyle=UITableViewCellSeparatorStyleNone; _tableView.frame=CGRectMake(0, 0, Screen_Width, Screen_Height-40) ; [self.view addSubview:_tableView]; _searchBar=[[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)]; _searchBar.delegate=self; [self initHeaderView]; } /** 修改:2017-9-25 适配机型 安全区视图发生变化 */ -(void)viewSafeAreaInsetsDidChange{ _tableView.frame = CGRectMake(0, 0, SCREENWIDTH, self.view.safeAreaLayoutGuide.layoutFrame.size.height-40);; _btnSearch.frame=CGRectMake(20, self.view.safeAreaLayoutGuide.layoutFrame.size.height-40,Screen_Width-40,35); [super viewSafeAreaInsetsDidChange]; } /** 初始化函数 */ -(id)init { self =[super init]; if(self){ _channelStr=@""; _customerTypeStr=@""; } return self; } /** 取消进度条函数 */ -(void)dealloc { [self cancel]; } #pragma mark - 委托函数 //客户编码数据加载完成 - (void)onLoadFinish:(ASIDownManager *)sender { NSDictionary *dic = [sender.mWebStr JSONValue]; [self cancel]; if (dic && [dic isKindOfClass:[NSDictionary class]]) { int iStatus = [[dic objectForKey:@"Status"] intValue]; NSString *message=[dic objectForKey:@"Message"]; if (iStatus == 0) { NSArray * approvArr=[dic objectForKey:@"Result"]; if(approvArr!=nil) { if(approvArr!=nil&&approvArr.count>0){ _searchArr=[[NSMutableArray alloc] init]; for(int i=0;i