Browse Source

1.新手引导弹窗点击【我的>新手引导】无跳转

huangxiaodong 1 year ago
parent
commit
4dcc3f4a5b

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

@@ -970,19 +970,25 @@
     if(tag ==1){
         [self getLastNoticeFun];
     }
-    else if(tag ==2){
+    else if(tag ==2 || tag == 10){
         CustomerWebViewController *vc = [[CustomerWebViewController alloc] init];
         vc.titleStr = NSLocalizedString(@"mine_newuser_title",nil);
         NSString *url = @"http://testprivacy.phone.androidscloud.com:1801/warrantyService/index.html#/novice?isNovice=true";
+        
         if([CloudService rangeOfString:@"hiboxde.armclouding.com"].location != NSNotFound){
             //url = @"http://hiboxde.armclouding.com:7780/h5/rule.html";;
         }
+        
+        if(tag == 10){
+            url = [url stringByReplacingOccurrencesOfString:@"?isNovice=true" withString:@""];
+        }
+        
         vc.webUrl = url;
         [self pushViewController:vc animated:YES];
         
         KWeakSelf
         vc.didClickBackFun = ^{
-            [self getLastNoticeFun];
+            [weakSelf getLastNoticeFun];
         };
     }
 }

+ 55 - 12
创维盒子/双子星云手机/NAS/view/newerGuideView.m

@@ -7,7 +7,7 @@
 
 #import "newerGuideView.h"
 
-@interface newerGuideView ()
+@interface newerGuideView ()<UITextViewDelegate>
 @property(nonatomic,strong) UILabel*titleLabel;
 
 
@@ -82,20 +82,37 @@
     }];
     
     //您可以在【我的>新手引导】查看操作教程
-    UILabel *title3Label = [[UILabel alloc] init];
-    title3Label.font = [UIFont systemFontOfSize:14.0];
-    title3Label.textColor = [UIColor hwColor:@"#0A132B"];
-    //title3Label.text = NSLocalizedString(@"NAS_newer_guide_video_to_world",nil);
-    title3Label.textAlignment = NSTextAlignmentCenter;
-    [whiteBgView addSubview:title3Label];
-    
-    [title3Label mas_makeConstraints:^(MASConstraintMaker *make) {
+//    UILabel *title3Label = [[UILabel alloc] init];
+//    title3Label.font = [UIFont systemFontOfSize:14.0];
+//    title3Label.textColor = [UIColor hwColor:@"#0A132B"];
+//    //title3Label.text = NSLocalizedString(@"NAS_newer_guide_video_to_world",nil);
+//    title3Label.textAlignment = NSTextAlignmentCenter;
+//    [whiteBgView addSubview:title3Label];
+//    
+//    [title3Label mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.height.mas_equalTo(20);
+//        make.left.mas_equalTo(0);
+//        make.right.mas_equalTo(0);
+//        make.top.equalTo(title2Label.mas_bottom).offset(8);
+//    }];
+    
+    UITextView *contentTV = [[UITextView alloc] init];
+    contentTV.textColor = [UIColor hwColor:@"#0A132B"];
+//    contentTV.font = [UIFont systemFontOfSize:16.0];
+//    contentTV.textAlignment = NSTextAlignmentCenter;
+    contentTV.delegate = self;
+    contentTV.editable = NO;        //必须禁止输入,否则点击将弹出输入键盘
+    contentTV.scrollEnabled = NO;
+    [whiteBgView addSubview:contentTV];
+        
+    [contentTV mas_makeConstraints:^(MASConstraintMaker *make) {
         make.height.mas_equalTo(20);
         make.left.mas_equalTo(0);
         make.right.mas_equalTo(0);
         make.top.equalTo(title2Label.mas_bottom).offset(8);
     }];
     
+
     NSString *title1 = NSLocalizedString(@"NAS_newer_guide_video_tip1",nil);
     NSString *title2 = NSLocalizedString(@"NAS_newer_guide_video_tip2",nil);
     NSString *title3 = NSLocalizedString(@"NAS_newer_guide_video_tip3",nil);
@@ -106,9 +123,21 @@
     NSRange redRange = NSMakeRange([fullTitle rangeOfString:title2].location, [fullTitle rangeOfString:title2].length);
     UIColor *noteColor =[UIColor hwColor:@"#01B7EA" alpha:1.0];
     [attrStr addAttribute:NSForegroundColorAttributeName value:noteColor range:redRange];
-    //[attrStr addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:16.0] range:redRange];
+    [attrStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:14.0] range:NSMakeRange(0, attrStr.length)];
+    
+    // 设置段落样式以实现水平中间对齐
+    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+    paragraphStyle.alignment = NSTextAlignmentCenter; // 水平中间对齐
+    [attrStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attrStr.length)];
+      
+      
+    
+    //title3Label.attributedText = attrStr;
+    [attrStr addAttribute:NSLinkAttributeName
+                                   value:@"didclick1://"
+                                   range:redRange];
+    contentTV.attributedText = attrStr;
     
-    title3Label.attributedText = attrStr;
 
     UIButton *leftbut = [[UIButton alloc] init];
     leftbut.tag = 1;
@@ -159,7 +188,21 @@
 }
 
 
-
+#pragma mark ---- textView Delegate ----
+- (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange interaction:(UITextItemInteraction)interaction
+{
+    
+    if([[URL scheme] isEqualToString:@"didclick1"]){
+        [self removeFromSuperview];
+        if(_didClickButtonFun){
+            _didClickButtonFun(10);
+        }
+        return NO;
+    }
+    
+    return YES;
+    
+}
 
 #pragma mark 按钮事件
 - (void)didClickButtonFun:(UIButton*)but