Explorar o código

1.修改UWAVER Cam Scan扫码查看Model Detail。

Pen Li %!s(int64=7) %!d(string=hai) anos
pai
achega
294c5adc6d

+ 18 - 0
RedAnt ERP Mobile/common/Functions/camscan/ScannerViewController.m

@@ -329,6 +329,14 @@
     self.scanButton.layer.borderWidth = 15;
     // Start the AVSession running
     [session startRunning];
+    
+#ifdef BUILD_UWAVER
+    
+    [self.targetButton setTitle:@"Target: Model Detail" forState:UIControlStateNormal];
+    self.target = SCANNER_TARGET_DETAIL;
+    
+#endif
+    
 }
 //#pragma mark - ScannerControllerDelegate
 //-(void)BeginScan:(bool)begin
@@ -417,6 +425,7 @@
             dvc.model_name=[transformed stringValue];
             dvc.category_id=nil;
             dvc.ispush = true;
+            dvc.groupName = [transformed stringValue];
             
             [dvc reload];
             [self.navigationController pushViewController:dvc animated:true];
@@ -667,6 +676,15 @@
 }
 - (IBAction)TargetButtonClick:(id)sender {
     
+    BOOL shouldChangeTarget = YES;
+#ifdef BUILD_UWAVER
+    shouldChangeTarget = NO;
+#endif
+    
+    if (!shouldChangeTarget) {
+        return;
+    }
+    
     UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Change scanner target to" message:nil preferredStyle:UIAlertControllerStyleAlert];
     //block代码块取代了delegate
     

+ 1 - 1
RedAnt ERP Mobile/common/Functions/modelDetail/DetailViewController.m

@@ -122,7 +122,7 @@ dispatch_async(dispatch_get_main_queue(), ^{
     
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
         
-        NSMutableDictionary* detail_json = [[RANetwork request_ItemDetail:self.product_id model_name:self.model_name category_id:self.category_id use_name:self.use_model_name] mutableCopy];
+        NSMutableDictionary* detail_json = [[RANetwork request_ItemDetail:self.product_id model_name:self.model_name category_id:self.category_id use_name:self.use_model_name groupName:self.groupName] mutableCopy];
         
         dispatch_async(dispatch_get_main_queue(), ^{
             [self.mum stopAnimating];

+ 1 - 1
RedAnt ERP Mobile/common/data_provider/RANetwork.h

@@ -77,7 +77,7 @@ extern NSString *const ScreenCodeOfflineSync;
 
 
 
-+(NSDictionary*)request_ItemDetail: (NSString* ) item_id model_name:(NSString*) model_name category_id:(NSString*) category_id use_name :(bool) use_name;
++(NSDictionary*)request_ItemDetail: (NSString* ) item_id model_name:(NSString*) model_name category_id:(NSString*) category_id use_name :(bool) use_name groupName:(NSString *)groupName;
 
 +(NSDictionary*) cart_incresement:(NSString*) cart_id increse:(bool) increse;
 +(NSDictionary*) cart_setQTY:(NSString*) cart_id value:(int) value;

+ 5 - 1
RedAnt ERP Mobile/common/data_provider/RANetwork.m

@@ -2989,7 +2989,7 @@ repeat:
     }
     return jsobj;
 }
-+(NSDictionary*)request_ItemDetail: (NSString* ) item_id model_name:(NSString*) model_name category_id:(NSString*) category_id use_name :(bool) use_name
++(NSDictionary*)request_ItemDetail: (NSString* ) item_id model_name:(NSString*) model_name category_id:(NSString*) category_id use_name :(bool) use_name groupName:(NSString *)groupName
 {
     
     NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
@@ -3019,6 +3019,10 @@ repeat:
         [params setObject:extra forKey:kExtra];
     }
     
+    if (groupName.length > 0) {
+        [params setObject:groupName forKey:@"groupName"];
+    }
+    
     if(appDelegate.offline_mode)
         return [OLDataProvider offline_model:params];