JXWellBeingVc.m 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. //
  2. // JXWellBeingVc.m
  3. // shiku_im
  4. //
  5. // Created by 123 on 2020/5/29.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXWellBeingVc.h"
  9. #import "JXWellBeingCell.h"
  10. #import "JXApplyViewController.h"
  11. #import "JXGoldenManagerViewController.h"
  12. #import "JXRedPackageViewController.h"
  13. #import "JXProcuratorViewController.h"
  14. #import "SGAnimation.h"
  15. #import "UUMarqueeView.h"
  16. #import "JXJiuHelpMoneyVc.h"
  17. #import "JXEveryDayVc.h"
  18. #import "JXGoldMangVc.h"
  19. @interface JXWellBeingVc ()<UITableViewDelegate,UITableViewDataSource,UUMarqueeViewDelegate>
  20. @property (nonatomic,strong) UIView *navigationView;
  21. @property (nonatomic,weak) UITableView *tableView;
  22. @property (nonatomic,strong) NSMutableArray *dataArr;
  23. @property (nonatomic,strong) UUMarqueeView *leftwardMarqueeView;
  24. @end
  25. @implementation JXWellBeingVc
  26. - (void)viewWillAppear:(BOOL)animated{
  27. [super viewWillAppear:animated];
  28. [self.navigationController setNavigationBarHidden:YES animated:NO];
  29. // if (_leftwardMarqueeView) {
  30. // [_leftwardMarqueeView start];
  31. // }
  32. }
  33. - (void)viewWillDisappear:(BOOL)animated{
  34. [super viewWillDisappear:animated];
  35. [self.navigationController setNavigationBarHidden:NO animated:NO];
  36. }
  37. - (void)viewDidLoad {
  38. [super viewDidLoad];
  39. //self.view.backgroundColor=kRGBColor246;
  40. [self initNavigationView];
  41. [self setupHorseRaceLampView];
  42. [self initTalbelView];
  43. [g_server getUser:g_server.myself.userId toView:self];
  44. }
  45. - (void)setupHorseRaceLampView {
  46. UIView *HRLView = [[UIView alloc] init];
  47. HRLView.frame = CGRectMake(5,CGRectGetMaxY(self.navigationView.frame), self.view.frame.size.width-10, 32);
  48. [self.view addSubview:HRLView];
  49. UIButton *leftIMG = [[UIButton alloc] init];
  50. leftIMG.contentMode=UIViewContentModeScaleAspectFit;
  51. [leftIMG setImage:[UIImage imageNamed:@"horn_icon"] forState:UIControlStateNormal];
  52. [leftIMG setTitle:@" 最新公告: " forState:UIControlStateNormal];
  53. [leftIMG setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  54. leftIMG.titleLabel.font=[UIFont systemFontOfSize:13 weight:UIFontWeightRegular];
  55. leftIMG.frame = CGRectMake(5,6, 100, 20);
  56. [HRLView addSubview:leftIMG];
  57. _leftwardMarqueeView = [[UUMarqueeView alloc] initWithFrame:CGRectMake(110, 0, JX_SCREEN_WIDTH - 40.0f, 32) direction:UUMarqueeViewDirectionLeftward];
  58. _leftwardMarqueeView.delegate = self;
  59. _leftwardMarqueeView.timeIntervalPerScroll = 0.0f;
  60. _leftwardMarqueeView.direction=UUMarqueeViewDirectionLeftward;
  61. _leftwardMarqueeView.scrollSpeed = 60.0f;
  62. _leftwardMarqueeView.itemSpacing = 20.0f;
  63. [HRLView addSubview:_leftwardMarqueeView];
  64. [_leftwardMarqueeView reloadData];
  65. /*
  66. SGHorseRaceLampView *HRLView = [[SGHorseRaceLampView alloc] init];
  67. HRLView.frame = CGRectMake(5,CGRectGetMaxY(self.navigationView.frame), self.view.frame.size.width-10, 32);
  68. HRLView.titleColor=kRGBColor(187,35,32);
  69. HRLView.backgroundColor = [UIColor whiteColor];
  70. HRLView.layer.cornerRadius=12;
  71. HRLView.layer.masksToBounds=YES;
  72. HRLView.titleFont = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium];
  73. HRLView.title = @"最新公告: 会员jl***23 首存100000 获得彩金1800; 会员jl***23 首存100000 获得彩金1800";
  74. HRLView.imageNage = @"horn_icon";
  75. [self.view addSubview:HRLView];
  76. HRLView.selectedBlock = ^{
  77. NSLog(@"被点击了");
  78. };
  79. */
  80. }
  81. /**
  82. * 滚动字幕代理
  83. */
  84. - (NSUInteger)numberOfVisibleItemsForMarqueeView:(UUMarqueeView*)marqueeView {
  85. return 1;
  86. }
  87. - (NSUInteger)numberOfDataForMarqueeView:(UUMarqueeView*)marqueeView {
  88. return 1;
  89. }
  90. - (void)createItemView:(UIView*)itemView forMarqueeView:(UUMarqueeView*)marqueeView {
  91. // for upwardMultiMarqueeView
  92. //WithFrame:CGRectMake(15, 5.0f,(JX_SCREEN_WIDTH-30)/2 , 16.0f)
  93. UILabel *content = [[UILabel alloc] init];
  94. content.font = [UIFont systemFontOfSize:15 weight:UIFontWeightRegular];
  95. content.textColor=kRGBColor(187,35,32);
  96. content.tag = 1002;
  97. [itemView addSubview:content];
  98. content.frame=CGRectMake(0, 0,JX_SCREEN_WIDTH-60, 32);
  99. }
  100. - (void)updateItemView:(UIView*)itemView atIndex:(NSUInteger)index forMarqueeView:(UUMarqueeView*)marqueeView {
  101. UILabel *time = [itemView viewWithTag:1002];
  102. time.text = [NSString stringWithFormat:@"%@",@"会员jl***23 首存100000 获得彩金1800; 会员jl***23 首存100000 获得彩金1800 ..."];
  103. }
  104. /**导航栏*/
  105. -(void)initNavigationView
  106. {
  107. self.navigationView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, JX_SCREEN_WIDTH, JX_SCREEN_HEIGHT>=812?44:44)];
  108. self.navigationView.backgroundColor = [UIColor whiteColor];
  109. [self.view addSubview:self.navigationView];
  110. UILabel * titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 2, JX_SCREEN_WIDTH, 40)];
  111. titleLabel.text = @"优惠活动";
  112. titleLabel.textColor = [UIColor blackColor];
  113. titleLabel.font = [UIFont systemFontOfSize:18.0f];
  114. titleLabel.textAlignment = NSTextAlignmentCenter;
  115. [self.navigationView addSubview:titleLabel];
  116. }
  117. -(void)initTalbelView
  118. {
  119. NSArray *titles=@[@{@"icon":@"mei日renwu",@"title":@"每日任务"},@{@"icon":@"wzguilai",@"title":@"王者归来"},@{@"icon":@"hysc",@"title":@"会员首存"}, @{@"icon":@"jljgj",@"title":@"吉利金管家"},@{@"icon":@"shen请daili",@"title":@"申请代理"},
  120. @{@"icon":@"qwhby",@"title":@"千万红包"}];
  121. _dataArr=[NSMutableArray array];
  122. [_dataArr addObjectsFromArray:titles];
  123. UITableView *tableView = [[UITableView alloc]init];
  124. tableView.delegate=self;
  125. tableView.dataSource=self;
  126. tableView.separatorStyle=UITableViewCellSeparatorStyleNone;
  127. [self.view addSubview:tableView];
  128. self.tableView=tableView;
  129. [tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  130. make.top.mas_equalTo(75);
  131. make.left.mas_equalTo(0);
  132. make.right.mas_equalTo(0);
  133. make.bottom.mas_equalTo(0);
  134. }];
  135. tableView.contentInset=UIEdgeInsetsMake(0, 0, 20, 0);
  136. }
  137. -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  138. return 160;
  139. }
  140. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  141. return _dataArr.count;
  142. }
  143. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  144. JXWellBeingCell *cell=[JXWellBeingCell cellWithTableView:tableView];
  145. NSDictionary *iconName= _dataArr[indexPath.row];
  146. cell.strURL=iconName[@"icon"];
  147. return cell;
  148. }
  149. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  150. NSDictionary *iconName= _dataArr[indexPath.row];
  151. NSString *titleStr =iconName[@"title"];
  152. NSArray *titles=@[@{@"icon":@"shen请daili",@"title":@"申请代理"},@{@"icon":@"wzguilai",@"title":@"王者归来"},@{@"icon":@"mei日renwu",@"title":@"每日任务"},@{@"icon":@"hysc",@"title":@"会员首存"},
  153. @{@"icon":@"jljgj",@"title":@"吉利金管家"},@{@"icon":@"qwhby",@"title":@"千万红包"}];
  154. if ([titleStr isEqualToString:@"每日任务"] ) {
  155. JXEveryDayVc *vcXX=[JXEveryDayVc new];
  156. vcXX.strIMG=@"meirrwu";
  157. vcXX.titleName=@"每日任务";
  158. vcXX.imgStr=@"每日任务";
  159. [g_navigation pushViewController:vcXX animated:YES];
  160. }else if([titleStr isEqualToString:@"申请代理"]){
  161. JXEveryDayVc *vcXX=[JXEveryDayVc new];
  162. vcXX.strIMG=@"shenqdaili";
  163. vcXX.titleName=@"申请代理";
  164. vcXX.imgStr=@"最强代理";
  165. [g_navigation pushViewController:vcXX animated:YES];
  166. }else if([titleStr isEqualToString:@"千万红包"]){
  167. JXEveryDayVc *vcXX=[JXEveryDayVc new];
  168. vcXX.strIMG=@"huiyuansc";
  169. vcXX.imgStr=@"首存彩金";
  170. vcXX.titleName=@"无忧贷款";
  171. [g_navigation pushViewController:vcXX animated:YES];
  172. }else if([titleStr isEqualToString:@"吉利金管家"]){
  173. JXEveryDayVc *vcXX=[JXEveryDayVc new];
  174. vcXX.titleName=@"吉利金管家";
  175. vcXX.strIMG=@"jljgj-1";
  176. //vcXX.imgStr=@"金管家";
  177. vcXX.imgStr=@"金管家";
  178. [g_navigation pushViewController:vcXX animated:YES];
  179. }else if([titleStr isEqualToString:@"王者归来"]){
  180. JXEveryDayVc *vcXX=[JXEveryDayVc new];
  181. vcXX.strIMG=@"jljyj";
  182. vcXX.imgStr=@"转运金";
  183. vcXX.titleName=@"转运金";
  184. [g_navigation pushViewController:vcXX animated:YES];
  185. }else if([titleStr isEqualToString:@"会员首存"]){
  186. JXEveryDayVc *vcXX=[JXEveryDayVc new];
  187. vcXX.strIMG=@"qwhongbaoy";
  188. vcXX.titleName=@"免费抽大奖";
  189. vcXX.imgStr=@"存款抽奖";
  190. [g_navigation pushViewController:vcXX animated:YES];
  191. }
  192. }
  193. //服务端返回数据
  194. -(void) didServerResultSucces:(JXConnection*)aDownload dict:(NSDictionary*)dict array:(NSArray*)array1{
  195. //[_wait hide];
  196. // _videoDict=dict;
  197. if( [aDownload.action isEqualToString:act_UserGet] ){
  198. }
  199. }
  200. @end