Przeglądaj źródła

1.相册备份开启弹窗第三点提示最后少了【换】字;相册备份开启弹窗,点击【传输设置】无法跳转到传输列表

huangxiaodong 1 rok temu
rodzic
commit
feca3e69c4

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

@@ -776,6 +776,10 @@
 		6BA08F5A2C01D05B00A2242D /* CWUploadTask+CheckInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BA08F442C01D05B00A2242D /* CWUploadTask+CheckInfo.m */; };
 		6BA533382B16E65500D1CB5C /* TvStatusModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BA533362B16E65500D1CB5C /* TvStatusModel.h */; };
 		6BA533392B16E65500D1CB5C /* TvStatusModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BA533372B16E65500D1CB5C /* TvStatusModel.m */; };
+		6BB481CF2C52481E00C21921 /* backupsOptionTipView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BB481CD2C52481E00C21921 /* backupsOptionTipView.h */; };
+		6BB481D02C52481E00C21921 /* backupsOptionTipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BB481CE2C52481E00C21921 /* backupsOptionTipView.m */; };
+		6BB481D12C52481E00C21921 /* backupsOptionTipView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BB481CD2C52481E00C21921 /* backupsOptionTipView.h */; };
+		6BB481D22C52481E00C21921 /* backupsOptionTipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BB481CE2C52481E00C21921 /* backupsOptionTipView.m */; };
 		6BB852282C4F7FE600570BF6 /* playingAudioGif.gif in Resources */ = {isa = PBXBuildFile; fileRef = 6BB852272C4F7FE500570BF6 /* playingAudioGif.gif */; };
 		6BB852292C4F7FE600570BF6 /* playingAudioGif.gif in Resources */ = {isa = PBXBuildFile; fileRef = 6BB852272C4F7FE500570BF6 /* playingAudioGif.gif */; };
 		6BBB35D92AE7645200E4A59B /* RunInBackground.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 6BBB35D62AE7645200E4A59B /* RunInBackground.mp3 */; };
@@ -1909,6 +1913,8 @@
 		6BA08F442C01D05B00A2242D /* CWUploadTask+CheckInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CWUploadTask+CheckInfo.m"; sourceTree = "<group>"; };
 		6BA533362B16E65500D1CB5C /* TvStatusModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TvStatusModel.h; sourceTree = "<group>"; };
 		6BA533372B16E65500D1CB5C /* TvStatusModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TvStatusModel.m; sourceTree = "<group>"; };
+		6BB481CD2C52481E00C21921 /* backupsOptionTipView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = backupsOptionTipView.h; sourceTree = "<group>"; };
+		6BB481CE2C52481E00C21921 /* backupsOptionTipView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = backupsOptionTipView.m; sourceTree = "<group>"; };
 		6BB852272C4F7FE500570BF6 /* playingAudioGif.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = playingAudioGif.gif; sourceTree = "<group>"; };
 		6BBB35D62AE7645200E4A59B /* RunInBackground.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = RunInBackground.mp3; sourceTree = "<group>"; };
 		6BBB35DB2AE76AD800E4A59B /* AudioSessionObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AudioSessionObject.h; sourceTree = "<group>"; };
@@ -3072,6 +3078,8 @@
 				6B5D86722C22C63F008D25EA /* NASCommonUsedView.m */,
 				6B5D86772C22D6E9008D25EA /* NASLastFileView.h */,
 				6B5D86782C22D6E9008D25EA /* NASLastFileView.m */,
+				6BB481CD2C52481E00C21921 /* backupsOptionTipView.h */,
+				6BB481CE2C52481E00C21921 /* backupsOptionTipView.m */,
 				6B07E0A42C3CD4AF004A3238 /* lastFileTableViewCell.h */,
 				6B07E0A52C3CD4AF004A3238 /* lastFileTableViewCell.m */,
 				6B9283642C4B62A30098CC75 /* newerGuideView.h */,
@@ -3750,6 +3758,7 @@
 				6BEA31752BB65606005167AA /* clearCacheAlretViewController.h in Headers */,
 				6B4C0F842C0315880070EF2E /* audioPlayerViewController.h in Headers */,
 				6B5D866E2C22AE2B008D25EA /* NASMySpaceView.h in Headers */,
+				6BB481CF2C52481E00C21921 /* backupsOptionTipView.h in Headers */,
 				6B467BB32BC7E4360039A6A6 /* addLogObject.h in Headers */,
 				183AE6D12A8CA98C00B11CB0 /* CloudPhoneAPI.h in Headers */,
 				6B07AC252BF85859005C2B0E /* ShareRecordModel.h in Headers */,
@@ -4014,6 +4023,7 @@
 				6BEA31782BB65606005167AA /* clearCacheAlretViewController.h in Headers */,
 				6B4C0F872C0315880070EF2E /* audioPlayerViewController.h in Headers */,
 				6B5D866F2C22AE2B008D25EA /* NASMySpaceView.h in Headers */,
