NYLIVipCoachViewController.m 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. //
  2. // NYLIVipCoachViewController.m
  3. // jiaPei
  4. //
  5. // Created by Ning.ge on 2025/1/23.
  6. // Copyright © 2025 JCZ. All rights reserved.
  7. //
  8. #import "NYLIVipCoachViewController.h"
  9. #import "NYLIVipCoachContentView.h"
  10. @interface NYLIVipCoachViewController ()
  11. /// viewModel
  12. @property (nonatomic, readonly, strong) NYLIVipCoachViewModel *viewModel;
  13. @property (nonatomic, readwrite, strong) RQVipBuyView *vipBuyView;
  14. @property (nonatomic, readwrite, strong) NYLiVipBuyNewView *vipBuyNewView;
  15. @property (nonatomic, readwrite, strong) RQTypeModel *chooseTypeModel;
  16. @property (nonatomic, readwrite, strong) IAPManager *iapManager;
  17. @property (nonatomic, strong) NYWPViewModel *wpviewModel;
  18. @property (nonatomic, readwrite, strong) UIButton *back_btn;
  19. @end
  20. @implementation NYLIVipCoachViewController
  21. @dynamic viewModel;
  22. #pragma mark - SystemMethod
  23. - (void)viewDidLoad {
  24. [super viewDidLoad];
  25. /// 初始化
  26. [self rq_setup];
  27. [self.wpviewModel.wView evaluateJavaScript:@"navigator.userAgent" completionHandler:^(id result, NSError *error) {
  28. NSLog(@"navigator.userAgent.result is ++++ %@", result);
  29. }];
  30. //控制-测试环境
  31. if(!isOfficial){
  32. [self.wpviewModel wkvPL:NYPiapph_test];
  33. }else{
  34. [self.wpviewModel wkvPL:NYPiapph];
  35. }
  36. }
  37. - (void)viewWillAppear:(BOOL)animated {
  38. [super viewWillAppear:animated];
  39. /// 清除缓存
  40. NSSet *websiteDataTypes = [WKWebsiteDataStore allWebsiteDataTypes];
  41. NSDate *dateFrom = [NSDate dateWithTimeIntervalSince1970:0];
  42. [[WKWebsiteDataStore defaultDataStore] removeDataOfTypes:websiteDataTypes modifiedSince:dateFrom completionHandler:^{
  43. }];
  44. [self.navigationController.navigationBar setHidden:YES];
  45. }
  46. - (void)viewWillDisappear:(BOOL)animated{
  47. [super viewWillDisappear:animated];
  48. [self.navigationController.navigationBar setHidden:NO];
  49. }
  50. - (void)dealloc {
  51. [RQ_Video_Module delayPlaydo:self.viewModel.homePageSubjectType];
  52. self.wpviewModel = nil;
  53. RQ_VIP_Module.chooseTypeModel = nil;
  54. [[NSNotificationCenter defaultCenter] removeObserver:self];
  55. }
  56. - (void)viewDidLayoutSubviews {
  57. [super viewDidLayoutSubviews];
  58. CGFloat customHeight = (self.viewModel.vipPageType == RQVIPPageType_Alert)? self.view.rq_height : RQ_SCREEN_HEIGHT;
  59. self.collectionView.size = CGSizeMake(RQ_SCREEN_WIDTH, self.view.rq_height - RQ_FIT_HORIZONTAL(110.f) - RQ_APPLICATION_SAFEAREA_BOTTOM_HEIGHT);
  60. // self.vipBuyView.frame = CGRectMake(0, customHeight - RQ_APPLICATION_SAFEAREA_BOTTOM_HEIGHT - RQ_FIT_HORIZONTAL(93.f), RQ_SCREEN_WIDTH, RQ_FIT_HORIZONTAL(93.f) + RQ_APPLICATION_SAFEAREA_BOTTOM_HEIGHT);
  61. self.vipBuyNewView.frame = CGRectMake(0, customHeight - RQ_APPLICATION_SAFEAREA_BOTTOM_HEIGHT - RQ_FIT_HORIZONTAL(110.f), RQ_SCREEN_WIDTH, RQ_FIT_HORIZONTAL(110.f) + RQ_APPLICATION_SAFEAREA_BOTTOM_HEIGHT);
  62. }
  63. #pragma mark - PrivateMethods
  64. /// 初始化
  65. - (void)rq_setup {
  66. /// set up ...
  67. @weakify(self)
  68. self.back_btn = [UIButton buttonWithType:UIButtonTypeCustom];
  69. self.back_btn.frame = CGRectMake(5, 44, 50, 50);
  70. [self.back_btn addTarget:self action:@selector(backActiondo:) forControlEvents:UIControlEventTouchUpInside];
  71. [self.back_btn setImage:[UIImage imageNamed:@"li_back_white"] forState:UIControlStateNormal];
  72. self.collectionView.bounces = NO;
  73. self.flowLayout.sectionHeadersPinToVisibleBounds = (self.viewModel.vipPageType == RQVIPPageType_Alert);
  74. self.collectionView.backgroundColor = RQ_MAIN_TEXT_COLOR_WHITE;
  75. [self.view addSubview:self.vipBuyNewView];
  76. [self.view addSubview:self.back_btn];
  77. [[[RACObserve(self.viewModel, dataSource) distinctUntilChanged] deliverOnMainThread] subscribeNext:^(id _Nullable x) {
  78. @strongify(self)
  79. if (self.viewModel.dataSource.count > 0) {
  80. NYLIVipHeaderImageViewGroupModel *vipHeaderImageViewGroupViewModel = self.viewModel.dataSource.firstObject;
  81. if (vipHeaderImageViewGroupViewModel.itemViewModels.count > 0) {
  82. NSArray *currentArr = [vipHeaderImageViewGroupViewModel.itemViewModels.rac_sequence filter:^BOOL(RQVipSinglePriceItemViewModel *vipSinglePriceItemViewModel) {
  83. return ![vipSinglePriceItemViewModel.typeModel.dictLabel containsString:@"理论实操计时"];
  84. }].array;
  85. RQVipSinglePriceItemViewModel *vipSinglePriceItemViewModel;
  86. if (currentArr.count > 0) {
  87. vipSinglePriceItemViewModel = currentArr.firstObject;
  88. } else {
  89. vipSinglePriceItemViewModel = vipHeaderImageViewGroupViewModel.itemViewModels.firstObject;
  90. }
  91. if (RQObjectIsNil(RQ_VIP_Module.chooseTypeModel)) {
  92. RQ_VIP_Module.chooseTypeModel = vipSinglePriceItemViewModel.typeModel;
  93. } else {
  94. }
  95. }
  96. }
  97. }];
  98. [self initPayNoti];
  99. [self.vipBuyView.buyBtn setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
  100. @strongify(self)
  101. if (!self.vipBuyView.userAgreeBtn.selected) {
  102. [[RACScheduler mainThreadScheduler] schedule:^{
  103. [NSObject rq_showAlertViewWithTitle:@"温馨提示" message:@"请阅读用户协议!才能开通会员哦!" confirmTitle:@"立即阅读" cancelTitle:@"取消" confirmAction:^{
  104. @strongify(self)
  105. self.vipBuyView.userAgreeBtn.selected = YES;
  106. NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://ys.zzxcx.net/jsjp-sf.html"]];
  107. RQWebViewModel *viewModel = [[RQWebViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{RQViewModelRequestKey : request,RQViewModelWebViewTypeKey:@(RQWebViewType_VIP)}];
  108. RQWebViewViewController *viewController = [[RQWebViewViewController alloc] initWithViewModel:viewModel];
  109. RQBaseNavigationController *nav = [[RQBaseNavigationController alloc] initWithRootViewController:viewController];
  110. [RQControllerHelper.currentViewController presentViewController:nav animated:YES completion:nil];
  111. } cancelAction:nil];
  112. }];
  113. return;
  114. }
  115. if (RQObjectIsNil(RQ_VIP_Module.chooseTypeModel)) {
  116. [MBProgressHUD rq_showTips:@"暂无可用VIP套餐"];
  117. } else {
  118. [self.wpviewModel wwvPLJS:RQ_VIP_Module.chooseTypeModel.dictCode goodType:4];
  119. }
  120. }];
  121. [self.vipBuyNewView.buyBtn setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
  122. @strongify(self)
  123. if (!self.vipBuyNewView.userAgreeBtn.selected) {
  124. [[RACScheduler mainThreadScheduler] schedule:^{
  125. [NSObject rq_showAlertViewWithTitle:@"温馨提示" message:@"请阅读用户协议!才能开通会员哦!" confirmTitle:@"立即阅读" cancelTitle:@"取消" confirmAction:^{
  126. @strongify(self)
  127. self.vipBuyNewView.userAgreeBtn.selected = YES;
  128. NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://ys.zzxcx.net/jsjp-sf.html"]];
  129. RQWebViewModel *viewModel = [[RQWebViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{RQViewModelRequestKey : request,RQViewModelWebViewTypeKey:@(RQWebViewType_VIP)}];
  130. RQWebViewViewController *viewController = [[RQWebViewViewController alloc] initWithViewModel:viewModel];
  131. RQBaseNavigationController *nav = [[RQBaseNavigationController alloc] initWithRootViewController:viewController];
  132. [RQControllerHelper.currentViewController presentViewController:nav animated:YES completion:nil];
  133. } cancelAction:nil];
  134. }];
  135. return;
  136. }
  137. if (RQObjectIsNil(RQ_VIP_Module.chooseTypeModel)) {
  138. [MBProgressHUD rq_showTips:@"暂无可用VIP套餐"];
  139. } else {
  140. // [MBProgressHUD rq_showProgressHUD:@"创建订单..."];
  141. // [[RQ_HTTP_Service postPrepareOrderLIWithDictCode:RQ_VIP_Module.chooseTypeModel.dictCode userId:RQ_USER_MANAGER.currentUser._id goodsType:4] subscribeNext:^(RQPrepareOrderModel *prepareOrderModel) {
  142. // [MBProgressHUD rq_hideHUD];
  143. // // 发起微信支付,设置参数
  144. // //需要创建这个支付对象
  145. // PayReq *req = [[PayReq alloc] init];
  146. // //由用户微信号和AppID组成的唯一标识,用于校验微信用户
  147. // req.openID = RQ_WECHAT_MANAGER.appID;
  148. // // 商家id,在注册的时候给的
  149. // req.partnerId = prepareOrderModel.partnerId;
  150. // // 预支付订单这个是后台跟微信服务器交互后,微信服务器传给你们服务器的,你们服务器再传给你
  151. // req.prepayId = prepareOrderModel.prepayId;
  152. // // 根据财付通文档填写的数据和签名
  153. // req.package = prepareOrderModel.packageValue;
  154. // // 随机编码,为了防止重复的,在后台生成
  155. // req.nonceStr = prepareOrderModel.nonceStr;
  156. // // 这个是时间戳,也是在后台生成的,为了验证支付的
  157. // NSString * stamp = prepareOrderModel.timeStamp;
  158. // req.timeStamp = (UInt32)stamp.intValue;
  159. // // 这个签名也是后台做的
  160. // req.sign = prepareOrderModel.sign;
  161. // [RQWechatManager hangleWechatPayWith:req];
  162. // } error:^(NSError * _Nullable error) {
  163. // [MBProgressHUD rq_hideHUD];
  164. // [MBProgressHUD rq_showErrorTips:error];
  165. // }];
  166. // return;
  167. [self.wpviewModel wwvPLJS:RQ_VIP_Module.chooseTypeModel.dictCode goodType:4];
  168. }
  169. }];
  170. }
  171. //返回
  172. - (void)backActiondo:(UIButton *)btn{
  173. [self.navigationController popViewControllerAnimated:YES];
  174. }
  175. - (void)initPayNoti {
  176. [[NSNotificationCenter defaultCenter] addObserver:self
  177. selector:@selector(ailyPayOrWechatSuccessAction)
  178. name:RQUserNotificationOrWechatSuccess
  179. object:nil];
  180. [[NSNotificationCenter defaultCenter] addObserver:self
  181. selector:@selector(ailyPayOrWechatFailAction)
  182. name:RQUserNotificationOrWechatFail
  183. object:nil];
  184. }
  185. - (void)ailyPayOrWechatSuccessAction {
  186. @weakify(self)
  187. RQVideoVipModel *historyVideoVipModel = RQ_VIP_Module.videoVipModel;
  188. [MBProgressHUD rq_showProgressHUD:@"更新VIP信息..."];
  189. NSLog(@"处理支付成功结果");
  190. [[[RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) {
  191. [subscriber sendNext:@"延时3.f秒"];
  192. return nil;
  193. }] delay:3.f] subscribeNext:^(id x) {
  194. [RQ_VIP_Module isVipWithSubject:0 complete:^(BOOL isVip) {
  195. @strongify(self)
  196. [MBProgressHUD rq_hideHUD];
  197. if ([RQ_VIP_Module.chooseTypeModel.dictLabel containsString:@"科一特训包"]) {
  198. if (RQStringIsNotEmpty(historyVideoVipModel.spSubject1)) {
  199. /// 续费
  200. if ([historyVideoVipModel.spSubject1 isEqualToString:RQ_VIP_Module.videoVipModel.spSubject1]) {
  201. /// 续费未查询到结果
  202. [self checkVipFail];
  203. } else {
  204. [RQ_ALERTVIEW_MANAGER showAlertWithTitle:@"温馨提示" message:@"您已续费成功!" confirmTitle:@"确定" confirmAction:^(__kindof QMUIDialogViewController * _Nonnull dialogViewController) {
  205. }];
  206. }
  207. } else {
  208. /// 购买
  209. if (RQStringIsEmpty(RQ_VIP_Module.videoVipModel.spSubject1)) {
  210. /// 购买未查询到结果
  211. [self checkVipFail];
  212. } else {
  213. [RQ_ALERTVIEW_MANAGER showAlertWithTitle:@"温馨提示" message:@"您已购买成功!" confirmTitle:@"确定" confirmAction:^(__kindof QMUIDialogViewController * _Nonnull dialogViewController) {
  214. }];
  215. }
  216. }
  217. } else if ([RQ_VIP_Module.chooseTypeModel.dictLabel containsString:@"科四特训包"]) {
  218. if (RQStringIsNotEmpty(historyVideoVipModel.spSubject4)) {
  219. /// 续费
  220. if ([historyVideoVipModel.spSubject4 isEqualToString:RQ_VIP_Module.videoVipModel.spSubject4]) {
  221. /// 续费未查询到结果
  222. [self checkVipFail];
  223. } else {
  224. [RQ_ALERTVIEW_MANAGER showAlertWithTitle:@"温馨提示" message:@"您已续费成功!" confirmTitle:@"确定" confirmAction:^(__kindof QMUIDialogViewController * _Nonnull dialogViewController) {
  225. }];
  226. }
  227. } else {
  228. /// 购买
  229. if (RQStringIsEmpty(RQ_VIP_Module.videoVipModel.spSubject4)) {
  230. /// 购买未查询到结果
  231. [self checkVipFail];
  232. } else {
  233. [RQ_ALERTVIEW_MANAGER showAlertWithTitle:@"温馨提示" message:@"您已购买成功!" confirmTitle:@"确定" confirmAction:^(__kindof QMUIDialogViewController * _Nonnull dialogViewController) {
  234. }];
  235. }
  236. }
  237. } else {
  238. if ([historyVideoVipModel.spSubject1 isEqualToString:RQ_VIP_Module.videoVipModel.spSubject1] && [historyVideoVipModel.spSubject4 isEqualToString:RQ_VIP_Module.videoVipModel.spSubject4]) {
  239. /// 续费未查询到结果
  240. [self checkVipFail];
  241. } else {
  242. [RQ_ALERTVIEW_MANAGER showAlertWithTitle:@"温馨提示" message:@"您已购买成功!" confirmTitle:@"确定" confirmAction:^(__kindof QMUIDialogViewController * _Nonnull dialogViewController) {
  243. @strongify(self)
  244. }];
  245. }
  246. }
  247. }];
  248. }];
  249. }
  250. - (void)checkVipFail {
  251. @weakify(self)
  252. [NSObject rq_showAlertViewWithTitle:@"温馨提示" message:@"更新VIP信息失败" confirmTitle:@"继续更新" cancelTitle:@"取消" confirmAction:^{
  253. @strongify(self)
  254. [self ailyPayOrWechatSuccessAction];
  255. } cancelAction:nil];
  256. }
  257. // 支付失败
  258. - (void)ailyPayOrWechatFailAction {
  259. NSLog(@"处理支付失败结果");
  260. }
  261. #pragma mark - OverrideMethods
  262. /// 配置collectionView的区域
  263. - (UIEdgeInsets)contentInset {
  264. return UIEdgeInsetsMake(0, 0, 0, 0);
  265. }
  266. - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView dequeueReusableCellWithIdentifier:(NSString *)identifier forIndexPath:(NSIndexPath *)indexPath {
  267. RQCommonGroupViewModel *groupViewModel = self.viewModel.dataSource[indexPath.section];
  268. RQCommonCollectionItemViewModel *itemViewModel = groupViewModel.itemViewModels[indexPath.row];
  269. return [NSClassFromString(itemViewModel.itemClassName) cellWithCollectionView:collectionView forIndexPath:indexPath];
  270. }
  271. - (void)configureCell:(RQCommonCell *)cell atIndexPath:(NSIndexPath *)indexPath withObject:(id)object {
  272. [cell bindViewModel:object];
  273. }
  274. - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section {
  275. switch (section) {
  276. case 0: {
  277. return UIEdgeInsetsMake(0, 16, 0, 16);
  278. }
  279. case 1: {
  280. return UIEdgeInsetsMake(0, 16, 0, 16);
  281. }
  282. case 2: {
  283. return UIEdgeInsetsMake(0, 16, 0, 16);
  284. }
  285. case 3: {
  286. return UIEdgeInsetsMake(0, 16, 0, 16);
  287. }
  288. case 4: {
  289. return UIEdgeInsetsMake(0, 16, 0, 16);
  290. }
  291. case 5: {
  292. return UIEdgeInsetsMake(0, 16, 0, 16);
  293. }
  294. case 6: {
  295. return UIEdgeInsetsMake(0, 16, 0, 16);
  296. }
  297. default: {
  298. return UIEdgeInsetsZero;
  299. }
  300. }
  301. }
  302. - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section {
  303. switch (section) {
  304. case 0:
  305. case 1:
  306. return 16;
  307. default:
  308. return 8;
  309. }
  310. }
  311. - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section {
  312. switch (section) {
  313. case 1:
  314. return 0;
  315. default:
  316. return 8;
  317. }
  318. }
  319. - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath {
  320. @weakify(self)
  321. // 如果是头视图
  322. if (kind == UICollectionElementKindSectionHeader) {
  323. if (indexPath.section == 0) {
  324. if (self.viewModel.vipPageType == RQVIPPageType_Alert) {
  325. RQVipAlertHeaderCollectionReusableView *headerView = [RQVipAlertHeaderCollectionReusableView reusableViewWithCollectionView:collectionView OfKind:kind forIndexPath:indexPath];
  326. [headerView.closeBtn setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
  327. @strongify(self)
  328. [self dismissViewControllerAnimated:YES completion:nil];
  329. }];
  330. return headerView;
  331. } else {
  332. NYLIVipHeaderImageViewNewReusableView *vipHeaderImageViewReusableView = [NYLIVipHeaderImageViewNewReusableView reusableViewWithCollectionView:collectionView OfKind:kind forIndexPath:indexPath];
  333. // RQVipHeaderImageViewNewGroupViewModel *vipHeaderImageViewGroupViewModel = self.viewModel.dataSource[indexPath.section];
  334. // [vipHeaderImageViewReusableView bindViewModel:vipHeaderImageViewGroupViewModel];
  335. return vipHeaderImageViewReusableView;
  336. }
  337. } else {
  338. RQCommonReusableView *headerView = [RQCommonReusableView reusableViewWithCollectionView:collectionView OfKind:kind forIndexPath:indexPath];
  339. RQCommonGroupViewModel *groupViewModel = self.viewModel.dataSource[indexPath.section];
  340. [headerView bindViewModel:groupViewModel];
  341. headerView.headerContentLabel.hidden = YES;
  342. headerView.footerContentLabel.hidden = YES;
  343. if (indexPath.section == 1 && self.viewModel.vipPageType == RQVIPPageType_Alert) {
  344. headerView.backgroundColor = UIColor.clearColor;
  345. }
  346. headerView.backgroundColor = UIColor.clearColor;
  347. return headerView;
  348. }
  349. } else {
  350. RQCommonReusableView *footerView = [RQCommonReusableView reusableViewWithCollectionView:collectionView OfKind:kind forIndexPath:indexPath];
  351. RQCommonGroupViewModel *groupViewModel = self.viewModel.dataSource[indexPath.section];
  352. [footerView bindViewModel:groupViewModel];
  353. footerView.headerContentLabel.hidden = YES;
  354. footerView.footerContentLabel.hidden = YES;
  355. footerView.backgroundColor = UIColor.clearColor;
  356. return footerView;
  357. }
  358. }
  359. - (BOOL)collectionView:(UICollectionView *)collectionView shouldSelectItemAtIndexPath:(NSIndexPath *)indexPath {
  360. switch (indexPath.section) {
  361. case 0:
  362. case 1:{
  363. RQCommonGroupViewModel *groupViewModel = self.viewModel.dataSource[indexPath.section];
  364. if ([groupViewModel.itemViewModels[indexPath.row] isKindOfClass:[RQVipTrainPriceItemViewModel class]]) {
  365. return (!RQObjectIsNil(RQ_VIP_Module.activationModel) && RQ_VIP_Module.activationModel.isShare && !(RQ_VIP_Module.activationModel.isActive == 1));
  366. } else {
  367. return YES;
  368. }
  369. }
  370. default:
  371. return NO;
  372. }
  373. }
  374. #pragma mark - HWPanModalPresentable3
  375. - (NYWPViewModel *)wpviewModel{
  376. if(!_wpviewModel){
  377. _wpviewModel = [[NYWPViewModel alloc] init];
  378. }
  379. return _wpviewModel;
  380. }
  381. - (UIScrollView *)panScrollable {
  382. return self.collectionView;
  383. }
  384. - (PanModalHeight)longFormHeight {
  385. return PanModalHeightMake(PanModalHeightTypeContent, RQ_SCREEN_HEIGHT * (459.f / 812.f));
  386. }
  387. - (CGFloat)cornerRadius {
  388. return 0.0;
  389. }
  390. - (BOOL)allowsTapBackgroundToDismiss {
  391. return NO;
  392. }
  393. - (BOOL)showDragIndicator {
  394. return NO;
  395. }
  396. #pragma mark - LazyLoad
  397. - (RQVipBuyView *)vipBuyView {
  398. if (!_vipBuyView) {
  399. _vipBuyView = [RQVipBuyView vipBuyView];
  400. RAC(_vipBuyView, typeModel) = [[RACObserve(RQ_VIP_Module, chooseTypeModel) distinctUntilChanged] takeUntil:self.rac_willDeallocSignal];
  401. }
  402. return _vipBuyView;
  403. }
  404. - (NYLiVipBuyNewView *)vipBuyNewView {
  405. if (!_vipBuyNewView) {
  406. _vipBuyNewView = [NYLiVipBuyNewView vipBuyNewView];
  407. RAC(_vipBuyNewView, typeModel) = [[RACObserve(RQ_VIP_Module, chooseTypeModel) distinctUntilChanged] takeUntil:self.rac_willDeallocSignal];
  408. }
  409. return _vipBuyNewView;
  410. }
  411. @end