Sfoglia il codice sorgente

1.检测盒子心跳弹框

huangxiaodong 4 mesi fa
parent
commit
2bb15fd723

+ 2 - 0
创维盒子/code/AppDelegate/AppDelegate.h

@@ -56,6 +56,8 @@
 
 @property(nonatomic,strong) RTCFileLogger *WebRtcLogger;//webRTC日志
 
+@property (nonatomic, assign)  BOOL needToShowReStratSucType;//是否要显示从前成功
+
 +(AppDelegate*)sharedAppDelegate;
 
 #pragma mark 更换设备 重新设置地址

创维盒子/code/NAS/view/BoxHeartbeatAlertTool.h → 创维盒子/code/NAS/BoxHeartbeatAlertTool/BoxHeartbeatAlertTool.h


+ 25 - 7
创维盒子/code/NAS/view/BoxHeartbeatAlertTool.m

@@ -10,6 +10,8 @@
 #import "ComontAlretViewController.h"
 //#import "ComontAlretType2ViewController.h"
 
+#import "BoxHeartbeatReStartView.h"
+
 static BoxHeartbeatAlertTool *shareInstance = nil;
 
 @interface BoxHeartbeatAlertTool ()
@@ -90,15 +92,31 @@ static BoxHeartbeatAlertTool *shareInstance = nil;
                                                                                    didClickOk:^{
            
             
-            if(self->curDidClickButFun){
-                self->curDidClickButFun(1);
-            }
-            
-            if(type != 1){
-                [weakSelf needToRebootFun];
-            }
             
          } 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);
+                     }];
+                     
+                 });
+             }
             
          }];
         

+ 16 - 0
创维盒子/code/NAS/BoxHeartbeatAlertTool/BoxHeartbeatReStartSucView.h

@@ -0,0 +1,16 @@
+//
+//  BoxHeartbeatReStartSucView.h
+//  双子星云手机
+//
+//  Created by xd h on 2025/2/8.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface BoxHeartbeatReStartSucView : UIView
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 143 - 0
创维盒子/code/NAS/BoxHeartbeatAlertTool/BoxHeartbeatReStartSucView.m

