ASHomeMainListModel.m 3.9 KB

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