SKMineViewController+user.m 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //
  2. // SKMineViewController+user.m
  3. // Overseas Watch
  4. //
  5. // Created by 刘振兴 on 2024/1/20.
  6. // Copyright © 2024 BaH Cy. All rights reserved.
  7. //
  8. #import "SKMineViewController+user.h"
  9. #import "SKMineViewCell.h"
  10. #import "SKWebViewViewController.h"
  11. #import "TestMasonryViewController.h"
  12. @implementation SKMineViewController (user)
  13. - (UITableViewCell *)userTableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  14. static NSString *cellID = @"MineCellID";
  15. SKMineViewCell *cell = (SKMineViewCell*)[self.mTableView dequeueReusableCellWithIdentifier:cellID forIndexPath:indexPath];
  16. if(cell == nil) {
  17. cell = [[SKMineViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellID];
  18. }
  19. NSString* imageName = [NSString stringWithFormat:@"%@_%ld", @"mine_list", (long)indexPath.row];
  20. NSString* titleName = [NSString stringWithFormat:@"%@.%ld", @"Mine.List", (long)indexPath.row];
  21. [cell.mImage setImage:[UIImage imageNamed:imageName]];
  22. cell.mTitle.text = NSLocalizedString(titleName, nil);
  23. return cell;
  24. }
  25. - (void)userTableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  26. switch (indexPath.row) {
  27. case 0:
  28. [self showBabyList];
  29. break;
  30. case 1:
  31. [self showAccountManager];
  32. break;
  33. case 2:
  34. [self showAboutUS];
  35. break;
  36. default:
  37. break;
  38. }
  39. }
  40. - (void)showBabyList{
  41. [MobClick event:@"ClickBabyList"];
  42. UIViewController *modPasswordVC = [[self storyboard] instantiateViewControllerWithIdentifier:@"BabyListVC"];
  43. [self pushViewController:modPasswordVC animated:YES];
  44. }
  45. - (void)showAccountManager {
  46. [MobClick event:@"ClickAccountManagerFromRight"];
  47. UIViewController *accountManager = [[self storyboard] instantiateViewControllerWithIdentifier:@"AccountManagerVC"];
  48. [self pushViewController:accountManager animated:YES];
  49. }
  50. - (void)showGuide {
  51. SKWebViewViewController *webVc = [[self storyboard] instantiateViewControllerWithIdentifier:@"WebViewVC"];
  52. webVc.title = NSLocalizedString(@"Guide.View.Title", nil);
  53. webVc.urlToOpen = @"http://m.kido.com.cn/index.php?m=content&c=index&a=lists&catid=13";
  54. webVc.isLockGestureRecognizer = YES;
  55. [self pushViewController:webVc animated:YES];
  56. }
  57. - (void)showGuideForK1K1S {
  58. [MobClick event:@"ClickNewbieGuide"];
  59. UIViewController *vc = [[self storyboard] instantiateViewControllerWithIdentifier:@"guideViewVC"];
  60. [self pushViewController:vc animated:YES];
  61. }
  62. - (void)showPushHistory {
  63. UIViewController *controller = [[self storyboard] instantiateViewControllerWithIdentifier:@"PushHistoryVC"];
  64. [self pushViewController:controller animated:YES];
  65. }
  66. - (void)showAboutUS {
  67. UIViewController *vc = [[self storyboard] instantiateViewControllerWithIdentifier:@"VersionVC"];
  68. [self pushViewController:vc animated:YES];
  69. }
  70. - (void)testMasonry {
  71. TestMasonryViewController *vc = [[self storyboard] instantiateViewControllerWithIdentifier:@"TestMasonryVC"];
  72. [self pushViewController:vc animated:YES];
  73. [vc addObserver:self forKeyPath:@"mTextField.text" options:NSKeyValueObservingOptionNew context:nil];
  74. }
  75. @end