@@ -0,0 +1,143 @@
+//
+//  BoxHeartbeatReStartSucView.m
+//  双子星云手机
+//
+//  Created by xd h on 2025/2/8.
+//
+
+#import "BoxHeartbeatReStartSucView.h"
+
+@implementation BoxHeartbeatReStartSucView
+
+- (id)initWithFrame:(CGRect)frame{
+    self = [super initWithFrame:frame];
+    self.backgroundColor = [UIColor hwColor:@"000000" alpha:0.6];
+    [self drawAnyView];
+    
+    return self;
+}
+
+- (void)drawAnyView{
+    UIView*whiteBgView = [UIView new];
+    whiteBgView.layer.cornerRadius = 8;
+    whiteBgView.backgroundColor = [UIColor whiteColor];
+    [self addSubview:whiteBgView];
+    
+    CGFloat curWhiteBgHeight = 300.f;
+    
+    ///获取设备当前地区的代码和APP语言环境
+    NSString *languageCode = [NSLocale preferredLanguages][0];
+
+    //目前支持 中文(简体 繁体) 英文 日语
+    if([languageCode rangeOfString:@"zh-Hans"].location != NSNotFound)
+    {
+    }
+    else if([languageCode rangeOfString:@"zh-Hant"].location != NSNotFound)
+    {
+    }
+    else{
+        curWhiteBgHeight = 500;
+    }
+    
+    [whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.height.mas_equalTo(curWhiteBgHeight);
+        make.width.mas_equalTo(300.f);
+        make.centerY.mas_equalTo(-40.f);
+        make.centerX.mas_equalTo(0.f);
+    }];
+    
+    UIImageView *topImage = [[UIImageView alloc] init];
+    //topImage.image = [UIImage imageNamed:@"imageVersionFailTip"];
+    topImage.backgroundColor = [UIColor lightGrayColor];
+    [whiteBgView addSubview:topImage];
+    
+    [topImage mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.height.mas_equalTo(104.f);
+        make.width.mas_equalTo(123.f);
+        make.centerX.mas_equalTo(0.f);
+        make.top.mas_equalTo(30.f);
+    }];
+    
+    NSString *curTitleStr = NSLocalizedString(@"Heartbeat_box_restart_Suc_phone",nil);
+    UILabel *titleLab = [[UILabel alloc] init];
+    titleLab.text = curTitleStr;
+    titleLab.numberOfLines = 0;
+    titleLab.textColor = [UIColor blackColor];
+    titleLab.font = [UIFont boldSystemFontOfSize:18.0];
+    titleLab.textAlignment = NSTextAlignmentCenter;
+    [whiteBgView addSubview:titleLab];
+    
+    [titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        //make.height.mas_equalTo(60);
+        make.right.mas_equalTo(-20.f);
+        make.left.mas_equalTo(20.f);
+        make.top.equalTo(topImage.mas_bottom).offset(20);
+    }];
+    
+//    NSString *tip1Str = NSLocalizedString(@"Heartbeat_box_restarting_phone_tip",nil);
+//    
+//    
+//    NSString*allTipStr = tip1Str;//[[NSString alloc] initWithFormat:@"%@%@%@",tip1Str,tip2Str,tip3Str];
+//    
+//    UILabel *tipaLab = [[UILabel alloc] init];
+//    tipaLab.text = allTipStr;
+//    tipaLab.numberOfLines = 0;
+//    tipaLab.textColor = [UIColor hwColor:@"#666666"];
+//    tipaLab.font = [UIFont systemFontOfSize:14.0];
+//    tipaLab.textAlignment = NSTextAlignmentCenter;
+//    [whiteBgView addSubview:tipaLab];
+//    
+//    [tipaLab mas_makeConstraints:^(MASConstraintMaker *make) {
+//        //make.height.mas_equalTo(60);
+//        make.right.mas_equalTo(-20.f);
+//        make.left.mas_equalTo(20.f);
+//        make.top.equalTo(titleLab.mas_bottom).offset(10);
+//    }];
+    
+    
+    UIButton *knowBut = [[UIButton alloc] init];
+    [knowBut setTitle:NSLocalizedString(@"common_I_know",nil) forState:UIControlStateNormal];
+    //knowBut.layer.cornerRadius = 8;
+    //knowBut.layer.masksToBounds = YES;
+    [knowBut setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+    [knowBut addTarget:self action:@selector(colseFun) forControlEvents:UIControlEventTouchUpInside];
+    [whiteBgView addSubview:knowBut];
+    
+    CAGradientLayer *gradientLayer = [CAGradientLayer layer];
+    gradientLayer.frame = CGRectMake(0, 0, 268, 40);
+    gradientLayer.colors = @[(__bridge NSString *)[UIColor hwColor:@"#0CDEFD" alpha:1.0].CGColor, (__bridge NSString *)[UIColor hwColor:@"#058DFB" alpha:1.0].CGColor];
+    gradientLayer.locations = @[@(0), @(1.0f)];
+    gradientLayer.startPoint = CGPointMake(0, 0.5);
+    gradientLayer.endPoint = CGPointMake(0.97, 0.5);
+    gradientLayer.cornerRadius = 8;
+    [knowBut.layer addSublayer:gradientLayer];
+
+//    knowBut.layer.shadowColor = [UIColor hwColor:@"#058DFB"].CGColor;
+//    // 设置阴影透明度(0.0到1.0)
+//    knowBut.layer.shadowOpacity = 0.5;
+//    // 设置阴影偏移量(x, y)
+//    knowBut.layer.shadowOffset = CGSizeMake(0, 3);
+//    // 设置阴影模糊半径
+//    knowBut.layer.shadowRadius = 5.0;
+//    // 为了使阴影在按钮外部可见,需要设置masksToBounds为NO
+//    // 注意:如果父视图设置了masksToBounds为YES,那么阴影可能仍然不可见
+//    knowBut.layer.masksToBounds = NO;
+    
+    [knowBut mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.height.mas_equalTo(40.f);
+        make.width.mas_equalTo(268.f);
+        make.centerX.mas_equalTo(0.f);
+        make.bottom.mas_equalTo(-30);
+    }];
+    
+    
+
+}
+
+
+- (void)colseFun
+{
+    [self removeFromSuperview];
+}
+@end
+

+ 16 - 0
创维盒子/code/NAS/BoxHeartbeatAlertTool/BoxHeartbeatReStartView.h

@@ -0,0 +1,16 @@
+//
+//  BoxHeartbeatReStartView.h
+//  双子星云手机
+//
+//  Created by xd h on 2025/2/8.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface BoxHeartbeatReStartView : UIView
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 142 - 0
创维盒子/code/NAS/BoxHeartbeatAlertTool/BoxHeartbeatReStartView.m

