// // ASHomeMainListModel.m // Asteria // // Created by iOS on 2023/6/6. // #import "ASHomeMainListModel.h" @implementation ASHomeMainListModel + (NSDictionary *)mj_objectClassInArray{ return @{ @"productList" : [ASProductBaseModel class], @"titleArr" : [ASHomeCategoryModel class], }; } - (ASJumpModel *)toJumpM { ASJumpModel *m = [ASJumpModel new]; m.title = self.title; m.type = self.type; m.link = self.typeId; m.image = self.imgUrl; return m; } + (NSArray *)homeDemoDatas { ASHomeMainListModel *cateM = [ASHomeMainListModel cateList]; ASHomeMainListModel *tipM = [ASHomeMainListModel tipList]; ASHomeMainListModel *bestSellM = [ASHomeMainListModel bestSellList]; ASHomeMainListModel *newinM = [ASHomeMainListModel newInList]; ASHomeMainListModel *imgM = [ASHomeMainListModel imgModel]; ASHomeMainListModel *flashM = [ASHomeMainListModel flashdealList]; ASHomeMainListModel *contactM = [ASHomeMainListModel contactModel]; ASHomeMainListModel *lookM = [ASHomeMainListModel lookM]; ASHomeMainListModel *imgM2 = [ASHomeMainListModel imgModel]; return @[cateM,tipM,bestSellM,newinM,imgM,flashM,contactM,lookM,imgM2]; } + (ASHomeMainListModel *)cateList { ASHomeMainListModel *model = [ASHomeMainListModel new]; model.showType = 1; NSMutableArray *arr = [NSMutableArray array]; for (int i=0; i<6; i++) { ASHomeCategoryModel *m = [ASHomeCategoryModel demoModel]; [arr addObject:m]; } model.titleArr = arr; return model; } + (ASHomeMainListModel *)tipList { ASHomeMainListModel *model = [ASHomeMainListModel new]; model.showType = 2; return model; } + (ASHomeMainListModel *)bestSellList { ASHomeMainListModel *model = [ASHomeMainListModel new]; model.showType = 3; model.title = @"BEST SELLER"; NSMutableArray *arr = [NSMutableArray array]; for (int i=0; i<4; i++) { ASProductBaseModel *m = [ASProductBaseModel demoModel]; [arr addObject:m]; } model.productList = arr; return model; } + (ASHomeMainListModel *)newInList { ASHomeMainListModel *model = [ASHomeMainListModel new]; model.showType = 4; model.title = @"New In"; NSMutableArray *arr = [NSMutableArray array]; for (int i=0; i<8; i++) { ASProductBaseModel *m = [ASProductBaseModel demoModel]; [arr addObject:m]; } model.productList = arr; return model; } + (ASHomeMainListModel *)imgModel { ASHomeMainListModel *model = [ASHomeMainListModel new]; model.showType = 5; model.title = @""; model.typeId = @"325"; model.imgUrl = @"https://img.pptjia.com/image/20200604/d9bd62a1a41bae8a7a60b579887e2cc1.jpg"; return model; } + (ASHomeMainListModel *)flashdealList { ASHomeMainListModel *model = [ASHomeMainListModel new]; model.showType = 6; model.title = @"FLASH DEAL"; NSDate *now = [[NSDate alloc] init]; NSDate *todayStart = [NSCalendar.currentCalendar startOfDayForDate:now]; NSDate *nextStart = [NSDate dateWithTimeIntervalSince1970:todayStart.timeIntervalSince1970 + 24*60*60]; model.endtime = nextStart.timeIntervalSince1970; NSMutableArray *arr = [NSMutableArray array]; for (int i=0; i<8; i++) { ASProductBaseModel *m = [ASProductBaseModel demoModel]; [arr addObject:m]; } model.productList = arr; return model; } + (ASHomeMainListModel *)contactModel { ASHomeMainListModel *model = [ASHomeMainListModel new]; model.showType = 5; model.title = @"wholesale"; model.imgUrl = @"https://img-qn.51miz.com/Element/00/64/88/86/ecec8108_E648886_37e0b3c6.jpg"; return model; } + (ASHomeMainListModel *)lookM { ASHomeMainListModel *model = [ASHomeMainListModel new]; model.showType = 7; model.title = @"SHOP BY LOOKING"; NSMutableArray *arr = [NSMutableArray array]; for (int i=0; i<8; i++) { ASHomeCategoryModel *m = [ASHomeCategoryModel demoModel]; m.webUrl = @"https://baidu.com"; m.imgUrl = @"https://img2.baidu.com/it/u=3089287678,3179663495&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500"; [arr addObject:m]; } model.titleArr = arr; return model; } @end