JTKFViewController.m 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. //
  2. // JTKFViewController.m
  3. // jitao
  4. //
  5. // Created by 罗云飞 on 2018/8/19.
  6. // Copyright © 2018年 罗云飞. All rights reserved.
  7. //
  8. #import "JTKFViewController.h"
  9. @interface JTKFViewController ()
  10. @end
  11. @implementation JTKFViewController
  12. - (void)viewDidLoad {
  13. [super viewDidLoad];
  14. self.view.backgroundColor = NewGroupTableViewBackgroundColor;
  15. [self setNavTitle:@"技淘客服"];
  16. [self loadUI];
  17. // Do any additional setup after loading the view.
  18. }
  19. - (void)loadUI{
  20. UIImageView *imageview = [UIImageView new];
  21. [imageview setImage:NewImageNamed(@"kf11")];
  22. [self.view addSubview:imageview];
  23. imageview.sd_layout
  24. .centerXEqualToView(self.view)
  25. .heightIs(60)
  26. .widthIs(60)
  27. .topSpaceToView(self.view, NavHeader+90);
  28. UILabel *iphoneNumer = [UILabel new];
  29. iphoneNumer.text = @"客服电话:400-8800-962";
  30. iphoneNumer.textAlignment = NSTextAlignmentCenter;
  31. iphoneNumer.textColor = [UIColor colorWithString:@"#6C6C6C"];
  32. [self.view addSubview:iphoneNumer];
  33. iphoneNumer.sd_layout
  34. .centerXEqualToView(self.view)
  35. .heightIs(20)
  36. .widthIs(SCREEN_WIDTH)
  37. .topSpaceToView(imageview, 15);
  38. UIButton *button = [UIButton new];
  39. [button setTitle:@"立即咨询" forState:UIControlStateNormal];
  40. [button setBackgroundImage:NewImageNamed(@"anniu") forState:UIControlStateNormal];
  41. [button setTitleColor:NewWhiteColor forState:UIControlStateNormal];
  42. button.titleLabel.font = NewFont(18);
  43. NewTouchUpInside(button, buttonclick:);
  44. [self.view addSubview:button];
  45. button.sd_layout
  46. .centerXEqualToView(self.view)
  47. .topSpaceToView(iphoneNumer, 70)
  48. .heightIs(45)
  49. .widthIs(SCREEN_WIDTH-90);
  50. }
  51. - (void)buttonclick:(UIButton *)sender {
  52. NSLog(@"%@",@"一键电话");
  53. UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"温馨提示" message:@"是否拨打客户电话?" preferredStyle:(UIAlertControllerStyleAlert)];
  54. UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"确定" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction *action) {
  55. [NewUtils callTel:@"400-8800-962"];
  56. }];
  57. UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:(UIAlertActionStyleCancel) handler:^(UIAlertAction *action) {
  58. }];
  59. [alertController addAction:okAction];
  60. [alertController addAction:cancelAction];
  61. [self presentViewController:alertController animated:YES completion:nil];
  62. }
  63. - (void)didReceiveMemoryWarning {
  64. [super didReceiveMemoryWarning];
  65. // Dispose of any resources that can be recreated.
  66. }
  67. /*
  68. #pragma mark - Navigation
  69. // In a storyboard-based application, you will often want to do a little preparation before navigation
  70. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  71. // Get the new view controller using [segue destinationViewController].
  72. // Pass the selected object to the new view controller.
  73. }
  74. */
  75. @end