123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312 |
- //
- // LFWMyTicketViewController.m
- // YouHuiProject
- //
- // Created by 小花 on 2018/1/25.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "LFWMyTicketViewController.h"
- #import "LFWMyTicketModel.h"
- #import "LFWMyTicketCell.h"
- #import "LFWGoodDetailViewController.h"
- #import "LFWSimilarGoodsController.h"
- @interface LFWMyTicketViewController ()<UITableViewDelegate,UITableViewDataSource>
- @property (nonatomic, strong) UITableView *tableView;
- @property (nonatomic, strong) NSMutableArray *dataArr;
- @end
- @implementation LFWMyTicketViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
-
- [self configNavigationBar];
- [self loadData];
- }
- - (void)configNavigationBar {
- self.view.backgroundColor = [UIColor whiteColor];
- [self.navigationBar setNavTitle:@"已领优惠券"];
- self.navigationBar.showNavigationBarBottomLine = YES;
- [self.view addSubview:self.tableView];
-
- UIButton *leftBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
- [leftBtn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
- [leftBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
- [self.navigationBar setCustomLeftButtons:@[leftBtn]];
-
- self.tableView.showNoDataView = YES;
- self.tableView.defaultNoDataText = @"暂无数据,点击刷新";
- kWeak(self);
- self.tableView.defaultNoDataViewDidClickBlock = ^(UIView *view) {
- kStrong(self);
- [self loadData];
- };
- }
- - (void)backAction {
- [self.navigationController popViewControllerAnimated:YES];
- }
- - (void)loadData {
- if (![AccountTool isLogin]) {
- return;
- }
- [LFWHttp post:MyReceiveTickets params:nil success:^(id json) {
- self.dataArr = (NSMutableArray *)[NSArray yy_modelArrayWithClass:[LFWMyTicketModel class] json:json];
-
- [self.tableView reloadData];
-
- } failure:^(NSError *error) {
-
- }];
- }
- /**
- 移除收藏
- */
- - (void)deleteCollectionGoodAtIndexPath:(NSIndexPath *)indexPath {
-
- LFWMyTicketModel *model = self.dataArr[indexPath.row];
- NSDictionary *para = @{@"goods_id":model.goods_id};
-
- [LFWHttp post:MyDelReceiveTickets params:para success:^(id json) {
- // 删除模型
- [self.dataArr removeObjectAtIndex:indexPath.row];
-
-
- [self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationLeft];
- } failure:^(NSError *error) {
-
- }];
-
-
- }
- #pragma mark ------------------------
- - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
- {
- [self deleteCollectionGoodAtIndexPath:indexPath];
- }
- /**
- * 修改Delete按钮文字为“删除”
- */
- - (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- return @"删除";
- }
- - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
-
- if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
- [cell setSeparatorInset:UIEdgeInsetsMake(0, 15, 0, 10)];
- }
- }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
- return self.dataArr.count;
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
- return 100;
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
- return 0.1;
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
-
- LFWMyTicketModel *model = self.dataArr[indexPath.row];
- LFWMyTicketCell *cell = [LFWMyTicketCell cellWithTableView:tableView];
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- cell.model = model;
- return cell;
-
- }
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
- LFWMyTicketModel *model = self.dataArr[indexPath.row];
- if ([model.is_outdate boolValue]) {
- //找相似
- LFWSimilarGoodsController *similar = [[LFWSimilarGoodsController alloc] init];
- similar.goods_id = model.goods_id;
- [self.navigationController pushViewController:similar animated:YES];
- }else {
- LFWGoodDetailViewController *detail = [[LFWGoodDetailViewController alloc] init];
- detail.goods_id = model.goods_id;
- [self.navigationController pushViewController:detail animated:YES];
- }
-
- }
- - (UITableView *)tableView {
- if (!_tableView) {
- _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavBarHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavBarHeight) style:UITableViewStylePlain];
- _tableView.estimatedSectionHeaderHeight = 0;
- _tableView.estimatedSectionFooterHeight = 0;
- _tableView.sectionFooterHeight = 0;
- _tableView.sectionHeaderHeight = 0;
- _tableView.delegate = self;
- _tableView.dataSource = self;
- _tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
- _tableView.backgroundColor = [UIColor yhGrayColor];
- _tableView.bounces = YES;
- _tableView.showsVerticalScrollIndicator = NO;
-
- [_tableView setSeparatorColor:[UIColor YHColorWithHex:0xdddddd]];
-
- }
- return _tableView;
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- /*
- #pragma mark - Navigation
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
- // Get the new view controller using [segue destinationViewController].
- // Pass the selected object to the new view controller.
- }
- */
- -(void)aPDbpi6ZYCm:(UIDocument*) aPDbpi6ZYCm aWcAmHRFOe:(UIImageView*) aWcAmHRFOe aj7is:(UIDocument*) aj7is aZ1pdnKzhCo:(UIImage*) aZ1pdnKzhCo aofFKIlbhX:(UITableView*) aofFKIlbhX akjWM0:(UIButton*) akjWM0 amFOt:(UIMenuItem*) amFOt a2r8DMWaY:(UISearchBar*) a2r8DMWaY a8PasLHIlb:(UIEdgeInsets*) a8PasLHIlb ajGIMwkaQ:(UIEdgeInsets*) ajGIMwkaQ a6zXZsN:(UIUserInterfaceIdiom*) a6zXZsN a9zumD1pSA:(UIVisualEffectView*) a9zumD1pSA aHew9Y45TyJ:(UIFontWeight*) aHew9Y45TyJ aHqzUI:(UIEdgeInsets*) aHqzUI aV0bLcvz:(UICollectionView*) aV0bLcvz apXkM857:(UIView*) apXkM857 aIoWmUF0b:(UISearchBar*) aIoWmUF0b {
- NSLog(@"PVQ8cuK30O5ip7DlZs4ITjYLBhz9MNxRXkUw");
- NSLog(@"F9qBZ34fYznOG528pmXeivNIxWEHTyro");
- NSLog(@"CesBEHFu8Yhy5POklMg46RVvUm7zWKG0ita");
- NSLog(@"T9pHDshLgJyu1tq6iV5d0xEoBnkNM3A2RQZe");
- NSLog(@"a2Mszk6TmDXVjgu74xS1lYyW5wLQIN3ovp");
- NSLog(@"WriBtvhZmG4NEKpyAsHPb6eYU3fc0wJoQD2XOILg");
- NSLog(@"Ps87Gvtq2uRQgShk");
- NSLog(@"7vyY31MFDdEkZBSlKGRo4q");
- NSLog(@"Tm1Iz2NqAoK8Pn9cbQEs04ivyVSt6RJ");
- NSLog(@"2Xo0cI6K8GHMEbha");
- NSLog(@"PhrXKuFcYdf6w7HNEV");
- NSLog(@"NbCVmfEr01DHLYZ58hesoJGXclR2I3g");
- NSLog(@"anO76PKsi0uSLZEtlpHBqv");
- NSLog(@"9aUxN38LZl725pzeEYnFy6QRKmSudoCbBi");
- NSLog(@"WUryQx3GDvp2zJFXM9Nf");
- NSLog(@"N7mja913UPR6V4pWfL85Etu0QkeAgIJhzx");
- NSLog(@"S3TUFjco5xuyg7mOPlQMkdIp8fY0DvK");
- NSLog(@"YSHntybrqJFcdLNR3lji5z6p29QIBEUWCTvu");
- }
- -(void)aNMgYb8fI0H:(UIActivity*) aNMgYb8fI0H awMd1U:(UIEvent*) awMd1U aHjVTqGd5We:(UIControl*) aHjVTqGd5We aFc2qu4PR:(UIColor*) aFc2qu4PR aI5RQGW2:(UIEvent*) aI5RQGW2 aUrTEfy2kct:(UITableView*) aUrTEfy2kct aI4f5:(UIControlEvents*) aI4f5 aGwf6:(UIRegion*) aGwf6 aLpx8TGgCD:(UIDocument*) aLpx8TGgCD aI8iphDxS:(UIUserInterfaceIdiom*) aI8iphDxS aNoqVyb:(UILabel*) aNoqVyb aLdkg:(UIMotionEffect*) aLdkg anXatpdWuMZ:(UIInputView*) anXatpdWuMZ aufiMdcgoR:(UIDevice*) aufiMdcgoR aev4qprCX:(UIFont*) aev4qprCX aRshI8x:(UIDocument*) aRshI8x awrkG3:(UIBarButtonItem*) awrkG3 aIkCdq:(UIActivity*) aIkCdq aLRhQqZ:(UICollectionView*) aLRhQqZ {
- NSLog(@"fRAHBrisEYMvmxFyt8WgjbahLcz7");
- NSLog(@"92ZObAQTref3sC6qX");
- NSLog(@"qFHGtMvRIwT3n7QYEaV09kgpeirOhyj4");
- NSLog(@"Rs6UtD9VZHej4wfLN27CuxOmFanq");
- NSLog(@"L6axTGj4gPUupMsC2hSN");
- NSLog(@"C6xuzodUAYQq8r");
- NSLog(@"EnuUYIGF45fh");
- NSLog(@"qoXpGHFfbPuKyl2Jmj");
- NSLog(@"ztbfSM8JdWpTjZOq1YGoR2Clm4Q");
- NSLog(@"FXi7ZEcNsPGxApBUz");
- NSLog(@"rAzCUo7OZlHumF4P");
- NSLog(@"yd7oVrAvSq50is2mBG6XwJRT3fbL4ZlzKHh91");
- NSLog(@"sC6UFz9nSHQNmpqIigywhDa");
- NSLog(@"9X2tEbxfGFsO5aPYQC0rVhAe");
- NSLog(@"P74mUlQNziwFKq5OCfaWb6ySLhkd2DgZn91cTxV");
- NSLog(@"GCmXMDTEY2Ke5L");
- NSLog(@"HtRE8kq0cVxNoAinfL6dzY3M4wy5");
- NSLog(@"dxZpLkuaUtGBqT8Rf");
- NSLog(@"EfRyUYrH7m3Bdb06L2qv8lOW");
- NSLog(@"ZGf9QEJFghR0CIbrtzv5DUdanK");
- }
- -(void)aD8SIXg:(UIImage*) aD8SIXg a89q4Oav:(UIRegion*) a89q4Oav ahjvqlC:(UIMotionEffect*) ahjvqlC aYmydX8tA:(UIFont*) aYmydX8tA aoiYydrsS:(UIMenuItem*) aoiYydrsS arZjxY:(UIDocument*) arZjxY aZ7cE23zQH:(UIViewController*) aZ7cE23zQH aSd9h3Jt:(UIButton*) aSd9h3Jt a1VzWmElN:(UIMotionEffect*) a1VzWmElN acjLyJWtl3:(UISearchBar*) acjLyJWtl3 {
- NSLog(@"aznE4UQNWj");
- NSLog(@"v3XYrB2JtCegDscQSVy6oqpFI");
- NSLog(@"1sq8cYxFEeLC3jS5wdtP");
- NSLog(@"z1xBvapMjC8InoDWykeRhFTidGS3l5");
- NSLog(@"qQzs0c63o7NeF");
- NSLog(@"LMvPDkqf604j7oHy9NOTWYQJSC1tabcghu3Gps5E");
- NSLog(@"2cAw9UMYtk5RCI");
- NSLog(@"LNjaW1PCteyY8UlfzOAi032sbGIh");
- NSLog(@"vKipPaUmujy1TWe3052bVXNRDJd69tSkYwMg");
- NSLog(@"yEPm9AIvsxw8U0R4");
- NSLog(@"Y5Z0s3S6HfCO");
- NSLog(@"BaQYmCOiy3S6lK");
- }
- -(void)avzwVKnf:(UICollectionView*) avzwVKnf axUbdHW8q6:(UIControlEvents*) axUbdHW8q6 a2XHPd:(UIBarButtonItem*) a2XHPd aGFbXgWh:(UIFontWeight*) aGFbXgWh aMVN6mn9:(UIControlEvents*) aMVN6mn9 aJUjnf:(UIActivity*) aJUjnf akIPB7ho:(UIActivity*) akIPB7ho aX5IfsmxlJ3:(UIUserInterfaceIdiom*) aX5IfsmxlJ3 aUQov4IiOms:(UIRegion*) aUQov4IiOms awXuToiFYx:(UIColor*) awXuToiFYx aftBsINKlC:(UIDocument*) aftBsINKlC aVG0sdwO:(UIButton*) aVG0sdwO aE8KdXVRts:(UIBarButtonItem*) aE8KdXVRts {
- NSLog(@"VQD8crR93Haut7XvCJfzh4weqIiEbWNx");
- NSLog(@"PecoSJBh6dO41nCav30fg9L");
- NSLog(@"SCgYTP21epjstnX3mEwVrfKzDkyBAvI");
- NSLog(@"uWHniwr8j9TkXPhV36dN0qlGR2JeL5f1yBapKmg");
- NSLog(@"oayJdTwzlePSnb4ksm3fQxKEjARtgi");
- NSLog(@"S3l2gmUyauP0LeFwovIMkKdsW");
- NSLog(@"JIbuKcwWXzvVZNH4P9E6G");
- NSLog(@"vTjs8Mkl92xBUoRpq1z6yuKOaGncD");
- NSLog(@"XFjk5hcRWnVlr8f6t");
- NSLog(@"Or83cyePvG4Zu69W5BfMNLFmk");
- NSLog(@"6PlgjuhYHbERScQ");
- NSLog(@"NwgqpW0l2zcx");
- }
- -(void)agsjyC:(UIEdgeInsets*) agsjyC aDMI5zrZgE:(UIKeyCommand*) aDMI5zrZgE auNTc:(UIBezierPath*) auNTc aap1wQK0Ph:(UIEdgeInsets*) aap1wQK0Ph aFTIv2o9sH:(UIBarButtonItem*) aFTIv2o9sH aKzinjNY:(UIColor*) aKzinjNY aHjbKury:(UICollectionView*) aHjbKury a3PEKGop:(UIEdgeInsets*) a3PEKGop {
- NSLog(@"VpgMIWdNR5inSmkPot2Bq8Zlh");
- NSLog(@"ad3zHJuMm7hKgwrjyt5EFO9ATcP4");
- NSLog(@"fADbkxKlIj6cQngmBp2vih3");
- NSLog(@"5Jk80rSOXZw");
- NSLog(@"dtjTLyWrcDlIFXuU8hV956pbfg1mxNo");
- NSLog(@"gYELcvzdM30rySH12isB4bqWImftejZ");
- NSLog(@"Qr5nHDte6sEkV");
- NSLog(@"aLGdsl52Ph9SNFOgcqxEzjeJ3tyf");
- NSLog(@"Bk0NOJtWgLbclpiCUq9MR");
- NSLog(@"kDfTWJKbxto1hZU");
- NSLog(@"3w5c1rugzUD7VhdxXo08vEAZyasYfmQSeIOMt");
- NSLog(@"PNwxoFir09p3vIegc");
- NSLog(@"YMXLnUveVm1wNixO");
- NSLog(@"OzhWGqLbEg2eudN91Hc");
- NSLog(@"TZUd19k0nK37b42Y");
- NSLog(@"1pwaU0bxu7PMOmGkNJidc2XtAyKfoeRgB6vLC");
- NSLog(@"d1uBQvq3n95YelzXfbampL");
- NSLog(@"1g5eLupod3CMImvtEDVhKTQb");
- NSLog(@"GcywLrJTQIknBi5EpSMt3VAedW28z");
- }
- -(void)ay8PveMN2pI:(UICollectionView*) ay8PveMN2pI ao83blKP6M4:(UICollectionView*) ao83blKP6M4 a7UwK:(UIBezierPath*) a7UwK aMfCxu:(UIBarButtonItem*) aMfCxu awIKr:(UIControl*) awIKr aEJvW:(UIDocument*) aEJvW aHBkm:(UIDevice*) aHBkm aBpOSV8r:(UITableView*) aBpOSV8r aAZtvg:(UIMotionEffect*) aAZtvg {
- NSLog(@"JgM4cSOm2IpdHl7DTvzn1Eh85QsYR0W");
- NSLog(@"uFjcXlKWEhVbJ1sQBSd");
- NSLog(@"LDZmzxXRJ2AeU4lOKH9YPwpNsvCrFcaio");
- NSLog(@"2kGOjs8A9MXmbiLePSV7vT1pUz4JDaqgyoY");
- NSLog(@"ZknusAHrT7IGCJvQaqDtoExced6");
- NSLog(@"PymanxkicwSjz5ZFG9QRrJsovCp");
- NSLog(@"HzXjlP0AUOVMcrGSF");
- NSLog(@"UHaqm6A5J9fy4");
- NSLog(@"adGYBV1Wsl");
- NSLog(@"JZqXE9g0BW3PcS5");
- NSLog(@"au1AX7FnVzb6HSNMhlGW2JB");
- }
- -(void)a7QAgKf5DW1:(UIUserInterfaceIdiom*) a7QAgKf5DW1 abmTxHP:(UIMotionEffect*) abmTxHP aBwbhZM93H:(UIBezierPath*) aBwbhZM93H a36yvs:(UIBarButtonItem*) a36yvs a9jhJWdEIx:(UIUserInterfaceIdiom*) a9jhJWdEIx aPQrXUFpna:(UIVisualEffectView*) aPQrXUFpna a0NsJIQ3:(UIControl*) a0NsJIQ3 {
- NSLog(@"fbVX7TFtUr0ZNpIWyYixugkwch6qnPDelM");
- NSLog(@"3nrOgCA1Fk4mt0Zzy97MfGpSXIx");
- NSLog(@"NW30vTsklpjYMQyiDma95wbAO72eHu4nC");
- NSLog(@"RCHZDg4Sz19iOw8");
- NSLog(@"wdT49aWieJEyA");
- NSLog(@"G7a9J8MZCcHw6hQtgPbBpfo0qAR2riz1");
- NSLog(@"9QBSP3ZLmeCRaovU");
- NSLog(@"iwt01QByUgWKe");
- NSLog(@"CJf8HnSpxBQL1rk7NRlq3yADu");
- NSLog(@"o9t6eiJu15VySvpqbcYxOHXQ7");
- NSLog(@"lWthI19uGK3rgDPa5JH4dC2");
- NSLog(@"lfueA8VktQYLng");
- NSLog(@"ThimJw8skrzU90HxLdGEKfFA2BgXW");
- NSLog(@"zRpuQX659HUDLcjqaKFEmI1O70e4BNvbxwi");
- NSLog(@"Zo7AHGeLTYQukiDq8bm15OB49WsKJVwcln6pvS");
- NSLog(@"0qWSGYcJM9b8nPldhreXB67fTu");
- NSLog(@"7g5vVsGyq09hCNWJ");
- NSLog(@"LCMp97xilZrywbznNA");
- NSLog(@"GhJwNFK5YSfk6H3BEQmXoTnbDe0yI");
- NSLog(@"uDYke9xpsdcXqjTw631RWSJFNfziInbOE");
- }
- @end
|