@@ -0,0 +1,142 @@
+//
+//  BoxHeartbeatReStartView.m
+//  双子星云手机
+//
+//  Created by xd h on 2025/2/8.
+//
+
+#import "BoxHeartbeatReStartView.h"
+
+@implementation BoxHeartbeatReStartView
+
+- (id)initWithFrame:(CGRect)frame{
+    self = [super initWithFrame:frame];
+    self.backgroundColor = [UIColor hwColor:@"000000" alpha:0.6];
+    [self drawAnyView];
+    
+    return self;
+}
+
+- (void)drawAnyView{
+    UIView*whiteBgView = [UIView new];
+    whiteBgView.layer.cornerRadius = 8;
+    whiteBgView.backgroundColor = [UIColor whiteColor];
+    [self addSubview:whiteBgView];
+    
+    CGFloat curWhiteBgHeight = 300.f;
+    
+    ///获取设备当前地区的代码和APP语言环境
+    NSString *languageCode = [NSLocale preferredLanguages][0];
+
+    //目前支持 中文(简体 繁体) 英文 日语
+    if([languageCode rangeOfString:@"zh-Hans"].location != NSNotFound)
+    {
+    }
+    else if([languageCode rangeOfString:@"zh-Hant"].location != NSNotFound)
+    {
+    }
+    else{
+        curWhiteBgHeight = 500;
+    }
+    
+    [whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.height.mas_equalTo(curWhiteBgHeight);
+        make.width.mas_equalTo(300.f);
+        make.centerY.mas_equalTo(-40.f);
+        make.centerX.mas_equalTo(0.f);
+    }];
+    
+    UIImageView *topImage = [[UIImageView alloc] init];
+    //topImage.image = [UIImage imageNamed:@"imageVersionFailTip"];
+    topImage.backgroundColor = [UIColor lightGrayColor];
+    [whiteBgView addSubview:topImage];
+    
+    [topImage mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.height.mas_equalTo(104.f);
+        make.width.mas_equalTo(123.f);
+        make.centerX.mas_equalTo(0.f);
+        make.top.mas_equalTo(30.f);
+    }];
+    
+    NSString *curTitleStr = NSLocalizedString(@"Heartbeat_box_restarting_phone",nil);
+    UILabel *titleLab = [[UILabel alloc] init];
+    titleLab.text = curTitleStr;
+    titleLab.numberOfLines = 0;
+    titleLab.textColor = [UIColor blackColor];
+    titleLab.font = [UIFont boldSystemFontOfSize:18.0];
+    titleLab.textAlignment = NSTextAlignmentCenter;
+    [whiteBgView addSubview:titleLab];
+    
+    [titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        //make.height.mas_equalTo(60);
+        make.right.mas_equalTo(-20.f);
+        make.left.mas_equalTo(20.f);
+        make.top.equalTo(topImage.mas_bottom).offset(20);
+    }];
+    
+    NSString *tip1Str = NSLocalizedString(@"Heartbeat_box_restarting_phone_tip",nil);
+    
+    
+    NSString*allTipStr = tip1Str;//[[NSString alloc] initWithFormat:@"%@%@%@",tip1Str,tip2Str,tip3Str];
+    
+    UILabel *tipaLab = [[UILabel alloc] init];
+    tipaLab.text = allTipStr;
+    tipaLab.numberOfLines = 0;
+    tipaLab.textColor = [UIColor hwColor:@"#666666"];
+    tipaLab.font = [UIFont systemFontOfSize:14.0];
+    tipaLab.textAlignment = NSTextAlignmentCenter;
+    [whiteBgView addSubview:tipaLab];
+    
+    [tipaLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        //make.height.mas_equalTo(60);
+        make.right.mas_equalTo(-20.f);
+        make.left.mas_equalTo(20.f);
+        make.top.equalTo(titleLab.mas_bottom).offset(10);
+    }];
+    
+    
+    UIButton *knowBut = [[UIButton alloc] init];
+    [knowBut setTitle:NSLocalizedString(@"common_I_know",nil) forState:UIControlStateNormal];
+    //knowBut.layer.cornerRadius = 8;
+    //knowBut.layer.masksToBounds = YES;
+    [knowBut setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+    [knowBut addTarget:self action:@selector(colseFun) forControlEvents:UIControlEventTouchUpInside];
+    [whiteBgView addSubview:knowBut];
+    
+    CAGradientLayer *gradientLayer = [CAGradientLayer layer];
+    gradientLayer.frame = CGRectMake(0, 0, 268, 40);
+    gradientLayer.colors = @[(__bridge NSString *)[UIColor hwColor:@"#0CDEFD" alpha:1.0].CGColor, (__bridge NSString *)[UIColor hwColor:@"#058DFB" alpha:1.0].CGColor];
+    gradientLayer.locations = @[@(0), @(1.0f)];
+    gradientLayer.startPoint = CGPointMake(0, 0.5);
+    gradientLayer.endPoint = CGPointMake(0.97, 0.5);
+    gradientLayer.cornerRadius = 8;
+    [knowBut.layer addSublayer:gradientLayer];
+
+//    knowBut.layer.shadowColor = [UIColor hwColor:@"#058DFB"].CGColor;
+//    // 设置阴影透明度(0.0到1.0)
+//    knowBut.layer.shadowOpacity = 0.5;
+//    // 设置阴影偏移量(x, y)
+//    knowBut.layer.shadowOffset = CGSizeMake(0, 3);
+//    // 设置阴影模糊半径
+//    knowBut.layer.shadowRadius = 5.0;
+//    // 为了使阴影在按钮外部可见,需要设置masksToBounds为NO
+//    // 注意:如果父视图设置了masksToBounds为YES,那么阴影可能仍然不可见
+//    knowBut.layer.masksToBounds = NO;
+    
+    [knowBut mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.height.mas_equalTo(40.f);
+        make.width.mas_equalTo(268.f);
+        make.centerX.mas_equalTo(0.f);
+        make.bottom.mas_equalTo(-30);
+    }];
+    
+    
+
+}
+
+
+- (void)colseFun
+{
+    [self removeFromSuperview];
+}
+@end

