123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- //
- // SPSBExplainViewController.m
- // 我的社保
- //
- // Created by shanp on 2021/5/13.
- //
- #import "SPSBExplainViewController.h"
- #import "SPSBUIGeneralHeader.h"
- @interface SPSBExplainViewController ()
- @end
- @implementation SPSBExplainViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- [self setupUI];
- }
- #pragma mark - Action
- #pragma mark - Network Action
- #pragma mark - UI
- - (void)setupUI {
- self.view.backgroundColor = spsb_F5F5F5_color();
- SEL action = NSSelectorFromString([NSString stringWithFormat:@"loadViewWithExplainType%ld", (long)_spsb_explainType]);
- IMP imp = [self methodForSelector:action];
- void (*func)(id, SEL) = (void *)imp;
- func(self, action);
- }
- //关于我的社保
- - (void)loadViewWithExplainType0 {
- UIScrollView *scrollView = [UIScrollView convenienceWithBackgroundColor:spsb_FFFFFF_color(1.f)];
- [self.view addSubview:scrollView];
- [scrollView makeConstraints:^(JXHConstraintMaker *make) {
- make.edges.equalTo(self.view);
- }];
-
- NSArray *contentArray = [SPSBAboutAPP componentsSeparatedByString:@"\n"];
- UIView *tempView = nil;
- for (NSInteger i = 0; i < contentArray.count; i ++) {
- UIView *view = [[UIView alloc] init];
- view.backgroundColor = [UIColor whiteColor];
- [scrollView addSubview:view];
- [view makeConstraints:^(JXHConstraintMaker *make) {
- make.leading.and.trailing.equalTo(0);
- make.width.equalTo(jxh_screenWidth());
- if (tempView) {
- make.top.equalTo(tempView.bottom).offset(31);
- } else {
- make.top.equalTo(31);
- }
- }];
-
- UILabel *content = [UILabel convenienceWithFont:spsb_font(15) textColor:spsb_333333_color() limitWidth:jxh_screenWidth() - 56];
- [content setAttributedStringWithText:contentArray[i] lineSpacing:9];
- [view addSubview:content];
- [content makeConstraints:^(JXHConstraintMaker *make) {
- make.leading.equalTo(28);
- make.trailing.equalTo(-28);
- make.top.equalTo(0);
- make.bottom.equalTo(0);
- }];
-
- tempView = view;
- }
-
- if (tempView) {
- [tempView makeConstraints:^(JXHConstraintMaker *make) {
- make.bottom.equalTo(-20);
- }];
- }
-
- }
- //代理社保、公积金协议
- - (void)loadViewWithExplainType1 {
- UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, jxh_screenWidth(), jxh_screenHeight() - 49)];
- scrollView.showsVerticalScrollIndicator = false;
- [self.view addSubview:scrollView];
- NSString *str = SPSBAgencyAgreement;
- UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(15, 30, jxh_screenWidth() - 30, jxh_screenHeight())];
- label.numberOfLines = 0;
- NSAttributedString *att = [[NSAttributedString alloc] initWithData:[str dataUsingEncoding:NSUnicodeStringEncoding] options:@{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType} documentAttributes:nil error:nil];
- label.attributedText = att;
- [label sizeToFit];
- [scrollView addSubview:label];
- scrollView.contentSize = CGSizeMake(jxh_screenWidth(), jxh_viewHeight(label) + 30);
- }
- //我的社保协议
- - (void)loadViewWithExplainType2 {
- UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, jxh_screenWidth(), jxh_screenHeight() - 49)];
- scrollView.showsVerticalScrollIndicator = false;
- [self.view addSubview:scrollView];
- NSString *str = SPSBAgreement;
- UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(15, 30, jxh_screenWidth() - 30, jxh_screenHeight())];
- label.numberOfLines = 0;
- NSAttributedString *att = [[NSAttributedString alloc] initWithData:[str dataUsingEncoding:NSUnicodeStringEncoding] options:@{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType} documentAttributes:nil error:nil];
- label.attributedText = att;
- [label sizeToFit];
- [scrollView addSubview:label];
- scrollView.contentSize = CGSizeMake(jxh_screenWidth(), jxh_viewHeight(label) + 30);
- }
- @end
|