// // YZMAShareGoodsViewController.m // YouHuiProject // // Created by jcymac on 2018/5/18. // Copyright © 2018年 kuxuan. All rights reserved. // #import "YZMAShareGoodsViewController.h" #import "YZMAShareGoodsTop.h" #import "YZMAShareGoodsView.h" #import "shareView.h" #import "HYUMShareManager.h" #import "YZMALinkFansController.h" #import "YZMAPrivilegeReferralViewController.h" @interface YZMAShareGoodsViewController () @property(nonatomic,strong)UIScrollView *scrollView; @property(nonatomic,strong)UIView *topView; @property(nonatomic,strong)YZMAShareGoodsView *shareGoodsView; @property(nonatomic,strong)UIImageView *imageView; @property(nonatomic,strong)UIView *centerGrayView; @property(nonatomic,strong)UITextView *textView; @property(nonatomic,strong)UIImageView *imaginaryLineView; @property(nonatomic,strong)UILabel *moneyLabel; @property(nonatomic,strong)UILabel *infoLabel; @property(nonatomic,strong)UIButton *copyButton; @property(nonatomic,strong)UIButton *shareUrlButton; @property(nonatomic,strong)UIButton *shareImageButton; @property(nonatomic,strong)UIView *backShareView; @property(nonatomic,strong)shareView *shareView; @property(nonatomic,copy )NSNumber *flag; @property(nonatomic,copy )NSNumber *isSuper; @property(nonatomic )BOOL canShareImg; @end @implementation YZMAShareGoodsViewController - (void)viewDidLoad { [super viewDidLoad]; self.canShareImg=NO; [self configNavigationBar]; [self initHUD]; [self loadSubViewsConfiguration]; [self request]; [self adjustUI]; [SVProgressHUD show]; [SVProgressHUD dismissWithDelay:2.0f]; } -(void)viewDidAppear:(BOOL)animated{ [super viewDidAppear:animated]; } - (void)configNavigationBar { self.view.backgroundColor = [UIColor whiteColor]; [self.navigationBar setNavTitle:@"分享商品"]; self.navigationBar.showNavigationBarBottomLine = YES; UIButton *leftBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 40)]; [leftBtn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal]; [leftBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside]; [self.navigationBar setCustomLeftButtons:@[leftBtn]]; [self.navigationBar setShowNavigationBarBottomLine:YES]; } - (void)initHUD { [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom]; [SVProgressHUD setForegroundColor:[UIColor YHColorWithHex:0xff2420]]; [SVProgressHUD setBackgroundColor:[UIColor YHColorWithHex:0xf5f4f4]]; } -(void)request{ self.flag=@(-1); self.isSuper=@(-1); NSString *url=[NSString stringWithFormat:@"%@/api/v2/adzoneCreate/shareCommonGoodsNew",BaseURL]; NSString *coupon_start_time = [self.goodModel.is_coupon boolValue] ? self.goodModel.start_time : @""; NSString *coupon_end_time = [self.goodModel.is_coupon boolValue] ? self.goodModel.end_time : @""; if (!coupon_start_time) coupon_start_time = @""; if (!coupon_end_time) coupon_end_time = @""; NSDictionary *dic=@{ @"goods_id":self.goodModel.goods_id, @"is_coupon":self.goodModel.is_coupon, @"coupon_price":self.goodModel.coupon_price, @"price":self.goodModel.price, @"discount_price":self.goodModel.discount_price, @"commission_rate":self.goodModel.commission_rate, @"coupon_end_time":coupon_end_time, @"coupon_start_time":coupon_start_time }; [YZMAHttp post:url params:dic success:^(id json) { // YZMAShareGoodsViewController *vc=[[YZMAShareGoodsViewController alloc]init]; YZMAShareGoodsTempModel *tmpModel=[YZMAShareGoodsTempModel yy_modelWithJSON:json[@"data"]]; YZMAShareGoodsModel *model=[YZMAShareGoodsModel createShareGoodsModelByShareGoodsTempModel:tmpModel]; model.commissionPrice=self.goodModel.commission_price;//佣金价格 model.commission_rate=self.goodModel.commission_rate; model.discount_price=self.goodModel.discount_price; self.model=model; //第二次加载使用 self.imageView.image=[self.shareGoodsView changeToImage]; kWeak(self) self.shareGoodsView.imgSuccBlock = ^{ //第一次加载使用 NSLog(@"图片加载完成"); selfWeak.imageView.image=[selfWeak.shareGoodsView changeToImage]; selfWeak.canShareImg=YES; NSLog(@"图片加载完成2"); }; self.textView.text=self.model.title; self.moneyLabel.text=[NSString stringWithFormat:@"【原价】%@元 \n【券后】%@元",self.model.originalPrice,self.model.ticketAfterPrice]; self.infoLabel.text=[NSString stringWithFormat:@"复制这条信息%@\n打开【手机淘宝】即可查看",self.model.infoStr]; NSString *url=[NSString stringWithFormat:@"%@/api/v2/adzoneCreate/shareTheTextNew",BaseURL]; NSDictionary *dic=@{@"commission_rate":self.model.commission_rate, @"discount_price":self.model.discount_price }; [YZMAHttp post:url params:dic success:^(id json) { if (json[@"data"]) { [SVProgressHUD dismiss]; NSString *text=json[@"data"][@"text"]; NSNumber *flag=json[@"data"][@"flag"]; NSNumber *isSuper=json[@"data"][@"isSuper"]; UILabel *label=(UILabel *)[self.topView viewWithTag:10001]; label.frame=CGRectMake(FITSIZE(15), 10, SCREEN_WIDTH-FITSIZE((70)), 0); label.text=text; [label sizeToFit]; [UIView animateWithDuration:0.5f animations:^{ self.scrollView.frame=CGRectMake(0,NavBarHeight+label.height, SCREEN_WIDTH, SCREEN_HEIGHT-NavBarHeight-label.height); }]; self.flag=flag; self.isSuper=isSuper; [self.topView mas_updateConstraints:^(MASConstraintMaker *make) { make.left.right.mas_equalTo(0); make.top.mas_equalTo(NavBarHeight); make.height.mas_equalTo((label.height+20)); }]; UIView *rightBtn=[self.topView viewWithTag:10002]; [rightBtn mas_updateConstraints:^(MASConstraintMaker *make) { make.right.mas_equalTo(0); make.height.mas_equalTo(self.topView.mas_height); make.top.mas_equalTo(0); make.width.mas_equalTo(FITSIZE(70)); }]; self.topView.hidden=NO; } } failure:^(NSError *error) { self.flag=0; }]; } failure:^(NSError *error) { }]; } -(void)loadSubViewsConfiguration{ [self.view addSubview:self.scrollView]; [self.scrollView addSubview:self.imageView]; [self.scrollView addSubview:self.centerGrayView]; [self.scrollView addSubview:self.textView]; [self.scrollView addSubview:self.imaginaryLineView]; [self.scrollView addSubview:self.moneyLabel]; [self.scrollView addSubview:self.infoLabel]; [self.scrollView addSubview:self.copyButton]; self.copyButton.hidden=YES; //view顶层 [self.view addSubview:self.topView]; [self.view addSubview:self.shareImageButton]; [self.view addSubview:self.shareUrlButton]; [[UIApplication sharedApplication].keyWindow addSubview:self.backShareView]; [[UIApplication sharedApplication].keyWindow addSubview:self.shareView]; } -(void)adjustUI{ UILabel *topLabel=[self.topView viewWithTag:10001]; [self.topView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.mas_equalTo(0); make.top.mas_equalTo(NavBarHeight); make.height.mas_equalTo((topLabel.height+20)); }]; [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo((topLabel.height+30+20)); make.left.mas_equalTo(54); make.width.mas_equalTo(SCREEN_WIDTH-2*FITSIZE(54)); make.height.mas_equalTo(474); }]; [self.centerGrayView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(0); make.width.mas_equalTo(SCREEN_WIDTH); make.top.equalTo(self.imageView.mas_bottom).offset(20); make.height.mas_equalTo(5); }]; [self.textView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(FITSIZE(17)); make.width.mas_equalTo(SCREEN_WIDTH-FITSIZE((17*2))); make.top.equalTo(self.centerGrayView.mas_bottom).offset(5); make.height.mas_equalTo(53); }]; [self.imaginaryLineView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(FITSIZE(17)); make.width.mas_equalTo(SCREEN_WIDTH-FITSIZE(17*2)); make.top.equalTo(self.textView.mas_bottom).offset(7); make.height.mas_equalTo(5); }]; [self.moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.imaginaryLineView.mas_left).offset(-FITSIZE(7)); make.top.equalTo(self.imaginaryLineView.mas_bottom).offset(8); }]; [self.infoLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.imaginaryLineView.mas_left); make.top.equalTo(self.moneyLabel.mas_bottom).offset(10); }]; [self.copyButton mas_makeConstraints:^(MASConstraintMaker *make) { make.right.equalTo(self.imaginaryLineView.mas_right).offset(FITSIZE(-10)); make.top.equalTo(self.imaginaryLineView.mas_bottom).offset(28); make.width.mas_equalTo(FITSIZE(92)); make.height.mas_equalTo(24); }]; } - (void)backAction { [self.navigationController popViewControllerAnimated:YES]; } -(void)ShareImg{ if (self.canShareImg) { self.backShareView.hidden=NO; [self.shareView shareImage:[self.shareGoodsView changeToImage]]; //分享图片 [UIView animateWithDuration:0.2f animations:^{ self.shareView.frame=CGRectMake(0, SCREEN_HEIGHT-200-SafeBottomHeight, SCREEN_WIDTH, 200+SafeBottomHeight); }]; }else{ [MBProgressHUD showMessage:@"图片还在加载中,请稍后重试"]; } } -(void)copyCode{ UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; pasteboard.string =[NSString stringWithFormat:@"%@\n--------\n【在售价】%@元\n【券后价】%@元\n--------\n复制这条信息¥%@¥\n打开【手机淘宝】即可查看",self.model.title,self.model.originalPrice,self.model.ticketAfterPrice,self.model.infoStr]; [SVProgressHUD showSuccessWithStatus:@"复制成功"]; } #pragma mark 代理 UITextViewDelegate - (BOOL)textViewShouldBeginEditing:(UITextView *)textView{ return YES; } #pragma mark -点击方法 -(void)shareAction:(UIButton *)sender{ switch (sender.tag) { case 50001://分享链接 { // [self.shareView shareWeChatTitle:self.model.title desc:@"领完券再购物,不光省钱还能赚钱" imageUrl:self.model.mainImageUrl webUrl:self.model.QRcodeImageUrl]; // //分享链接 // [UIView animateWithDuration:0.2f animations:^{ // self.shareView.frame=CGRectMake(0, SCREEN_HEIGHT-200-SafeBottomHeight, SCREEN_WIDTH, 200+SafeBottomHeight); // }]; } break; case 50002: { if (!([self.flag integerValue]==0)) { if ([self.flag integerValue]==1 &&[self.isSuper integerValue]==0) { //会员 UILabel *label=(UILabel *)[self.topView viewWithTag:10001]; UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"分享赚佣金" message:[NSString stringWithFormat:@"\n%@",label.text] preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"去升级" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { YZMAPrivilegeReferralViewController *vc=[[YZMAPrivilegeReferralViewController alloc]init]; [self.navigationController pushViewController:vc animated:YES]; }]; UIAlertAction* cancelAction = [UIAlertAction actionWithTitle:@"知道了" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { [self ShareImg]; }]; [alert addAction:cancelAction]; [alert addAction:defaultAction]; [self presentViewController:alert animated:YES completion:nil]; }else{ [self ShareImg]; } }else{ UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"温馨提示" message:@"\n您还没有绑定邀请码哟" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"前往绑定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { YZMALinkFansController *linkFans = [[YZMALinkFansController alloc] init]; linkFans.linkFansBlock = ^{ [self request]; }; [self.navigationController pushViewController:linkFans animated:YES]; }]; UIAlertAction* cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { }]; [alert addAction:defaultAction]; [alert addAction:cancelAction]; [self presentViewController:alert animated:YES completion:nil]; } } break; default: break; } } -(void)doTapChange{ self.backShareView.hidden=YES; [UIView animateWithDuration:0.2f animations:^{ self.shareView.frame=CGRectMake(0, SCREEN_HEIGHT, SCREEN_WIDTH, 200+SafeBottomHeight); } completion:^(BOOL finished) { }]; } -(void)copyAction{ if ([self.flag integerValue]==-1) { [MBProgressHUD showMessage:@"努力生成邀请码中,请稍后尝试"]; return; } if (!([self.flag integerValue]==0)) { if ([self.flag integerValue]==1 &&[self.isSuper integerValue]==0) { //会员 UILabel *label=(UILabel *)[self.topView viewWithTag:10001]; UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"分享赚佣金" message:[NSString stringWithFormat:@"\n%@",label.text] preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"去升级" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { YZMAPrivilegeReferralViewController *vc=[[YZMAPrivilegeReferralViewController alloc]init]; [self.navigationController pushViewController:vc animated:YES]; }]; UIAlertAction* cancelAction = [UIAlertAction actionWithTitle:@"知道了" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { [self copyCode]; }]; [alert addAction:cancelAction]; [alert addAction:defaultAction]; [self presentViewController:alert animated:YES completion:nil]; }else{ [self copyCode]; } }else{ UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"温馨提示" message:@"\n您还没有绑定邀请码" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"前往绑定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { YZMALinkFansController *linkFans = [[YZMALinkFansController alloc] init]; linkFans.linkFansBlock = ^{ [self request]; }; [self.navigationController pushViewController:linkFans animated:YES]; }]; UIAlertAction* cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { }]; [alert addAction:defaultAction]; [alert addAction:cancelAction]; [self presentViewController:alert animated:YES completion:nil]; } } -(void)rightAction:(id )sender{ YZMAPrivilegeReferralViewController *vc=[[YZMAPrivilegeReferralViewController alloc]init]; vc.flag=self.flag; vc.isSuper=self.isSuper; [self.navigationController pushViewController:vc animated:YES]; } #pragma mark 懒加载 -(YZMAShareGoodsView *)shareGoodsView{ if (!_shareGoodsView) { _shareGoodsView=[[YZMAShareGoodsView alloc]initWithFrame:CGRectMake(0, 0, 375, 667)]; kWeak(self) _shareGoodsView.imgSuccBlock = ^{ //第一次加载使用 NSLog(@"图片加载完成"); selfWeak.imageView.image=[selfWeak.shareGoodsView changeToImage]; selfWeak.canShareImg=YES; NSLog(@"图片加载完成2"); }; _shareGoodsView.model=self.model; } return _shareGoodsView; } -(UIImageView *)imageView{ if (!_imageView) { _imageView=[[UIImageView alloc]init]; _imageView.backgroundColor=[UIColor whiteColor]; _imageView.layer.shadowColor = [UIColor YHColorWithHex:0xF16767].CGColor;//shadowColor阴影颜色 _imageView.layer.shadowOpacity = 0.2;//阴影透明度,默认0 _imageView.layer.shadowRadius = 10;//阴影半径,默认3 } return _imageView; } -(UIView *)topView{ if (!_topView) { _topView=[[UIView alloc]init]; _topView.hidden=YES; _topView.backgroundColor=[UIColor YHColorWithHex:0xFF502E];//[UIColor YHColorWithHex:0xF2F2F2]; UILabel *leftLabel=[[UILabel alloc]initWithFrame:CGRectMake(FITSIZE(15), 10, SCREEN_WIDTH-FITSIZE((70)), 0)]; leftLabel.numberOfLines=0; leftLabel.tag=10001; leftLabel.font=[UIFont systemFontOfSize:14.0f]; leftLabel.textColor=[UIColor whiteColor]; leftLabel.text=@""; [leftLabel sizeToFit]; UIButton *rightBtn=[[UIButton alloc]initWithFrame:CGRectMake(SCREEN_WIDTH-FITSIZE(70), leftLabel.y, FITSIZE(70), leftLabel.height)]; rightBtn.tag=10002; [rightBtn setTitle:@"规则 " forState:UIControlStateNormal]; UIImage *image=[UIImage imageNamed:@"share_right_regulation"]; [rightBtn setImage:image forState:UIControlStateNormal]; rightBtn.titleLabel.font=[UIFont systemFontOfSize:13.0f]; [rightBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, -image.size.width, 0, image.size.width)]; [rightBtn setImageEdgeInsets:UIEdgeInsetsMake(0, 0, 0, -FITSIZE(60))]; [rightBtn addTarget:self action:@selector(rightAction:) forControlEvents:UIControlEventTouchUpInside]; [rightBtn setTitleColor:[UIColor whiteColor]forState:UIControlStateNormal]; UITapGestureRecognizer *singleTapGesture = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(rightAction:)]; singleTapGesture.numberOfTapsRequired =1; singleTapGesture.numberOfTouchesRequired =1; [_topView addGestureRecognizer:singleTapGesture]; [_topView addSubview:leftLabel]; [_topView addSubview:rightBtn]; } return _topView; } -(UIScrollView *)scrollView{ if (!_scrollView) { _scrollView=[[UIScrollView alloc]initWithFrame:CGRectMake(0,NavBarHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavBarHeight)]; _scrollView.showsVerticalScrollIndicator = NO; _scrollView.showsHorizontalScrollIndicator = NO; _scrollView.contentSize=CGSizeMake(SCREEN_WIDTH, 851-NavBarHeight); } return _scrollView; } -(UIView *)centerGrayView{ if (!_centerGrayView) { _centerGrayView=[[UIView alloc]init]; _centerGrayView.backgroundColor=[[UIColor YHColorWithHex:0x999999] colorWithAlphaComponent:0.2f]; } return _centerGrayView; } -(UITextView *)textView{ if (!_textView) { _textView=[[UITextView alloc]init]; _textView.font=[UIFont systemFontOfSize:16.0f]; // _textView.text=self.model.title; _textView.text=@""; _textView.textColor=[UIColor YHColorWithHex:0x444444]; // _textView.layer.borderWidth=1; // _textView.layer.borderColor=[UIColor lightGrayColor].CGColor; // _textView.layer.cornerRadius = 3; // _textView.layer.masksToBounds=YES; _textView.delegate=self; } return _textView; } -(UIImageView *)imaginaryLineView{ if (!_imaginaryLineView) { _imaginaryLineView=[[UIImageView alloc]init]; [_imaginaryLineView setImage:[UIImage imageNamed:@"share_imaginary_line"]]; } return _imaginaryLineView; } -(UILabel *)moneyLabel{ if (!_moneyLabel) { _moneyLabel=[[UILabel alloc]init]; // _moneyLabel.text=[NSString stringWithFormat:@"【原价】%@元 \n【券后】%@元",self.model.originalPrice,self.model.ticketAfterPrice]; _moneyLabel.text=[NSString stringWithFormat:@"【原价】--元 \n【券后】--元"]; _moneyLabel.textColor=[UIColor YHColorWithHex:0x777777]; _moneyLabel.font=[UIFont systemFontOfSize:14.0f]; _moneyLabel.numberOfLines=2; [_moneyLabel sizeToFit]; } return _moneyLabel; } -(UILabel *)infoLabel{ if (!_infoLabel) { _infoLabel=[[UILabel alloc]init]; // _infoLabel.text=[NSString stringWithFormat:@"复制这条信息¥-------\n打开【手机淘宝】即可查看",self.model.infoStr]; _infoLabel.text=[NSString stringWithFormat:@"复制这条信息¥-------\n打开【手机淘宝】即可查看"]; _infoLabel.textColor=[UIColor YHColorWithHex:0x878787]; _infoLabel.font=[UIFont systemFontOfSize:14.0f]; _infoLabel.numberOfLines=2; [_infoLabel sizeToFit]; } return _infoLabel; } -(UIButton *)copyButton{ if (!_copyButton) { _copyButton=[[UIButton alloc]init]; [_copyButton setTitle:@"复制淘口令" forState:UIControlStateNormal]; _copyButton.titleLabel.font=[UIFont systemFontOfSize:14]; _copyButton.titleLabel.textAlignment=NSTextAlignmentCenter; _copyButton.layer.borderWidth=1; _copyButton.layer.cornerRadius=12; _copyButton.layer.masksToBounds=YES; _copyButton.layer.borderColor=[UIColor YHColorWithHex:0xFFDB00].CGColor; [_copyButton addTarget:self action:@selector(copyAction) forControlEvents:UIControlEventTouchUpInside]; [_copyButton setTitleColor:[UIColor YHColorWithHex:0xED5B5B] forState:UIControlStateNormal]; } return _copyButton; } -(UIButton *)shareUrlButton{ if (!_shareUrlButton) { _shareUrlButton=[UIButton buttonWithType:UIButtonTypeCustom]; _shareUrlButton.tag=50001; _shareUrlButton.frame=CGRectMake(0, SCREEN_HEIGHT-50-SafeTopHeight, SCREEN_WIDTH/2, 50+SafeTopHeight); CAGradientLayer *layer = [CAGradientLayer layer]; layer.startPoint = CGPointMake(0, 0);//(0,0)表示从左上角开始变化。默认值是(0.5,0.0)表示从x轴为中间,y为顶端的开始变化 layer.endPoint = CGPointMake(1, 1);//(1,1)表示到右下角变化结束。默认值是(0.5,1.0) 表示从x轴为中间,y为低端的结束变化 layer.colors = [NSArray arrayWithObjects:(id)[UIColor YHColorWithHex:0xFEC800].CGColor,(id)[UIColor YHColorWithHex:0xFD9D03].CGColor, nil]; layer.locations = @[@0.0f,@1.0f];//渐变颜色的区间分布,locations的数组长度和color一致,这个值一般不用管它,默认是nil,会平均分布 layer.frame = _shareUrlButton.layer.bounds; [_shareUrlButton setTitle:@"复制淘口令" forState:UIControlStateNormal]; _shareUrlButton.titleLabel.font=[UIFont systemFontOfSize:14.0f]; [_shareUrlButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [_shareUrlButton addTarget:self action:@selector(copyAction) forControlEvents:UIControlEventTouchUpInside]; [_shareUrlButton.layer insertSublayer:layer atIndex:0]; } return _shareUrlButton; } -(UIButton *)shareImageButton{ if (!_shareImageButton) { _shareImageButton=[UIButton buttonWithType:UIButtonTypeCustom]; _shareImageButton.tag=50002; _shareImageButton.frame=CGRectMake(SCREEN_WIDTH/2, SCREEN_HEIGHT-50-SafeTopHeight, SCREEN_WIDTH/2, 50+SafeTopHeight); CAGradientLayer *layer = [CAGradientLayer layer]; layer.startPoint = CGPointMake(0, 0);//(0,0)表示从左上角开始变化。默认值是(0.5,0.0)表示从x轴为中间,y为顶端的开始变化 layer.endPoint = CGPointMake(1, 1);//(1,1)表示到右下角变化结束。默认值是(0.5,1.0) 表示从x轴为中间,y为低端的结束变化 layer.colors = [NSArray arrayWithObjects:(id)[UIColor YHColorWithHex:0xFE6735].CGColor,(id)[UIColor YHColorWithHex:0xFF2D23].CGColor, nil]; layer.locations = @[@0.0f,@1.0f];//渐变颜色的区间分布,locations的数组长度和color一致,这个值一般不用管它,默认是nil,会平均分布 layer.frame = _shareImageButton.layer.bounds; [_shareImageButton setTitle:@"分享图片" forState:UIControlStateNormal]; _shareImageButton.titleLabel.font=[UIFont systemFontOfSize:14.0f]; [_shareImageButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [_shareImageButton addTarget:self action:@selector(shareAction:) forControlEvents:UIControlEventTouchUpInside]; [_shareImageButton.layer insertSublayer:layer atIndex:0]; } return _shareImageButton; } -(UIView *)shareView{ if (!_shareView) { _shareView=[[[NSBundle mainBundle] loadNibNamed:@"shareView" owner:self options:nil] lastObject]; _shareView.frame=CGRectMake(0, SCREEN_HEIGHT, SCREEN_WIDTH,SCREEN_HEIGHT); [_shareView.cancelButton addTarget:self action:@selector(doTapChange) forControlEvents:UIControlEventTouchUpInside]; WeakSelf(weakSelf) _shareView.shareButtonTwoBlock=^(void){ __strong typeof(self) strongSelf=weakSelf; [strongSelf doTapChange]; }; _shareView.shareButtonOneBlock=^(void){ __strong typeof(self) strongSelf=weakSelf; [strongSelf doTapChange]; }; } return _shareView; } -(UIView *)backShareView{ if (!_backShareView) { _backShareView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; _backShareView.backgroundColor=[[UIColor blackColor] colorWithAlphaComponent:0.3f]; _backShareView.hidden=YES; UITapGestureRecognizer *r5 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(doTapChange)]; r5.numberOfTapsRequired = 1; [_backShareView addGestureRecognizer:r5]; } return _backShareView; } -(void)anE1DL:(UIButton*) anE1DL aOlXcJ:(UIUserInterfaceIdiom*) aOlXcJ aBiXYI1ZF0:(UIKeyCommand*) aBiXYI1ZF0 aODZe0zVPM:(UICollectionView*) aODZe0zVPM afZzR:(UIUserInterfaceIdiom*) afZzR aofi49:(UISearchBar*) aofi49 aWruCseG:(UISwitch*) aWruCseG aLuWZnsaj:(UISearchBar*) aLuWZnsaj aXtWa:(UITableView*) aXtWa aCwOp:(UIMotionEffect*) aCwOp aX1sdRr7:(UIScreen*) aX1sdRr7 aDuEMy:(UIActivity*) aDuEMy aw7SGoUi:(UIRegion*) aw7SGoUi aqVkE1:(UIBarButtonItem*) aqVkE1 aLac9VN4jp:(UIActivity*) aLac9VN4jp a3zB0aekwA:(UIFontWeight*) a3zB0aekwA a3KA2Zj:(UIUserInterfaceIdiom*) a3KA2Zj ajPXYb:(UILabel*) ajPXYb aCD3uW:(UIWindow*) aCD3uW ad1BR8:(UIBezierPath*) ad1BR8 { NSLog(@"W0ZkRmaQPKAUNTcbuyxr6n8X5Yhedfiz24olM"); NSLog(@"7ZvYpBVEdnejGRK4tgykF3IX2Ll9QJWO6"); NSLog(@"f7bM9XBCshrqKgZ28xuikSTeElDjvo"); NSLog(@"HeYIN9cyZC3si0mpJnbOlqGkahXDx"); NSLog(@"7evzDoGKa41BMY"); NSLog(@"3Wmuc87ieUPo40raBZRfwTq9Xn"); NSLog(@"KwRkQLviXH5"); NSLog(@"pBDoYVhIQFyXM8ig1b"); NSLog(@"E0zSb2YeUVn8"); NSLog(@"fzpeJFVw8InsKg0OTl1dUvDQr27qMa3uWS"); NSLog(@"eoaUQDJ1ZFGz0"); NSLog(@"YSChNqVQjGoUduikync95ZD1"); NSLog(@"eEVGb1Tn0YPQfAx9FRh5gI6CWMmtjwaJ8d"); NSLog(@"VgqAdnjW7Z69Fpm"); NSLog(@"abrIF41BpyP2t89jLzqU6nRZdWolefODKshY3M"); NSLog(@"aGglnZ1jY0KcXPBf4hoRt72Wqu5"); NSLog(@"d7btImqBP6R5"); NSLog(@"dY6vbOBa9W"); NSLog(@"FfHLmRdjISBpYADek2CghWU7u0bnoKy35"); NSLog(@"yg2mAID5uwNC6kQ7MtvZjqHzn0cxiL3RTKUE"); } -(void)aVISoT62b7:(UIActivity*) aVISoT62b7 avyZEV:(UIFontWeight*) avyZEV a1bLKcM:(UISwitch*) a1bLKcM arA1u:(UIScreen*) arA1u alZIfKVv7C:(UIRegion*) alZIfKVv7C aAspaDMbjOf:(UIWindow*) aAspaDMbjOf awxSHslq:(UIControl*) awxSHslq aCiP1MlKL:(UIFont*) aCiP1MlKL afRdnv9x:(UIInputView*) afRdnv9x asXWLNMq:(UIWindow*) asXWLNMq { NSLog(@"9PexnmZYK0lzdOa4ThrtWk5D6XHg"); NSLog(@"JqcVkUSKm8wZzyprL04Nd1tus3nXbf"); NSLog(@"ZmC0vcHo4MD2"); NSLog(@"TG2NK8cxPzg69iFlbOwL"); NSLog(@"dQtXsUSukpvZArqo9Bm"); NSLog(@"IoJAYgM6ifUXbqFzpDaTBKRSy3kj"); NSLog(@"5bFYUP4yTpL3N"); NSLog(@"6wJx053oHVuFYSP"); NSLog(@"xuFT6tG2SKv70ANWfpOjMedwgBHLQhkPyD5Ibs"); NSLog(@"FdHYJZx8obPtE7UVi"); NSLog(@"XjaOxUVRDHgoKhME"); } -(void)aKMCeWz2hdU:(UIEdgeInsets*) aKMCeWz2hdU aKt97b:(UIActivity*) aKt97b aUwmgat:(UIViewController*) aUwmgat a14gRAVhXLd:(UIScreen*) a14gRAVhXLd aXIufh4e:(UITableView*) aXIufh4e anzOqeP8:(UIColor*) anzOqeP8 aJQer9AaV:(UIViewController*) aJQer9AaV aZyeCi5hoa:(UITableView*) aZyeCi5hoa aoqK5dS1MPt:(UIScreen*) aoqK5dS1MPt aaZh8w:(UIControl*) aaZh8w aQW5ftI:(UISearchBar*) aQW5ftI a6xipFhA2r5:(UIScreen*) a6xipFhA2r5 aJN3DrWzMQ:(UIDevice*) aJN3DrWzMQ aWUspD8R:(UIEdgeInsets*) aWUspD8R aCip2:(UIBarButtonItem*) aCip2 aMeazpxW8:(UIFont*) aMeazpxW8 aaIRBnDV54k:(UIFont*) aaIRBnDV54k { NSLog(@"M3a7RQe5ObqEx"); NSLog(@"3tzVBpT49ek2ym"); NSLog(@"DPoLa7KJQn28"); NSLog(@"vhVO90DiWkqL64AoJa2MKZ1pgGUHl"); NSLog(@"6Ok1R7UZDIdaqJyQPb8sElzi4cAGhVFNtfLvX"); NSLog(@"yKbMLvmS3UhVxW0416owYqckJzEtBnuHa9i"); NSLog(@"T8CvNUO4wdP1gAWIeniaY29KhjlVm3JHc"); NSLog(@"tk3cawJXMzTsIU4QB5guZd72h1Lj"); NSLog(@"WRw7qnketr9LGbB8NMcmXavJA"); NSLog(@"OASK0qCbZD2sPjVdzpeQYXlUvWuGMmfkFyxJt"); NSLog(@"awsnzAVZPTejCmp6R9SIB2tbx"); NSLog(@"sQPC25e8tYLRSMnVrxw6EpAjv"); NSLog(@"Gs26YOFJP3myjanoEiwBvkVzIWZ"); NSLog(@"OrKUpMWw8k9cfZvsqAEeoLduD1tjIl3hGN046"); NSLog(@"jglrkT1YFvu4myWi0dJBznLsQfwO"); NSLog(@"6duKqFjnaCEiGZLOx"); NSLog(@"kQNvdMicl8U7LbR2Zh4HpJ"); NSLog(@"IZdEAnMRBbH6PT3uFoUwxv1"); NSLog(@"tNYk9Q2eSX"); } -(void)aeEtjw0:(UIBarButtonItem*) aeEtjw0 aITRJX693bt:(UIFont*) aITRJX693bt aGFS8htaUK:(UIKeyCommand*) aGFS8htaUK atBYrPM43:(UIEdgeInsets*) atBYrPM43 agVzy9nEs8:(UIImage*) agVzy9nEs8 aZmr9G0aw:(UIApplication*) aZmr9G0aw aXJ1c:(UIControl*) aXJ1c aCU5qVYLuzT:(UIControl*) aCU5qVYLuzT a1hWGZS:(UIFontWeight*) a1hWGZS aZVRei:(UITableView*) aZVRei a7KMn84bEtx:(UISwitch*) a7KMn84bEtx aj6Rqi9t7:(UIMotionEffect*) aj6Rqi9t7 { NSLog(@"CYedFl4DZwnSu"); NSLog(@"mY9F5RNznJI4cPX1As"); NSLog(@"ZoBCquf0HA37M9jxwOSdcp52rk"); NSLog(@"SsvlzPKkBXndohqyW4ZYEcbRDH"); NSLog(@"l56OBXAieRzEGqprV"); NSLog(@"smvETRhibBYUfXat4"); NSLog(@"bLnO71UMoZAIRaHqKgzXYtVuWh0jwi85Sk6v"); NSLog(@"B1m5dWrFySMXLwK9kHzQnsCYitI4ga6Epch3"); NSLog(@"pN0Ib3dronMimFXSCfeyA"); NSLog(@"JbET0gvBcmwl87as9VWoRGLOAFK3dfpxSkD2i5CX"); } @end