Browse Source

1.分享详情UI

huangxiaodong 1 year ago
parent
commit
ede40a6d4a

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

@@ -223,6 +223,10 @@
 		6B34DC6F2BF2070D002DD1EF /* titleLabelReusableView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B34DC6A2BF2070D002DD1EF /* titleLabelReusableView.h */; };
 		6B3A4B152B6F69A500F74679 /* cloudPhoneCommonModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3A4B132B6F69A500F74679 /* cloudPhoneCommonModel.h */; };
 		6B3A4B162B6F69A500F74679 /* cloudPhoneCommonModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B3A4B142B6F69A500F74679 /* cloudPhoneCommonModel.m */; };
+		6B3AD6842BF48DBA0096D6B7 /* shareRecordDetailsHWViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3AD6822BF48DBA0096D6B7 /* shareRecordDetailsHWViewController.h */; };
+		6B3AD6852BF48DBA0096D6B7 /* shareRecordDetailsHWViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B3AD6832BF48DBA0096D6B7 /* shareRecordDetailsHWViewController.m */; };
+		6B3AD6862BF48DBA0096D6B7 /* shareRecordDetailsHWViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B3AD6832BF48DBA0096D6B7 /* shareRecordDetailsHWViewController.m */; };
+		6B3AD6872BF48DBA0096D6B7 /* shareRecordDetailsHWViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3AD6822BF48DBA0096D6B7 /* shareRecordDetailsHWViewController.h */; };
 		6B3F96342AD2A15A008E349E /* netWorkManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3F96322AD2A15A008E349E /* netWorkManager.h */; };
 		6B3F96352AD2A15A008E349E /* netWorkManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B3F96332AD2A15A008E349E /* netWorkManager.m */; };
 		6B3F963A2AD2AD0B008E349E /* newWorkInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3F96392AD2AD0B008E349E /* newWorkInterface.h */; };
@@ -1095,6 +1099,8 @@
 		6B34DC6B2BF2070D002DD1EF /* titleLabelReusableView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = titleLabelReusableView.m; sourceTree = "<group>"; };
 		6B3A4B132B6F69A500F74679 /* cloudPhoneCommonModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cloudPhoneCommonModel.h; sourceTree = "<group>"; };
 		6B3A4B142B6F69A500F74679 /* cloudPhoneCommonModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = cloudPhoneCommonModel.m; sourceTree = "<group>"; };
+		6B3AD6822BF48DBA0096D6B7 /* shareRecordDetailsHWViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = shareRecordDetailsHWViewController.h; sourceTree = "<group>"; };
+		6B3AD6832BF48DBA0096D6B7 /* shareRecordDetailsHWViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = shareRecordDetailsHWViewController.m; sourceTree = "<group>"; };
 		6B3F96322AD2A15A008E349E /* netWorkManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = netWorkManager.h; sourceTree = "<group>"; };
 		6B3F96332AD2A15A008E349E /* netWorkManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = netWorkManager.m; sourceTree = "<group>"; };
 		6B3F96392AD2AD0B008E349E /* newWorkInterface.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = newWorkInterface.h; sourceTree = "<group>"; };
@@ -1969,6 +1975,8 @@
 				6B93549F2BF37D2D00AA8D31 /* previewAudioOrDocumentViewController.m */,
 				6B9354A42BF3848D00AA8D31 /* shareRecordViewController.h */,
 				6B9354A52BF3848D00AA8D31 /* shareRecordViewController.m */,
+				6B3AD6822BF48DBA0096D6B7 /* shareRecordDetailsHWViewController.h */,
+				6B3AD6832BF48DBA0096D6B7 /* shareRecordDetailsHWViewController.m */,
 			);
 			path = previewFile;
 			sourceTree = "<group>";
@@ -2669,6 +2677,7 @@
 				6B304E982BEF6058004F5580 /* customShareManageTool.h in Headers */,
 				6B5D402F2B4BCBC1000965CF /* downLoadPreViewCell.h in Headers */,
 				6B0581AD2AFCF57300D37290 /* AJPhotoGroupView.h in Headers */,
+				6B3AD6842BF48DBA0096D6B7 /* shareRecordDetailsHWViewController.h in Headers */,
 				18F9CB072ABD7835003FF71A /* QRCodeScanForChangeDeviceViewController.h in Headers */,
 				6B45C5042B5F9CEC007E6911 /* diskListTableView.h in Headers */,
 				18664FF62AC2B3A4008F8A61 /* ShearDeviceUDPManager.h in Headers */,
@@ -2809,6 +2818,7 @@
 				6B304E992BEF6058004F5580 /* customShareManageTool.h in Headers */,
 				6BD507032B9576A4006E7CB0 /* downLoadPreViewCell.h in Headers */,
 				6BD507042B9576A4006E7CB0 /* AJPhotoGroupView.h in Headers */,
