Browse Source

扫码提示设备信息不存在的提示语按最新版本修改

huangxiaodong 1 year ago
parent
commit
08e79eb77d

+ 1 - 1
创维盒子/双子星云手机/Class/Guide/QRCodeScanViewController.h

@@ -10,7 +10,7 @@
 NS_ASSUME_NONNULL_BEGIN
 
 @interface QRCodeScanViewController : BaseViewController
-
+@property (nonatomic,copy) void (^didScanErrorFun)(void);
 @end
 
 NS_ASSUME_NONNULL_END

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

@@ -319,14 +319,16 @@ bool isDownType = YES;
         if(didSuc == 1){
             [weakSelf gotoGuideViewFunBy:sn];
         }else{
-            if(didSuc == 2){
-                [[iToast makeText:NSLocalizedString(@"scan_sn_data_error_tip",nil)] show];
+//            if(didSuc == 2){
+//                [[iToast makeText:NSLocalizedString(@"scan_sn_data_error_tip",nil)] show];
+//            }
+//            else{
+//                [[iToast makeText:NSLocalizedString(@"guide_qrcoede_tips_get_SdnID_fail",nil)] show];
+//            }
+            if(self->_didScanErrorFun){
+                self->_didScanErrorFun();
             }
-            else{
-                [[iToast makeText:NSLocalizedString(@"guide_qrcoede_tips_get_SdnID_fail",nil)] show];
-            }
-            
-            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
                 [self.navigationController popViewControllerAnimated:YES];
             });
         }

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

@@ -198,6 +198,10 @@
 - (void)qrcodeBtnPressed{
     QRCodeScanViewController *nextVC = [[QRCodeScanViewController alloc] init];
     [self.navigationController pushViewController:nextVC animated:YES];
+    
+    nextVC.didScanErrorFun = ^{
+        self->_isNeedToShowAleatType = YES;
+    };
 }
 
 /*

+ 1 - 1
创维盒子/双子星云手机/Class/Set/ChangeDevice/QRCodeScanForChangeDeviceViewController.h

@@ -10,7 +10,7 @@
 NS_ASSUME_NONNULL_BEGIN
 
 @interface QRCodeScanForChangeDeviceViewController : BaseViewController
-
+@property (nonatomic,copy) void (^didScanErrorFun)(void);
 @end
 
 NS_ASSUME_NONNULL_END

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

@@ -351,15 +351,17 @@ bool isDownType22 = YES;
                 
             }else{
                 
-                if(didSuc == 2){
-                    [[iToast makeText:NSLocalizedString(@"scan_sn_data_error_tip",nil)] show];
-                }
-                else{
-                    [[iToast makeText:NSLocalizedString(@"guide_qrcoede_tips_get_SdnID_fail",nil)] show];
-                }
+//                if(didSuc == 2){
+//                    [[iToast makeText:NSLocalizedString(@"scan_sn_data_error_tip",nil)] show];
+//                }
+//                else{
+//                    [[iToast makeText:NSLocalizedString(@"guide_qrcoede_tips_get_SdnID_fail",nil)] show];
+//                }
                 
-                
-                dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+                if(self->_didScanErrorFun){
+                    self->_didScanErrorFun();
+                }
+                dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
                     mainBlock(^{
                         [self.navigationController popViewControllerAnimated:YES];
                     });

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

@@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface TipsQRCodeForChangeDeviceViewController : BaseViewController
 @property(nonatomic,assign)BOOL isRootVCType;
+@property(nonatomic,assign)BOOL isNeedToShowAleatType;
 @end
 
 NS_ASSUME_NONNULL_END

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

@@ -212,6 +212,9 @@
 - (void)qrcodeBtnPressed{
     QRCodeScanForChangeDeviceViewController *nextVC = [[QRCodeScanForChangeDeviceViewController alloc] init];
     [self.navigationController pushViewController:nextVC animated:YES];
+    nextVC.didScanErrorFun = ^{
+        self->_isNeedToShowAleatType = YES;
+    };
 }
 
 /*
@@ -224,4 +227,38 @@
 }
 */
 
+- (void)viewDidAppear:(BOOL)animated
+{
+    [super viewDidAppear:animated];
+    if(_isNeedToShowAleatType){
+        [self showAlertFun];
+    }
+}
+
+- (void)showAlertFun
+{
+    
+    
+    NSString *linkErrTitle = NSLocalizedString(@"scan_sn_data_error_title",nil);
+    NSString *linkErrTip = NSLocalizedString(@"scan_sn_data_error_content",nil);
+    
+    ComontAlretViewController *linkFailAlretVC= [[ComontAlretViewController alloc] initWithTiTle:linkErrTitle
+                                                                                      msg:linkErrTip
+                                                                                 imageStr:nil
+                                                                              cancelTitle:NSLocalizedString(@"guide_set_pwd_guide_know",nil)
+                                                                                  okTitle:nil isOkBtnHighlight:NO
+                                                                               didClickOk:^{
+        
+        
+     } didClickCancel:^{
+         
+     }];
+    
+     linkFailAlretVC.modalPresentationStyle = UIModalPresentationCustom;
+     
+     [linkFailAlretVC setMsgTextAlignment:NSTextAlignmentLeft];
+     [self presentViewController:linkFailAlretVC animated:YES completion:^{
+         linkFailAlretVC.view.superview.backgroundColor = [UIColor clearColor];
+     }];
+}
 @end