|
@@ -75,50 +75,52 @@ static BoxHeartbeatAlertTool *shareInstance = nil;
|
|
|
|
|
|
NSString* linkErrTitle = NSLocalizedString(@"Heartbeat_box_all_fail_title",nil);
|
|
NSString* linkErrTitle = NSLocalizedString(@"Heartbeat_box_all_fail_title",nil);
|
|
NSString* linkErrTip = NSLocalizedString(@"Heartbeat_box_all_fail_tip",nil);
|
|
NSString* linkErrTip = NSLocalizedString(@"Heartbeat_box_all_fail_tip",nil);
|
|
- NSString* buttonTitle = NSLocalizedString(@"common_I_know",nil);
|
|
|
|
|
|
+ NSString* buttonOKTitle = nil;
|
|
|
|
+ NSString* buttonCloseTitle = NSLocalizedString(@"common_I_know",nil);
|
|
|
|
+ BOOL isOkBtnHighlight = NO;
|
|
|
|
|
|
if(type != 1){
|
|
if(type != 1){
|
|
linkErrTitle = NSLocalizedString(@"Heartbeat_box_part_fail_title",nil);
|
|
linkErrTitle = NSLocalizedString(@"Heartbeat_box_part_fail_title",nil);
|
|
linkErrTip = NSLocalizedString(@"Heartbeat_box_part_fail_tip",nil);
|
|
linkErrTip = NSLocalizedString(@"Heartbeat_box_part_fail_tip",nil);
|
|
- buttonTitle = NSLocalizedString(@"Heartbeat_box_restart_phone",nil);
|
|
|
|
|
|
+ buttonOKTitle = NSLocalizedString(@"Heartbeat_box_restart_phone",nil);
|
|
|
|
+ buttonCloseTitle = NSLocalizedString(@"common_close",nil);
|
|
|
|
+ isOkBtnHighlight = YES;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
KWeakSelf
|
|
KWeakSelf
|
|
linkFailAlretVC= [[ComontAlretViewController alloc] initWithTiTle:linkErrTitle
|
|
linkFailAlretVC= [[ComontAlretViewController alloc] initWithTiTle:linkErrTitle
|
|
msg:linkErrTip
|
|
msg:linkErrTip
|
|
imageStr:@""
|
|
imageStr:@""
|
|
- cancelTitle:buttonTitle
|
|
|
|
- okTitle:@""
|
|
|
|
- isOkBtnHighlight:NO
|
|
|
|
|
|
+ cancelTitle:buttonCloseTitle
|
|
|
|
+ okTitle:buttonOKTitle
|
|
|
|
+ isOkBtnHighlight:isOkBtnHighlight
|
|
didClickOk:^{
|
|
didClickOk:^{
|
|
|
|
|
|
|
|
+ if(self->curDidClickButFun){
|
|
|
|
+ self->curDidClickButFun(1);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ if(type != 1){
|
|
|
|
+ [weakSelf needToRebootFun];
|
|
|
|
+
|
|
|
|
+ ksharedAppDelegate.needToShowReStratSucType = YES;
|
|
|
|
+
|
|
|
|
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
|
+ BoxHeartbeatReStartView *view = [[BoxHeartbeatReStartView alloc] init];
|
|
|
|
+ [ksharedAppDelegate.window addSubview:view];
|
|
|
|
+
|
|
|
|
+ [view mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.left.mas_equalTo(0.f);
|
|
|
|
+ make.bottom.mas_equalTo(0.f);
|
|
|
|
+ make.right.mas_equalTo(0.f);
|
|
|
|
+ make.top.mas_equalTo(0.f);
|
|
|
|
+ }];
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
|
|
} didClickCancel:^{
|
|
} didClickCancel:^{
|
|
|
|
|
|
- if(self->curDidClickButFun){
|
|
|
|
- self->curDidClickButFun(1);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(type != 1){
|
|
|
|
- [weakSelf needToRebootFun];
|
|
|
|
-
|
|
|
|
- ksharedAppDelegate.needToShowReStratSucType = YES;
|
|
|
|
-
|
|
|
|
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
|
- BoxHeartbeatReStartView *view = [[BoxHeartbeatReStartView alloc] init];
|
|
|
|
- [ksharedAppDelegate.window addSubview:view];
|
|
|
|
-
|
|
|
|
- [view mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
- make.left.mas_equalTo(0.f);
|
|
|
|
- make.bottom.mas_equalTo(0.f);
|
|
|
|
- make.right.mas_equalTo(0.f);
|
|
|
|
- make.top.mas_equalTo(0.f);
|
|
|
|
- }];
|
|
|
|
-
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
|
|
}];
|
|
}];
|
|
|
|
|
|
@@ -130,8 +132,32 @@ static BoxHeartbeatAlertTool *shareInstance = nil;
|
|
|
|
|
|
|
|
|
|
linkFailAlretVC.view.tag = type;
|
|
linkFailAlretVC.view.tag = type;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //添加一个删除按钮
|
|
|
|
+// UIView *whiteBgView = [linkFailAlretVC.view viewWithTag:999];
|
|
|
|
+// HLog(@"%@",whiteBgView);
|
|
|
|
+//
|
|
|
|
+// UIButton* delBut = [[UIButton alloc] init];
|
|
|
|
+// [delBut setImage:[UIImage imageNamed:@"common_del"] forState:UIControlStateNormal];
|
|
|
|
+// [delBut addTarget:self action:@selector(delViewFun) forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
+// [whiteBgView addSubview:delBut];
|
|
|
|
+//
|
|
|
|
+// [delBut mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+// make.top.mas_equalTo(0);
|
|
|
|
+// make.right.mas_equalTo(0);
|
|
|
|
+// make.width.mas_equalTo(40);
|
|
|
|
+// make.height.mas_equalTo(40.0);
|
|
|
|
+// }];
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+//#pragma mark 用户点击关闭
|
|
|
|
+//- (void)delViewFun{
|
|
|
|
+// [linkFailAlretVC dismissViewControllerAnimated:YES completion:^{
|
|
|
|
+//
|
|
|
|
+// }];
|
|
|
|
+//}
|
|
|
|
+
|
|
|
|
|
|
#pragma mark 重启云机
|
|
#pragma mark 重启云机
|
|
- (void)needToRebootFun
|
|
- (void)needToRebootFun
|