JXEveryDayVc.m 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. //
  2. // JXEveryDayVc.m
  3. // shiku_im
  4. //
  5. // Created by 123 on 2020/6/10.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXEveryDayVc.h"
  9. #import "JXApplyViewController.h"
  10. #import "JXApplyTableViewCell.h"
  11. #import "JXExamViewController.h"
  12. #import "JXSignViewController.h"
  13. #import "JXQuestionnVc.h"
  14. #import "JXShowDayFulLiVc.h"
  15. #import "JXBigReelVc.h"
  16. #import "JXTFuLiCell.h"
  17. #import "JXRelayVC.h"
  18. #import "JXActiveDetailVc.h"
  19. #import "UUMarqueeView.h"
  20. #import "JXActiveDetial2Vc.h"
  21. #import "JXGoldenManagerViewController.h"
  22. #import "JXJiuHelpMoneyVc.h"
  23. #import "JXRedPackageViewController.h"
  24. #import "JXProcuratorViewController.h"
  25. #import "JXNewPackRainVc.h"
  26. #import "JXBigReelVc.h"
  27. #import "JXGoldMangVc.h"
  28. #import "JXLuckRescueFundVc.h"
  29. #import "JXGoldMangerVc.h"
  30. @interface JXEveryDayVc ()
  31. @end
  32. @implementation JXEveryDayVc
  33. - (void)viewDidLoad {
  34. [super viewDidLoad];
  35. self.view.backgroundColor=[UIColor whiteColor];
  36. [self defineNavBar:_titleName andRinghtBtnImg:@""];
  37. _dataDict=[NSDictionary dictionary];
  38. UIScrollView *imageScrollView =[[UIScrollView alloc]init];
  39. if (@available(iOS 11.0, *)) {
  40. imageScrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
  41. } else {
  42. // Fallback on earlier versions
  43. }
  44. imageScrollView.backgroundColor=kRGBColor(232, 230, 231);
  45. [self.view addSubview:imageScrollView];
  46. [imageScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
  47. make.top.mas_equalTo(JX_SCREEN_TOP);
  48. make.left.mas_equalTo(0);
  49. make.right.mas_equalTo(0);
  50. make.bottom.mas_equalTo(-JX_SCREEN_BOTTOM);
  51. }];
  52. UIImageView *imageBackV=[[UIImageView alloc]initWithImage:[UIImage imageNamed:_strIMG]];
  53. imageBackV.userInteractionEnabled=YES;
  54. imageBackV.contentMode=UIViewContentModeScaleAspectFill;
  55. [imageScrollView addSubview:imageBackV];
  56. CGFloat imageYW = CGImageGetWidth(imageBackV.image.CGImage);
  57. // iamgeView的H = imageView的宽 / (原始图片的宽 / 原始图片的高)---根据宽高比得出imageView的宽
  58. CGFloat imageH = JX_SCREEN_WIDTH / (imageYW / CGImageGetHeight(imageBackV.image.CGImage));
  59. imageBackV.frame = CGRectMake(10, 0, JX_SCREEN_WIDTH-20, imageH);
  60. UIImageView *imageBackVBt=[[UIImageView alloc]initWithImage:[UIImage imageNamed:_imgStr]];
  61. imageBackVBt.userInteractionEnabled=YES;
  62. imageBackVBt.contentMode=UIViewContentModeScaleAspectFill;
  63. [imageScrollView addSubview:imageBackVBt];
  64. CGFloat imageYWBt = CGImageGetWidth(imageBackVBt.image.CGImage);
  65. // iamgeView的H = imageView的宽 / (原始图片的宽 / 原始图片的高)---根据宽高比得出imageView的宽
  66. CGFloat imageHBt = JX_SCREEN_WIDTH / (imageYWBt / CGImageGetHeight(imageBackVBt.image.CGImage));
  67. imageBackVBt.frame = CGRectMake(0,CGRectGetMaxY(imageBackV.frame)+20, JX_SCREEN_WIDTH, imageHBt);
  68. imageScrollView.contentSize=CGSizeMake(0, CGRectGetMaxY(imageBackVBt.frame)+44);
  69. // UIButton *lefImg= [[UIButton alloc]initWithFrame:CGRectMake(15,JX_SCREEN_HEIGHT-42-10, 140, 42)];
  70. // lefImg.layer.cornerRadius = 12;
  71. // lefImg.backgroundColor = [UIColor whiteColor];
  72. // [lefImg setTitleColor:kRGBColor(91, 19, 19) forState:UIControlStateNormal];
  73. // [lefImg setTitle:@"活动详情" forState:UIControlStateNormal];
  74. // [lefImg setBackgroundImage:[UIImage imageNamed:@"huodongxq"] forState:UIControlStateNormal];
  75. //
  76. // lefImg.tag=0;
  77. // [self.view addSubview:lefImg];
  78. // [lefImg addTarget:self action:@selector(lefIMGClick:) forControlEvents:UIControlEventTouchUpInside];
  79. UIView *rightView= [[UIView alloc]initWithFrame:CGRectMake(0, JX_SCREEN_HEIGHT-JX_SCREEN_TOP, JX_SCREEN_WIDTH, JX_SCREEN_TOP)];
  80. [self.view addSubview:rightView];
  81. // UIButton *rightImg= [[UIButton alloc]initWithFrame:CGRectMake(JX_SCREEN_WIDTH/2-60, 0 , 120, JX_SCREEN_BOTTOM)];
  82. UIButton *rightImg= [[UIButton alloc]initWithFrame:CGRectMake(0, 0 , JX_SCREEN_WIDTH, JX_SCREEN_TOP)];
  83. rightImg.tag=1;
  84. rightImg.layer.cornerRadius = 12;
  85. rightImg.backgroundColor = [UIColor whiteColor];
  86. rightImg.titleLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
  87. [rightImg setTitle:@"我要参与" forState:UIControlStateNormal];
  88. [rightImg setTitleColor:kRGBColor(91, 19, 19) forState:UIControlStateNormal];
  89. [rightImg setBackgroundImage:[UIImage imageNamed:@"huodongxq"] forState:UIControlStateNormal];
  90. [rightView addSubview:rightImg];
  91. [rightImg addTarget:self action:@selector(lefIMGClick:) forControlEvents:UIControlEventTouchUpInside];
  92. }
  93. -(void)lefIMGClick:(UIButton *)sender{ //吉利救援金
  94. if (sender.tag==0) {
  95. JXActiveDetail2Vc *vc=[JXActiveDetail2Vc new];
  96. vc.strIMG=_imgStr;
  97. [g_navigation pushViewController:vc animated:YES];
  98. }else{
  99. if ([_strIMG isEqualToString:@"meirrwu"]) {
  100. JXApplyViewController *vc=[JXApplyViewController new];
  101. [g_navigation pushViewController:vc animated:YES];
  102. }else if([_strIMG isEqualToString:@"jljgj-1"]){
  103. //JXGoldMangerVc JXGoldMangVc
  104. JXGoldMangerVc *vc=[JXGoldMangerVc new];
  105. [g_navigation pushViewController:vc animated:YES];
  106. }else if([_strIMG isEqualToString:@"jljyj"]){
  107. JXLuckRescueFundVc *vc=[JXLuckRescueFundVc new];
  108. [g_navigation pushViewController:vc animated:YES];
  109. }else if([_strIMG isEqualToString:@"qwhongbaoy"]){
  110. JXBigReelVc *vc=[JXBigReelVc new];
  111. vc.pushWheel=@"1";
  112. [g_navigation pushViewController:vc animated:YES];
  113. }else if([_strIMG isEqualToString:@"shenqdaili"]){
  114. // JXProcuratorViewController *vc=[JXProcuratorViewController new];
  115. // [g_navigation pushViewController:vc animated:YES];
  116. _deleageStr=11;
  117. [g_server getUser:g_server.myself.userId toView:self];
  118. }else if([_strIMG isEqualToString:@"huiyuansc"]){
  119. [g_server getUser:g_server.myself.userId toView:self];
  120. }
  121. }
  122. }
  123. //服务端返回数据
  124. -(void) didServerResultSucces:(JXConnection*)aDownload dict:(NSDictionary*)dict array:(NSArray*)array1{
  125. if( [aDownload.action isEqualToString:act_UserGet] ){
  126. _dataDict=dict[@"vipInfo"][@"current"];
  127. NSString *kefuID=@"";
  128. if (_deleageStr==11) {
  129. kefuID= _dataDict[@"proxyService"];
  130. if (kefuID.length==0||kefuID==nil) {
  131. [SVProgressHUD showWithStatus:@"暂无参与"];
  132. [SVProgressHUD dismissWithDelay:1.5];
  133. return;
  134. }
  135. JXChatViewC *vc = [[JXChatViewC alloc] init]; //10000656 10000
  136. JXUserObject *user = [[JXUserObject sharedInstance] getUserById:kefuID];
  137. vc.chatPerson = user;
  138. vc.customerPush=@"代理客服";
  139. [g_navigation pushViewController:vc animated:YES];
  140. }else{
  141. kefuID= _dataDict[@"loanService"];
  142. if (kefuID.length==0||kefuID==nil) {
  143. [SVProgressHUD showWithStatus:@"暂无参与"];
  144. [SVProgressHUD dismissWithDelay:1.5];
  145. return;
  146. }
  147. JXChatViewC *vc = [[JXChatViewC alloc] init]; //10000656 10000
  148. JXUserObject *user = [[JXUserObject sharedInstance] getUserById:kefuID];
  149. vc.chatPerson = user;
  150. vc.customerPush=@"无忧贷款";
  151. [g_navigation pushViewController:vc animated:YES];
  152. }
  153. }
  154. }
  155. -(int) didServerResultFailed:(JXConnection*)aDownload dict:(NSDictionary*)dict{
  156. if( [aDownload.action isEqualToString:act_UserGet] ){
  157. }
  158. return hide_error;
  159. }
  160. -(int) didServerConnectError:(JXConnection*)aDownload error:(NSError *)error{//error为空时,代表超时
  161. // [_wait hide]; return 0;
  162. if( [aDownload.action isEqualToString:act_UserGet] ){
  163. }
  164. }
  165. @end