+				6B3AD6872BF48DBA0096D6B7 /* shareRecordDetailsHWViewController.h in Headers */,
 				6BD507052B9576A4006E7CB0 /* QRCodeScanForChangeDeviceViewController.h in Headers */,
 				6BD507062B9576A4006E7CB0 /* diskListTableView.h in Headers */,
 				6BD507072B9576A4006E7CB0 /* ShearDeviceUDPManager.h in Headers */,
@@ -3380,6 +3390,7 @@
 				6BD507BC2B9576A4006E7CB0 /* netWorkManager.m in Sources */,
 				6BD507BD2B9576A4006E7CB0 /* HWBookmarkHeader.m in Sources */,
 				6BD507BE2B9576A4006E7CB0 /* HWDataManager.m in Sources */,
+				6B3AD6862BF48DBA0096D6B7 /* shareRecordDetailsHWViewController.m in Sources */,
 				6BD507BF2B9576A4006E7CB0 /* MySetViewController.m in Sources */,
 				6BD507C02B9576A4006E7CB0 /* downloadFileBottomView.m in Sources */,
 				6BD507C12B9576A4006E7CB0 /* FLAnimatedImageView.m in Sources */,
@@ -3605,6 +3616,7 @@
 				6B3F96352AD2A15A008E349E /* netWorkManager.m in Sources */,
 				A031DD7127EC34E500909527 /* HWBookmarkHeader.m in Sources */,
 				A003F6D227D8425C00715CBF /* HWDataManager.m in Sources */,
+				6B3AD6852BF48DBA0096D6B7 /* shareRecordDetailsHWViewController.m in Sources */,
 				18C475502A8E0DB5006129C0 /* MySetViewController.m in Sources */,
 				6B5D40342B4BE358000965CF /* downloadFileBottomView.m in Sources */,
 				A003F6C127D841FF00715CBF /* FLAnimatedImageView.m in Sources */,

+ 22 - 0
创维盒子/双子星云手机/Assets.xcassets/Set/fileSet/share_QRCode_edging.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "share_QRCode_edging@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "share_QRCode_edging@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
创维盒子/双子星云手机/Assets.xcassets/Set/fileSet/share_QRCode_edging.imageset/share_QRCode_edging@2x.png


BIN
创维盒子/双子星云手机/Assets.xcassets/Set/fileSet/share_QRCode_edging.imageset/share_QRCode_edging@3x.png


+ 16 - 0
创维盒子/双子星云手机/Class/Set/previewFile/shareRecordDetailsHWViewController.h

@@ -0,0 +1,16 @@
+//
+//  shareRecordDetailsHWViewController.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/5/15.
+//
+
+#import "BaseViewController.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface shareRecordDetailsHWViewController : BaseViewController
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 225 - 0
创维盒子/双子星云手机/Class/Set/previewFile/shareRecordDetailsHWViewController.m

