Browse Source

1.弹框优化相关

huangxiaodong 1 year ago
parent
commit
af2dce9224

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

@@ -279,6 +279,10 @@
 		6B8FF6BA2B04E19600800981 /* uploadFileRecordheadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B8FF6B82B04E19600800981 /* uploadFileRecordheadView.m */; };
 		6B8FF6C12B05B24D00800981 /* uploadFileRecordCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B8FF6BF2B05B24D00800981 /* uploadFileRecordCell.h */; };
 		6B8FF6C22B05B24D00800981 /* uploadFileRecordCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B8FF6C02B05B24D00800981 /* uploadFileRecordCell.m */; };
+		6B97143F2BCD00CA00CE0096 /* ComontAlretType2ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B97143E2BCD00C900CE0096 /* ComontAlretType2ViewController.m */; };
+		6B9714402BCD00CA00CE0096 /* ComontAlretType2ViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B97143D2BCD00C900CE0096 /* ComontAlretType2ViewController.h */; };
+		6B9714412BCD00CA00CE0096 /* ComontAlretType2ViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B97143D2BCD00C900CE0096 /* ComontAlretType2ViewController.h */; };
+		6B9714422BCD00CA00CE0096 /* ComontAlretType2ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B97143E2BCD00C900CE0096 /* ComontAlretType2ViewController.m */; };
 		6BA533382B16E65500D1CB5C /* TvStatusModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BA533362B16E65500D1CB5C /* TvStatusModel.h */; };
 		6BA533392B16E65500D1CB5C /* TvStatusModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BA533372B16E65500D1CB5C /* TvStatusModel.m */; };
 		6BBB35D92AE7645200E4A59B /* RunInBackground.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 6BBB35D62AE7645200E4A59B /* RunInBackground.mp3 */; };
@@ -1115,6 +1119,8 @@
 		6B8FF6B82B04E19600800981 /* uploadFileRecordheadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = uploadFileRecordheadView.m; sourceTree = "<group>"; };
 		6B8FF6BF2B05B24D00800981 /* uploadFileRecordCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = uploadFileRecordCell.h; sourceTree = "<group>"; };
 		6B8FF6C02B05B24D00800981 /* uploadFileRecordCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = uploadFileRecordCell.m; sourceTree = "<group>"; };
+		6B97143D2BCD00C900CE0096 /* ComontAlretType2ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ComontAlretType2ViewController.h; sourceTree = "<group>"; };
+		6B97143E2BCD00C900CE0096 /* ComontAlretType2ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ComontAlretType2ViewController.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>"; };
 		6BBB35D62AE7645200E4A59B /* RunInBackground.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = RunInBackground.mp3; sourceTree = "<group>"; };
@@ -2166,6 +2172,8 @@
 			children = (
 				18A909962ABC4A3300E6D2BE /* ComontAlretViewController.h */,
 				18A909972ABC4A3300E6D2BE /* ComontAlretViewController.m */,
+				6B97143D2BCD00C900CE0096 /* ComontAlretType2ViewController.h */,
+				6B97143E2BCD00C900CE0096 /* ComontAlretType2ViewController.m */,
 				18C4754C2A8E0D9B006129C0 /* Set */,
 				18E5571A2A3C5D75005CC84B /* Calculator */,
 				1823A8232A85D66000CE2913 /* Guide */,
@@ -2483,6 +2491,7 @@
 				6B1CC2CA2B67A5FC00AD4217 /* USBInsertPopView.h in Headers */,
 				6BED888E2B4E901900F76DDC /* downloadFileRecordCell.h in Headers */,
 				184C8ACC2A94557200F26650 /* HidenMaskSetViewController.h in Headers */,
+				6B9714402BCD00CA00CE0096 /* ComontAlretType2ViewController.h in Headers */,
 				18EC79DC2ABC109F0084836A /* SetPWDSecondViewController.h in Headers */,
 				6B0582852B0457C400D37290 /* uploadFileManager.h in Headers */,
 				6B467BB92BC7F7D70039A6A6 /* fileUploadToFileCenterModel.h in Headers */,
@@ -2611,6 +2620,7 @@
 				6BD506E82B9576A4006E7CB0 /* USBInsertPopView.h in Headers */,
 				6BD506E92B9576A4006E7CB0 /* downloadFileRecordCell.h in Headers */,
 				6BD506EA2B9576A4006E7CB0 /* HidenMaskSetViewController.h in Headers */,
+				6B9714412BCD00CA00CE0096 /* ComontAlretType2ViewController.h in Headers */,
 				6BD506EB2B9576A4006E7CB0 /* SetPWDSecondViewController.h in Headers */,
 				6BD506EC2B9576A4006E7CB0 /* uploadFileManager.h in Headers */,
 				6B467BBB2BC7F7D70039A6A6 /* fileUploadToFileCenterModel.h in Headers */,
