Explorar o código

修改Notify Me,选择Customer时提交参数增加Customer Email。
修改Email Cart和Notify Me邮箱正则表达式匹配。

Pen Li %!s(int64=9) %!d(string=hai) anos
pai
achega
b8dfc6b48b

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


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

@@ -2775,7 +2775,7 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
     emailAddrVC.textHandler = ^(NSString *text){
         
         // 验证邮箱格式是否正确
-        NSString *match = @"^[A-Za-zd]+([-_.][A-Za-zd]+)*@([A-Za-zd]+[-.])+[A-Za-zd]{2,5}$";
+        NSString *match = EMAIL_MATCHES;
         NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",match];
         BOOL isEmailAddr = [predicate evaluateWithObject:text];
         if (isEmailAddr) {

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

@@ -1882,7 +1882,7 @@ self.isrefreshing=false;
     emailAddrVC.textHandler = ^(NSString *text){
         
         // 验证邮箱格式是否正确
-        NSString *match = @"^[A-Za-zd]+([-_.][A-Za-zd]+)*@([A-Za-zd]+[-.])+[A-Za-zd]{2,5}$";
+        NSString *match = EMAIL_MATCHES;
         NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",match];
         BOOL isEmailAddr = [predicate evaluateWithObject:text];
         if (isEmailAddr) {

+ 2 - 0
RedAnt ERP Mobile/common/const.h

@@ -96,6 +96,8 @@
 #define MSG_OFFLINE_SUBMIT @"Offline order will be submitted when you login online mode and sync with server."
 #define TITLE_OFFLINE_SUBMIT @"Offline Submit"
 
+#define EMAIL_MATCHES @"\\w[-\\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\\.)+[A-Za-z]{2,14}"
+
 #define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
 
 

+ 9 - 1
RedAnt ERP Mobile/common/data_provider/iSalesNetwork.m

@@ -3975,8 +3975,16 @@ repeat:
     
     [dic setValue:modelID forKey:@"productId"];
     
-    if (addr) {
+    if (addr) { // 弹框输入
         [dic setValue:addr forKey:@"email"];
+    } else {
+        // employee选择了Contact,并且Contact有Email
+        if (appDelegate.user_type == USER_ROLE_EMPLOYEE && appDelegate.customerInfo) {
+            NSString *email = [appDelegate.customerInfo objectForKey:@"customer_email"];
+            if (email) {
+                [dic setValue:email forKey:@"email"];
+            }
+        }
     }