123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- //
- // KDPLiveEarningCell.m
- // KuDianProject
- //
- // Created by 学丽 on 2019/7/4.
- // Copyright © 2019 KDP. All rights reserved.
- //
- #import "KDPLiveEarningCell.h"
- @implementation KDPLiveEarningCell
- -(instancetype)initWithFrame:(CGRect)frame
- {
- self=[super initWithFrame:frame];
- if (self) {
- self.backImgV=[[UIImageView alloc]init];
- self.backImgV.image=[UIImage imageNamed:@"top_icon-backnew"];
- [self addSubview:self.backImgV];
- self.backImgV.userInteractionEnabled=YES;
-
- [self.backImgV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.top.right.mas_equalTo(0);
- }];
-
- UILabel *livel =[[UILabel alloc]init];
- livel.text=@"直播收益";
- livel.font=[UIFont systemFontOfSize:15];
- livel.textColor=[UIColor colorWithHexString:@"#666666"];
- [self.backImgV addSubview:livel];
-
- [livel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(45);
- make.top.mas_equalTo(9);
- make.height.mas_equalTo(21);
- }];
-
- UIButton *accountBtn =[[UIButton alloc]init];
- [accountBtn setImage:[UIImage imageNamed:@"next_icon"] forState:UIControlStateNormal];
- [accountBtn addTarget:self action:@selector(accountclickBtn) forControlEvents:UIControlEventTouchUpInside];
- [self.backImgV addSubview:accountBtn];
- [accountBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- make.right.mas_equalTo(-20);
- make.top.mas_equalTo(10);
- make.width.height.mas_equalTo(21);
- }];
-
-
- [self.backImgV addSubview:self.orderNumgL];
- [self.backImgV addSubview:self.Forecastlabel];
-
- [self.orderNumgL mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(0);
- make.top.mas_equalTo(39);
- make.height.mas_equalTo(42);
- make.width.mas_equalTo(SCREEN_WIDTH/2);
- }];
-
- [self.backImgV addSubview:self.addNumL];
- [self.addNumL mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(self.orderNumgL.mas_right).offset(-45);
- make.top.mas_equalTo(self.orderNumgL.mas_top).offset(-5);
- make.height.mas_equalTo(15);
- }];
-
- [self.Forecastlabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(self.orderNumgL.mas_right);
- make.top.mas_equalTo(39);
- make.height.mas_equalTo(42);
- make.width.mas_equalTo(SCREEN_WIDTH/2);
- }];
-
-
- [self orderMoneyView];
- [self addorderBAckView];
-
- }
- return self;
- }
- -(void)addorderBAckView
- {
-
- UIView *oderV=[[UIView alloc]init];
- oderV.backgroundColor=[UIColor clearColor];
- oderV.userInteractionEnabled=YES;
- [self.backImgV addSubview:oderV];
- [oderV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.width.mas_equalTo(114);
- make.height.mas_equalTo(17);
- make.centerX.mas_equalTo(self.Forecastlabel.mas_centerX);
- }];
- UIView *pointorderV=[[UIView alloc]init];
- pointorderV.layer.cornerRadius=3;
- pointorderV.layer.masksToBounds=YES;
- pointorderV.backgroundColor=[UIColor colorWithHexString:@"#FF9E3C"];
- [oderV addSubview:pointorderV];
- [pointorderV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.width.height.mas_equalTo(6);
- make.left.mas_equalTo(0);
- make.top.mas_equalTo(5.5);
- }];
-
- UILabel *ordertitleL=[[UILabel alloc]init];
- ordertitleL.text=@"今日预估(元)";
- ordertitleL.font=[UIFont systemFontOfSize:12];
- ordertitleL.textColor=[UIColor colorWithHexString:@"#666666"];
- ordertitleL.textAlignment=NSTextAlignmentCenter;
- [oderV addSubview:ordertitleL];
-
- [ordertitleL mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(10);
- make.top.mas_equalTo(self.orderNumgL.mas_bottom).offset(1);
-
- make.height.mas_equalTo(17);
- make.width.mas_equalTo(90);
- }];
-
-
- UIButton *changeBtn =[[UIButton alloc]init];
- [changeBtn setImage:[UIImage imageNamed:@"open_hidden_icon"] forState:UIControlStateNormal];
- [changeBtn setImage:[UIImage imageNamed:@"close_hidden_icon"] forState:UIControlStateSelected];
- changeBtn.userInteractionEnabled=YES;
- changeBtn.selected=[KDPublicMethod is_hiddenMoney];
- [changeBtn addTarget:self action:@selector(changeBtnclickBtn:) forControlEvents:UIControlEventTouchUpInside];
- [oderV addSubview:changeBtn];
-
- [changeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(ordertitleL.mas_right).offset(0);
- make.top.mas_equalTo(0);
- make.width.height.mas_equalTo(17);
- }];
-
-
- }
- -(void)orderMoneyView
- {
- {
-
- UIView *oderV=[[UIView alloc]init];
- oderV.backgroundColor=[UIColor clearColor];
- [self.backImgV addSubview:oderV];
- [oderV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.width.mas_equalTo(75);
- make.height.mas_equalTo(17);
- make.centerX.mas_equalTo(self.orderNumgL.mas_centerX);
- }];
- UIView *pointorderV=[[UIView alloc]init];
- pointorderV.layer.cornerRadius=3;
- pointorderV.layer.masksToBounds=YES;
- pointorderV.backgroundColor=[UIColor colorWithHexString:@"#F44A44"];
- [oderV addSubview:pointorderV];
- [pointorderV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.width.height.mas_equalTo(6);
- make.left.mas_equalTo(0);
- make.top.mas_equalTo(5.5);
- }];
-
- UILabel *ordertitleL=[[UILabel alloc]init];
- ordertitleL.text=@"今日订单";
- ordertitleL.font=[UIFont systemFontOfSize:12];
- ordertitleL.textColor=[UIColor colorWithHexString:@"#666666"];
- ordertitleL.textAlignment=NSTextAlignmentCenter;
- [oderV addSubview:ordertitleL];
-
- [ordertitleL mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(10);
- make.top.mas_equalTo(self.orderNumgL.mas_bottom).offset(1);
-
- make.height.mas_equalTo(17);
- make.width.mas_equalTo(65);
- }];
-
- }
- }
- #pragma mark---金额隐私切换
- -(void)changeBtnclickBtn:(UIButton *)bnt
- {
- KDPAccountModel *model=[KDPAccountTool account];
-
- if (model.is_hidden.integerValue == 0) {
- model.is_hidden = @"1";
- bnt.selected=YES;
-
- }else{
- model.is_hidden = @"0";
- bnt.selected=NO;
-
- }
- [KDPAccountTool saveAccount:model];
- [self ishidden_rebat];
- }
- -(void)setRebet_money:(NSString *)rebet_money
- {
- _rebet_money = rebet_money;
- [self ishidden_rebat];
- }
- -(void)ishidden_rebat
- {
- if ([KDPublicMethod is_hiddenMoney]) {
- self.Forecastlabel.text = @"****";
- }else{
- self.Forecastlabel.text=_rebet_money;
- }
- }
- #pragma mark---
- -(void)accountclickBtn
- {
- if (self.liveDataBlock) {
- self.liveDataBlock();
- }
- }
- -(UILabel *)orderNumgL
- {
- if (!_orderNumgL) {
- _orderNumgL=[[UILabel alloc]init];
- _orderNumgL.text=@"----";
- _orderNumgL.font=[UIFont boldSystemFontOfSize:28];
- _orderNumgL.textColor=[UIColor colorWithHexString:fontColor];
- _orderNumgL.textAlignment=NSTextAlignmentCenter;
-
-
- }
- return _orderNumgL;
-
- }
- -(UILabel *)addNumL
- {
- if (!_addNumL) {
- _addNumL=[[UILabel alloc]init];
- _addNumL.textColor=[UIColor colorWithHexString:ThemeColor];
-
- _addNumL.font=[UIFont systemFontOfSize:18];
-
- }
- return _addNumL;
- }
- -(UILabel *)Forecastlabel
- {
- if (!_Forecastlabel) {
-
- _Forecastlabel=[[UILabel alloc]init];
- _Forecastlabel.text=@"----";
- _Forecastlabel.font=[UIFont boldSystemFontOfSize:28];
- _Forecastlabel.textColor=[UIColor colorWithHexString:fontColor];
- _Forecastlabel.textAlignment=NSTextAlignmentCenter;
-
-
- }
- return _Forecastlabel;
- }
- @end
|