// // SPSBPrivacyViewController.m // 我的社保 // // Created by shanp on 2021/4/29. // #import "SPSBPrivacyViewController.h" #import "SPSBUIGeneralHeader.h" #import "SPSBKeyProfile.h" #import #import "SPSBHtmlViewController.h" #import "SPSBURLApiProfile.h" #import "SPSBNavigationController.h" @interface SPSBPrivacyViewController () @end @implementation SPSBPrivacyViewController - (void)viewDidLoad { [super viewDidLoad]; [self setupUI]; [jxh_userDefaults() setObject:@(true) forKey:SPSBPersonalPrivacy]; [jxh_userDefaults() synchronize]; } #pragma mark - Action - (void)privacyAction { [self hideAnimation:^(BOOL finished) { [self dismissViewControllerAnimated:false completion:nil]; }]; } - (void)intoProtocolAction { SPSBHtmlViewController *vc = [[SPSBHtmlViewController alloc] init]; vc.spsb_url = SPSBSocialSecurityServiceAgreementLink; SPSBNavigationController *nav = [[SPSBNavigationController alloc] initWithRootViewController:vc]; [self presentViewController:nav animated:true completion:nil]; } - (void)intoPrivacyAction { SPSBHtmlViewController *vc = [[SPSBHtmlViewController alloc] init]; vc.spsb_url = SPSBSocialSecurityPrivacyLink; SPSBNavigationController *nav = [[SPSBNavigationController alloc] initWithRootViewController:vc]; [self presentViewController:nav animated:true completion:nil]; } #pragma mark - Network Action #pragma mark - UI - (void)setupUI { self.view.backgroundColor = spsb_000000_color(SPSBPopupViewBackgroundAlpha); [self addPrivacy]; } #define spsb_privacyWidth 313 - (void)addPrivacy { UIView *privacyBG = [[UIView alloc] init]; privacyBG.backgroundColor = spsb_FFFFFF_color(1.f); [privacyBG setLayerCornerRadius:14 clipToBounds:false]; UILabel *title = [UILabel convenienceWithFont:spsb_semiboldFont(18) text:[NSString stringWithFormat:@"%@网用户隐私政策", SPSBAppName] textColor:spsb_333333_color() textAlignment:NSTextAlignmentCenter]; [privacyBG addSubview:title]; [title makeConstraints:^(JXHConstraintMaker *make) { make.top.equalTo(24); make.centerX.equalTo(privacyBG); }]; UIScrollView *contentView = [[UIScrollView alloc] init]; contentView.showsVerticalScrollIndicator = false; [privacyBG addSubview:contentView]; [contentView makeConstraints:^(JXHConstraintMaker *make) { make.top.equalTo(60); make.bottom.equalTo(-80); make.left.and.right.equalTo(0); }]; JXHClickTextView *clickView = [[JXHClickTextView alloc] initWithFont:spsb_font(14) titleColor:spsb_333333_color() tag:0 textAlignment:NSTextAlignmentLeft lineSpacing:3 width:spsb_privacyWidth - 50 numberOfLines:0]; @weakify(self) [clickView setText:@"欢迎使用我的社保!我们深知个人信息安全的重要性,请仔细阅读《我的社保网隐私政策》和《我的社保服务协议》,我们致力于维持您对我们的信任,恪守权责一致、目的明确、选择同意、最少够用等原则,保护您的个人信息。" newFonts:@[spsb_semiboldFont(14), spsb_semiboldFont(14)] clickRanges:@[[NSValue valueWithRange:NSMakeRange(30, 9)], [NSValue valueWithRange:NSMakeRange(42, 8)]] color:spsb_3296FB_color() highlightColor:spsb_3296FB_color() clickCoverColor:spsb_FFFFFF_color(1.f) clickBlock:^(NSString *clickText, JXHClickTextView *clickTextView, NSUInteger clickActionTag) { @strongify(self) if (clickActionTag == 0) { [self intoPrivacyAction]; } else { [self intoProtocolAction]; } }]; [clickView setSubstringByRange:NSMakeRange(24, 6) color:spsb_333333_color() newFont:spsb_semiboldFont(14)]; [clickView setSubstringByRange:NSMakeRange(39, 3) color:spsb_333333_color() newFont:spsb_semiboldFont(14)]; [clickView setSubstringByRange:NSMakeRange(50, 1) color:spsb_333333_color() newFont:spsb_semiboldFont(14)]; [contentView addSubview:clickView]; [clickView makeConstraints:^(JXHConstraintMaker *make) { make.top.equalTo(0); make.left.equalTo(25); make.right.equalTo(-25); make.width.equalTo(spsb_privacyWidth - 50); make.height.equalTo(clickView.jxh_height); }]; UILabel *label = [UILabel convenienceWithFont:spsb_semiboldFont(14) textColor:spsb_333333_color() limitWidth:spsb_privacyWidth - 50]; [label setAttributedStringWithText:@"为保证您可以使用我的社保全部功能,请点击“同意并进入”开始使用我们的产品和服务,我们将按业界成熟的安全标准,采取严格的安全保护措施,尽全力保护您的个人信息。" lineSpacing:3]; [contentView addSubview:label]; [label makeConstraints:^(JXHConstraintMaker *make) { make.top.equalTo(138); make.left.equalTo(25); make.right.equalTo(-25); }]; label = [UILabel convenienceWithFont:spsb_font(14) textColor:spsb_333333_color() limitWidth:spsb_privacyWidth - 50]; [label setAttributedStringWithText:@"如果使用“仅浏览”模式,我们会限制部分功能的使用,但为了方便我们解决用户使用时遇到的问题,我们可能会收集设备名称、型号、操作系统等软硬件信息。" lineSpacing:3]; [contentView addSubview:label]; [label makeConstraints:^(JXHConstraintMaker *make) { make.top.equalTo(253); make.left.equalTo(25); make.right.equalTo(-25); make.bottom.equalTo(0); }]; UIButton *button = [UIButton convenienceWithFont:spsb_font(16) target:self action:@selector(privacyAction)]; [button setTitle:@"仅浏览" titleColor:spsb_999999_color() state:JXHButtonControlStateNormal]; [button setLayerCornerRadius:20 clipToBounds:true]; [button setLayerBorderWidth:1 borderColor:spsb_CCCCCC_color()]; [privacyBG addSubview:button]; [button makeConstraints:^(JXHConstraintMaker *make) { make.bottom.equalTo(-21); make.left.equalTo(25); make.size.equalTo(CGSizeMake(103, 40)); }]; button = [UIButton convenienceWithFont:spsb_font(16) target:self action:@selector(privacyAction)]; [button setTitle:@"同意并进入" titleColor:spsb_FFFFFF_color(1.f) state:JXHButtonControlStateNormal]; [button setBackgroundColor:spsb_3296FB_color()]; [button setLayerCornerRadius:20 clipToBounds:true]; [privacyBG addSubview:button]; [button makeConstraints:^(JXHConstraintMaker *make) { make.bottom.equalTo(-21); make.right.equalTo(-25); make.size.equalTo(CGSizeMake(147, 40)); }]; [self.view addSubview:privacyBG]; [privacyBG makeConstraints:^(JXHConstraintMaker *make) { make.size.equalTo(CGSizeMake(spsb_privacyWidth, 396)); make.center.equalTo(privacyBG.superview); }]; } #undef spsb_privacyWidth @end