@@ -0,0 +1,225 @@
+//
+//  shareRecordDetailsHWViewController.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/5/15.
+//
+
+#import "shareRecordDetailsHWViewController.h"
+
+@interface shareRecordDetailsHWViewController ()
+@property (nonatomic,strong)UILabel *shareTitleLabel;
+@property (nonatomic,strong)UILabel *shareBeginDateLabel;
+@property (nonatomic,strong)UIImageView *shareQRCodeImageView;
+@property (nonatomic,strong)UIButton*checkShareLinkButton;
+@property (nonatomic,strong)UILabel *shareEndDateLabel;
+
+@property (nonatomic,strong)UIButton*cancelShareLinkButton;
+@property (nonatomic,strong)UIButton*shareLinkCopyButton;
+@end
+
+@implementation shareRecordDetailsHWViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    
+    [self.toolBar setHidden:YES];
+    [self.navigationBar setHidden:YES];
+    [self.navBarBGView setHidden:NO];
+    self.navBarBGView.backgroundColor = [UIColor whiteColor];
+    [self.view setBackgroundColor:[UIColor hwColor:@"#F5F7FA"]];
+    self.titleLabel.text = NSLocalizedString(@"share_record_title",nil);
+    
+    [self drawAnyView];
+}
+
+- (void)drawAnyView{
+    
+    //
+    UIView *whiteBgView = [[UIView alloc] init];
+    whiteBgView.backgroundColor = [UIColor whiteColor];
+    [self.view addSubview:whiteBgView];
+    
+    whiteBgView.layer.cornerRadius = 8;
+    whiteBgView.layer.masksToBounds = YES;
+    
+    [whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(15);
+        make.right.mas_equalTo(-15);
+        make.top.equalTo(self.navBarBGView.mas_bottom).offset(40.f);
+        make.height.mas_equalTo(448);
+    }];
+    
+    //文件夹图标
+    UIImageView *folderImageView = [[UIImageView alloc] init];
+    folderImageView.image = [UIImage imageNamed:@"uploadFile_file_icon"];
+    folderImageView.backgroundColor = [UIColor whiteColor];
+    [self.view addSubview:folderImageView];
+    
+    folderImageView.layer.cornerRadius = 44;
+    folderImageView.layer.masksToBounds = YES;
+    
+    [folderImageView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
+        make.centerX.mas_equalTo(self.view.mas_centerX);
+        make.width.mas_equalTo(88);
+        make.height.mas_equalTo(88);
+    }];
+    
+    _shareTitleLabel = [[UILabel alloc] init];
+    _shareTitleLabel.text = @"banner.png等多个文件";
+    _shareTitleLabel.textAlignment = NSTextAlignmentCenter;
+    _shareTitleLabel.textColor = HW0A132BColor;
+    _shareTitleLabel.font = [UIFont systemFontOfSize:14.0];
+    [whiteBgView addSubview:_shareTitleLabel];
+    
+    [_shareTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(folderImageView.mas_bottom).offset(5.f);
+        make.left.mas_equalTo(15);
+        make.right.mas_equalTo(-15);
+        make.height.mas_equalTo(20);
+    }];
+    
+    _shareBeginDateLabel = [[UILabel alloc] init];
+    _shareBeginDateLabel.text = @"2024/04/25 19:45";
+    _shareBeginDateLabel.textAlignment = NSTextAlignmentCenter;
+    _shareBeginDateLabel.textColor = HW666666Color;
+    _shareBeginDateLabel.font = [UIFont systemFontOfSize:12.0];
+    [whiteBgView addSubview:_shareBeginDateLabel];
+    
+    [_shareBeginDateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(_shareTitleLabel.mas_bottom).offset(25.f);
+        make.left.mas_equalTo(15);
+        make.right.mas_equalTo(-15);
+        make.height.mas_equalTo(15);
+    }];
+    
+    UIImageView *QRCodeEdgingImageView = [[UIImageView alloc] init];
+    QRCodeEdgingImageView.image = [UIImage imageNamed:@"share_QRCode_edging"];
+    [whiteBgView addSubview:QRCodeEdgingImageView];
+
+    [QRCodeEdgingImageView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(_shareBeginDateLabel.mas_bottom).offset(10.f);
+        make.centerX.mas_equalTo(self.view.mas_centerX);
+        make.width.mas_equalTo(208);
+        make.height.mas_equalTo(208);
+    }];
+    
+    _shareQRCodeImageView = [[UIImageView alloc] init];
+    _shareQRCodeImageView.backgroundColor = [UIColor greenColor];
+    [QRCodeEdgingImageView addSubview:_shareQRCodeImageView];
+    [_shareQRCodeImageView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.mas_equalTo(20);
+        make.bottom.mas_equalTo(-20);
+        make.left.mas_equalTo(20);
+        make.right.mas_equalTo(-20);
+    }];
+    
+    _shareQRCodeImageView.image = [self generateQRCodeWithInputMessage:@"http://baidu.com" Width:168 Height:168];
+    
+    _checkShareLinkButton = [[UIButton alloc] init];
+    [_checkShareLinkButton setTitle:NSLocalizedString(@"check_share_link_title",nil) forState:UIControlStateNormal];
+    [_checkShareLinkButton setTitleColor:[UIColor hwColor:@"#01B7EA"] forState:UIControlStateNormal];
+    _checkShareLinkButton.titleLabel.font = [UIFont systemFontOfSize:14.0];
+    [_checkShareLinkButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
+    _checkShareLinkButton.tag = 1;
+    [self.view addSubview:_checkShareLinkButton];
+    
+    [_checkShareLinkButton mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(15);
+        make.right.mas_equalTo(-15);
+        make.top.equalTo(QRCodeEdgingImageView.mas_bottom).offset(0.f);
+        make.height.mas_equalTo(30);
+    }];
+    
+    _shareEndDateLabel = [[UILabel alloc] init];
+    _shareEndDateLabel.text = @"2024/04/25 19:45";
+    _shareEndDateLabel.textAlignment = NSTextAlignmentCenter;
+    _shareEndDateLabel.textColor = HW0A132BColor;
+    _shareEndDateLabel.font = [UIFont systemFontOfSize:14.0];
+    [whiteBgView addSubview:_shareEndDateLabel];
+    
+    [_shareEndDateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(_checkShareLinkButton.mas_bottom).offset(25.f);
+        make.left.mas_equalTo(15);
+        make.right.mas_equalTo(-15);
+        make.height.mas_equalTo(15);
+    }];
+    
+    
+    
+    _cancelShareLinkButton = [[UIButton alloc] init];
+    [_cancelShareLinkButton setTitle:NSLocalizedString(@"cancel_share_title",nil) forState:UIControlStateNormal];
+    [_cancelShareLinkButton setTitleColor:HW0A132BColor forState:UIControlStateNormal];
+    _cancelShareLinkButton.titleLabel.font = [UIFont systemFontOfSize:14.0];
+    [_cancelShareLinkButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
+    _cancelShareLinkButton.tag = 2;
+    [self.view addSubview:_cancelShareLinkButton];
+    _cancelShareLinkButton.layer.cornerRadius = 8;
+    _cancelShareLinkButton.layer.masksToBounds = YES;
+    _cancelShareLinkButton.backgroundColor = [UIColor hwColor:@"#E3E8F1"];
+    
+    [_cancelShareLinkButton mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(15);
+        make.width.mas_equalTo(130);
+        make.top.equalTo(whiteBgView.mas_bottom).offset(25);
+        make.height.mas_equalTo(48);
+    }];
+    
+    
+    _shareLinkCopyButton = [[UIButton alloc] init];
+    CGFloat w_btn = SCREEN_W-130 -15 -10 -15;
+    
+    // gradient
+    CAGradientLayer *gl = [CAGradientLayer layer];
+    gl.frame = CGRectMake(0,0,w_btn,48.f);
+    gl.startPoint = CGPointMake(0, 0.5);
+    gl.endPoint = CGPointMake(1, 0.5);
+    gl.colors = @[(__bridge id)HW0CDEFDColor.CGColor, (__bridge id)HW058DFBColor.CGColor];
+    gl.locations = @[@(0), @(1.0f)];
+    
+    [_shareLinkCopyButton.layer addSublayer:gl];
+    [_shareLinkCopyButton setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
+    [_shareLinkCopyButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:(UIControlEventTouchUpInside)];
+    [_shareLinkCopyButton setTitle:NSLocalizedString(@"copy_share_link_title",nil) forState:(UIControlStateNormal)];
+    [_shareLinkCopyButton.titleLabel setFont:[UIFont systemFontOfSize:14.f]];
+    [_shareLinkCopyButton.layer setCornerRadius:8.f];
+    _shareLinkCopyButton.clipsToBounds = YES;
+    _shareLinkCopyButton.tag = 11;
+    
+    [self.view addSubview:_shareLinkCopyButton];
+
+    [_shareLinkCopyButton mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.mas_equalTo(-15);
+        make.width.mas_equalTo(w_btn);
+        make.top.equalTo(whiteBgView.mas_bottom).offset(25);
+        make.height.mas_equalTo(48);
+    }];
+    
+}
+
+// 生成二维码
+- (UIImage *)generateQRCodeWithInputMessage:(NSString *)inputMessage
+                                      Width:(CGFloat)width
+                                     Height:(CGFloat)height{
+    NSData *inputData = [inputMessage dataUsingEncoding:NSUTF8StringEncoding];
+    CIFilter *filter = [CIFilter filterWithName:@"CIQRCodeGenerator"];
+    [filter setValue:inputData forKey:@"inputMessage"];
+    //    [filter setValue:@"H" forKey:@"inputCorrectionLevel"]; // 设置二维码不同级别的容错率
+
+    CIImage *ciImage = filter.outputImage;
+    // 消除模糊
+    CGFloat scaleX = MIN(width, height)/ciImage.extent.size.width;
+    CGFloat scaleY = MIN(width, height)/ciImage.extent.size.height;
+    ciImage = [ciImage imageByApplyingTransform:CGAffineTransformScale(CGAffineTransformIdentity, scaleX, scaleY)];
+    UIImage *returnImage = [UIImage imageWithCIImage:ciImage];
+    return returnImage;
+}
+
+- (void)didClickButtonFun:(UIButton*)but
+{
+    
+}
+
+@end

+ 10 - 0
创维盒子/双子星云手机/Class/Set/previewFile/shareRecordViewController.m

@@ -7,6 +7,7 @@
 
 #import "shareRecordViewController.h"
 #import "shareRecordTableViewCell.h"
+#import "shareRecordDetailsHWViewController.h"
 
 @interface shareRecordViewController ()<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
 {
@@ -249,6 +250,15 @@
     return 70;
 }
 
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
+    NSInteger row = indexPath.row;
+    if(isEditType){
+        return;
+    }
+    
+    shareRecordDetailsHWViewController *vc = [shareRecordDetailsHWViewController new];
+    [self.navigationController pushViewController:vc animated:YES];
+}
 
 
 #pragma mark 空数据

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

@@ -474,3 +474,6 @@
 "share_del_record"   = "删除记录";
 "cancel_share_title"   = "取消分享";
 "common_no_data_tip"   = "暂无数据";
+"share_record_title"   = "分享连接";
+"check_share_link_title"   = "查看连接";
+"copy_share_link_title"   = "复制连接";