YMHomePageViewModel.m 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. //
  2. // YMHomePageViewModel.m
  3. // MSYOUPAI
  4. //
  5. // Created by YoMi on 2024/2/4.
  6. // Copyright © 2024 MS. All rights reserved.
  7. //
  8. #import "YMHomePageViewModel.h"
  9. #import "YMAdvertModel.h"
  10. #import "YMAdolescentModelViewModel.h"
  11. @interface YMHomePageViewModel ()
  12. /// 首页BannerVM
  13. @property (nonatomic, strong, readwrite) YMHomePageBannerViewModel *bannerVM;
  14. /// 首页ViewModel列表
  15. @property (nonatomic, strong, readwrite) NSArray <YMHomePageListViewModel *>*homePageVMListDataArray;
  16. ///// 推荐VM
  17. //@property (nonatomic, strong,readwrite) YMHomePageListViewModel *recommendVM;
  18. /////男神VM
  19. //@property (nonatomic, strong,readwrite) YMHomePageListViewModel *maleGoldVM;
  20. ///// 在线VM
  21. //@property (nonatomic, strong,readwrite) YMHomePageListViewModel *onlineVM;
  22. ///// 同城
  23. //@property (nonatomic, strong,readwrite) YMHomePageListViewModel *sameCityVM;
  24. ///// 推荐for男性(登录男号)
  25. //@property (nonatomic, strong,readwrite) YMHomePageListViewModel *recommendForMaleVM;
  26. @property (nonatomic, strong,readwrite) YMHomePageListViewModel *homeIndexVM;
  27. @property (nonatomic, strong,readwrite) YMHomePageListViewModel *homeSkillAnchorsVM;
  28. @property (nonatomic, strong,readwrite) YMHomePageListViewModel *homeRecommendAnchorsVM;
  29. @property (nonatomic, strong,readwrite) YMHomePageListViewModel *homeRecommendVM;
  30. @property (nonatomic, strong,readwrite) YMHomePageListViewModel *homeWCWVM;
  31. @property (nonatomic, strong,readwrite) YMHomePageListViewModel *homeOnlineListVM;
  32. @property (nonatomic, strong,readwrite) YMHomePageListViewModel *homeOnlineVM;
  33. @property (nonatomic, strong,readwrite) YMHomePageListViewModel *homeGetDesignatedVM;
  34. @property (nonatomic, strong,readwrite) YMHomePageListViewModel *homeGetSameCityUserVM;
  35. @property (nonatomic, strong,readwrite) YMHomePageListViewModel *homeActiveAnchorsVM;
  36. @property (nonatomic, strong,readwrite) YMHomePageListViewModel *homeNewAnchorsVM;
  37. @property (nonatomic, strong,readwrite) YMHomePageListViewModel *homeCityAnchorsVM;
  38. @property (nonatomic, strong,readwrite) YMHomePageListViewModel *homeBannerVM;
  39. @end
  40. @implementation YMHomePageViewModel
  41. - (void)ym_initialize{
  42. [super ym_initialize];
  43. if(self.isFemaleGender){
  44. self.homePageVMListDataArray = @[
  45. self.homeWCWVM,
  46. self.homeGetDesignatedVM,
  47. self.homeOnlineVM,
  48. self.homeRecommendVM,
  49. ];
  50. } else {
  51. self.homePageVMListDataArray = @[
  52. self.homeWCWVM,
  53. self.homeGetDesignatedVM,
  54. self.homeOnlineVM,
  55. ];
  56. }
  57. }
  58. - (void)judgementsIsOpenAdolescentModel{
  59. [self getAdolescentModelStatusData];
  60. // //先判断是否设置了青少年模式
  61. // kAppDelegate.kadolescentStatus = [LCSaveData getYoungMode];
  62. // if(kAppDelegate.kadolescentStatus == 1){
  63. // [self closeAdolescentModelPopup];
  64. // }else{
  65. // ///在判断是否提醒过
  66. // ///检查更新 根据时间戳 设定12小时/一天之内调用一次
  67. // NSString* updateTime = [LCSaveData getYoungNoticeTime];
  68. // NSDate * newData = [NSDate date];
  69. // NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
  70. // [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
  71. // if (!updateTime) {
  72. // NSString* dataString = [dateFormatter stringFromDate:newData];
  73. // [LCSaveData saveYoungNoticeTime:dataString];
  74. // ///弹出设置青少年模式弹窗
  75. // ///要不要检查一下status 防止卸载后重装
  76. // [self getAdolescentModelStatusData];
  77. //
  78. // }else{
  79. // //获取与当前的时间差
  80. // NSDate *timeDate = [dateFormatter dateFromString:updateTime];
  81. // NSTimeInterval timeInterval = [timeDate timeIntervalSinceNow];
  82. // timeInterval = -timeInterval;
  83. // //超过30天
  84. // if (timeInterval > 60 * 60 * 24) {
  85. // NSString* dataString = [dateFormatter stringFromDate:newData];
  86. // [LCSaveData saveYoungNoticeTime:dataString];
  87. // //弹出青少年模式弹窗
  88. // [self openAdolescentModelPopup];
  89. // }
  90. // }
  91. // }
  92. }
  93. - (void)getAdolescentModelStatusData {
  94. [LCHttpHelper requestWithURLString:GetAdolescentStatus parameters:@{} needToken:YES type:HttpRequestTypePost success:^(id responseObject) {
  95. NSDictionary* dict = (NSDictionary*)responseObject;
  96. NSInteger code = [[dict objectForKey:@"code"] integerValue];
  97. if (code == 0) {
  98. NSDictionary *data = [dict dictionaryValueForKey:@"data" defaultValue:@{}];
  99. NSInteger adoleStatus = [data integerValueForKey:@"is_set_adolescent" defaultValue:0];
  100. [LCSaveData saveYoungMode:adoleStatus];
  101. if(adoleStatus == 1){
  102. [self closeAdolescentModelPopup];
  103. }else{
  104. ///在判断是否提醒过
  105. ///检查更新 根据时间戳 设定12小时/一天之内调用一次
  106. NSString* updateTime = [LCSaveData getYoungNoticeTime];
  107. NSDate * newData = [NSDate date];
  108. NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
  109. [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
  110. if (!updateTime) {
  111. NSString* dataString = [dateFormatter stringFromDate:newData];
  112. [LCSaveData saveYoungNoticeTime:dataString];
  113. ///弹出设置青少年模式弹窗
  114. ///要不要检查一下status 防止卸载后重装
  115. }else{
  116. //获取与当前的时间差
  117. NSDate *timeDate = [dateFormatter dateFromString:updateTime];
  118. NSTimeInterval timeInterval = [timeDate timeIntervalSinceNow];
  119. timeInterval = -timeInterval;
  120. //超过30天
  121. if (timeInterval > 60 * 60 * 24) {
  122. NSString* dataString = [dateFormatter stringFromDate:newData];
  123. [LCSaveData saveYoungNoticeTime:dataString];
  124. //弹出青少年模式弹窗
  125. [self openAdolescentModelPopup];
  126. }
  127. }
  128. }
  129. }else{
  130. [ZCHUDHelper showTitle:[dict stringValueForKey:@"message" defaultValue:@""]];
  131. }
  132. } failure:^(NSError *error) {
  133. [ZCHUDHelper showTitle:error.localizedDescription];
  134. }];
  135. }
  136. - (void)zhidingData{
  137. [LCHttpHelper requestWithURLString:HomeZhiDing parameters:@{} needToken:YES type:HttpRequestTypePost success:^(id responseObject) {
  138. NSDictionary* dict = (NSDictionary*)responseObject;
  139. NSInteger code = [[dict objectForKey:@"code"] integerValue];
  140. if (code == 0) {
  141. NSDictionary *dataDic = [dict dictionaryValueForKey:@"data" defaultValue:@{}];
  142. NSString *str = [dataDic objectForKey:@"msg"];
  143. [ZCHUDHelper showTitle:[NSString stringWithFormat:@"置顶成功,%@",str]];
  144. if(self.refreshHomeListData){
  145. self.refreshHomeListData();
  146. }
  147. }
  148. } failure:^(NSError *error) {
  149. }];
  150. }
  151. /// 群打招呼
  152. - (void)groupGreetingData {
  153. [LCHttpHelper requestWithURLString:HomeZhiDing parameters:@{} needToken:YES type:HttpRequestTypePost success:^(id responseObject) {
  154. NSDictionary* dict = (NSDictionary*)responseObject;
  155. NSInteger code = [[dict objectForKey:@"code"] integerValue];
  156. if (code == 0) {
  157. NSDictionary *dataDic = [dict dictionaryValueForKey:@"data" defaultValue:@{}];
  158. NSString *str = [dataDic objectForKey:@"msg"];
  159. [ZCHUDHelper showTitle:[NSString stringWithFormat:@"置顶成功,%@",str]];
  160. if(self.refreshHomeListData){
  161. self.refreshHomeListData();
  162. }
  163. }
  164. } failure:^(NSError *error) {
  165. }];
  166. }
  167. - (void)getAdvertData{
  168. [LCHttpHelper requestWithURLString:GetAdvert parameters:@{
  169. @"source_id":@"2"
  170. } needToken:YES type:HttpRequestTypePost success:^(id responseObject) {
  171. NSDictionary* dict = (NSDictionary*)responseObject;
  172. NSInteger code = [[dict objectForKey:@"code"] integerValue];
  173. if (code == 0) {
  174. NSDictionary *data = [dict dictionaryValueForKey:@"data" defaultValue:@{}];
  175. YMAdvertModel *model = [YMAdvertModel yy_modelWithJSON:[data dictionaryValueForKey:@"advert" defaultValue:@{}]];
  176. NSInteger link_type = [dict[@"data"][@"advert"][@"link_type"] integerValue];
  177. NSString *link_url = dict[@"data"][@"advert"][@"link_url"];
  178. NSInteger window_type = [dict[@"data"][@"advert"][@"window_type"] integerValue];
  179. if (model.status == 1 && model.image.length>5) {
  180. if (window_type == 2) {
  181. // YOUPAIHRWebWindow *window = [[YOUPAIHRWebWindow alloc] init];
  182. // window.isTouchDismiss = YES;
  183. // window.youpaipurl = dict[@"data"][@"advert"][@"window_link"];
  184. // window.youpaipwidth = [dict[@"data"][@"advert"][@"width"] floatValue];
  185. // window.youpaipheight = [dict[@"data"][@"advert"][@"height"] floatValue];
  186. // window.youpaipgravity = dict[@"data"][@"advert"][@"gravity"];
  187. // [self TFPresentVC:window completion:^{}];
  188. }else{
  189. // YOUPAIZYAdvertWindow *VC= [[YOUPAIZYAdvertWindow alloc]init];
  190. // VC.youpaipdelegate = self;
  191. // VC.vWidth = KScreenWidth -30;
  192. // VC.vHeight = KScreenWidth-30;
  193. // VC.youpaipimageurl = image;
  194. // VC.youpaiplink_type = link_type;
  195. // VC.youpaiplink_url = link_url;
  196. // VC.isTouchDismiss = YES;
  197. // [self TFPresentVC:VC completion:^{}];
  198. }
  199. }
  200. }
  201. } failure:^(NSError *error) {
  202. }];
  203. }
  204. /// 获取等级图标数据
  205. - (void)getLevelIconData{
  206. [LCHttpHelper requestWithURLString:LevelInfo parameters:@{} needToken:YES type:HttpRequestTypePost success:^(id responseObject) {
  207. NSDictionary* dict = (NSDictionary*)responseObject;
  208. NSInteger code = [[dict objectForKey:@"code"] integerValue];
  209. if (code == 0) {
  210. NSDictionary *data = [dict dictionaryValueForKey:@"data" defaultValue:@{}];
  211. [LCSaveData saveLevelInfo:data];
  212. }
  213. } failure:^(NSError *error) {
  214. }];
  215. }
  216. /// 获取徽章和贵族图标数据
  217. - (void)getBadgesAndNobilityIconData{
  218. [LCHttpHelper requestWithURLString:AllBadge parameters:@{} needToken:YES type:HttpRequestTypePost success:^(id responseObject) {
  219. NSDictionary* dict = (NSDictionary*)responseObject;
  220. NSInteger code = [[dict objectForKey:@"code"] integerValue];
  221. if (code == 0) {
  222. NSDictionary *data = [dict dictionaryValueForKey:@"data" defaultValue:@{}];
  223. NSDictionary* badge = [data dictionaryValueForKey:@"badge" defaultValue:@{}];
  224. NSDictionary* noble = [data dictionaryValueForKey:@"noble" defaultValue:@{}];
  225. [LCSaveData saveBadgeInfo:badge];
  226. [LCSaveData saveNobleInfo:noble];
  227. }
  228. } failure:^(NSError *error) {
  229. }];
  230. }
  231. - (void)gotoSearchUser{
  232. YMSearchUserViewModel *searchUserVM = [[YMSearchUserViewModel alloc]initWithParams:@{}];
  233. [YMRouter openURL:stringFormat(@"%@%@",YM_ROUTER_URL_PREFIX,YM_ROUTER_SEARCH_USER) withUserInfo:@{
  234. RouterViewModel:searchUserVM
  235. } completion:nil];
  236. }
  237. - (void)openAdolescentModelPopup{
  238. YMOpenAdolescentModelPopupView *customView = [[YMOpenAdolescentModelPopupView alloc]init];
  239. YMPopupView *popupView = [YMPopupView initWithCustomView:customView parentView:nil popStyle:YMPopupStyleFade dismissStyle:YMDismissStyleFade];
  240. popupView.priority = 998;
  241. popupView.cornerRadius = adapt(10);
  242. popupView.rectCorners = UIRectCornerAllCorners;
  243. popupView.positionStyle = YMPositionStyleCenter;
  244. popupView.isHideBg = NO;
  245. popupView.bgAlpha = 0.3;
  246. @weakify(popupView)
  247. customView.noMoreRemindersButtonBlock = ^{
  248. @strongify(popupView)
  249. [popupView dismissWithStyle:YMDismissStyleFade duration:2.0];
  250. };
  251. customView.gotoAdolescentModelButtonBlock = ^{
  252. @strongify(popupView)
  253. [popupView dismissWithStyle:YMDismissStyleFade duration:2.0];
  254. YMAdolescentModelViewModel *adolescentModelVM = [[YMAdolescentModelViewModel alloc]initWithParams:@{
  255. ParamsCategoryType:@(YMAdolescentModelTypeSettingPassword)
  256. }];
  257. [YMRouter openURL:stringFormat(@"%@%@", YM_ROUTER_URL_PREFIX, YM_ROUTER_ADOLESCENT_MODEL) withUserInfo:@{
  258. RouterViewModel:adolescentModelVM
  259. } completion:nil];
  260. };
  261. [popupView pop];
  262. }
  263. - (void)closeAdolescentModelPopup{
  264. YMCloseAdolescentModelPopupView *customView = [[YMCloseAdolescentModelPopupView alloc]init];
  265. YMPopupView *popupView = [YMPopupView initWithCustomView:customView parentView:nil popStyle:YMPopupStyleFade dismissStyle:YMDismissStyleFade];
  266. popupView.priority = 998;
  267. popupView.cornerRadius = adapt(10);
  268. popupView.rectCorners = UIRectCornerAllCorners;
  269. popupView.positionStyle = YMPositionStyleCenter;
  270. popupView.isHideBg = NO;
  271. popupView.bgAlpha = 0.3;
  272. @weakify(popupView)
  273. customView.openOrCloseAdolescentModelButtonBlock = ^{
  274. @strongify(popupView)
  275. [popupView dismissWithStyle:YMDismissStyleFade duration:2.0];
  276. YMAdolescentModelViewModel *adolescentModelVM = [[YMAdolescentModelViewModel alloc]initWithParams:@{
  277. ParamsCategoryType:@(YMAdolescentModelTypeClosePassword)
  278. }];
  279. [YMRouter openURL:stringFormat(@"%@%@", YM_ROUTER_URL_PREFIX, YM_ROUTER_ADOLESCENT_MODEL) withUserInfo:@{
  280. RouterViewModel:adolescentModelVM
  281. } completion:nil];
  282. };
  283. customView.forgotPasswordBlock = ^{
  284. @strongify(popupView)
  285. [popupView dismissWithStyle:YMDismissStyleFade duration:2.0];
  286. };
  287. [popupView pop];
  288. }
  289. - (YMHomePageBannerViewModel *)bannerVM{
  290. if (!_bannerVM) {
  291. _bannerVM = [[YMHomePageBannerViewModel alloc]initWithParams:@{}];
  292. }
  293. return _bannerVM;
  294. }
  295. //- (YMHomePageListViewModel *)recommendVM{
  296. // if (!_recommendVM) {
  297. // _recommendVM = [[YMHomePageListViewModel alloc]initWithParams:@{
  298. // ParamsCategoryType:@(YMHomePageCategoryTypeRecommend)
  299. // }];
  300. // }
  301. // return _recommendVM;
  302. //}
  303. //
  304. //- (YMHomePageListViewModel *)maleGoldVM{
  305. // if (!_maleGoldVM) {
  306. // _maleGoldVM = [[YMHomePageListViewModel alloc]initWithParams:@{
  307. // ParamsCategoryType:@(YMHomePageCategoryTypeMaleGold)
  308. // }];
  309. // }
  310. // return _maleGoldVM;
  311. //}
  312. //
  313. //- (YMHomePageListViewModel *)onlineVM{
  314. // if (!_onlineVM) {
  315. // _onlineVM = [[YMHomePageListViewModel alloc]initWithParams:@{
  316. // ParamsCategoryType:@(YMHomePageCategoryTypeOnline)
  317. // }];
  318. // }
  319. // return _onlineVM;
  320. //}
  321. //
  322. //- (YMHomePageListViewModel *)sameCityVM{
  323. // if (!_sameCityVM) {
  324. // _sameCityVM = [[YMHomePageListViewModel alloc]initWithParams:@{
  325. // ParamsCategoryType:@(YMHomePageCategoryTypeSameCity)
  326. // }];
  327. // }
  328. // return _sameCityVM;
  329. //}
  330. //
  331. //- (YMHomePageListViewModel *)recommendForMaleVM{
  332. // if (!_recommendForMaleVM) {
  333. // _recommendForMaleVM = [[YMHomePageListViewModel alloc]initWithParams:@{
  334. // ParamsCategoryType:@(YMHomePageCategoryTypeRecommendForMale)
  335. // }];
  336. // }
  337. // return _recommendForMaleVM;
  338. //}
  339. - (YMHomePageListViewModel *)homeIndexVM {
  340. if (!_homeIndexVM) {
  341. _homeIndexVM = [[YMHomePageListViewModel alloc] initWithParams:@{ParamsCategoryType: @(YMHomePageCategoryTypeHomeIndex)}];
  342. _homeIndexVM.tabTitle = @"";
  343. _homeIndexVM.tabURLStr = HomeIndex;
  344. }
  345. return _homeIndexVM;
  346. }
  347. - (YMHomePageListViewModel *)homeSkillAnchorsVM {
  348. if (!_homeSkillAnchorsVM) {
  349. _homeSkillAnchorsVM = [[YMHomePageListViewModel alloc] initWithParams:@{ParamsCategoryType: @(YMHomePageCategoryTypeHomeSkillAnchors)}];
  350. _homeSkillAnchorsVM.tabTitle = @"";
  351. _homeSkillAnchorsVM.tabURLStr = HomeSkillAnchors;
  352. }
  353. return _homeSkillAnchorsVM;
  354. }
  355. - (YMHomePageListViewModel *)homeRecommendAnchorsVM {
  356. if (!_homeRecommendAnchorsVM) {
  357. _homeRecommendAnchorsVM = [[YMHomePageListViewModel alloc] initWithParams:@{ParamsCategoryType: @(YMHomePageCategoryTypeHomeRecommendAnchors)}];
  358. _homeRecommendAnchorsVM.tabTitle = @"";
  359. _homeRecommendAnchorsVM.tabURLStr = HomeRecommendAnchors;
  360. }
  361. return _homeRecommendAnchorsVM;
  362. }
  363. - (YMHomePageListViewModel *)homeRecommendVM {
  364. if (!_homeRecommendVM) {
  365. _homeRecommendVM = [[YMHomePageListViewModel alloc] initWithParams:@{ParamsCategoryType: @(YMHomePageCategoryTypeHomeRecommend)}];
  366. _homeRecommendVM.tabTitle = @"";
  367. _homeRecommendVM.tabURLStr = HomeRecommend;
  368. }
  369. return _homeRecommendVM;
  370. }
  371. - (YMHomePageListViewModel *)homeWCWVM {
  372. if (!_homeWCWVM) {
  373. _homeWCWVM = [[YMHomePageListViewModel alloc] initWithParams:@{ParamsCategoryType: @(YMHomePageCategoryTypeHomeWCW)}];
  374. _homeWCWVM.tabTitle = @"";
  375. _homeWCWVM.tabURLStr = HomeWCW;
  376. }
  377. return _homeWCWVM;
  378. }
  379. - (YMHomePageListViewModel *)homeOnlineListVM {
  380. if (!_homeOnlineListVM) {
  381. _homeOnlineListVM = [[YMHomePageListViewModel alloc] initWithParams:@{ParamsCategoryType: @(YMHomePageCategoryTypeHomeOnlineList)}];
  382. _homeOnlineListVM.tabTitle = @"";
  383. _homeOnlineListVM.tabURLStr = HomeOnlineList;
  384. }
  385. return _homeOnlineListVM;
  386. }
  387. - (YMHomePageListViewModel *)homeOnlineVM {
  388. if (!_homeOnlineVM) {
  389. _homeOnlineVM = [[YMHomePageListViewModel alloc] initWithParams:@{ParamsCategoryType: @(YMHomePageCategoryTypeHomeOnline)}];
  390. _homeOnlineVM.tabTitle = @"";
  391. _homeOnlineVM.tabURLStr = HomeOnline;
  392. }
  393. return _homeOnlineVM;
  394. }
  395. - (YMHomePageListViewModel *)homeGetDesignatedVM {
  396. if (!_homeGetDesignatedVM) {
  397. _homeGetDesignatedVM = [[YMHomePageListViewModel alloc] initWithParams:@{ParamsCategoryType: @(YMHomePageCategoryTypeHomeGetDesignated)}];
  398. _homeGetDesignatedVM.tabTitle = @"";
  399. _homeGetDesignatedVM.tabURLStr = HomeGetDesignated;
  400. }
  401. return _homeGetDesignatedVM;
  402. }
  403. - (YMHomePageListViewModel *)homeGetSameCityUserVM {
  404. if (!_homeGetSameCityUserVM) {
  405. _homeGetSameCityUserVM = [[YMHomePageListViewModel alloc] initWithParams:@{ParamsCategoryType: @(YMHomePageCategoryTypeHomeGetSameCityUser)}];
  406. _homeGetSameCityUserVM.tabTitle = @"";
  407. _homeGetSameCityUserVM.tabURLStr = HomeGetSameCityUser;
  408. }
  409. return _homeGetSameCityUserVM;
  410. }
  411. - (YMHomePageListViewModel *)homeActiveAnchorsVM {
  412. if (!_homeActiveAnchorsVM) {
  413. _homeActiveAnchorsVM = [[YMHomePageListViewModel alloc] initWithParams:@{ParamsCategoryType: @(YMHomePageCategoryTypeHomeActiveAnchors)}];
  414. _homeActiveAnchorsVM.tabTitle = @"";
  415. _homeActiveAnchorsVM.tabURLStr = HomeActiveAnchors;
  416. }
  417. return _homeActiveAnchorsVM;
  418. }
  419. - (YMHomePageListViewModel *)homeNewAnchorsVM {
  420. if (!_homeNewAnchorsVM) {
  421. _homeNewAnchorsVM = [[YMHomePageListViewModel alloc] initWithParams:@{ParamsCategoryType: @(YMHomePageCategoryTypeHomeNewAnchors)}];
  422. _homeNewAnchorsVM.tabTitle = @"";
  423. _homeNewAnchorsVM.tabURLStr = HomeNewAnchors;
  424. }
  425. return _homeNewAnchorsVM;
  426. }
  427. - (YMHomePageListViewModel *)homeCityAnchorsVM {
  428. if (!_homeCityAnchorsVM) {
  429. _homeCityAnchorsVM = [[YMHomePageListViewModel alloc] initWithParams:@{ParamsCategoryType: @(YMHomePageCategoryTypeHomeCityAnchors)}];
  430. _homeCityAnchorsVM.tabTitle = @"";
  431. _homeCityAnchorsVM.tabURLStr = HomeCityAnchors;
  432. }
  433. return _homeCityAnchorsVM;
  434. }
  435. - (YMHomePageListViewModel *)homeBannerVM {
  436. if (!_homeBannerVM) {
  437. _homeBannerVM = [[YMHomePageListViewModel alloc] initWithParams:@{ParamsCategoryType: @(YMHomePageCategoryTypeHomeBanner)}];
  438. _homeBannerVM.tabTitle = @"";
  439. _homeBannerVM.tabURLStr = HomeBanner;
  440. }
  441. return _homeBannerVM;
  442. }
  443. @end