+				6BB481D12C52481E00C21921 /* backupsOptionTipView.h in Headers */,
 				6B467BB52BC7E4360039A6A6 /* addLogObject.h in Headers */,
 				6BD506A92B9576A4006E7CB0 /* CloudPhoneAPI.h in Headers */,
 				6B07AC282BF85859005C2B0E /* ShareRecordModel.h in Headers */,
@@ -4951,6 +4961,7 @@
 				6B304E9B2BEF6058004F5580 /* customShareManageTool.m in Sources */,
 				6BD507D32B9576A4006E7CB0 /* uploadFileRecordEditBottomView.m in Sources */,
 				6BD507D42B9576A4006E7CB0 /* BaseTabBarController.m in Sources */,
+				6BB481D22C52481E00C21921 /* backupsOptionTipView.m in Sources */,
 				6BD507D52B9576A4006E7CB0 /* FLAnimatedImage.m in Sources */,
 				6BD507D62B9576A4006E7CB0 /* main.m in Sources */,
 				6BD507D72B9576A4006E7CB0 /* uploadFileRecordTableView.m in Sources */,
@@ -5297,6 +5308,7 @@
 				6B304E9A2BEF6058004F5580 /* customShareManageTool.m in Sources */,
 				6B7272502B0B58E500C03F87 /* uploadFileRecordEditBottomView.m in Sources */,
 				A003F6A927D841C800715CBF /* BaseTabBarController.m in Sources */,
+				6BB481D02C52481E00C21921 /* backupsOptionTipView.m in Sources */,
 				A003F6C027D841FF00715CBF /* FLAnimatedImage.m in Sources */,
 				A02FF6AC27D7054700D59D3F /* main.m in Sources */,
 				6B7272602B0E240F00C03F87 /* uploadFileRecordTableView.m in Sources */,

+ 52 - 21
创维盒子/双子星云手机/Class/Set/previewFile/backupsOptionViewController.m

@@ -10,6 +10,8 @@
 #import "downloadManager.h"
 #import "backupsFileManager.h"
 #import "AFNetworkReachabilityManager.h"
+#import "backupsOptionTipView.h"
+#import "fileTransfeSetViewController.h"
 
 @interface backupsOptionViewController ()
 {
@@ -187,34 +189,63 @@
         return;
     }
     
-    NSString*msgStr1 = NSLocalizedString(@"backups_need_read_msg",nil);
-    NSString*msgStr2 = NSLocalizedString(@"backups_need_read_msg2",nil);
+    backupsOptionTipView * backupsOptionTipV = [[backupsOptionTipView alloc] init];
+    [ksharedAppDelegate.window addSubview:backupsOptionTipV];
     
-    NSString *totalMsgstr = [[NSString alloc] initWithFormat:@"%@%@",msgStr1,msgStr2];
-    
-    //KWeakSelf
-    /*弹窗提示恢复出厂*/
-    ComontAlretViewController *nextVC = [[ComontAlretViewController alloc] initWithTiTle:@""
-                                                                                     msg:totalMsgstr
-                                                                                imageStr:@""
-                                                                             cancelTitle:NSLocalizedString(@"guide_set_pwd_guide_know",nil)
-                                                                                 okTitle:@""
-                                                                        isOkBtnHighlight:NO
-                                                                              didClickOk:^{
-        
-    } didClickCancel:^{
-        [HWDataManager setBoolWithKey:Const_file_backups_need_read value:YES];
+    [backupsOptionTipV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0.0);
+        make.right.mas_equalTo(0.0);
+        make.top.mas_equalTo(0.0);
+        make.bottom.mas_equalTo(0.0);
     }];
     
-    nextVC.modalPresentationStyle = UIModalPresentationCustom;
-    [nextVC setMsgTextAlignment:NSTextAlignmentLeft];
+    KWeakSelf
+    backupsOptionTipV.didClickButtonFun = ^(NSInteger tag) {
+        if(tag==10){
+            [weakSelf gotoFileTransfeSetVCFun];
+        }
+    };
     