+ 4 - 3
创维盒子/code/NAS/NASViewController.m

@@ -1013,9 +1013,10 @@
         return;
     }
     
-//    [[BoxHeartbeatAlertTool shareInstance] showBoxHeartbeatAlertFun:1 didClickBut:^(NSInteger tag) {
-//                
-//    }];
+    //test code
+    [[BoxHeartbeatAlertTool shareInstance] showBoxHeartbeatAlertFun:2 didClickBut:^(NSInteger tag) {
+                
+    }];
     
     if(ksharedAppDelegate.isWebSockLinkOKAginType && ksharedAppDelegate.cloudPhoneExtraFileListMod){
         return;

+ 4 - 0
创维盒子/code/webRtc/webRtcManager/webRtcManager.h

@@ -12,6 +12,10 @@
 #import "webRtcMsgModel.h"
 #import "USBInsertPopView.h"
 #import "addLogObject.h"
+#import "BoxHeartbeatAlertTool.h"
+#import "queryHeartbeatModel.h"
+#import "BoxHeartbeatReStartSucView.h"
+#import "BoxHeartbeatReStartView.h"
 
 NS_ASSUME_NONNULL_BEGIN
 

+ 104 - 0
创维盒子/code/webRtc/webRtcManager/webRtcManager.m

@@ -77,6 +77,9 @@
                 _didReportWebRtcFailType = YES;
                 [self reportWebRtcRePoportTypeIsChannel:YES withStats:nil withSessionId:_webRtcChannelSessionId];
                 [[addLogObject shareInstance] gotoAddLogFun];
+                
+                //检测盒子心跳
+                [self checkBoxHeartbeatFun];
             }
         }
         
@@ -209,6 +212,14 @@
     [self getBaseInfoFun];
     
     [self getTvStatusFun];
+    
+    if(ksharedAppDelegate.needToShowReStratSucType){
+        ksharedAppDelegate.needToShowReStratSucType = NO;
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            [self showReStartSucFun];
+        });
+    }
+    
 }
 
 #pragma mark 盒子第一次连接成功  给ws发送信息 单点登录 把其他账号挤下去
@@ -1057,4 +1068,97 @@
     [self reportWebRtcRePoportTypeIsChannel:YES withLocal:local remoteCandidate:remote withSessionId:self.webRtcChannelSessionId];
 }
 
