ScanDiscountViewController.m 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. //
  2. // ScanDiscountViewController.m
  3. // HMLG Scan Order
  4. //
  5. // Created by Rui Zhang on 6/16/22.
  6. // Copyright © 2022 United Software Applications, Inc. All rights reserved.
  7. //
  8. #import "ScanDiscountViewController.h"
  9. @interface ScanDiscountViewController ()
  10. @end
  11. @implementation ScanDiscountViewController
  12. - (void)viewDidLoad {
  13. [super viewDidLoad];
  14. // Do any additional setup after loading the view.
  15. }
  16. -(void) updatebtn:(UIButton*)btn
  17. {
  18. self.btn3.backgroundColor = UIColor.clearColor;
  19. self.btn5.backgroundColor = UIColor.clearColor;
  20. self.btn8.backgroundColor = UIColor.clearColor;
  21. self.btn10.backgroundColor = UIColor.clearColor;
  22. self.btnnone.backgroundColor = UIColor.clearColor;
  23. btn.backgroundColor =UIColor.redColor;
  24. }
  25. - (IBAction)onCancel:(id)sender {
  26. [self dismissViewControllerAnimated:NO
  27. completion:^{
  28. }];
  29. }
  30. - (IBAction)onUpdate:(id)sender {
  31. [self dismissViewControllerAnimated:NO
  32. completion:^{
  33. if(self.onSetValue)
  34. self.onSetValue( self.price,self.discount);
  35. }];
  36. }
  37. - (IBAction)on3:(id)sender {
  38. self.discount = 3;
  39. [self updatebtn:sender];
  40. }
  41. - (IBAction)onnone:(id)sender {
  42. self.discount = 0;
  43. [self updatebtn:sender];
  44. }
  45. - (IBAction)on5:(id)sender {
  46. self.discount = 5;
  47. [self updatebtn:sender];
  48. }
  49. - (IBAction)on8:(id)sender {
  50. self.discount = 8;
  51. [self updatebtn:sender];
  52. }
  53. - (IBAction)on10:(id)sender {
  54. self.discount = 10;
  55. [self updatebtn:sender];
  56. }
  57. /*
  58. #pragma mark - Navigation
  59. // In a storyboard-based application, you will often want to do a little preparation before navigation
  60. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  61. // Get the new view controller using [segue destinationViewController].
  62. // Pass the selected object to the new view controller.
  63. }
  64. */
  65. @end