123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304 |
- //
- // YZMAMyTicketViewController.m
- // YouHuiProject
- //
- // Created by 小花 on 2018/1/25.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "YZMAMyTicketViewController.h"
- #import "YZMAMyTicketModel.h"
- #import "YZMAMyTicketCell.h"
- #import "YZMAGoodDetailViewController.h"
- #import "YZMASimilarGoodsController.h"
- @interface YZMAMyTicketViewController ()<UITableViewDelegate,UITableViewDataSource>
- @property (nonatomic, strong) UITableView *tableView;
- @property (nonatomic, strong) NSMutableArray *dataArr;
- @end
- @implementation YZMAMyTicketViewController
- - (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;
- }
- [YZMAHttp post:MyReceiveTickets params:nil success:^(id json) {
- self.dataArr = (NSMutableArray *)[NSArray yy_modelArrayWithClass:[YZMAMyTicketModel class] json:json];
-
- [self.tableView reloadData];
-
- } failure:^(NSError *error) {
-
- }];
- }
- /**
- 移除收藏
- */
- - (void)deleteCollectionGoodAtIndexPath:(NSIndexPath *)indexPath {
-
- YZMAMyTicketModel *model = self.dataArr[indexPath.row];
- NSDictionary *para = @{@"goods_id":model.goods_id};
-
- [YZMAHttp 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 {
-
- YZMAMyTicketModel *model = self.dataArr[indexPath.row];
- YZMAMyTicketCell *cell = [YZMAMyTicketCell cellWithTableView:tableView];
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- cell.model = model;
- cell.saimarClick = ^{
- //找相似
- YZMASimilarGoodsController *similar = [[YZMASimilarGoodsController alloc] init];
- similar.goods_id = model.goods_id;
- [self.navigationController pushViewController:similar animated:YES];
- };
- return cell;
-
- }
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
- YZMAMyTicketModel *model = self.dataArr[indexPath.row];
- YZMAGoodDetailViewController *detail = [[YZMAGoodDetailViewController alloc] init];
- DetailRequestModel *requestModel = [[DetailRequestModel alloc] initWithId:model.goods_id
- is_coupon:model.is_coupon
- coupon_price:model.coupon_price
- price:model.price
- discount_price:model.discount_price
- commission_rate:model.commission_rate
- coupon_start_time:model.coupon_start_time
- coupon_end_time:model.coupon_end_time];
- detail.requestModel = requestModel;
- [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)asD7U2:(UISwitch*) asD7U2 aAFSMnL2:(UIMenuItem*) aAFSMnL2 a1Pf9cWnU:(UIDevice*) a1Pf9cWnU aZT2dLUK:(UIButton*) aZT2dLUK aiROnTWtv4:(UIColor*) aiROnTWtv4 {
- NSLog(@"DrG2FsycqaSU51");
- NSLog(@"IvwxPT3mt5zVsAa0q2p8Mud7UoOe9kh6CDScHRKl");
- NSLog(@"QOYvku5hKnNPdImfRZHJbirj9");
- NSLog(@"Kp5nN2AP7mWZJDXEOkvyltgw8eCx9VR4Ifj3HBd");
- NSLog(@"tzBdI2QnPVk04ry1ApTUmhKfF");
- NSLog(@"Srw9gL7Os6BmMpDnTkNKxUAfaeJHW");
- NSLog(@"sueZKhc3QoyElBnP6C1p8GiXaWbvMqkR4F9VOm");
- NSLog(@"bpgchnldIT3e8irWfuUXNKaHBqVZtz");
- NSLog(@"Hoiln43Z7JKGf");
- NSLog(@"oaT10y4niMwKOsGcpUrBHL2XYqeuzAFQS8");
- NSLog(@"gD1vmXWywuRSIoKF3esQUda9CnPc");
- NSLog(@"4cnELDAOfb8hQrVjIiwPkCdt0KpBueX2y6ZmNTH");
- NSLog(@"BGJdqu8kyo1jHzNfpgD4YmnA9cbt2OsW3vVCeUrR");
- NSLog(@"1WH3NM4eyAxid8SqV0upRTK");
- NSLog(@"i0HmCIl2wpMcA3Tdt");
- NSLog(@"BHx40KCJnYa");
- NSLog(@"pBR4I8csw9DkUdiWf");
- }
- -(void)a0FHN9ez:(UIAlertView*) a0FHN9ez aaqhbnMeIv:(UITableView*) aaqhbnMeIv a3eJld:(UIEdgeInsets*) a3eJld a08Upw:(UIWindow*) a08Upw a6OW9H2bB43:(UIEdgeInsets*) a6OW9H2bB43 aqCUO:(UIVisualEffectView*) aqCUO asXoHk9ArM:(UIUserInterfaceIdiom*) asXoHk9ArM aBinG:(UIDocument*) aBinG avKf07:(UIUserInterfaceIdiom*) avKf07 apRdfDIys7e:(UIBezierPath*) apRdfDIys7e a6PuGfq8pRo:(UIButton*) a6PuGfq8pRo aFGrpRobh6P:(UIViewController*) aFGrpRobh6P avJjr8d3oG:(UIUserInterfaceIdiom*) avJjr8d3oG {
- NSLog(@"Sh2OoZ0UN4JMFdQm9ejRrupf5txzLcGn");
- NSLog(@"SsOkabDpKftAiYBIGuUTgQw6MNvRc2Lo");
- NSLog(@"LBp1HktoDVTWIYm2q46E");
- NSLog(@"EFS4CIwb2YrmlMJHU0fD7yd");
- NSLog(@"AdctGYWVZqx");
- NSLog(@"cPk72bZl1LSGjQsWYUHeOVztnxXNEKphw8Jy");
- NSLog(@"HFv1eg2cUDS03JnkYQlChq5axT4VoM");
- NSLog(@"sGXTQcwpz1FyxDfRmYbjvA4OZJN5IHdPWM2Erg");
- NSLog(@"zaI8YtmFcLkTiXJQ2rV0BpCWOoU4qhjv9u1");
- NSLog(@"faXvIY6qUOL3Doeg0Er1cFiPylHSzQVuN47m");
- NSLog(@"M8wbXIxr97tFAmpnheOBQLPRNJus6ldWSKfi5c");
- NSLog(@"fQ9V1onPvJLek6RSyEFj7WDMi0AzYB8rlpK");
- NSLog(@"gro0LHiQczWZ7");
- NSLog(@"KQwx3GRoOrcgD6yztiSTjJ2WAeL");
- NSLog(@"C5yq2d6gL0vxf");
- NSLog(@"eBPOZ62hDmtzKvSJ4kuRwQ9");
- NSLog(@"aSQyvEe2LFi7OzP0cn4fRYMVwUxr");
- NSLog(@"6GyHJmMRocVt72ESOCY8f9da4q");
- }
- -(void)ahYJ0:(UIScreen*) ahYJ0 aFQha:(UIFont*) aFQha aTlwG:(UIBezierPath*) aTlwG ami2lyqJLF:(UILabel*) ami2lyqJLF aGTsCrHIXQF:(UIBarButtonItem*) aGTsCrHIXQF aTv54K0qp1:(UIScreen*) aTv54K0qp1 aAxoLVNdsw9:(UIBarButtonItem*) aAxoLVNdsw9 a2zlXLJNvR:(UILabel*) a2zlXLJNvR atejQ:(UIInputView*) atejQ aoQtMTj:(UIView*) aoQtMTj agFtLRQklcb:(UIVisualEffectView*) agFtLRQklcb ayAR7PThK:(UITableView*) ayAR7PThK auICixeR7:(UIControl*) auICixeR7 apUuP4b56a:(UIDocument*) apUuP4b56a aHCQnE865:(UIControl*) aHCQnE865 a2iZfOFlq:(UIApplication*) a2iZfOFlq {
- NSLog(@"kebsluMEfPBKVA4NRZCYWQoLvd5I");
- NSLog(@"0OGV1XlscyjCH");
- NSLog(@"WmDpVfSbt2BnL9Al3Xo7QRk6Odv");
- NSLog(@"x5pGtjwz4iISKagc9FJAdohXB2QbL");
- NSLog(@"lDNV2peijz7AxYRaOn");
- NSLog(@"G0gF1bacD6zlRYTZSPfvIUX72yJtLQEWK4n3sx");
- NSLog(@"krd37NUWvXe5x8fnc2BZlqKGhHODjoI46F");
- NSLog(@"nDGPjvs59bCOukaH3Ri1S2ZgmYoVtEwycfdqQFA");
- NSLog(@"FEY0CRLsXi4xPJhmBfjrn7ZQ3D");
- NSLog(@"8xMkBujImpg6LoT0sENZ24lSKzRAyab");
- NSLog(@"HkJn4SqXZN0FbQhjRC");
- NSLog(@"LMB1hZCFdz5D9HG6loUEgfw24RQi0nb");
- NSLog(@"4JeuZrDpL2hYz7GX3ONRw9EkcBdUban");
- NSLog(@"R1sSXY036VNDO4pTvq2tj");
- NSLog(@"sChzxikWqe73FR2yBE");
- NSLog(@"U6O5gQ3CKMGkzXsTP2Zn1IVoRAJY");
- NSLog(@"S15GQbaokjdUcAe7i");
- NSLog(@"k92QHwlEoWU4eJ51hzLxINYKiFVgDXAfm0");
- }
- -(void)alp75:(UIRegion*) alp75 awZjQ3lS:(UIWindow*) awZjQ3lS ae4uof7xw:(UIFontWeight*) ae4uof7xw aM1u2i6:(UIFontWeight*) aM1u2i6 abeZ0t7Mcm:(UIMenuItem*) abeZ0t7Mcm ajeyAMV:(UICollectionView*) ajeyAMV aTA9LRN:(UIControlEvents*) aTA9LRN apr3QX:(UIDocument*) apr3QX aVhsHEM:(UIUserInterfaceIdiom*) aVhsHEM ajvICEQkfN:(UIMotionEffect*) ajvICEQkfN aRlpmJCS:(UIFont*) aRlpmJCS a3lDpTKaXE:(UIDocument*) a3lDpTKaXE aIetw57XdC:(UIBezierPath*) aIetw57XdC af9pkPxHubt:(UIFontWeight*) af9pkPxHubt {
- NSLog(@"oYGwmeAIpNLdgQktv7");
- NSLog(@"k8fNP0lXmH1RMdFn5IUub6vh");
- NSLog(@"KMjlQs3S8hH9nUeRPNZ1ovYwGiL");
- NSLog(@"Vi9YPjQD4swIkrmXdehWHBRN2F1qc");
- NSLog(@"ZLjRzvyw26t");
- NSLog(@"DW1Q53wY70CkuPyNrK9");
- NSLog(@"rC7YX8EThFt2OIHZ9pLQlwxDey1aK");
- NSLog(@"6IqWpO7c8nSoZdsFl1K");
- NSLog(@"NXpSW0G3aQYomRHTiB9IZzsO4udwPt6");
- NSLog(@"QkRaiJMno1");
- NSLog(@"Gnc39pTSeKirzdOVFUoCvI4bRBXHuAsMlf");
- NSLog(@"oL1UDlWnbgfV");
- NSLog(@"cvQB4mCt9M");
- }
- -(void)aGYQ5og0j:(UIKeyCommand*) aGYQ5og0j aalrh3MJVQ:(UILabel*) aalrh3MJVQ afrashUqz4:(UIEvent*) afrashUqz4 aLWj5vpfw:(UIActivity*) aLWj5vpfw aUMyNTGp6:(UIWindow*) aUMyNTGp6 aRrmkuv6Vi:(UIBezierPath*) aRrmkuv6Vi alUon:(UITableView*) alUon a1LRAvUbWak:(UIColor*) a1LRAvUbWak a6ktFbj9:(UIActivity*) a6ktFbj9 axaZu:(UIImage*) axaZu aoHd5chet:(UIEdgeInsets*) aoHd5chet aUVbaPxdEcX:(UIBarButtonItem*) aUVbaPxdEcX aLXwavYE:(UIViewController*) aLXwavYE aQ3BWZ1:(UIInputView*) aQ3BWZ1 aZqLw3TjUb:(UIViewController*) aZqLw3TjUb a3nOxRb:(UITableView*) a3nOxRb aDi42l:(UIActivity*) aDi42l aqc6QDwe:(UIWindow*) aqc6QDwe a8Eh6ojQGFm:(UIDocument*) a8Eh6ojQGFm aJ4dx2W0N:(UIControlEvents*) aJ4dx2W0N {
- NSLog(@"kLBUPsawcJX7F");
- NSLog(@"PCjgbJuK4Id");
- NSLog(@"PDZJxydmlUaKFX5Ls3erwo7GTi4E6k");
- NSLog(@"cVIxG8kzt9XO0rKiCblqHwQLS4ysmduUTvofR53");
- NSLog(@"KEID9kozfTswlr");
- NSLog(@"swJjSnYZcgG3KhHD9");
- NSLog(@"VRfcK4JetyBpTwx3IDHG6vZqMl");
- NSLog(@"s7Bn61vGU9qATfcbHEprNQ");
- NSLog(@"HrUbAgECV56B7Sjf");
- NSLog(@"tfgyxn2mCB9JHihb6RY4V");
- NSLog(@"5fBkaPob7l");
- NSLog(@"ROzQVGxM5q3fSTlWtF24hbdNDA9ipew");
- NSLog(@"5C4mVNv2GMyzRYkdLt8DgWsBZHxPcuXa6Jr7");
- NSLog(@"HjAiaVB4T0UfeGcWwk6XyE2DQMSuxhvK9qO");
- NSLog(@"BtkvDlbEn03MTexaG5HS7Y1wjdAoKCPhX2Zi");
- NSLog(@"zl5rwOSMGZ0LfnyhCUXFjb");
- NSLog(@"VWJgsP6CUnLKHckau2N9m5iGQZ");
- NSLog(@"mLIF702HDCMhsnfPpJ1buW4RiqSUY");
- NSLog(@"v8XT6yxkjuVSZHAgfE");
- }
- -(void)aV8ru:(UIColor*) aV8ru avRazkr:(UIColor*) avRazkr anOtb:(UIImage*) anOtb aF5Yxapqv:(UISwitch*) aF5Yxapqv a2JVH:(UIImageView*) a2JVH a0H9DN2WfZa:(UIImageView*) a0H9DN2WfZa axp9ROIvd:(UISwitch*) axp9ROIvd avAPT:(UIKeyCommand*) avAPT azA7OTcx:(UIUserInterfaceIdiom*) azA7OTcx aRlCTp:(UIColor*) aRlCTp ac5nh0I9laE:(UIVisualEffectView*) ac5nh0I9laE aQd0nZA:(UIFont*) aQd0nZA adn3EIl:(UIDocument*) adn3EIl ahxmTw7:(UIBarButtonItem*) ahxmTw7 aH3ea:(UIImageView*) aH3ea {
- NSLog(@"q60ZMSB4i9snVva28cPIyU1AOtF5weNKLlbhDQ");
- NSLog(@"GYNM3wCtXKEZ7AcSarWRFi0n9bsg2kPzTdeOuhB8");
- NSLog(@"ODxAgqTHKPQ35YVFE6Ico");
- NSLog(@"RY8alNfqpXPKJ1Wt3xOgvnoESV5CeZ");
- NSLog(@"gt5i1SDsdQazu08yv");
- NSLog(@"HjV4NDIbZmqXkM1POsz9iuToeGgJQ0v8A2E3nC");
- NSLog(@"EmITvnf1MjYkK2RiPO5qzeBHgN");
- NSLog(@"loIASDhcKPaQW2rO8yJHFfCzx1s6ig7");
- NSLog(@"hJtUroBauALPx3qj");
- NSLog(@"72yhAQv8nDaOWjt");
- NSLog(@"jaYGMc9PHt");
- NSLog(@"TUpw4iWxtl56oIS7dEhVKCJga23Z9frDePmA");
- NSLog(@"ld6HCD2XvK4ObpZ9TcPQG8kMrFUyJwYqWnI7Som");
- NSLog(@"72FHuJkbvPzyaIr4dLg6eY0OTjU3");
- }
- @end
|