| | |
| | | // |
| | | |
| | | #import "MainInviteViewController.h" |
| | | #import "MainInviteTableViewCell.h" |
| | | #import "InvateListTableViewCell.h" |
| | | #import "UIImageView+YTH.h" |
| | | #import "ShonpingShareViewController.h" |
| | | #import "XYRWebViewController.h" |
| | |
| | | #import "InviteThreeCell.h" |
| | | #import "InvitewFourCell.h" |
| | | #import "InviteHederFourView.h" |
| | | // viewModel |
| | | #import "MainInviteViewModel.h" |
| | | |
| | | #define LfteLength 10 |
| | | |
| | | @interface MainInviteViewController ()<UITableViewDataSource,UITableViewDelegate> |
| | | |
| | | @property (nonatomic, strong) UITableView *tableView; |
| | | //@property (nonatomic, strong) UIScrollView *scrollview; |
| | | //@property (nonatomic, strong) UIImageView *headImageView; |
| | | //@property (nonatomic, strong) UIView *teamView; |
| | | //@property (nonatomic, strong) UILabel *teamNumber; |
| | | //@property (nonatomic, strong) UILabel *estimateLabel; |
| | | //@property (nonatomic, strong) UILabel *mothLabel; |
| | | //@property (nonatomic, strong) UILabel *lastMonLabel; |
| | | //@property (nonatomic, strong) UIView *taskView; |
| | | //@property (nonatomic, strong) UITableView *taskTableview; |
| | | //@property (nonatomic, strong) UIView *percentageView; |
| | | //@property (nonatomic, strong) UIView *listView; |
| | | //@property (nonatomic, strong) UITableView *listTableview; |
| | | //@property (nonatomic, strong) UIView *ruleView; |
| | | //@property (nonatomic, strong) UILabel *ruleLabel; |
| | | //@property (nonatomic, strong) NSArray *inviteGetMoneyList; |
| | | //@property (nonatomic, strong) NSArray *everyDayTaskList; |
| | | //@property (nonatomic, strong) NSArray *gradeArr; |
| | | //@property (nonatomic, strong) UIView *loginView; |
| | | // |
| | | //@property (nonatomic, strong) UIView *primtView; |
| | | //@property (nonatomic, strong) UILabel *primtTitle; |
| | | //@property (nonatomic, strong) UILabel *primtContent; |
| | | //@property (nonatomic, strong) UIWindow *primtWindow; |
| | | //@property (nonatomic, strong) NSString *inviteListString; |
| | | //@property (nonatomic, strong) NSString *number; |
| | | @property (nonatomic, strong, nullable) UITableView *tableView; |
| | | /// viewModel |
| | | @property (nonatomic, strong, nullable) MainInviteViewModel *viewModel; |
| | | /// uid |
| | | @property (nonatomic, copy, nullable) NSString *uid; |
| | | /// é¡µæ° |
| | | @property (nonatomic, assign) NSInteger pageIndex; |
| | | |
| | | @property (nonatomic, strong) MainInviteModel *model; |
| | | |
| | | @property (nonatomic, strong) NSAttributedString *attributedString; |
| | | |
| | | @property (nonatomic, strong) UIView *primtView; |
| | | @property (nonatomic, strong) UILabel *primtTitle; |
| | | @property (nonatomic, strong) UILabel *primtContent; |
| | | @property (nonatomic, strong) UIWindow *primtWindow; |
| | | |
| | | |
| | | @end |
| | | |
| | |
| | | - (void)viewDidLoad { |
| | | [super viewDidLoad]; |
| | | |
| | | // self.gradeArr = @[@"g1",@"g2",@"g3",@"g4",@"g5"]; |
| | | // [self.view addSubview:self.scrollview]; |
| | | // [self.view addSubview:self.loginView]; |
| | | self.automaticallyAdjustsScrollViewInsets = NO; |
| | | |
| | | self.navigationController.title = @"é请æå¥"; |
| | | |
| | | self.view.backgroundColor = XYRBackgroundColor; |
| | | |
| | | self.pageIndex = 1; |
| | | |
| | | [self bindViewModel]; |
| | | |
| | | [self.view addSubview:self.tableView]; |
| | | } |
| | | |
| | | - (void)viewWillAppear:(BOOL)animated{ |
| | | [super viewWillAppear:animated]; |
| | | [MobClick beginLogPageView:@"é请æå¥"]; |
| | | |
| | | self.uid = [[NSUserDefaults standardUserDefaults] objectForKey:@"userId"]; |
| | | |
| | | if (!self.isMine) { |
| | | |
| | | [self.navigationController setNavigationBarHidden:YES animated:animated]; |
| | | |
| | | } else { |
| | | self.title = @"é请æå¥"; |
| | | //self.title = @"é请æå¥"; |
| | | [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}]; |
| | | } |
| | | |
| | | //[self getdatasource]; |
| | | [self.viewModel.requestRemotetCommand execute:nil]; |
| | | } |
| | | |
| | | - (void)viewWillDisappear:(BOOL)animated { |
| | | [super viewWillDisappear:animated]; |
| | | [MobClick endLogPageView:@"é请æå¥"]; |
| | | |
| | | [self.navigationController setNavigationBarHidden:NO animated:animated]; |
| | | } |
| | | //// headImageç¹å»äºä»¶ |
| | | //- (void)headImageTaped:(UITapGestureRecognizer *)tap { |
| | | // |
| | | // if (!([[NSUserDefaults standardUserDefaults] objectForKey:@"userId"])) { |
| | | // |
| | | // LoginViewController *loginVc = [[LoginViewController alloc] init]; |
| | | // |
| | | // loginVc.hidesBottomBarWhenPushed = YES; |
| | | // loginVc.rootVc = self; |
| | | // |
| | | // [self.navigationController pushViewController:loginVc animated:YES]; |
| | | // |
| | | // } else { |
| | | // |
| | | // InvitationFriendsViewController *invitaVC = [[InvitationFriendsViewController alloc]init]; |
| | | // invitaVC.hidesBottomBarWhenPushed=YES; |
| | | // [self.navigationController pushViewController:invitaVC animated:YES]; |
| | | // } |
| | | //} |
| | | // |
| | | //- (void)loginTaped:(UIButton *)sender { |
| | | // //ç»å½çé¢ |
| | | // LoginViewController *loginVc = [[LoginViewController alloc] init]; |
| | | // |
| | | // loginVc.hidesBottomBarWhenPushed=YES; |
| | | // loginVc.rootVc = self; |
| | | // |
| | | // [self.navigationController pushViewController:loginVc animated:YES]; |
| | | //} |
| | | // |
| | | //- (void)shareShopTaped:(UIButton *)sender { |
| | | // |
| | | // if (!([[NSUserDefaults standardUserDefaults] objectForKey:@"userId"])) { |
| | | // |
| | | // LoginViewController *loginVc=[[LoginViewController alloc] init]; |
| | | // |
| | | // loginVc.hidesBottomBarWhenPushed = YES; |
| | | // loginVc.rootVc = self; |
| | | // |
| | | // [self.navigationController pushViewController:loginVc animated:YES]; |
| | | // |
| | | // } else { |
| | | // |
| | | // NSInteger tag = sender.tag - 722; |
| | | // [self geturlwithID:self.everyDayTaskList[tag][@"etGoods"][@"auctionId"]]; |
| | | // } |
| | | //} |
| | | // |
| | | //- (void)numTaped:(UIButton *)sender { |
| | | // |
| | | // ShonpingShareViewController *SureWebVC=[[ShonpingShareViewController alloc] init]; |
| | | // SureWebVC.urlString=self.inviteListString; |
| | | // |
| | | // SureWebVC.hidesBottomBarWhenPushed=YES; |
| | | // [self.navigationController pushViewController:SureWebVC animated:YES]; |
| | | //} |
| | | // |
| | | //- (void)geturlwithID:(NSString *)shopid { |
| | | // |
| | | // NSMutableDictionary *dic = [[NSMutableDictionary alloc] init]; |
| | | // |
| | | // [dic setObject:shopid forKey:@"id"]; |
| | | // |
| | | // NSLog(@"%@",[NSString stringWithFormat:@"%@/%@",domainHTTP,@"share/getGoodsShareUrl"]); |
| | | // |
| | | // [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"share/getGoodsShareUrl"] |
| | | // param:dic |
| | | // success:^(NSDictionary *object) { |
| | | // |
| | | // ShonpingShareViewController *shopVC = [[ShonpingShareViewController alloc]init]; |
| | | // shopVC.urlString = object[@"data"]; |
| | | // shopVC.hidesBottomBarWhenPushed=YES; |
| | | // [self.navigationController pushViewController:shopVC animated:YES]; |
| | | // |
| | | // } fail:^(id object) { |
| | | // NSLog(@"%@",object); |
| | | // }]; |
| | | //} |
| | | //- (void)getdatasource { |
| | | // |
| | | // NSMutableDictionary *dic = [[NSMutableDictionary alloc] init]; |
| | | // |
| | | // [dic setObject:@"1" forKey:@"pageIndex"]; |
| | | // |
| | | // if ([[NSUserDefaults standardUserDefaults] objectForKey:@"userId"] != nil) { |
| | | // [dic setObject:[[NSUserDefaults standardUserDefaults] objectForKey:@"userId"] forKey:@"uid"]; |
| | | // |
| | | // } else { |
| | | // |
| | | // [dic setObject:@"" forKey:@"uid"]; |
| | | // } |
| | | // |
| | | // [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"invite/inviteGetMoney"] param:dic success:^(NSDictionary *object) { |
| | | // |
| | | // [self->_scrollview.mj_header endRefreshing]; |
| | | // |
| | | // NSDictionary *dic = object[@"data"]; |
| | | // |
| | | // self.inviteListString = dic[@"inviteList"]; |
| | | // self.everyDayTaskList = dic[@"everyDayTaskList"]; |
| | | // self.inviteGetMoneyList = dic[@"inviteGetMoneyList"]; |
| | | // |
| | | // self.taskView.frame = CGRectMake(0, CGRectGetMaxY(self.percentageView.frame) + 10, KScreenW, self.everyDayTaskList.count * 120 + 60); |
| | | // self.taskTableview.frame = CGRectMake(0, 0, KScreenW,self->_taskView.frame.size.height ); |
| | | // self.listView.frame = CGRectMake(0, CGRectGetMaxY(self.taskView.frame) + 10, KScreenW, self.inviteGetMoneyList.count * 50 + 60); |
| | | // self.listTableview.frame = CGRectMake(0, 0, self->_listView.frame.size.width, self->_listView.frame.size.height ); |
| | | // |
| | | // NSAttributedString * attrStr = [[NSAttributedString alloc] initWithData:[dic[@"activityRules"] dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil]; |
| | | // |
| | | // NSMutableAttributedString *str = [[NSMutableAttributedString alloc]initWithAttributedString:attrStr]; |
| | | // |
| | | // [str addAttribute:NSForegroundColorAttributeName value:SJColor(136, 136, 136, 1) range:NSMakeRange(0,str.length)]; |
| | | // [str addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize :14] range:NSMakeRange(0, str.length)]; |
| | | // |
| | | // self.ruleLabel.attributedText = str; |
| | | // |
| | | // if ([[NSString stringWithFormat:@"%@",dic[@"myTeam"]] isKindOfClass:[NSNull class]]) { |
| | | // self.teamNumber.text = @"0"; |
| | | // }else{ |
| | | // self.teamNumber.text = [NSString stringWithFormat:@"%@",dic[@"myTeam"]]; |
| | | // self.number = self.teamNumber.text; |
| | | // } |
| | | // |
| | | // if (!dic[@"moneyToday"]) { |
| | | // self.estimateLabel.text = @"0"; |
| | | // }else{ |
| | | // self.estimateLabel.text = [NSString stringWithFormat:@"%@",dic[@"moneyToday"]]; |
| | | // } |
| | | // |
| | | // if (!dic[@"moneyMonth"]) { |
| | | // self.mothLabel.text = @"0"; |
| | | // }else{ |
| | | // self.mothLabel.text = [NSString stringWithFormat:@"%@",dic[@"moneyMonth"]]; |
| | | // } |
| | | // if (!dic[@"moneyLastMonth"]) { |
| | | // self.lastMonLabel.text = @"0"; |
| | | // }else{ |
| | | // self.lastMonLabel.text = [NSString stringWithFormat:@"%@",dic[@"moneyLastMonth"]]; |
| | | // } |
| | | // [self.ruleLabel sizeToFit]; |
| | | // |
| | | // CGSize size = [self sizeWithFont:[UIFont systemFontOfSize:14] maxSize:CGSizeMake(KScreenW - 40, 2000) string:self.ruleLabel.text]; |
| | | // |
| | | // self.ruleView.frame = CGRectMake(0, CGRectGetMaxY(self.listView.frame) + 10, KScreenW, size.height + 80); |
| | | // |
| | | // self->_scrollview.contentSize = CGSizeMake(KScreenW, self.headImageView.frame.size.height + self.teamView.frame.size.height + self.taskView.frame.size.height + self.percentageView.frame.size.height + self.listView.frame.size.height + self.ruleView.frame.size.height + 100); |
| | | // |
| | | // [self.taskTableview reloadData]; |
| | | // [self.listTableview reloadData]; |
| | | // |
| | | // if (!([[NSUserDefaults standardUserDefaults] objectForKey:@"userId"])) { |
| | | // self.teamNumber.text = @"---"; |
| | | // self.estimateLabel.text = @"---"; |
| | | // self.mothLabel.text = @"---"; |
| | | // self.lastMonLabel.text = @"---"; |
| | | // } |
| | | // |
| | | // } fail:^(id object) { |
| | | // |
| | | // [self->_scrollview.mj_header endRefreshing]; |
| | | // }]; |
| | | //} |
| | | //- (void)priTaped:(UIButton *)sender{ |
| | | // |
| | | // if (![[NSUserDefaults standardUserDefaults] objectForKey:@"userId"]) { |
| | | // |
| | | // return; |
| | | // } |
| | | // |
| | | // _primtWindow = [[UIWindow alloc]init]; |
| | | // |
| | | // _primtWindow.backgroundColor = [UIColor colorWithWhite:0.2 alpha:0.7]; |
| | | // _primtWindow.windowLevel = UIWindowLevelAlert - 1; |
| | | // _primtWindow.hidden = NO; |
| | | // |
| | | // [_primtWindow addSubview:self.primtView]; |
| | | // |
| | | // if (sender.tag == 35) { |
| | | // |
| | | // self.primtTitle.text = @"仿¥é¢ä¼°æ¶ç"; |
| | | // self.primtContent.text = @"仿¥æ°å¢çææè®¢åé¢ä¼°æ¶ç"; |
| | | // |
| | | // } else if(sender.tag == 36) { |
| | | // |
| | | // self.primtTitle.text = @"æ¬æé¢ä¼°æ¶ç"; |
| | | // self.primtContent.text = @"æ¬æå
产ççææè®¢åé¢ä¼°æ¶çï¼ä¼å¨è®¢å确认æ¶è´§åçæ¬¡æ25æ¥å转å
¥ä½ çä½é¢ï¼ä»¥å®é
转å
¥ä½é¢ä¸ºå"; |
| | | // |
| | | // } else { |
| | | // |
| | | // self.primtTitle.text = @"䏿é¢ä¼°æ¶å
¥"; |
| | | // self.primtContent.text = @"ä¸ä¸ªæå
确认æ¶è´§çè®¢åæ¶å
¥ï¼æ¯æ25æ¥ç»ç®åï¼å°èªå¨è½¬å
¥ä½ çä½é¢"; |
| | | // } |
| | | //} |
| | | // |
| | | //- (void)primtTaped:(UIButton *)sender { |
| | | // |
| | | // _primtWindow.hidden = YES; |
| | | // _primtWindow = nil; |
| | | //} |
| | | ////è®¡ç®æåé«åº¦ |
| | | //- (CGFloat)getHeightLineWithString:(NSString *)string withWidth:(CGFloat)width withFont:(UIFont *)font { |
| | | // |
| | | // //1.1æå¤§å
许ç»å¶çææ¬èå´ |
| | | // CGSize size = CGSizeMake(width, 2000); |
| | | // //1.2é
ç½®è®¡ç®æ¶çè¡æªåæ¹æ³,åcontentLabelå¯¹åº |
| | | // NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init]; |
| | | // [style setLineSpacing:10]; |
| | | // //1.3é
ç½®è®¡ç®æ¶çåä½çå¤§å° |
| | | // //1.4é
ç½®å±æ§åå
¸ |
| | | // NSDictionary *dic = @{NSFontAttributeName:font, NSParagraphStyleAttributeName:style}; |
| | | // //2.è®¡ç® |
| | | // //妿æ³ä¿çå¤ä¸ªæä¸¾å¼,åæä¸¾å¼ä¸é´å æä½æ|å³å¯,并䏿¯ææçæä¸¾ç±»åé½å¯ä»¥æä½æ,åªææä¸¾å¼çèµå¼ä¸æå·¦ç§»è¿ç®ç¬¦æ¶æå¯ä»¥ |
| | | // CGFloat height = [string boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:dic context:nil].size.height; |
| | | // |
| | | // return height; |
| | | //} |
| | | // |
| | | //-(CGSize)sizeWithFont:(UIFont *)font maxSize:(CGSize)maxSize string:(NSString *)string { |
| | | // |
| | | // NSDictionary *attrs = @{NSFontAttributeName:font}; |
| | | // |
| | | // return [string boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:attrs context:nil].size; |
| | | //} |
| | | // |
| | | ////设置viewæä¸éçè¾¹æ¡ |
| | | //- (void)setBorderWithView:(UIView *)view top:(BOOL)top left:(BOOL)left bottom:(BOOL)bottom right:(BOOL)right borderColor:(UIColor *)color borderWidth:(CGFloat)width { |
| | | // |
| | | // if (top) { |
| | | // CALayer *layer = [CALayer layer]; |
| | | // layer.frame = CGRectMake(0, 0, view.frame.size.width, width); |
| | | // layer.backgroundColor = color.CGColor; |
| | | // [view.layer addSublayer:layer]; |
| | | // } |
| | | // if (left) { |
| | | // CALayer *layer = [CALayer layer]; |
| | | // layer.frame = CGRectMake(0, 0, width, view.frame.size.height); |
| | | // layer.backgroundColor = color.CGColor; |
| | | // [view.layer addSublayer:layer]; |
| | | // } |
| | | // if (bottom) { |
| | | // CALayer *layer = [CALayer layer]; |
| | | // layer.frame = CGRectMake(0, view.frame.size.height - width, view.frame.size.width, width); |
| | | // layer.backgroundColor = color.CGColor; |
| | | // [view.layer addSublayer:layer]; |
| | | // } |
| | | // if (right) { |
| | | // CALayer *layer = [CALayer layer]; |
| | | // layer.frame = CGRectMake(view.frame.size.width - width, 0, width, view.frame.size.height); |
| | | // layer.backgroundColor = color.CGColor; |
| | | // [view.layer addSublayer:layer]; |
| | | // } |
| | | //} |
| | | // |
| | | |
| | | - (void)bindViewModel { |
| | | |
| | | RAC(self.viewModel, uid) = RACObserve(self, uid); |
| | | RAC(self.viewModel, pageIndex) = RACObserve(self, pageIndex); |
| | | |
| | | @weakify(self) |
| | | [self.viewModel.requestRemotetCommand.executionSignals.switchToLatest |
| | | subscribeNext:^(RACSignal *signal) { |
| | | @strongify(self) |
| | | |
| | | [signal subscribeNext:^(MainInviteModel *mainInviteModel) { |
| | | |
| | | dispatch_async(dispatch_get_main_queue(), ^{ |
| | | |
| | | [self.tableView.mj_header endRefreshing]; |
| | | |
| | | self.model = mainInviteModel; |
| | | |
| | | self.model.activityRulesAttributed = [self stringWithAttributedString:mainInviteModel.activityRules]; |
| | | |
| | | [self.tableView reloadData]; |
| | | |
| | | }); |
| | | |
| | | } error:^(NSError *error) { |
| | | |
| | | }]; |
| | | }]; |
| | | } |
| | | |
| | | - (NSAttributedString *)stringWithAttributedString:(NSString *)str { |
| | | |
| | | NSMutableAttributedString * attrString = [[NSMutableAttributedString alloc] initWithData:[str dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType} documentAttributes:nil error:nil]; |
| | | |
| | | //设置åºçº¿åç§»å¼ï¼åå¼ä¸º NSNumber ï¼floatï¼,æ£å¼ä¸åï¼è´å¼ä¸åï¼å¯ä½¿UILabelææ¬åç´å±
ä¸ |
| | | [attrString addAttributes:@{NSBaselineOffsetAttributeName:@(5), NSFontAttributeName:[UIFont systemFontOfSize:14]} range:NSMakeRange(0, attrString.length)]; |
| | | |
| | | return attrString; |
| | | } |
| | | |
| | | - (void)onInviteEvent:(UIButton *)button { |
| | | |
| | | |
| | | if (!([[NSUserDefaults standardUserDefaults] objectForKey:@"userId"])) { |
| | | |
| | | LoginViewController *loginVc = [[LoginViewController alloc] init]; |
| | | |
| | | loginVc.hidesBottomBarWhenPushed = YES; |
| | | loginVc.rootVc = self; |
| | | |
| | | [self.navigationController pushViewController:loginVc animated:YES]; |
| | | |
| | | } else { |
| | | |
| | | InvitationFriendsViewController *invitaVC = [[InvitationFriendsViewController alloc]init]; |
| | | invitaVC.hidesBottomBarWhenPushed=YES; |
| | | [self.navigationController pushViewController:invitaVC animated:YES]; |
| | | } |
| | | } |
| | | |
| | | - (void)priTaped:(UIButton *)sender{ |
| | | |
| | | if (![[NSUserDefaults standardUserDefaults] objectForKey:@"userId"]) { |
| | | |
| | | return; |
| | | } |
| | | |
| | | _primtWindow = [[UIWindow alloc] init]; |
| | | _primtWindow.backgroundColor = [UIColor colorWithWhite:0.2 alpha:0.7]; |
| | | _primtWindow.windowLevel = UIWindowLevelAlert - 1; |
| | | _primtWindow.hidden = NO; |
| | | |
| | | [_primtWindow addSubview:self.primtView]; |
| | | |
| | | if (sender.tag == 35) { |
| | | |
| | | self.primtTitle.text = @"仿¥é¢ä¼°æ¶ç"; |
| | | self.primtContent.text = @"仿¥æ°å¢çææè®¢åé¢ä¼°æ¶ç"; |
| | | |
| | | } else if(sender.tag == 36) { |
| | | |
| | | self.primtTitle.text = @"æ¬æé¢ä¼°æ¶ç"; |
| | | self.primtContent.text = @"æ¬æå
产ççææè®¢åé¢ä¼°æ¶çï¼ä¼å¨è®¢å确认æ¶è´§åçæ¬¡æ25æ¥å转å
¥ä½ çä½é¢ï¼ä»¥å®é
转å
¥ä½é¢ä¸ºå"; |
| | | |
| | | } else { |
| | | |
| | | self.primtTitle.text = @"䏿é¢ä¼°æ¶å
¥"; |
| | | self.primtContent.text = @"ä¸ä¸ªæå
确认æ¶è´§çè®¢åæ¶å
¥ï¼æ¯æ25æ¥ç»ç®åï¼å°èªå¨è½¬å
¥ä½ çä½é¢"; |
| | | } |
| | | } |
| | | |
| | | - (void)primtTaped:(UIButton *)sender { |
| | | |
| | | _primtWindow.hidden = YES; |
| | | _primtWindow = nil; |
| | | } |
| | | |
| | | - (void)onRefreshData { |
| | | |
| | | NSIndexSet *reloadSet = [NSIndexSet indexSetWithIndex:3]; |
| | | [self.tableView reloadSections:reloadSet withRowAnimation:UITableViewRowAnimationNone]; |
| | | } |
| | | |
| | | #pragma mark - UITableViewDataSource,UITableViewDelegate |
| | | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { |
| | | |
| | |
| | | cell = [[InviteOneCell alloc] initWithStyle:UITableViewCellStyleDefault |
| | | reuseIdentifier:cellIden]; |
| | | } |
| | | cell.uid = [[NSUserDefaults standardUserDefaults] objectForKey:@"userId"]; |
| | | cell.model = self.model; |
| | | |
| | | // æçéå |
| | | @weakify(self) |
| | | [[cell.teamButton rac_signalForControlEvents:UIControlEventTouchUpInside] |
| | | subscribeNext:^(UIButton *button) { |
| | | @strongify(self) |
| | | ShonpingShareViewController *sureWebVC = [[ShonpingShareViewController alloc] init]; |
| | | sureWebVC.urlString = self.model.inviteList; |
| | | |
| | | sureWebVC.hidesBottomBarWhenPushed = YES; |
| | | [self.navigationController pushViewController:sureWebVC animated:YES]; |
| | | }]; |
| | | |
| | | [cell.estimateButton addTarget:self |
| | | action:@selector(priTaped:) |
| | | forControlEvents:UIControlEventTouchUpInside]; |
| | | |
| | | [cell.mothButton addTarget:self |
| | | action:@selector(priTaped:) |
| | | forControlEvents:UIControlEventTouchUpInside]; |
| | | |
| | | [cell.lastMothButton addTarget:self |
| | | action:@selector(priTaped:) |
| | | forControlEvents:UIControlEventTouchUpInside]; |
| | | |
| | | [cell.inviteButton addTarget:self |
| | | action:@selector(onInviteEvent:) |
| | | forControlEvents:UIControlEventTouchUpInside]; |
| | | |
| | | return cell; |
| | | |
| | |
| | | cell = [[InviteThreeCell alloc] initWithStyle:UITableViewCellStyleDefault |
| | | reuseIdentifier:cellIden]; |
| | | } |
| | | cell.model = self.model; |
| | | |
| | | return cell; |
| | | |
| | |
| | | cell = [[InvitewFourCell alloc] initWithStyle:UITableViewCellStyleDefault |
| | | reuseIdentifier:cellIden]; |
| | | } |
| | | cell.model = self.model; |
| | | |
| | | cell.remainNumStr = self.attributedString; |
| | | |
| | | return cell; |
| | | } |
| | |
| | | |
| | | // è¡¨æ ¼é«åº¦ |
| | | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { |
| | | |
| | | // return [self.tableView cellHeightForIndexPath:indexPath |
| | | // model:self.listArrs[indexPath.section] |
| | | // keyPath:@"model" |
| | | // cellClass:[AddrssMangeCell class] |
| | | // contentViewWidth:SCREEN_WIDTH]; |
| | | |
| | | if (indexPath.section == 0) { |
| | | |
| | |
| | | |
| | | } else { |
| | | |
| | | return 50; |
| | | return [self.tableView cellHeightForIndexPath:indexPath |
| | | model:self.model |
| | | keyPath:@"model" |
| | | cellClass:[InvitewFourCell class] |
| | | contentViewWidth:SCREEN_WIDTH]; |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | //- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { |
| | | // |
| | | // if (tableView == self.taskTableview) { |
| | | // |
| | | // NSString *identifier = @"MainInviteTableViewCell"; |
| | | // MainInviteTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; |
| | | // |
| | | // if (!cell) { |
| | | // cell = [[MainInviteTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]; |
| | | // } |
| | | // cell.selectionStyle = UITableViewCellSelectionStyleNone; |
| | | // cell.buttonView.layer.cornerRadius = cell.buttonView.frame.size.height / 2; |
| | | // cell.buttonView.layer.masksToBounds = YES; |
| | | // NSDictionary *dic = self.everyDayTaskList[indexPath.row]; |
| | | // [cell.imageview setYthImageWithURL:dic[@"etGoods"][@"pictUrl"] placeholderImage:[UIImage imageNamed:@"ååé»è®¤å¾ç"]]; |
| | | // |
| | | // cell.nameLabel.text = [NSString stringWithFormat:@"%@",dic[@"etGoods"][@"title"]]; |
| | | // cell.saleNumberLabel.text = [NSString stringWithFormat:@"æééï¼%@",dic[@"etGoods"][@"salesCount"]]; |
| | | // cell.makeMoneyLabel.text = [NSString stringWithFormat:@"%@",dic[@"getMoney"]]; |
| | | // cell.shareButton.tag = 722 + indexPath.row; |
| | | // [cell.shareButton addTarget:self action:@selector(shareShopTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | | // cell.priceLabel.text = [NSString stringWithFormat:@"å¸åä»·:%@",dic[@"quanhoujia"]]; |
| | | // NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:cell.priceLabel.text]; |
| | | // [str addAttribute:NSForegroundColorAttributeName value:[UIColor blackColor] range:NSMakeRange(4,cell.priceLabel.text.length - 4)]; |
| | | // |
| | | // if (KScreenW <375) { |
| | | // cell.makeMoneyLabel.font = [UIFont systemFontOfSize:12]; |
| | | // cell.saleNumberLabel.font = [UIFont systemFontOfSize:12]; |
| | | // [str addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12] range:NSMakeRange(0,cell.priceLabel.text.length )]; |
| | | // } |
| | | // cell.priceLabel.attributedText = str; |
| | | // |
| | | // return cell; |
| | | // |
| | | // } else { |
| | | // |
| | | // NSString *identifier = @"InvateListTableViewCell"; |
| | | // |
| | | // InvateListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; |
| | | // |
| | | // if (!cell) { |
| | | // cell = [[InvateListTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]; |
| | | // } |
| | | // |
| | | // cell.selectionStyle = UITableViewCellSelectionStyleNone; |
| | | // cell.backView.layer.cornerRadius = 5; |
| | | // cell.backView.layer.masksToBounds = YES; |
| | | // cell.backView.backgroundColor = indexPath.row % 2 ? SJColor(255, 225, 238, 1) : SJColor(255, 254, 227, 1); |
| | | // cell.headImage.layer.cornerRadius = cell.headImage.frame.size.height / 2; |
| | | // cell.headImage.layer.masksToBounds = YES; |
| | | // |
| | | // NSDictionary *dic = self.inviteGetMoneyList[indexPath.row]; |
| | | // cell.nameLabel.text = dic[@"name"]; |
| | | // cell.gradeImage.image = [UIImage imageNamed:@"gï¼"]; |
| | | // [cell.gradeImage setYthImageWithURL:dic[@"icon"] placeholderImage:[UIImage imageNamed:self.gradeArr[indexPath.row % 5]]]; |
| | | // [cell.headImage setYthImageWithURL:dic[@"portrait"] placeholderImage:[UIImage imageNamed:@"é»è®¤å¤´å"]]; |
| | | // cell.moneyLabel.text = [NSString stringWithFormat:@"Â¥%.2f",[dic[@"money"]doubleValue]]; |
| | | // cell.userInteractionEnabled = NO; |
| | | // return cell; |
| | | // } |
| | | //} |
| | | // |
| | | //- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { |
| | | // |
| | | // UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, KScreenW, 40)]; |
| | | // label.text = @"æ¯æ¥ä»»å¡"; |
| | | // if (tableView == self.listTableview) { |
| | | // label.text = @"é请å¥éæ¦"; |
| | | // } |
| | | // label.textAlignment = NSTextAlignmentCenter; |
| | | // label.font = [UIFont boldSystemFontOfSize:20]; |
| | | // label.textColor = XYRMainColor; |
| | | // [self setBorderWithView:label top:NO left:NO bottom:YES right:NO borderColor:XYRBackgroundColor borderWidth:1]; |
| | | // |
| | | // return label; |
| | | //} |
| | | // |
| | | //- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ |
| | | // return 40; |
| | | //} |
| | | // |
| | | //- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ |
| | | // |
| | | // NSDictionary *tempItem = [self.everyDayTaskList[indexPath.row] objectForKey:@"etGoods"]; |
| | | // |
| | | // if ([YTHsharedManger startManger].isDetailWebValue) { |
| | | // SureWebViewController *webView=[[SureWebViewController alloc] init]; |
| | | // [webView backClicked:^(NSString *string) { |
| | | // |
| | | // }]; |
| | | // webView.goodsId=[tempItem objectForKey:@"auctionId"]; |
| | | // webView.canDownRefresh=YES; |
| | | // webView.isGoodsDetail = YES; |
| | | // webView.hidesBottomBarWhenPushed = YES; |
| | | // [self.navigationController pushViewController:webView animated:YES]; |
| | | // return; |
| | | // } |
| | | // |
| | | // GoodDeTrViewController *goodsDetailVC = [[GoodDeTrViewController alloc]init]; |
| | | // goodsDetailVC.hidesBottomBarWhenPushed = YES; |
| | | // goodsDetailVC.goodsID = [tempItem objectForKey:@"auctionId"]; |
| | | // [self .navigationController pushViewController:goodsDetailVC animated:YES]; |
| | | //} |
| | | // |
| | | // |
| | | //#pragma mark - getter |
| | | //- (UIScrollView *)scrollview{ |
| | | // |
| | | // if (_scrollview) { |
| | | // |
| | | // return _scrollview ; |
| | | // } |
| | | // NSInteger height = -20; |
| | | // |
| | | // if (IsiPhoneX) { |
| | | // |
| | | // height = -44; |
| | | // } |
| | | // _scrollview = [[UIScrollView alloc]initWithFrame:CGRectMake(0, height, KScreenW, KScreenH)]; |
| | | // _scrollview.pagingEnabled = NO; |
| | | // _scrollview.showsHorizontalScrollIndicator = NO; |
| | | // _scrollview.backgroundColor = XYRBackgroundColor; |
| | | // [_scrollview addSubview:self.headImageView]; |
| | | // [_scrollview addSubview:self.teamView]; |
| | | // [_scrollview addSubview:self.percentageView]; |
| | | // [_scrollview addSubview:self.taskView]; |
| | | // [_scrollview addSubview:self.listView]; |
| | | // [_scrollview addSubview:self.ruleView]; |
| | | // _scrollview.contentSize = CGSizeMake(KScreenW, self.headImageView.frame.size.height + self.teamView.frame.size.height + self.taskView.frame.size.height + self.percentageView.frame.size.height + self.listView.frame.size.height + self.ruleView.frame.size.height + 120); |
| | | // _scrollview.mj_header =[MJRefreshNormalHeader headerWithRefreshingBlock:^{ |
| | | // [self getdatasource]; |
| | | // }]; |
| | | // return _scrollview; |
| | | //} |
| | | // |
| | | //- (UIImageView *)headImageView { |
| | | // |
| | | // if (_headImageView) { |
| | | // return _headImageView; |
| | | // } |
| | | // _headImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, KScreenW, 220)]; |
| | | // |
| | | // _headImageView.image = [UIImage imageNamed: @"banner"]; |
| | | // _headImageView.userInteractionEnabled = YES; |
| | | // UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(headImageTaped:)]; |
| | | // [_headImageView addGestureRecognizer:tap]; |
| | | // |
| | | // return _headImageView; |
| | | //} |
| | | //- (UIView *)teamView { |
| | | // |
| | | // if (_teamView) { |
| | | // return _teamView; |
| | | // } |
| | | // |
| | | // UIView *backView = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_headImageView.frame), KScreenW , 90)]; |
| | | // backView.backgroundColor = SJColor(250, 222, 50, 1); |
| | | // [_scrollview addSubview:backView]; |
| | | // |
| | | // _teamView = [[UIView alloc]initWithFrame:CGRectMake(LfteLength, CGRectGetMaxY(_headImageView.frame) + 10, KScreenW - LfteLength * 2, 80)]; |
| | | // _teamView.backgroundColor = [UIColor whiteColor]; |
| | | // _teamView.layer.cornerRadius = 8; |
| | | // _teamView.layer.masksToBounds = YES; |
| | | // [_teamView addSubview:self.teamNumber]; |
| | | // [_teamView addSubview:self.estimateLabel]; |
| | | // [_teamView addSubview:self.mothLabel]; |
| | | // [_teamView addSubview:self.lastMonLabel]; |
| | | // return _teamView; |
| | | //} |
| | | //- (UILabel *)teamNumber { |
| | | // if (_teamNumber) { |
| | | // return _teamNumber; |
| | | // } |
| | | // _teamNumber = [[UILabel alloc]initWithFrame:CGRectMake(0, 10,( KScreenW - LfteLength) / 4 - 1, 30)]; |
| | | // _teamNumber.textColor = XYRMainColor; |
| | | // _teamNumber.font = [UIFont boldSystemFontOfSize:30]; |
| | | // _teamNumber .font = [UIFont fontWithName:@"Arial-BoldMT" size:30]; |
| | | // |
| | | // _teamNumber.textAlignment = NSTextAlignmentCenter; |
| | | // _teamNumber.text = @"---"; |
| | | // |
| | | // NSInteger height = 15; |
| | | // if (KScreenW > 375) { |
| | | // height = 15; |
| | | // } |
| | | // UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMinX(_teamNumber.frame), CGRectGetMaxY(_teamNumber.frame) + 10, _teamNumber.frame.size.width, height)]; |
| | | // label.font = [UIFont systemFontOfSize:12]; |
| | | // if (KScreenW > 375) { |
| | | // label.font = [UIFont systemFontOfSize:15]; |
| | | // } |
| | | // label.textAlignment = NSTextAlignmentCenter; |
| | | // label.text = @"æçéå"; |
| | | // label.textColor = SJColor(98, 98, 98,1); |
| | | // |
| | | // [_teamView addSubview:label]; |
| | | // UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | // button.frame = CGRectMake(CGRectGetMinX(_teamNumber.frame), CGRectGetMinY(_teamNumber.frame), _teamNumber.frame.size.width, _teamNumber.frame.size.height + label.frame.size.height + 10); |
| | | // [button addTarget:self action:@selector(numTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | | // button.tag = 35; |
| | | // [_teamView addSubview:button]; |
| | | // return _teamNumber; |
| | | //} |
| | | // |
| | | //-(UILabel *)estimateLabel{ |
| | | // if (_estimateLabel) { |
| | | // return _estimateLabel; |
| | | // } |
| | | // UIView *lineview = [[UIView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.teamNumber.frame), 15, 1, _teamView.frame.size.height - 30)]; |
| | | // lineview.backgroundColor = XYRBackgroundColor; |
| | | // [_teamView addSubview:lineview]; |
| | | // |
| | | // _estimateLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.teamNumber.frame) + 1, 10, self.teamNumber.frame.size.width, 30)]; |
| | | // _estimateLabel.textColor = XYRMainColor; |
| | | // _estimateLabel.font = [UIFont boldSystemFontOfSize:30]; |
| | | // _estimateLabel .font = [UIFont fontWithName:@"Arial-BoldMT" size:30]; |
| | | // |
| | | // _estimateLabel.textAlignment = NSTextAlignmentCenter; |
| | | // _estimateLabel.text = @"---"; |
| | | // UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMinX(_estimateLabel.frame), CGRectGetMaxY(_estimateLabel.frame) + 10, _estimateLabel.frame.size.width-20, 25)]; |
| | | // label.font = [UIFont systemFontOfSize:12]; |
| | | // if (KScreenW > 375) { |
| | | // label.font = [UIFont systemFontOfSize:15]; |
| | | // } |
| | | // label.text = @" 仿¥é¢ä¼°"; |
| | | // label.textAlignment = NSTextAlignmentRight; |
| | | // [label sizeToFit]; |
| | | // |
| | | // label.textColor = SJColor(98, 98, 98,1); |
| | | // [_teamView addSubview:label]; |
| | | // UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(label.frame)-5, CGRectGetMinY(label.frame) - 4 , 30, 22)]; |
| | | // image.image = [UIImage imageNamed:@"å½¢ç¶é®"]; |
| | | // [_teamView addSubview:image]; |
| | | // UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | // button.frame = CGRectMake(CGRectGetMinX(_estimateLabel.frame), CGRectGetMinY(_estimateLabel.frame), _estimateLabel.frame.size.width, _estimateLabel.frame.size.height + label.frame.size.height + 10); |
| | | // [button addTarget:self action:@selector(priTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | | // button.tag = 35; |
| | | // [_teamView addSubview:button]; |
| | | // return _estimateLabel; |
| | | //} |
| | | //- (UILabel *)mothLabel { |
| | | // if (_mothLabel) { |
| | | // return _mothLabel; |
| | | // } |
| | | // UIView *lineview = [[UIView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.estimateLabel.frame), 15, 1, _teamView.frame.size.height - 30)]; |
| | | // lineview.backgroundColor = XYRBackgroundColor; |
| | | // [_teamView addSubview:lineview]; |
| | | // |
| | | // _mothLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.estimateLabel.frame) + 1, 10, _estimateLabel.frame.size.width, 30)]; |
| | | // _mothLabel.textColor = XYRMainColor; |
| | | // _mothLabel.font = [UIFont boldSystemFontOfSize:30]; |
| | | // _mothLabel .font = [UIFont fontWithName:@"Arial-BoldMT" size:30]; |
| | | // |
| | | // _mothLabel.textAlignment = NSTextAlignmentCenter; |
| | | // _mothLabel.text = @"---"; |
| | | // UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMinX(_mothLabel.frame), CGRectGetMaxY(_mothLabel.frame) + 10, _mothLabel.frame.size.width-20, 25)]; |
| | | // label.font = [UIFont systemFontOfSize:12]; |
| | | // if (KScreenW > 375) { |
| | | // label.font = [UIFont systemFontOfSize:15]; |
| | | // } |
| | | // label.textAlignment = NSTextAlignmentRight; |
| | | // label.text = @" æ¬æé¢ä¼°"; |
| | | // label.textColor = SJColor(98, 98, 98,1); |
| | | // [label sizeToFit]; |
| | | // [_teamView addSubview:label]; |
| | | // |
| | | // UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(label.frame)- 4, CGRectGetMinY(label.frame) - 5, 30, 22)]; |
| | | // image.image = [UIImage imageNamed:@"å½¢ç¶é®"]; |
| | | // [_teamView addSubview:image]; |
| | | // |
| | | // UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | // button.frame = CGRectMake(CGRectGetMinX(_mothLabel.frame), CGRectGetMinY(_mothLabel.frame), _mothLabel.frame.size.width, _mothLabel.frame.size.height + label.frame.size.height + 10); |
| | | // [button addTarget:self action:@selector(priTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | | // button.tag = 36; |
| | | // [_teamView addSubview:button]; |
| | | // return _mothLabel; |
| | | //} |
| | | //- (UIView *)taskView{ |
| | | // if (_taskView) { |
| | | // return _taskView; |
| | | // } |
| | | // _taskView = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.percentageView.frame) + 10, KScreenW, 400)]; |
| | | // _taskView.backgroundColor = [UIColor whiteColor]; |
| | | // [_taskView addSubview:self.taskTableview]; |
| | | // return _taskView; |
| | | //} |
| | | //- (UITableView *)taskTableview{ |
| | | // if (_taskTableview) { |
| | | // return _taskTableview; |
| | | // } |
| | | // _taskTableview = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, _taskView.frame.size.width, _taskView.frame.size.height) style:UITableViewStylePlain]; |
| | | // _taskTableview.delegate = self; |
| | | // _taskTableview.dataSource = self; |
| | | // _taskTableview.rowHeight = 120; |
| | | // _taskTableview.scrollEnabled = NO; |
| | | // [_taskTableview registerNib:[UINib nibWithNibName:@"MainInviteTableViewCell" bundle:nil] forCellReuseIdentifier:@"MainInviteTableViewCell"]; |
| | | // return _taskTableview; |
| | | //} |
| | | //- (UIView *)percentageView{ |
| | | // if (_percentageView) { |
| | | // return _percentageView; |
| | | // } |
| | | // UIView *backView = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.teamView.frame) , KScreenW , KScreenW / 0.89)]; |
| | | // backView.backgroundColor = SJColor(250, 222, 50, 1); |
| | | // [_scrollview addSubview:backView]; |
| | | // _percentageView = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.teamView.frame) + 10, KScreenW , backView .frame.size.height - 20)]; |
| | | // _teamView.layer.cornerRadius = 8; |
| | | // _teamView.layer.masksToBounds = YES; |
| | | // _percentageView.backgroundColor = [UIColor whiteColor]; |
| | | // UIImageView *imageview = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, _percentageView.frame.size.width, _percentageView.frame.size.height)]; |
| | | // imageview.image = [UIImage imageNamed:@"ä¼åææ"]; |
| | | // [_percentageView addSubview:imageview]; |
| | | // |
| | | // return _percentageView; |
| | | //} |
| | | // |
| | | //- (UIView *)listView { |
| | | // |
| | | // if (_listView) { |
| | | // return _listView; |
| | | // } |
| | | // _listView = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.percentageView.frame) + 10, KScreenW, 400)]; |
| | | // _listView.backgroundColor = [UIColor whiteColor]; |
| | | // [_listView addSubview:self.listTableview]; |
| | | // return _listView; |
| | | //} |
| | | // |
| | | - (UITableView *)tableView { |
| | | if (!_tableView) { |
| | | |
| | |
| | | if (IsiPhoneX) { |
| | | |
| | | height = -44; |
| | | |
| | | } else if (IS_IPHONE_5) { |
| | | |
| | | height = 0; |
| | | } |
| | | |
| | | CGRect rect; |
| | |
| | | style:UITableViewStyleGrouped]; |
| | | _tableView.delegate = self; |
| | | _tableView.dataSource = self; |
| | | _tableView.estimatedRowHeight = 0; |
| | | _tableView.estimatedSectionFooterHeight = 0; |
| | | _tableView.estimatedRowHeight = 40; |
| | | _tableView.estimatedSectionHeaderHeight = 0; |
| | | _tableView.estimatedSectionFooterHeight = 0; |
| | | _tableView.backgroundColor = XYRBackgroundColor; |
| | | _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; |
| | | _tableView.rowHeight = UITableViewAutomaticDimension; |
| | | |
| | | _tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ |
| | | |
| | | self.pageIndex = 1; |
| | | [self.viewModel.requestRemotetCommand execute:nil]; |
| | | }]; |
| | | } |
| | | |
| | | return _tableView; |
| | | } |
| | | // |
| | | //- (UIView *)ruleView { |
| | | // |
| | | // if (_ruleView) { |
| | | // return _ruleView; |
| | | // } |
| | | // |
| | | // _ruleView = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.listView.frame) + 10, KScreenW, 400)]; |
| | | // _ruleView.backgroundColor = [UIColor whiteColor]; |
| | | // UIView *lineView = [[UIView alloc]initWithFrame:CGRectMake(10, 10, 5, 35)]; |
| | | // lineView.backgroundColor = SJColor(220, 0, 90, 1); |
| | | // [_ruleView addSubview:lineView]; |
| | | // UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(lineView.frame) + 10, CGRectGetMinY(lineView.frame), KScreenW / 2, 35)]; |
| | | // label.font = [UIFont boldSystemFontOfSize:20]; |
| | | // label.textColor = SJColor(53, 53, 53, 1); |
| | | // label.text = @"æ´»å¨è§å"; |
| | | // [_ruleView addSubview:label]; |
| | | // |
| | | // _ruleLabel = [[UILabel alloc]initWithFrame:CGRectMake(20, CGRectGetMaxY(lineView.frame) + 20, KScreenW - 40, 330)]; |
| | | // |
| | | // _ruleLabel.font = [UIFont systemFontOfSize:14]; |
| | | // _ruleLabel.textColor = SJColor(136, 136, 136, 1); |
| | | // _ruleLabel.numberOfLines = 0; |
| | | // [_ruleView addSubview:_ruleLabel]; |
| | | // |
| | | // return _ruleView; |
| | | //} |
| | | //- (UIView *)loginView { |
| | | // |
| | | // if (_loginView) { |
| | | // return _loginView; |
| | | // } |
| | | // _loginView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KScreenW, KScreenH)]; |
| | | // _loginView.backgroundColor = [UIColor whiteColor]; |
| | | // _loginView.hidden = YES; |
| | | // UIButton *loginButton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | // loginButton.frame = CGRectMake(KScreenW / 2 - 40, KScreenH / 2 - 20, 80, 40); |
| | | // [loginButton setTitle:@"ç»å½" forState:UIControlStateNormal]; |
| | | // loginButton.layer.cornerRadius = loginButton.frame.size.height / 2; |
| | | // loginButton.layer.masksToBounds = YES; |
| | | // loginButton.backgroundColor = XYRMainColor; |
| | | // [loginButton addTarget:self action:@selector(loginTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | | // [_loginView addSubview:loginButton]; |
| | | // return _loginView; |
| | | //} |
| | | // |
| | | //- (UIView *)primtView { |
| | | // |
| | | // if (_primtView) { |
| | | // return _primtView; |
| | | // } |
| | | // _primtView = [[UIView alloc]initWithFrame:CGRectMake(30, KScreenH / 2 - 80, KScreenW - 60, 180)]; |
| | | // _primtView.backgroundColor = [UIColor whiteColor]; |
| | | // _primtView.layer.cornerRadius = 6; |
| | | // _primtView.layer.masksToBounds = YES; |
| | | // |
| | | // _primtTitle = [[UILabel alloc]initWithFrame:CGRectMake(0, 25, _primtView.frame.size.width, 20)]; |
| | | // _primtTitle.text = @"仿¥é¢ä¼°æ¶ç"; |
| | | // _primtTitle.textAlignment = NSTextAlignmentCenter; |
| | | // _primtTitle.font = [UIFont systemFontOfSize:18]; |
| | | // |
| | | // _primtContent = [[UILabel alloc]initWithFrame:CGRectMake(15, CGRectGetMaxY(self.primtTitle.frame) + 10, _primtView.frame.size.width - 30, 80)]; |
| | | // _primtContent.text = @""; |
| | | // _primtContent.numberOfLines = 0; |
| | | // _primtContent.textAlignment = NSTextAlignmentCenter; |
| | | // _primtContent.font = [UIFont systemFontOfSize:16]; |
| | | // _primtContent.textColor = SJColor(98, 98, 98, 1); |
| | | // |
| | | // [_primtView addSubview:self.primtTitle]; |
| | | // [_primtView addSubview:self.primtContent]; |
| | | // UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | // button.frame = CGRectMake(15, CGRectGetMaxY(_primtContent.frame), _primtView.frame.size.width - 30, 40); |
| | | // [button setTitle:@"ç¥éå¦" forState:UIControlStateNormal]; |
| | | // [button setTitleColor:XYRMainColor forState:UIControlStateNormal]; |
| | | // [self setBorderWithView:button top:YES left:NO bottom:NO right:NO borderColor:XYRBackgroundColor borderWidth:1]; |
| | | // [button addTarget:self action:@selector(primtTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | | // [_primtView addSubview:button]; |
| | | // return _primtView; |
| | | //} |
| | | //- (UILabel *)lastMonLabel { |
| | | // |
| | | // if (_lastMonLabel) { |
| | | // return _lastMonLabel; |
| | | // } |
| | | // UIView *lineview = [[UIView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.mothLabel.frame), 15, 1, _teamView.frame.size.height - 30)]; |
| | | // lineview.backgroundColor = XYRBackgroundColor; |
| | | // [_teamView addSubview:lineview]; |
| | | // |
| | | // _lastMonLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.mothLabel.frame) + 1, 10, self.mothLabel.frame.size.width, 30)]; |
| | | // _lastMonLabel.textColor = XYRMainColor; |
| | | // _lastMonLabel.font = [UIFont boldSystemFontOfSize:30]; |
| | | // _lastMonLabel .font = [UIFont fontWithName:@"Arial-BoldMT" size:30]; |
| | | // _lastMonLabel.textAlignment = NSTextAlignmentCenter; |
| | | // _lastMonLabel.text = @"---"; |
| | | // UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMinX(_lastMonLabel.frame), CGRectGetMaxY(_lastMonLabel.frame) + 10, _lastMonLabel.frame.size.width-20, 25)]; |
| | | // label.font = [UIFont systemFontOfSize:12]; |
| | | // if (KScreenW > 375) { |
| | | // label.font = [UIFont systemFontOfSize:15]; |
| | | // } |
| | | // label.textAlignment = NSTextAlignmentRight; |
| | | // label.text = @" 䏿æ¶å
¥"; |
| | | // label.textColor = SJColor(98, 98, 98,1); |
| | | // [label sizeToFit]; |
| | | // [_teamView addSubview:label]; |
| | | // |
| | | // UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(label.frame)- 4, CGRectGetMinY(label.frame) - 5, 30, 22)]; |
| | | // if (KScreenW < 375) { |
| | | // image.frame = CGRectMake(CGRectGetMaxX(label.frame) - 8, CGRectGetMinY(label.frame) - 5, 30, 22); |
| | | // } |
| | | // image.image = [UIImage imageNamed:@"å½¢ç¶é®"]; |
| | | // [_teamView addSubview:image]; |
| | | // |
| | | // UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | // button.frame = CGRectMake(CGRectGetMinX(_lastMonLabel.frame), CGRectGetMinY(_lastMonLabel.frame), _lastMonLabel.frame.size.width, _lastMonLabel.frame.size.height + label.frame.size.height + 10); |
| | | // [button addTarget:self action:@selector(priTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | | // button.tag = 37; |
| | | // [_teamView addSubview:button]; |
| | | // return _lastMonLabel; |
| | | //} |
| | | |
| | | - (UIView *)primtView { |
| | | |
| | | if (_primtView) { |
| | | return _primtView; |
| | | } |
| | | _primtView = [[UIView alloc]initWithFrame:CGRectMake(30, KScreenH / 2 - 80, KScreenW - 60, 180)]; |
| | | _primtView.backgroundColor = [UIColor whiteColor]; |
| | | _primtView.layer.cornerRadius = 6; |
| | | _primtView.layer.masksToBounds = YES; |
| | | |
| | | _primtTitle = [[UILabel alloc]initWithFrame:CGRectMake(0, 25, _primtView.frame.size.width, 20)]; |
| | | _primtTitle.text = @"仿¥é¢ä¼°æ¶ç"; |
| | | _primtTitle.textAlignment = NSTextAlignmentCenter; |
| | | _primtTitle.font = [UIFont systemFontOfSize:18]; |
| | | |
| | | _primtContent = [[UILabel alloc]initWithFrame:CGRectMake(15, CGRectGetMaxY(self.primtTitle.frame) + 10, _primtView.frame.size.width - 30, 80)]; |
| | | _primtContent.text = @""; |
| | | _primtContent.numberOfLines = 0; |
| | | _primtContent.textAlignment = NSTextAlignmentCenter; |
| | | _primtContent.font = [UIFont systemFontOfSize:16]; |
| | | _primtContent.textColor = SJColor(98, 98, 98, 1); |
| | | |
| | | [_primtView addSubview:self.primtTitle]; |
| | | [_primtView addSubview:self.primtContent]; |
| | | UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | button.frame = CGRectMake(15, CGRectGetMaxY(_primtContent.frame), _primtView.frame.size.width - 30, 40); |
| | | [button setTitle:@"ç¥éå¦" forState:UIControlStateNormal]; |
| | | [button setTitleColor:XYRMainColor forState:UIControlStateNormal]; |
| | | [self setBorderWithView:button top:YES left:NO bottom:NO right:NO borderColor:XYRBackgroundColor borderWidth:1]; |
| | | [button addTarget:self action:@selector(primtTaped:) forControlEvents:UIControlEventTouchUpInside]; |
| | | [_primtView addSubview:button]; |
| | | return _primtView; |
| | | } |
| | | |
| | | - (MainInviteViewModel *)viewModel { |
| | | |
| | | if (!_viewModel) { |
| | | _viewModel = [[MainInviteViewModel alloc] init]; |
| | | } |
| | | return _viewModel; |
| | | } |
| | | |
| | | - (void)didReceiveMemoryWarning { |
| | | [super didReceiveMemoryWarning]; |