YMDynamicViewModel.m 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // YMDynamicViewModel.m
  3. // MSYOUPAI
  4. //
  5. // Created by YoMi on 2024/2/26.
  6. // Copyright © 2024 MS. All rights reserved.
  7. //
  8. #import "YMDynamicViewModel.h"
  9. #import "YMAdvertModel.h"
  10. #import "YMAdolescentModelViewModel.h"
  11. @interface YMDynamicViewModel ()
  12. /// 动态ViewModel列表
  13. @property (nonatomic, strong, readwrite) NSArray <YMDynamicListViewModel *>*dynamicVMListDataArray;
  14. /// 推荐VM
  15. @property (nonatomic, strong) YMDynamicListViewModel *recommendVM;
  16. /// 关注VM
  17. @property (nonatomic, strong) YMDynamicListViewModel *followVM;
  18. @end
  19. @implementation YMDynamicViewModel
  20. - (void)ym_initialize{
  21. [super ym_initialize];
  22. self.dynamicVMListDataArray = @[
  23. self.recommendVM,
  24. self.followVM,
  25. ];
  26. }
  27. - (void)gotoDynamicMessages{
  28. YMDynamicMessagesViewModel *dynamicMessagesVM = [[YMDynamicMessagesViewModel alloc]initWithParams:@{}];
  29. [YMRouter openURL:stringFormat(@"%@%@", YM_ROUTER_URL_PREFIX, YM_ROUTER_DYNAMIC_MESSAGES) withUserInfo:@{
  30. RouterViewModel:dynamicMessagesVM
  31. } completion:nil];
  32. }
  33. - (YMDynamicListViewModel *)recommendVM{
  34. if (!_recommendVM) {
  35. _recommendVM = [[YMDynamicListViewModel alloc]initWithParams:@{
  36. ParamsCategoryType:@(YMDynamicCategoryTypeRecommend)
  37. }];
  38. }
  39. return _recommendVM;
  40. }
  41. - (YMDynamicListViewModel *)followVM{
  42. if (!_followVM) {
  43. _followVM = [[YMDynamicListViewModel alloc]initWithParams:@{
  44. ParamsCategoryType:@(YMDynamicCategoryTypeFollow)
  45. }];
  46. }
  47. return _followVM;
  48. }
  49. @end