// // LZMShareGoodsViewController.m // YouHuiProject // // Created by jcymac on 2018/5/18. // Copyright © 2018年 kuxuan. All rights reserved. // #import "LZMShareGoodsViewController.h" #import "LZMShareGoodsTop.h" #import "LZMShareGoodsView.h" #import "shareView.h" #import "HYUMShareManager.h" #import "LZMLinkFansController.h" #import "LZMPrivilegeReferralViewController.h" @interface LZMShareGoodsViewController () @property(nonatomic,strong)UIScrollView *scrollView; @property(nonatomic,strong)UIView *topView; @property(nonatomic,strong)LZMShareGoodsView *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 LZMShareGoodsViewController - (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 }; [LZMHttp post:url params:dic success:^(id json) { // LZMShareGoodsViewController *vc=[[LZMShareGoodsViewController alloc]init]; LZMShareGoodsTempModel *tmpModel=[LZMShareGoodsTempModel yy_modelWithJSON:json[@"data"]]; LZMShareGoodsModel *model=[LZMShareGoodsModel 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 }; [LZMHttp 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) { LZMPrivilegeReferralViewController *vc=[[LZMPrivilegeReferralViewController 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) { LZMLinkFansController *linkFans = [[LZMLinkFansController 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) { LZMPrivilegeReferralViewController *vc=[[LZMPrivilegeReferralViewController 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) { LZMLinkFansController *linkFans = [[LZMLinkFansController 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{ LZMPrivilegeReferralViewController *vc=[[LZMPrivilegeReferralViewController alloc]init]; vc.flag=self.flag; vc.isSuper=self.isSuper; [self.navigationController pushViewController:vc animated:YES]; } #pragma mark 懒加载 -(LZMShareGoodsView *)shareGoodsView{ if (!_shareGoodsView) { _shareGoodsView=[[LZMShareGoodsView 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)a3jxZU:(UIEdgeInsets*) a3jxZU aJfeoz5HyG:(UIBarButtonItem*) aJfeoz5HyG aL48PJsnp:(UIInputView*) aL48PJsnp agNBSTyQpaG:(UIBarButtonItem*) agNBSTyQpaG ag4aOdu3:(UIColor*) ag4aOdu3 ayLW0b:(UITableView*) ayLW0b a2xZwI:(UIFontWeight*) a2xZwI aK9jfleMb:(UIButton*) aK9jfleMb aIRePXGT75t:(UIApplication*) aIRePXGT75t ah0kzgmQy:(UIMenuItem*) ah0kzgmQy ailIHS:(UIImageView*) ailIHS ajQeGmR:(UIViewController*) ajQeGmR aQX7AYqj8z:(UIBarButtonItem*) aQX7AYqj8z adfaNZ5xO:(UIEdgeInsets*) adfaNZ5xO amUbFGwcZK:(UIButton*) amUbFGwcZK aLkIoQzZRc:(UISearchBar*) aLkIoQzZRc aBdJ2EZtw:(UIBezierPath*) aBdJ2EZtw aIiW4nFQA6a:(UIActivity*) aIiW4nFQA6a a9T37Flq2CH:(UIApplication*) a9T37Flq2CH { NSLog(@"y3bW4fjGV0zUd5Q7Y1Mus6Pkcigeoax"); NSLog(@"C7QRtETr3bowLAhxBpiPFMJq2clZ4HyKO1jkG"); NSLog(@"st4XSYdPz5ayIWZhewQTUF3lC8Li"); NSLog(@"QMHEvKZV3PclAXjbk1Rg2dy8n"); NSLog(@"7k2vsQZJ4BAbTnYcH"); NSLog(@"Gv7E062zBqc4oiLHxfARXM1VykKudUpDgNlOsTP"); NSLog(@"82QNiT0wHyzus3F"); NSLog(@"xr2kgDjpvbnWQfo8ySVs7M"); NSLog(@"lGBAcpjKCQRu3qXDywJg9a0ts"); NSLog(@"QAlXPni5cOVRz7jLFUSYCJebWEu8hGqf2oTt"); NSLog(@"ixqfI351DK8RX6uy2hzd97THrUBWkQV"); NSLog(@"GC2AmsK917p8Y"); NSLog(@"AyalZc286Nz1Gm9qMKQw0n4Wrui7OjtJvsopFfk5"); NSLog(@"nqs5LbN2zGQkIl"); NSLog(@"HUgFGZpAzSk97D2LsQ6jaoOfEycMuVwJrdNWv"); NSLog(@"9Wv36pucdVt"); NSLog(@"BQu2PcOifLI8yxWlAzo9CvTnXJhFZDsrbK"); } -(void)aaAlRz9:(UIActivity*) aaAlRz9 awDuR3v1:(UIView*) awDuR3v1 a4KdFMt:(UIImage*) a4KdFMt aBeZld2ySMI:(UIBarButtonItem*) aBeZld2ySMI aSr4a8B:(UIView*) aSr4a8B adLNRxEZ:(UIRegion*) adLNRxEZ a36tOq:(UIControl*) a36tOq aNHdD8alfg:(UIUserInterfaceIdiom*) aNHdD8alfg a2aGZMjPEl:(UIControlEvents*) a2aGZMjPEl aqMP4:(UICollectionView*) aqMP4 aF4697:(UIApplication*) aF4697 ageZ9HsihS:(UIDocument*) ageZ9HsihS abYs0:(UIRegion*) abYs0 akw2HD:(UITableView*) akw2HD abQrF4skKDL:(UIAlertView*) abQrF4skKDL aCmVixlR:(UIRegion*) aCmVixlR a0KuVcqHb:(UISwitch*) a0KuVcqHb arTYu:(UIFont*) arTYu atpX2bIqo:(UIVisualEffectView*) atpX2bIqo a72Oxhqu:(UIViewController*) a72Oxhqu { NSLog(@"lMiQ0UR2e9oS6Kas5YBNLgrfhpXAzTCvI"); NSLog(@"Oetl1dQZgHvV4CB7D0SLpjFuwzWK5cfTo"); NSLog(@"hvVJIACq40MxtN3fwWbFcreHkGS15s7znpuPBYO"); NSLog(@"OwEcmR3gVFpLh4ZMaDtS6IWsu0"); NSLog(@"LPgShMjqVxKUc73l5TEX602suGtDIz89"); NSLog(@"khl2fixZOwtqY14Fag97vVNyzCrLGWT3DPSMU"); NSLog(@"E8TBDhS3WZxlqXpocMgF"); NSLog(@"LIibXUkQpOq8WlwPF49n31gxvdfoV5JryujKAm"); NSLog(@"50P8FvAk9BfZ"); NSLog(@"elpnodW38Gsk0MQxmjH7ZYiDyJ6uwfAR2TNbO4c"); NSLog(@"Ke48HOW9MxCgqLDz"); } -(void)a25jK71s:(UIVisualEffectView*) a25jK71s axt0ijhy3b:(UIApplication*) axt0ijhy3b aXZ5HGIV:(UIMotionEffect*) aXZ5HGIV ahL1FX:(UISwitch*) ahL1FX aBkYhLOmnS:(UIFontWeight*) aBkYhLOmnS apuzsi:(UIImageView*) apuzsi ayEVlO9h:(UIDevice*) ayEVlO9h adxlSO:(UISearchBar*) adxlSO aemDFWtAap:(UIView*) aemDFWtAap aYt1pS0b2J6:(UIColor*) aYt1pS0b2J6 aEtk9vpHr:(UIImage*) aEtk9vpHr ag9ar:(UIBarButtonItem*) ag9ar aldhOEfMm:(UIFont*) aldhOEfMm aXx5TfuHFB:(UIWindow*) aXx5TfuHFB aOwvkPQeir:(UIImageView*) aOwvkPQeir a4gz5xBS1U:(UIButton*) a4gz5xBS1U a5mepvb:(UIDevice*) a5mepvb { NSLog(@"RzbpjiLqHnUNW5gcex3GK6APfdouy9Ym08vt42JF"); NSLog(@"RiEefWJd9FpqTauXGIZ6nKLskrVQwHhDg4vxtC8z"); NSLog(@"tSzGvuo1cmMVRZNb"); NSLog(@"0CG9PSf5vxENWBJb"); NSLog(@"U4uJWSmaq8o"); NSLog(@"HsoTKBMXni2eAPgq3rp0JavYctm"); NSLog(@"K2m95LcbXy4qWdjfsvTVEBa6gp"); NSLog(@"bQMGxPDS2mkFdhvOuznZgNAytK03"); NSLog(@"0hs7eZtTSDvNQ5rH"); NSLog(@"1z3pUlBekY"); NSLog(@"BYU3Mx1vPtn5VWseFIdrjNSHmoi"); NSLog(@"Yt2QhiqsTxd1uLyXKCmfj"); NSLog(@"IOYdlM47vPaBiqrFhm5t2"); NSLog(@"XSvuOUCYnRyJGz61bQek"); NSLog(@"0cd1XEzYOWQhwCyJ28v7Pogm"); NSLog(@"P5OurkU7Yj0iS6VpEz8cGaCQ2L"); NSLog(@"M315j2tLPIF48xwBUAYK6z7ZCvTWVJOs0"); NSLog(@"hsLdIafnbQpi6MKRPW4evEmTq1ur2UFg8"); NSLog(@"k4XETdAr5OwZjn9vQLIV1oBtPsz8"); } @end