+
+#pragma mark 检测盒子的心跳情况
+- (void)checkBoxHeartbeatFun
+{
+    //1.隐私模式密码界面 3秒检测一次是否输入完成密码了
+    if(ksharedAppDelegate.isDidShowPwdType){
+        KWeakSelf
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            [weakSelf checkBoxHeartbeatFun];
+        });
+        
+        return;
+    }
+    
+//    [[BoxHeartbeatAlertTool shareInstance] showBoxHeartbeatAlertFun:1 didClickBut:^(NSInteger tag) {
+//
+//    }];
+    
+    if(ksharedAppDelegate.isWebSockLinkOKAginType && ksharedAppDelegate.cloudPhoneExtraFileListMod){
+        return;
+    }
+    
+    NSMutableDictionary *paraDict = [NSMutableDictionary new];
+   
+    KWeakSelf
+    [[netWorkManager shareInstance] CommonGetWithCallBackCode:queryHeartbeat Parameters:paraDict success:^(id  _Nonnull responseObject){
+        queryHeartbeatModel *heartbeatMod = [[queryHeartbeatModel alloc] initWithDictionary:responseObject error:nil];
+        if(heartbeatMod && heartbeatMod.data){
+            [weakSelf checkBoxHeartbeatToShowPopViewFunBy:heartbeatMod];
+        }
+        
+    } failure:^(NSError * _Nonnull error) {
+    }];
+
+}
+
+#pragma mark 根据盒子的心跳情况 显示异常谈了
+- (void)checkBoxHeartbeatToShowPopViewFunBy:(queryHeartbeatModel*)heartbeatMod
+{
+    if(!heartbeatMod || !heartbeatMod.data){
+        return;
+    }
+    
+    if (!heartbeatMod.data.frpStatus
+        &&!heartbeatMod.data.hostAgentStatus
+        &&!heartbeatMod.data.containerAgentStatus) {//全部异常
+        
+        [[BoxHeartbeatAlertTool shareInstance] showBoxHeartbeatAlertFun:1 didClickBut:^(NSInteger tag) {
+                    
+        }];
+    }
+    else if (heartbeatMod.data.hostAgentStatus
+            && !heartbeatMod.data.frpStatus
+            && !heartbeatMod.data.containerAgentStatus) {//frp异常
+        [[BoxHeartbeatAlertTool shareInstance] showBoxHeartbeatAlertFun:2 didClickBut:^(NSInteger tag) {
+                    
+        }];
+    }
+}
+
+#pragma mark 显示重启成功
+- (void)showReStartSucFun
+{
+    //1.隐私模式密码界面 3秒检测一次是否输入完成密码了
+    if(ksharedAppDelegate.isDidShowPwdType){
+        KWeakSelf
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            [weakSelf showReStartSucFun];
+        });
+        
+        return;
+    }
+    
+    NSArray * subViews = ksharedAppDelegate.window.subviews;
+    
+    for (BoxHeartbeatReStartView*view in subViews) {
+        if([view isKindOfClass:[BoxHeartbeatReStartView class]]){
+            [view removeFromSuperview];
+            break;
+        }
+    }
+    
+    
+    BoxHeartbeatReStartSucView *view = [[BoxHeartbeatReStartSucView 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);
+    }];
+}
 @end

+ 69 - 1
创维盒子/code/webRtc/webRtcPlayerViewController.m

@@ -428,7 +428,10 @@
                     tryRelinkNum = 0;
                     _didReportWebRtcFailType = YES;
                     [[webRtcManager shareManager] reportWebRtcRePoportTypeIsChannel:YES withStats:nil withSessionId:_webRtcPlayerSessionId];
-                    [self showLinkPhoneErrorFun];
+                    //[self showLinkPhoneErrorFun];
+                    
+                    //检测盒子心跳
+                    [self checkBoxHeartbeatFun];
                 }
             }
             
@@ -1459,4 +1462,69 @@
 - (UIRectEdge)preferredScreenEdgesDeferringSystemGestures{
     return UIRectEdgeAll;
 }
+
+
+#pragma mark 检测盒子的心跳情况
+- (void)checkBoxHeartbeatFun
+{
+    //1.隐私模式密码界面 3秒检测一次是否输入完成密码了
+    if(ksharedAppDelegate.isDidShowPwdType){
+        KWeakSelf
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            [weakSelf checkBoxHeartbeatFun];
+        });
+        
+        return;
+    }
+    
+//    [[BoxHeartbeatAlertTool shareInstance] showBoxHeartbeatAlertFun:1 didClickBut:^(NSInteger tag) {
+//
+//    }];
+    
+    if(ksharedAppDelegate.isWebSockLinkOKAginType && ksharedAppDelegate.cloudPhoneExtraFileListMod){
+        return;
+    }
+    
+    NSMutableDictionary *paraDict = [NSMutableDictionary new];
+   
+    KWeakSelf
+    [[netWorkManager shareInstance] CommonGetWithCallBackCode:queryHeartbeat Parameters:paraDict success:^(id  _Nonnull responseObject){
+        queryHeartbeatModel *heartbeatMod = [[queryHeartbeatModel alloc] initWithDictionary:responseObject error:nil];
+        if(heartbeatMod && heartbeatMod.data){
+            [weakSelf checkBoxHeartbeatToShowPopViewFunBy:heartbeatMod];
+        }
+        
+    } failure:^(NSError * _Nonnull error) {
+    }];
+
+}
+
+#pragma mark 根据盒子的心跳情况 显示异常谈了
+- (void)checkBoxHeartbeatToShowPopViewFunBy:(queryHeartbeatModel*)heartbeatMod
+{
+    if(!heartbeatMod || !heartbeatMod.data){
+        return;
+    }
+    
+    if (!heartbeatMod.data.frpStatus
+        &&!heartbeatMod.data.hostAgentStatus
+        &&!heartbeatMod.data.containerAgentStatus) {//全部异常
+        
+        [[BoxHeartbeatAlertTool shareInstance] showBoxHeartbeatAlertFun:1 didClickBut:^(NSInteger tag) {
+                    
+        }];
+    }
+    else if (heartbeatMod.data.hostAgentStatus
+            && !heartbeatMod.data.frpStatus
+            && !heartbeatMod.data.containerAgentStatus) {//frp异常
+        [[BoxHeartbeatAlertTool shareInstance] showBoxHeartbeatAlertFun:2 didClickBut:^(NSInteger tag) {
+                    
+        }];
+    }
+    else{//原来的逻辑
+        [self showLinkPhoneErrorFun];
+    }
+}
+
+
 @end

