// // YMGuidePageViewController.m // MSYOUPAI // // Created by YoMi on 2024/2/10. // Copyright © 2024 MS. All rights reserved. // #import "YMGuidePageViewController.h" #import "YMGuidePageViewModel.h" @interface YMGuidePageViewController () /// 引导页VM @property (nonatomic, strong) YMGuidePageViewModel *viewModel; /// 启动图 @property (nonatomic, strong) UIImageView *launchscreenImage; @end @implementation YMGuidePageViewController @dynamic viewModel; - (void)viewDidLoad { [super viewDidLoad]; [self setNavHidden:YES]; YMServicePolicyPopupView *customView = [[YMServicePolicyPopupView alloc]init]; YMPopupView *popupView = [YMPopupView initWithCustomView:customView parentView:self.view popStyle:YMPopupStyleFade dismissStyle:YMDismissStyleFade]; popupView.priority = 999; popupView.cornerRadius = adapt(10); popupView.rectCorners = UIRectCornerAllCorners; popupView.positionStyle = YMPositionStyleCenter; popupView.isHideBg = NO; popupView.bgAlpha = 0.3; [popupView pop]; @weakify(popupView) customView.buttonBlock = ^(BOOL isConsentAuthorization) { @strongify(popupView) if (self.callBlock) { self.callBlock(isConsentAuthorization); } [popupView dismissWithStyle:YMDismissStyleFade duration:2.0]; }; customView.userProtocolBlock = ^{ YMWebArticleViewModel *webArticleVM = [[YMWebArticleViewModel alloc]initWithParams:@{ ParamsUrl:[NSString stringWithFormat:@"%@%@",[LCSaveData getBaseURL]?[LCSaveData getBaseURL]:BaseURL,UserProtocolH5] }]; [YMRouter openURL:stringFormat(@"%@%@", YM_ROUTER_URL_PREFIX, YM_ROUTER_WEB_ARTICLE) withUserInfo:@{ RouterViewModel:webArticleVM } completion:nil]; }; customView.privacyPolicyBlock = ^{ YMWebArticleViewModel *webArticleVM = [[YMWebArticleViewModel alloc]initWithParams:@{ ParamsUrl:[NSString stringWithFormat:@"%@%@",[LCSaveData getBaseURL]?[LCSaveData getBaseURL]:BaseURL,UserPrivacyH5] }]; [YMRouter openURL:stringFormat(@"%@%@", YM_ROUTER_URL_PREFIX, YM_ROUTER_WEB_ARTICLE) withUserInfo:@{ RouterViewModel:webArticleVM } completion:nil]; }; } - (void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:YES]; } - (void)viewWillDisappear:(BOOL)animated{ [super viewWillDisappear:YES]; } - (void)ym_setupViews{ [self.view addSubview:self.launchscreenImage]; [self.view sendSubviewToBack:self.launchscreenImage]; [self.view setNeedsUpdateConstraints]; [self.view updateConstraintsIfNeeded]; } - (void)updateViewConstraints{ [self.launchscreenImage mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self.view); make.left.right.equalTo(self.view); make.bottom.equalTo(self.view); }]; [super updateViewConstraints]; } - (void)ym_bindViewModel{ } - (UIImageView *)launchscreenImage{ if (!_launchscreenImage) { _launchscreenImage = [[UIImageView alloc]init]; _launchscreenImage.contentMode = UIViewContentModeScaleAspectFill; _launchscreenImage.image = ImageByName(@"vqu_images_ic_login_bg"); _launchscreenImage.userInteractionEnabled = YES; } return _launchscreenImage; } @end