123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479 |
- //
- // ProfileModule.m
- // SDJK
- //
- // Created by 张嵘 on 2021/7/30.
- //
- #import "ProfileModule.h"
- /// VIP价格路径
- NSString * const RQVipPricePath = @"vip_price";
- /// 销售价格路径
- NSString * const RQVipPriceOriginalPath = @"vip_price_original";
- /// XXX路径
- NSString * const RQButtonSwitchOriginalPath = @"button_switch";
- /// 线上路径
- NSString * const RQOnlineVersionPath = @"Online_Version";
- /// 题库更新路径
- NSString * const RQUpdateDbOriginalPaDth = @"update_db";
- /// app图标是否更改
- NSString * const RQSDJKAPPICONNEEDCHANGEPath = @"SDJK_APP_ICON_NEED_CHANGE";
- /// VIP类型
- NSString * const RQVipTypePath = @"sd_package";
- @interface RQAlertTextField : UITextField
- @end
- @implementation RQAlertTextField
- - (CGRect)leftViewRectForBounds:(CGRect)bounds {
- CGRect iconRect = [super leftViewRectForBounds:bounds];
- iconRect.origin.x += 12; //像右边偏12
- return iconRect;
- }
- //UITextField 文字与输入框的距离
- - (CGRect)textRectForBounds:(CGRect)bounds {
-
- return CGRectInset(bounds, 35, 0);
-
- }
- //控制文本的位置
- - (CGRect)editingRectForBounds:(CGRect)bounds {
-
- return CGRectInset(bounds, 35, 0);
- }
- @end
- @implementation ProfileModule
- @def_singleton(ProfileModule);
- - (void)rq_ActivateVIPAlertWithComplete:(VoidBlock_Bool)complete {
-
- // if (DEBUG) {
- // [[RQ_HTTP_Service getVipCodeList] subscribeNext:^(id _Nullable x) {
- //
- // }];
- // }
-
- SCLAlertView *alert = [[SCLAlertView alloc] initWithNewWindowWidth:RQ_SCREEN_WIDTH - 80.f];
- @weakify(alert)
- [alert removeTopCircle];
- alert.tintTopCircle = NO;
- alert.useLargerIcon = NO;
- alert.shouldDismissOnTapOutside = YES;
- alert.iconTintColor = RQ_MAIN_COLOR;
- alert.cornerRadius = 10;
-
- alert.labelTitle.textColor = RQ_MAIN_TEXT_COLOR_1;
- alert.labelTitle.font = [UIFont boldSystemFontOfSize:20.f];
-
- [alert.labelTitle mas_remakeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_offset(20);
- make.centerX.mas_offset(0);
- make.size.mas_equalTo(CGSizeMake(RQ_SCREEN_WIDTH/3.f, 21.f));
- }];
-
- QMUIButton *leftBtn = [[QMUIButton alloc] qmui_initWithImage:nil title:@"激活码开通"];
- QMUIButton *rightBtn = [[QMUIButton alloc] qmui_initWithImage:nil title:@"邀请码绑定"];
-
- [alert addCustomView:leftBtn];
- [leftBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(alert.labelTitle.mas_bottom).mas_offset(20);
- make.left.mas_offset(16);
- make.size.mas_equalTo(CGSizeMake(RQ_SCREEN_WIDTH/3.f, 21.f));
- }];
-
- [alert addCustomView:rightBtn];
- [rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(alert.labelTitle.mas_bottom).mas_offset(20);
- make.right.mas_offset(-16);
- make.size.mas_equalTo(CGSizeMake(RQ_SCREEN_WIDTH/3.f, 21.f));
- }];
-
- alert.viewText.textColor = RQ_MAIN_TEXT_COLOR_3;
- alert.viewText.font = [UIFont systemFontOfSize:16.f];
-
- [alert.viewText mas_remakeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(leftBtn.mas_bottom).mas_offset(20);
- make.left.mas_offset(16);
- make.right.mas_offset(-16);
- make.size.mas_equalTo(CGSizeMake(RQ_SCREEN_WIDTH - 80.f - 32.f, 36.f));
- }];
-
- UIImageView *textFieldBgImageView = [[UIImageView alloc] initWithImage:[UIImage imageWithColor:RQ_LIST_BACKGROUNDCOLOR]];
- [alert addCustomView:textFieldBgImageView];
- [textFieldBgImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(alert.viewText.mas_bottom).mas_offset(20);
- make.centerX.mas_offset(0);
- make.size.mas_equalTo(CGSizeMake(RQ_SCREEN_WIDTH - 80.f - 40.f, 30.f));
- textFieldBgImageView.layer.cornerRadius = 15;
- textFieldBgImageView.layer.borderWidth = 1;
- textFieldBgImageView.layer.borderColor = RQ_MAIN_LINE_COLOR_1.CGColor;
- textFieldBgImageView.layer.masksToBounds = YES;
- }];
-
- RQAlertTextField *textField = [[RQAlertTextField alloc] initWithFrame:CGRectMake(0, 0, 250, 30)];
- textField.backgroundColor = UIColor.clearColor;
- textField.borderStyle = UITextBorderStyleNone;
- UIView *leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
- UIImageView *imageView = [[UIImageView alloc]initWithImage:RQImageNamed(@"activationIcon")];
- imageView.center = leftView.center;
- [leftView addSubview:imageView];
- textField.leftView = imageView;
- textField.leftViewMode = UITextFieldViewModeAlways; //此处用来设置leftview现实时机
- textField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
- textField.placeholder = @"请输入激活码";
- textField.tintColor = [UIColor colorWithHexString:@"#BFBFBF"];
- textField.textColor = RQ_MAIN_TEXT_COLOR_3;
- textField.font = [UIFont systemFontOfSize:16];
- [alert addCustomTextField:textField];
-
- [textField mas_remakeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(alert.viewText.mas_bottom).mas_offset(20);
- make.centerX.mas_offset(0);
- make.size.mas_equalTo(CGSizeMake(RQ_SCREEN_WIDTH - 80.f - 40.f, 30.f));
- }];
- SCLButton *activateBtn = [alert addButton:@"立即开通" validationBlock:^BOOL{
- @strongify(alert)
- if (textField.text.length <= 0) {
- [MBProgressHUD rq_showTips:@"请输入激活码" addedToView:alert.view];
- }
- return textField.text.length > 0;
- } actionBlock:^{
- [[RQ_HTTP_Service putVipCodeWithVipCode:textField.text] subscribeNext:^(RQBaseModel *baseModel) {
- [RQ_CACHE_MANAGER removeCacheWithPath:RQ_GET_VipInfo parameters:nil];
- [RQ_USER_MANAGER isVipWithComplete:^(NSInteger isVip) {
- if (complete) {
- complete(isVip);
- }
- if (isVip > 0) {
- [MBProgressHUD rq_showTips:@"购买VIP成功"];
- } else {
- [MBProgressHUD rq_showTips:@"VIP激活中!请稍等片刻!!!"];
- }
- }];
-
-
- } error:^(NSError * _Nullable error) {
- [MBProgressHUD rq_showErrorTips:error];
- }];
- }];
- activateBtn.buttonFormatBlock = ^NSDictionary* (void) {
- NSMutableDictionary *buttonConfig = [[NSMutableDictionary alloc] init];
- buttonConfig[@"cornerRadius"] = @"20.f";
- buttonConfig[@"backgroundColor"] = RQ_MAIN_COLOR;
- buttonConfig[@"textColor"] = RQ_MAIN_TEXT_COLOR_WHITE;
- buttonConfig[@"font"] = [UIFont systemFontOfSize:16];
- return buttonConfig;
- };
- [activateBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(textField.mas_bottom).mas_offset(20);
- make.right.mas_offset(-36.f);
- make.size.mas_equalTo(CGSizeMake((RQ_SCREEN_WIDTH - 80.f - 40.f - 15.f - 72.f) * (1.f / 2.f), 40.f));
- }];
-
- UILabel *noteLabel = [[UILabel alloc] init];
- noteLabel.font = [UIFont systemFontOfSize:16.f];
- noteLabel.textColor = RQ_MAIN_TEXT_COLOR_3;
- noteLabel.textAlignment = NSTextAlignmentCenter;
- noteLabel.text = @"速达驾考";
- [alert addCustomView:noteLabel];
- [noteLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(activateBtn.mas_bottom).mas_offset(20);
- make.centerX.mas_offset(0);
- make.size.mas_equalTo(CGSizeMake(RQ_SCREEN_WIDTH - 80.f - 40.f, 21.f));
- make.bottom.mas_offset(-26);
- }];
-
- SCLButton *closeButton = [alert addButton:@"" actionBlock:^{
- @strongify(alert);
- [alert hideView];
- if (complete) {
- complete(NO);
- }
- }];
- closeButton.imageEdgeInsets = UIEdgeInsetsMake(6, 6, 6, 6);
- [closeButton setImage:RQImageNamed(@"close") forState:UIControlStateNormal];
- [closeButton mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_offset(14);
- make.right.mas_offset(-14);
- make.size.mas_equalTo(CGSizeMake(30.f, 30.f));
- }];
-
- alert.showAnimationType = SCLAlertViewShowAnimationFadeIn;
- [alert showTitle:@"提示" subTitle:@"您还未开通系统,请输入激活码开通!" style:SCLAlertViewStyleCustom closeButtonTitle:nil duration:0.f];
- }
- - (void)showVIPAlertWithComplete:(VoidBlock_Bool)complete {
-
- QMUIDialogViewController *dialogViewController = [[QMUIDialogViewController alloc] init];
- dialogViewController.headerSeparatorColor = nil;
- dialogViewController.headerViewBackgroundColor = UIColor.whiteColor;
-
- NSString *message = @"您还未开通系统,请输入激活码开通!";
-
- CGFloat textHeight = [message heightForFont:RQRegularFont_16 width:RQ_SCREEN_WIDTH - 80.f - 32.f] + 16 > RQ_SCREEN_HEIGHT / 2.f? RQ_SCREEN_HEIGHT / 2.f : [message heightForFont:RQRegularFont_16 width:RQ_SCREEN_WIDTH - 80.f - 32.f] + 16;
- dialogViewController.headerViewHeight = (24.f + 22.f + 16.f + textHeight + 16.f) + 57.f + 13.f;
-
-
- QMUILabel *titleLabel = [[QMUILabel alloc] qmui_initWithFont:RQSemiboldFont(20) textColor:[UIColor qmui_colorWithHexString:@"#040B26"]];
- titleLabel.text = @"提示";
- titleLabel.textAlignment = NSTextAlignmentCenter;
- [dialogViewController.headerView addSubview:titleLabel];
- [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(dialogViewController.headerView.mas_top).mas_offset(24);
- make.centerX.mas_offset(0);
- make.size.mas_equalTo(CGSizeMake(RQ_SCREEN_WIDTH - 80.f, 22.f));
- }];
-
- QMUIButton *leftBtn = [[QMUIButton alloc] qmui_initWithImage:nil title:@"激活码开通"];
- [leftBtn setTitleColor:RQ_MAIN_TEXT_COLOR_2 forState:UIControlStateNormal];
- [leftBtn setTitleColor:RQ_MAIN_COLOR forState:UIControlStateSelected];
- [leftBtn setSelected:YES];
-
- // QMUIButton *rightBtn = [[QMUIButton alloc] qmui_initWithImage:nil title:@"邀请码绑定"];
- // [rightBtn setTitleColor:RQ_MAIN_TEXT_COLOR_2 forState:UIControlStateNormal];
- // [rightBtn setTitleColor:RQ_MAIN_COLOR forState:UIControlStateSelected];
- // [rightBtn setSelected:NO];
-
-
- [dialogViewController.headerView addSubview:leftBtn];
- [leftBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(titleLabel.mas_bottom).mas_offset(20);
- // make.left.mas_offset(16);
- make.centerX.mas_offset(0);
- make.size.mas_equalTo(CGSizeMake(RQ_SCREEN_WIDTH/3.f, 21.f));
- }];
-
- // [dialogViewController.headerView addSubview:rightBtn];
- // [rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- // make.top.mas_equalTo(titleLabel.mas_bottom).mas_offset(20);
- // make.right.mas_offset(-16);
- // make.size.mas_equalTo(CGSizeMake(RQ_SCREEN_WIDTH/3.f, 21.f));
- // }];
-
- // UIProgressView *progress = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault];
- // progress.progress = 0.5f;
- // progress.trackTintColor = RQColorFromHexString(@"#E5EDF8");
- // progress.progressTintColor = RQ_MAIN_COLOR;
- // [dialogViewController.headerView addSubview:progress];
- // [progress mas_makeConstraints:^(MASConstraintMaker *make) {
- // make.top.mas_equalTo(leftBtn.mas_bottom).mas_offset(8.f);
- // make.centerX.mas_offset(0);
- // make.size.mas_equalTo(CGSizeMake(RQ_SCREEN_WIDTH - 80.f - 32.f, 5.f));
- // }];
-
- QMUILabel *messageLabel = [[QMUILabel alloc] qmui_initWithFont:RQRegularFont_16 textColor:[UIColor qmui_colorWithHexString:@"#5C6066"]];
- messageLabel.text = message;
- messageLabel.textAlignment = NSTextAlignmentCenter;
- messageLabel.numberOfLines = 0;
- [dialogViewController.headerView addSubview:messageLabel];
- [messageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(leftBtn.mas_bottom).mas_offset(16);
- make.centerX.mas_offset(0);
- make.size.mas_equalTo(CGSizeMake(RQ_SCREEN_WIDTH - 80.f - 32.f, textHeight));
- }];
-
- QMUIButton *closeButton = [[QMUIButton alloc] qmui_initWithImage:RQImageNamed(@"close") title:@""];
- @weakify(dialogViewController)
- [closeButton setBlockForControlEvents:UIControlEventTouchUpInside block:^(id _Nonnull sender) {
- @strongify(dialogViewController)
- [dialogViewController hide];
- if (complete) {
- complete(NO);
- }
- }];
-
- [dialogViewController.headerView addSubview:closeButton];
- [closeButton mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_offset(14);
- make.right.mas_offset(-14);
- make.size.mas_equalTo(CGSizeMake(30.f, 30.f));
- }];
-
-
- UIView *contentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, RQ_SCREEN_WIDTH - 80.f, 55.f)];
- contentView.backgroundColor = UIColorWhite;
-
- UIImageView *textFieldBgImageView = [[UIImageView alloc] initWithImage:[UIImage imageWithColor:RQ_LIST_BACKGROUNDCOLOR]];
- [contentView addSubview:textFieldBgImageView];
- [textFieldBgImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(contentView.mas_top).mas_offset(10);
- make.centerX.mas_offset(0);
- make.size.mas_equalTo(CGSizeMake(RQ_SCREEN_WIDTH - 80.f - 40.f, 35.f));
- textFieldBgImageView.layer.cornerRadius = 15;
- textFieldBgImageView.layer.borderWidth = 1;
- textFieldBgImageView.layer.borderColor = RQ_MAIN_LINE_COLOR_1.CGColor;
- textFieldBgImageView.layer.masksToBounds = YES;
- }];
-
- RQAlertTextField *textField = [[RQAlertTextField alloc] initWithFrame:CGRectMake(0, 0, 250, 35)];
- textField.backgroundColor = UIColor.clearColor;
- textField.borderStyle = UITextBorderStyleNone;
- UIView *leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 35, 35)];
- UIImageView *imageView = [[UIImageView alloc]initWithImage:RQImageNamed(@"activationIcon")];
- imageView.center = leftView.center;
- [leftView addSubview:imageView];
- textField.leftView = imageView;
- textField.leftViewMode = UITextFieldViewModeAlways; //此处用来设置leftview现实时机
- textField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
- textField.placeholder = @"请输入激活码";
- textField.tintColor = [UIColor colorWithHexString:@"#BFBFBF"];
- textField.textColor = RQ_MAIN_TEXT_COLOR_3;
- textField.font = [UIFont systemFontOfSize:16];
- [contentView addSubview:textField];
-
- [textField mas_remakeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(contentView.mas_top).mas_offset(10);
- make.centerX.mas_offset(0);
- make.size.mas_equalTo(CGSizeMake(RQ_SCREEN_WIDTH - 80.f - 40.f, 35.f));
- }];
-
-
- dialogViewController.contentView = contentView;
-
- dialogViewController.footerSeparatorColor = nil;
- dialogViewController.footerViewBackgroundColor = UIColor.whiteColor;
- dialogViewController.footerViewHeight = 117.f;
- dialogViewController.footerView.hidden = NO;
- CGFloat btnWidth = (RQ_SCREEN_WIDTH - 80.f - 16.f - 72.f) / 2.f;
-
- // QMUIButton *buyBtn = [QMUIButton buttonWithType:UIButtonTypeCustom];
- // [buyBtn setTitle:@"在线购买" textColor:UIColor.whiteColor Font:15 fotState:UIControlStateNormal];
- // [buyBtn setBackgroundImage:[UIImage imageWithGradualChangingColor:^(QQGradualChangingColor *graColor) {
- // graColor.fromColor = [UIColor qmui_colorWithHexString:@"#FF4D53"];
- // graColor.toColor = [UIColor qmui_colorWithHexString:@"#FF7E4D"];
- // graColor.type = QQGradualChangeTypeLeftToRight;
- // } size:CGSizeMake(btnWidth, 40.f) cornerRadius:QQRadiusMakeSame(20.f)] forState:UIControlStateNormal];
- // [buyBtn setBackgroundImage:[UIImage imageWithGradualChangingColor:^(QQGradualChangingColor *graColor) {
- // graColor.fromColor = [UIColor qmui_colorWithHexString:@"#8A9099"];
- // graColor.toColor = [UIColor qmui_colorWithHexString:@"#8A9099"];
- // graColor.type = QQGradualChangeTypeLeftToRight;
- // } size:CGSizeMake(btnWidth, 40.f) cornerRadius:QQRadiusMakeSame(20.f)] forState:UIControlStateDisabled];
- // [buyBtn setBlockForControlEvents:UIControlEventTouchUpInside block:^(id _Nonnull sender) {
- // [dialogViewController hide];
- // RQActivateVIPViewModel *activateVIPViewModel = [[RQActivateVIPViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:nil];
- // [RQ_APPDELEGATE.services pushViewModel:activateVIPViewModel animated:YES];
- // }];
- // [dialogViewController.footerView addSubview:buyBtn];
- // [buyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- // make.top.mas_offset(10.f);
- // make.left.mas_offset(36.f);
- // make.size.mas_equalTo(CGSizeMake(btnWidth, 40.f));
- // }];
-
-
- QMUIButton *confirmBtn = [QMUIButton buttonWithType:UIButtonTypeCustom];
- [confirmBtn setTitle:@"立即开通" textColor:UIColor.whiteColor Font:15 fotState:UIControlStateNormal];
- [confirmBtn setBackgroundImage:[UIImage qmui_imageWithColor:RQ_MAIN_COLOR size:CGSizeMake(btnWidth, 40.f) cornerRadius:0] forState:UIControlStateNormal];
- [confirmBtn setBackgroundImage:[UIImage qmui_imageWithColor:[UIColor qmui_colorWithHexString:@"#8A9099"] size:CGSizeMake(btnWidth, 40.f) cornerRadius:0] forState:UIControlStateDisabled];
- confirmBtn.layer.cornerRadius = 20;
- confirmBtn.layer.masksToBounds = YES;
- @weakify(confirmBtn, textField)
- [confirmBtn setBlockForControlEvents:UIControlEventTouchUpInside block:^(id _Nonnull sender) {
- [dialogViewController hide];
- @strongify(confirmBtn, textField)
- if ([confirmBtn.titleLabel.text isEqualToString:@"立即开通"]) {
- [[RQ_HTTP_Service putVipCodeWithVipCode:textField.text] subscribeNext:^(RQBaseModel *baseModel) {
- [RQ_CACHE_MANAGER removeCacheWithPath:RQ_GET_VipInfo parameters:nil];
- [RQ_USER_MANAGER isVipWithComplete:^(NSInteger isVip) {
- if (complete) {
- complete(isVip);
- }
- if (isVip > 0) {
- [MBProgressHUD rq_showTips:@"购买VIP成功"];
- } else {
- [MBProgressHUD rq_showTips:@"VIP激活中!请稍等片刻!!!"];
- }
- }];
- } error:^(NSError * _Nullable error) {
- [MBProgressHUD rq_showErrorTips:error];
- }];
- } else {
- [[RQ_HTTP_Service getRecommendCodeWithRecommendCode:textField.text] subscribeNext:^(RQBaseModel *baseModel) {
- [MBProgressHUD rq_showTips:@"绑定成功"];
- [[RQ_HTTP_Service postPrepareOrderWithDictCode:@"45"] subscribeNext:^(RQPrepareOrderModel *prepareOrderModel) {
- [RQ_WECHAT_MANAGER clickToWechatPayWithPrepareOrder:prepareOrderModel];
- } error:^(NSError * _Nullable error) {
- [MBProgressHUD rq_showErrorTips:error];
- }];
- } error:^(NSError * _Nullable error) {
- [MBProgressHUD rq_showErrorTips:error];
- }];
- }
- }];
- [dialogViewController.footerView addSubview:confirmBtn];
- [confirmBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_offset(10.f);
- // make.right.mas_offset(-36.f);
- make.centerX.mas_offset(0);
- make.size.mas_equalTo(CGSizeMake(btnWidth, 40.f));
- }];
-
- UILabel *noteLabel = [[UILabel alloc] init];
- noteLabel.font = [UIFont systemFontOfSize:16.f];
- noteLabel.textColor = RQ_MAIN_TEXT_COLOR_3;
- noteLabel.textAlignment = NSTextAlignmentCenter;
- noteLabel.text = @"速达驾考";
- [dialogViewController.footerView addSubview:noteLabel];
- [noteLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(confirmBtn.mas_bottom).mas_offset(20);
- make.centerX.mas_offset(0);
- make.size.mas_equalTo(CGSizeMake(RQ_SCREEN_WIDTH - 80.f - 40.f, 21.f));
- make.bottom.mas_offset(-26);
- }];
-
- [dialogViewController show];
-
- // @weakify(leftBtn, rightBtn, messageLabel, progress)
- @weakify(leftBtn, messageLabel)
- [leftBtn setQmui_tapBlock:^(__kindof UIControl *sender) {
- // @strongify(leftBtn, rightBtn, messageLabel, confirmBtn, progress, textField, dialogViewController)
- // if (!leftBtn.selected) leftBtn.selected = YES;
- // if (rightBtn.selected) rightBtn.selected = NO;
- // messageLabel.text = @"您还未开通系统,请输入激活码开通!";
- // CGFloat textNewHeight = [messageLabel.text heightForFont:RQRegularFont_16 width:RQ_SCREEN_WIDTH - 80.f - 32.f] + 16 > RQ_SCREEN_HEIGHT / 2.f? RQ_SCREEN_HEIGHT / 2.f : [messageLabel.text heightForFont:RQRegularFont_16 width:RQ_SCREEN_WIDTH - 80.f - 32.f] + 16;
- //
- // dialogViewController.headerViewHeight = (24.f + 22.f + 16.f + textHeight + 16.f) + 57.f;
- // [messageLabel mas_updateConstraints:^(MASConstraintMaker *make) {
- // make.size.mas_equalTo(CGSizeMake(RQ_SCREEN_WIDTH - 80.f - 32.f, textNewHeight));
- // }];
- //
- // textField.placeholder = @"请输入激活码";
- // [confirmBtn setTitleNormal:@"立即开通"];
- //
- // progress.trackTintColor = RQColorFromHexString(@"#E5EDF8");
- // progress.progressTintColor = RQ_MAIN_COLOR;
- }];
- // [rightBtn setQmui_tapBlock:^(__kindof UIControl *sender) {
- // @strongify(leftBtn, rightBtn, messageLabel, confirmBtn, progress, textField, dialogViewController)
- // if (!rightBtn.selected) rightBtn.selected = YES;
- // if (leftBtn.selected) leftBtn.selected = NO;
- // messageLabel.text = @"如有老师推荐请输入邀请码(没有无需填写)";
- // CGFloat textNewHeight = [messageLabel.text heightForFont:RQRegularFont_16 width:RQ_SCREEN_WIDTH - 80.f - 32.f] + 16 > RQ_SCREEN_HEIGHT / 2.f? RQ_SCREEN_HEIGHT / 2.f : [messageLabel.text heightForFont:RQRegularFont_16 width:RQ_SCREEN_WIDTH - 80.f - 32.f] + 16;
- //
- // dialogViewController.headerViewHeight = (24.f + 22.f + 16.f + textHeight + 16.f) + 57.f;
- // [messageLabel mas_updateConstraints:^(MASConstraintMaker *make) {
- // make.size.mas_equalTo(CGSizeMake(RQ_SCREEN_WIDTH - 80.f - 32.f, textNewHeight));
- // }];
- //
- // textField.placeholder = @"请输入邀请码";
- // [confirmBtn setTitleNormal:@"立即绑定"];
- //
- // progress.trackTintColor = RQ_MAIN_COLOR;
- // progress.progressTintColor = RQColorFromHexString(@"#E5EDF8");
- // }];
- }
- @end
|