JXAboutVC.m 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. //
  2. // JXAboutVC.m
  3. // shiku_im
  4. //
  5. // Created by flyeagleTang on 14-6-10.
  6. // Copyright (c) 2014年 Reese. All rights reserved.
  7. //
  8. #import "JXAboutVC.h"
  9. #import "JXShareListVC.h"
  10. #import "JXShareManager.h"
  11. #define HEIGHT 44
  12. #define STARTTIME_TAG 1
  13. @interface JXAboutVC ()<ShareListDelegate,JXActionSheetVCDelegate>
  14. @end
  15. @implementation JXAboutVC
  16. - (id)init
  17. {
  18. self = [super init];
  19. if (self) {
  20. self.isGotoBack = YES;
  21. self.title = Localized(@"JXAboutVC_AboutUS");
  22. self.heightFooter = 0;
  23. self.heightHeader = JX_SCREEN_TOP;
  24. //self.view.frame = CGRectMake(0, 0, JX_SCREEN_WIDTH, JX_SCREEN_HEIGHT);
  25. [self createHeadAndFoot];
  26. // self.tableBody.backgroundColor = HEXCOLOR(0xf0eff4);
  27. self.tableBody.scrollEnabled = YES;
  28. // int h = 0;
  29. if (THE_APP_OUR) {
  30. //右侧分享按钮
  31. UIButton *shareBtn = [[UIButton alloc] initWithFrame:CGRectMake(self_width-31-8, JX_SCREEN_TOP - 38, 31, 31)];
  32. [shareBtn setImage:[UIImage imageNamed:@"ic_share_black"] forState:UIControlStateNormal];
  33. [shareBtn addTarget:self action:@selector(shareBtnClick:) forControlEvents:UIControlEventTouchUpInside];
  34. [self.tableHeader addSubview:shareBtn];
  35. }
  36. JXImageView* iv;
  37. iv = [[JXImageView alloc]initWithFrame:CGRectMake((JX_SCREEN_WIDTH-67)/2, JX_SCREEN_TOP+40, 67, 67)];
  38. iv.image = [UIImage imageNamed:@"ALOGO_120"];
  39. [self.tableBody addSubview:iv];
  40. UILabel* p = [self createLabel:self.tableBody default:[NSString stringWithFormat:@"%@ %@",APP_NAME,g_config.version]];
  41. p.frame = CGRectMake(0, CGRectGetMaxY(iv.frame)+27, JX_SCREEN_WIDTH, 20);
  42. p.textAlignment = NSTextAlignmentCenter;
  43. p.textColor = HEXCOLOR(0x333333);
  44. p.font = g_factory.font14;
  45. if (THE_APP_OUR) {
  46. p = [self createLabel:self.view default:g_App.config.companyName];
  47. p.frame = CGRectMake(0, JX_SCREEN_HEIGHT-110, JX_SCREEN_WIDTH, 13);
  48. p.font = g_factory.font13;
  49. p.textColor = HEXCOLOR(0x333333);
  50. p.textAlignment = NSTextAlignmentCenter;
  51. p = [self createLabel:self.view default:g_App.config.copyright];
  52. p.frame = CGRectMake(0, JX_SCREEN_HEIGHT-88, JX_SCREEN_WIDTH, 15);
  53. p.font = g_factory.font14;
  54. p.textColor = HEXCOLOR(0x333333);
  55. p.textAlignment = NSTextAlignmentCenter;
  56. }
  57. UIButton* _btn;
  58. _btn = [UIFactory createCommonButton:Localized(@"JXAboutVC_Good") target:self action:@selector(onGood)];
  59. _btn.frame = CGRectMake(15, iv.frame.origin.y+iv.frame.size.height+20 + 20 + 20, JX_SCREEN_WIDTH-30, 40);
  60. [_btn.titleLabel setFont:SYSFONT(16)];
  61. _btn.layer.masksToBounds = YES;
  62. _btn.layer.cornerRadius = 7.f;
  63. [self.tableBody addSubview:_btn];
  64. }
  65. return self;
  66. }
  67. -(void)dealloc{
  68. // NSLog(@"JXAboutVC.dealloc");
  69. // [super dealloc];
  70. }
  71. - (void)viewDidLoad
  72. {
  73. [super viewDidLoad];
  74. // Do any additional setup after loading the view.
  75. }
  76. - (void)didReceiveMemoryWarning
  77. {
  78. [super didReceiveMemoryWarning];
  79. // Dispose of any resources that can be recreated.
  80. }
  81. -(UILabel*)createLabel:(UIView*)parent default:(NSString*)s{
  82. UILabel* p = [[UILabel alloc] initWithFrame:CGRectMake(JX_SCREEN_WIDTH/2,INSETS,JX_SCREEN_WIDTH/2 -20,HEIGHT-INSETS*2)];
  83. p.userInteractionEnabled = NO;
  84. p.text = s;
  85. p.font = g_factory.font13;
  86. p.textAlignment = NSTextAlignmentRight;
  87. [parent addSubview:p];
  88. // [p release];
  89. return p;
  90. }
  91. -(void)onGood{
  92. if (g_App.config.appleId.length > 0) {
  93. NSString *str = [NSString stringWithFormat:@"http://itunes.apple.com/us/app/id%@",g_App.config.appleId];
  94. [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
  95. }
  96. }
  97. //分享按钮点击事件
  98. - (void)shareBtnClick:(UIButton *)shareBtn{
  99. // JXShareListVC *shareListVC = [[JXShareListVC alloc] init];
  100. // shareListVC.shareListDelegate = self;
  101. // [self.view addSubview:shareListVC.view];
  102. JXActionSheetVC *actionVC = [[JXActionSheetVC alloc] initWithImages:@[@"circle_of_friends_icon",@"wechat_icon_square"] names:@[@"分享到朋友圈",@"分享给微信好友"]];
  103. actionVC.delegate = self;
  104. [self presentViewController:actionVC animated:NO completion:nil];
  105. }
  106. - (void)actionSheet:(JXActionSheetVC *)actionSheet didButtonWithIndex:(NSInteger)index {
  107. if (index == 0) {
  108. [self shareToIndex:1];
  109. }else if (index == 1) {
  110. [self shareToIndex:0];
  111. }
  112. }
  113. - (void)shareToIndex:(NSInteger)index {
  114. JXShareModel *shareModel = [[JXShareModel alloc] init];
  115. shareModel.shareTo = index;
  116. //分享标题
  117. shareModel.shareTitle = APP_NAME;
  118. //分享内容
  119. shareModel.shareContent = @"微信?快手?ZOOM?\n轻轻松松实现它!";
  120. // //分享链接
  121. // shareModel.shareUrl = [NSString stringWithFormat:@"%@%@?userId=%lld&language=%@",g_config.shareUrl,act_ShareBoss,[[_dataDict objectForKey:@"userId"] longLongValue],[JXMyTools getCurrentSysLanguage]];
  122. //分享链接
  123. shareModel.shareUrl = g_config.website;
  124. //分享头像
  125. // shareModel.shareImageUrl = url;
  126. shareModel.shareImage = [UIImage imageNamed:@"ALOGO_120"];
  127. [[JXShareManager defaultManager] shareWith:shareModel delegate:self];
  128. }
  129. #pragma mark JXShareSelectView delegate
  130. //- (void)didShareBtnClick:(UIButton *)shareBtn{
  131. // // NSString *userId = [NSString stringWithFormat:@"%lld",[[_dataDict objectForKey:@"userId"] longLongValue]-1];
  132. //// NSString *userId = [NSString stringWithFormat:@"%lld",[[_dataDict objectForKey:@"userId"] longLongValue]];
  133. //
  134. // JXShareModel *shareModel = [[JXShareModel alloc] init];
  135. // shareModel.shareTo = shareBtn.tag;
  136. // //分享标题
  137. // shareModel.shareTitle = APP_NAME;
  138. //
  139. // //分享内容
  140. // shareModel.shareContent = @"微信?快手?ZOOM?\n轻轻松松实现它!";
  141. // // //分享链接
  142. // // shareModel.shareUrl = [NSString stringWithFormat:@"%@%@?userId=%lld&language=%@",g_config.shareUrl,act_ShareBoss,[[_dataDict objectForKey:@"userId"] longLongValue],[JXMyTools getCurrentSysLanguage]];
  143. // //分享链接
  144. // shareModel.shareUrl = g_config.website;
  145. //
  146. // //分享头像
  147. //
  148. //// shareModel.shareImageUrl = url;
  149. // shareModel.shareImage = [UIImage imageNamed:@"ALOGO_120"];
  150. // [[JXShareManager defaultManager] shareWith:shareModel delegate:self];
  151. //
  152. //}
  153. @end