SPSBAboutViewController.m 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. //
  2. // SPSBAboutViewController.m
  3. // 我的社保
  4. //
  5. // Created by shanp on 2021/5/13.
  6. //
  7. #import "SPSBAboutViewController.h"
  8. #import "SPSBUIGeneralHeader.h"
  9. #import "SPSBExplainViewController.h"
  10. @interface SPSBAboutViewController ()
  11. @end
  12. @implementation SPSBAboutViewController
  13. - (void)viewDidLoad {
  14. [super viewDidLoad];
  15. [self setupUI];
  16. }
  17. #pragma mark - Action
  18. - (void)introductionAction {
  19. SPSBExplainViewController *vc = SPSBExplainViewController.new;
  20. vc.spsb_explainType = SPSBExplainAboutApp;
  21. vc.title = [NSString stringWithFormat:@"%@简介", SPSBAppName];
  22. [self.navigationController pushViewController:vc animated:true];
  23. }
  24. - (void)gradeAction {
  25. jxh_openUrl([NSURL URLWithString:SPSBUrlToAppStoreComment], ^(BOOL success) {
  26. });
  27. }
  28. #pragma mark - Network Action
  29. #pragma mark - UI
  30. - (void)setupUI {
  31. self.title = [NSString stringWithFormat:@"关于%@", SPSBAppName];
  32. self.view.backgroundColor = spsb_F5F5F5_color();
  33. [self createView];
  34. }
  35. - (void)createView {
  36. UIView *iconView = [[UIView alloc] init];
  37. iconView.backgroundColor = spsb_FFFFFF_color(1.f);
  38. [self.view addSubview:iconView];
  39. [iconView makeConstraints:^(JXHConstraintMaker *make) {
  40. make.top.equalTo(self.view.safetop);
  41. make.leading.and.trailing.equalTo(0);
  42. make.height.equalTo(200);
  43. }];
  44. UIImageView *logoImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:SPSBLogo]];
  45. [logoImageView setLayerCornerRadius:16 clipToBounds:true];
  46. [logoImageView setLayerBorderWidth:jxh_onePixe() borderColor:spsb_E7E6EB_color()];
  47. [iconView addSubview:logoImageView];
  48. [logoImageView makeConstraints:^(JXHConstraintMaker *make) {
  49. make.top.equalTo(40);
  50. make.centerX.equalTo(iconView);
  51. }];
  52. UILabel *version = [UILabel convenienceWithFont:spsb_font(13) text:[NSString stringWithFormat:@"版本号 %@", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]] textColor:spsb_999999_color() textAlignment:NSTextAlignmentCenter];
  53. [iconView addSubview:version];
  54. [version makeConstraints:^(JXHConstraintMaker *make) {
  55. make.top.equalTo(logoImageView.bottom).offset(15);
  56. make.centerX.equalTo(iconView);
  57. }];
  58. UIButton *introductionButton = [UIButton convenienceWithTarget:self action:@selector(introductionAction)];
  59. introductionButton.backgroundColor = spsb_FFFFFF_color(1.f);
  60. [self.view addSubview:introductionButton];
  61. [introductionButton makeConstraints:^(JXHConstraintMaker *make) {
  62. make.top.equalTo(iconView.bottom).offset(12);
  63. make.leading.and.trailing.equalTo(0);
  64. make.height.equalTo(50);
  65. }];
  66. UILabel *titleLabel = [UILabel convenienceWithFont:spsb_font(16) text:[NSString stringWithFormat:@"%@简介", SPSBAppName] textColor:spsb_333333_color()];
  67. [introductionButton addSubview:titleLabel];
  68. [titleLabel makeConstraints:^(JXHConstraintMaker *make) {
  69. make.leading.equalTo(15);
  70. make.centerY.equalTo(introductionButton);
  71. }];
  72. UIImageView *arrow = [[UIImageView alloc] initWithImage:jxh_getImage(list_arrow)];
  73. [introductionButton addSubview:arrow];
  74. [arrow makeConstraints:^(JXHConstraintMaker *make) {
  75. make.trailing.equalTo(-15);
  76. make.centerY.equalTo(introductionButton);
  77. }];
  78. UIButton *gradeButton = [UIButton convenienceWithTarget:self action:@selector(gradeAction)];
  79. gradeButton.backgroundColor = spsb_FFFFFF_color(1.f);
  80. [self.view addSubview:gradeButton];
  81. [gradeButton makeConstraints:^(JXHConstraintMaker *make) {
  82. make.top.equalTo(introductionButton.bottom);
  83. make.leading.and.trailing.equalTo(0);
  84. make.height.equalTo(50);
  85. }];
  86. titleLabel = [UILabel convenienceWithFont:spsb_font(16) text:@"喜欢我们,打分鼓励" textColor:spsb_333333_color()];
  87. [gradeButton addSubview:titleLabel];
  88. [titleLabel makeConstraints:^(JXHConstraintMaker *make) {
  89. make.leading.equalTo(15);
  90. make.centerY.equalTo(gradeButton);
  91. }];
  92. arrow = [[UIImageView alloc] initWithImage:jxh_getImage(list_arrow)];
  93. [gradeButton addSubview:arrow];
  94. [arrow makeConstraints:^(JXHConstraintMaker *make) {
  95. make.trailing.equalTo(-15);
  96. make.centerY.equalTo(gradeButton);
  97. }];
  98. [gradeButton createLineWithLocation:JXHLineLocationTop headOffset:15 footOffset:0];
  99. UIImageView *footer = [[UIImageView alloc] initWithImage:jxh_getImage(footer)];
  100. [self.view addSubview:footer];
  101. [footer makeConstraints:^(JXHConstraintMaker *make) {
  102. make.bottom.equalTo(self.view.safebottom).offset(-40);
  103. make.centerX.equalTo(self.view);
  104. }];
  105. }
  106. @end