SPSBAppCommentViewController.m 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. //
  2. // SPSBAppCommentViewController.m
  3. // 我的社保
  4. //
  5. // Created by shanp on 2021/4/29.
  6. //
  7. #import "SPSBAppCommentViewController.h"
  8. #import "SPSBUIGeneralHeader.h"
  9. #import "SPSBKeyProfile.h"
  10. @interface SPSBAppCommentViewController ()
  11. @end
  12. @implementation SPSBAppCommentViewController
  13. - (void)viewDidLoad {
  14. [super viewDidLoad];
  15. [self setupUI];
  16. }
  17. #pragma mark - Action
  18. - (void)commentAction:(UIButton *)sender {
  19. if (sender.tag == 3000) {
  20. jxh_openUrl([NSURL URLWithString:SPSBUrlToAppStoreComment], nil);
  21. }
  22. [self hideAnimation:^(BOOL finished) {
  23. [self dismissViewControllerAnimated:false completion:nil];
  24. }];
  25. }
  26. #pragma mark - Network Action
  27. #pragma mark - UI
  28. - (void)setupUI {
  29. self.view.backgroundColor = spsb_000000_color(SPSBPopupViewBackgroundAlpha);
  30. UIView *commentBG = UIView.new;
  31. commentBG.backgroundColor = [UIColor whiteColor];
  32. [commentBG setLayerCornerRadius:8 clipToBounds:true];
  33. UIImageView *topView = [[UIImageView alloc] initWithImage:jxh_getImage(wuxinhaoping)];
  34. [commentBG addSubview:topView];
  35. [topView makeConstraints:^(JXHConstraintMaker *make) {
  36. make.top.and.leading.equalTo(0);
  37. }];
  38. UILabel *title = [UILabel convenienceWithFont:spsb_semiboldFont(21) text:[NSString stringWithFormat:@"喜欢“%@”吗?", SPSBAppName] textColor:spsb_333333_color() textAlignment:NSTextAlignmentCenter];
  39. [commentBG addSubview:title];
  40. [title makeConstraints:^(JXHConstraintMaker *make) {
  41. make.top.equalTo(topView.bottom).offset(28);
  42. make.centerX.equalTo(commentBG);
  43. }];
  44. UILabel *content = [UILabel convenienceWithFont:spsb_font(17) textColor:spsb_999999_color() limitWidth:313 - 64];
  45. [content setAttributedStringWithText:@"你的建议和鼓励会助我们做的更好,期待五星好评!" textAlignment:NSTextAlignmentCenter lineSpacing:4 lineHeight:0 paragraphSpacing:0 lineBreakMode:NSLineBreakByTruncatingTail];
  46. [commentBG addSubview:content];
  47. [content makeConstraints:^(JXHConstraintMaker *make) {
  48. make.top.equalTo(title.bottom).offset(10);
  49. make.leading.equalTo(32);
  50. make.trailing.equalTo(-32);
  51. }];
  52. UIButton *button = [UIButton convenienceWithFont:spsb_semiboldFont(16) target:self action:@selector(commentAction:)];
  53. [button setTitle:@"鼓励一下" titleColor:spsb_FFFFFF_color(1.f) image:nil backgroundImage:jxh_getImage(confirm_n) state:JXHButtonControlStateNormal];
  54. [button setBackgroundImage:jxh_getImage(confirm_h) state:JXHButtonControlStateHighlighted];
  55. button.tag = 3000;
  56. [button setLayerCornerRadius:22.5 clipToBounds:true];
  57. [commentBG addSubview:button];
  58. [button makeConstraints:^(JXHConstraintMaker *make) {
  59. make.top.equalTo(content.bottom).offset(20);
  60. make.centerX.equalTo(commentBG);
  61. make.size.equalTo(CGSizeMake(259, 45));
  62. }];
  63. button = [UIButton convenienceWithFont:spsb_font(17) target:self action:@selector(commentAction:)];
  64. [button setTitle:@"等下再说" titleColor:spsb_999999_color() state:JXHButtonControlStateNormal];
  65. button.tag = 3001;
  66. [commentBG addSubview:button];
  67. [button makeConstraints:^(JXHConstraintMaker *make) {
  68. make.bottom.equalTo(-30);
  69. make.centerX.equalTo(commentBG);
  70. make.size.equalTo(CGSizeMake(68, 24));
  71. }];
  72. [self.view addSubview:commentBG];
  73. [commentBG makeConstraints:^(JXHConstraintMaker *make) {
  74. make.size.equalTo(CGSizeMake(313, 396));
  75. make.center.equalTo(commentBG.superview);
  76. }];
  77. }
  78. @end