Przeglądaj źródła

修改Notify Me填写邮件地址提示信息以及Email Cart成功提示,Cart Cell增加缺货标记。

Pen Li 9 lat temu
rodzic
commit
000452d2bf

BIN
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 13 - 3
RedAnt ERP Mobile/common/Functions/cart/CartViewController.m

@@ -607,9 +607,9 @@
         if ([obj isKindOfClass:[NSDictionary class]]) {
         if ([obj isKindOfClass:[NSDictionary class]]) {
             
             
             NSDictionary *item_json = (NSDictionary *)obj;
             NSDictionary *item_json = (NSDictionary *)obj;
-            BOOL isAvailable = ![[item_json valueForKey:@"available"] isEqualToString:@"In Production"] || [[item_json valueForKey:@"available"] integerValue] != 0;
+            BOOL isAvailable = ![[item_json valueForKey:@"is_out_of_stock"] boolValue];
             self.available = self.available && isAvailable;
             self.available = self.available && isAvailable;
-            
+
         }
         }
         
         
     }];
     }];
@@ -1525,7 +1525,7 @@
     NSDictionary * combine_json =[item_json objectForKey:@"combine"];
     NSDictionary * combine_json =[item_json objectForKey:@"combine"];
     bool isfree = [[item_json valueForKey:@"is_free"]boolValue];
     bool isfree = [[item_json valueForKey:@"is_free"]boolValue];
     NSString* notes = [item_json valueForKey:@"note"];
     NSString* notes = [item_json valueForKey:@"note"];
-    
+    BOOL is_out_of_stock = [[item_json valueForKey:@"is_out_of_stock"] boolValue];
     bool noprice =[[item_json valueForKey:@"is_no_price"]boolValue];
     bool noprice =[[item_json valueForKey:@"is_no_price"]boolValue];
     cell.noprice = noprice;
     cell.noprice = noprice;
     cell.enable_longpress = true;
     cell.enable_longpress = true;
@@ -1554,6 +1554,16 @@
     else
     else
         cell.labelNoSuchModel.hidden=true;
         cell.labelNoSuchModel.hidden=true;
     
     
+    if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
+        if (!is_out_of_stock) {
+            cell.labelOutOfStock.hidden = YES;
+        } else {
+            cell.labelOutOfStock.hidden = NO;
+        }
+    } else {
+        cell.labelOutOfStock.hidden = YES;
+    }
+    
     //    discount = 5.0;
     //    discount = 5.0;
     cell.discount = discount;
     cell.discount = discount;
     
     

+ 1 - 0
RedAnt ERP Mobile/common/Functions/cart/ModelItemCell.h

@@ -52,6 +52,7 @@
 @property (strong, nonatomic) IBOutlet UIImageView *img_checkmark;
 @property (strong, nonatomic) IBOutlet UIImageView *img_checkmark;
 
 
 @property (strong, nonatomic) IBOutlet UILabel *labelNoSuchModel;
 @property (strong, nonatomic) IBOutlet UILabel *labelNoSuchModel;
+@property (strong, nonatomic) IBOutlet UILabel *labelOutOfStock;
 
 
 @property (nonatomic , copy) void (^onReturnQTY)(int qty , NSDictionary* ext);
 @property (nonatomic , copy) void (^onReturnQTY)(int qty , NSDictionary* ext);
 
 

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

@@ -1012,6 +1012,8 @@ self.isrefreshing=false;
                             
                             
                             } else {
                             } else {
                                 
                                 
+                                [RAUtils message_alert:@"Notification is sent to default email" title:@"Message" controller:weakself];
+                                
                             }
                             }
                         });
                         });
                         
                         
@@ -1805,7 +1807,7 @@ self.isrefreshing=false;
 - (void)showEmailAddrBox {
 - (void)showEmailAddrBox {
     AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     
     
-    JKMessageBoxController *emailAddrVC = [JKMessageBoxController messageBoxControllerWithTip:@"Please enter email address"];
+    JKMessageBoxController *emailAddrVC = [JKMessageBoxController messageBoxControllerWithTip:@"E-mail not setup, please enter your default e-mail" ContentSize:CGSizeMake(350, 130)];
     emailAddrVC.textFiled.secureTextEntry = NO;
     emailAddrVC.textFiled.secureTextEntry = NO;
     emailAddrVC.yesButtonTitle = @"send";
     emailAddrVC.yesButtonTitle = @"send";
     
     

Plik diff jest za duży
+ 132 - 135
RedAnt ERP Mobile/iSales-NPD/Base.lproj/Main.storyboard


+ 2 - 0
RedAnt ERP Mobile/iSales-NPD/JKLock/JKMessageBoxController.h

@@ -24,6 +24,8 @@ typedef void(^inputHandler)(NSString *text);
 
 
 + (instancetype)messageBoxControllerWithTip:(NSString *)msg;
 + (instancetype)messageBoxControllerWithTip:(NSString *)msg;
 
 
++ (instancetype)messageBoxControllerWithTip:(NSString *)msg ContentSize:(CGSize)size;
+
 - (void)warning:(NSString *)msg;
 - (void)warning:(NSString *)msg;
 
 
 @end
 @end

+ 15 - 0
RedAnt ERP Mobile/iSales-NPD/JKLock/JKMessageBoxController.m

@@ -36,6 +36,21 @@
     return alertController;
     return alertController;
 }
 }
 
 
++ (instancetype)messageBoxControllerWithTip:(NSString *)msg ContentSize:(CGSize)size{
+    JKMessageBoxController *alertController = [[JKMessageBoxController alloc] init];
+    
+    // 设置弹出视图时视图大小位置
+    alertController.modalPresentationStyle = UIModalPresentationFormSheet; // 只在iPad起作用
+    if (size.width <= 0 || size.height <= 0) {
+        size = CGSizeMake(300, 130);
+    }
+    alertController.preferredContentSize = size; // 只有在 UIModalPresentationFormSheet 的时候起作用
+    alertController.titleLabel.text = msg;
+    alertController.title = msg;
+    
+    return alertController;
+}
+
 - (void)warning:(NSString *)msg {
 - (void)warning:(NSString *)msg {
     self.textFiled.text = @"";
     self.textFiled.text = @"";
     self.titleLabel.text = msg;
     self.titleLabel.text = msg;

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików