Bladeren bron

1.网络异常时交互及文案提示优化

huangxiaodong 11 maanden geleden
bovenliggende
commit
fd3deb38fd

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

@@ -682,6 +682,10 @@
 		6B7EA7BD2BF759AC002D5CC2 /* shareSecretTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B7EA7BB2BF759AC002D5CC2 /* shareSecretTableViewCell.m */; };
 		6B7EA7BE2BF759AC002D5CC2 /* shareSecretTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B7EA7BA2BF759AC002D5CC2 /* shareSecretTableViewCell.h */; };
 		6B7EA7BF2BF759AC002D5CC2 /* shareSecretTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B7EA7BB2BF759AC002D5CC2 /* shareSecretTableViewCell.m */; };
+		6B833A822C48F3B300F9F1D0 /* customToastVew.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B833A812C48F3B300F9F1D0 /* customToastVew.m */; };
+		6B833A832C48F3B300F9F1D0 /* customToastVew.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B833A802C48F3B300F9F1D0 /* customToastVew.h */; };
+		6B833A842C48F3B300F9F1D0 /* customToastVew.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B833A802C48F3B300F9F1D0 /* customToastVew.h */; };
+		6B833A852C48F3B300F9F1D0 /* customToastVew.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B833A812C48F3B300F9F1D0 /* customToastVew.m */; };
 		6B8661D62BBA53B600B19846 /* noticeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B8661D52BBA53B600B19846 /* noticeModel.m */; };
 		6B8661D72BBA53B600B19846 /* noticeModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B8661D42BBA53B600B19846 /* noticeModel.h */; };
 		6B8661D82BBA53B600B19846 /* noticeModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B8661D42BBA53B600B19846 /* noticeModel.h */; };
@@ -1838,6 +1842,8 @@
 		6B7EA7B52BF74BDB002D5CC2 /* shareBySecretView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = shareBySecretView.m; sourceTree = "<group>"; };
 		6B7EA7BA2BF759AC002D5CC2 /* shareSecretTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = shareSecretTableViewCell.h; sourceTree = "<group>"; };
 		6B7EA7BB2BF759AC002D5CC2 /* shareSecretTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = shareSecretTableViewCell.m; sourceTree = "<group>"; };
+		6B833A802C48F3B300F9F1D0 /* customToastVew.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = customToastVew.h; sourceTree = "<group>"; };
+		6B833A812C48F3B300F9F1D0 /* customToastVew.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = customToastVew.m; sourceTree = "<group>"; };
 		6B8661D42BBA53B600B19846 /* noticeModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = noticeModel.h; sourceTree = "<group>"; };
 		6B8661D52BBA53B600B19846 /* noticeModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = noticeModel.m; sourceTree = "<group>"; };
 		6B8661DA2BBA578600B19846 /* HaveNoticeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HaveNoticeView.h; sourceTree = "<group>"; };
@@ -3399,6 +3405,8 @@
 				6B304E972BEF6058004F5580 /* customShareManageTool.m */,
 				6B4C0F912C0320710070EF2E /* NSObject+Extensions.h */,
 				6B4C0F922C0320710070EF2E /* NSObject+Extensions.m */,
+				6B833A802C48F3B300F9F1D0 /* customToastVew.h */,
+				6B833A812C48F3B300F9F1D0 /* customToastVew.m */,
 			);
 			path = Helpers;
 			sourceTree = "<group>";
@@ -3831,6 +3839,7 @@
 				6B0581AF2AFCF57300D37290 /* AJPhotoGroupCell.h in Headers */,
 				6B5D401A2B4A9850000965CF /* couldPhoneFolderListModel.h in Headers */,
 				6B1CC2CA2B67A5FC00AD4217 /* USBInsertPopView.h in Headers */,
+				6B833A832C48F3B300F9F1D0 /* customToastVew.h in Headers */,
 				6B2C1E702C070ADE00FDCF82 /* ZFLandscapeViewController_iOS15.h in Headers */,
 				6BED888E2B4E901900F76DDC /* downloadFileRecordCell.h in Headers */,
 				184C8ACC2A94557200F26650 /* HidenMaskSetViewController.h in Headers */,
@@ -4090,6 +4099,7 @@
 				6BD506E62B9576A4006E7CB0 /* AJPhotoGroupCell.h in Headers */,
 				6BD506E72B9576A4006E7CB0 /* couldPhoneFolderListModel.h in Headers */,
 				6BD506E82B9576A4006E7CB0 /* USBInsertPopView.h in Headers */,
+				6B833A842C48F3B300F9F1D0 /* customToastVew.h in Headers */,
 				6B2C1E712C070ADE00FDCF82 /* ZFLandscapeViewController_iOS15.h in Headers */,
 				6BD506E92B9576A4006E7CB0 /* downloadFileRecordCell.h in Headers */,
 				6BD506EA2B9576A4006E7CB0 /* HidenMaskSetViewController.h in Headers */,
@@ -4827,6 +4837,7 @@
 				6BD507AA2B9576A4006E7CB0 /* JSONModelArray.m in Sources */,
 				6B4C0F692C0314BA0070EF2E /* DFPlayerLyricsTableview.m in Sources */,
 				6BC7415B2C2413B20049BA8D /* webSocketManager+upLoadFile.m in Sources */,
+				6B833A852C48F3B300F9F1D0 /* customToastVew.m in Sources */,
 				6BD507AB2B9576A4006E7CB0 /* AFURLSessionManager.m in Sources */,
 				6BD507AC2B9576A4006E7CB0 /* GuideLastView.m in Sources */,
 				6BD507AD2B9576A4006E7CB0 /* TvStatusModel.m in Sources */,
@@ -5168,6 +5179,7 @@
 				183AE6062A89CE3C00B11CB0 /* JSONModelArray.m in Sources */,
 				6B4C0F682C0314BA0070EF2E /* DFPlayerLyricsTableview.m in Sources */,
 				6BC741592C2413B20049BA8D /* webSocketManager+upLoadFile.m in Sources */,
+				6B833A822C48F3B300F9F1D0 /* customToastVew.m in Sources */,
 				183AE6562A8A2CF000B11CB0 /* AFURLSessionManager.m in Sources */,
 				1868201A2AB94877005702A6 /* GuideLastView.m in Sources */,
 				6BA533392B16E65500D1CB5C /* TvStatusModel.m in Sources */,

+ 0 - 1
创维盒子/双子星云手机/AppDelegate/AppDelegate.m

@@ -10,7 +10,6 @@
 #import "ShearDeviceUDPManager.h"
 #import "AudioSessionObject.h"
 #import "DDYLanguageTool.h"
-#import "AFNetworkReachabilityManager.h"
 #import "PLeakSniffer.h"
 #import "connectDeviceManager.h"
 #import <Bugly/Bugly.h>

+ 3 - 0
创维盒子/双子星云手机/AppDelegate/Config/Const.h

@@ -34,6 +34,9 @@ UIKIT_EXTERN NSString *const Const_Have_Add_Device;
 /*用于存储添加设备的sdnid*/
 UIKIT_EXTERN NSString *const Const_Have_Add_Device_sdnid;
 
+/*用于存储添加设备的隐私模式*/
+UIKIT_EXTERN NSString *const Const_Have_Add_Device_Privacy_Mode;
+
 /*用于存储添加设备的SN号*/
 UIKIT_EXTERN NSString *const Const_Have_Add_Device_SN;
 

+ 4 - 0
创维盒子/双子星云手机/AppDelegate/Config/Const.m

@@ -37,6 +37,10 @@ NSString *const Const_Have_Add_Device_PWD = @"Const_Have_Add_Device_PWD";
 /*用于存储添加设备的sdnid*/
 NSString *const Const_Have_Add_Device_sdnid = @"Const_Have_Add_Device_sdnid";
 
