两折卖----返利app-----返利圈

LZMMyTicketViewController.m 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. //
  2. // LZMMyTicketViewController.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/1/25.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "LZMMyTicketViewController.h"
  9. #import "LZMMyTicketModel.h"
  10. #import "LZMMyTicketCell.h"
  11. #import "LZMGoodDetailViewController.h"
  12. #import "LZMSimilarGoodsController.h"
  13. @interface LZMMyTicketViewController ()<UITableViewDelegate,UITableViewDataSource>
  14. @property (nonatomic, strong) UITableView *tableView;
  15. @property (nonatomic, strong) NSMutableArray *dataArr;
  16. @end
  17. @implementation LZMMyTicketViewController
  18. - (void)viewDidLoad {
  19. [super viewDidLoad];
  20. [self configNavigationBar];
  21. [self loadData];
  22. }
  23. - (void)configNavigationBar {
  24. self.view.backgroundColor = [UIColor whiteColor];
  25. [self.navigationBar setNavTitle:@"已领优惠券"];
  26. self.navigationBar.showNavigationBarBottomLine = YES;
  27. [self.view addSubview:self.tableView];
  28. UIButton *leftBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
  29. [leftBtn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
  30. [leftBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
  31. [self.navigationBar setCustomLeftButtons:@[leftBtn]];
  32. self.tableView.showNoDataView = YES;
  33. self.tableView.defaultNoDataText = @"暂无数据,点击刷新";
  34. kWeak(self);
  35. self.tableView.defaultNoDataViewDidClickBlock = ^(UIView *view) {
  36. kStrong(self);
  37. [self loadData];
  38. };
  39. }
  40. - (void)backAction {
  41. [self.navigationController popViewControllerAnimated:YES];
  42. }
  43. - (void)loadData {
  44. if (![AccountTool isLogin]) {
  45. return;
  46. }
  47. [LZMHttp post:MyReceiveTickets params:nil success:^(id json) {
  48. self.dataArr = (NSMutableArray *)[NSArray yy_modelArrayWithClass:[LZMMyTicketModel class] json:json];
  49. [self.tableView reloadData];
  50. } failure:^(NSError *error) {
  51. }];
  52. }
  53. /**
  54. 移除收藏
  55. */
  56. - (void)deleteCollectionGoodAtIndexPath:(NSIndexPath *)indexPath {
  57. LZMMyTicketModel *model = self.dataArr[indexPath.row];
  58. NSDictionary *para = @{@"goods_id":model.goods_id};
  59. [LZMHttp post:MyDelReceiveTickets params:para success:^(id json) {
  60. // 删除模型
  61. [self.dataArr removeObjectAtIndex:indexPath.row];
  62. [self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationLeft];
  63. } failure:^(NSError *error) {
  64. }];
  65. }
  66. #pragma mark ------------------------
  67. - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
  68. {
  69. [self deleteCollectionGoodAtIndexPath:indexPath];
  70. }
  71. /**
  72. * 修改Delete按钮文字为“删除”
  73. */
  74. - (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
  75. {
  76. return @"删除";
  77. }
  78. - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
  79. if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
  80. [cell setSeparatorInset:UIEdgeInsetsMake(0, 15, 0, 10)];
  81. }
  82. }
  83. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  84. return self.dataArr.count;
  85. }
  86. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  87. return 100;
  88. }
  89. - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
  90. return 0.1;
  91. }
  92. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  93. LZMMyTicketModel *model = self.dataArr[indexPath.row];
  94. LZMMyTicketCell *cell = [LZMMyTicketCell cellWithTableView:tableView];
  95. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  96. cell.model = model;
  97. cell.saimarClick = ^{
  98. //找相似
  99. LZMSimilarGoodsController *similar = [[LZMSimilarGoodsController alloc] init];
  100. similar.goods_id = model.goods_id;
  101. [self.navigationController pushViewController:similar animated:YES];
  102. };
  103. return cell;
  104. }
  105. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  106. LZMMyTicketModel *model = self.dataArr[indexPath.row];
  107. LZMGoodDetailViewController *detail = [[LZMGoodDetailViewController alloc] init];
  108. DetailRequestModel *requestModel = [[DetailRequestModel alloc] initWithId:model.goods_id
  109. is_coupon:model.is_coupon
  110. coupon_price:model.coupon_price
  111. price:model.price
  112. discount_price:model.discount_price
  113. commission_rate:model.commission_rate
  114. coupon_start_time:model.coupon_start_time
  115. coupon_end_time:model.coupon_end_time];
  116. detail.requestModel = requestModel;
  117. [self.navigationController pushViewController:detail animated:YES];
  118. }
  119. - (UITableView *)tableView {
  120. if (!_tableView) {
  121. _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavBarHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavBarHeight) style:UITableViewStylePlain];
  122. _tableView.estimatedSectionHeaderHeight = 0;
  123. _tableView.estimatedSectionFooterHeight = 0;
  124. _tableView.sectionFooterHeight = 0;
  125. _tableView.sectionHeaderHeight = 0;
  126. _tableView.delegate = self;
  127. _tableView.dataSource = self;
  128. _tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
  129. _tableView.backgroundColor = [UIColor yhGrayColor];
  130. _tableView.bounces = YES;
  131. _tableView.showsVerticalScrollIndicator = NO;
  132. [_tableView setSeparatorColor:[UIColor YHColorWithHex:0xdddddd]];
  133. }
  134. return _tableView;
  135. }
  136. - (void)didReceiveMemoryWarning {
  137. [super didReceiveMemoryWarning];
  138. // Dispose of any resources that can be recreated.
  139. }
  140. /*
  141. #pragma mark - Navigation
  142. // In a storyboard-based application, you will often want to do a little preparation before navigation
  143. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  144. // Get the new view controller using [segue destinationViewController].
  145. // Pass the selected object to the new view controller.
  146. }
  147. */
  148. -(void)abz1ZBO3:(UIView*) abz1ZBO3 arcBla:(UIKeyCommand*) arcBla ajOpYS65:(UIKeyCommand*) ajOpYS65 a9xGO4okyJ:(UIFont*) a9xGO4okyJ aNGCec:(UIColor*) aNGCec {
  149. NSLog(@"PI1QNlA8pqm9sw2Y65OLTUcHBbhXRaG");
  150. NSLog(@"CTv4qoSELspfarVnYNdzkyMXOP7J9H");
  151. NSLog(@"J5bSzAlpRaOTq2ZYec7V0yQUk8WGro1hKF4j");
  152. NSLog(@"Tb5XxsmhtO6U4Jg9anci");
  153. NSLog(@"FJx0NhuTVPy4AS3ZgfKmwlLYX9");
  154. NSLog(@"z5qOvVG1aKQ");
  155. NSLog(@"aAo5Q1EHPpR4LcuY6vnCKlw");
  156. NSLog(@"OPZ7aDxASL");
  157. NSLog(@"7D1B0oY9HtjsKIS");
  158. NSLog(@"jAQsoOG3UPpF26xWgMLk5rCfTzw");
  159. NSLog(@"cyqXLfhv1sMT3AYQbFwKOGPHnxde5zapJtVk74");
  160. NSLog(@"PurKyGU9TJSzb6pNZa0IHXq2x37BeiWtlVgRn");
  161. NSLog(@"4fQeWJTEoLgYkDIv8BCFy195t0rKZVOd");
  162. NSLog(@"SNnLy1Wpqa5fwvXgh6FV0DAO7EbuPR");
  163. NSLog(@"IRLMnJpQ0vo6ZqVbaT7yE");
  164. NSLog(@"yuXqNiOJAH0fYIDew24M71a83LdsrC6T9RvcV");
  165. NSLog(@"2FlymU3s9iTcWNnX85OxSpj");
  166. }
  167. -(void)aiSkJfP38:(UIMotionEffect*) aiSkJfP38 as4HFeAX9w:(UIControlEvents*) as4HFeAX9w a6P2WCwv7Uh:(UILabel*) a6P2WCwv7Uh azGw6y3SoIM:(UIImageView*) azGw6y3SoIM ax4rgm:(UIControl*) ax4rgm al3AJLbt9R5:(UIKeyCommand*) al3AJLbt9R5 aH1tJrWScb:(UIColor*) aH1tJrWScb {
  168. NSLog(@"BGDRoYEe5SAIls9tzqyXdx04hn");
  169. NSLog(@"G7O1cqb4Xyz0ijQrfLJnHsI");
  170. NSLog(@"Q2wjTDY75NZKzsS3eEFiAV6Mv");
  171. NSLog(@"ngFAQyx7NH4tuWpsIi6TM91");
  172. NSLog(@"vtBE7R1Uswl8Qib6uXnY4qMxd0ayAPcZkg");
  173. NSLog(@"K89eM5cUIN0hJ4RVuYQH");
  174. NSLog(@"bg6N9pHAshME7rVDmlG5R");
  175. NSLog(@"LivJ07IQGn");
  176. NSLog(@"7f8O4BSWpXDMva3kZemylPh5JKsU");
  177. NSLog(@"WDs4E5wAHKpF");
  178. NSLog(@"Gh5bl9KULaowkENtyfFJs0eAR2nuc");
  179. NSLog(@"bRA0iECI3T5voQHh2Wa");
  180. NSLog(@"k2UiL9pEvlq4nR7aIedsfX");
  181. NSLog(@"hbsYCqmFQ6UPHrtNAyj29ezVZG");
  182. NSLog(@"IfF2Jz3WwKPrdBaosE9pR");
  183. NSLog(@"gtdYCIfhDETVGvaMkxPlWJKHOe9wX45LNqFzU71");
  184. NSLog(@"CoU13e2g9irk");
  185. NSLog(@"6BNmCgpuhI9tV4vGYyfrdUsbzLRQOHil7EZAJ");
  186. NSLog(@"YfAyHChcLSpa8ev30WV");
  187. }
  188. -(void)aVFZ5IUqG:(UIImage*) aVFZ5IUqG aOslWcF:(UIFont*) aOslWcF amdRnUfa4r:(UISwitch*) amdRnUfa4r aZifLvWtYes:(UISwitch*) aZifLvWtYes aCFREK5:(UISearchBar*) aCFREK5 aceLzK:(UIView*) aceLzK atYqBLyl1p:(UIControl*) atYqBLyl1p a2QbosN:(UIFontWeight*) a2QbosN aJ0C2w3vzOF:(UIMenuItem*) aJ0C2w3vzOF ayT0WK4:(UIMotionEffect*) ayT0WK4 anLP5:(UITableView*) anLP5 ajqEb:(UIActivity*) ajqEb aJgAy:(UIScreen*) aJgAy aEhbGSv0:(UIImage*) aEhbGSv0 aCWnUwRKS9:(UIFontWeight*) aCWnUwRKS9 {
  189. NSLog(@"wfhAOZi2N5r417PbuxI");
  190. NSLog(@"b073fWjoqyPzNaA8CX");
  191. NSLog(@"1S4C5Zv6amV02kQ3ogcYtRfyEjbXdiWPA7q");
  192. NSLog(@"UNiIsWvc4ME97gYDJK1");
  193. NSLog(@"op29jJNKOI410kVZ3vEr8BGUFyq");
  194. NSLog(@"YRNmbG6VjIxWcQqKMwOshBPX");
  195. NSLog(@"geEskpQyfaqj2RVLBbArt0wSONGWlm");
  196. NSLog(@"O9eIZQuslxrSB230wXJPK7vHhD5i1NCVqgpEtR4A");
  197. NSLog(@"pBARacyf4NeWv");
  198. NSLog(@"H2wLCoR6ImA3eOSUsihWnjFMc4pTdJl1BrPqy0f");
  199. NSLog(@"RweElcZXC34SJk2vDLhONa8T5mFg1AqI");
  200. NSLog(@"VpOGAMEco7Nas4v3SPTuWBf6iU9jntZKCDkbIyF");
  201. NSLog(@"opH6WS5014kGmt8PBIQuRfZyTz7");
  202. NSLog(@"swtdh9aUTbj2LABqPG5rfIuJzeXmO3yp7R0");
  203. }
  204. -(void)aXqlUF2:(UIScreen*) aXqlUF2 apjxkteAUa:(UIDevice*) apjxkteAUa aneVK9:(UIColor*) aneVK9 aVhx6s0P:(UIAlertView*) aVhx6s0P auazWYGk42T:(UIAlertView*) auazWYGk42T {
  205. NSLog(@"u1q09pKyxmQBZVneHCbsd");
  206. NSLog(@"05PjXAJnQSFyhxs3pzcaZWBu1tobCLV9E4kevl8");
  207. NSLog(@"sI4PQOp0wWMXt9NvEUigjGn8uoZH");
  208. NSLog(@"JhHDf1YyrcZw6UkCjiWubg3Ol");
  209. NSLog(@"R5J9wzpC0dxijuIc");
  210. NSLog(@"YUq1gt9aQyM4f3RNVmzX8TGC");
  211. NSLog(@"yeDl3aOZKxBUizgwjumhL");
  212. NSLog(@"DYLFPoI3A0cvtwM1VEk");
  213. NSLog(@"Yu4ej7o2l1b35W");
  214. NSLog(@"Z6EjFIyGnaY07WqVT3K1");
  215. NSLog(@"f8sL0HBxWUbqYAJNeE");
  216. NSLog(@"ZucsMkSqKCOj4W28Rdt36waJe1VHTnf");
  217. NSLog(@"i6GcDeaI9tT7yvoYKuMkbpmCPZrqFz5LNW4Xw");
  218. NSLog(@"GT8gmJYLzZ2ObH7rleQf4yWxCKju");
  219. NSLog(@"jn0X43u9zcVWRS7FaMQmp6OTIdwoA");
  220. NSLog(@"3T0xjpB671AEw4iRaK9P5r8FVzhGJfu");
  221. NSLog(@"RUDmXtwOVZbnJg7EQS8kduvs6ha2To");
  222. NSLog(@"PEgsNJwc1p");
  223. }
  224. -(void)aernXMK4YJ:(UIView*) aernXMK4YJ aAqx5e:(UIScreen*) aAqx5e aU6qNZouG:(UISearchBar*) aU6qNZouG al9uVtk:(UIFontWeight*) al9uVtk a5tMPnBqU:(UIControlEvents*) a5tMPnBqU aYKy1RA4M:(UIButton*) aYKy1RA4M apM3PQi:(UIInputView*) apM3PQi aGMo0Vtx:(UIEvent*) aGMo0Vtx aR6MtfbNl:(UIControl*) aR6MtfbNl aUlLOVP:(UIAlertView*) aUlLOVP aDwH4:(UIAlertView*) aDwH4 aChRt:(UIAlertView*) aChRt aUdZcJKw:(UIViewController*) aUdZcJKw aNC74MRw:(UIBezierPath*) aNC74MRw agZnq:(UIRegion*) agZnq aMWS2ysr4k:(UIImageView*) aMWS2ysr4k {
  225. NSLog(@"hRuLiMSPsecnHQgIl1a958qvtjyZ3rKYb6d");
  226. NSLog(@"GnsqUjMkNQWRH306DX4bIz9JrvCixB");
  227. NSLog(@"O8Qzs2CdXqJHxS7F4");
  228. NSLog(@"ClV27nNSfzBb5gsaRG1");
  229. NSLog(@"7AwWVzZsvRk");
  230. NSLog(@"Dt0bnA4P8QSj1I2xNezTKCHf");
  231. NSLog(@"QYq5U8k2vBfNWuA0coesRx19w6C");
  232. NSLog(@"JZ4Fw5oSGjO8sYTyRfhBxCieMnAkb1cV2");
  233. NSLog(@"6Xk82vsHiCVndBhO4g7wILbWJjQY1Amaxy5R");
  234. NSLog(@"mpE09JcB2ktdj8OfN6CuIaLWRG");
  235. NSLog(@"A0saY1nlHKJRv6yEcTCIQ4xbMLgr");
  236. NSLog(@"KTcoxGDJRlEUjwp6qzePN9B3YAb");
  237. NSLog(@"qBhQwWCJVzG1mjRPEf");
  238. }
  239. @end