+ 3 - 0
创维盒子/code/zh-Hans.lproj/Localizable.strings

@@ -658,3 +658,6 @@
 "Heartbeat_box_part_fail_title"   = "云手机连接失败";
 "Heartbeat_box_part_fail_tip"   = "检测到设备状态异常导致云手机连接失败,请检查设备电源和网络是否连接正常。若还无法连接请提供SN联系官方客服获取帮助。";
 "Heartbeat_box_restart_phone" = "重启云手机";
+"Heartbeat_box_restarting_phone" = "云手机重启中...";
+"Heartbeat_box_restarting_phone_tip" = "云手机重启预计需要90秒,请稍后重试。";
+"Heartbeat_box_restart_Suc_phone" = "云手机重启成功";

+ 36 - 4
创维盒子/双子星云手机.xcodeproj/project.pbxproj

@@ -1287,6 +1287,14 @@
 		6BD780712C2BF7F10014912F /* customerServiceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BD7806F2C2BF7F10014912F /* customerServiceViewController.m */; };
 		6BD780722C2BF7F10014912F /* customerServiceViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BD7806E2C2BF7F10014912F /* customerServiceViewController.h */; };
 		6BD780732C2BF7F10014912F /* customerServiceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BD7806F2C2BF7F10014912F /* customerServiceViewController.m */; };
+		6BDB85B72D573A9C00526D1F /* BoxHeartbeatReStartView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BDB85B52D573A9C00526D1F /* BoxHeartbeatReStartView.h */; };
+		6BDB85B82D573A9C00526D1F /* BoxHeartbeatReStartView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BDB85B62D573A9C00526D1F /* BoxHeartbeatReStartView.m */; };
+		6BDB85B92D573A9C00526D1F /* BoxHeartbeatReStartView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BDB85B52D573A9C00526D1F /* BoxHeartbeatReStartView.h */; };
+		6BDB85BA2D573A9C00526D1F /* BoxHeartbeatReStartView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BDB85B62D573A9C00526D1F /* BoxHeartbeatReStartView.m */; };
+		6BDB85BD2D57444400526D1F /* BoxHeartbeatReStartSucView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BDB85BB2D57444400526D1F /* BoxHeartbeatReStartSucView.h */; };
+		6BDB85BE2D57444400526D1F /* BoxHeartbeatReStartSucView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BDB85BC2D57444400526D1F /* BoxHeartbeatReStartSucView.m */; };
+		6BDB85BF2D57444400526D1F /* BoxHeartbeatReStartSucView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BDB85BB2D57444400526D1F /* BoxHeartbeatReStartSucView.h */; };
+		6BDB85C02D57444400526D1F /* BoxHeartbeatReStartSucView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BDB85BC2D57444400526D1F /* BoxHeartbeatReStartSucView.m */; };
 		6BEA31752BB65606005167AA /* clearCacheAlretViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BEA31732BB65606005167AA /* clearCacheAlretViewController.h */; };
 		6BEA31762BB65606005167AA /* clearCacheAlretViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BEA31742BB65606005167AA /* clearCacheAlretViewController.m */; };
 		6BEA31772BB65606005167AA /* clearCacheAlretViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BEA31742BB65606005167AA /* clearCacheAlretViewController.m */; };