+/*用于存储添加设备的隐私模式*/
+NSString *const Const_Have_Add_Device_Privacy_Mode = @"Const_Have_Add_Device_Privacy_Mode";
+
+
 // 定义一个CloudPhoneType的字符串类型作为枚举类型
 NSString *const Const_NAMEXINGDONG = @"星动";
 NSString *const Const_NAMEXINGYAO = @"星曜";

+ 2 - 0
创维盒子/双子星云手机/AppDelegate/PrefixHeader.pch

@@ -43,6 +43,7 @@
 //网络相关
 #import "netWorkManager.h"
 #import "newWorkInterface.h"
+#import "AFNetworkReachabilityManager.h"
 
 #import "AppDelegate.h"
 #import "connectDeviceManager.h"
@@ -94,6 +95,7 @@ isBangsScreen; \
 //创维盒子 测试地址
 //#define CloudService   @"http://14.18.190.141:1801"
 //#define shareService   @"http://testprivacy.phone.armclouding.com:1801/h5/#/pages/fileSharing/index?productType=Private-X&token="
+
 #define CloudService   @"http://testprivacy.phone.androidscloud.com:1801"
 #define shareService   @"http://testprivacy.phone.androidscloud.com:1801/h5/#/pages/fileSharing/index?productType=Private-X&token="
 

+ 60 - 23
创维盒子/双子星云手机/AppDelegate/SceneDelegate.m

@@ -41,6 +41,7 @@
 #import "customDownloadManager.h"
 #import "audioPlayListManager.h"
 #import "QRCodeScanForChangeDeviceViewController.h"
+#import "customToastVew.h"
 
 @interface SceneDelegate ()<SetUsePWDViewControllerDelegate,GuideViewControllerDelegate,UITabBarControllerDelegate>
 @property(nonatomic, strong)   CalculatorViewController *calculatorVC;
@@ -122,13 +123,6 @@
     }
 }
 
-/** 进入登录界面 - 内部使用 */
-- (void)enterLoginVCFromScene {
-//    UIViewController *vc = [[UIViewController alloc] init];
-//    vc.view.backgroundColor = [UIColor redColor];
-//    UINavigationController *nvc = [[UINavigationController alloc] initWithRootViewController:vc];
-//    self.window.rootViewController = nvc;
-}
 
 /** 主界面 - 内部使用 */
 - (void)enterMainVCFromScene {
@@ -186,15 +180,36 @@
     
     
     if(maskModel == 0 && _isFirstOpenInLaunch){
+        
         //20240612 产品觉得 启动页太快了 要停两秒
         dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            
+            if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable)
+            {
+                [[iToast makeText:NSLocalizedString(@"phone_network_fail_Tips",nil)] show];
+                customToastVew *toastview = [customToastVew makeText:NSLocalizedString(@"phone_network_fail_Tips",nil)];
+                [toastview show];
+                [self->_customLaunchV addSubview:toastview];
+                return;
+            }
+            
             [self getDeviceMsgInMainVCWith:deviceDict];
         });
         
         _isFirstOpenInLaunch = NO;
     }
     else{
-        [self getDeviceMsgInMainVCWith:deviceDict];
+        //延时等网络状态
+        if(_isFirstOpenInLaunch){
+            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+                [self getDeviceMsgInMainVCWith:deviceDict];
+            });
+            _isFirstOpenInLaunch = NO;
+        }
+        else{
+            [self getDeviceMsgInMainVCWith:deviceDict];
+        }
+        
     }
    
     //[self showNetErrorAlertType2Fun];
