ScanHistoryViewController.m 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. //
  2. // ScanHistoryViewController.m
  3. // HMLG Scan Order
  4. //
  5. // Created by Rui Zhang on 3/29/22.
  6. // Copyright © 2022 United Software Applications, Inc. All rights reserved.
  7. //
  8. #import "ScanHistoryViewController.h"
  9. #import "ScanListCell.h"
  10. #import "RASingleton.h"
  11. @interface ScanHistoryViewController ()
  12. @end
  13. @implementation ScanHistoryViewController
  14. - (void)viewDidLoad {
  15. [super viewDidLoad];
  16. // Do any additional setup after loading the view.
  17. }
  18. /*
  19. #pragma mark - Navigation
  20. // In a storyboard-based application, you will often want to do a little preparation before navigation
  21. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  22. // Get the new view controller using [segue destinationViewController].
  23. // Pass the selected object to the new view controller.
  24. }
  25. */
  26. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  27. return RASingleton.sharedInstance.scan_list.count;
  28. }
  29. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  30. return 166.0f;
  31. }
  32. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  33. {
  34. ScanListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ScanListCell"];
  35. if (!cell) {
  36. cell = [[ScanListCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"ScanListCell"];
  37. }
  38. NSMutableArray* arr = RASingleton.sharedInstance.scan_list;
  39. [cell setModelJson:arr[indexPath.row]];
  40. return cell;
  41. }
  42. //#pragma mark - TableView Delegate
  43. /*
  44. #pragma mark - Navigation
  45. // In a storyboard-based application, you will often want to do a little preparation before navigation
  46. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  47. // Get the new view controller using [segue destinationViewController].
  48. // Pass the selected object to the new view controller.
  49. }
  50. */
  51. //- (IBAction)onAddToCart:(id)sender {
  52. //
  53. // [self dismissViewControllerAnimated:true completion:^{
  54. // if(self.returnValue)
  55. // self.returnValue(self.modellist);
  56. // }];
  57. //
  58. //
  59. //}
  60. #pragma mark - RA_NOTIFICAITON
  61. -(void) refresh_ui
  62. {
  63. [self.tableview reloadData];
  64. }
  65. -(void) reload_data {
  66. [self.tableview reloadData];
  67. }
  68. @end