NYLIVipCoachViewController.m 21 KB

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