@@ -202,6 +217,20 @@
 
 - (void)getDeviceMsgInMainVCWith:(NSDictionary*)deviceDict
 {
+
+    if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable)
+    {
+        BOOL isPrivacyMode = [HWDataManager getBoolWithKey:Const_Have_Add_Device_Privacy_Mode];
+        NSInteger maskModel =  [HWDataManager getIntegerWithKey:Const_Mask_View_Model];
+        if(!isPrivacyMode && maskModel == 0){
+            return;
+        }
+        
+        [self initMainTabbarFun];
+        [self showCalculatorVC];
+        return;
+    }
+    
     KWeakSelf
     //有设备了先去做链接准备  // 80bec9c5
     NSString *SNStr = deviceDict[@"Const_Have_Add_Device_SN"];
@@ -716,6 +745,11 @@
         return;
     }
     
+    BOOL isPrivacyMode = [HWDataManager getBoolWithKey:Const_Have_Add_Device_Privacy_Mode];
+    if(!isPrivacyMode){
+        return;
+    }
+    
     //修复扫描已经有密码的合作 点击跳过因为网络弹框再次覆盖一次密码(需要输入两次密码)
     BaseNavigationController*curTopNav = (BaseNavigationController*)[iTools appRootViewController];
     if([curTopNav isKindOfClass:[BaseNavigationController class]]){
@@ -732,11 +766,6 @@
     NSString *PwdStr = nil;
     NSDictionary *deviceDict = [HWDataManager getObjectWithKey:Const_Have_Add_Device];
     
-    //本地密码本地判断 密码改在服务器保持
-    if ([[deviceDict allKeys] containsObject:Const_Have_Add_Device_PWD]){
-        PwdStr = [deviceDict objectForKey:Const_Have_Add_Device_PWD];
-    }
-
     //实时拿到的密码 (每次打开或者更换设备 通过SN重新拿)
     if([connectDeviceManager shareInstance].DeviceThirdIdMod.data.password){
         NSString *curPwd = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.password;
@@ -746,7 +775,12 @@
             PwdStr = desPwdStr;
         }
     }
-   
+    else{
+        //本地密码本地判断 密码改在服务器保持
+        if ([[deviceDict allKeys] containsObject:Const_Have_Add_Device_PWD]){
+            PwdStr = [deviceDict objectForKey:Const_Have_Add_Device_PWD];
+        }
+    }
     
     if (!PwdStr || [PwdStr isEqualToString:@""])
     {
@@ -767,16 +801,19 @@
         return;
     }
     
-    if(![connectDeviceManager shareInstance].DeviceThirdIdMod){
-        return;
-    }
-  
-    BOOL isPrivacyMode = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPrivacyMode;
-    if(!isPrivacyMode)
+    if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus != AFNetworkReachabilityStatusNotReachable)
     {
-        [connectDeviceManager shareInstance].isFirstInputPwdDone = YES;
-        [[NSNotificationCenter defaultCenter] postNotificationName:ShowImgAndVoiceNotification object:nil];
-        return;
+        if(![connectDeviceManager shareInstance].DeviceThirdIdMod){
+            return;
+        }
+      
+        BOOL isPrivacyMode = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPrivacyMode;
+        if(!isPrivacyMode)
+        {
+            [connectDeviceManager shareInstance].isFirstInputPwdDone = YES;
+            [[NSNotificationCenter defaultCenter] postNotificationName:ShowImgAndVoiceNotification object:nil];
+            return;
+        }
     }
     
 #ifdef developJSQ

+ 36 - 30
创维盒子/双子星云手机/Class/Calculator/CalculatorViewController.m

@@ -4,6 +4,7 @@
 #import <Masonry.h>
 #import "connectDeviceManager.h"
 #import "RSATool.h"
+#import "customToastVew.h"
 
 @interface CalculatorViewController ()
 {
@@ -286,7 +287,7 @@
     
     [self addTextFieldFormat];
     
-    HLog(@"忘记密码:%@",_curKeyToForgetPwd);
+    HLog(@"输入密码:%@",_curKeyToForgetPwd);
 }
 
 #pragma mark ----样式处理----
