Kaynağa Gözat

HMLG scan order 1.25
Modify autocomplete, add additional params
Modify autocomplete list display, add detail

Ray Zhang 3 yıl önce
ebeveyn
işleme
2ee7aade5f

+ 1 - 1
RedAnt ERP Mobile/HMLG Scan Order/config.h

@@ -17,7 +17,7 @@
 #define RA_NOTIFICATION
 
 # ifdef DEBUG
-#define test_server
+//#define test_server
 # endif
 
 #define exception_switch 1

+ 3 - 2
common/customUI/commoneditor/CommonEditorAutoCompleteView.m

@@ -176,7 +176,8 @@
                                       reuseIdentifier:MyIdentifier];
 
     }
-    cell.textLabel.text = self.arr_result[indexPath.row];//[@"value"];
+    cell.textLabel.text = self.arr_result[indexPath.row][0];//[@"value"];
+    cell.detailTextLabel.text = self.arr_result[indexPath.row][1];
     //cell.detailTextLabel.text = self.arr_result[indexPath.row];//[@"description"];
     return cell;
 }
@@ -196,7 +197,7 @@
     
     
     if(self.returnValue)
-        self.returnValue(self.arr_result[indexPath.row]/*[@"value"]*/);
+        self.returnValue(self.arr_result[indexPath.row][0]/*[@"value"]*/);
 //    self.searchInput.text = nil;
     self.arr_result = nil;
     self.hidden=true;

+ 31 - 0
common/customUI/commoneditor/CommonEditorViewController.m

@@ -6487,6 +6487,37 @@ if(!self.alert.isBeingDismissed)
         NSMutableDictionary* params = [item_json[@"autocomplete_params"] mutableCopy];
         params[@"full_url"] = item_json[@"full_url"];
         params[@"url"] = item_json[@"url"];
+        NSMutableDictionary* add_params = [item_json[@"autocomplete_addation_params"] mutableCopy];
+        NSArray* add_key=[add_params allKeys];
+        for(int i=0;i<add_key.count;i++)
+        {
+            NSString* key = (NSString*)add_key[i];
+            NSString* val = nil;
+            
+            int sc = [self.content_data_download[@"section_count"] intValue];
+            for(int is=0;is<sc;is++)
+            {
+                NSDictionary* section_json = [self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%ld",(long)is ]];
+                int icount=[[section_json valueForKey:@"count"] intValue];
+                for (int ic=0;ic<icount;ic++)
+                {
+                    NSDictionary* add_item= [section_json objectForKey:[NSString stringWithFormat:@"item_%d",ic ]];
+                    
+                    
+                    NSString* mapto = [add_item valueForKey:@"name"];
+                    if([mapto isEqualToString:add_params[key]])
+                    {
+                        val = add_item[@"value"];
+                        params[key]=val;
+                        break;
+                    }
+
+                }
+            }
+           
+            
+        }
+        
         self.autocompleteView.params= params;
         self.autocompleteView.returnValue = ^(NSString *str) {
             //textField  = true;

+ 2 - 2
common/customUI/commoneditor/CommonEditorWebCell.h

@@ -7,7 +7,7 @@
 //
 
 #import <UIKit/UIKit.h>
-
+#import <WebKit/WebKit.h>
 @class CommonEditorWebCell;
 @protocol CommonEditorWebCellDelegate <NSObject>
 
@@ -18,7 +18,7 @@
 @interface CommonEditorWebCell : UITableViewCell
 
 @property (nonatomic,weak) id<CommonEditorWebCellDelegate> webDelegate;
-@property (strong, nonatomic) IBOutlet UIWebView *webview;
+@property (strong, nonatomic) IBOutlet WKWebView *webview;
 @property (weak, nonatomic) IBOutlet UILabel *htmlLabel;
 
 @end