diff --git a/Pods/WSProgressHUD/WSProgressHUD/WSProgressHUD.m b/Pods/WSProgressHUD/WSProgressHUD/WSProgressHUD.m index 3c4e66e..dd7d1a5 100644 --- a/Pods/WSProgressHUD/WSProgressHUD/WSProgressHUD.m +++ b/Pods/WSProgressHUD/WSProgressHUD/WSProgressHUD.m @@ -140,11 +140,13 @@ + (void)showWithStatus:(NSString *)string maskType:(WSProgressHUDMaskType)maskTy + (void)showSuccessWithStatus:(NSString *)string { + [WSProgressHUD setProgressHUDFont:[UIFont systemFontOfSize:17]]; [self showImage:WSProgressHUDSuccessDefaultImage() status:string]; } + (void)showErrorWithStatus:(NSString *)string { + [WSProgressHUD setProgressHUDFont:[UIFont systemFontOfSize:17]]; [self showImage:WSProgressHUDErrorDefaultImage() status:string]; } @@ -1395,7 +1397,7 @@ - (UIControl *)overlayView { - (UIImageView *)imageView { if (!_imageView) { - _imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 28, 28)]; + _imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 22, 22)]; _imageView.hidden = YES; } return _imageView; diff --git a/box-Authorizer.xcodeproj/project.pbxproj b/box-Authorizer.xcodeproj/project.pbxproj index 479aa9c..54f2ccf 100644 --- a/box-Authorizer.xcodeproj/project.pbxproj +++ b/box-Authorizer.xcodeproj/project.pbxproj @@ -19,6 +19,8 @@ 170D788B205F6B9E00916F25 /* CurrencyAccountTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 170D7882205F6B9E00916F25 /* CurrencyAccountTableViewCell.m */; }; 170D789A205F92AC00916F25 /* AboutBoxViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 170D7899205F92AC00916F25 /* AboutBoxViewController.m */; }; 170F392420B7BF2F00B98E93 /* UIButton+touch.m in Sources */ = {isa = PBXBuildFile; fileRef = 170F392320B7BF2F00B98E93 /* UIButton+touch.m */; }; + 1718EC8E2106DBC1005BDC24 /* languageSwitchTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 1718EC8D2106DBC1005BDC24 /* languageSwitchTableViewCell.m */; }; + 1719D421211803C600ED0917 /* libGprinterLabelPrinterSDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1719D420211803C600ED0917 /* libGprinterLabelPrinterSDK.a */; }; 171EA98E20B27E84006F53F1 /* AddressVerifyManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 171EA98D20B27E84006F53F1 /* AddressVerifyManager.m */; }; 171EA99120B2EB3D006F53F1 /* AgentStatusManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 171EA99020B2EB3D006F53F1 /* AgentStatusManager.m */; }; 171EC0E120A2A58500CA7F20 /* PassWordManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 171EC0E020A2A58500CA7F20 /* PassWordManager.m */; }; @@ -157,6 +159,11 @@ 170D7899205F92AC00916F25 /* AboutBoxViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AboutBoxViewController.m; sourceTree = ""; }; 170F392220B7BF2F00B98E93 /* UIButton+touch.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIButton+touch.h"; sourceTree = ""; }; 170F392320B7BF2F00B98E93 /* UIButton+touch.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIButton+touch.m"; sourceTree = ""; }; + 1718EC8C2106DBC1005BDC24 /* languageSwitchTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = languageSwitchTableViewCell.h; sourceTree = ""; }; + 1718EC8D2106DBC1005BDC24 /* languageSwitchTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = languageSwitchTableViewCell.m; sourceTree = ""; }; + 1719D41E211803C600ED0917 /* GprinterLabelPrinterBluetooth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GprinterLabelPrinterBluetooth.h; sourceTree = ""; }; + 1719D41F211803C600ED0917 /* GprinterLabelPrinterCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GprinterLabelPrinterCommand.h; sourceTree = ""; }; + 1719D420211803C600ED0917 /* libGprinterLabelPrinterSDK.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libGprinterLabelPrinterSDK.a; sourceTree = ""; }; 171EA98C20B27E84006F53F1 /* AddressVerifyManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddressVerifyManager.h; sourceTree = ""; }; 171EA98D20B27E84006F53F1 /* AddressVerifyManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddressVerifyManager.m; sourceTree = ""; }; 171EA98F20B2EB3D006F53F1 /* AgentStatusManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AgentStatusManager.h; sourceTree = ""; }; @@ -436,6 +443,7 @@ 1783572D205773AE00CD6FA8 /* libcrypto.a in Frameworks */, 402C032A7E658ECCBF3FB289 /* libPods-box-Authorizer.a in Frameworks */, 1783572E205773AE00CD6FA8 /* libssl.a in Frameworks */, + 1719D421211803C600ED0917 /* libGprinterLabelPrinterSDK.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -526,6 +534,8 @@ 17B4FFC520F5F3240040ED73 /* TransferCollectionViewCell.m */, 17B4FFCC20F5F3470040ED73 /* TransferTopView.h */, 17B4FFCB20F5F3470040ED73 /* TransferTopView.m */, + 1718EC8C2106DBC1005BDC24 /* languageSwitchTableViewCell.h */, + 1718EC8D2106DBC1005BDC24 /* languageSwitchTableViewCell.m */, ); path = Views; sourceTree = ""; @@ -603,6 +613,32 @@ path = Views; sourceTree = ""; }; + 1718EC852105C56C005BDC24 /* GprinterSDK */ = { + isa = PBXGroup; + children = ( + 1719D41C211803C600ED0917 /* include */, + 1719D420211803C600ED0917 /* libGprinterLabelPrinterSDK.a */, + ); + path = GprinterSDK; + sourceTree = ""; + }; + 1719D41C211803C600ED0917 /* include */ = { + isa = PBXGroup; + children = ( + 1719D41D211803C600ED0917 /* GprinterLabelPrinterSDK */, + ); + path = include; + sourceTree = ""; + }; + 1719D41D211803C600ED0917 /* GprinterLabelPrinterSDK */ = { + isa = PBXGroup; + children = ( + 1719D41E211803C600ED0917 /* GprinterLabelPrinterBluetooth.h */, + 1719D41F211803C600ED0917 /* GprinterLabelPrinterCommand.h */, + ); + path = GprinterLabelPrinterSDK; + sourceTree = ""; + }; 171EEA502050DC35002DABD3 /* ASE */ = { isa = PBXGroup; children = ( @@ -1024,6 +1060,7 @@ 5684457C2043B10D004891D8 /* globel */ = { isa = PBXGroup; children = ( + 1718EC852105C56C005BDC24 /* GprinterSDK */, 17835751205A288400CD6FA8 /* ManagerCommon */, 1783574620592AFA00CD6FA8 /* CIQRCode */, 178357302057757D00CD6FA8 /* OpenSSLManager */, @@ -1386,6 +1423,7 @@ 178357422057DAF400CD6FA8 /* PrintAlertView.m in Sources */, 171EEA8620513495002DABD3 /* BackupViewController.m in Sources */, 178357452058FAAA00CD6FA8 /* GenerateContractViewController.m in Sources */, + 1718EC8E2106DBC1005BDC24 /* languageSwitchTableViewCell.m in Sources */, 176402C9207F29B000E125B2 /* ApprovalBusinessTopView.m in Sources */, 17B4FFB120F5ED4C0040ED73 /* AssetAmountViewController.m in Sources */, 17A812B820FD86CA007A791A /* ApprovalBusinessFooterView.m in Sources */, @@ -1648,6 +1686,7 @@ "$(inherited)", "$(PROJECT_DIR)/box-Authorizer/TheThird/OpenSSL/lib", "$(PROJECT_DIR)/box-Authorizer/globel/OpenSSL/include", + "$(PROJECT_DIR)/box-Authorizer/globel/GprinterSDK", ); PRODUCT_BUNDLE_IDENTIFIER = com.2se.boxAuthorizer; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1686,6 +1725,7 @@ "$(inherited)", "$(PROJECT_DIR)/box-Authorizer/TheThird/OpenSSL/lib", "$(PROJECT_DIR)/box-Authorizer/globel/OpenSSL/include", + "$(PROJECT_DIR)/box-Authorizer/globel/GprinterSDK", ); PRODUCT_BUNDLE_IDENTIFIER = com.2se.boxAuthorizer; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/box-Authorizer.xcworkspace/xcuserdata/yuhuang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/box-Authorizer.xcworkspace/xcuserdata/yuhuang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 23e9a33..aa7bf5f 100644 --- a/box-Authorizer.xcworkspace/xcuserdata/yuhuang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/box-Authorizer.xcworkspace/xcuserdata/yuhuang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -3,22 +3,6 @@ type = "0" version = "2.0"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/box-Authorizer/Application/AppDelegate.m b/box-Authorizer/Application/AppDelegate.m index c1aeacb..8241f31 100755 --- a/box-Authorizer/Application/AppDelegate.m +++ b/box-Authorizer/Application/AppDelegate.m @@ -29,9 +29,20 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( [NSThread sleepForTimeInterval:2.0]; //网络监测 [self monitorReachabilityStatus]; + [self initIQKeyboardManager]; [self launchJumpVC]; return YES; } + +-(void)initIQKeyboardManager +{ + IQKeyboardManager *manager = [IQKeyboardManager sharedManager]; //处理键盘遮挡 + //[manager setCanAdjustTextView:YES]; + manager.enable = YES; + manager.shouldResignOnTouchOutside = YES; + manager.shouldToolbarUsesTextFieldTintColor = YES; + manager.enableAutoToolbar = YES; +} //启动跳转的VC -(void)launchJumpVC diff --git a/box-Authorizer/BaseClass/Models/CurrencyModel.h b/box-Authorizer/BaseClass/Models/CurrencyModel.h index ac60b6b..42c4092 100644 --- a/box-Authorizer/BaseClass/Models/CurrencyModel.h +++ b/box-Authorizer/BaseClass/Models/CurrencyModel.h @@ -17,6 +17,7 @@ @property (nonatomic,assign) BOOL select; @property (nonatomic,assign) NSInteger state; @property (nonatomic,strong) NSString *limit; +@property (nonatomic,strong) NSString *tokenAddr; - (instancetype)initWithDict:(NSDictionary *)dict; diff --git a/box-Authorizer/BaseClass/Models/CurrencyModel.m b/box-Authorizer/BaseClass/Models/CurrencyModel.m index 425a356..c0c808d 100644 --- a/box-Authorizer/BaseClass/Models/CurrencyModel.m +++ b/box-Authorizer/BaseClass/Models/CurrencyModel.m @@ -33,10 +33,14 @@ - (instancetype)initWithDict:(NSDictionary *)dict if(![dict[@"limit"] isKindOfClass:[NSNull class]]){ self.limit = [dict objectForKey:@"limit"]; } + if(![dict[@"tokenAddr"] isKindOfClass:[NSNull class]]){ + self.tokenAddr = [dict objectForKey:@"tokenAddr"]; + } } return self; } + @end diff --git a/box-Authorizer/CodeClass/HomePage/Controllers/HomepageViewController.m b/box-Authorizer/CodeClass/HomePage/Controllers/HomepageViewController.m index e7d8642..95d8cc6 100644 --- a/box-Authorizer/CodeClass/HomePage/Controllers/HomepageViewController.m +++ b/box-Authorizer/CodeClass/HomePage/Controllers/HomepageViewController.m @@ -20,19 +20,6 @@ #import "ServiceStartModel.h" #define CellReuseIdentifier @"Homepage" -#define HomepageMidOneLabStop @"关停" -#define HomepageMidOneLabStart @"启动" -#define HomepageMidOneLabDetailStop @"您的服务为启动状态" -#define HomepageMidOneLabDetailStart @"您的服务为关停状态" -#define HomepageMidOneLabDetailError @"您的服务异常" -#define HomepageMidTwoLab @"币种开户" -#define HomepageMidThreeLab @"审批业务流" -#define HomepageMidFourLab @"授权码" -#define HomepageMidFourDetailLab @"授权员工最高权限" -#define HomepageFootTitle @"最新动态" -#define HomepageTitle @"首页" -#define HomepageNoApproval @"暂无待审批" -#define HomepageNoCurrency @"暂无开户币种" @interface HomepageViewController () { @@ -74,13 +61,15 @@ - (void)viewDidLoad { [self createBarItem]; _firstInit = 1; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pushNextVCAction:) name:@"pushNextVC" object:nil]; - [[NewsInfoModel sharedManager] insertNewsInfoNews:@"打开私钥App"]; + [[NewsInfoModel sharedManager] insertNewsInfoNews:OpenApp]; [self loadNews]; timer = [NSTimer scheduledTimerWithTimeInterval:2.0f target:self selector:@selector(agentStatusTimer:) userInfo:nil repeats:YES]; [self requestAgentStatus]; [self headRefresh]; } + + -(void)loadNavigationBar { self.view.backgroundColor = [UIColor colorWithHexString:@"#ededee"]; @@ -221,7 +210,7 @@ -(void)showAgentState:(NSInteger)state hexString = @"F17B00"; _topView.image = [UIImage imageNamed:@"image_home_yellow"]; }else{ - hexString = @"4867FF"; + hexString = @"4C5CFF"; _topView.image = [UIImage imageNamed:@"homePageTopImg"]; } UINavigationBar * bar = self.navigationController.navigationBar; @@ -711,7 +700,7 @@ -(void)createFootDetail _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; _labelTip = [[UILabel alloc]initWithFrame:CGRectMake(30, 15, SCREEN_WIDTH - 60, 30)]; - _labelTip.text = @"暂无动态"; + _labelTip.text = NoDynamic; _labelTip.textAlignment = NSTextAlignmentCenter; _labelTip.textColor = [UIColor colorWithHue:0.00 saturation:0.00 brightness:0.66 alpha:1.00]; _labelTip.font = [UIFont systemFontOfSize:17]; @@ -819,6 +808,11 @@ -(void)agentOperate:(NSInteger)state password:(NSString *)password [self handleCheckTime]; }else{ [self seviceType:StoppedServiceStatus]; + if (state == StopServiceOperate) { + [[NewsInfoModel sharedManager] insertNewsInfoNews:StoppedService]; + [self loadNews]; + } + } }else{ [ProgressHUD showStatus:RspNo]; @@ -840,7 +834,7 @@ -(void)handleCheckTime -(void)checkTimeStatus { _middleOneView.userInteractionEnabled = NO; - _middleOneLab.text = @"等待校验"; + _middleOneLab.text = WaitCheck; _middleOneDetailLab.text = HomepageMidOneLabDetailStart; } @@ -848,21 +842,20 @@ -(void)seviceType:(NSInteger)state { if (state == StartedServiceStatus) { _middleOneView.userInteractionEnabled = YES; - [[NewsInfoModel sharedManager] insertNewsInfoNews:@"已启动服务"]; + [[NewsInfoModel sharedManager] insertNewsInfoNews:StartedService]; //可关停 [BoxDataManager sharedManager].agentOperate = StopServiceOperate; _middleOneLab.text = HomepageMidOneLabStop; _middleOneDetailLab.text = HomepageMidOneLabDetailStop; }else if(state == StoppedServiceStatus){ _middleOneView.userInteractionEnabled = YES; - [[NewsInfoModel sharedManager] insertNewsInfoNews:@"已关停服务"]; //可启动 [BoxDataManager sharedManager].agentOperate = StartServiceOperate; _middleOneLab.text = HomepageMidOneLabStart; _middleOneDetailLab.text = HomepageMidOneLabDetailStart; }else if(state == NotConnectedStatus){ _middleOneView.userInteractionEnabled = NO; - [[NewsInfoModel sharedManager] insertNewsInfoNews:@"服务异常"]; + [[NewsInfoModel sharedManager] insertNewsInfoNews:NotConnected]; _middleOneLab.text = HomepageMidOneLabStart; _middleOneDetailLab.text = HomepageMidOneLabDetailError; } diff --git a/box-Authorizer/CodeClass/HomePage/Controllers/LeftMenuViewController.m b/box-Authorizer/CodeClass/HomePage/Controllers/LeftMenuViewController.m index 33dfc97..b03f2d4 100644 --- a/box-Authorizer/CodeClass/HomePage/Controllers/LeftMenuViewController.m +++ b/box-Authorizer/CodeClass/HomePage/Controllers/LeftMenuViewController.m @@ -36,9 +36,9 @@ - (void)viewDidLoad { _sourceArray = [[NSMutableArray alloc] init]; NSDictionary *dict = @{ @"data":@[ - @{@"titleName":@"资产总览"}, - @{@"titleName":@"服务器地址"}, - @{@"titleName":@"关于BOX"} + @{@"titleName":AssetOverview}, + @{@"titleName":ServerAddress}, + @{@"titleName":AboutBOX} ] }; for (NSDictionary *dataDic in dict[@"data"]) { @@ -121,7 +121,16 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath [self.navigationController pushViewController:modifyServerAdressVC animated:YES]; [self.sidePanelController toggleRightPanel:nil]; [self addNSNotificationCenter:modifyServerAdressVC]; - }else if(indexPath.row == 2){ + } + /* + else if(indexPath.row == 2) { + LanguageSwitchViewController *languageSwitchVc = [[LanguageSwitchViewController alloc] init]; + [self.navigationController pushViewController:languageSwitchVc animated:YES]; + [self.sidePanelController toggleRightPanel:nil]; + [self addNSNotificationCenter:languageSwitchVc]; + } + */ + else if(indexPath.row == 2){ AboutBoxViewController *aboutBoxVC = [[AboutBoxViewController alloc] init]; [self.navigationController pushViewController:aboutBoxVC animated:YES]; [self addNSNotificationCenter:aboutBoxVC]; diff --git a/box-Authorizer/CodeClass/HomePage/Views/SeviceStateView.m b/box-Authorizer/CodeClass/HomePage/Views/SeviceStateView.m index 57d2c21..68e508a 100644 --- a/box-Authorizer/CodeClass/HomePage/Views/SeviceStateView.m +++ b/box-Authorizer/CodeClass/HomePage/Views/SeviceStateView.m @@ -8,12 +8,6 @@ #import "SeviceStateView.h" -#define HomepageSeverStartLaber @"确定要关停服务吗?" -#define HomepageSeverStopLaber @"确定要启动服务吗?" -#define HomepageSeverStartButton @"确定关停?" -#define HomepageSeverStopButton @"确定启动?" -#define HomepageSeverCancel @"取消" - @interface SeviceStateView () @property (nonatomic,strong)UIView *bigView; @@ -55,7 +49,7 @@ -(void)createView:(NSInteger)state [self addSubview:_mainView]; _cancelBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - [_cancelBtn setTitle:HomepageSeverCancel forState:UIControlStateNormal]; + [_cancelBtn setTitle:Cancel forState:UIControlStateNormal]; [_cancelBtn setTitleColor:[UIColor colorWithHexString:@"#666666"] forState:UIControlStateNormal]; _cancelBtn.titleLabel.font = Font(13); [_cancelBtn addTarget:self action:@selector(cancelAction:) forControlEvents:UIControlEventTouchUpInside]; diff --git a/box-Authorizer/CodeClass/InitAccount/Controllers/AwaitBackupViewController.m b/box-Authorizer/CodeClass/InitAccount/Controllers/AwaitBackupViewController.m index b1cbacd..38828c8 100644 --- a/box-Authorizer/CodeClass/InitAccount/Controllers/AwaitBackupViewController.m +++ b/box-Authorizer/CodeClass/InitAccount/Controllers/AwaitBackupViewController.m @@ -11,8 +11,6 @@ #import "AuthorizerInfoModel.h" #import "GenerateContractViewController.h" -#define ServiceStartAwaitBtn @"已等待时间" - @interface AwaitBackupViewController () { NSTimer *timer; @@ -88,9 +86,9 @@ -(void)requestAgentStatus [[BoxDataManager sharedManager] saveDataWithCoding:@"Address" codeValue:Address]; [[BoxDataManager sharedManager] saveDataWithCoding:@"stringD" codeValue:stringD]; _nextButton.hidden = NO; - [_nextButton setTitle:@"下一步" forState:UIControlStateNormal]; + [_nextButton setTitle:NextStep forState:UIControlStateNormal]; statusIn = 0; - _contentLab.text = @"所有私钥App持有者都已正确输入备份密码"; + _contentLab.text = AwaitBackupVCContentLabText; } } } fail:^(NSError *error) { @@ -100,9 +98,9 @@ -(void)requestAgentStatus -(void)handleStatus:(NSInteger)status { - _contentLab.text = @"备份密码不一致"; + _contentLab.text = AwaitBackupVCContentLabStatusText; _nextButton.hidden = NO; - [_nextButton setTitle:@"返回重新备份" forState:UIControlStateNormal]; + [_nextButton setTitle:AwaitBackupVnextButtonTitle forState:UIControlStateNormal]; statusIn = status; } @@ -133,7 +131,7 @@ -(void)createView }]; _contentLab = [[UILabel alloc] init]; - _contentLab.text = @"等待下一个私钥App持有者输入正确的备份密码"; + _contentLab.text = AwaitBackupVCContentLabNextText; _contentLab.textAlignment = NSTextAlignmentCenter; _contentLab.font = Font(17); _contentLab.textColor = [UIColor colorWithHexString:@"#444444"]; @@ -147,7 +145,7 @@ -(void)createView }]; _nextButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_nextButton setTitle:@"下一步" forState:UIControlStateNormal]; + [_nextButton setTitle:NextStep forState:UIControlStateNormal]; [_nextButton setTitleColor:[UIColor colorWithHexString:@"#ffffff"] forState:UIControlStateNormal]; _nextButton.backgroundColor = [UIColor colorWithHexString:@"#4c7afd"]; _nextButton.titleLabel.font = Font(16); diff --git a/box-Authorizer/CodeClass/InitAccount/Controllers/BackupViewController.m b/box-Authorizer/CodeClass/InitAccount/Controllers/BackupViewController.m index d313436..fd7bc01 100644 --- a/box-Authorizer/CodeClass/InitAccount/Controllers/BackupViewController.m +++ b/box-Authorizer/CodeClass/InitAccount/Controllers/BackupViewController.m @@ -13,12 +13,6 @@ #import "HomepageViewController.h" #import "LeftMenuViewController.h" -#define BackupVCContentlab @"私钥App持有者正在连接..." -#define BackupVCbackupButton @"立即备份" -#define BackupVCSVProgressOne @"密码备份成功" -#define BackupVCWSProgressTwo @"请等待下一位私钥App持有者连接..." -#define BackupVCCheckPwd @"密码必须为6-12位数字和字母组成" - @interface BackupViewController () { NSTimer *timer; diff --git a/box-Authorizer/CodeClass/InitAccount/Controllers/BlueToothListViewController.m b/box-Authorizer/CodeClass/InitAccount/Controllers/BlueToothListViewController.m index ad5308c..d75d624 100755 --- a/box-Authorizer/CodeClass/InitAccount/Controllers/BlueToothListViewController.m +++ b/box-Authorizer/CodeClass/InitAccount/Controllers/BlueToothListViewController.m @@ -14,6 +14,9 @@ #import "PrintAlertView.h" #import "GenerateContractViewController.h" #import "HLPrinter.h" +#import "GprinterLabelPrinterBluetooth.h" +#import "GprinterLabelPrinterCommand.h" +#import static NSString *identifier = @"blueToothList"; #define SubCount 115 @@ -21,8 +24,7 @@ @interface BlueToothListViewController () @property (nonatomic,strong)UITableView *tableView; -/**< 蓝牙设备个数 */ -@property (strong, nonatomic)NSMutableArray *deviceArray; +@property (strong, nonatomic)NSArray *deviceArray; /**< 蓝牙设备个数 */ @property (nonatomic,strong)PrintAlertView *printAlertView; /**< 详情数组 */ @@ -32,21 +34,32 @@ @interface BlueToothListViewController () *perpherals, BOOL isTimeout) { + NSLog(@"perpherals:%@",perpherals); + _deviceArray = perpherals; + [_tableView reloadData]; + for (id s in self.deviceArray) { + NSLog(@"::%@",s); } - - [SVProgressHUD setDefaultStyle:SVProgressHUDStyleDark]; - [SVProgressHUD showInfoWithStatus:info ]; - [SVProgressHUD dismissWithDelay:1.2]; - }; - for (NSDictionary *dic in self.deviArray) { - [self.deviceArray addObject:dic]; - } - manager.discoverPeripheralBlcok = ^(CBCentralManager *central, CBPeripheral *peripheral, NSDictionary *advertisementData, NSNumber *RSSI) { - if (peripheral.name.length <= 0) { - return ; - } - if (self.deviceArray.count == 0) { - NSDictionary *dict = @{@"peripheral":peripheral, @"RSSI":RSSI}; - [self.deviceArray addObject:dict]; - } else { - BOOL isExist = NO; - for (int i = 0; i < self.deviceArray.count; i++) { - NSDictionary *dict = [self.deviceArray objectAtIndex:i]; - CBPeripheral *per = dict[@"peripheral"]; - if ([per.identifier.UUIDString isEqualToString:peripheral.identifier.UUIDString]) { - isExist = YES; - NSDictionary *dict = @{@"peripheral":peripheral, @"RSSI":RSSI}; - [_deviceArray replaceObjectAtIndex:i withObject:dict]; - } - } - if (!isExist) { - NSDictionary *dict = @{@"peripheral":peripheral, @"RSSI":RSSI}; - [self.deviceArray addObject:dict]; - } - } - [[NSNotificationCenter defaultCenter] - postNotificationName:@"upDateDeviceArr" object:self.deviceArray]; - [self.tableView reloadData]; - - }; + } failure:^(ScanError error) { + NSLog(@"error:%ld",(long)error); + }]; } #pragma mark - createBarItem - (void)createBarItem{ UIBarButtonItem *buttonLeft = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"back"] style:UIBarButtonItemStyleDone target:self action:@selector(backButtonAction:)]; self.navigationItem.leftBarButtonItem = buttonLeft; - + } //返回按钮 @@ -143,87 +105,34 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { BlueToothListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier forIndexPath:indexPath]; - NSDictionary *dict = [self.deviceArray objectAtIndex:indexPath.row]; - CBPeripheral *peripherral = dict[@"peripheral"]; - BlueToothListModel *model = [[BlueToothListModel alloc] initWithDict:dict]; - [cell setDataWithModel:model]; - if (peripherral.state == CBPeripheralStateConnected) { - cell.accessoryType = UITableViewCellAccessoryCheckmark; - } else { - cell.accessoryType = UITableViewCellAccessoryNone; + if (_deviceArray.count > 0) { + CBPeripheral *peripherral =[self.deviceArray objectAtIndex:indexPath.row]; + [cell setDataWithModel:peripherral.name]; } + cell.accessoryType = UITableViewCellAccessoryNone; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; - NSDictionary *dict = [self.deviceArray objectAtIndex:indexPath.row]; - CBPeripheral *peripheral = dict[@"peripheral"]; + CBPeripheral *peripheral = [self.deviceArray objectAtIndex:indexPath.row]; + self.pperipheral = peripheral; [self connectBlueTooth:peripheral]; } #pragma mark ----- 查找蓝牙服务 ----- -(void)connectBlueTooth:(CBPeripheral *)peripherall { - HLBLEManager *manager = [HLBLEManager sharedInstance]; - [manager connectPeripheral:peripherall - connectOptions:@{CBConnectPeripheralOptionNotifyOnDisconnectionKey:@(YES)} - stopScanAfterConnected:YES - servicesOptions:nil - characteristicsOptions:nil - completeBlock:^(HLOptionStage stage, CBPeripheral *peripheral, CBService *service, CBCharacteristic *character, NSError *error) { - switch (stage) { - case HLOptionStageConnection: - { - if (error) { - //[SVProgressHUD showErrorWithStatus:@"连接失败"]; - - } else { - //[SVProgressHUD showSuccessWithStatus:@"连接成功"]; - //正在连接打印机 - [self showAlertView]; - } - break; - } - case HLOptionStageSeekServices: - { - if (error) { - //[SVProgressHUD showSuccessWithStatus:@"查找服务失败"]; - } else { - //[SVProgressHUD showSuccessWithStatus:@"查找服务成功"]; - [_infoss addObjectsFromArray:peripheral.services]; - [self createChatacter]; - [_printAlertView changePrintState:BTConnectSuccess]; - } - break; - } - case HLOptionStageSeekCharacteristics: - { - // 该block会返回多次,每一个服务返回一次 - if (error) { - NSLog(@"查找特性失败"); - } else { - NSLog(@"查找特性成功"); - [self createChatacter]; - } - break; - } - case HLOptionStageSeekdescriptors: - { - // 该block会返回多次,每一个特性返回一次 - if (error) { - NSLog(@"查找特性的描述失败"); - } else { - // NSLog(@"查找特性的描述成功"); - } - break; - } - default: - break; - } - - }]; + [[GprinterLabelPrinterBluetooth sharedInstance]connectPeripheral:peripherall completion:^(CBPeripheral *perpheral, NSError *error) { + if (error) { + } else { + [self showAlertView]; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [_printAlertView changePrintState:BTConnectSuccess]; + }); + } + }]; } #pragma mark ----- 生成可写入的特性 ----- @@ -254,6 +163,12 @@ -(void)showAlertView } +-(void)cancelPrintView +{ + [_printAlertView removeFromSuperview]; + _printAlertIn = 0; +} + #pragma mark ----- PrintAlertViewDelegate 立即打印 ----- - (void)printRightNow { @@ -288,40 +203,57 @@ -(NSArray *)createQRCode -(void)goToPrinting { - NSArray *printerArr = [self createQRCode]; - HLPrinter *printer = [[HLPrinter alloc] init]; - for (int i = 0; i < printerArr.count; i ++) { - //UIImage *image = [CIQRCodeManager createImageWithString:printStr]; - //[printer appendImage:image alignment:HLTextAlignmentCenter maxWidth:300]; - NSString *detailStr = [NSString stringWithFormat:@"二维码 %d(%@)", i + 1, [BoxDataManager sharedManager].applyer_account]; - [printer appendFooter:detailStr]; - [printer appendFooter:nil]; - if (i == 2) { - [printer appendQRCodeWithInfo:printerArr[i] size:7.5]; - }else{ - [printer appendQRCodeWithInfo:printerArr[i] size:6]; - } - } - NSInteger timestampIn = [[NSDate date]timeIntervalSince1970] * 1000; - NSString *printTime = [self getElapseTimeToString:timestampIn]; - [printer appendFooter:printTime]; - [printer appendFooter:nil]; - NSData *mainData = [printer getFinalData]; - HLBLEManager *bleManager = [HLBLEManager sharedInstance]; - if (_infoss.count & CBCharacteristicPropertyWrite) { - [bleManager writeValue:mainData forCharacteristic:self.chatacter type:CBCharacteristicWriteWithResponse completionBlock:^(CBCharacteristic *characteristic, NSError *error) { - if (!error) { - NSLog(@"写入成功"); + NSArray *codeArray = [NSArray arrayWithObjects:[BoxDataManager sharedManager].stringD, [BoxDataManager sharedManager].passWord, nil]; + NSString *codeSting = [JsonObject dictionaryToarrJson:codeArray]; + NSString *aesStr = [FSAES128 AES128EncryptStrig:codeSting keyStr:[BoxDataManager sharedManager].codePassWord]; + //如果你需要连接,立刻去打印 + [[GprinterLabelPrinterBluetooth sharedInstance] fullOptionPeripheral:self.pperipheral completion:^(OptionStage stage, CBPeripheral *perpheral, NSError *error) { + if (stage == OptionStageSeekCharacteristics) { + self.c = [[GprinterLabelPrinterCommand alloc]init]; + [self.c clearBuffer]; + NSInteger timestampIn = [[NSDate date]timeIntervalSince1970] * 1000; + NSString *printTime = [self getElapseTimeToString:timestampIn]; + printTime = [NSString stringWithFormat:@"%@ (%@)",printTime, [BoxDataManager sharedManager].applyer_account]; + /* 指令打印 + */ + /* + NSString *str1 = @"SPEED 3\r\nDENSITY 2\r\nSET COUNTER @1 1\r\nDIRECTION 1\r\nSIZE 100 mm,100 mm\r\nCLS\r\nGAP 2 mm,0 mm\r\nTEXT 140,100,\"TSS24.BF2\",0,1,1,\""; + NSString *str4 = @"\"\r\n"; + NSString *str5 = @"QRCODE 140,200,H,4,A,0,\""; + NSString *str2 = @"\"\r\nREFERENCE 40,40\r\nPRINT 1,1\r\n"; + NSString *str = [NSString stringWithFormat:@"%@%@%@%@%@%@", str1,printTime,str4,str5,aesStr, str2]; + [self.c sendcommand:str]; + */ + + + /* + SDK打印 + */ + NSString *printStr = aesStr; + //SIZE:定义标签纸的宽度及高度 这里为100 mm, 100 mm; + //SPEED:设定打印机的打印速度 SPEED1~SPEED6 + //DENSITY:设定打印机的打印浓度 0~15 0 表示最淡的浓度,15 表示最深的浓度 + //GAP:定义两张标签之间的间隙距离, GAP m mm, n mm:定义标签间隙高度 (英寸或厘米),定义标签间隙高度的补偿值 (英寸或厘米) + [self.c setupForWidth:@"100 mm" heigth:@"100 mm" speed:SPEED3 density:DENSITY7 sensor:GAP vertical:@"2" offset:@"0"]; + //设定打印方向:0 、1 + [self.c Direction:@"1"]; + //打印二维码各参数:X:QRCODE 条码左上角 X 座标;Y:QRCODE 条码左上角 Y 座标;ECC level:错误纠正能力等级; cell width:1~10;mode:自动生成编码/手动生成编码;rotation:顺时针旋转角度;model:条码生成样式:1:(预设), 原始版本、2:扩大版本;mask:范围:0~8,预设 7; Data string:码资料内容 + [self.c QRCodeWithX:@"205" Y:@"230" ECClevel:LEVEL_H cellwidth:@"4" Mode:@"M" rotation:ROTATION_0 model:@"1" mask:@"2" code:printStr]; + //打印文字 语法:TEXT X, Y, ”font”, rotation, x-multiplication, y-multiplication, “content” :font:字型名称 Rotation:顺时针旋转角度 X-multiplication:水平放大值,最大可放大至 10 倍 有效系数:1~10 Y-multiplication:垂直放大值,最大可放大至 10 倍 有效系数:1~10 + [self.c printerfontFormX:@"205" Y:@"150" fontName:SIMPLIFIED_CHINESE rotation:ROTATION_0 magnificationRateX:MUL_1 magnificationRateY:MUL_1 content:printTime]; + //PRINT:将存于数据缓存的标签打印 语法:PRINT m [,n] m:打印张数,N:每张标签需重复打印的张数 1 ≤ m ≤ 999999999 1 ≤ n ≤ 999999999 + [self.c printLabelWithNumberOfSets:@"1" copies:@"1"]; + //发送指令 + [self.c sendToPrinter]; + [[GprinterLabelPrinterBluetooth sharedInstance] sendPrintData:[self.c sendData] completion:^(CBPeripheral *connectPerpheral, BOOL completion, NSString *error) { + NSLog(@"写入结:%d---错误:%@",completion,error); [_printAlertView changePrintState:BTPrintSuccess]; - - } - }]; - } else if (_infoss.count & CBCharacteristicPropertyWriteWithoutResponse) { - [bleManager writeValue:mainData forCharacteristic:self.chatacter type:CBCharacteristicWriteWithoutResponse]; - [_printAlertView changePrintState:BTPrintSuccess]; - } + }]; + } + }]; } + - (NSString *)getElapseTimeToString:(NSInteger)second{ NSDateFormatter *dateformatter1 = [[NSDateFormatter alloc] init]; [dateformatter1 setDateFormat:@"yyyy-MM-dd HH:mm"]; @@ -356,13 +288,13 @@ - (void)didReceiveMemoryWarning { } /* -#pragma mark - Navigation - -// In a storyboard-based application, you will often want to do a little preparation before navigation -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - // Get the new view controller using [segue destinationViewController]. - // Pass the selected object to the new view controller. -} -*/ + #pragma mark - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. + } + */ @end diff --git a/box-Authorizer/CodeClass/InitAccount/Controllers/GenerateContractViewController.m b/box-Authorizer/CodeClass/InitAccount/Controllers/GenerateContractViewController.m index 8dba647..fddf5b1 100644 --- a/box-Authorizer/CodeClass/InitAccount/Controllers/GenerateContractViewController.m +++ b/box-Authorizer/CodeClass/InitAccount/Controllers/GenerateContractViewController.m @@ -11,14 +11,6 @@ #import "ServiceStartViewController.h" #import "ServiceStartModel.h" -#define GenerateContractVCTitle @"生成合约" -#define GenerateContractVCScanLab @"请先向账户二维码充值" -#define GenerateContractVCAccountCopyBtn @"复制地址" -#define GenerateContractVCAccountSaveBtn @"保存二维码" -#define GenerateContractVCscanTwoLab @"合约二维码" -#define GenerateContractVCprivateBtn @"输入口令" -#define GenerateContractVserviceStartBtn @"启动服务" - @interface GenerateContractViewController () @property(nonatomic, strong)UIScrollView *contentView; @@ -333,7 +325,7 @@ -(void)showProgressHUD //设置有遮罩 //self.progressHUD.dimBackground = YES; //设置进度框中的提示文字 - self.progressHUD.label.text = @"地址复制成功"; + self.progressHUD.label.text = CopyAddressSucceed; [self.progressHUD showAnimated:YES]; [self.progressHUD hideAnimated:YES afterDelay:0.5]; } @@ -367,10 +359,10 @@ -(void)saveImageView:(UIImageView *)img - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo { if (error) { - [SVProgressHUD showErrorWithStatus:@"保存失败"]; + [SVProgressHUD showErrorWithStatus:SaveFailure]; [SVProgressHUD dismissWithDelay:0.8]; } else { - [SVProgressHUD showSuccessWithStatus:@"成功保存到相册"]; + [SVProgressHUD showSuccessWithStatus:SavePicturesucceed]; [SVProgressHUD dismissWithDelay:0.8]; } } @@ -451,7 +443,7 @@ -(void)requestAgentStatus NSInteger checkTime = [[BoxDataManager sharedManager].checkTime integerValue]; NSInteger elapseTime = (currentTime - checkTime)/1000; if (elapseTime < 10) { - [WSProgressHUD showSuccessWithStatus:@"密码已提交,等待校验"]; + [WSProgressHUD showSuccessWithStatus:PasswordWaitingForCheck]; }else{ [self handleReInputPassword]; } @@ -459,7 +451,7 @@ -(void)requestAgentStatus [self handleReInputPassword]; } }else if(Status == 2){ - [WSProgressHUD showErrorWithStatus:@"服务异常"]; + [WSProgressHUD showErrorWithStatus:ServiceException]; } } } fail:^(NSError *error) { @@ -476,7 +468,7 @@ -(void)showPasswordView -(void)handleReInputPassword { - [WSProgressHUD showErrorWithStatus:@"校验密码失败,请重新输入私钥密码"]; + [WSProgressHUD showErrorWithStatus:CheckPasswordFailed]; [_privateBtn setTitle:GenerateContractVCprivateBtn forState:UIControlStateNormal]; _privateBtnState = 0; if ([BoxDataManager sharedManager].checkTime != nil) { @@ -498,9 +490,9 @@ - (void)PrivatePasswordViewDelegate:(NSString *)passwordStr NSDictionary *dict = responseObject; NSInteger RspNo = [dict[@"RspNo"] integerValue]; if ([dict[@"RspNo"] isEqualToString:@"0"]) { - [WSProgressHUD showSuccessWithStatus:@"密码已提交,等待校验"]; + [WSProgressHUD showSuccessWithStatus:PasswordWaitingForCheck]; [_privatePasswordView removeFromSuperview]; - [_privateBtn setTitle:@"刷新" forState:UIControlStateNormal]; + [_privateBtn setTitle:Refresh forState:UIControlStateNormal]; _privateBtnState = 1; [self handleCheckTime]; }else{ diff --git a/box-Authorizer/CodeClass/InitAccount/Controllers/InitAccountViewController.m b/box-Authorizer/CodeClass/InitAccount/Controllers/InitAccountViewController.m index 8bf4eec..9d6d787 100755 --- a/box-Authorizer/CodeClass/InitAccount/Controllers/InitAccountViewController.m +++ b/box-Authorizer/CodeClass/InitAccount/Controllers/InitAccountViewController.m @@ -9,10 +9,6 @@ #import "InitAccountViewController.h" #import "ScanCodeViewController.h" -#define InitAccountVCTitle @"扫一扫" -#define PerfectInformationVCLaber @"扫一扫完成初始化" -#define PerfectInformationVCSubLaber @"扫一扫MAC端的签名机完成初始化" - @interface InitAccountViewController () /** 开始扫描 */ @property(nonatomic, strong)UIButton *scanButton; diff --git a/box-Authorizer/CodeClass/InitAccount/Controllers/PerfectInformationViewController.m b/box-Authorizer/CodeClass/InitAccount/Controllers/PerfectInformationViewController.m index 4856533..58a8b6a 100644 --- a/box-Authorizer/CodeClass/InitAccount/Controllers/PerfectInformationViewController.m +++ b/box-Authorizer/CodeClass/InitAccount/Controllers/PerfectInformationViewController.m @@ -9,20 +9,10 @@ #import "PerfectInformationViewController.h" #import "BackupViewController.h" -#define PerfectInformationVCTitle @"完善信息" -#define PerfectInformationVCNameText @"请输入姓名" -#define PerfectInformationVCPasswordText @"请输入口令(6-12位数字和字母组成,区分大小写)" -#define PerfectInformationVCVerifiyText @"请再次输入口令" -#define PerfectInformationVCAleartLab @"口令切记不要遗忘,不可告知其他人,在输入时请面向自己,防止身后有人偷窥或用摄像头记录" -#define PerfectInformationVCCormfirmBtn @"提交" -#define PerfectInformationVCAleartOne @"请完善信息" -#define PerfectInformationVCAleartTwo @"请输入口令" -#define PerfectInformationVCAleartThree @"口令不一致" -#define PerfectInformationVCSucceed @"提交完成" -#define PerfectInformationVCCheckPwd @"口令格式为6-12位数字和字母组成,区分大小写" - @interface PerfectInformationViewController () - +{ + IQKeyboardReturnKeyHandler *returnKeyHandler; +} @property(nonatomic, strong)UIScrollView *contentView; /** 姓名 */ @property (nonatomic,strong)UITextField *nameTf; @@ -46,6 +36,7 @@ - (void)viewDidLoad { self.view.backgroundColor = [UIColor whiteColor]; [self createView]; _aWrapper = [[DDRSAWrapper alloc] init]; + returnKeyHandler = [[IQKeyboardReturnKeyHandler alloc] initWithViewController:self]; } -(void)createView @@ -102,8 +93,11 @@ -(void)createView value:[UIColor colorWithHexString:@"#cccccc"] range:NSMakeRange(0, passwordText.length)]; [passwordholder addAttribute:NSFontAttributeName - value:Font(14) - range:NSMakeRange(0, passwordText.length)]; + value:Font(14) + range:NSMakeRange(0, 5)]; + [passwordholder addAttribute:NSFontAttributeName + value:Font(13) + range:NSMakeRange(5, passwordText.length - 5)]; _passwordTf.attributedPlaceholder = passwordholder; _passwordTf.keyboardType = UIKeyboardTypeAlphabet; _passwordTf.secureTextEntry = YES; @@ -123,9 +117,9 @@ -(void)createView [_contentView addSubview:_showPwdBtn]; [_showPwdBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.centerY.equalTo(_passwordTf); - make.width.offset(36); - make.right.equalTo(lineOne.mas_right).offset(0); - make.height.offset(27); + make.width.offset(23); + make.right.equalTo(lineOne.mas_right).offset(-5); + make.height.offset(15); }]; UIView *lineTwo = [[UIView alloc] init]; @@ -142,7 +136,7 @@ -(void)createView _verifyPwFf.backgroundColor = [UIColor whiteColor]; _verifyPwFf.delegate = self; _verifyPwFf.clearButtonMode=UITextFieldViewModeWhileEditing; - NSString *verifiyText = PerfectInformationVCVerifiyText; + NSString *verifiyText = PerfectInformationVCVerifyText; NSMutableAttributedString *verifiyHolder = [[NSMutableAttributedString alloc] initWithString:verifiyText]; [verifiyHolder addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithHexString:@"#cccccc"] @@ -198,7 +192,7 @@ -(void)createView }]; UILabel *aleartLab = [[UILabel alloc]init]; - aleartLab.text = PerfectInformationVCAleartLab; + aleartLab.text = PerfectInformationVCAlert; aleartLab.textAlignment = NSTextAlignmentLeft; aleartLab.font = Font(11); aleartLab.textColor = [UIColor colorWithHexString:@"#d94122"]; @@ -212,7 +206,7 @@ -(void)createView }]; _cormfirmButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_cormfirmButton setTitle:PerfectInformationVCCormfirmBtn forState:UIControlStateNormal]; + [_cormfirmButton setTitle:Submit forState:UIControlStateNormal]; [_cormfirmButton setTitleColor:kWhiteColor forState:UIControlStateNormal]; _cormfirmButton.backgroundColor = [UIColor colorWithHexString:@"#4c7afd"]; _cormfirmButton.titleLabel.font = Font(16); @@ -232,11 +226,11 @@ -(void)createView -(void)cormfirmAction:(UIButton *)btn { if ( [_nameTf.text isEqualToString:@""]) { - [WSProgressHUD showErrorWithStatus:PerfectInformationVCAleartOne]; + [WSProgressHUD showErrorWithStatus:PerfectInformationVCAlertOne]; return; } if ([_passwordTf.text isEqualToString:@""]) { - [WSProgressHUD showErrorWithStatus:PerfectInformationVCAleartTwo]; + [WSProgressHUD showErrorWithStatus:PerfectInformationVCAlertTwo]; return; } BOOL checkBool = [PassWordManager checkPassWord:_passwordTf.text]; @@ -245,7 +239,7 @@ -(void)cormfirmAction:(UIButton *)btn return; } if (![_passwordTf.text isEqualToString:_verifyPwFf.text]) { - [WSProgressHUD showErrorWithStatus:PerfectInformationVCAleartThree]; + [WSProgressHUD showErrorWithStatus:PerfectInformationVCAlertThree]; return; } NSArray *codeArray = [JsonObject dictionaryWithJsonStringArr:_scanResult]; @@ -276,7 +270,7 @@ -(void)cormfirmAction:(UIButton *)btn NSInteger RspNo = [dict[@"RspNo"] integerValue]; if ([dict[@"RspNo"] isEqualToString:@"0"]) { [[BoxDataManager sharedManager] saveDataWithCoding:@"launchState" codeValue:@"0"]; - [WSProgressHUD showSuccessWithStatus:PerfectInformationVCSucceed]; + [WSProgressHUD showSuccessWithStatus:SubmissionCompletion]; BackupViewController *backupVC = [[BackupViewController alloc] init]; [self presentViewController:backupVC animated:YES completion:nil]; } @@ -294,7 +288,7 @@ -(void)textViewEditChanged:(NSNotification *)notification{ if (textField.tag == 100) { // 需要限制的长度 NSUInteger maxLength = 0; - maxLength = 20; + maxLength = 12; if (maxLength == 0) return; // text field 的内容 NSString *contentText = textField.text; @@ -335,6 +329,10 @@ - (BOOL)textField:(UITextField*)textField shouldChangeCharactersInRange:(NSRange return YES; } +-(void)dealloc +{ + returnKeyHandler = nil; +} //[SVProgressHUD dismiss]; - (void)didReceiveMemoryWarning { diff --git a/box-Authorizer/CodeClass/InitAccount/Controllers/ScanCodeViewController.m b/box-Authorizer/CodeClass/InitAccount/Controllers/ScanCodeViewController.m index 2ca4792..85a980a 100755 --- a/box-Authorizer/CodeClass/InitAccount/Controllers/ScanCodeViewController.m +++ b/box-Authorizer/CodeClass/InitAccount/Controllers/ScanCodeViewController.m @@ -12,12 +12,6 @@ #define ScanSize [[UIScreen mainScreen] bounds].size.width - 70 -#define ScanCodeVCTitle @"扫一扫" -#define PerfectInformationVCTorchlight @"轻触关闭" -#define PerfectInformationVCTorchheight @"轻触照亮" -#define PerfectInformationVCScanResult @"将二维码放入框内,即可自动扫描" -#define PerfectInformationVCErrorCode @"二维码无效" - @interface ScanCodeViewController () /** 扫描二维码范围的view */ @@ -424,7 +418,7 @@ - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputMetadataObjects: //判断的扫描的结果是否是二维码 if ([[metadataObject type] isEqualToString:AVMetadataObjectTypeQRCode]) { // 显示遮盖 - [SVProgressHUD showWithStatus:@"正在处理"]; + [SVProgressHUD showWithStatus:Handing]; [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeClear]; // 当扫描到数据时,停止扫描 [ _session stopRunning]; diff --git a/box-Authorizer/CodeClass/InitAccount/Controllers/ServiceStartViewController.m b/box-Authorizer/CodeClass/InitAccount/Controllers/ServiceStartViewController.m index 289f52f..61e6ebd 100644 --- a/box-Authorizer/CodeClass/InitAccount/Controllers/ServiceStartViewController.m +++ b/box-Authorizer/CodeClass/InitAccount/Controllers/ServiceStartViewController.m @@ -13,21 +13,6 @@ #import "HomepageViewController.h" #import "LeftMenuViewController.h" -#define ServiceStartTitle @"启动服务" -#define ServiceStartLaunchUnstart @"未启动" -#define ServiceStartLaunchState @"启动中" -#define ServiceStartLaunchStateSecceed @"启动成功" -#define ServiceStartPassword @"请输入口令" -#define ServiceStartRepassword @"请再次口令" -#define ServiceStartCommitStart @"同意启动" -#define ServiceStartCommitStartUse @"开始使用" -#define ServiceStartAwaitBtn @"已等待时间" -#define ServiceStartUse @"开始使用" -#define ServiceStateTitle @"启动成功" -#define ServiceStateDetail @"继续等待下一位私钥App持有者启动服务" -#define ServiceStartAleartOne @"请输入口令" -#define ServiceStartAleartTwo @"口令不一致" -#define ServiceStartPwdTitle @"输入口令" #define CellReuseIdentifier @"ServiceStart" @interface ServiceStartViewController () @@ -35,6 +20,7 @@ @interface ServiceStartViewController () /** 密码 */ @property (nonatomic,strong)UITextField *passwordTf; @@ -108,8 +102,11 @@ -(void)createView value:[UIColor colorWithHexString:@"#cccccc"] range:NSMakeRange(0, backupText.length)]; [backupHolder addAttribute:NSFontAttributeName - value:Font(15) - range:NSMakeRange(0, backupText.length)]; + value:Font(14) + range:NSMakeRange(0, 5)]; + [backupHolder addAttribute:NSFontAttributeName + value:Font(13) + range:NSMakeRange(5, backupText.length - 5)]; _passwordTf.attributedPlaceholder = backupHolder; _passwordTf.keyboardType = UIKeyboardTypeAlphabet; _passwordTf.secureTextEntry = YES; @@ -129,9 +126,9 @@ -(void)createView [_footView addSubview:_showPwdBtn]; [_showPwdBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.centerY.equalTo(_passwordTf); - make.width.offset(36); - make.right.offset(-16); - make.height.offset(27); + make.width.offset(23); + make.right.offset(-18); + make.height.offset(15); }]; @@ -146,7 +143,7 @@ -(void)createView }]; UILabel *aleartLab = [[UILabel alloc]init]; - aleartLab.text = BackupViewAleartLab; + aleartLab.text = BackupViewAlertLab; aleartLab.textAlignment = NSTextAlignmentLeft; aleartLab.font = Font(11); aleartLab.textColor = [UIColor colorWithHexString:@"#666666"]; @@ -170,7 +167,7 @@ -(void)createView }]; _confirmBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - [_confirmBtn setTitle:BackupViewConfirmBtn forState:UIControlStateNormal]; + [_confirmBtn setTitle:Confirm forState:UIControlStateNormal]; [_confirmBtn setTitleColor:[UIColor colorWithHexString:@"#ffffff"] forState:UIControlStateNormal]; _confirmBtn.backgroundColor = [UIColor colorWithHexString:@"#4c7afd"]; _confirmBtn.layer.cornerRadius = 2.0f; diff --git a/box-Authorizer/CodeClass/InitAccount/Views/BlueToothListTableViewCell.h b/box-Authorizer/CodeClass/InitAccount/Views/BlueToothListTableViewCell.h index 280c163..f700997 100644 --- a/box-Authorizer/CodeClass/InitAccount/Views/BlueToothListTableViewCell.h +++ b/box-Authorizer/CodeClass/InitAccount/Views/BlueToothListTableViewCell.h @@ -13,6 +13,6 @@ @property (nonatomic,strong) BlueToothListModel *model; -- (void)setDataWithModel:(BlueToothListModel *)model; +- (void)setDataWithModel:(NSString *)model; @end diff --git a/box-Authorizer/CodeClass/InitAccount/Views/BlueToothListTableViewCell.m b/box-Authorizer/CodeClass/InitAccount/Views/BlueToothListTableViewCell.m index 483ff17..6876bed 100644 --- a/box-Authorizer/CodeClass/InitAccount/Views/BlueToothListTableViewCell.m +++ b/box-Authorizer/CodeClass/InitAccount/Views/BlueToothListTableViewCell.m @@ -46,7 +46,7 @@ - (void)createView{ }]; _linkLabel = [[UILabel alloc]init]; - _linkLabel.text = @"未连接"; + _linkLabel.text = Unconnected; _linkLabel.textAlignment = NSTextAlignmentRight; _linkLabel.font = [UIFont systemFontOfSize:16]; _linkLabel.textColor = [UIColor colorWithHexString:@"#474747"]; @@ -72,16 +72,9 @@ - (void)createView{ } -- (void)setDataWithModel:(BlueToothListModel *)model +- (void)setDataWithModel:(NSString *)model { - _nameLabel.text = model.blueTooth; - if (model.isSelect) { - _linkLabel.text = @"连接成功"; - _linkLabel.textColor = [UIColor colorWithHexString:@"#f96268"]; - }else{ - _linkLabel.text = @"未连接"; - _linkLabel.textColor = [UIColor colorWithHexString:@"#50b4ff"]; - } + _nameLabel.text = model; } diff --git a/box-Authorizer/CodeClass/InitAccount/Views/PrintAlertView.m b/box-Authorizer/CodeClass/InitAccount/Views/PrintAlertView.m index f4387b7..cb4f66c 100644 --- a/box-Authorizer/CodeClass/InitAccount/Views/PrintAlertView.m +++ b/box-Authorizer/CodeClass/InitAccount/Views/PrintAlertView.m @@ -76,7 +76,7 @@ -(void)createView _imgTwo.hidden = YES; _printState = [[UILabel alloc]init]; - _printState.text = @"正在连接打印机,请稍等..."; + _printState.text = PrintAlertViewPrinting; _printState.textAlignment = NSTextAlignmentCenter; _printState.font = Font(15); _printState.textColor = kBlackColor; @@ -89,7 +89,7 @@ -(void)createView }]; _printBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - [_printBtn setTitle:@"立即打印" forState:UIControlStateNormal]; + [_printBtn setTitle:PrintImmediately forState:UIControlStateNormal]; [_printBtn setTitleColor:kWhiteColor forState:UIControlStateNormal]; _printBtn.layer.cornerRadius = 2.f; _printBtn.layer.masksToBounds = YES; @@ -127,7 +127,7 @@ -(void)createPrintView }]; _printAgainBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - [_printAgainBtn setTitle:@"重新打印" forState:UIControlStateNormal]; + [_printAgainBtn setTitle:Reprint forState:UIControlStateNormal]; [_printAgainBtn setTitleColor:[UIColor colorWithHexString:@"#666666"] forState:UIControlStateNormal]; _printAgainBtn.titleLabel.font = Font(13); [_printAgainBtn addTarget:self action:@selector(printAgainAction:) forControlEvents:UIControlEventTouchUpInside]; @@ -140,7 +140,7 @@ -(void)createPrintView }]; UILabel *printedLab = [[UILabel alloc]init]; - printedLab.text = @"打印已成功"; + printedLab.text = PrintSuccessfully; printedLab.textAlignment = NSTextAlignmentCenter; printedLab.font = Font(16); printedLab.textColor = [UIColor colorWithHexString:@"#444444"]; @@ -178,7 +178,7 @@ -(void)createPrintView }]; UILabel *aleartLab = [[UILabel alloc]init]; - aleartLab.text = @"为保证安全请将二维码1-3放入一个信封;将二维码4-6放入另一个信封分别将两个信封保存至两个银行的保险柜中。"; + aleartLab.text = PrintAlertViewAlertLabText; aleartLab.textAlignment = NSTextAlignmentLeft; aleartLab.font = Font(12); aleartLab.textColor = [UIColor colorWithHexString:@"#d94122"]; @@ -193,7 +193,7 @@ -(void)createPrintView }]; _contractBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - [_contractBtn setTitle:@"生成合约" forState:UIControlStateNormal]; + [_contractBtn setTitle:GenerateContract forState:UIControlStateNormal]; [_contractBtn setTitleColor:[UIColor colorWithHexString:@"#ffffff"] forState:UIControlStateNormal]; _contractBtn.backgroundColor = [UIColor colorWithHexString:@"#4c7afd"]; _contractBtn.titleLabel.font = Font(15); @@ -240,7 +240,7 @@ -(void)changePrintState:(NSInteger)state switch (state) { case BTConnectFail: { - _printState.text = @"连接失败,重新连接"; + _printState.text = PrintAlertViewBTConnectFail; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self removeFromSuperview]; }); @@ -262,7 +262,7 @@ -(void)changePrintState:(NSInteger)state _imgTwo.image = [UIImage imageNamed:@"printingImg"]; _printState.hidden = NO; _printBtn.hidden = YES; - _printState.text = @"正在打印中,请稍后..."; + _printState.text = PrintAlertViewBTPrinting; break; } case BTPrintSuccess: diff --git a/box-Authorizer/CodeClass/InitAccount/Views/PrivatePasswordView.m b/box-Authorizer/CodeClass/InitAccount/Views/PrivatePasswordView.m index 89fabd2..ab1b2ee 100644 --- a/box-Authorizer/CodeClass/InitAccount/Views/PrivatePasswordView.m +++ b/box-Authorizer/CodeClass/InitAccount/Views/PrivatePasswordView.m @@ -8,10 +8,10 @@ #import "PrivatePasswordView.h" -#define PrivatePasswordbackupLab @"口令" -#define PrivatePasswordComfirm @"确认" - @interface PrivatePasswordView () +{ + IQKeyboardReturnKeyHandler *returnKeyHandler; +} /** 密码 */ @property (nonatomic,strong)UITextField *passwordTf; /** 取消 */ @@ -33,7 +33,8 @@ -(id)initWithFrame:(CGRect)frame{ self = [super initWithFrame:frame]; if (self) { [self createView]; - + returnKeyHandler = [[IQKeyboardReturnKeyHandler alloc] init]; + [returnKeyHandler addResponderFromView:self]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; } @@ -99,7 +100,7 @@ -(void)createView _passwordTf.backgroundColor = [UIColor colorWithHexString:@"#f7f8f9"]; _passwordTf.delegate = self; _passwordTf.clearButtonMode=UITextFieldViewModeWhileEditing; - NSString *backupText = @"请输入口令"; + NSString *backupText = PrivatePasswordPasswordTfPlaceholder; NSMutableAttributedString *backupHolder = [[NSMutableAttributedString alloc] initWithString:backupText]; [backupHolder addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithHexString:@"#cccccc"] @@ -126,9 +127,9 @@ -(void)createView [_footView addSubview:_showPwdBtn]; [_showPwdBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.centerY.equalTo(_passwordTf); - make.width.offset(36); - make.right.offset(-16); - make.height.offset(27); + make.width.offset(23); + make.right.offset(-18); + make.height.offset(15); }]; UIView *line = [[UIView alloc] init]; @@ -148,7 +149,7 @@ -(void)createView _confirmBtn.layer.cornerRadius = 2.0f; _confirmBtn.layer.masksToBounds = YES; _confirmBtn.titleLabel.font = Font(16); - _confirmBtn.timeInterVal = 0.8; + _confirmBtn.timeInterVal = 1.8; [_confirmBtn addTarget:self action:@selector(confirmAction:) forControlEvents:UIControlEventTouchUpInside]; [_footView addSubview:_confirmBtn]; [_confirmBtn mas_makeConstraints:^(MASConstraintMaker *make) { @@ -188,11 +189,12 @@ -(void)cancelAction:(UIButton *)btn -(void)confirmAction:(UIButton *)btn { if ([_passwordTf.text isEqualToString:@""]) { - [WSProgressHUD showErrorWithStatus:@"请输入私钥密码"]; + [WSProgressHUD showErrorWithStatus:PrivatePasswordPasswordTfPlaceholder]; return; } - if ([self.delegate respondsToSelector:@selector(PrivatePasswordViewDelegate:)]) { + if ([self.delegate respondsToSelector:@selector(PrivatePasswordViewDelegate:)]) {; [self.delegate PrivatePasswordViewDelegate:_passwordTf.text]; + NSLog(@"========================password"); } } @@ -226,6 +228,7 @@ -(void)keyboardWillHide:(NSNotification *)notification - (void)dealloc { [[NSNotificationCenter defaultCenter]removeObserver:self name:UIKeyboardWillShowNotification object:nil]; [[NSNotificationCenter defaultCenter]removeObserver:self name:UIKeyboardWillHideNotification object:nil]; + returnKeyHandler = nil; } #pragma mark - UITextFieldDelegate diff --git a/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/AddCurrencyViewController.m b/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/AddCurrencyViewController.m index e42b388..02a6277 100644 --- a/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/AddCurrencyViewController.m +++ b/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/AddCurrencyViewController.m @@ -10,11 +10,6 @@ #import "ScanAdressViewController.h" #import "ScanCodeViewController.h" -#define AddCurrencyVCTitle @"新增代币" -#define AddCurrencyVCCurrencyNameTf @"请输入代币名称" -#define AddCurrencyVCCurrencyAdressTf @"请输入代币地址" -#define AddCurrencyVCaccuracyTf @"请输入代币精度 (位数)" - @interface AddCurrencyViewController () @property(nonatomic, strong)UIScrollView *contentView; @@ -181,7 +176,7 @@ -(void)createView }]; _cormfirmButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_cormfirmButton setTitle:@"确认增加" forState:UIControlStateNormal]; + [_cormfirmButton setTitle:AddCurrencyVCCormfirmButton forState:UIControlStateNormal]; [_cormfirmButton setTitleColor:kWhiteColor forState:UIControlStateNormal]; _cormfirmButton.backgroundColor = [UIColor colorWithHexString:@"#4c7afd"]; _cormfirmButton.titleLabel.font = Font(16); @@ -228,12 +223,15 @@ -(void)cormfirmAction:(UIButton *)btn [WSProgressHUD showErrorWithStatus:AddCurrencyVCaccuracyTf]; return; } + NSString *currencyAdress = [_currencyAdressTf.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; + NSString *currencyName = [_currencyNameTf.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; + NSString *accuracyStr = [_accuracyTf.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; - NSString *signSHA256 = [_aWrapper PKCSSignBytesSHA256withRSA:_currencyAdressTf.text privateStr:[BoxDataManager sharedManager].privateKeyBase64]; - NSInteger accuracy = [_accuracyTf.text integerValue]; + NSString *signSHA256 = [_aWrapper PKCSSignBytesSHA256withRSA:currencyAdress privateStr:[BoxDataManager sharedManager].privateKeyBase64]; + NSInteger accuracy = [accuracyStr integerValue]; NSMutableDictionary *paramsDic = [[NSMutableDictionary alloc]init]; - [paramsDic setObject: _currencyNameTf.text forKey:@"tokenname"]; - [paramsDic setObject:_currencyAdressTf.text forKey:@"contractaddr"]; + [paramsDic setObject: currencyName forKey:@"tokenname"]; + [paramsDic setObject:currencyAdress forKey:@"contractaddr"]; [paramsDic setObject:@(accuracy) forKey:@"decimals"]; [paramsDic setObject:signSHA256 forKey:@"sign"]; [paramsDic setObject:[BoxDataManager sharedManager].app_account_id forKey:@"applyerid"]; @@ -242,8 +240,8 @@ -(void)cormfirmAction:(UIButton *)btn [WSProgressHUD dismiss]; NSDictionary *dict = responseObject; if ([dict[@"RspNo"] integerValue] == 0) { - [WSProgressHUD showSuccessWithStatus:@"新增成功"]; - [[NewsInfoModel sharedManager] insertNewsInfoNews:[NSString stringWithFormat:@"%@%@", @"开户",_currencyNameTf.text]]; + [WSProgressHUD showSuccessWithStatus:AddCurrencyVCAddSuccess]; + [[NewsInfoModel sharedManager] insertNewsInfoNews:[NSString stringWithFormat:@"%@%@", OpenAccount,currencyName]]; if ([self.delegate respondsToSelector:@selector(addCurrencyDelegateReflesh)]) { [self.navigationController popViewControllerAnimated:YES]; [self.delegate addCurrencyDelegateReflesh]; diff --git a/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/ApprovalBusinessDetailViewController.m b/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/ApprovalBusinessDetailViewController.m index d1b3fce..49d4238 100644 --- a/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/ApprovalBusinessDetailViewController.m +++ b/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/ApprovalBusinessDetailViewController.m @@ -18,19 +18,12 @@ #define CellReuseIdentifier @"ApprovalBusinessDetail" #define headerReusableViewIdentifier @"ApprovalBusinessDetail" -#define ApprovalBusinessDetailVCAgreeApprovalBtn @"同意审批" -#define ApprovalBusinessDetailVCRefuseApprovalBtn @"拒绝审批" -#define ApprovalBusinessDetailApprovaling @"审批中" -#define ApprovalBusinessDetailSucceed @"审批通过" -#define ApprovalBusinessDetailFail @"已拒绝审批" -#define ApprovalBusinessDetailAwait @"待审批" -#define ApprovalBusinessDetailAgreen @"已同意审批" - @interface ApprovalBusinessDetailViewController () { NSInteger tagIn; NSString *reasonStr; + IQKeyboardReturnKeyHandler *returnKeyHandler; } @property(nonatomic, strong)ApprovalBusinessTopView *approvalBusinessTopView; @@ -67,6 +60,8 @@ - (void)viewDidLoad { [self layoutCollectionView]; [self createCollectionView:0]; [self requestData]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textViewEditChanged:) name:UITextFieldTextDidChangeNotification object:nil]; + returnKeyHandler = [[IQKeyboardReturnKeyHandler alloc] initWithViewController:self]; } #pragma mark ----- 布局 ----- @@ -196,7 +191,7 @@ -(void)handleApprovalAction:(NSString *)passwordStr MemberInfoModel *menberInfoModel = menberArr[0]; BOOL veryOK = [_aWrapper PKCSVerifyBytesSHA256withRSA:Flow signature:Sign publicStr:menberInfoModel.publicKey]; if (!veryOK) { - [WSProgressHUD showErrorWithStatus:@"非法审批流"]; + [WSProgressHUD showErrorWithStatus:IllegalApprovalFlow]; return; } } @@ -223,10 +218,10 @@ -(void)handleApprovalAction:(NSString *)passwordStr _approvalStateBtn.hidden = NO; if (tagIn == 0) { [_approvalStateBtn setTitle:ApprovalBusinessDetailFail forState:UIControlStateNormal]; - [[NewsInfoModel sharedManager] insertNewsInfoNews:[NSString stringWithFormat:@"%@%@", @"拒绝审批",_model.Name]]; + [[NewsInfoModel sharedManager] insertNewsInfoNews:[NSString stringWithFormat:@"%@%@", ApprovalBusinessDetailVCRefuseApprovalBtn,_model.Name]]; }else if(tagIn == 1){ [_approvalStateBtn setTitle:ApprovalBusinessDetailAgreen forState:UIControlStateNormal]; - [[NewsInfoModel sharedManager] insertNewsInfoNews:[NSString stringWithFormat:@"%@%@", @"同意审批",_model.Name]]; + [[NewsInfoModel sharedManager] insertNewsInfoNews:[NSString stringWithFormat:@"%@%@", ApprovalBusinessDetailVCAgreeApprovalBtn,_model.Name]]; } }else{ [ProgressHUD showStatus:[responseObject[@"RspNo"] integerValue]]; @@ -250,6 +245,36 @@ -(void)approvalAction:(UIButton *)btn } } +- (void)textViewEditChanged:(NSNotification *)notification{ + UIAlertController *alertController = (UIAlertController *)self.presentedViewController; + if (alertController) { + UITextField *textField = alertController.textFields.firstObject; + UIAlertAction *submitAction = alertController.actions.lastObject; + submitAction.enabled = textField.text.length > 0; + // 需要限制的长度 + NSUInteger maxLength = 0; + maxLength = 50; + if (maxLength == 0) return; + // text field 的内容 + NSString *contentText = textField.text; + // 获取高亮内容的范围 + UITextRange *selectedRange = [textField markedTextRange]; + // 这行代码 可以认为是 获取高亮内容的长度 + NSInteger markedTextLength = [textField offsetFromPosition:selectedRange.start toPosition:selectedRange.end]; + // 没有高亮内容时,对已输入的文字进行操作 + if (markedTextLength == 0) { + // 如果 text field 的内容长度大于我们限制的内容长度 + if (contentText.length > maxLength) { + // 截取从前面开始maxLength长度的字符串 + // textField.text = [contentText substringToIndex:maxLength]; + // 此方法用于在字符串的一个range范围内,返回此range范围内完整的字符串的range + NSRange rangeRange = [contentText rangeOfComposedCharacterSequencesForRange:NSMakeRange(0, maxLength)]; + textField.text = [contentText substringWithRange:rangeRange]; + } + } + } +} + -(void)showInputReason { NSString *title = RefuseApproval; @@ -261,14 +286,16 @@ -(void)showInputReason textField.placeholder = RefuseApprovalPlacehode; textField.secureTextEntry = NO; }]; + UIAlertAction *actionCancel = [UIAlertAction actionWithTitle:cancelTitle style:UIAlertActionStyleCancel handler:nil]; + [alertDialog addAction:actionCancel]; UIAlertAction *submit = [UIAlertAction actionWithTitle:submitTitle style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { UITextField *textField = alertDialog.textFields.firstObject; reasonStr = textField.text; [self showPrivatePasswordView]; }]; [alertDialog addAction:submit]; - UIAlertAction *actionCancel = [UIAlertAction actionWithTitle:cancelTitle style:UIAlertActionStyleCancel handler:nil]; - [alertDialog addAction:actionCancel]; + submit.enabled = NO; + [self presentViewController:alertDialog animated:YES completion:nil]; } @@ -336,7 +363,7 @@ -(void)requestData [self headertViewChange:flowLimitArr.count * 30]; [_approvalBusinessTopView setValueWithData:mutableDic ]; NSArray *approvaled_infoArr = flowDic[@"approval_info"]; - [self footerViewChange:approvaled_infoArr]; + [self footerViewChange:approvaled_infoArr headFloat:flowLimitArr.count * 30]; for (NSDictionary *dic in approvaled_infoArr) { ApprovalBusinessDetailModel *model = [[ApprovalBusinessDetailModel alloc] initWithDict:dic]; [_approvaledInfoArray addObject:model]; @@ -368,7 +395,7 @@ -(void)headertViewChange:(CGFloat)headFloat _approvalBusinessTopView.frame = CGRectMake(0, -72 - 39 - 10 - headFloat, SCREEN_WIDTH - 22, 72 + 39 + 10 + headFloat); } --(void)footerViewChange:(NSArray *)array +-(void)footerViewChange:(NSArray *)array headFloat:(CGFloat)headFloat { CGFloat aa = 0.0; for (int i = 0; i < array.count; i ++) { @@ -377,10 +404,11 @@ -(void)footerViewChange:(NSArray *)array NSInteger approversAll = 0; NSInteger approversIn = model.approvers.count % 4; if (approversIn >= 1) { - approversAll = model.approvers.count / 4 + approversIn; + approversAll = model.approvers.count / 4 + 1; } aa = aa + 30 + approversAll * 45 + 10; } + _collectionView.contentInset = UIEdgeInsetsMake(72 + 39 + 10 + headFloat, 0, 60 + 50, 0); _approvalBusinessFooterView = [[ApprovalBusinessFooterView alloc] initWithFrame: CGRectMake(0,aa, SCREEN_WIDTH - 22, 60)]; _approvalBusinessFooterView.delegate = self; [_collectionView addSubview: _approvalBusinessFooterView]; @@ -416,7 +444,14 @@ -(void)showBtnApprovalState:(NSString *)state _approvalStateBtn.hidden = NO; _approvalBusinessTopView.rightLab.text = ApprovalBusinessDetailFail; [_approvalStateBtn setTitle:ApprovalBusinessDetailFail forState:UIControlStateNormal]; - }else{ + }else if([state isEqualToString:@"9"]){ + _agreeApprovalBtn.hidden = YES; + _refuseApprovalBtn.hidden = YES; + _approvalStateBtn.hidden = NO; + _approvalBusinessTopView.rightLab.text = ApprovalCancel; + [_approvalStateBtn setTitle:ApprovalCancel forState:UIControlStateNormal]; + } + else{ _agreeApprovalBtn.hidden = YES; _refuseApprovalBtn.hidden = YES; _approvalStateBtn.hidden = NO; @@ -465,6 +500,11 @@ - (void)createBarItem{ } +-(void)dealloc +{ + returnKeyHandler = nil; +} + -(void)backAction:(UIBarButtonItem *)barButtonItem { //[self.navigationController popViewControllerAnimated:YES]; diff --git a/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/ApprovalBusinessViewController.m b/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/ApprovalBusinessViewController.m index 0b9fa82..d8a08f0 100644 --- a/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/ApprovalBusinessViewController.m +++ b/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/ApprovalBusinessViewController.m @@ -13,7 +13,6 @@ #define PageSize 12 #define CellReuseIdentifier @"ApprovalBusiness" -#define ApprovalBusinessVCTitle @"审批流" @interface ApprovalBusinessViewController () @@ -48,7 +47,7 @@ - (UIView *)viewLayer{ if(_viewLayer) return _viewLayer; _viewLayer = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 200, 30)]; _viewLayer.backgroundColor = [UIColor clearColor]; - _segmentedView = [[UISegmentedControl alloc]initWithItems:@[@"待审批",@"已审批"]]; + _segmentedView = [[UISegmentedControl alloc]initWithItems:@[ApprovalBusinessVCSegmentedTitleOne,ApprovalBusinessVCSegmentedTitleTwo]]; [_segmentedView addTarget:self action:@selector(segmentedChangle) forControlEvents:UIControlEventValueChanged]; [_viewLayer addSubview:self.segmentedView]; self.segmentedView.frame = CGRectMake(30, 0, 200 - 60, 30); diff --git a/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/CurrencyAccountViewController.m b/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/CurrencyAccountViewController.m index 71c5306..546ff16 100644 --- a/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/CurrencyAccountViewController.m +++ b/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/CurrencyAccountViewController.m @@ -22,6 +22,7 @@ @interface CurrencyAccountViewController () @property(nonatomic, strong)UIScrollView *contentView; @@ -183,7 +178,7 @@ -(void)createView }]; _cormfirmButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_cormfirmButton setTitle:@"确认增加" forState:UIControlStateNormal]; + [_cormfirmButton setTitle:AddCurrencyVCCormfirmButton forState:UIControlStateNormal]; [_cormfirmButton setTitleColor:kWhiteColor forState:UIControlStateNormal]; _cormfirmButton.backgroundColor = [UIColor colorWithHexString:@"#4c7afd"]; _cormfirmButton.titleLabel.font = Font(16); @@ -233,11 +228,15 @@ -(void)cormfirmAction:(UIButton *)btn return; } - NSString *signSHA256 = [_aWrapper PKCSSignBytesSHA256withRSA:_currencyAdressTf.text privateStr:[BoxDataManager sharedManager].privateKeyBase64]; - NSInteger accuracy = [_accuracyTf.text integerValue]; + NSString *currencyAdress = [_currencyAdressTf.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; + NSString *currencyName = [_currencyNameTf.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; + NSString *accuracyStr = [_accuracyTf.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; + + NSString *signSHA256 = [_aWrapper PKCSSignBytesSHA256withRSA:currencyAdress privateStr:[BoxDataManager sharedManager].privateKeyBase64]; + NSInteger accuracy = [accuracyStr integerValue]; NSMutableDictionary *paramsDic = [[NSMutableDictionary alloc]init]; - [paramsDic setObject: _currencyNameTf.text forKey:@"tokenname"]; - [paramsDic setObject:_currencyAdressTf.text forKey:@"contractaddr"]; + [paramsDic setObject: currencyName forKey:@"tokenname"]; + [paramsDic setObject:currencyAdress forKey:@"contractaddr"]; [paramsDic setObject:@(accuracy) forKey:@"decimals"]; [paramsDic setObject:signSHA256 forKey:@"sign"]; [paramsDic setObject:[BoxDataManager sharedManager].app_account_id forKey:@"applyerid"]; @@ -246,7 +245,7 @@ -(void)cormfirmAction:(UIButton *)btn [WSProgressHUD dismiss]; NSDictionary *dict = responseObject; if ([dict[@"RspNo"] integerValue] == 0) { - [WSProgressHUD showSuccessWithStatus:@"新增成功"]; + [WSProgressHUD showSuccessWithStatus:AddCurrencyVCAddSuccess]; if ([self.delegate respondsToSelector:@selector(editCurrencyDelegateReflesh)]) { [self.navigationController popViewControllerAnimated:YES]; [self.delegate editCurrencyDelegateReflesh]; diff --git a/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/ScanAdressViewController.m b/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/ScanAdressViewController.m index 95ce321..7b3437a 100644 --- a/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/ScanAdressViewController.m +++ b/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/ScanAdressViewController.m @@ -8,13 +8,6 @@ #import "ScanAdressViewController.h" -#define ScanAdressVCTitle @" 授权码" -#define ScanAdressVCScanLab @"授权二维码" -#define ScanAdressVCDetailLab @"用员工App扫描以上二维码,进行授权" -#define ScanAdressVCAuthorizeBtn @"本机授权" -#define ScanAdressVCAleartLab @"为避免资金风险,请勿分享授权码给他人,截屏自动失效" -#define ScanAdressVCIknown @"我知道了" - @interface ScanAdressViewController () { NSTimer *registTimer; @@ -348,8 +341,8 @@ - (void)createBarItem{ -(void)backAction:(UIBarButtonItem *)barButtonItem { if (_aleartView.hidden) { - UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:@"返回将不再绑定正在扫描二维码的员工App" preferredStyle:UIAlertControllerStyleAlert]; - [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) { + UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:ScanAdressVCAlertMessage preferredStyle:UIAlertControllerStyleAlert]; + [alert addAction:[UIAlertAction actionWithTitle:Affirm style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) { [registTimer invalidate]; registTimer = nil; [codeTimer invalidate]; @@ -358,7 +351,7 @@ -(void)backAction:(UIBarButtonItem *)barButtonItem [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationUserDidTakeScreenshotNotification object:nil]; }]]; - [alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:nil]]; + [alert addAction:[UIAlertAction actionWithTitle:Cancel style:UIAlertActionStyleDefault handler:nil]]; [self presentViewController:alert animated:YES completion:nil]; }else{ [self dismissViewControllerAnimated:YES completion:nil]; diff --git a/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/ViewLogViewController.m b/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/ViewLogViewController.m index 1350d1d..ad64462 100644 --- a/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/ViewLogViewController.m +++ b/box-Authorizer/CodeClass/Secotion/ HomeSection/Controllers/ViewLogViewController.m @@ -42,10 +42,22 @@ -(void)requestData [[NetworkManager shareInstance] requestWithMethod:GET withUrl:@"/agent/approvaloplist" params:paramsDic success:^(id responseObject) { NSDictionary *dict = responseObject; if ([dict[@"RspNo"] integerValue] == 0) { + if (_page == 1) { + [_sourceArray removeAllObjects]; + } NSArray *listArray = dict[@"HashOperates"]; + if([listArray isKindOfClass:[NSNull class]]){ + return ; + } for (NSDictionary *listDic in listArray) { ViewLogModel *model = [[ViewLogModel alloc] initWithDict:listDic]; - [_sourceArray addObject:model]; + if ([model.Option isEqualToString:@"4"]) { + if([model.Opinion isEqualToString:@"5"] || [model.Opinion isEqualToString:@"2"] || [model.Opinion isEqualToString:@"7"]){ + [_sourceArray addObject:model]; + } + }else{ + [_sourceArray addObject:model]; + } } }else{ } @@ -60,9 +72,18 @@ -(void)reloadAction { dispatch_async(dispatch_get_main_queue(), ^{ [self.tableView reloadData]; + [self.tableView.mj_header endRefreshing]; }); } +-(void)headerReflesh +{ + _tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ + self.page = 1; + [self requestData]; + }]; +} + -(void)createView { [self createBarItem]; @@ -78,6 +99,7 @@ -(void)createView }]; [_tableView registerClass:[ViewLogTableViewCell class] forCellReuseIdentifier:CellReuseIdentifier]; _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; + [self headerReflesh]; } #pragma mark - createBarItem diff --git a/box-Authorizer/CodeClass/Secotion/ HomeSection/Views/ApprovalBusinessCollectionReusableView.m b/box-Authorizer/CodeClass/Secotion/ HomeSection/Views/ApprovalBusinessCollectionReusableView.m index 521d764..ec8761d 100644 --- a/box-Authorizer/CodeClass/Secotion/ HomeSection/Views/ApprovalBusinessCollectionReusableView.m +++ b/box-Authorizer/CodeClass/Secotion/ HomeSection/Views/ApprovalBusinessCollectionReusableView.m @@ -8,9 +8,6 @@ #import "ApprovalBusinessCollectionReusableView.h" -#define ApprovalMenber @"审批人员" -#define ApprovalMenberAmount @"需审批人数" - @implementation ApprovalBusinessCollectionReusableView -(id)initWithFrame:(CGRect)frame diff --git a/box-Authorizer/CodeClass/Secotion/ HomeSection/Views/ApprovalBusinessTableViewCell.m b/box-Authorizer/CodeClass/Secotion/ HomeSection/Views/ApprovalBusinessTableViewCell.m index 8e1de29..38fa594 100644 --- a/box-Authorizer/CodeClass/Secotion/ HomeSection/Views/ApprovalBusinessTableViewCell.m +++ b/box-Authorizer/CodeClass/Secotion/ HomeSection/Views/ApprovalBusinessTableViewCell.m @@ -7,12 +7,7 @@ // #import "ApprovalBusinessTableViewCell.h" - -#define ApprovalAwaitBusiness @"待审批" -#define ApprovalingBusiness @"审批中" -#define ApprovalSucceedBusiness @"审批成功" -#define ApprovalFailBusiness @"审批失败" - + @interface ApprovalBusinessTableViewCell() @property (nonatomic,strong) UILabel *approvalTitleLab; @@ -95,10 +90,12 @@ - (void)createView{ HASH_STATUS_0 = "0" //待申请 HASH_STATUS_1 = "1" //私钥已申请提交 HASH_STATUS_2 = "2" //私钥已拒绝提交 私钥A拒绝 - HASH_STATUS_3 = "3" //私链已申请确认 + HASH_STATUS_3 = "3" //私链已申请确认(日志) HASH_STATUS_4 = "4" //私链已同意确认 私钥B、私钥C均同意 HASH_STATUS_5 = "5" //私链已拒绝确认 私钥B、私钥C有不同意 - HASH_STATUS_6 = "6" //公链已同意 + HASH_STATUS_6 = "6" //私链已同意(日志) + HASH_STATUS_7 = "7" //公链已同意 + HASH_STATUS_8 = "8" //公链已拒绝 */ - (void)setDataWithModel:(ApprovalBusinessModel *)model @@ -110,7 +107,10 @@ - (void)setDataWithModel:(ApprovalBusinessModel *)model _approvalStateLab.text = ApprovalFailBusiness; }else if([model.Status isEqualToString:@"7"]){ _approvalStateLab.text = ApprovalSucceedBusiness; - }else { + }else if([model.Status isEqualToString:@"9"]){ + _approvalStateLab.text = ApprovalCancel; + } + else { _approvalStateLab.text = ApprovalingBusiness; } } diff --git a/box-Authorizer/CodeClass/Secotion/ HomeSection/Views/ApprovalBusinessTopView.m b/box-Authorizer/CodeClass/Secotion/ HomeSection/Views/ApprovalBusinessTopView.m index 6415461..1163262 100644 --- a/box-Authorizer/CodeClass/Secotion/ HomeSection/Views/ApprovalBusinessTopView.m +++ b/box-Authorizer/CodeClass/Secotion/ HomeSection/Views/ApprovalBusinessTopView.m @@ -9,10 +9,6 @@ #import "ApprovalBusinessTopView.h" #import "CurrencyDetailTableViewCell.h" -#define ApprovalBusinessDetailApprovaling @"审批中" -#define ApprovalBusinessDetailSucceed @"审批通过" -#define ApprovalBusinessDetailFail @"已拒绝审批" -#define ApprovalBusinessDetailAwait @"待审批" #define CellReuseIdentifier @"CurrencyDetailTableViewCell" @interface ApprovalBusinessTopView () diff --git a/box-Authorizer/CodeClass/Secotion/ HomeSection/Views/CurrencyAccountTableViewCell.m b/box-Authorizer/CodeClass/Secotion/ HomeSection/Views/CurrencyAccountTableViewCell.m index 565af6a..3487f18 100644 --- a/box-Authorizer/CodeClass/Secotion/ HomeSection/Views/CurrencyAccountTableViewCell.m +++ b/box-Authorizer/CodeClass/Secotion/ HomeSection/Views/CurrencyAccountTableViewCell.m @@ -8,8 +8,6 @@ #import "CurrencyAccountTableViewCell.h" -#define CurrencyAccountTableViewCellAddCurrency @"新增代币" - @interface CurrencyAccountTableViewCell() @property (nonatomic,strong) UILabel *currencyLab; @@ -48,8 +46,8 @@ - (void)createView{ [_checkImage mas_makeConstraints:^(MASConstraintMaker *make) { make.centerY.equalTo(_currencyLab); make.right.offset(-18); - make.height.offset(16); - make.width.offset(20); + make.height.offset(13); + make.width.offset(18); }]; _checkImage.hidden = YES; diff --git a/box-Authorizer/CodeClass/Secotion/ HomeSection/Views/ViewLogTableViewCell.m b/box-Authorizer/CodeClass/Secotion/ HomeSection/Views/ViewLogTableViewCell.m index 9405c18..5aa5ecb 100644 --- a/box-Authorizer/CodeClass/Secotion/ HomeSection/Views/ViewLogTableViewCell.m +++ b/box-Authorizer/CodeClass/Secotion/ HomeSection/Views/ViewLogTableViewCell.m @@ -84,7 +84,7 @@ - (void)setDataWithModel:(ViewLogModel *)model value:[UIColor redColor] range:NSMakeRange(CaptainName.length, str.length - CaptainName.length)]; _leftLab.attributedText = strHolder; - _bottomLab.text = [NSString stringWithFormat:@"%@:%@", Reason, CaptainName]; + _bottomLab.text = [NSString stringWithFormat:@"%@:%@", Reason, model.Opinion]; break; } case 1: @@ -94,7 +94,21 @@ - (void)setDataWithModel:(ViewLogModel *)model } case 2: { - _leftLab.text = [NSString stringWithFormat:@"%@%@", CaptainName, ApprovalBusinessSucceed]; + _leftLab.text = [NSString stringWithFormat:@"%@%@", model.ApplyerAccount, ApprovalBusinessCancel]; + break; + } + case 3: + { + _leftLab.text = [NSString stringWithFormat:@"%@%@", model.ApplyerAccount, ApprovalCreate]; + break; + } + case 4: + { + if([model.Opinion isEqualToString:@"5"] || [model.Opinion isEqualToString:@"2"]){ + _leftLab.text = SystemApprovalFail; + }else if([model.Opinion isEqualToString:@"7"]){ + _leftLab.text = SystemApprovalSucceed; + } break; } @@ -107,12 +121,11 @@ - (void)setDataWithModel:(ViewLogModel *)model + (CGFloat)defaultHeight:(ViewLogModel *)model { - if ([model.Option integerValue] == ApprovalFail) { + if ([model.Option integerValue] == 0) { return 51; - }else if([model.Option integerValue] == ApprovalSucceed){ + }else { return 28; } - return 28; } - (NSString *)getElapseTimeToString:(NSInteger)second{ diff --git a/box-Authorizer/CodeClass/Secotion/LeftSection/Controllers/AboutBoxViewController.m b/box-Authorizer/CodeClass/Secotion/LeftSection/Controllers/AboutBoxViewController.m index 8adf40d..8300de8 100644 --- a/box-Authorizer/CodeClass/Secotion/LeftSection/Controllers/AboutBoxViewController.m +++ b/box-Authorizer/CodeClass/Secotion/LeftSection/Controllers/AboutBoxViewController.m @@ -8,9 +8,6 @@ #import "AboutBoxViewController.h" - -#define AboutBoxVCTitle @"关于BOX" - @interface AboutBoxViewController () @end @@ -22,7 +19,7 @@ - (void)viewDidLoad { // Do any additional setup after loading the view. self.view.backgroundColor = kWhiteColor; self.navigationController.navigationBar.hidden = NO; - self.title = AboutBoxVCTitle; + self.title = AboutBOX; [self createBarItem]; [self createView]; } @@ -43,7 +40,7 @@ -(void)createView NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; NSString *app_Version = [infoDictionary objectForKey:@"CFBundleShortVersionString"]; UILabel *versonlab = [[UILabel alloc] init]; - versonlab.text = [NSString stringWithFormat:@"当前版本号 V%@",app_Version]; + versonlab.text = [NSString stringWithFormat:@"%@ V%@",CurrentVersion,app_Version]; versonlab.font = Font(14); versonlab.textAlignment = NSTextAlignmentCenter; versonlab.textColor = [UIColor colorWithHexString:@"#999999"]; diff --git a/box-Authorizer/CodeClass/Secotion/LeftSection/Controllers/AssetAmountListViewController.m b/box-Authorizer/CodeClass/Secotion/LeftSection/Controllers/AssetAmountListViewController.m index a70de7e..f66135d 100644 --- a/box-Authorizer/CodeClass/Secotion/LeftSection/Controllers/AssetAmountListViewController.m +++ b/box-Authorizer/CodeClass/Secotion/LeftSection/Controllers/AssetAmountListViewController.m @@ -30,7 +30,7 @@ - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. self.view.backgroundColor = kWhiteColor; - self.title = [NSString stringWithFormat:@"%@明细",_currency]; + self.title = [NSString stringWithFormat:@"%@%@",_currency,Detailed]; _sourceArray = [[NSMutableArray alloc] init]; [self createView]; _page = 1; diff --git a/box-Authorizer/CodeClass/Secotion/LeftSection/Controllers/AssetAmountViewController.m b/box-Authorizer/CodeClass/Secotion/LeftSection/Controllers/AssetAmountViewController.m index 8ff2c29..2a8e46f 100644 --- a/box-Authorizer/CodeClass/Secotion/LeftSection/Controllers/AssetAmountViewController.m +++ b/box-Authorizer/CodeClass/Secotion/LeftSection/Controllers/AssetAmountViewController.m @@ -13,8 +13,7 @@ #define PageSize 12 #define CellReuseIdentifier @"AssetAmount" -#define AssetAmountVCTitle @"资产总览" - + @interface AssetAmountViewController () @property (nonatomic,strong) UITableView *tableView; @@ -30,7 +29,7 @@ - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. self.view.backgroundColor = kWhiteColor; - self.title = AssetAmountVCTitle; + self.title = AssetOverview; self.navigationController.navigationBar.hidden = NO; _sourceArray = [[NSMutableArray alloc] init]; self.page = 1; diff --git a/box-Authorizer/CodeClass/Secotion/LeftSection/Controllers/LanguageSwitchViewController.m b/box-Authorizer/CodeClass/Secotion/LeftSection/Controllers/LanguageSwitchViewController.m index e39ea9a..b5d83f0 100644 --- a/box-Authorizer/CodeClass/Secotion/LeftSection/Controllers/LanguageSwitchViewController.m +++ b/box-Authorizer/CodeClass/Secotion/LeftSection/Controllers/LanguageSwitchViewController.m @@ -8,7 +8,10 @@ #import "LanguageSwitchViewController.h" #import "LanguageSwitchModel.h" +#import "languageSwitchTableViewCell.h" + #define LanguageSwitchTitle @"语言" +#define CellReuseIdentifier @"languageSwitch" @interface LanguageSwitchViewController () @@ -33,8 +36,8 @@ - (void)viewDidLoad { [self createView]; NSDictionary *dict = @{ @"data":@[ - @{@"titleName":@"中文"}, - @{@"titleName":@"英文"} + @{@"titleName":SimplifiedChinese,@"select":@(YES)}, + @{@"titleName":@"English",@"select":@(NO)} ] }; for (NSDictionary *dataDic in dict[@"data"]) { @@ -56,7 +59,7 @@ -(void)createView make.right.offset(-0); make.bottom.equalTo(self.view.mas_bottom).offset(0); }]; - _tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; + [_tableView registerClass:[languageSwitchTableViewCell class] forCellReuseIdentifier:CellReuseIdentifier]; // 去掉底部多余的表格线 [_tableView setTableFooterView:[[UIView alloc] initWithFrame:CGRectZero]]; } @@ -70,23 +73,25 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPa } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ - static NSString *identifier = @"languageSwitch"; - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; - if (cell == nil) { - cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:identifier]; - } - cell.accessoryType = UITableViewCellAccessoryNone; + languageSwitchTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellReuseIdentifier forIndexPath:indexPath]; LanguageSwitchModel *model = self.sourceArray[indexPath.row]; - cell.textLabel.text = model.titleName; + cell.model = model; + [cell setDataWithModel:model]; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - [self.navigationController popViewControllerAnimated:YES]; - [self.sidePanelController setCenterPanelHidden:NO]; - //[self.sidePanelController showCenterPanelAnimated:NO]; - self.navigationController.navigationBar.hidden = YES; + LanguageSwitchModel *model = self.sourceArray[indexPath.row]; + for (LanguageSwitchModel *languageSwitchModel in self.sourceArray) { + if (![languageSwitchModel.titleName isEqualToString:model.titleName]) { + if (languageSwitchModel.select) { + model.select = languageSwitchModel.select; + languageSwitchModel.select = !languageSwitchModel.select; + } + } + } + [self.tableView reloadData]; } #pragma mark - createBarItem @@ -94,6 +99,19 @@ - (void)createBarItem{ UIImage *leftImage = [[UIImage imageNamed:@"icon_back"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; UIBarButtonItem *buttonLeft = [[UIBarButtonItem alloc]initWithImage:leftImage style:UIBarButtonItemStylePlain target:self action:@selector(backAction:)]; self.navigationItem.leftBarButtonItem = buttonLeft; + + UIBarButtonItem *buttonRight = [[UIBarButtonItem alloc]initWithTitle:Affirm style:UIBarButtonItemStyleDone target:self action:@selector(rightButtonAction:)]; + self.navigationItem.rightBarButtonItem = buttonRight; + [self.navigationItem.rightBarButtonItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:Font(15),NSFontAttributeName,[UIColor colorWithHexString:@"#666666"],NSForegroundColorAttributeName, nil] forState:UIControlStateSelected]; + [self.navigationItem.rightBarButtonItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:Font(15),NSFontAttributeName,[UIColor colorWithHexString:@"#666666"],NSForegroundColorAttributeName, nil] forState:UIControlStateNormal]; +} + +#pragma mark ----- rightBarButtonItemAction ----- +- (void)rightButtonAction:(UIBarButtonItem *)buttonItem{ + [self.navigationController popViewControllerAnimated:YES]; + [self.sidePanelController setCenterPanelHidden:NO]; + //[self.sidePanelController showCenterPanelAnimated:NO]; + self.navigationController.navigationBar.hidden = YES; } -(void)backAction:(UIBarButtonItem *)barButtonItem diff --git a/box-Authorizer/CodeClass/Secotion/LeftSection/Controllers/ModifyServerAddressViewController.m b/box-Authorizer/CodeClass/Secotion/LeftSection/Controllers/ModifyServerAddressViewController.m index 21b337f..89ee9b9 100644 --- a/box-Authorizer/CodeClass/Secotion/LeftSection/Controllers/ModifyServerAddressViewController.m +++ b/box-Authorizer/CodeClass/Secotion/LeftSection/Controllers/ModifyServerAddressViewController.m @@ -7,12 +7,6 @@ // #import "ModifyServerAddressViewController.h" -#define ModifyServerAddressVCTitle @"修改服务器地址" -#define ModifyServerAddressVCAddress @"地址" -#define ModifyServerAddressVCInfo @"请输入服务器地址" -#define ModifyServerAddressVCAleartSucceed @"修改成功" -#define ModifyServerAddressVCVerifyBtn @"确认修改" - @interface ModifyServerAddressViewController () diff --git a/box-Authorizer/CodeClass/Secotion/LeftSection/Models/LanguageSwitchModel.h b/box-Authorizer/CodeClass/Secotion/LeftSection/Models/LanguageSwitchModel.h index 0512a68..ebe8e12 100644 --- a/box-Authorizer/CodeClass/Secotion/LeftSection/Models/LanguageSwitchModel.h +++ b/box-Authorizer/CodeClass/Secotion/LeftSection/Models/LanguageSwitchModel.h @@ -11,6 +11,7 @@ @interface LanguageSwitchModel : NSObject @property (nonatomic,strong) NSString *titleName; +@property (nonatomic,assign) BOOL select; - (instancetype)initWithDict:(NSDictionary *)dict; @end diff --git a/box-Authorizer/CodeClass/Secotion/LeftSection/Models/LanguageSwitchModel.m b/box-Authorizer/CodeClass/Secotion/LeftSection/Models/LanguageSwitchModel.m index 238472f..4335787 100644 --- a/box-Authorizer/CodeClass/Secotion/LeftSection/Models/LanguageSwitchModel.m +++ b/box-Authorizer/CodeClass/Secotion/LeftSection/Models/LanguageSwitchModel.m @@ -21,6 +21,9 @@ - (instancetype)initWithDict:(NSDictionary *)dict if(![dict[@"titleName"] isKindOfClass:[NSNull class]]){ self.titleName = [dict objectForKey:@"titleName"]; } + if(![dict[@"select"] isKindOfClass:[NSNull class]]){ + self.select = [[dict objectForKey:@"select"] boolValue]; + } } return self; } diff --git a/box-Authorizer/CodeClass/Secotion/LeftSection/Views/TransferCollectionReusableView.m b/box-Authorizer/CodeClass/Secotion/LeftSection/Views/TransferCollectionReusableView.m index d60b4d5..fbfb4b0 100644 --- a/box-Authorizer/CodeClass/Secotion/LeftSection/Views/TransferCollectionReusableView.m +++ b/box-Authorizer/CodeClass/Secotion/LeftSection/Views/TransferCollectionReusableView.m @@ -8,9 +8,6 @@ #import "TransferCollectionReusableView.h" -#define ApprovalMenber @"审批人员" -#define ApprovalMenberAmount @"需审批人数" - @implementation TransferCollectionReusableView -(id)initWithFrame:(CGRect)frame diff --git a/box-Authorizer/CodeClass/Secotion/LeftSection/Views/TransferRecordTableViewCell.m b/box-Authorizer/CodeClass/Secotion/LeftSection/Views/TransferRecordTableViewCell.m index 2191e16..6d0631a 100644 --- a/box-Authorizer/CodeClass/Secotion/LeftSection/Views/TransferRecordTableViewCell.m +++ b/box-Authorizer/CodeClass/Secotion/LeftSection/Views/TransferRecordTableViewCell.m @@ -7,15 +7,7 @@ // #import "TransferRecordTableViewCell.h" - -#define TransferRecordTableViewCellTransferingAwait @"待审批" -#define TransferRecordTableViewCellTransfering @"审批中" -#define TransferRecordTableViewCellTransferStateSucceed @"同意审批(转账成功)" -#define TransferRecordTableViewCellTransferStateSucceedTransfing @"同意审批(转账中)" -#define TransferRecordTableViewCellTransferStateFail @"同意审批(转账失败)" -#define TransferRecordTableViewCellRecharge @"充值成功" -#define TransferRecordTableViewCellTransferFail @"拒绝审批" - + @interface TransferRecordTableViewCell() @property (nonatomic,strong) UILabel *topLeftLab; @@ -154,7 +146,7 @@ -(void)handleProgress:(TransferAwaitModel *)model - (NSString *)getElapseTimeToString:(NSInteger)second{ NSDateFormatter *dateformatter1 = [[NSDateFormatter alloc] init]; - [dateformatter1 setDateFormat:@"M月d日 HH:mm"]; + [dateformatter1 setDateFormat:@"MM:dd HH:mm"]; NSTimeInterval timeInterval1 = second; NSDate *date1 = [NSDate dateWithTimeIntervalSince1970:timeInterval1]; NSString *dateStr1=[dateformatter1 stringFromDate:date1]; diff --git a/box-Authorizer/CodeClass/Secotion/LeftSection/Views/languageSwitchTableViewCell.h b/box-Authorizer/CodeClass/Secotion/LeftSection/Views/languageSwitchTableViewCell.h new file mode 100644 index 0000000..bb3f55d --- /dev/null +++ b/box-Authorizer/CodeClass/Secotion/LeftSection/Views/languageSwitchTableViewCell.h @@ -0,0 +1,18 @@ +// +// languageSwitchTableViewCell.h +// box-Authorizer +// +// Created by Yu Huang on 2018/7/24. +// Copyright © 2018年 2se. All rights reserved. +// + +#import +#import "LanguageSwitchModel.h" + +@interface languageSwitchTableViewCell : UITableViewCell + +@property (nonatomic,strong) LanguageSwitchModel *model; + +- (void)setDataWithModel:(LanguageSwitchModel *)model; + +@end diff --git a/box-Authorizer/CodeClass/Secotion/LeftSection/Views/languageSwitchTableViewCell.m b/box-Authorizer/CodeClass/Secotion/LeftSection/Views/languageSwitchTableViewCell.m new file mode 100644 index 0000000..5340aad --- /dev/null +++ b/box-Authorizer/CodeClass/Secotion/LeftSection/Views/languageSwitchTableViewCell.m @@ -0,0 +1,73 @@ +// +// languageSwitchTableViewCell.m +// box-Authorizer +// +// Created by Yu Huang on 2018/7/24. +// Copyright © 2018年 2se. All rights reserved. +// + +#import "languageSwitchTableViewCell.h" + +@interface languageSwitchTableViewCell() + +@property (nonatomic,strong) UILabel *titleLab; +@property (nonatomic,strong) UIView *lineView; +@property (nonatomic,strong) UIImageView *checkImage; + +@end + +@implementation languageSwitchTableViewCell + +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + self.selectionStyle = UITableViewCellSelectionStyleNone; + self.backgroundColor = [UIColor whiteColor]; + [self createView]; + return self; +} + +- (void)createView{ + _titleLab = [[UILabel alloc]init]; + _titleLab.font = Font(14); + _titleLab.textColor = [UIColor colorWithHexString:@"#333333"]; + [self.contentView addSubview:_titleLab]; + [_titleLab mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.offset(0); + make.bottom.offset(0); + make.left.offset(15); + }]; + + _checkImage = [[UIImageView alloc] init]; + _checkImage.image = [UIImage imageNamed:@"icon_check"]; + [self.contentView addSubview:_checkImage]; + [_checkImage mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.equalTo(_titleLab); + make.right.offset(-18); + make.height.offset(13); + make.width.offset(18); + }]; + _checkImage.hidden = YES; +} + +- (void)setDataWithModel:(LanguageSwitchModel *)model +{ + if (model.select) { + _checkImage.hidden = NO; + }else{ + _checkImage.hidden = YES; + } + _titleLab.text = model.titleName; +} + +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/box-Authorizer/Macro/Localizable.h b/box-Authorizer/Macro/Localizable.h index 65e799c..5499cc6 100644 --- a/box-Authorizer/Macro/Localizable.h +++ b/box-Authorizer/Macro/Localizable.h @@ -25,5 +25,174 @@ #define RefuseApprovalPlacehode NSLocalizedString(@"RefuseApprovalPlacehode", nil) #define Cancel NSLocalizedString(@"Cancel", nil) #define RefuseTransfer NSLocalizedString(@"RefuseTransfer", nil) +#define InitAccountVCTitle NSLocalizedString(@"InitAccountVCTitle", nil) +#define PerfectInformationVCLaber NSLocalizedString(@"PerfectInformationVCLaber", nil) +#define PerfectInformationVCSubLaber NSLocalizedString(@"PerfectInformationVCSubLaber", nil) +#define ScanCodeVCTitle NSLocalizedString(@"ScanCodeVCTitle", nil) +#define PerfectInformationVCTorchlight NSLocalizedString(@"PerfectInformationVCTorchlight", nil) +#define PerfectInformationVCTorchheight NSLocalizedString(@"PerfectInformationVCTorchheight", nil) +#define PerfectInformationVCScanResult NSLocalizedString(@"PerfectInformationVCScanResult", nil) +#define PerfectInformationVCErrorCode NSLocalizedString(@"PerfectInformationVCErrorCode", nil) +#define Handing NSLocalizedString(@"Handing", nil) +#define PerfectInformationVCTitle NSLocalizedString(@"PerfectInformationVCTitle", nil) +#define PerfectInformationVCNameText NSLocalizedString(@"PerfectInformationVCNameText", nil) +#define PerfectInformationVCPasswordText NSLocalizedString(@"PerfectInformationVCPasswordText", nil) +#define PerfectInformationVCVerifyText NSLocalizedString(@"PerfectInformationVCVerifyText", nil) +#define PerfectInformationVCAlert NSLocalizedString(@"PerfectInformationVCAlert", nil) +#define Submit NSLocalizedString(@"Submit", nil) +#define PerfectInformationVCAlertOne NSLocalizedString(@"PerfectInformationVCAlertOne", nil) +#define PerfectInformationVCAlertTwo NSLocalizedString(@"PerfectInformationVCAlertTwo", nil) +#define PerfectInformationVCAlertThree NSLocalizedString(@"PerfectInformationVCAlertThree", nil) +#define PerfectInformationVCCheckPwd NSLocalizedString(@"PerfectInformationVCCheckPwd", nil) +#define SubmissionCompletion NSLocalizedString(@"SubmissionCompletion", nil) +#define BackupVCContentlab NSLocalizedString(@"BackupVCContentlab", nil) +#define BackupVCbackupButton NSLocalizedString(@"BackupVCbackupButton", nil) +#define BackupVCSVProgressOne NSLocalizedString(@"BackupVCSVProgressOne", nil) +#define BackupVCWSProgressTwo NSLocalizedString(@"BackupVCWSProgressTwo", nil) +#define ServiceStartAwaitBtn NSLocalizedString(@"ServiceStartAwaitBtn", nil) +#define NextStep NSLocalizedString(@"NextStep", nil) +#define AwaitBackupVCContentLabText NSLocalizedString(@"AwaitBackupVCContentLabText", nil) +#define AwaitBackupVCContentLabStatusText NSLocalizedString(@"AwaitBackupVCContentLabStatusText", nil) +#define AwaitBackupVnextButtonTitle NSLocalizedString(@"AwaitBackupVnextButtonTitle", nil) +#define AwaitBackupVCContentLabNextText NSLocalizedString(@"AwaitBackupVCContentLabNextText", nil) +#define BlueToothListVCTitle NSLocalizedString(@"BlueToothListVCTitle", nil) +#define GenerateContractVCTitle NSLocalizedString(@"GenerateContractVCTitle", nil) +#define GenerateContractVCScanLab NSLocalizedString(@"GenerateContractVCScanLab", nil) +#define GenerateContractVCAccountCopyBtn NSLocalizedString(@"GenerateContractVCAccountCopyBtn", nil) +#define GenerateContractVCAccountSaveBtn NSLocalizedString(@"GenerateContractVCAccountSaveBtn", nil) +#define GenerateContractVCscanTwoLab NSLocalizedString(@"GenerateContractVCscanTwoLab", nil) +#define GenerateContractVCprivateBtn NSLocalizedString(@"GenerateContractVCprivateBtn", nil) +#define GenerateContractVserviceStartBtn NSLocalizedString(@"GenerateContractVserviceStartBtn", nil) +#define CopyAddressSucceed NSLocalizedString(@"CopyAddressSucceed", nil) +#define SaveFailure NSLocalizedString(@"SaveFailure", nil) +#define SavePicturesucceed NSLocalizedString(@"SavePicturesucceed", nil) +#define PasswordWaitingForCheck NSLocalizedString(@"PasswordWaitingForCheck", nil) +#define ServiceException NSLocalizedString(@"ServiceException", nil) +#define CheckPasswordFailed NSLocalizedString(@"CheckPasswordFailed", nil) +#define Refresh NSLocalizedString(@"Refresh", nil) +#define ServiceStartTitle NSLocalizedString(@"ServiceStartTitle", nil) +#define ServiceStartLaunchUnstart NSLocalizedString(@"ServiceStartLaunchUnstart", nil) +#define ServiceStartLaunchState NSLocalizedString(@"ServiceStartLaunchState", nil) +#define ServiceStartLaunchStateSecceed NSLocalizedString(@"ServiceStartLaunchStateSecceed", nil) +#define ServiceStartPassword NSLocalizedString(@"ServiceStartPassword", nil) +#define ServiceStartRepassword NSLocalizedString(@"ServiceStartRepassword", nil) +#define ServiceStartCommitStart NSLocalizedString(@"ServiceStartCommitStart", nil) +#define ServiceStartCommitStartUse NSLocalizedString(@"ServiceStartCommitStartUse", nil) +#define ServiceStateTitle NSLocalizedString(@"ServiceStateTitle", nil) +#define ServiceStateDetail NSLocalizedString(@"ServiceStateDetail", nil) +#define ServiceStartAleartOne NSLocalizedString(@"ServiceStartAleartOne", nil) +#define ServiceStartAleartTwo NSLocalizedString(@"ServiceStartAleartTwo", nil) +#define ServiceStartPwdTitle NSLocalizedString(@"ServiceStartPwdTitle", nil) +#define StartupServiceFailed NSLocalizedString(@"StartupServiceFailed", nil) +#define AllPrivateAppStartedService NSLocalizedString(@"AllPrivateAppStartedService", nil) +#define BackupViewBackupLab NSLocalizedString(@"BackupViewBackupLab", nil) +#define BackupViewBackupText NSLocalizedString(@"BackupViewBackupText", nil) +#define BackupViewAlertLab NSLocalizedString(@"BackupViewAlertLab", nil) +#define BackupViewCheckPwd NSLocalizedString(@"BackupViewCheckPwd", nil) +#define Confirm NSLocalizedString(@"Confirm", nil) +#define ConnectionSuccess NSLocalizedString(@"ConnectionSuccess", nil) +#define Unconnected NSLocalizedString(@"Unconnected", nil) +#define PrintAlertViewPrinting NSLocalizedString(@"PrintAlertViewPrinting", nil) +#define PrintImmediately NSLocalizedString(@"PrintImmediately", nil) +#define Reprint NSLocalizedString(@"Reprint", nil) +#define PrintSuccessfully NSLocalizedString(@"PrintSuccessfully", nil) +#define PrintAlertViewAlertLabText NSLocalizedString(@"PrintAlertViewAlertLabText", nil) +#define GenerateContract NSLocalizedString(@"GenerateContract", nil) +#define PrintAlertViewBTPrinting NSLocalizedString(@"PrintAlertViewBTPrinting", nil) +#define PrintAlertViewBTConnectFail NSLocalizedString(@"PrintAlertViewBTConnectFail", nil) + +#define PrivatePasswordbackupLab NSLocalizedString(@"PrivatePasswordbackupLab", nil) +#define PrivatePasswordComfirm NSLocalizedString(@"PrivatePasswordComfirm", nil) +#define PrivatePasswordPasswordTfPlaceholder NSLocalizedString(@"PrivatePasswordPasswordTfPlaceholder", nil) +#define HomepageMidOneLabStop NSLocalizedString(@"HomepageMidOneLabStop", nil) +#define HomepageMidOneLabStart NSLocalizedString(@"HomepageMidOneLabStart", nil) +#define HomepageMidOneLabDetailStop NSLocalizedString(@"HomepageMidOneLabDetailStop", nil) +#define HomepageMidOneLabDetailStart NSLocalizedString(@"HomepageMidOneLabDetailStart", nil) +#define HomepageMidOneLabDetailError NSLocalizedString(@"HomepageMidOneLabDetailError", nil) +#define HomepageMidTwoLab NSLocalizedString(@"HomepageMidTwoLab", nil) +#define HomepageMidThreeLab NSLocalizedString(@"HomepageMidThreeLab", nil) +#define HomepageMidFourLab NSLocalizedString(@"HomepageMidFourLab", nil) +#define HomepageMidFourDetailLab NSLocalizedString(@"HomepageMidFourDetailLab", nil) +#define HomepageFootTitle NSLocalizedString(@"HomepageFootTitle", nil) +#define HomepageTitle NSLocalizedString(@"HomepageTitle", nil) +#define HomepageNoApproval NSLocalizedString(@"HomepageNoApproval", nil) +#define HomepageNoCurrency NSLocalizedString(@"HomepageNoCurrency", nil) +#define OpenApp NSLocalizedString(@"OpenApp", nil) +#define NoDynamic NSLocalizedString(@"NoDynamic", nil) +#define WaitCheck NSLocalizedString(@"WaitCheck", nil) +#define StartedService NSLocalizedString(@"StartedService", nil) +#define StoppedService NSLocalizedString(@"StoppedService", nil) +#define NotConnected NSLocalizedString(@"NotConnected", nil) +#define AssetOverview NSLocalizedString(@"AssetOverview", nil) +#define ServerAddress NSLocalizedString(@"ServerAddress", nil) +#define Language NSLocalizedString(@"Language", nil) +#define AboutBOX NSLocalizedString(@"AboutBOX", nil) +#define HomepageSeverStartLaber NSLocalizedString(@"HomepageSeverStartLaber", nil) +#define HomepageSeverStopLaber NSLocalizedString(@"HomepageSeverStopLaber", nil) +#define HomepageSeverStartButton NSLocalizedString(@"HomepageSeverStartButton", nil) +#define HomepageSeverStopButton NSLocalizedString(@"HomepageSeverStopButton", nil) + +#define AddCurrencyVCTitle NSLocalizedString(@"AddCurrencyVCTitle", nil) +#define AddCurrencyVCCurrencyNameTf NSLocalizedString(@"AddCurrencyVCCurrencyNameTf", nil) +#define AddCurrencyVCCurrencyAdressTf NSLocalizedString(@"AddCurrencyVCCurrencyAdressTf", nil) +#define AddCurrencyVCaccuracyTf NSLocalizedString(@"AddCurrencyVCaccuracyTf", nil) +#define AddCurrencyVCCormfirmButton NSLocalizedString(@"AddCurrencyVCCormfirmButton", nil) +#define AddCurrencyVCAddSuccess NSLocalizedString(@"AddCurrencyVCAddSuccess", nil) +#define OpenAccount NSLocalizedString(@"OpenAccount", nil) +#define Cancel NSLocalizedString(@"Cancel", nil) +#define Affirm NSLocalizedString(@"Affirm", nil) +#define delete NSLocalizedString(@"delete", nil) +#define SureToDelete NSLocalizedString(@"SureToDelete", nil) +#define ScanAdressVCTitle NSLocalizedString(@"ScanAdressVCTitle", nil) +#define ScanAdressVCScanLab NSLocalizedString(@"ScanAdressVCScanLab", nil) +#define ScanAdressVCDetailLab NSLocalizedString(@"ScanAdressVCDetailLab", nil) +#define ScanAdressVCAuthorizeBtn NSLocalizedString(@"ScanAdressVCAuthorizeBtn", nil) +#define ScanAdressVCAleartLab NSLocalizedString(@"ScanAdressVCAleartLab", nil) +#define ScanAdressVCIknown NSLocalizedString(@"ScanAdressVCIknown", nil) +#define ScanAdressVCAlertMessage NSLocalizedString(@"ScanAdressVCAlertMessage", nil) +#define ApprovalBusinessDetailVCAgreeApprovalBtn NSLocalizedString(@"ApprovalBusinessDetailVCAgreeApprovalBtn", nil) +#define ApprovalBusinessDetailVCRefuseApprovalBtn NSLocalizedString(@"ApprovalBusinessDetailVCRefuseApprovalBtn", nil) +#define ApprovalBusinessDetailApprovaling NSLocalizedString(@"ApprovalBusinessDetailApprovaling", nil) +#define ApprovalBusinessDetailSucceed NSLocalizedString(@"ApprovalBusinessDetailSucceed", nil) +#define ApprovalBusinessDetailFail NSLocalizedString(@"ApprovalBusinessDetailFail", nil) +#define ApprovalBusinessDetailAwait NSLocalizedString(@"ApprovalBusinessDetailAwait", nil) +#define ApprovalBusinessDetailAgreen NSLocalizedString(@"ApprovalBusinessDetailAgreen", nil) +#define IllegalApprovalFlow NSLocalizedString(@"IllegalApprovalFlow", nil) +#define ApprovalBusinessVCTitle NSLocalizedString(@"ApprovalBusinessVCTitle", nil) +#define ApprovalBusinessVCSegmentedTitleOne NSLocalizedString(@"ApprovalBusinessVCSegmentedTitleOne", nil) +#define ApprovalBusinessVCSegmentedTitleTwo NSLocalizedString(@"ApprovalBusinessVCSegmentedTitleTwo", nil) +#define ApprovalAwaitBusiness NSLocalizedString(@"ApprovalAwaitBusiness", nil) +#define ApprovalingBusiness NSLocalizedString(@"ApprovalingBusiness", nil) +#define ApprovalSucceedBusiness NSLocalizedString(@"ApprovalSucceedBusiness", nil) +#define ApprovalFailBusiness NSLocalizedString(@"ApprovalFailBusiness", nil) +#define CurrencyAccountTableViewCellAddCurrency NSLocalizedString(@"CurrencyAccountTableViewCellAddCurrency", nil) +#define ApprovalMenber NSLocalizedString(@"ApprovalMenber", nil) +#define ApprovalMenberAmount NSLocalizedString(@"ApprovalMenberAmount", nil) +#define CurrentVersion NSLocalizedString(@"CurrentVersion", nil) +#define SimplifiedChinese NSLocalizedString(@"SimplifiedChinese", nil) +#define ModifyServerAddressVCTitle NSLocalizedString(@"ModifyServerAddressVCTitle", nil) +#define ModifyServerAddressVCAddress NSLocalizedString(@"ModifyServerAddressVCAddress", nil) +#define ModifyServerAddressVCInfo NSLocalizedString(@"ModifyServerAddressVCInfo", nil) +#define ModifyServerAddressVCVerifyBtn NSLocalizedString(@"ModifyServerAddressVCVerifyBtn", nil) +#define ModifyServerAddressVCAleartSucceed NSLocalizedString(@"ModifyServerAddressVCAleartSucceed", nil) +#define Detailed NSLocalizedString(@"Detailed", nil) +#define TransferRecordTableViewCellTransferingAwait NSLocalizedString(@"TransferRecordTableViewCellTransferingAwait", nil) +#define TransferRecordTableViewCellTransfering NSLocalizedString(@"TransferRecordTableViewCellTransfering", nil) +#define TransferRecordTableViewCellTransferStateSucceed NSLocalizedString(@"TransferRecordTableViewCellTransferStateSucceed", nil) +#define TransferRecordTableViewCellTransferStateSucceedTransfing NSLocalizedString(@"TransferRecordTableViewCellTransferStateSucceedTransfing", nil) +#define TransferRecordTableViewCellTransferStateFail NSLocalizedString(@"TransferRecordTableViewCellTransferStateFail", nil) +#define TransferRecordTableViewCellRecharge NSLocalizedString(@"TransferRecordTableViewCellRecharge", nil) +#define TransferRecordTableViewCellTransferFail NSLocalizedString(@"TransferRecordTableViewCellTransferFail", nil) + +#define ApprovalBusinessCancel NSLocalizedString(@"ApprovalBusinessCancel", nil) +#define SystemApprovalSucceed NSLocalizedString(@"SystemApprovalSucceed", nil) +#define SystemApprovalFail NSLocalizedString(@"SystemApprovalFail", nil) +#define ApprovalCancel NSLocalizedString(@"ApprovalCancel", nil) +#define SureToDeleteSection NSLocalizedString(@"SureToDeleteSection", nil) +#define ApprovalCreate NSLocalizedString(@"ApprovalCreate", nil) + + + + #endif /* Localizable_h */ diff --git a/box-Authorizer/Macro/box-PrefixHeader.pch b/box-Authorizer/Macro/box-PrefixHeader.pch index 5d1deac..1b55a8d 100644 --- a/box-Authorizer/Macro/box-PrefixHeader.pch +++ b/box-Authorizer/Macro/box-PrefixHeader.pch @@ -24,6 +24,7 @@ #import "MJRefresh.h" #import "JASidePanelController.h" #import "UIViewController+JASidePanel.h" +#import "IQKeyboardManager.h" #import "JsonObject.h" #import "CIQRCodeManager.h" diff --git a/box-Authorizer/Resource/Assets.xcassets/icon_bukejian.imageset/Contents.json b/box-Authorizer/Resource/Assets.xcassets/icon_bukejian.imageset/Contents.json index a640295..6b69a93 100644 --- a/box-Authorizer/Resource/Assets.xcassets/icon_bukejian.imageset/Contents.json +++ b/box-Authorizer/Resource/Assets.xcassets/icon_bukejian.imageset/Contents.json @@ -6,12 +6,12 @@ }, { "idiom" : "universal", - "filename" : "icon_bukejian@2x.png", + "filename" : "icon_不可见@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "icon_bukejian@3x.png", + "filename" : "icon_不可见@3x.png", "scale" : "3x" } ], diff --git a/box-Authorizer/Resource/Assets.xcassets/icon_bukejian.imageset/icon_bukejian@2x.png b/box-Authorizer/Resource/Assets.xcassets/icon_bukejian.imageset/icon_bukejian@2x.png deleted file mode 100644 index e980a81..0000000 Binary files a/box-Authorizer/Resource/Assets.xcassets/icon_bukejian.imageset/icon_bukejian@2x.png and /dev/null differ diff --git a/box-Authorizer/Resource/Assets.xcassets/icon_bukejian.imageset/icon_bukejian@3x.png b/box-Authorizer/Resource/Assets.xcassets/icon_bukejian.imageset/icon_bukejian@3x.png deleted file mode 100644 index 8ffdd73..0000000 Binary files a/box-Authorizer/Resource/Assets.xcassets/icon_bukejian.imageset/icon_bukejian@3x.png and /dev/null differ diff --git "a/box-Authorizer/Resource/Assets.xcassets/icon_bukejian.imageset/icon_\344\270\215\345\217\257\350\247\201@2x.png" "b/box-Authorizer/Resource/Assets.xcassets/icon_bukejian.imageset/icon_\344\270\215\345\217\257\350\247\201@2x.png" new file mode 100644 index 0000000..ee8da39 Binary files /dev/null and "b/box-Authorizer/Resource/Assets.xcassets/icon_bukejian.imageset/icon_\344\270\215\345\217\257\350\247\201@2x.png" differ diff --git "a/box-Authorizer/Resource/Assets.xcassets/icon_bukejian.imageset/icon_\344\270\215\345\217\257\350\247\201@3x.png" "b/box-Authorizer/Resource/Assets.xcassets/icon_bukejian.imageset/icon_\344\270\215\345\217\257\350\247\201@3x.png" new file mode 100644 index 0000000..1bcd263 Binary files /dev/null and "b/box-Authorizer/Resource/Assets.xcassets/icon_bukejian.imageset/icon_\344\270\215\345\217\257\350\247\201@3x.png" differ diff --git a/box-Authorizer/Resource/Assets.xcassets/icon_kejian.imageset/Contents.json b/box-Authorizer/Resource/Assets.xcassets/icon_kejian.imageset/Contents.json index 6c0b7d9..46bc06b 100644 --- a/box-Authorizer/Resource/Assets.xcassets/icon_kejian.imageset/Contents.json +++ b/box-Authorizer/Resource/Assets.xcassets/icon_kejian.imageset/Contents.json @@ -6,12 +6,12 @@ }, { "idiom" : "universal", - "filename" : "icon_kejian@2x.png", + "filename" : "icon_可见@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "icon_kejian@3x.png", + "filename" : "icon_可见@3x.png", "scale" : "3x" } ], diff --git a/box-Authorizer/Resource/Assets.xcassets/icon_kejian.imageset/icon_kejian@2x.png b/box-Authorizer/Resource/Assets.xcassets/icon_kejian.imageset/icon_kejian@2x.png deleted file mode 100644 index ab81d59..0000000 Binary files a/box-Authorizer/Resource/Assets.xcassets/icon_kejian.imageset/icon_kejian@2x.png and /dev/null differ diff --git a/box-Authorizer/Resource/Assets.xcassets/icon_kejian.imageset/icon_kejian@3x.png b/box-Authorizer/Resource/Assets.xcassets/icon_kejian.imageset/icon_kejian@3x.png deleted file mode 100644 index 9971111..0000000 Binary files a/box-Authorizer/Resource/Assets.xcassets/icon_kejian.imageset/icon_kejian@3x.png and /dev/null differ diff --git "a/box-Authorizer/Resource/Assets.xcassets/icon_kejian.imageset/icon_\345\217\257\350\247\201@2x.png" "b/box-Authorizer/Resource/Assets.xcassets/icon_kejian.imageset/icon_\345\217\257\350\247\201@2x.png" new file mode 100644 index 0000000..a353256 Binary files /dev/null and "b/box-Authorizer/Resource/Assets.xcassets/icon_kejian.imageset/icon_\345\217\257\350\247\201@2x.png" differ diff --git "a/box-Authorizer/Resource/Assets.xcassets/icon_kejian.imageset/icon_\345\217\257\350\247\201@3x.png" "b/box-Authorizer/Resource/Assets.xcassets/icon_kejian.imageset/icon_\345\217\257\350\247\201@3x.png" new file mode 100644 index 0000000..4c0e964 Binary files /dev/null and "b/box-Authorizer/Resource/Assets.xcassets/icon_kejian.imageset/icon_\345\217\257\350\247\201@3x.png" differ diff --git a/box-Authorizer/Resource/Info.plist b/box-Authorizer/Resource/Info.plist index d00e78b..990f8c6 100755 --- a/box-Authorizer/Resource/Info.plist +++ b/box-Authorizer/Resource/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.1.1 + 0.5.0 CFBundleVersion - 0.1.1 + 0.5.0 LSRequiresIPhoneOS NSBluetoothPeripheralUsageDescription diff --git a/box-Authorizer/Resource/en.lproj/InfoPlist.strings b/box-Authorizer/Resource/en.lproj/InfoPlist.strings index 2bb0714..6b96366 100644 --- a/box-Authorizer/Resource/en.lproj/InfoPlist.strings +++ b/box-Authorizer/Resource/en.lproj/InfoPlist.strings @@ -5,4 +5,5 @@ Created by Yu Huang on 2018/7/17. Copyright © 2018年 2se. All rights reserved. */ -CFBundleDisplayName = ""; + +CFBundleDisplayName = "box-私钥版"; diff --git a/box-Authorizer/Resource/en.lproj/Localizable.strings b/box-Authorizer/Resource/en.lproj/Localizable.strings index 8069501..a7cfbf5 100644 --- a/box-Authorizer/Resource/en.lproj/Localizable.strings +++ b/box-Authorizer/Resource/en.lproj/Localizable.strings @@ -7,4 +7,199 @@ */ +"InitAccountVCTitle" = "扫一扫"; +"PerfectInformationVCLaber" = "扫一扫完成初始化"; +"PerfectInformationVCSubLaber" = "扫一扫MAC端的签名机App完成初始化"; + +"ScanCodeVCTitle" = "扫一扫"; +"PerfectInformationVCTorchlight" = "轻触关闭"; +"PerfectInformationVCTorchheight" = "轻触照亮"; +"PerfectInformationVCScanResult" = "将二维码放入框内,即可自动扫描"; +"PerfectInformationVCErrorCode" = "二维码无效"; +"Handing" = "正在处理"; + +"PerfectInformationVCTitle" = "完善信息"; +"PerfectInformationVCNameText" = "请输入姓名"; +"PerfectInformationVCPasswordText" = "请输入密码(6-12位数字和字母组成,区分大小写)"; +"PerfectInformationVCVerifyText" = "请再次输入密码"; +"PerfectInformationVCAlert" = "密码切记不要遗忘,不可告知其他人,在输入时请面向自己,防止身后有人偷窥或用摄像头记录"; +"Submit" = "提交"; +"PerfectInformationVCAlertOne" = "请完善信息"; +"PerfectInformationVCAlertTwo" = "请输入密码"; +"PerfectInformationVCAlertThree" = "密码不一致"; +"PerfectInformationVCCheckPwd" = "密码格式为6-12位数字和字母组成,区分大小写"; +"SubmissionCompletion" = "提交完成"; + +"BackupVCContentlab" = "私钥App持有者正在连接..."; +"BackupVCbackupButton" = "立即备份"; +"BackupVCSVProgressOne" = "密码备份成功"; +"BackupVCWSProgressTwo" = "请等待下一位私钥App持有者连接..."; + +"ServiceStartAwaitBtn" = "已等待时间"; +"NextStep" = "下一步"; +"AwaitBackupVCContentLabText" = "所有私钥App持有者都已正确输入备份密码"; +"AwaitBackupVCContentLabStatusText" = "备份密码不一致"; +"AwaitBackupVnextButtonTitle" = "返回重新备份"; +"AwaitBackupVCContentLabNextText" = "等待下一个私钥App持有者输入正确的备份密码"; + +"GenerateContractVCTitle" = "生成合约"; +"GenerateContractVCScanLab" = "请先向账户二维码充值"; +"GenerateContractVCAccountCopyBtn" = "复制地址"; +"GenerateContractVCAccountSaveBtn" = "保存二维码"; +"GenerateContractVCscanTwoLab" = "合约二维码"; +"GenerateContractVCprivateBtn" = "输入密码"; +"GenerateContractVserviceStartBtn" = "启动服务"; +"CopyAddressSucceed" = "地址复制成功"; +"SaveFailure" = "保存失败"; +"SavePicturesucceed" = "成功保存到相册"; +"PasswordWaitingForCheck" = "密码已提交,等待校验"; +"ServiceException" = "服务异常"; +"CheckPasswordFailed" = "校验密码失败,请重新输入私钥密码"; +"Refresh" = "刷新"; + +"ServiceStartTitle" = "启动服务"; +"ServiceStartLaunchUnstart" = "未启动"; +"ServiceStartLaunchState" = "启动中"; +"ServiceStartLaunchStateSecceed" = "启动成功"; +"ServiceStartPassword" = "请输入密码"; +"ServiceStartRepassword" = "请再次输入密码"; +"ServiceStartCommitStart" = "同意启动"; +"ServiceStartCommitStartUse" = "开始使用"; +"ServiceStateTitle" = "启动成功"; +"ServiceStateDetail" = "继续等待下一位私钥App持有者启动服务"; +"ServiceStartAleartOne" = "请输入密码"; +"ServiceStartAleartTwo" = "密码不一致"; +"ServiceStartPwdTitle" = "输入密码"; +"StartupServiceFailed" = "启动服务失败,请重新启动"; +"AllPrivateAppStartedService" = "所有私钥App持有者都已启动服务"; +"BlueToothListVCTitle" = "蓝牙"; + +"BackupViewBackupLab" = "备份口令"; +"BackupViewBackupText" = "请输入备份口令(6-12位数字和字母组成,区分大小写)"; +"BackupViewAlertLab" = "此备份口令需要所有私钥App持有者私下协商决定"; +"BackupViewCheckPwd" = "口令格式为6-12位数字和字母组成,区分大小写"; + +"Confirm" = "确认"; + +"ConnectionSuccess" = "连接成功"; +"Unconnected" = "未连接"; +"PrintAlertViewPrinting" = "正在连接打印机,请稍等..."; +"PrintImmediately" = "立即打印"; +"Reprint" = "重新打印"; +"PrintSuccessfully" = "打印已成功"; +"PrintAlertViewAlertLabText" = "为保证安全请将二维码1-3放入一个信封;将二维码4-6放入另一个信封分别将两个信封保存至两个银行的保险柜中。"; +"GenerateContract" = "生成合约"; +"PrintAlertViewBTPrinting" = "正在打印中,请稍后..."; +"PrintAlertViewBTConnectFail" = "连接失败,重新连接"; + +"PrivatePasswordbackupLab" = "密码"; +"PrivatePasswordComfirm" = "确认"; +"PrivatePasswordPasswordTfPlaceholder" = "请输入密码"; + +"HomepageMidOneLabStop" = "关停"; +"HomepageMidOneLabStart" = "启动"; +"HomepageMidOneLabDetailStop" = "您的服务为启动状态"; +"HomepageMidOneLabDetailStart" = "您的服务为关停状态"; +"HomepageMidOneLabDetailError" = "您的服务异常"; +"HomepageMidTwoLab" = "新增币种"; +"HomepageMidThreeLab" = "审批业务流"; +"HomepageMidFourLab" = "授权码"; +"HomepageMidFourDetailLab" = "授权员工最高权限"; +"HomepageFootTitle" = "最新动态"; +"HomepageTitle" = "首页"; +"HomepageNoApproval" = "暂无待审批"; +"HomepageNoCurrency" = "暂无开户币种"; +"OpenApp" = "打开私钥App"; +"NoDynamic" = "暂无动态"; +"WaitCheck" = "等待校验"; +"StartedService" = "已启动服务"; +"StoppedService" = "已关停服务"; +"NotConnected" = "服务异常"; +"HomepageSeverStartLaber" = "确定要关停服务吗?"; +"HomepageSeverStopLaber" = "确定要启动服务吗?"; +"HomepageSeverStartButton" = "确定关停?"; +"HomepageSeverStopButton" = "确定启动?"; + +"AssetOverview" = "资产总览"; +"ServerAddress" = "服务器地址"; +"Language" = "语言"; +"AboutBOX" = "关于BOX"; + +"AddCurrencyVCTitle" = "新增代币"; +"AddCurrencyVCCurrencyNameTf" = "请输入代币名称"; +"AddCurrencyVCCurrencyAdressTf" = "请输入代币地址"; +"AddCurrencyVCaccuracyTf" = "请输入代币精度 (位数)"; +"AddCurrencyVCCormfirmButton" = "确认增加"; +"AddCurrencyVCAddSuccess" = "新增成功"; +"OpenAccount" = "新增"; + + +"LimitTimes" = "额度恢复时间"; +"AccountPasswordHour" = "小时"; +"Limit" = "上限"; +"LimitAlertAffirm" = "我知道了"; +"LimitAlertTitle" = "什么是额度恢复时间?"; +"LimitAlertContent" = "审批流中,可设定币种在一段时间内,申请转账的累计上限。超出时间后,转账额度即可恢复。如:设置ETH的转账上限为10,额度恢复时间为24小时,则最近24小时内,最多可累计申请10个ETH;若额度恢复时间为0,则每次最多转10个ETH,无时间限制。"; +"viewLog" = "查看日志"; +"ApprovalBusinessSucceed" = "审批通过"; +"ApprovalBusinessFail" = "审批不通过"; +"RefuseApproval" = "拒绝审批"; +"RefuseApprovalInfo" = "拒绝的审批无法恢复,请谨慎操作!"; +"Submit" = "提交"; +"RefuseApprovalPlacehode" = "请输入拒绝原因"; +"Cancel" = " 取消"; +"RefuseTransfer" = "撤回转账申请"; + +"Cancel" = "取消"; +"Affirm" = "确定"; +"delete" = "删除"; +"SureToDelete" = "确定删除?"; +"ScanAdressVCTitle" = "授权码"; +"ScanAdressVCScanLab" = "授权二维码"; +"ScanAdressVCDetailLab" = "用员工App扫描以上二维码,进行授权"; +"ScanAdressVCAuthorizeBtn" = "本机授权"; +"ScanAdressVCAleartLab" = "为避免资金风险,请勿分享授权码给他人,截屏自动失效"; +"ScanAdressVCIknown" = "我知道了"; +"ScanAdressVCAlertMessage" = "返回将不再绑定正在扫描二维码的员工App"; +"ApprovalBusinessDetailVCAgreeApprovalBtn" = "同意审批"; +"ApprovalBusinessDetailVCRefuseApprovalBtn" = "拒绝审批"; +"ApprovalBusinessDetailApprovaling" = "审批中"; +"ApprovalBusinessDetailSucceed" = "审批通过"; +"ApprovalBusinessDetailFail" = "已拒绝审批"; +"ApprovalBusinessDetailAwait" = "待审批"; +"ApprovalBusinessDetailAgreen" = "已同意审批"; +"IllegalApprovalFlow" = "非法审批流"; +"ApprovalBusinessVCTitle" = "审批流"; +"ApprovalBusinessVCSegmentedTitleOne" = "待审批"; +"ApprovalBusinessVCSegmentedTitleTwo" = "已审批"; +"ApprovalAwaitBusiness" = "待审批"; +"ApprovalingBusiness" = "审批中"; +"ApprovalSucceedBusiness" = "审批成功"; +"ApprovalFailBusiness" = "审批失败"; +"CurrencyAccountTableViewCellAddCurrency" = "新增代币"; +"ApprovalMenber" = "审批人员"; +"ApprovalMenberAmount" = "需审批人数"; +"CurrentVersion" = "当前版本号"; +"SimplifiedChinese" = "简体中文"; +"ModifyServerAddressVCTitle" = "修改服务器地址"; +"ModifyServerAddressVCAddress" = "地址"; +"ModifyServerAddressVCInfo" = "请输入服务器地址"; +"ModifyServerAddressVCVerifyBtn" = "确认修改"; +"ModifyServerAddressVCAleartSucceed" = "修改成功"; +"Detailed" = "明细"; + +"TransferRecordTableViewCellTransferingAwait" = "待审批"; +"TransferRecordTableViewCellTransfering" = "审批中"; +"TransferRecordTableViewCellTransferStateSucceed" = "同意审批(转账成功)"; +"TransferRecordTableViewCellTransferStateSucceedTransfing" = "同意审批(转账中)"; +"TransferRecordTableViewCellTransferStateFail" = "同意审批(转账失败)"; +"TransferRecordTableViewCellRecharge" = "充值成功"; +"TransferRecordTableViewCellTransferFail" = "拒绝审批"; + +"ApprovalBusinessCancel" = "已废审批流"; +"SystemApprovalSucceed" = "系统审批通过"; +"SystemApprovalFail" = "系统审批不通过"; +"ApprovalCancel" = "已作废"; +"ApprovalCreate" = "创建审批流"; +"Reason" = "原因"; diff --git a/box-Authorizer/Resource/zh-Hans.lproj/Localizable.strings b/box-Authorizer/Resource/zh-Hans.lproj/Localizable.strings index 0fca35c..5e55dd6 100644 --- a/box-Authorizer/Resource/zh-Hans.lproj/Localizable.strings +++ b/box-Authorizer/Resource/zh-Hans.lproj/Localizable.strings @@ -6,6 +6,134 @@ Copyright © 2018年 2se. All rights reserved. */ + +"InitAccountVCTitle" = "扫一扫"; +"PerfectInformationVCLaber" = "扫一扫完成初始化"; +"PerfectInformationVCSubLaber" = "扫一扫MAC端的签名机App完成初始化"; + +"ScanCodeVCTitle" = "扫一扫"; +"PerfectInformationVCTorchlight" = "轻触关闭"; +"PerfectInformationVCTorchheight" = "轻触照亮"; +"PerfectInformationVCScanResult" = "将二维码放入框内,即可自动扫描"; +"PerfectInformationVCErrorCode" = "二维码无效"; +"Handing" = "正在处理"; + +"PerfectInformationVCTitle" = "完善信息"; +"PerfectInformationVCNameText" = "请输入姓名"; +"PerfectInformationVCPasswordText" = "请输入密码(6-12位数字和字母组成,区分大小写)"; +"PerfectInformationVCVerifyText" = "请再次输入密码"; +"PerfectInformationVCAlert" = "密码切记不要遗忘,不可告知其他人,在输入时请面向自己,防止身后有人偷窥或用摄像头记录"; +"Submit" = "提交"; +"PerfectInformationVCAlertOne" = "请完善信息"; +"PerfectInformationVCAlertTwo" = "请输入密码"; +"PerfectInformationVCAlertThree" = "密码不一致"; +"PerfectInformationVCCheckPwd" = "密码格式为6-12位数字和字母组成,区分大小写"; +"SubmissionCompletion" = "提交完成"; + +"BackupVCContentlab" = "私钥App持有者正在连接..."; +"BackupVCbackupButton" = "立即备份"; +"BackupVCSVProgressOne" = "密码备份成功"; +"BackupVCWSProgressTwo" = "请等待下一位私钥App持有者连接..."; + +"ServiceStartAwaitBtn" = "已等待时间"; +"NextStep" = "下一步"; +"AwaitBackupVCContentLabText" = "所有私钥App持有者都已正确输入备份密码"; +"AwaitBackupVCContentLabStatusText" = "备份密码不一致"; +"AwaitBackupVnextButtonTitle" = "返回重新备份"; +"AwaitBackupVCContentLabNextText" = "等待下一个私钥App持有者输入正确的备份密码"; + +"GenerateContractVCTitle" = "生成合约"; +"GenerateContractVCScanLab" = "请先向账户二维码充值"; +"GenerateContractVCAccountCopyBtn" = "复制地址"; +"GenerateContractVCAccountSaveBtn" = "保存二维码"; +"GenerateContractVCscanTwoLab" = "合约二维码"; +"GenerateContractVCprivateBtn" = "输入密码"; +"GenerateContractVserviceStartBtn" = "启动服务"; +"CopyAddressSucceed" = "地址复制成功"; +"SaveFailure" = "保存失败"; +"SavePicturesucceed" = "成功保存到相册"; +"PasswordWaitingForCheck" = "密码已提交,等待校验"; +"ServiceException" = "服务异常"; +"CheckPasswordFailed" = "校验密码失败,请重新输入私钥密码"; +"Refresh" = "刷新"; + +"ServiceStartTitle" = "启动服务"; +"ServiceStartLaunchUnstart" = "未启动"; +"ServiceStartLaunchState" = "启动中"; +"ServiceStartLaunchStateSecceed" = "启动成功"; +"ServiceStartPassword" = "请输入密码"; +"ServiceStartRepassword" = "请再次输入密码"; +"ServiceStartCommitStart" = "同意启动"; +"ServiceStartCommitStartUse" = "开始使用"; +"ServiceStateTitle" = "启动成功"; +"ServiceStateDetail" = "继续等待下一位私钥App持有者启动服务"; +"ServiceStartAleartOne" = "请输入密码"; +"ServiceStartAleartTwo" = "密码不一致"; +"ServiceStartPwdTitle" = "输入密码"; +"StartupServiceFailed" = "启动服务失败,请重新启动"; +"AllPrivateAppStartedService" = "所有私钥App持有者都已启动服务"; +"BlueToothListVCTitle" = "蓝牙"; + +"BackupViewBackupLab" = "备份口令"; +"BackupViewBackupText" = "请输入备份口令(6-12位数字和字母组成,区分大小写)"; +"BackupViewAlertLab" = "此备份口令需要所有私钥App持有者私下协商决定"; +"BackupViewCheckPwd" = "口令格式为6-12位数字和字母组成,区分大小写"; + +"Confirm" = "确认"; + +"ConnectionSuccess" = "连接成功"; +"Unconnected" = "未连接"; +"PrintAlertViewPrinting" = "正在连接打印机,请稍等..."; +"PrintImmediately" = "立即打印"; +"Reprint" = "重新打印"; +"PrintSuccessfully" = "打印已成功"; +"PrintAlertViewAlertLabText" = "为保证安全请将二维码1-3放入一个信封;将二维码4-6放入另一个信封分别将两个信封保存至两个银行的保险柜中。"; +"GenerateContract" = "生成合约"; +"PrintAlertViewBTPrinting" = "正在打印中,请稍后..."; +"PrintAlertViewBTConnectFail" = "连接失败,重新连接"; + +"PrivatePasswordbackupLab" = "密码"; +"PrivatePasswordComfirm" = "确认"; +"PrivatePasswordPasswordTfPlaceholder" = "请输入密码"; + +"HomepageMidOneLabStop" = "关停"; +"HomepageMidOneLabStart" = "启动"; +"HomepageMidOneLabDetailStop" = "您的服务为启动状态"; +"HomepageMidOneLabDetailStart" = "您的服务为关停状态"; +"HomepageMidOneLabDetailError" = "您的服务异常"; +"HomepageMidTwoLab" = "新增币种"; +"HomepageMidThreeLab" = "审批业务流"; +"HomepageMidFourLab" = "授权码"; +"HomepageMidFourDetailLab" = "授权员工最高权限"; +"HomepageFootTitle" = "最新动态"; +"HomepageTitle" = "首页"; +"HomepageNoApproval" = "暂无待审批"; +"HomepageNoCurrency" = "暂无开户币种"; +"OpenApp" = "打开私钥App"; +"NoDynamic" = "暂无动态"; +"WaitCheck" = "等待校验"; +"StartedService" = "已启动服务"; +"StoppedService" = "已关停服务"; +"NotConnected" = "服务异常"; +"HomepageSeverStartLaber" = "确定要关停服务吗?"; +"HomepageSeverStopLaber" = "确定要启动服务吗?"; +"HomepageSeverStartButton" = "确定关停?"; +"HomepageSeverStopButton" = "确定启动?"; + +"AssetOverview" = "资产总览"; +"ServerAddress" = "服务器地址"; +"Language" = "语言"; +"AboutBOX" = "关于BOX"; + +"AddCurrencyVCTitle" = "新增代币"; +"AddCurrencyVCCurrencyNameTf" = "请输入代币名称"; +"AddCurrencyVCCurrencyAdressTf" = "请输入代币地址"; +"AddCurrencyVCaccuracyTf" = "请输入代币精度 (位数)"; +"AddCurrencyVCCormfirmButton" = "确认增加"; +"AddCurrencyVCAddSuccess" = "新增成功"; +"OpenAccount" = "新增"; + + "LimitTimes" = "额度恢复时间"; "AccountPasswordHour" = "小时"; "Limit" = "上限"; @@ -22,4 +150,59 @@ "Cancel" = " 取消"; "RefuseTransfer" = "撤回转账申请"; +"Cancel" = "取消"; +"Affirm" = "确定"; +"delete" = "删除"; +"SureToDelete" = "确定删除?"; +"ScanAdressVCTitle" = "授权码"; +"ScanAdressVCScanLab" = "授权二维码"; +"ScanAdressVCDetailLab" = "用员工App扫描以上二维码,进行授权"; +"ScanAdressVCAuthorizeBtn" = "本机授权"; +"ScanAdressVCAleartLab" = "为避免资金风险,请勿分享授权码给他人,截屏自动失效"; +"ScanAdressVCIknown" = "我知道了"; +"ScanAdressVCAlertMessage" = "返回将不再绑定正在扫描二维码的员工App"; +"ApprovalBusinessDetailVCAgreeApprovalBtn" = "同意审批"; +"ApprovalBusinessDetailVCRefuseApprovalBtn" = "拒绝审批"; +"ApprovalBusinessDetailApprovaling" = "审批中"; +"ApprovalBusinessDetailSucceed" = "审批通过"; +"ApprovalBusinessDetailFail" = "已拒绝审批"; +"ApprovalBusinessDetailAwait" = "待审批"; +"ApprovalBusinessDetailAgreen" = "已同意审批"; +"IllegalApprovalFlow" = "非法审批流"; +"ApprovalBusinessVCTitle" = "审批流"; +"ApprovalBusinessVCSegmentedTitleOne" = "待审批"; +"ApprovalBusinessVCSegmentedTitleTwo" = "已审批"; +"ApprovalAwaitBusiness" = "待审批"; +"ApprovalingBusiness" = "审批中"; +"ApprovalSucceedBusiness" = "审批成功"; +"ApprovalFailBusiness" = "审批失败"; +"CurrencyAccountTableViewCellAddCurrency" = "新增代币"; +"ApprovalMenber" = "审批人员"; +"ApprovalMenberAmount" = "需审批人数"; +"CurrentVersion" = "当前版本号"; +"SimplifiedChinese" = "简体中文"; +"ModifyServerAddressVCTitle" = "修改服务器地址"; +"ModifyServerAddressVCAddress" = "地址"; +"ModifyServerAddressVCInfo" = "请输入服务器地址"; +"ModifyServerAddressVCVerifyBtn" = "确认修改"; +"ModifyServerAddressVCAleartSucceed" = "修改成功"; +"Detailed" = "明细"; + +"TransferRecordTableViewCellTransferingAwait" = "待审批"; +"TransferRecordTableViewCellTransfering" = "审批中"; +"TransferRecordTableViewCellTransferStateSucceed" = "同意审批(转账成功)"; +"TransferRecordTableViewCellTransferStateSucceedTransfing" = "同意审批(转账中)"; +"TransferRecordTableViewCellTransferStateFail" = "同意审批(转账失败)"; +"TransferRecordTableViewCellRecharge" = "充值成功"; +"TransferRecordTableViewCellTransferFail" = "拒绝审批"; + +"ApprovalBusinessCancel" = "已废审批流"; +"SystemApprovalSucceed" = "系统审批通过"; +"SystemApprovalFail" = "系统审批不通过"; +"ApprovalCancel" = "已作废"; +"ApprovalCreate" = "创建审批流"; +"Reason" = "原因"; + + + diff --git a/box-Authorizer/globel/GprinterSDK/include/GprinterLabelPrinterSDK/GprinterLabelPrinterBluetooth.h b/box-Authorizer/globel/GprinterSDK/include/GprinterLabelPrinterSDK/GprinterLabelPrinterBluetooth.h new file mode 100644 index 0000000..3e6fd55 --- /dev/null +++ b/box-Authorizer/globel/GprinterSDK/include/GprinterLabelPrinterSDK/GprinterLabelPrinterBluetooth.h @@ -0,0 +1,215 @@ +// +// GprinterLabelPrinterBluetooth.h +// GprinterLabelPrinterSDK +// +// Created by ShaoDan on 2017/7/21. +// Copyright © 2017年 Gainscha. All rights reserved. +// + +#import +#import + + + +// 发送数据时,需要分段的长度,可修改 +#define Length 90 + +@class GprinterLabelPrinterBluetooth; + +typedef NS_ENUM(NSInteger, ScanError) { + ScanErrorUnknown = 0, + ScanErrorResetting, + ScanErrorUnsupported, //设备不支持 + ScanErrorUnauthorized, //未授权 + ScanErrorPoweredOff, //蓝牙可用,但是未打开 + ScanErrorTimeout, //搜索超时 +}; + +typedef NS_ENUM(NSInteger, OptionStage) { + OptionStageConnection, //蓝牙连接阶段 + OptionStageSeekServices, //搜索服务阶段 + OptionStageSeekCharacteristics, //搜索特性阶段 + OptionStageSeekdescriptors, //搜索描述信息阶段 +}; +/** + * 扫描成功的block + * + * @param perpherals 蓝牙外设列表 + */ +typedef void(^ScanPerpheralSuccess)(NSArray *perpherals, BOOL isTimeout); + +/** + * 扫描失败的block + * + * @param error 失败的字典 + */ +typedef void(^ScanPerpheralFailure)(ScanError error); + +/** + * 连接完成的block + * + * @param perpheral 要连接的蓝牙外设 + */ +typedef void(^ConnectCompletion)(CBPeripheral *perpheral, NSError *error); + +/** + * 连接、扫描服务、扫描特性、扫描描述全套流程 + * + * @param stage 枚举 所处阶段 + * @param perpheral 蓝牙外设 + * @param error 错误信息 + */ +typedef void(^FullOptionCompletion)(OptionStage stage, CBPeripheral *perpheral, NSError *error); + +/** + * 断开蓝牙连接 + * + * @param perpheral 蓝牙外设 + * @param error 错误 + */ +typedef void(^Disconnect)(CBPeripheral *perpheral, NSError *error); + +/** + * 打印回调 + * + * @param completion 是否完成 + * @param error 错误信息 + */ +typedef void(^PrintResult)(CBPeripheral *connectPerpheral, BOOL completion, NSString *error); + + +@protocol GprinterLabelPrinterBlueToothDeledage + +/** 返回扫描到的蓝牙 设备列表 + * 因为蓝牙模块一次返回一个设备,所以该方法会调用多次 + */ +- (void)printerManager:(GprinterLabelPrinterBluetooth *)manager perpherals:(NSArray *)perpherals isTimeout:(BOOL)isTimeout; + +/** 扫描蓝牙设备失败 + * + */ +- (void)printerManager:(GprinterLabelPrinterBluetooth *)manager scanError:(ScanError)error; + +/** + * 连接蓝牙外设完成 + * + * @param manager 管理中心 + * @param perpheral 蓝牙外设 + * @param error 错误 + */ +- (void)printerManager:(GprinterLabelPrinterBluetooth *)manager completeConnectPerpheral:(CBPeripheral *)perpheral error:(NSError *)error; + +/** + * 断开连接 + * + * @param manager 管理中心 + * @param peripheral 设备 + * @param error 错误信息 + */ +- (void)printerManager:(GprinterLabelPrinterBluetooth *)manager disConnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error; + +@end + + + +@interface GprinterLabelPrinterBluetooth : NSObject +/*蓝牙操作代理 */ +@property (assign, nonatomic) id delegate; + +/*当前连接的外设 */ +@property (strong, nonatomic, readonly) CBPeripheral *connectedPerpheral; + + +#pragma mark - bluetooth method + ++ (instancetype)sharedInstance; + +/** + * 上次连接的蓝牙外设的UUIDString + * + * @return UUIDString,没有时返回nil + */ ++ (NSString *)UUIDStringForLastPeripheral; + +/** + * 蓝牙外设是否已连接 + * + * @return YES/NO + */ +- (BOOL)isConnected; + +/** + * 开始扫描蓝牙外设 + * @param timeout 扫描超时时间,设置为0时表示一直扫描 + */ +- (void)startScanPerpheralTimeout:(NSTimeInterval)timeout; + +/** + * 开始扫描蓝牙外设,block方式返回结果 + * @param timeout 扫描超时时间,设置为0时表示一直扫描 + * @param success 扫描成功的回调 + * @param failure 扫描失败的回调 + */ +- (void)startScanPerpheralTimeout:(NSTimeInterval)timeout Success:(ScanPerpheralSuccess)success failure:(ScanPerpheralFailure)failure; + +/** + * 停止扫描蓝牙外设 + */ +- (void)stopScan; + +/** + * 连接蓝牙外设,连接成功后会停止扫描蓝牙外设 + * + * @param peripheral 蓝牙外设 + */ +- (void)connectPeripheral:(CBPeripheral *)peripheral; + +/** + * 连接蓝牙外设,连接成功后会停止扫描蓝牙外设,block方式返回结果 + * + * @param peripheral 要连接的蓝牙外设 + * @param completion 完成后的回调 + */ +- (void)connectPeripheral:(CBPeripheral *)peripheral completion:(ConnectCompletion)completion; + +/** + * 完整操作,包括连接、扫描服务、扫描特性、扫描描述 + * + * @param peripheral 要连接的蓝牙外设 + * @param completion 完成后的回调 + */ +- (void)fullOptionPeripheral:(CBPeripheral *)peripheral completion:(FullOptionCompletion)completion; + +/** + * 取消某个蓝牙外设的连接 + * + * @param peripheral 蓝牙外设 + */ +- (void)cancelPeripheral:(CBPeripheral *)peripheral; + +/** + * 自动连接上次的蓝牙外设 + * + * @param timeout 超时 + * @param completion 完成 + */ +- (void)autoConnectLastPeripheralTimeout:(NSTimeInterval)timeout completion:(ConnectCompletion)completion; + +/** + * 设置断开连接的block + * + * @param disconnectBlock 断开 + */ +- (void)isDisconnect:(Disconnect)disconnectBlock; + +/** + * 打印自己组装的数据 + * + * @param data 数据 + * @param result 结果 + */ +- (void)sendPrintData:(NSData *)data completion:(PrintResult)result; + + + +@end diff --git a/box-Authorizer/globel/GprinterSDK/include/GprinterLabelPrinterSDK/GprinterLabelPrinterCommand.h b/box-Authorizer/globel/GprinterSDK/include/GprinterLabelPrinterSDK/GprinterLabelPrinterCommand.h new file mode 100644 index 0000000..2ae7898 --- /dev/null +++ b/box-Authorizer/globel/GprinterSDK/include/GprinterLabelPrinterSDK/GprinterLabelPrinterCommand.h @@ -0,0 +1,271 @@ +// +// GprinterLabelPrinterCommand.h +// GprinterLabelPrinterSDK +// +// Created by ShaoDan on 2017/7/21. +// Copyright © 2017年 Gainscha. All rights reserved. +// + +#import +#import + +@interface GprinterLabelPrinterCommand : NSObject +//打印数据(文字图片信息) +@property (nonatomic, strong) NSMutableData *sendData; + + + +typedef enum { + DENSITY0 = 0, + DENSITY1 = 1, + DENSITY2 = 2, + DENSITY3 = 3, + DENSITY4 = 4, + DENSITY5 = 5, + DENSITY6 = 6, + DENSITY7 = 7, + DENSITY8 = 8, + DENSITY9 = 9, + DENSITY10 = 10, + DENSITY11 = 11, + DENSITY12 = 12, + DENSITY13 = 13, + DENSITY14 = 14, + DENSITY15 = 15, +}DENSITY; + +typedef enum { + DISABLE = 0, + ENABEL = 1, +}READABLE; + +typedef enum { + ROTATION_0 = 0, + ROTATION_90 = 90, + ROTATION_180 =180, + ROTATION_270 = 270, +}ROTATION; + +typedef enum { + SPEED1 = 1, + SPEED2 = 2, + SPEED3 = 3, + SPEED4 = 4, + SPEED5 = 5, + SPEED6 = 6, +}SPEED; + + +typedef enum { + FORWARD = 0, + BACKWARD = 1, + +}DIRECTION; + +typedef enum { + GAP = 0, + BLINE = 1, + +}SENSOR; + +typedef enum { + + OVERWRITE = 0, + OR = 1, + XOR = 2, + + +}BITMAPMODE; + +typedef enum { + MUL_1 = 1, + MUL_2 = 2, + MUL_3 = 3, + MUL_4 = 4, + MUL_5 = 5, + MUL_6 = 6, + MUL_7 = 7, + MUL_8 = 8, + MUL_9 = 9, + MUL_10 = 10, +}FONTMAGNIFICATION; + +typedef enum { + // 437: United States + // 850: Multilingual + // 852: Slavic + // 860: Portuguese + // 863: Canadian/French 865: Nordic + // Windows code page 1250: Central Europe 1252: Latin I + // 1253: Greek + // 1254: Turkish + C437 = 437, + C850 = 850, + C852 = 852, + C860 = 860, + C863 = 863, + C865 = 865, + WC1250 = 1250, + WC1252 = 1252, + WC1253 = 1253, + WC1254 = 1254, + +}CODEPAGE; + + +typedef NS_ENUM (NSUInteger,FontType){ + FONT_1 = 1, + FONT_2 = 2, + FONT_3 = 3, + FONT_4 = 4, + FONT_5 = 5, + FONT_6 = 6, + FONT_7 = 7, + FONT_8 = 8, + // SIMPLIFIED_CHINESE("TSS24.BF2"), + // TRADITIONAL_CHINESE("TST24.BF2"), + // KOREAN("K"), + SIMPLIFIED_CHINESE = 9, + TRADITIONAL_CHINESE = 10, + KOREAN = 11, + +}; + +typedef NS_ENUM (NSUInteger,BarColorType) { + CODE128=1, + + CODE128M=2, + + EAN128=3, + + ITF25=4, + + ITF25C=5, + + CODE39=6, + + CODE39C=7, + + + CODE93 = 9, + + EAN13 = 10, + + EAN13_2 = 11, + + EAN13_5 = 12, + + EAN8 = 13, + + EAN8_2 = 14, + + EAN8_5 = 15, + + CODABAR = 16, + + POSt = 17, + + UPCA = 18, + + UPCA_2 = 19, + + UPCA_5 = 20, + + UPCE = 21, + + UPCE_2 = 22, + + UPCE_5 = 23, + + + MSI = 25, + + MSIC = 26, + + PLESSEY = 27, + + ITF14 = 28, + + EAN14 = 29, + + // CODE128 = "128", + // CODE128M("128M"), + // EAN128("EAN128"), + // ITF25("25"), + // ITF25C("25C"), + // CODE39("39"), + // CODE39C("39C"), + // CODE39S("39S"), + // CODE93("93"), + // EAN13("EAN13"), + // EAN13_2("EAN13+2"), + // EAN13_5("EAN13+5"), + // EAN8("EAN8"), + // EAN8_2("EAN8+2"), + // EAN8_5("EAN8+5"), + // CODABAR("CODA"), + // POST("POST"), + // UPCA("UPCA"), + // UPCA_2("UPCA+2"), + // UPCA_5("UPCA+5"), + // UPCE("UPCE13"), + // UPCE_2("UPCE13+2"), + // UPCE_5("UPCE13+5"), + // CPOST("CPOST"), + // MSI("MSI"), + // MSIC("MSIC"), + // PLESSEY("PLESSEY"), + // ITF14("ITF14"), + // EAN14("EAN14"); +}; + + + +typedef NS_ENUM (NSUInteger,QRcodeLevel){ + // LEVEL_L("L"), + // LEVEL_M("M"), + // LEVEL_Q("Q"), + // LEVEL_H("H"); + LEVEL_L = 1, + LEVEL_M = 2, + LEVEL_Q = 3, + LEVEL_H = 4, +}; + + + +//连接 +-(instancetype)openport:(NSString*)host port:(UInt16)port timeout:(NSTimeInterval)timeout; +//断开 +- (void)closeport; +//发送给打印机 +-(void)sendToPrinter; +//初始化UI +-(void)setupForWidth:(NSString*)w heigth:(NSString*)h speed:(SPEED)sp density:(DENSITY)den sensor:(SENSOR)string vertical:(NSString*)ver offset:(NSString*)off; +//打印文字 +-(void)printerfontFormX:(NSString*)x Y:(NSString*)y fontName:(FontType)fonttype rotation:(ROTATION)rotation magnificationRateX:(FONTMAGNIFICATION)mx magnificationRateY:(FONTMAGNIFICATION)my content:(NSString*)text; +//条形码 +-(void)barcodeFromX:(NSString*)x Y:(NSString*)y barcodeType:(BarColorType)barcodetype height:(NSString*)h readable:(READABLE)readable rotation:(ROTATION)ro narrow:(NSString*)narrow wide:(NSString*)wide code:(NSString*)codetext; +//二维码 +-(void)QRCodeWithX:(NSString*)x Y:(NSString*)y ECClevel:(QRcodeLevel)qrlevel cellwidth:(NSString*)cw Mode:(NSString*)m rotation:(ROTATION)rotation model:(NSString*)model mask:(NSString*)mask code:(NSString*)codetext; +//矩形 +-(void)Box:(NSString*)x y:(NSString*)y xend:(NSString*)w yend:(NSString*)h thickness:(NSString*)line; +//划线 +-(void)Bar:(NSString*)x y:(NSString*)y width:(NSString*)w height:(NSString*)h; +//打印图片 +-(void)PrintPictureWithX:(NSString*)x Y:(NSString*)y mode:(BITMAPMODE)m Image:(UIImage*)img; +//打印份数 +-(void)printLabelWithNumberOfSets:(NSString*)m copies:(NSString*)n +; +//发送指令 +-(void)sendcommand:(NSString*)commandText; +//十六进制 +-(void)sendcommandData:(NSData*)commandtextData; +//CLS +-(void)clearBuffer; +//formfeed +-(void)FormFeed; +//打印方向 +-(void)Direction:(NSString*)d; + +@end diff --git a/box-Authorizer/globel/GprinterSDK/libGprinterLabelPrinterSDK.a b/box-Authorizer/globel/GprinterSDK/libGprinterLabelPrinterSDK.a new file mode 100644 index 0000000..16976c0 Binary files /dev/null and b/box-Authorizer/globel/GprinterSDK/libGprinterLabelPrinterSDK.a differ diff --git a/box-Authorizer/globel/ManagerCommon/ProgressHUD.m b/box-Authorizer/globel/ManagerCommon/ProgressHUD.m index 1c2b6e4..a6cf43e 100644 --- a/box-Authorizer/globel/ManagerCommon/ProgressHUD.m +++ b/box-Authorizer/globel/ManagerCommon/ProgressHUD.m @@ -14,6 +14,7 @@ #define NetWorkCode103 @"非法金额" #define NetWorkCode10000 @"请求失败" #define NetWorkCode107 @"密码错误" +#define NetWorkCode112 @"重复请求" @implementation ProgressHUD @@ -37,6 +38,8 @@ +(void)showStatus:(NSInteger)code [WSProgressHUD showErrorWithStatus:NetWorkCode10000]; }else if (code == 107){ [WSProgressHUD showErrorWithStatus:NetWorkCode107]; + }else if (code == 112){ + [WSProgressHUD showErrorWithStatus:NetWorkCode112]; } }