@@ -381,38 +382,43 @@
         NSString *SNStr = deviceDict[@"Const_Have_Add_Device_SN"];
         
         if(SNStr){
-//            [[connectDeviceManager shareInstance] getThridMsgBySN:SNStr needReconnect:NO didNetEnd:^(bool didSuc) {
-//
-//                if(didSuc){
-                    NSString *curPwd = nil;
-                    NSString*desPwdStr = nil;
-                    
-                    if([connectDeviceManager shareInstance].DeviceThirdIdMod.data.password
-                       && [connectDeviceManager shareInstance].DeviceThirdIdMod.data.password.length > 0){
-                        curPwd = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.password;
-                        desPwdStr  = [RSATool AES128Decrypt:curPwd key:AESCODEKEEYY];
-                    }
-                    else{
-                        if(deviceDict && [[deviceDict allKeys] containsObject:Const_Have_Add_Device_PWD])
-                        {
-                            desPwdStr = deviceDict[Const_Have_Add_Device_PWD];
-                        }
+
+                NSString *curPwd = nil;
+                NSString*desPwdStr = nil;
+                
+                if([connectDeviceManager shareInstance].DeviceThirdIdMod.data.password
+                   && [connectDeviceManager shareInstance].DeviceThirdIdMod.data.password.length > 0){
+                    curPwd = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.password;
+                    desPwdStr  = [RSATool AES128Decrypt:curPwd key:AESCODEKEEYY];
+                }
+                else{
+                    if(deviceDict && [[deviceDict allKeys] containsObject:Const_Have_Add_Device_PWD])
+                    {
+                        desPwdStr = deviceDict[Const_Have_Add_Device_PWD];
                     }
-            
-                    if ([desPwdStr isEqualToString:text]){
-                        [connectDeviceManager shareInstance].isFirstInputPwdDone = YES;
+                }
+        
+                if ([desPwdStr isEqualToString:text]){
+                    HLog(@"输入密码正确")
+                    
+                    if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable)
+                    {
+                        //[[iToast makeText:NSLocalizedString(@"phone_network_fail_Tips",nil)] show];
+                        customToastVew *view = [customToastVew makeText:NSLocalizedString(@"phone_network_fail_Tips",nil)];
+                        [view show];
+                        [self.view addSubview:view];
                         
-                        [self.view removeFromSuperview];
-                        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-                            [[NSNotificationCenter defaultCenter] postNotificationName:ShowImgAndVoiceNotification object:nil];
-                        });
+                        return;
                     }
-//                }
-//                else{
-//
-//                }
-//
-//            }];
+                    
+                    [connectDeviceManager shareInstance].isFirstInputPwdDone = YES;
+                    
+                    [self.view removeFromSuperview];
+                    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+                        [[NSNotificationCenter defaultCenter] postNotificationName:ShowImgAndVoiceNotification object:nil];
+                    });
+                }
+
         }
     }
     

+ 14 - 0
创维盒子/双子星云手机/Class/Controller/HWWebViewController.m

@@ -19,6 +19,7 @@
 #import "iPhone.h"
 #import "connectDeviceManager.h"
 #import "RSATool.h"
+#import "customToastVew.h"
 
 @interface HWWebViewController ()<WKScriptMessageHandler,WKNavigationDelegate,WKUIDelegate,HWToolViewControllerDelete>{
     UIView *bgView;/*引导视图*/
@@ -341,6 +342,19 @@
                     }
                     
                     if ([desPwdStr isEqualToString:text]){
+                        
+                        HLog(@"输入密码正确")
+                        
+                        if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable)
+                        {
+                            //[[iToast makeText:NSLocalizedString(@"phone_network_fail_Tips",nil)] show];
+                            customToastVew *view = [customToastVew makeText:NSLocalizedString(@"phone_network_fail_Tips",nil)];
+                            [view show];
+                            [self.view addSubview:view];
+                            
+                            return;
+                        }
+                        
                         [connectDeviceManager shareInstance].isFirstInputPwdDone = YES;
                         
                         [self.view removeFromSuperview];

