123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629 |
- //
- // shareRecordDetailsHWViewController.m
- // 双子星云手机
- //
- // Created by xd h on 2024/5/15.
- //
- #import "shareRecordDetailsHWViewController.h"
- @interface shareRecordDetailsHWViewController ()
- @property (nonatomic,strong)UIScrollView *BgScrollView;
- @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)UIImageView*lineImageView;//分割线
- @property (nonatomic,strong)UILabel *shareEndDateLabel;//失效日期
- @property (nonatomic,strong)UILabel *remainingNumberLabel;//剩余次数
- @property (nonatomic,strong)UILabel *extractCodeTipLab;//提取码
- @property (nonatomic,strong)UILabel *extractCodeTip2Lab;//提取码
- @property (nonatomic,strong)UILabel *reportTipLabel;//被投诉封禁
- @property (nonatomic,strong)UILabel *reportLabel;//被投诉封禁
- @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{
-
- _BgScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, NAVIHEIGHT + AdaptNaviHeight, SCREEN_W, SCREEN_H - NAVIHEIGHT- AdaptNaviHeight)];
- //_BgScrollView.backgroundColor = [UIColor greenColor];
- //_BgScrollView.contentSize = CGSizeMake(SCREEN_W, 0);
- [self.view addSubview:_BgScrollView];
- // [_BgScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
- // make.left.mas_equalTo(0);
- // make.right.mas_equalTo(0);
- // make.top.equalTo(self.navBarBGView.mas_bottom).offset(0.f);
- // make.bottom.mas_equalTo(0);
- // }];
-
- //
- _whiteBgView = [[UIView alloc] init];
- _whiteBgView.backgroundColor = [UIColor whiteColor];
- [_BgScrollView 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.width.mas_equalTo(SCREEN_W - 30);
- //make.top.equalTo(self.navBarBGView.mas_bottom).offset(40.f);
- make.top.mas_equalTo(40);
- make.height.mas_equalTo(558);
- }];
-
- //文件夹图标
- UIImageView *folderImageView = [[UIImageView alloc] init];
- folderImageView.image = [UIImage imageNamed:@"uploadFile_file_icon"];
- folderImageView.backgroundColor = [UIColor whiteColor];
- [_BgScrollView 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.top.mas_equalTo(10.f);
- make.centerX.mas_equalTo(_BgScrollView.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.centerX.mas_equalTo(_whiteBgView.mas_centerX);
- make.width.mas_equalTo(208);
- make.height.mas_equalTo(208);
- }];
-
- _shareQRCodeImageView = [[UIImageView alloc] init];
- //_shareQRCodeImageView.backgroundColor = [UIColor lightGrayColor];
- [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;
- [_whiteBgView 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);
- }];
-
-
- //分割线 347 /32
- CGFloat lineW = SCREEN_W - 30;
- CGFloat lineH = (lineW*32.0)/347.0;
-
- _lineImageView = [[UIImageView alloc] init];
- //_lineImageView.backgroundColor = [UIColor lightGrayColor];
- _lineImageView.image = [UIImage imageNamed:@"nas_share_Divider_img"];
- [_whiteBgView addSubview:_lineImageView];
- [_lineImageView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.equalTo(_checkShareLinkButton.mas_bottom).offset(8);
- make.height.mas_equalTo(lineH);
- make.left.mas_equalTo(0);
- make.right.mas_equalTo(0);
- }];
- //失效时间
- UILabel *shareEndDateTipLab = [[UILabel alloc] init];
- shareEndDateTipLab.font = [UIFont systemFontOfSize:14.f];
- [shareEndDateTipLab setTextColor:[UIColor hwColor:@"#999999"]];
- shareEndDateTipLab.text = NSLocalizedString(@"copy_share_link_Invalid_tip3",nil);
- [_whiteBgView addSubview:shareEndDateTipLab];
-
- [shareEndDateTipLab mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(32);
- make.width.mas_equalTo(80);
- make.top.equalTo(_lineImageView.mas_bottom).offset(8);
- make.height.mas_equalTo(20);
- }];
-
- _shareEndDateLabel = [[UILabel alloc] init];
- //_shareEndDateLabel.text = @"2024/04/25 19:45";
- //_shareEndDateLabel.textAlignment = NSTextAlignmentCenter;
- _shareEndDateLabel.textColor = HW0A132BColor;
- _shareEndDateLabel.font = [UIFont boldSystemFontOfSize:14.0];
- [_whiteBgView addSubview:_shareEndDateLabel];
- //_shareEndDateLabel.backgroundColor = [UIColor greenColor];
-
- [_shareEndDateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(shareEndDateTipLab.mas_right);
- make.right.mas_equalTo(0);
- make.top.mas_equalTo(shareEndDateTipLab.mas_top);
- make.height.mas_equalTo(20);
- }];
-
-
- //剩余次数
- UILabel *remainingNumberTipLabel = [[UILabel alloc] init];
- remainingNumberTipLabel.font = [UIFont systemFontOfSize:14.f];
- [remainingNumberTipLabel setTextColor:[UIColor hwColor:@"#999999"]];
- remainingNumberTipLabel.text = NSLocalizedString(@"share_number_remainingNumber_tip",nil);
- [_whiteBgView addSubview:remainingNumberTipLabel];
-
- [remainingNumberTipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(32);
- make.width.mas_equalTo(80);
- make.top.equalTo(shareEndDateTipLab.mas_bottom).offset(10);
- make.height.mas_equalTo(20);
- }];
-
- _remainingNumberLabel = [[UILabel alloc] init];
- _remainingNumberLabel.font = [UIFont boldSystemFontOfSize:14.f];
- //_remainingNumberLabel.text = @"80";
- [_remainingNumberLabel setTextColor:HW0A132BColor];
- [_whiteBgView addSubview:_remainingNumberLabel];
- [_remainingNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(remainingNumberTipLabel.mas_right);
- make.right.mas_equalTo(-20);
- make.top.equalTo(remainingNumberTipLabel.mas_top);
- make.height.mas_equalTo(20);
- }];
-
- ///获取设备当前地区的代码和APP语言环境
- NSString *languageCode = [NSLocale preferredLanguages][0];
- CGFloat curlaberW = 80.0;
- //目前支持 中文(简体 繁体) 英文 日语
- if([languageCode rangeOfString:@"zh-Hans"].location != NSNotFound)
- {
- }
- else if([languageCode rangeOfString:@"zh-Hant"].location != NSNotFound)
- {
- }
- else{
- curlaberW = 110.0;
- }
-
- //提取码
- _extractCodeTipLab = [[UILabel alloc] init];
- _extractCodeTipLab.font = [UIFont systemFontOfSize:14.f];
- [_extractCodeTipLab setTextColor:[UIColor hwColor:@"#999999"]];
- _extractCodeTipLab.text = NSLocalizedString(@"share_Extract_code_tip",nil);
- [_whiteBgView addSubview:_extractCodeTipLab];
-
- [_extractCodeTipLab mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(32);
- make.width.mas_equalTo(curlaberW);
- make.top.equalTo(remainingNumberTipLabel.mas_bottom).offset(10);
- make.height.mas_equalTo(20);
- }];
-
- _extractCodeTip2Lab = [[UILabel alloc] init];
- _extractCodeTip2Lab.font = [UIFont boldSystemFontOfSize:14.f];
- [_extractCodeTip2Lab setTextColor:HW0A132BColor];
- [_whiteBgView addSubview:_extractCodeTip2Lab];
-
- [_extractCodeTip2Lab mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(_extractCodeTipLab.mas_right);
- make.right.mas_equalTo(-20);
- make.top.equalTo(_extractCodeTipLab.mas_top);
- make.height.mas_equalTo(20);
- }];
-
- //封禁原因
- _reportTipLabel = [[UILabel alloc] init];
- _reportTipLabel.font = [UIFont systemFontOfSize:14.f];
- [_reportTipLabel setTextColor:[UIColor hwColor:@"#999999"]];
- _reportTipLabel.text = NSLocalizedString(@"share_report_tip1",nil);
- [_whiteBgView addSubview:_reportTipLabel];
-
- [_reportTipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(32);
- make.width.mas_equalTo(80);
- make.top.equalTo(_extractCodeTipLab.mas_bottom).offset(10);
- make.height.mas_equalTo(20);
- }];
-
- _reportLabel = [[UILabel alloc] init];
- _reportLabel.font = [UIFont boldSystemFontOfSize:14.f];
- _reportLabel.text = NSLocalizedString(@"share_report_tip2",nil);
- [_reportLabel setTextColor:HW0A132BColor];
- [_whiteBgView addSubview:_reportLabel];
-
- [_reportLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(_reportTipLabel.mas_right);
- make.right.mas_equalTo(-20);
- make.top.equalTo(_reportTipLabel.mas_top);
- make.height.mas_equalTo(20);
- }];
-
- CGFloat shareButW = (SCREEN_W - 20 -20 -15)/2.0;
-
- _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 = 10;
- [_BgScrollView addSubview:_cancelShareLinkButton];
- _cancelShareLinkButton.layer.cornerRadius = 8;
- _cancelShareLinkButton.layer.masksToBounds = YES;
- _cancelShareLinkButton.backgroundColor = [UIColor hwColor:@"#E3E8F1"];
-
- [_cancelShareLinkButton mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(20);
- make.width.mas_equalTo(shareButW);
- make.top.equalTo(_whiteBgView.mas_bottom).offset(25);
- make.height.mas_equalTo(48);
- }];
-
-
- _shareLinkCopyButton = [[UIButton alloc] init];
- CGFloat w_btn = shareButW;//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;
-
- [_BgScrollView addSubview:_shareLinkCopyButton];
- [_shareLinkCopyButton mas_makeConstraints:^(MASConstraintMaker *make) {
- //make.right.mas_equalTo(-20);
- make.left.equalTo(_cancelShareLinkButton.mas_right).offset(15);
- make.width.mas_equalTo(w_btn);
- make.top.equalTo(_cancelShareLinkButton.mas_top).offset(0);
- 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
- {
- NSInteger tag = but.tag;
-
- if(tag == 1){
- NSString *serUrl = shareService;
- NSString *shareUrl = [[NSString alloc] initWithFormat:@"%@%@",serUrl,_dataModel.token];
-
- NSURL *URL = [NSURL URLWithString:shareUrl];
- [[UIApplication sharedApplication] openURL:URL];
- }
- else if(tag == 10){
- [self showCancelAlearViewFun];
- }
- else if(tag == 11){
- [self copyShareLinkFun];
- }
- }
- - (void)viewWillAppear:(BOOL)animated
- {
- [super viewWillAppear:animated];
- [self handleDataFun];
- }
- //- (void)setDataModel:(ShareRecordListModel *)dataModel
- - (void)handleDataFun
- {
- //_dataModel = dataModel;
-
- if(!_dataModel.expirationStatus && !_dataModel.reportStatus){
- _cancelShareLinkButton.hidden = NO;
- _shareLinkCopyButton.hidden = NO;
-
- if(_dataModel.expirationDay== 0)
- {
- NSString *expDateStr = NSLocalizedString(@"share_expiration_date_forever",nil);
- _shareEndDateLabel.text = expDateStr;
- }
- else{
- //失效时间
- _shareEndDateLabel.text = _dataModel.expirationTime;
- }
- }
- else{
- _cancelShareLinkButton.hidden = YES;
- _shareLinkCopyButton.hidden = YES;
-
- //失效时间
- //NSString *tipStr2 = NSLocalizedString(@"copy_share_link_Invalid_tip",nil);
- //_shareEndDateLabel.text = tipStr2;
- //_shareEndDateLabel.textColor = [UIColor hwColor:@"#DD4E4E"];
-
- if(_dataModel.reportStatus){
- _shareEndDateLabel.text = _dataModel.reportTime;
- _checkShareLinkButton.hidden = YES;
- }
- else{
- _shareEndDateLabel.text = _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 = shareService;
- NSString *shareUrl = [[NSString alloc] initWithFormat:@"%@%@",serUrl,_dataModel.token];
- _shareQRCodeImageView.image = [self generateQRCodeWithInputMessage:shareUrl Width:168 Height:168];
-
- _extractCodeTip2Lab.text = _dataModel.extractionCode;
-
- _remainingNumberLabel.text = [[NSString alloc] initWithFormat:@"%ld",_dataModel.remainingNumber];
-
- CGFloat whiteBgViewH = 558;
- if(_dataModel.platformType == 4){
-
- if (_dataModel.reportStatus) {
- _reportTipLabel.hidden = NO;
- _reportLabel.hidden = NO;
- }
- else{
- _reportTipLabel.hidden = YES;
- _reportLabel.hidden = YES;
- whiteBgViewH -= 30;
- }
-
-
-
- [_whiteBgView mas_remakeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(15);
- //make.right.mas_equalTo(-15);
- make.width.mas_equalTo(SCREEN_W - 30);
- //make.top.equalTo(self.navBarBGView.mas_bottom).offset(40.f);
- make.top.mas_equalTo(40);
- make.height.mas_equalTo(whiteBgViewH);
- }];
-
-
- }
- else{
-
- _extractCodeTipLab.hidden = YES;
- _extractCodeTip2Lab.hidden = YES;
- whiteBgViewH -= 30;
-
- if (_dataModel.reportStatus) {
- _reportTipLabel.hidden = NO;
- _reportLabel.hidden = NO;
-
- [_reportTipLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(32);
- make.width.mas_equalTo(80);
- make.top.equalTo(_remainingNumberLabel.mas_bottom).offset(10);
- make.height.mas_equalTo(20);
- }];
-
- [_reportLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(_reportTipLabel.mas_right);
- make.right.mas_equalTo(-20);
- make.top.equalTo(_reportTipLabel.mas_top);
- make.height.mas_equalTo(20);
- }];
-
- }
- else{
- _reportTipLabel.hidden = YES;
- _reportLabel.hidden = YES;
- whiteBgViewH -= 30;
- }
- [_whiteBgView mas_remakeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(15);
- //make.right.mas_equalTo(-15);
- make.width.mas_equalTo(SCREEN_W - 30);
- //make.top.equalTo(self.navBarBGView.mas_bottom).offset(40.f);
- make.top.mas_equalTo(40);
- make.height.mas_equalTo(whiteBgViewH);
- }];
-
-
- }
-
- _BgScrollView.contentSize = CGSizeMake(SCREEN_W, 40 + whiteBgViewH + 75);
- }
- #pragma mark 取消分享
- - (void)showCancelAlearViewFun
- {
- NSString *tipStr = NSLocalizedString(@"cancel_share_Tip_msg",nil);
- KWeakSelf
- ComontAlretViewController *curAlretVC= [[ComontAlretViewController alloc] initWithTiTle:nil
- msg:tipStr
- imageStr:nil
- cancelTitle:NSLocalizedString(@"other_cancel",nil)
- okTitle:NSLocalizedString(@"other_confirm",nil) isOkBtnHighlight:YES
- didClickOk:^{
-
- [weakSelf cancelShareLinkFun];
- } didClickCancel:^{
-
- }];
-
- curAlretVC.modalPresentationStyle = UIModalPresentationCustom;
-
- [self presentViewController:curAlretVC animated:YES completion:^{
- curAlretVC.view.superview.backgroundColor = [UIColor clearColor];
- }];
- }
- - (void)cancelShareLinkFun
- {
- NSMutableDictionary *paraDict = [NSMutableDictionary new];
- if(_dataModel.addShareId){
- //[paraDict setValue:_dataModel.addShareId forKey:@"id"];
- [paraDict setValue:@[_dataModel.addShareId] forKey:@"idList"];
- }
- [paraDict setValue:@1 forKey:@"expirationStatus"];
-
- KWeakSelf
- [self showNewIndicatorWithCanBack:NO canTouch:NO];
- [[netWorkManager shareInstance] CommonPostCallBackCode:updateShareInfoFun Parameters:paraDict success:^(id _Nonnull responseObject) {
- [weakSelf removeNewIndicator];
- SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
- if(model && model.code == 0){
- [[iToast makeText:NSLocalizedString(@"cancel_share_suc_msg",nil)] show];
- [weakSelf getShareOneFileListFun];
- }
- else{
- [[iToast makeText:NSLocalizedString(@"cancel_share_fail_msg",nil)] show];
- }
-
- } failure:^(NSError * _Nonnull error) {
- [weakSelf removeNewIndicator];
- [[iToast makeText:NSLocalizedString(@"cancel_share_fail_msg",nil)] show];
- }];
- }
- #pragma mark 取消分享信息重新获取
- - (void)getShareOneFileListFun
- {
- _dataModel.expirationStatus = 1;
- [self handleDataFun];
-
- if(_didCancelShareLinkFun){
- _didCancelShareLinkFun();
- }
- }
- - (void)copyShareLinkFun
- {
- if(_dataModel.fileListVOS.count <=0 ){
- return;
- }
-
- ShareFileDataModel *dataModel = _dataModel.fileListVOS.firstObject;
-
- NSString *copyStr1 = [[NSString alloc] initWithFormat:@"%@%@%@%ld%@",NSLocalizedString(@"share_secret_titile_1_1",nil),dataModel.fileName,NSLocalizedString(@"share_file_more_tip",nil), _dataModel.fileListVOS.count,NSLocalizedString(@"share_file_Numbers_tip",nil)];
-
- if(_dataModel.fileListVOS.count == 1){
- copyStr1 = [[NSString alloc] initWithFormat:@"%@%@",NSLocalizedString(@"share_secret_titile_1",nil),dataModel.fileName];
- }
-
- if(_dataModel.platformType == 4) {
- copyStr1 = [[NSString alloc] initWithFormat:@"%@%@",NSLocalizedString(@"share_secret_titile_1",nil),copyStr1];
- }
-
- NSString *serUrl = shareService;
- NSString *shareUrl = [[NSString alloc] initWithFormat:@"%@%@",serUrl,_dataModel.token];
- NSString *copyStr2 = [[NSString alloc] initWithFormat:@"%@%@",NSLocalizedString(@"share_secret_titile_2",nil),shareUrl];
-
- NSString *copyStr3 = [[NSString alloc] initWithFormat:@"%@%@",NSLocalizedString(@"share_secret_titile_3",nil),_dataModel.extractionCode];
- NSString *copyStr4 = NSLocalizedString(@"share_secret_titile_4",nil);
-
- NSString *copyTotalStr = [[NSString alloc] initWithFormat:@"%@\n%@\n%@\n%@",copyStr1,copyStr2,copyStr3,copyStr4];
- if(_dataModel.platformType != 4) {
- copyTotalStr = [[NSString alloc] initWithFormat:@"%@\n%@\n%@",copyStr1,copyStr2,copyStr4];
- }
-
- UIPasteboard* pasteboard = [UIPasteboard generalPasteboard];
- pasteboard.string = copyTotalStr;
-
- [[iToast makeText:NSLocalizedString(@"copy_share_link_suc_tip",nil)] show];
- }
- @end
|