Ver código fonte

1.修改Apex Mobile Detail,增加Tracing菜单搜索HBOL。
2.导入Apex Mobile Status Wait图标。

Pen Li 8 anos atrás
pai
commit
c1265fa05d

+ 1 - 0
Apex Mobile/Apex Mobile/Base.lproj/Localizable.strings

@@ -53,3 +53,4 @@
 "about_ver_key"="Version:";
 "about_ver_key"="Version:";
 "about_support_key"="Support:";
 "about_support_key"="Support:";
 "about_support_value"="USAIRedAnt@united-us.net";
 "about_support_value"="USAIRedAnt@united-us.net";
+"search"="Search Document";

+ 2 - 0
Apex Mobile/Apex Mobile/DetailContent.h

@@ -23,4 +23,6 @@
 @property (strong,nonatomic) NSArray* segments;
 @property (strong,nonatomic) NSArray* segments;
 @property (strong,nonatomic) NSMutableDictionary* webviewHeight;
 @property (strong,nonatomic) NSMutableDictionary* webviewHeight;
 
 
+@property (nonatomic,strong) NSDictionary *originContent;
+
 @end
 @end

+ 112 - 11
Apex Mobile/Apex Mobile/DetailTabBarController.m

@@ -7,8 +7,9 @@
 //
 //
  
  
 #import "DetailTabBarController.h"
 #import "DetailTabBarController.h"
+#import "AMResultViewController.h"
 
 
-@interface DetailTabBarController ()
+@interface DetailTabBarController () <UITabBarControllerDelegate>
 
 
 @end
 @end
 
 
@@ -230,33 +231,133 @@
 //    self.navigationItem.backBarButtonItem = backButton;
 //    self.navigationItem.backBarButtonItem = backButton;
 
 
     
     
+//    UIButton *saveBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+//    saveBtn.frame = CGRectMake(0, 0, 30, 30);
+//    [saveBtn setImage:[UIImage imageNamed:@"ic_save"] forState:UIControlStateNormal];
+////    [saveBtn setImageEdgeInsets:UIEdgeInsetsMake(0, 0, 0, -15)]; // 右移
+//    [saveBtn addTarget:self action:@selector(saveDetail:) forControlEvents:UIControlEventTouchUpInside];
+//    UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] initWithCustomView:saveBtn];
+//
+//    UIBarButtonItem *fixBtn = [[UIBarButtonItem alloc] initWithTitle:nil style:UIBarButtonItemStylePlain target:nil action:nil];
+//    fixBtn.width = 0;
+//
+//    UIButton *closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+//    closeBtn.frame = CGRectMake(0, 0, 30, 30);
+//    [closeBtn setImage:[UIImage imageNamed:@"ic_exit"] forState:UIControlStateNormal];
+////    [closeBtn setImageEdgeInsets:UIEdgeInsetsMake(0, 0, 0, -15)]; // 右移,调整和屏幕大间距
+//    [closeBtn addTarget:self action:@selector(closeClick:) forControlEvents:UIControlEventTouchUpInside];
+//    UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithCustomView:closeBtn];
+//
+//
+//    self.navigationItem.rightBarButtonItems = @[closeButton,fixBtn,saveButton];
+
+
+    self.delegate = self;
+}
+
+- (void)didReceiveMemoryWarning
+{
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+- (void)viewWillAppear:(BOOL)animated {
+    [super viewWillAppear:animated];
+    
+     [self configureNavigationBar];
+}
+
+- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
+    
+    [self configureNavigationBar];
+}
+
+- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController {
+    
+    return YES;
+}
+
+- (void)configureNavigationBar {
+    
     UIButton *saveBtn = [UIButton buttonWithType:UIButtonTypeCustom];
     UIButton *saveBtn = [UIButton buttonWithType:UIButtonTypeCustom];
     saveBtn.frame = CGRectMake(0, 0, 30, 30);
     saveBtn.frame = CGRectMake(0, 0, 30, 30);
     [saveBtn setImage:[UIImage imageNamed:@"ic_save"] forState:UIControlStateNormal];
     [saveBtn setImage:[UIImage imageNamed:@"ic_save"] forState:UIControlStateNormal];
-//    [saveBtn setImageEdgeInsets:UIEdgeInsetsMake(0, 0, 0, -15)]; // 右移
+    //    [saveBtn setImageEdgeInsets:UIEdgeInsetsMake(0, 0, 0, -15)]; // 右移
     [saveBtn addTarget:self action:@selector(saveDetail:) forControlEvents:UIControlEventTouchUpInside];
     [saveBtn addTarget:self action:@selector(saveDetail:) forControlEvents:UIControlEventTouchUpInside];
     UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] initWithCustomView:saveBtn];
     UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] initWithCustomView:saveBtn];
-
+    
     UIBarButtonItem *fixBtn = [[UIBarButtonItem alloc] initWithTitle:nil style:UIBarButtonItemStylePlain target:nil action:nil];
     UIBarButtonItem *fixBtn = [[UIBarButtonItem alloc] initWithTitle:nil style:UIBarButtonItemStylePlain target:nil action:nil];
     fixBtn.width = 0;
     fixBtn.width = 0;
     
     
     UIButton *closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
     UIButton *closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
     closeBtn.frame = CGRectMake(0, 0, 30, 30);
     closeBtn.frame = CGRectMake(0, 0, 30, 30);
     [closeBtn setImage:[UIImage imageNamed:@"ic_exit"] forState:UIControlStateNormal];
     [closeBtn setImage:[UIImage imageNamed:@"ic_exit"] forState:UIControlStateNormal];