+ 7 - 0
创维盒子/双子星云手机/Class/Guide/TipsQRCodeViewController.m

@@ -196,6 +196,13 @@
 
 
 - (void)qrcodeBtnPressed{
+    
+    if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable)
+    {
+        [[iToast makeText:NSLocalizedString(@"phone_network_fail_Tips",nil)] show];
+        return;
+    }
+    
     QRCodeScanViewController *nextVC = [[QRCodeScanViewController alloc] init];
     [self.navigationController pushViewController:nextVC animated:YES];
     

+ 7 - 0
创维盒子/双子星云手机/Class/Set/ChangeDevice/QRCodeScanForChangeDeviceViewController.m

@@ -343,6 +343,13 @@ bool isDownType22 = YES;
             
             [self removeNewIndicatorHaveStr];
             
+            if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable)
+            {
+                [[iToast makeText:NSLocalizedString(@"phone_network_fail_Tips",nil)] show];
+                [self.navigationController popViewControllerAnimated:YES];
+                return;
+            }
+            
             if(didSuc == 1){
                 
                 //数据埋点

+ 7 - 0
创维盒子/双子星云手机/Class/Set/ChangeDevice/TipsQRCodeForChangeDeviceViewController.m

@@ -210,6 +210,13 @@
 }
 
 - (void)qrcodeBtnPressed{
+    
+    if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable)
+    {
+        [[iToast makeText:NSLocalizedString(@"phone_network_fail_Tips",nil)] show];
+        return;
+    }
+    
     QRCodeScanForChangeDeviceViewController *nextVC = [[QRCodeScanForChangeDeviceViewController alloc] init];
     [self.navigationController pushViewController:nextVC animated:YES];
     nextVC.didScanErrorFun = ^(NSInteger code) {

+ 18 - 0
创维盒子/双子星云手机/Helpers/customToastVew.h

@@ -0,0 +1,18 @@
+//
+//  customToastVew.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/7/18.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface customToastVew : UIView
+
++ (customToastVew*)makeText:(NSString*)text;
+- (void)show;
+@end
+
+NS_ASSUME_NONNULL_END

+ 97 - 0
创维盒子/双子星云手机/Helpers/customToastVew.m

@@ -0,0 +1,97 @@
+//
+//  customToastVew.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/7/18.
+//
+
+#import "customToastVew.h"
+
+@interface customToastVew ()
+@property(nonatomic,copy)NSString*curText;
+@property(nonatomic,strong)UILabel*textlabel;
+@end
+
+@implementation customToastVew
+
+static customToastVew * _instance;
+
++ (customToastVew*)makeText:(NSString*)text
+{
+    [customToastVew shardInstance].curText = text;
+    
+    return [customToastVew shardInstance];
+}
+
++ (instancetype)shardInstance {
+    
+    static dispatch_once_t customToastVewOnceToken;
+    dispatch_once(&customToastVewOnceToken, ^{
+        _instance = [[self alloc] init];
+    });
+    return _instance;
+}
+
+- (id)initWithFrame:(CGRect)frame
+{
+    self = [super initWithFrame:frame];
+    
+    if (self)
+    {
+        [self drawAnyView];
+    }
+    
+    return self;
+}
+
+- (void)drawAnyView
+{
+
+    
+    CGFloat titleSize = 16.f;
+    //UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, textSize.width + 20, textSize.height + 20)];
+    _textlabel = [[UILabel alloc] init];
+    _textlabel.backgroundColor = [UIColor clearColor];
+    _textlabel.textAlignment = NSTextAlignmentCenter;
+    _textlabel.textColor = [UIColor whiteColor];
+    _textlabel.font = [UIFont systemFontOfSize:titleSize];
+    _textlabel.numberOfLines = 0;
+    
+    self.backgroundColor = [UIColor hwColor:@"#000000" alpha:0.8];
+    self.layer.cornerRadius = 8;
+    self.layer.masksToBounds = YES;
+
+    [self addSubview:_textlabel];
+}
+
+- (void)show
+{
+    CGFloat titleSize = 16.f;
+    CGSize textSize = [_curText boundingRectWithSize:CGSizeMake([UIScreen mainScreen].bounds.size.width * 0.75, 100)
+                                         options:(NSStringDrawingUsesLineFragmentOrigin)
+                                      attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:titleSize], NSForegroundColorAttributeName:[UIColor whiteColor]}
+                                         context:nil].size;
+    
+    _textlabel.frame = CGRectMake(10, 10, textSize.width + 20, textSize.height + 20);
+    _textlabel.text = _curText;
+    
+    self.frame = CGRectMake((SCREEN_W - (textSize.width + 40))/2, (SCREEN_H - (textSize.height + 40))/2, textSize.width + 40, textSize.height + 40);
+    
+    
+    [ksharedAppDelegate.window  insertSubview:self atIndex:0];
+    //[ksharedAppDelegate.mainTabBar.view  insertSubview:self atIndex:0];
+    
+    
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+        [self hideFun];
+    });
+
+}
+
+
+
+-(void)hideFun
+{
+    [self removeFromSuperview];
+}
+@end