-    [[iTools appRootViewController] presentViewController:nextVC animated:YES completion:^{
-        nextVC.view.superview.backgroundColor = [UIColor clearColor];
-    }];
+//    NSString*msgStr1 = NSLocalizedString(@"backups_need_read_msg",nil);
+//    NSString*msgStr2 = NSLocalizedString(@"backups_need_read_msg2",nil);
+//    
+//    NSString *totalMsgstr = [[NSString alloc] initWithFormat:@"%@%@",msgStr1,msgStr2];
+//    
+//    //KWeakSelf
+//    /*弹窗提示恢复出厂*/
+//    ComontAlretViewController *nextVC = [[ComontAlretViewController alloc] initWithTiTle:@""
+//                                                                                     msg:totalMsgstr
+//                                                                                imageStr:@""
+//                                                                             cancelTitle:NSLocalizedString(@"guide_set_pwd_guide_know",nil)
+//                                                                                 okTitle:@""
+//                                                                        isOkBtnHighlight:NO
+//                                                                              didClickOk:^{
+//        
+//    } didClickCancel:^{
+//        [HWDataManager setBoolWithKey:Const_file_backups_need_read value:YES];
+//    }];
+//    
+//    nextVC.modalPresentationStyle = UIModalPresentationCustom;
+//    [nextVC setMsgTextAlignment:NSTextAlignmentLeft];
+//    
+//    [[iTools appRootViewController] presentViewController:nextVC animated:YES completion:^{
+//        nextVC.view.superview.backgroundColor = [UIColor clearColor];
+//    }];
     
 }
 
+#pragma mark 调整传输设置
+- (void)gotoFileTransfeSetVCFun
+{
+    if(!ksharedAppDelegate.isWebSockLinkOKAginType){
+        [[iToast makeText:NSLocalizedString(@"check_could_phone_state",nil)] show];
+        return;
+    }
+
+    fileTransfeSetViewController *nextVC = [fileTransfeSetViewController new];
+    [self.navigationController pushViewController:nextVC animated:YES];
+}
+
 - (void)setBackupsStateFun
 {
     BOOL haveOpenBackups = [HWDataManager getBoolWithKey:stringKeyAddSn(Const_photo_backups_state)];

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

@@ -988,7 +988,7 @@
     }
     
     newerGuideView *guideView =  [[newerGuideView alloc] init];
