YOUPAIBigCastSettingVC.m 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. //
  2. // YOUPAIBigCastSettingVC.m
  3. // MSYOUPAI
  4. //
  5. // Created by CY on 2022/3/9.
  6. // Copyright © 2022 MS. All rights reserved.
  7. //
  8. #import "YOUPAIBigCastSettingVC.h"
  9. #import "YOUPAIBigCastSettingCell.h"
  10. #import "YOUPAILZBigCastChargeSettingVC.h"
  11. #import "YOUPAIMessafeTemplateListVC.h"
  12. #import "YOUPAIFateWindow.h"
  13. #import "UIViewController+TFPresent.h"
  14. @interface YOUPAIBigCastSettingVC () <UITableViewDelegate,UITableViewDataSource>
  15. @property (nonatomic, weak)UITableView *youpaiptableView;
  16. @property (nonatomic, strong)NSArray *youpaipdataSource;
  17. @property (nonatomic, strong) NSString *youpaipanchorDividedinfo;
  18. @end
  19. @implementation YOUPAIBigCastSettingVC
  20. - (void)viewDidLoad {
  21. [super viewDidLoad];
  22. self.view.backgroundColor = [UIColor whiteColor];
  23. self.title = @"女神设置";
  24. [self youpaifinitUI];
  25. [self youpaifinitData];
  26. [self youpaifloadAnchorDividedinfo];
  27. }
  28. - (void)youpaifinitUI{
  29. UITableView *tableView = [[UITableView alloc]initWithFrame:CGRectMake(0,NavBarHeight, KScreenWidth, KScreenHeight-NavBarHeight) style:UITableViewStyleGrouped];
  30. tableView.showsVerticalScrollIndicator = NO;
  31. tableView.rowHeight = 70.0f;
  32. tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  33. tableView.backgroundColor = [UIColor whiteColor];
  34. tableView.estimatedSectionHeaderHeight = 0;
  35. tableView.estimatedSectionFooterHeight = 0;
  36. tableView.dataSource = self;
  37. tableView.delegate = self;
  38. [self.view addSubview:tableView];
  39. self.youpaiptableView = tableView;
  40. }
  41. - (void)youpaifloadAnchorDividedinfo{
  42. @weakify(self);
  43. [LCHttpHelper requestWithURLString:UserCenter parameters:nil needToken:YES type:(HttpRequestTypePost) success:^(id responseObject) {
  44. @strongify(self);
  45. NSDictionary* dict = (NSDictionary*)responseObject;
  46. NSInteger code = [[dict objectForKey:@"code"] integerValue];
  47. if (code==0) {//成功
  48. if ([[[dict objectForKey:@"data"] allKeys] containsObject:@"webUrl"]) {
  49. self.youpaipanchorDividedinfo = [NSString stringWithFormat:@"%@",[[[dict objectForKey:@"data"]objectForKey:@"webUrl"] objectForKey:@"anchorDividedinfo"]];
  50. }
  51. }
  52. } failure:^(NSError *error) {
  53. }];
  54. }
  55. - (void)youpaifinitData{
  56. NSMutableArray *dataSource = [NSMutableArray array];
  57. [dataSource addObject:@{
  58. @"type":@"charge_setting",
  59. @"image":[UIImage imageNamed:@"vqu_images_bigcast_charge_setting"],
  60. @"title":@"收费设置",
  61. }];
  62. [dataSource addObject:@{
  63. @"type":@"sayhi_setting",
  64. @"image":[UIImage imageNamed:@"vqu_images_bigcast_sayhi_setting"],
  65. @"title":@"打招呼设置",
  66. }];
  67. [dataSource addObject:@{
  68. @"type":@"fate_setting",
  69. @"image":[UIImage imageNamed:@"vqu_images_bigcast_fate_setting"],
  70. @"title":@"缘分牵线说明",
  71. }];
  72. // [dataSource addObject:@{
  73. // @"type":@"divide_detail",
  74. // @"image":[UIImage imageNamed:@"vqu_images_bigcast_divide_detail"],
  75. // @"title":@"分成详情",
  76. // }];
  77. self.youpaipdataSource = dataSource.copy;
  78. [self.youpaiptableView reloadData];
  79. }
  80. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  81. return self.youpaipdataSource.count;
  82. }
  83. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  84. NSDictionary *cellData = self.youpaipdataSource[indexPath.row];
  85. NSString *cellID = @"YOUPAIBigCastSettingCell";
  86. YOUPAIBigCastSettingCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
  87. if (cell == nil) {
  88. cell = [[YOUPAIBigCastSettingCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
  89. }
  90. cell.youpaipimgV.image = [cellData valueForKey:@"image"];
  91. cell.youpaiptitleL.text = [cellData valueForKey:@"title"];
  92. return cell;
  93. }
  94. - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
  95. return CGFLOAT_MIN;
  96. }
  97. - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
  98. return CGFLOAT_MIN;
  99. }
  100. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  101. NSDictionary *cellData = self.youpaipdataSource[indexPath.row];
  102. if ([[cellData valueForKey:@"type"] isEqual:@"charge_setting"]) {
  103. YOUPAILZBigCastChargeSettingVC *vc = [[YOUPAILZBigCastChargeSettingVC alloc] init];
  104. [self.navigationController pushViewController:vc animated:YES];
  105. }else if ([[cellData valueForKey:@"type"] isEqual:@"sayhi_setting"]) {
  106. YOUPAIMessafeTemplateListVC *vc = [YOUPAIMessafeTemplateListVC new];
  107. [self.navigationController pushViewController:vc animated:YES];
  108. }else if ([[cellData valueForKey:@"type"] isEqual:@"divide_detail"]) {
  109. ZCBaseWebVC * vc = [[ZCBaseWebVC alloc]init];
  110. vc.contentUrl = self.youpaipanchorDividedinfo;
  111. [self.navigationController pushViewController:vc animated:YES];
  112. }else if ([[cellData valueForKey:@"type"] isEqual:@"fate_setting"]) {
  113. YOUPAIFateWindow *vc = [[YOUPAIFateWindow alloc]init];
  114. vc.isTouchDismiss = NO;
  115. [self TFPresentVC:vc completion:^{
  116. }];
  117. }
  118. }
  119. @end