@@ -2131,6 +2139,10 @@
 		6BD5080D2B9576A9006E7CB0 /* jiSuanQi_Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = jiSuanQi_Info.plist; path = "/Users/xdh/Desktop/创维盒子/创维盒子/jiSuanQi_Info.plist"; sourceTree = "<absolute>"; };
 		6BD7806E2C2BF7F10014912F /* customerServiceViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = customerServiceViewController.h; sourceTree = "<group>"; };
 		6BD7806F2C2BF7F10014912F /* customerServiceViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = customerServiceViewController.m; sourceTree = "<group>"; };
+		6BDB85B52D573A9C00526D1F /* BoxHeartbeatReStartView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BoxHeartbeatReStartView.h; sourceTree = "<group>"; };
+		6BDB85B62D573A9C00526D1F /* BoxHeartbeatReStartView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BoxHeartbeatReStartView.m; sourceTree = "<group>"; };
+		6BDB85BB2D57444400526D1F /* BoxHeartbeatReStartSucView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BoxHeartbeatReStartSucView.h; sourceTree = "<group>"; };
+		6BDB85BC2D57444400526D1F /* BoxHeartbeatReStartSucView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BoxHeartbeatReStartSucView.m; sourceTree = "<group>"; };
 		6BEA31732BB65606005167AA /* clearCacheAlretViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = clearCacheAlretViewController.h; sourceTree = "<group>"; };
 		6BEA31742BB65606005167AA /* clearCacheAlretViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = clearCacheAlretViewController.m; sourceTree = "<group>"; };
 		6BED88882B4E819000F76DDC /* downloadFileRecordTableView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = downloadFileRecordTableView.h; sourceTree = "<group>"; };
@@ -3300,6 +3312,7 @@
 		6B5D86632C227C4A008D25EA /* NAS */ = {
 			isa = PBXGroup;
 			children = (
+				6BDB85B42D572FDC00526D1F /* BoxHeartbeatAlertTool */,
 				6BF62B122D55D57700E7A98A /* model */,
 				6BB573312C8076A600713351 /* nasBackupsManager */,
 				6B9773982C637BFB00213317 /* nasUploadManager */,
@@ -3337,8 +3350,6 @@
 				6B9283652C4B62A30098CC75 /* newerGuideView.m */,
 				6B92836A2C4B94310098CC75 /* errorAlertTool.h */,
 				6B92836B2C4B94310098CC75 /* errorAlertTool.m */,
-				6BF62B1C2D55E2F700E7A98A /* BoxHeartbeatAlertTool.h */,
-				6BF62B1D2D55E2F700E7A98A /* BoxHeartbeatAlertTool.m */,
 				6B0A75DD2C4CA3D300DCB32D /* audioPlayingView.h */,
 				6B0A75DE2C4CA3D300DCB32D /* audioPlayingView.m */,
 			);
@@ -3602,6 +3613,19 @@
 			path = cloudPhone;
 			sourceTree = "<group>";
 		};