+ 12 - 0
创维盒子/双子星云手机/NAS/NASViewController.m

@@ -383,6 +383,12 @@
 #pragma mark 点击头部
 - (void)didClickHeadButtonFun:(UIButton*)but
 {
+    if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable)
+    {
+        [[iToast makeText:NSLocalizedString(@"phone_network_fail_Tips",nil)] show];
+        return;
+    }
+    
     NSInteger tag = but.tag;
     
     switch (tag) {
@@ -449,6 +455,12 @@
 #pragma mark 点击常用模块模块
 - (void)didClickCommonUsedFunBy:(NSInteger)tag
 {
+    if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable)
+    {
+        [[iToast makeText:NSLocalizedString(@"phone_network_fail_Tips",nil)] show];
+        return;
+    }
+    
     switch (tag)
     {
         case 10:{

+ 6 - 0
创维盒子/双子星云手机/cloudPhone/cloudPhoneViewController.m

@@ -163,6 +163,12 @@
 #pragma mark 点击按钮
 - (void)didClickButtonFun:(UIButton*)but
 {
+    if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable)
+    {
+        [[iToast makeText:NSLocalizedString(@"phone_network_fail_Tips",nil)] show];
+        return;
+    }
+    
     NSInteger tag = but.tag;
     HLog(@"%ld",tag);
     switch (tag) {

+ 2 - 0
创维盒子/双子星云手机/connectDeviceManager/connectDeviceManager.m

@@ -121,6 +121,8 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
                 [dict setObject:sdnid forKey:Const_Have_Add_Device_sdnid];
             }
             
+            [HWDataManager setObjectWithKey:Const_Have_Add_Device_Privacy_Mode value:[NSNumber numberWithBool:model.data.isPrivacyMode]];
+            
             [HWDataManager setObjectWithKey:Const_Have_Add_Device value:dict];
             
             //

+ 6 - 0
创维盒子/双子星云手机/mine/mineViewController.m

@@ -120,6 +120,12 @@
 #pragma mark 点击常用模块模块
 - (void)didClickCommonUsedFunBy:(NSInteger)tag
 {
+    if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable)
+    {
+        [[iToast makeText:NSLocalizedString(@"phone_network_fail_Tips",nil)] show];
+        return;
+    }
+    
     switch (tag)
     {
         case 10:{

+ 1 - 0
创维盒子/双子星云手机/zh-Hans.lproj/Localizable.strings

@@ -579,3 +579,4 @@
 "share_report_tip2"   = "举报封禁";
 "delete_upload_task_title_msg"   = "确认删除选中的任务?";
 "delete_with_cloud_file_msg"   = "同时删除云端的文件";
+"phone_network_fail_Tips" = "手机网络异常, 请检查网络或到设置中正确给予网络权限后再试!";