ASHomeMainListModel.m 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. //
  2. // ASHomeMainListModel.m
  3. // Asteria
  4. //
  5. // Created by iOS on 2023/6/6.
  6. //
  7. #import "ASHomeMainListModel.h"
  8. @implementation ASHomeMainListModel
  9. + (NSDictionary *)mj_objectClassInArray{
  10. return @{
  11. @"productList" : [ASProductBaseModel class],
  12. @"titleArr" : [ASHomeCategoryModel class],
  13. };
  14. }
  15. - (ASJumpModel *)toJumpM {
  16. ASJumpModel *m = [ASJumpModel new];
  17. m.title = self.title;
  18. m.type = self.type;
  19. m.link = self.typeId;
  20. m.image = self.imgUrl;
  21. return m;
  22. }
  23. + (NSArray <ASHomeMainListModel *>*)homeDemoDatas {
  24. ASHomeMainListModel *cateM = [ASHomeMainListModel cateList];
  25. ASHomeMainListModel *tipM = [ASHomeMainListModel tipList];
  26. ASHomeMainListModel *bestSellM = [ASHomeMainListModel bestSellList];
  27. ASHomeMainListModel *newinM = [ASHomeMainListModel newInList];
  28. ASHomeMainListModel *imgM = [ASHomeMainListModel imgModel];
  29. ASHomeMainListModel *flashM = [ASHomeMainListModel flashdealList];
  30. ASHomeMainListModel *contactM = [ASHomeMainListModel contactModel];
  31. ASHomeMainListModel *lookM = [ASHomeMainListModel lookM];
  32. ASHomeMainListModel *imgM2 = [ASHomeMainListModel imgModel];
  33. return @[cateM,tipM,bestSellM,newinM,imgM,flashM,contactM,lookM,imgM2];
  34. }
  35. + (ASHomeMainListModel *)cateList {
  36. ASHomeMainListModel *model = [ASHomeMainListModel new];
  37. model.showType = 1;
  38. NSMutableArray *arr = [NSMutableArray array];
  39. for (int i=0; i<6; i++) {
  40. ASHomeCategoryModel *m = [ASHomeCategoryModel demoModel];
  41. [arr addObject:m];
  42. }
  43. model.titleArr = arr;
  44. return model;
  45. }
  46. + (ASHomeMainListModel *)tipList {
  47. ASHomeMainListModel *model = [ASHomeMainListModel new];
  48. model.showType = 2;
  49. return model;
  50. }
  51. + (ASHomeMainListModel *)bestSellList {
  52. ASHomeMainListModel *model = [ASHomeMainListModel new];
  53. model.showType = 3;
  54. model.title = @"BEST SELLER";
  55. NSMutableArray *arr = [NSMutableArray array];
  56. for (int i=0; i<4; i++) {
  57. ASProductBaseModel *m = [ASProductBaseModel demoModel];
  58. [arr addObject:m];
  59. }
  60. model.productList = arr;
  61. return model;
  62. }
  63. + (ASHomeMainListModel *)newInList {
  64. ASHomeMainListModel *model = [ASHomeMainListModel new];
  65. model.showType = 4;
  66. model.title = @"New In";
  67. NSMutableArray *arr = [NSMutableArray array];
  68. for (int i=0; i<8; i++) {
  69. ASProductBaseModel *m = [ASProductBaseModel demoModel];
  70. [arr addObject:m];
  71. }
  72. model.productList = arr;
  73. return model;
  74. }
  75. + (ASHomeMainListModel *)imgModel {
  76. ASHomeMainListModel *model = [ASHomeMainListModel new];
  77. model.showType = 5;
  78. model.title = @"";
  79. model.typeId = @"325";
  80. model.imgUrl = @"https://img.pptjia.com/image/20200604/d9bd62a1a41bae8a7a60b579887e2cc1.jpg";
  81. return model;
  82. }
  83. + (ASHomeMainListModel *)flashdealList {
  84. ASHomeMainListModel *model = [ASHomeMainListModel new];
  85. model.showType = 6;
  86. model.title = @"FLASH DEAL";
  87. NSDate *now = [[NSDate alloc] init];
  88. NSDate *todayStart = [NSCalendar.currentCalendar startOfDayForDate:now];
  89. NSDate *nextStart = [NSDate dateWithTimeIntervalSince1970:todayStart.timeIntervalSince1970 + 24*60*60];
  90. model.endtime = nextStart.timeIntervalSince1970;
  91. NSMutableArray *arr = [NSMutableArray array];
  92. for (int i=0; i<8; i++) {
  93. ASProductBaseModel *m = [ASProductBaseModel demoModel];
  94. [arr addObject:m];
  95. }
  96. model.productList = arr;
  97. return model;
  98. }
  99. + (ASHomeMainListModel *)contactModel {
  100. ASHomeMainListModel *model = [ASHomeMainListModel new];
  101. model.showType = 5;
  102. model.title = @"wholesale";
  103. model.imgUrl = @"https://img-qn.51miz.com/Element/00/64/88/86/ecec8108_E648886_37e0b3c6.jpg";
  104. return model;
  105. }
  106. + (ASHomeMainListModel *)lookM {
  107. ASHomeMainListModel *model = [ASHomeMainListModel new];
  108. model.showType = 7;
  109. model.title = @"SHOP BY LOOKING";
  110. NSMutableArray *arr = [NSMutableArray array];
  111. for (int i=0; i<8; i++) {
  112. ASHomeCategoryModel *m = [ASHomeCategoryModel demoModel];
  113. m.webUrl = @"https://baidu.com";
  114. m.imgUrl = @"https://img2.baidu.com/it/u=3089287678,3179663495&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500";
  115. [arr addObject:m];
  116. }
  117. model.titleArr = arr;
  118. return model;
  119. }
  120. @end