-    [[iTools getKeyWindow] addSubview:guideView];
+    [ksharedAppDelegate.window addSubview:guideView];
     
     [guideView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.mas_equalTo(0);

+ 16 - 0
创维盒子/双子星云手机/NAS/view/backupsOptionTipView.h

@@ -0,0 +1,16 @@
+//
+//  backupsOptionTipView.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/7/25.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface backupsOptionTipView : UIView
+@property (nonatomic,copy) void (^didClickButtonFun)(NSInteger tag);
+@end
+
+NS_ASSUME_NONNULL_END

+ 187 - 0
创维盒子/双子星云手机/NAS/view/backupsOptionTipView.m

@@ -0,0 +1,187 @@
+//
+//  backupsOptionTipView.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/7/25.
+//
+
+#import "backupsOptionTipView.h"
+
+@interface backupsOptionTipView ()<UITextViewDelegate>
+
+@end
+
+@implementation backupsOptionTipView
+
+- (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 alloc] init];
+    whiteBgView.backgroundColor = [UIColor whiteColor];
+    [self addSubview:whiteBgView];
+    whiteBgView.layer.cornerRadius = 8;
+    whiteBgView.layer.masksToBounds = YES;
+    
+//    [whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.centerX.mas_equalTo(0);
+//        make.width.mas_equalTo(300);
+//        make.height.mas_equalTo(300);
+//        make.centerY.mas_equalTo(0);
+//    }];
+    
+   
+    //温馨提示
+    UILabel *titleLabel = [[UILabel alloc] init];
+    titleLabel.font = [UIFont boldSystemFontOfSize:18.0];
+    titleLabel.textColor = [UIColor hwColor:@"#151515"];
+    titleLabel.text = NSLocalizedString(@"File_upload_Record_clear_Tip_title",nil);
+    titleLabel.textAlignment = NSTextAlignmentCenter;
+    [whiteBgView addSubview:titleLabel];
+    
+    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.height.mas_equalTo(25);
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.top.mas_equalTo(20);
+    }];
+    
+    
+    UITextView *contentTV = [[UITextView alloc] init];
+    //contentTV.textColor = HW666666Color;//[UIColor hwColor:@"#151515" alpha:0.5];
+//    contentTV.font = [UIFont systemFontOfSize:16.0];
+//    contentTV.textAlignment = NSTextAlignmentCenter;
+    contentTV.delegate = self;
+    contentTV.editable = NO;        //必须禁止输入,否则点击将弹出输入键盘
+    contentTV.scrollEnabled = NO;
+    [whiteBgView addSubview:contentTV];
+        
+    // 创建长按手势识别器
+    UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress)];
+    // 设置长按手势的最小按压时间
+    longPress.minimumPressDuration = 0.5; // 2
+    // 将手势识别器添加到视图上
+    [contentTV addGestureRecognizer:longPress];
+    
+    NSString *title1 = NSLocalizedString(@"backups_need_read_msg",nil);
+    NSString *title2 = NSLocalizedString(@"backups_need_read_msg2",nil);
+    NSString *title3 = NSLocalizedString(@"backups_need_read_msg3",nil);
+    NSString *title4 = NSLocalizedString(@"backups_need_read_msg4",nil);
+
+    
+    NSString *fullTitle = [[NSString alloc] initWithFormat:@"%@%@%@%@",title1,title2,title3,title4];
+    
+    NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:fullTitle];
+    
+    [attrStr addAttribute:NSForegroundColorAttributeName value:[UIColor hwColor:@"#151515" alpha:0.5] range:NSMakeRange(0, attrStr.length)];
+    
+    NSRange redRange = NSMakeRange([fullTitle rangeOfString:title3].location, [fullTitle rangeOfString:title3].length);
+    UIColor *noteColor =[UIColor hwColor:@"#01B7EA" alpha:1.0];
+    [attrStr addAttribute:NSForegroundColorAttributeName value:noteColor 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;
+    
+     //计算高度
+    CGFloat textHeight = [fullTitle boundingRectWithSize:CGSizeMake(270, 1000) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14.0]} context:nil].size.height;
+
+    
+    [contentTV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.height.mas_equalTo(textHeight +20);
+        make.left.mas_equalTo(15);
+        make.right.mas_equalTo(-15);
+        make.top.equalTo(titleLabel.mas_bottom).offset(10.0);
+    }];
+
+    // gradient
+    CAGradientLayer *gl = [CAGradientLayer layer];
+    gl.frame = CGRectMake(0,0,240,40);
+    gl.startPoint = CGPointMake(0.0, 0.5);
+    gl.endPoint = CGPointMake(1, 0.5);
+    gl.colors = @[(__bridge id)[UIColor hwColor:@"#0BDDFD"].CGColor, (__bridge id)[UIColor hwColor:@"#048CFB"].CGColor];
+    gl.locations = @[@(0), @(1.0f)];
+    
+    UIButton *rightbut = [[UIButton alloc] init];
+    [rightbut.layer addSublayer:gl];
+    
+    rightbut.tag = 1;
+    [rightbut addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
+    [rightbut setTitle:NSLocalizedString(@"guide_set_pwd_guide_know",nil) forState:UIControlStateNormal];
+    [rightbut setTitleColor:[UIColor hwColor:@"#FFFFFF"] forState:UIControlStateNormal];
+    rightbut.titleLabel.font = [UIFont systemFontOfSize:16];
+    rightbut.layer.cornerRadius = 8;
+    rightbut.layer.masksToBounds = YES;
+    [whiteBgView addSubview:rightbut];
+    
+    [rightbut mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.mas_equalTo(-30);
+        make.width.mas_equalTo(240);
+        make.height.mas_equalTo(40);
+        make.bottom.mas_equalTo(-25);
+    }];
+    
+
+    [whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.centerX.mas_equalTo(0);
+        make.width.mas_equalTo(300);
+        make.height.mas_equalTo(45 + textHeight + 30 + 65 + 20);
+        make.centerY.mas_equalTo(-20);
+    }];
+    
+    
+}
+
+
+#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)longPress{
+    HLog(@"拦截长按事件")
+}
+
+#pragma mark 按钮事件
+- (void)didClickButtonFun:(UIButton*)but
+{
+    NSInteger tag = but.tag;
+    HLog(@"%ld",tag);
+    
+    [self removeFromSuperview];
+    
+    
+    if(_didClickButtonFun){
+        _didClickButtonFun(tag);
+    }
+}
+@end

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

@@ -112,6 +112,12 @@
         make.top.equalTo(title2Label.mas_bottom).offset(8);
     }];
     
+    // 创建长按手势识别器
+    UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress)];
+    // 设置长按手势的最小按压时间
+    longPress.minimumPressDuration = 0.5; // 2
+    // 将手势识别器添加到视图上
+    [contentTV addGestureRecognizer:longPress];
 
     NSString *title1 = NSLocalizedString(@"NAS_newer_guide_video_tip1",nil);
     NSString *title2 = NSLocalizedString(@"NAS_newer_guide_video_tip2",nil);
@@ -204,6 +210,11 @@
     
 }
 
+#pragma mark 拦截长按事件
+- (void)longPress{
+    HLog(@"拦截长按事件")
+}
+
 #pragma mark 按钮事件
 - (void)didClickButtonFun:(UIButton*)but
 {

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

@@ -595,4 +595,6 @@
 "box_save_fail_reSave_All"   = "全部重试";
 "netWork_error_show_tip"   = "网络异常,请稍后再试!";
 "box_link_error_show_tip"   = "连接盒子异常,请检查网络后再试";
-"backups_need_read_msg2" = "3、备份路径可以到【传输设置】页面进行更换";
+"backups_need_read_msg2" = "3、备份路径可以到";
+"backups_need_read_msg3" = "【传输设置】";
+"backups_need_read_msg4" = "页面进行更换";