-//    [closeBtn setImageEdgeInsets:UIEdgeInsetsMake(0, 0, 0, -15)]; // 右移,调整和屏幕大间距
+    //    [closeBtn setImageEdgeInsets:UIEdgeInsetsMake(0, 0, 0, -15)]; // 右移,调整和屏幕大间距
     [closeBtn addTarget:self action:@selector(closeClick:) forControlEvents:UIControlEventTouchUpInside];
     [closeBtn addTarget:self action:@selector(closeClick:) forControlEvents:UIControlEventTouchUpInside];
     UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithCustomView:closeBtn];
     UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithCustomView:closeBtn];
-
     
     
-    self.navigationItem.rightBarButtonItems = @[closeButton,fixBtn,saveButton];
-
+    UIButton *menuBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+    menuBtn.frame = CGRectMake(0, 0, 30, 30);
+    [menuBtn setImage:[UIImage imageNamed:@"ic_menu"] forState:UIControlStateNormal];
+    [menuBtn addTarget:self action:@selector(menuClick:) forControlEvents:UIControlEventTouchUpInside];
+    UIBarButtonItem *menuButton = [[UIBarButtonItem alloc] initWithCustomView:menuBtn];
+    
+    DetailPageViewController *pageVC = (DetailPageViewController *)self.selectedViewController;
+    
+    if([pageVC.function_name isEqualToString:@"Cargo Tracking"] || [pageVC.title isEqualToString:@"Tracing"]) {
+        self.navigationItem.rightBarButtonItems = @[closeButton,fixBtn,menuButton];
+    } else {
+        self.navigationItem.rightBarButtonItems = @[closeButton,fixBtn,saveButton];
+    }
+}
 
 
+- (void)searchDocument {
+    
+    DetailPageViewController *pageVC = (DetailPageViewController *)self.selectedViewController;
+    NSString *hbol = [pageVC.content.originContent objectForKey:@"hbol"];
+    
+    if (hbol.length) {
+        
+        AMResultViewController *resultVC = [[AMResultViewController alloc] initWithNibName:@"Result" bundle:nil];
+        resultVC.params = [@{
+                            @"bol" : hbol,
+                            @"module_name" : @"Download Document"
+                            } mutableCopy];
+        [self.navigationController pushViewController:resultVC animated:YES];
+    } else {
+        
+        UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:nil message:@"There is no hbol to search" preferredStyle:UIAlertControllerStyleAlert];
+        UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"ok", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
+            
+        }];
+        [alertVC addAction:cancelAction];
+        
+        [self presentViewController:alertVC animated:YES completion:nil];
+    }
 }
 }
 
 
-- (void)didReceiveMemoryWarning
-{
-    [super didReceiveMemoryWarning];
-    // Dispose of any resources that can be recreated.
+- (void)menuClick:(id)sender {
+    
+    UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleAlert];
+    
+    __weak typeof(self) weakSelf = self;
+    UIAlertAction *saveAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"save", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+        [weakSelf saveDetail:nil];
+    }];
+    
+    UIAlertAction *searchAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"search", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+        [weakSelf searchDocument];
+    }];
+    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"cancel", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
+        
+    }];
+    
+    [alertVC addAction:saveAction];
+    [alertVC addAction:searchAction];
+    [alertVC addAction:cancelAction];
+    
+    [self presentViewController:alertVC animated:YES completion:nil];
+    
 }
 }
 
 
 @end
 @end

+ 23 - 0
Apex Mobile/Apex Mobile/NewImages.xcassets/status_wait.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "status_wait.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "status_wait@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "status_wait@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
Apex Mobile/Apex Mobile/NewImages.xcassets/status_wait.imageset/status_wait.png


BIN
Apex Mobile/Apex Mobile/NewImages.xcassets/status_wait.imageset/status_wait@2x.png


BIN
Apex Mobile/Apex Mobile/NewImages.xcassets/status_wait.imageset/status_wait@3x.png


+ 1 - 1
Apex Mobile/Apex Mobile/RANetwork.m

@@ -504,7 +504,7 @@
         
         
         //   NSDictionary* objrecords = [jsobj objectForKey:@"records"];
         //   NSDictionary* objrecords = [jsobj objectForKey:@"records"];
         
         
-        
+        detailContent.originContent = jsobj;
         
         
         return detailContent;
         return detailContent;
         
         

+ 1 - 1
Apex Mobile/Apex Mobile/config.h

@@ -12,7 +12,7 @@
 
 
 # ifdef DEBUG
 # ifdef DEBUG
 
 
-//#define test_server
+#define test_server
 
 
 # endif
 # endif
 
 

+ 1 - 0
Apex Mobile/Apex Mobile/zh-Hans.lproj/Localizable.strings

@@ -52,3 +52,4 @@
 "about_ver_key"="版本:";
 "about_ver_key"="版本:";
 "about_support_key"="技术支持:";
 "about_support_key"="技术支持:";
 "about_support_value"="USAIRedAnt@united-us.net";
 "about_support_value"="USAIRedAnt@united-us.net";
+"search"="搜索文档";