@@ -3078,6 +3088,7 @@
 				6BD507442B9576A4006E7CB0 /* HWAgreementViewController.m in Sources */,
 				6BD507452B9576A4006E7CB0 /* UIImageView+AFNetworking.m in Sources */,
 				6BD507462B9576A4006E7CB0 /* AFSecurityPolicy.m in Sources */,
+				6B9714422BCD00CA00CE0096 /* ComontAlretType2ViewController.m in Sources */,
 				6BD507472B9576A4006E7CB0 /* USBInsertPopView.m in Sources */,
 				6BD507482B9576A4006E7CB0 /* SetUsePWDViewController.m in Sources */,
 				6BD507492B9576A4006E7CB0 /* cloudPhoneCommonModel.m in Sources */,
@@ -3291,6 +3302,7 @@
 				A031DD7F27EC78C800909527 /* HWAgreementViewController.m in Sources */,
 				183AE64F2A8A2CF000B11CB0 /* UIImageView+AFNetworking.m in Sources */,
 				183AE6592A8A2CF000B11CB0 /* AFSecurityPolicy.m in Sources */,
+				6B97143F2BCD00CA00CE0096 /* ComontAlretType2ViewController.m in Sources */,
 				6B1CC2CB2B67A5FC00AD4217 /* USBInsertPopView.m in Sources */,
 				18E557262A3C6088005CC84B /* SetUsePWDViewController.m in Sources */,
 				6B3A4B162B6F69A500F74679 /* cloudPhoneCommonModel.m in Sources */,
@@ -3862,7 +3874,7 @@
 				ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 3;
 				DEVELOPMENT_TEAM = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -3939,7 +3951,7 @@
 				ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 3;
 				DEVELOPMENT_TEAM = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",

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

@@ -9,8 +9,19 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@interface ComontAlretType2ViewController : BaseViewController
+/**
+ *  点击确定
+ */
+typedef void (^CommonAlertType2_ClickOkBtn) (void);
+/**
+ *  点击取消
+ */
+typedef void (^CommonAlertType2_ClickCancelBtn) (void);
+
+typedef void (^CommonAlertType2_ClickOtherBtn) (void);
 
+@interface ComontAlretType2ViewController : BaseViewController
+- (id)initWithTitle:(NSString *)title msg:(NSString *)msg imageStr:(NSString *)images cancelTitle:(NSString *)cancelTitle okTitle:(NSString *)okTitle otherTitle:(NSString *)otherTitle isOkBtnHighlight:(BOOL)okBtnHighlight didClickOk:(CommonAlertType2_ClickOkBtn)ok didClickCancel:(CommonAlertType2_ClickCancelBtn)Cancel didClickOther:(CommonAlertType2_ClickOtherBtn)Other;
 @end
 
 NS_ASSUME_NONNULL_END

+ 237 - 8
创维盒子/双子星云手机/Class/ComontAlretType2ViewController.m

@@ -7,25 +7,254 @@
 
 #import "ComontAlretType2ViewController.h"
 
-@interface ComontAlretType2ViewController ()
+@interface ComontAlretType2ViewController (){
+    NSString *titleStr;
+    NSString *msgStr;
+    NSString *imageStr;
+    NSString *cancelTitleStr;
+    NSString *okTitleStr;
+    NSString *otherTitleStr;
+    BOOL isOkBtnHighlight;
+    
+    CommonAlertType2_ClickOkBtn didClickOkBtn;
+    CommonAlertType2_ClickCancelBtn didClickCanaelBtn;
+    CommonAlertType2_ClickOtherBtn didClickOtherBtn;
+}
 
 @end
 
 @implementation ComontAlretType2ViewController
 