+		6BDB85B42D572FDC00526D1F /* BoxHeartbeatAlertTool */ = {
+			isa = PBXGroup;
+			children = (
+				6BF62B1C2D55E2F700E7A98A /* BoxHeartbeatAlertTool.h */,
+				6BF62B1D2D55E2F700E7A98A /* BoxHeartbeatAlertTool.m */,
+				6BDB85B52D573A9C00526D1F /* BoxHeartbeatReStartView.h */,
+				6BDB85B62D573A9C00526D1F /* BoxHeartbeatReStartView.m */,
+				6BDB85BB2D57444400526D1F /* BoxHeartbeatReStartSucView.h */,
+				6BDB85BC2D57444400526D1F /* BoxHeartbeatReStartSucView.m */,
+			);
+			path = BoxHeartbeatAlertTool;
+			sourceTree = "<group>";
+		};
 		6BEA31722BB654F4005167AA /* clearCache */ = {
 			isa = PBXGroup;
 			children = (
@@ -4053,6 +4077,7 @@
 				6B9283672C4B62A30098CC75 /* newerGuideView.h in Headers */,
 				6B3E7A6E2C89479000B032C4 /* webRtcPlayerViewController+AdjustBtnFrame.h in Headers */,
 				6B0582782AFF7C6D00D37290 /* TZAssetModel+imageData.h in Headers */,
+				6BDB85BF2D57444400526D1F /* BoxHeartbeatReStartSucView.h in Headers */,
 				6B8661DD2BBA578600B19846 /* HaveNoticeView.h in Headers */,
 				6B5D403F2B4CE40F000965CF /* downloadManager.h in Headers */,
 				6B679DF02C252ED000D0DC03 /* NASMySpaceTableViewCell.h in Headers */,
@@ -4088,6 +4113,7 @@
 				6B2C1E3E2C070ADE00FDCF82 /* ZFPortraitControlView.h in Headers */,
 				6B0A75E02C4CA3D300DCB32D /* audioPlayingView.h in Headers */,
 				6B3F963A2AD2AD0B008E349E /* newWorkInterface.h in Headers */,
+				6BDB85B92D573A9C00526D1F /* BoxHeartbeatReStartView.h in Headers */,
 				6B0581B22AFE02B100D37290 /* uploadFileBottomView.h in Headers */,
 				18F9CAFC2ABD35C4003FF71A /* ModifyPWDFirstViewController.h in Headers */,
 				1810F9012AA1839C00322116 /* PhoneTimeInfoModel.h in Headers */,
@@ -4350,6 +4376,7 @@
 				6B9283682C4B62A30098CC75 /* newerGuideView.h in Headers */,
 				6B3E7A702C89479300B032C4 /* webRtcPlayerViewController+AdjustBtnFrame.h in Headers */,
 				6BD506A52B9576A4006E7CB0 /* TZAssetModel+imageData.h in Headers */,
+				6BDB85BD2D57444400526D1F /* BoxHeartbeatReStartSucView.h in Headers */,
 				6B8661DE2BBA578600B19846 /* HaveNoticeView.h in Headers */,
 				6BD506A62B9576A4006E7CB0 /* downloadManager.h in Headers */,
 				6B679DF22C252ED000D0DC03 /* NASMySpaceTableViewCell.h in Headers */,
@@ -4385,6 +4412,7 @@
 				6B2C1E3F2C070ADE00FDCF82 /* ZFPortraitControlView.h in Headers */,
 				6B0A75E22C4CA3D300DCB32D /* audioPlayingView.h in Headers */,
 				6BD506B02B9576A4006E7CB0 /* newWorkInterface.h in Headers */,
+				6BDB85B72D573A9C00526D1F /* BoxHeartbeatReStartView.h in Headers */,
 				6BD506B12B9576A4006E7CB0 /* uploadFileBottomView.h in Headers */,
 				6BD506B22B9576A4006E7CB0 /* ModifyPWDFirstViewController.h in Headers */,
 				6BD506B32B9576A4006E7CB0 /* PhoneTimeInfoModel.h in Headers */,
@@ -5072,6 +5100,7 @@
 				6BB573302C7DC7A300713351 /* customUploadOperation.m in Sources */,
 				6BD507712B9576A4006E7CB0 /* AFImageDownloader.m in Sources */,
 				6BD507722B9576A4006E7CB0 /* UIColor+HZXColor.m in Sources */,
+				6BDB85B82D573A9C00526D1F /* BoxHeartbeatReStartView.m in Sources */,
 				6BA464DB2D2384E300AD08ED /* imageVersionUpdateFailView.m in Sources */,
 				6B238C912C60AAE200C5AC2F /* nasDownloadManager.m in Sources */,
 				6BD507732B9576A4006E7CB0 /* CalculatorViewController.m in Sources */,
@@ -5117,6 +5146,7 @@
 				6BD5078E2B9576A4006E7CB0 /* MineViewCell.m in Sources */,
 				6BD5078F2B9576A4006E7CB0 /* PlayerViewController+AdjustBtnFrame.m in Sources */,
 				6BD507902B9576A4006E7CB0 /* cachesFileManager.m in Sources */,
+				6BDB85BE2D57444400526D1F /* BoxHeartbeatReStartSucView.m in Sources */,
 				6BD780732C2BF7F10014912F /* customerServiceViewController.m in Sources */,
 				6B2C1E8F2C070ADE00FDCF82 /* ZFPlayerGestureControl.m in Sources */,
 				6B5BE5882BFC8B0B00A1B9B3 /* previewFileAndFolderSecondViewController.m in Sources */,
@@ -5451,6 +5481,7 @@
 				6BB5732E2C7DC7A300713351 /* customUploadOperation.m in Sources */,
 				183AE6532A8A2CF000B11CB0 /* AFImageDownloader.m in Sources */,
 				A003F6B327D841EE00715CBF /* UIColor+HZXColor.m in Sources */,
+				6BDB85BA2D573A9C00526D1F /* BoxHeartbeatReStartView.m in Sources */,
 				6BA464D82D2384E300AD08ED /* imageVersionUpdateFailView.m in Sources */,
 				6B238C8E2C60AAE200C5AC2F /* nasDownloadManager.m in Sources */,
 				18E557222A3C5D75005CC84B /* CalculatorViewController.m in Sources */,
@@ -5496,6 +5527,7 @@
 				181E84F62A8F451D00292B96 /* MineViewCell.m in Sources */,
 				18FCE5412AD136670020F623 /* PlayerViewController+AdjustBtnFrame.m in Sources */,
 				6B7272542B0CABC600C03F87 /* cachesFileManager.m in Sources */,
+				6BDB85C02D57444400526D1F /* BoxHeartbeatReStartSucView.m in Sources */,
 				6BD780712C2BF7F10014912F /* customerServiceViewController.m in Sources */,
 				6B2C1E8E2C070ADE00FDCF82 /* ZFPlayerGestureControl.m in Sources */,
 				6B5BE5862BFC8B0B00A1B9B3 /* previewFileAndFolderSecondViewController.m in Sources */,
@@ -6020,7 +6052,7 @@
 				CODE_SIGN_ENTITLEMENTS = "隐私保护.entitlements";
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 20;
+				CURRENT_PROJECT_VERSION = 21;
 				DEVELOPMENT_TEAM = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -6099,7 +6131,7 @@
 				CODE_SIGN_ENTITLEMENTS = "隐私保护.entitlements";
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 20;
+				CURRENT_PROJECT_VERSION = 21;
 				DEVELOPMENT_TEAM = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",