|
|
@@ -8,10 +8,13 @@
|
|
|
#import "shareRecordDetailsHWViewController.h"
|
|
|
|
|
|
@interface shareRecordDetailsHWViewController ()
|
|
|
+@property (nonatomic,strong)UIView *whiteBgView;
|
|
|
@property (nonatomic,strong)UILabel *shareTitleLabel;
|
|
|
@property (nonatomic,strong)UILabel *shareBeginDateLabel;
|
|
|
@property (nonatomic,strong)UIImageView *shareQRCodeImageView;
|
|
|
@property (nonatomic,strong)UIButton*checkShareLinkButton;
|
|
|
+@property (nonatomic,strong)UIView *extractCodeBgView;
|
|
|
+@property (nonatomic,strong)UILabel *extractCodeTip2Lab;
|
|
|
@property (nonatomic,strong)UILabel *shareEndDateLabel;
|
|
|
|
|
|
@property (nonatomic,strong)UIButton*cancelShareLinkButton;
|
|
|
@@ -37,14 +40,14 @@
|
|
|
- (void)drawAnyView{
|
|
|
|
|
|
//
|
|
|
- UIView *whiteBgView = [[UIView alloc] init];
|
|
|
- whiteBgView.backgroundColor = [UIColor whiteColor];
|
|
|
- [self.view addSubview:whiteBgView];
|
|
|
+ _whiteBgView = [[UIView alloc] init];
|
|
|
+ _whiteBgView.backgroundColor = [UIColor whiteColor];
|
|
|
+ [self.view addSubview:_whiteBgView];
|
|
|
|
|
|
- whiteBgView.layer.cornerRadius = 8;
|
|
|
- whiteBgView.layer.masksToBounds = YES;
|
|
|
+ _whiteBgView.layer.cornerRadius = 8;
|
|
|
+ _whiteBgView.layer.masksToBounds = YES;
|
|
|
|
|
|
- [whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ [_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);
|
|
|
@@ -68,11 +71,11 @@
|
|
|
}];
|
|
|
|
|
|
_shareTitleLabel = [[UILabel alloc] init];
|
|
|
- _shareTitleLabel.text = @"banner.png等多个文件";
|
|
|
+ //_shareTitleLabel.text = @"banner.png等多个文件";
|
|
|
_shareTitleLabel.textAlignment = NSTextAlignmentCenter;
|
|
|
_shareTitleLabel.textColor = HW0A132BColor;
|
|
|
_shareTitleLabel.font = [UIFont systemFontOfSize:14.0];
|
|
|
- [whiteBgView addSubview:_shareTitleLabel];
|
|
|
+ [_whiteBgView addSubview:_shareTitleLabel];
|
|
|
|
|
|
[_shareTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
make.top.equalTo(folderImageView.mas_bottom).offset(5.f);
|
|
|
@@ -82,11 +85,11 @@
|
|
|
}];
|
|
|
|
|
|
_shareBeginDateLabel = [[UILabel alloc] init];
|
|
|
- _shareBeginDateLabel.text = @"2024/04/25 19:45";
|
|
|
+ //_shareBeginDateLabel.text = @"2024/04/25 19:45";
|
|
|
_shareBeginDateLabel.textAlignment = NSTextAlignmentCenter;
|
|
|
_shareBeginDateLabel.textColor = HW666666Color;
|
|
|
_shareBeginDateLabel.font = [UIFont systemFontOfSize:12.0];
|
|
|
- [whiteBgView addSubview:_shareBeginDateLabel];
|
|
|
+ [_whiteBgView addSubview:_shareBeginDateLabel];
|
|
|
|
|
|
[_shareBeginDateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
make.top.equalTo(_shareTitleLabel.mas_bottom).offset(25.f);
|
|
|
@@ -97,7 +100,7 @@
|
|
|
|
|
|
UIImageView *QRCodeEdgingImageView = [[UIImageView alloc] init];
|
|
|
QRCodeEdgingImageView.image = [UIImage imageNamed:@"share_QRCode_edging"];
|
|
|
- [whiteBgView addSubview:QRCodeEdgingImageView];
|
|
|
+ [_whiteBgView addSubview:QRCodeEdgingImageView];
|
|
|
|
|
|
[QRCodeEdgingImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
make.top.equalTo(_shareBeginDateLabel.mas_bottom).offset(10.f);
|
|
|
@@ -107,7 +110,7 @@
|
|
|
}];
|
|
|
|
|
|
_shareQRCodeImageView = [[UIImageView alloc] init];
|
|
|
- _shareQRCodeImageView.backgroundColor = [UIColor greenColor];
|
|
|
+ //_shareQRCodeImageView.backgroundColor = [UIColor lightGrayColor];
|
|
|
[QRCodeEdgingImageView addSubview:_shareQRCodeImageView];
|
|
|
[_shareQRCodeImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
make.top.mas_equalTo(20);
|
|
|
@@ -116,7 +119,7 @@
|
|
|
make.right.mas_equalTo(-20);
|
|
|
}];
|
|
|
|
|
|
- _shareQRCodeImageView.image = [self generateQRCodeWithInputMessage:@"http://baidu.com" Width:168 Height:168];
|
|
|
+ //_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];
|
|
|
@@ -133,15 +136,58 @@
|
|
|
make.height.mas_equalTo(30);
|
|
|
}];
|
|
|
|
|
|
+ //提取码
|
|
|
+ _extractCodeBgView = [[UIView alloc] init];
|
|
|
+ _extractCodeBgView.backgroundColor = [UIColor hwColor:@"#F9F9F9"];
|
|
|
+ [_whiteBgView addSubview:_extractCodeBgView];
|
|
|
+ _extractCodeBgView.layer.cornerRadius = 8;
|
|
|
+ _extractCodeBgView.layer.masksToBounds = YES;
|
|
|
+
|
|
|
+ [_extractCodeBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(50);
|
|
|
+ make.right.mas_equalTo(-50);
|
|
|
+ make.top.equalTo(_checkShareLinkButton.mas_bottom).offset(15);
|
|
|
+ make.height.mas_equalTo(40);
|
|
|
+ }];
|
|
|
+
|
|
|
+ UILabel *extractCodeTipLab = [[UILabel alloc] init];
|
|
|
+ extractCodeTipLab.font = [UIFont systemFontOfSize:14.f];
|
|
|
+ [extractCodeTipLab setTextColor:HW0A132BColor];
|
|
|
+ extractCodeTipLab.text = NSLocalizedString(@"share_Extract_code_tip",nil);
|
|
|
+ [_extractCodeBgView addSubview:extractCodeTipLab];
|
|
|
+
|
|
|
+ [extractCodeTipLab mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(15);
|
|
|
+ make.right.mas_equalTo(_extractCodeBgView.mas_centerX);
|
|
|
+ make.top.mas_equalTo(0);
|
|
|
+ make.bottom.mas_equalTo(0);
|
|
|
+ }];
|
|
|
+
|
|
|
+ _extractCodeTip2Lab = [[UILabel alloc] init];
|
|
|
+ _extractCodeTip2Lab.font = [UIFont systemFontOfSize:14.f];
|
|
|
+ //[_extractCodeTip2Lab setTextAlignment:(NSTextAlignmentRight)];
|
|
|
+ [_extractCodeTip2Lab setTextAlignment:(NSTextAlignmentCenter)];
|
|
|
+ [_extractCodeTip2Lab setTextColor:[UIColor hwColor:@"#01B7EA" alpha:1.0]];
|
|
|
+ [_extractCodeBgView addSubview:_extractCodeTip2Lab];
|
|
|
+ //extractCodeTip2Lab.text = _addShareMod.data.extractionCode;
|
|
|
+
|
|
|
+ [_extractCodeTip2Lab mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ //make.left.mas_equalTo(extractCodeTipLab.mas_right);
|
|
|
+ make.left.mas_equalTo(20);
|
|
|
+ make.right.mas_equalTo(-20);
|
|
|
+ make.top.mas_equalTo(0);
|
|
|
+ make.bottom.mas_equalTo(0);
|
|
|
+ }];
|
|
|
+
|
|
|
_shareEndDateLabel = [[UILabel alloc] init];
|
|
|
- _shareEndDateLabel.text = @"2024/04/25 19:45";
|
|
|
+ //_shareEndDateLabel.text = @"2024/04/25 19:45";
|
|
|
_shareEndDateLabel.textAlignment = NSTextAlignmentCenter;
|
|
|
_shareEndDateLabel.textColor = HW0A132BColor;
|
|
|
_shareEndDateLabel.font = [UIFont systemFontOfSize:14.0];
|
|
|
- [whiteBgView addSubview:_shareEndDateLabel];
|
|
|
+ [_whiteBgView addSubview:_shareEndDateLabel];
|
|
|
|
|
|
[_shareEndDateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.top.equalTo(_checkShareLinkButton.mas_bottom).offset(25.f);
|
|
|
+ make.top.equalTo(_extractCodeBgView.mas_bottom).offset(15.f);
|
|
|
make.left.mas_equalTo(15);
|
|
|
make.right.mas_equalTo(-15);
|
|
|
make.height.mas_equalTo(15);
|
|
|
@@ -163,7 +209,7 @@
|
|
|
[_cancelShareLinkButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
make.left.mas_equalTo(15);
|
|
|
make.width.mas_equalTo(130);
|
|
|
- make.top.equalTo(whiteBgView.mas_bottom).offset(25);
|
|
|
+ make.top.equalTo(_whiteBgView.mas_bottom).offset(25);
|
|
|
make.height.mas_equalTo(48);
|
|
|
}];
|
|
|
|
|
|
@@ -193,7 +239,7 @@
|
|
|
[_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.top.equalTo(_whiteBgView.mas_bottom).offset(25);
|
|
|
make.height.mas_equalTo(48);
|
|
|
}];
|
|
|
|
|
|
@@ -222,4 +268,82 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
+- (void)viewWillAppear:(BOOL)animated
|
|
|
+{
|
|
|
+ [super viewWillAppear:animated];
|
|
|
+ [self handleDataFun];
|
|
|
+}
|
|
|
+
|
|
|
+//- (void)setDataModel:(ShareRecordListModel *)dataModel
|
|
|
+- (void)handleDataFun
|
|
|
+{
|
|
|
+ //_dataModel = dataModel;
|
|
|
+
|
|
|
+ if(!_dataModel.expirationStatus){
|
|
|
+ _cancelShareLinkButton.hidden = NO;
|
|
|
+ _shareLinkCopyButton.hidden = NO;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ _cancelShareLinkButton.hidden = YES;
|
|
|
+ _shareLinkCopyButton.hidden = YES;
|
|
|
+ }
|
|
|
+
|
|
|
+ //失效时间
|
|
|
+ NSString *tipStr = NSLocalizedString(@"copy_share_link_Invalid_tip3",nil);
|
|
|
+ _shareEndDateLabel.text = [[NSString alloc] initWithFormat:@"%@: %@",tipStr,_dataModel.expirationTime];
|
|
|
+
|
|
|
+ ShareFileDataModel *fileModel = _dataModel.fileListVOS.firstObject;
|
|
|
+ NSString *titleStr = [[NSString alloc] initWithFormat:@"%@%@%ld%@",fileModel.fileName,NSLocalizedString(@"share_file_more_tip",nil), _dataModel.fileListVOS.count,NSLocalizedString(@"share_file_Numbers_tip",nil)];
|
|
|
+
|
|
|
+ if(_dataModel.fileListVOS.count == 1){
|
|
|
+ titleStr = fileModel.fileName;
|
|
|
+ }
|
|
|
+
|
|
|
+ _shareTitleLabel.text = titleStr;
|
|
|
+ _shareBeginDateLabel.text = _dataModel.createTime;
|
|
|
+
|
|
|
+ NSString *serUrl = @"http://192.168.12.253:8080/#/pages/fileSharing/index?token=";
|
|
|
+ NSString *shareUrl = [[NSString alloc] initWithFormat:@"%@%@",serUrl,_dataModel.token];
|
|
|
+ _shareQRCodeImageView.image = [self generateQRCodeWithInputMessage:shareUrl Width:168 Height:168];
|
|
|
+
|
|
|
+ _extractCodeTip2Lab.text = _dataModel.extractionCode;
|
|
|
+
|
|
|
+ if(_dataModel.platformType == 4){
|
|
|
+
|
|
|
+ [_whiteBgView mas_remakeConstraints:^(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(508);
|
|
|
+ }];
|
|
|
+
|
|
|
+ _extractCodeBgView.hidden = NO;
|
|
|
+
|
|
|
+ [_shareEndDateLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.top.equalTo(_extractCodeBgView.mas_bottom).offset(15.f);
|
|
|
+ make.left.mas_equalTo(15);
|
|
|
+ make.right.mas_equalTo(-15);
|
|
|
+ make.height.mas_equalTo(15);
|
|
|
+ }];
|
|
|
+ }
|
|
|
+ else{
|
|
|
+
|
|
|
+ [_whiteBgView mas_remakeConstraints:^(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);
|
|
|
+ }];
|
|
|
+
|
|
|
+ _extractCodeBgView.hidden = YES;
|
|
|
+
|
|
|
+ [_shareEndDateLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.top.equalTo(_checkShareLinkButton.mas_bottom).offset(15.f);
|
|
|
+ make.left.mas_equalTo(15);
|
|
|
+ make.right.mas_equalTo(-15);
|
|
|
+ make.height.mas_equalTo(15);
|
|
|
+ }];
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
@end
|