+- (id)initWithTitle:(NSString *)title msg:(NSString *)msg imageStr:(NSString *)images cancelTitle:(NSString *)cancelTitle okTitle:(NSString *)okTitle otherTitle:(NSString *)otherTitle isOkBtnHighlight:(BOOL)okBtnHighlight didClickOk:(CommonAlertType2_ClickOkBtn)ok didClickCancel:(CommonAlertType2_ClickCancelBtn)Cancel didClickOther:(CommonAlertType2_ClickOtherBtn)Other{
+    self = [super init];
+    
+    titleStr = title;
+    msgStr = msg;
+    imageStr = images;
+    cancelTitleStr = cancelTitle;
+    okTitleStr = okTitle;
+    otherTitleStr = otherTitle;
+    isOkBtnHighlight = okBtnHighlight;
+    
+    didClickOkBtn = ok;
+    didClickCanaelBtn = Cancel;
+    didClickOtherBtn = Other;
+    return  self;
+}
+
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
+    
+    [self drawAnyView];
+}
+
+- (void)drawAnyView{
+    [self.view setBackgroundColor:HW000000Color60];
+    
+    [self.toolBar setHidden:YES];
+    [self.navigationBar setHidden:YES];
+        
+    UIView *bgView = [[UIView alloc] init];
+    [bgView setBackgroundColor:[UIColor whiteColor]];
+    [bgView.layer setCornerRadius:8.f];
+    
+    [self.view addSubview:bgView];
+        
+    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.centerY.equalTo(self.view.mas_centerY).offset(10*HAUTOSCALE);
+        make.centerX.equalTo(self.view.mas_centerX);
+        make.width.mas_equalTo(300.f);
+    }];
+    
+    CGFloat curTop = 30.0;
+    
+    //图片
+    UIImageView *topImageView = [[UIImageView alloc] init];
+    //topImageView.backgroundColor = [UIColor redColor];
+    
+    if(imageStr && imageStr.length > 0){
+        topImageView.image = [UIImage imageNamed:imageStr];
+        [bgView addSubview:topImageView];
+        [topImageView mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.width.mas_equalTo(80.f);
+            make.height.mas_equalTo(80.f);
+            make.centerX.equalTo(bgView.mas_centerX);;
+            make.top.mas_equalTo(curTop);
+        }];
+        
+        curTop = 30 + 80 + 10.0;
+    }
+    
+    /*主标题*/
+    UILabel *titleLabel = [[UILabel alloc] init];
+    [titleLabel setTextColor:HW0A132BColor];
+    [titleLabel setFont:[UIFont boldSystemFontOfSize:16.f]];
+    [titleLabel setTextAlignment:(NSTextAlignmentCenter)];
+    [titleLabel setText:titleStr];
+    [titleLabel setNumberOfLines:0];
+    
+    if (titleStr.length > 0){
+        [bgView addSubview:titleLabel];
+        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(10.f);
+            make.right.mas_equalTo(-10.f);
+            make.top.mas_equalTo(curTop);
+        }];
+    }
+    
+    /*副标题*/
+    UILabel *msgLabel = [[UILabel alloc] init];
+    [msgLabel setTextColor:HW333333Color];
+    [msgLabel setFont:[UIFont systemFontOfSize:15.f]];
+    [msgLabel setTextAlignment:(NSTextAlignmentLeft)];
+    msgLabel.tag = 11;
+    [msgLabel setText:msgStr];
+    [msgLabel setNumberOfLines:0];
+    
+    if (msgStr.length > 0){
+        [bgView addSubview:msgLabel];
+        [msgLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(10.f);
+            make.right.mas_equalTo(-10.f);
+            if (titleStr.length > 0){
+                make.top.equalTo(titleLabel.mas_bottom).offset(15.f);
+            }else{
+                make.top.mas_equalTo(curTop);
+            }
+        }];
+    }
+    
+    /*双按钮*/
+    /*取消*/
+    //CGFloat w_btn = 300;
+    CGFloat h_btn = 51;
+    
+    /*取消按钮*/
+    UIButton *cancelBtn = [[UIButton alloc] init];
+    cancelBtn.frame = CGRectMake(0, 0, 115, 48.f);
+    [cancelBtn addTarget:self action:@selector(cancelBtnClick) forControlEvents:(UIControlEventTouchUpInside)];
+    [cancelBtn setTitle:cancelTitleStr forState:(UIControlStateNormal)];
+    [cancelBtn.titleLabel setFont:[UIFont systemFontOfSize:16.f]];
+    [cancelBtn setTitleColor:[UIColor hwColor:@"#01B7EA"] forState:UIControlStateNormal];
+    cancelBtn.tag = 999;
+    [bgView addSubview:cancelBtn];
+    [cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.equalTo(bgView.mas_bottom).offset(0.f);
+        make.height.mas_equalTo(h_btn);
+    }];
+    
+    UIView *lineView = [[UIView alloc] init];
+    lineView.backgroundColor = [UIColor hwColor:@"#CFD1D4"];
+    [bgView addSubview:lineView];
+    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.equalTo(cancelBtn.mas_top).offset(0.f);
+        make.height.mas_equalTo(1.0);
+    }];
+    
+    if (otherTitleStr.length > 0){
+        
+        /*残忍拒绝*/
+        UIButton *otherBtn = [[UIButton alloc] init];
+        [otherBtn addTarget:self action:@selector(otherBtnClick) forControlEvents:(UIControlEventTouchUpInside)];
+        [otherBtn setTitle:otherTitleStr forState:(UIControlStateNormal)];
+        [otherBtn setTitleColor:[UIColor hwColor:@"#01B7EA"] forState:UIControlStateNormal];
+        [otherBtn.titleLabel setFont:[UIFont systemFontOfSize:16.f]];
+        
+        [bgView addSubview:otherBtn];
+        [otherBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(0);
+            make.right.mas_equalTo(0);
+            make.bottom.equalTo(lineView.mas_top).offset(0.f);
+            make.height.mas_equalTo(h_btn);
+        }];
+        
+        UIView *lineView2 = [[UIView alloc] init];
+        lineView2.backgroundColor = [UIColor hwColor:@"#CFD1D4"];
+        [bgView addSubview:lineView2];
+        [lineView2 mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(0);
+            make.right.mas_equalTo(0);
+            make.bottom.equalTo(otherBtn.mas_top).offset(0.f);
+            //make.top.equalTo(msgLabel.mas_bottom).offset(20.f);
+            make.height.mas_equalTo(1.0);
+        }];
+    }
+    
+    if (okTitleStr.length > 0){
+        
+        /*残忍拒绝*/
+        UIButton *okBtn = [[UIButton alloc] init];
+        [okBtn addTarget:self action:@selector(okBtnClick) forControlEvents:(UIControlEventTouchUpInside)];
+        [okBtn setTitle:okTitleStr forState:(UIControlStateNormal)];
+        //[okBtn setTitleColor:HW0A132BColor forState:(UIControlStateNormal)];
+        [okBtn.titleLabel setFont:[UIFont systemFontOfSize:16.f]];
+        [okBtn setTitleColor:[UIColor hwColor:@"#01B7EA"] forState:UIControlStateNormal];
+        
+        [bgView addSubview:okBtn];
+        [okBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(0);
+            make.right.mas_equalTo(0);
+            if (otherTitleStr.length > 0){
+                make.bottom.equalTo(lineView.mas_top).offset(-h_btn);
+            }
+            else{
+                make.bottom.equalTo(lineView.mas_top).offset(0.f);
+            }
+           
+            make.height.mas_equalTo(h_btn);
+        }];
+        
+        UIView *lineView1 = [[UIView alloc] init];
+        lineView1.backgroundColor = [UIColor hwColor:@"#CFD1D4"];
+        [bgView addSubview:lineView1];
+        [lineView1 mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(0);
+            make.right.mas_equalTo(0);
+            make.bottom.equalTo(okBtn.mas_top).offset(0.f);
+            make.top.equalTo(msgLabel.mas_bottom).offset(20.f);
+            make.height.mas_equalTo(1.0);
+        }];
+    }
 }
 
-/*
-#pragma mark - Navigation
 
-// In a storyboard-based application, you will often want to do a little preparation before navigation
-- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
-    // Get the new view controller using [segue destinationViewController].
-    // Pass the selected object to the new view controller.
+- (void)cancelBtnClick{
+    [self dismissViewControllerAnimated:YES completion:^{
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            
+            
+            if(self->didClickCanaelBtn){
+                self->didClickCanaelBtn();
+            }
+        });
+    }];
 }
-*/
 
+- (void)okBtnClick{
+    [self dismissViewControllerAnimated:YES completion:^{
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+
+            if(self->didClickOkBtn){
+                self->didClickOkBtn();
+            }
+            
+        });
+    }];
+}
+
+- (void)otherBtnClick{
+    [self dismissViewControllerAnimated:YES completion:^{
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+
+            if(self->didClickOtherBtn){
+                self->didClickOtherBtn();
+            }
+        });
+    }];
+}
 @end

+ 1 - 1
创维盒子/双子星云手机/CloudPlayer/RCCommandHelp.m

@@ -1160,7 +1160,7 @@ withType:(BOOL)isUploadType
 
 + (NSString *)applyForDownloadThumbnailFileBy:(NSString *)taskUid withFilePath:(NSString *)filePath withPosition:(long)position
 {
-    NSString *dataStr =[NSString stringWithFormat:@"{\"data\":{\"taskUid\":\"%@\",\"filePath\":\"%@\",\"width\":\"200\",\"height\":\"200\",\"position\":\"%ld\"},\"type\":\"getShotCat\"}",taskUid,filePath,position];
+    NSString *dataStr =[NSString stringWithFormat:@"{\"data\":{\"taskUid\":\"%@\",\"filePath\":\"%@\",\"width\":\"300\",\"height\":\"300\",\"position\":\"%ld\"},\"type\":\"getShotCat\"}",taskUid,filePath,position];
 
     if (USENEWCONTROLLCOMMONDNO500)
     {