Prechádzať zdrojové kódy

1.修改Cart、Place Order以及Order Detail,增加Master。

Pen Li 8 rokov pred
rodič
commit
71b444ae5b

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


+ 2 - 0
RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellModel.h

@@ -24,5 +24,7 @@
 @property (strong, nonatomic) NSDictionary* bundle_item;
 @property (strong, nonatomic) IBOutlet UILabel *avalibilityLabel;
 
+@property (strong, nonatomic) IBOutlet UIButton *masterBtn;
+@property (nonatomic,strong) NSDictionary *master_items;
 
 @end

+ 26 - 0
RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellModel.m

@@ -56,6 +56,32 @@
     }];
     
 }
+
+
+- (IBAction)masterBtnClick:(UIButton *)sender {
+    
+    UIViewController* vc=[RAUtils getViewController :sender];
+    
+    
+    BundleModelViewController * bundleVC =[ vc.storyboard instantiateViewControllerWithIdentifier:@"BundleModelViewController"];
+    
+    bundleVC.content_data = self.master_items;
+    
+    UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:bundleVC] ;
+    
+    
+    
+    
+    
+    
+    navi.modalPresentationStyle = UIModalTransitionStyleCrossDissolve;//有三种状态,自己看看是哪种
+    [vc presentViewController:navi animated:YES completion:^{
+
+    }];
+    
+}
+
+
 /*
 -(void)longTap:(UILongPressGestureRecognizer *)longRecognizer
 {

+ 10 - 0
RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.m

@@ -4056,6 +4056,16 @@
             NSDictionary * combine_json =[item_json objectForKey:@"combine"];
             cell.bundle_item=combine_json;
             
+            NSDictionary * master_json = [item_json objectForKey:@"combine_master"];
+            if (cell.masterBtn != nil) {
+                if (master_json == nil) {
+                    cell.masterBtn.hidden = YES;
+                } else{
+                    cell.masterBtn.hidden = NO;
+                    cell.master_items = master_json;
+                }
+            }
+            
             double dprice=0.0;
             
             if(cell.bundle_item!=nil)

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

@@ -1527,6 +1527,17 @@
     ModelItemCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
     NSDictionary * item_json = self.content_arr[indexPath.row];//[self.content_data objectForKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row]];
     NSDictionary * combine_json =[item_json objectForKey:@"combine"];
+    NSDictionary * master_json = [item_json objectForKey:@"combine_master"];
+    if (cell.masterBtn != nil) {
+        if (master_json == nil) {
+            cell.masterBtn.hidden = YES;
+        } else{
+            cell.masterBtn.hidden = NO;
+            cell.master_items = master_json;
+        }
+    }
+    
+    
     bool isfree = [[item_json valueForKey:@"is_free"]boolValue];
     NSString* notes = [item_json valueForKey:@"note"];
     BOOL is_out_of_stock = [[item_json valueForKey:@"is_out_of_stock"] boolValue];

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

@@ -20,6 +20,8 @@
 
 //@property (nonatomic, weak) id<ModelItemCellDelegate> delegate;
 
+@property (strong, nonatomic) IBOutlet UIButton *masterBtn;
+@property (nonatomic,strong) NSDictionary *master_items;
 
 @property (strong, nonatomic) IBOutlet UILabel *labelDescription;
 

+ 19 - 3
RedAnt ERP Mobile/common/Functions/cart/ModelItemCell.m

@@ -277,6 +277,25 @@
 
 }
 
+- (IBAction)masterBundleClick:(UIButton *)sender {
+    
+    UIViewController* vc=[RAUtils getViewController :self.bundleButton];
+    
+    
+    BundleModelViewController * bundleVC =[ vc.storyboard instantiateViewControllerWithIdentifier:@"BundleModelViewController"];
+    
+    bundleVC.content_data = self.master_items;
+    
+    UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:bundleVC] ;
+    
+    navi.modalPresentationStyle = UIModalTransitionStyleCrossDissolve;//有三种状态,自己看看是哪种
+    [vc presentViewController:navi animated:YES completion:^{
+        
+
+    }];
+
+    
+}
 
 //-(UIViewController*) getViewController
 //{
@@ -303,9 +322,6 @@
     
     
     
-    
-    
-    
     navi.modalPresentationStyle = UIModalTransitionStyleCrossDissolve;//有三种状态,自己看看是哪种
     [vc presentViewController:navi animated:YES completion:^{
         

+ 2 - 0
RedAnt ERP Mobile/common/Functions/order/OrderDetailModelCell.h

@@ -23,5 +23,7 @@
 @property (strong, nonatomic) NSDictionary* bundle_item;
 
 @property (nonatomic,copy) NSString *imageName;///<图片标识
+@property (strong, nonatomic) IBOutlet UIButton *masterBtn;
+@property (nonatomic,strong) NSDictionary *master_items;
 
 @end

+ 25 - 0
RedAnt ERP Mobile/common/Functions/order/OrderDetailModelCell.m

@@ -51,4 +51,29 @@
     }];
 }
 
+- (IBAction)masterBtnClick:(UIButton *)sender {
+    
+    UIViewController* vc=[RAUtils getViewController :sender];
+    
+    
+    BundleModelViewController * bundleVC =[ vc.storyboard instantiateViewControllerWithIdentifier:@"BundleModelViewController"];
+    
+    bundleVC.content_data = self.master_items;
+    
+    UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:bundleVC] ;
+    
+    
+    
+    
+    
+    
+    navi.modalPresentationStyle = UIModalTransitionStyleCrossDissolve;//有三种状态,自己看看是哪种
+    [vc presentViewController:navi animated:YES completion:^{
+
+    }];
+
+    
+}
+
+
 @end

+ 37 - 0
RedAnt ERP Mobile/common/Functions/order/OrderDetailViewController.m

@@ -2229,6 +2229,15 @@
 //            int count = [[item_json valueForKey:@"count"] intValue];
             NSDictionary * combine_json =[item_json objectForKey:@"combine"];
             cell.bundle_item=combine_json;
+            NSDictionary * master_json = [item_json objectForKey:@"combine_master"];
+            if (cell.masterBtn != nil) {
+                if (master_json == nil) {
+                    cell.masterBtn.hidden = YES;
+                } else{
+                    cell.masterBtn.hidden = NO;
+                    cell.master_items = master_json;
+                }
+            }
             
             double dprice=0.0;
             
@@ -2581,6 +2590,15 @@
             //            int count = [[item_json valueForKey:@"count"] intValue];
             NSDictionary * combine_json =[item_json objectForKey:@"combine"];
             cell.bundle_item=combine_json;
+            NSDictionary * master_json = [item_json objectForKey:@"combine_master"];
+            if (cell.masterBtn != nil) {
+                if (master_json == nil) {
+                    cell.masterBtn.hidden = YES;
+                } else{
+                    cell.masterBtn.hidden = NO;
+                    cell.master_items = master_json;
+                }
+            }
             
             double dprice=0.0;
             
@@ -2933,6 +2951,15 @@
             //            int count = [[item_json valueForKey:@"count"] intValue];
             NSDictionary * combine_json =[item_json objectForKey:@"combine"];
             cell.bundle_item=combine_json;
+            NSDictionary * master_json = [item_json objectForKey:@"combine_master"];
+            if (cell.masterBtn != nil) {
+                if (master_json == nil) {
+                    cell.masterBtn.hidden = YES;
+                } else{
+                    cell.masterBtn.hidden = NO;
+                    cell.master_items = master_json;
+                }
+            }
             
             double dprice=0.0;
             
@@ -3312,6 +3339,16 @@
             NSDictionary * combine_json =[item_json objectForKey:@"combine"];
             cell.bundle_item=combine_json;
             
+            NSDictionary * master_json = [item_json objectForKey:@"combine_master"];
+            if (cell.masterBtn != nil) {
+                if (master_json == nil) {
+                    cell.masterBtn.hidden = YES;
+                } else{
+                    cell.masterBtn.hidden = NO;
+                    cell.master_items = master_json;
+                }
+            }
+            
             double dprice=0.0;
             
             if(cell.bundle_item!=nil)

+ 39 - 12
RedAnt ERP Mobile/iSales-NPD/Base.lproj/Main.storyboard

@@ -2200,7 +2200,7 @@
                                         <rect key="frame" x="0.0" y="88" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Pol-lE-P45" id="FAm-1c-nX0">
-                                            <rect key="frame" x="0.0" y="0.0" width="730" height="44"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="702" height="44"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Clean Cache" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="AHm-p1-51h">
@@ -2433,7 +2433,7 @@
                                                 <rect key="frame" x="0.0" y="22" width="768" height="146"/>
                                                 <autoresizingMask key="autoresizingMask"/>
                                                 <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="0QE-xl-8q8" id="tZa-g0-y6H">
-                                                    <rect key="frame" x="0.0" y="0.0" width="768" height="146"/>
+                                                    <rect key="frame" x="0.0" y="0.0" width="768" height="145.5"/>
                                                     <autoresizingMask key="autoresizingMask"/>
                                                     <subviews>
                                                         <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="name aaaaaaaaaaaaa aaaaaaaaaa BBBBB  CCCCC" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="S98-fV-nsC" userLabel="name and description">
@@ -2541,6 +2541,14 @@
                                                             <color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                                                             <nil key="highlightedColor"/>
                                                         </label>
+                                                        <button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="UvK-dV-WvD" customClass="BundleDetailButton">
+                                                            <rect key="frame" x="697" y="84" width="57" height="30"/>
+                                                            <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+                                                            <state key="normal" title="Master"/>
+                                                            <connections>
+                                                                <action selector="masterBundleClick:" destination="0QE-xl-8q8" eventType="touchUpInside" id="RWn-bh-50i"/>
+                                                            </connections>
+                                                        </button>
                                                     </subviews>
                                                 </tableViewCellContentView>
                                                 <connections>
@@ -2557,6 +2565,7 @@
                                                     <outlet property="labelOutOfStock" destination="5Qv-6p-Q3B" id="O41-iu-Zbb"/>
                                                     <outlet property="labelPrice" destination="Cxh-Hh-Y8F" id="XKJ-Ql-8i9"/>
                                                     <outlet property="labelUnitPrice" destination="1VQ-u3-PN9" id="e4k-4z-CHK"/>
+                                                    <outlet property="masterBtn" destination="UvK-dV-WvD" id="J1J-eW-bv5"/>
                                                     <outlet property="stepper" destination="gtr-CW-DLD" id="Ryd-YC-bC5"/>
                                                 </connections>
                                             </tableViewCell>
@@ -4945,7 +4954,7 @@
                                         <rect key="frame" x="0.0" y="55.5" width="768" height="140"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="n4c-77-hLv" id="DvL-17-pkX">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="139"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="139.5"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" id="NKX-ck-Bay">
@@ -5053,7 +5062,7 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="CommonEditorCellEdit" rowHeight="44" id="59Q-8C-fQM" customClass="CommonEditorCellEdit">
-                                        <rect key="frame" x="0.0" y="284" width="768" height="44"/>
+                                        <rect key="frame" x="0.0" y="283.5" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="59Q-8C-fQM" id="nqb-0z-RP8">
                                             <rect key="frame" x="0.0" y="0.0" width="768" height="43"/>
@@ -5939,6 +5948,14 @@ Email: redantsupport@united-us.net</string>
                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                     <nil key="highlightedColor"/>
                                                 </label>
+                                                <button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="xAh-FH-6T1">
+                                                    <rect key="frame" x="663" y="124" width="60" height="30"/>
+                                                    <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+                                                    <state key="normal" title="Master"/>
+                                                    <connections>
+                                                        <action selector="masterBtnClick:" destination="lSe-2G-cT7" eventType="touchUpInside" id="EPy-mA-s22"/>
+                                                    </connections>
+                                                </button>
                                             </subviews>
                                         </tableViewCellContentView>
                                         <connections>
@@ -5947,6 +5964,7 @@ Email: redantsupport@united-us.net</string>
                                             <outlet property="imgbtn" destination="fGj-mm-19f" id="xBa-os-9Zh"/>
                                             <outlet property="labelDiscount" destination="jhV-zw-Osd" id="ZMs-IA-SEm"/>
                                             <outlet property="labelOldPrice" destination="dzI-A2-cDp" id="yOx-ap-wiT"/>
+                                            <outlet property="masterBtn" destination="xAh-FH-6T1" id="y7x-vQ-KDP"/>
                                             <outlet property="noteLabel" destination="ZC6-yX-gVz" id="3kW-9b-Ji2"/>
                                             <outlet property="qtyLabel" destination="1RP-t3-Yzh" id="RtE-xs-jJ9"/>
                                             <outlet property="statusLabel" destination="hXf-AY-f6Z" id="hDH-zP-nVA"/>
@@ -6615,8 +6633,8 @@ Email: redantsupport@united-us.net</string>
                                             <rect key="frame" x="0.0" y="0.0" width="768" height="140"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
-                                                <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" id="Joe-9c-mhx">
-                                                    <rect key="frame" x="20" y="20" width="100" height="100"/>
+                                                <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" id="Joe-9c-mhx">
+                                                    <rect key="frame" x="20" y="5" width="100" height="100"/>
                                                     <autoresizingMask key="autoresizingMask"/>
                                                 </imageView>
                                                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="name&amp;description" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="iDg-P5-o92">
@@ -6686,6 +6704,14 @@ Email: redantsupport@united-us.net</string>
                                                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                     <nil key="highlightedColor"/>
                                                 </label>
+                                                <button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="KFI-NJ-ifx">
+                                                    <rect key="frame" x="34" y="102" width="72" height="30"/>
+                                                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                                    <state key="normal" title="Master"/>
+                                                    <connections>
+                                                        <action selector="masterBtnClick:" destination="aNn-5E-yfU" eventType="touchUpInside" id="347-tV-7w2"/>
+                                                    </connections>
+                                                </button>
                                             </subviews>
                                         </tableViewCellContentView>
                                         <connections>
@@ -6699,6 +6725,7 @@ Email: redantsupport@united-us.net</string>
                                             <outlet property="labelOldPrice" destination="iUj-CY-YFb" id="xKC-ab-ocD"/>
                                             <outlet property="labelTotalPrice" destination="6jm-kJ-DHb" id="fuG-jo-xav"/>
                                             <outlet property="labelUnitPrice" destination="T07-5n-VTm" id="Zvz-p9-Ss1"/>
+                                            <outlet property="masterBtn" destination="KFI-NJ-ifx" id="Ded-T1-gkD"/>
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="CommonEditorCellEnum" id="0El-DP-xYZ" customClass="CommonEditorCellEnum">
@@ -8032,7 +8059,7 @@ Email: redantsupport@united-us.net</string>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="HwF-54-hzr">
-                                                    <rect key="frame" x="15" y="0.0" width="698" height="43.5"/>
+                                                    <rect key="frame" x="28" y="0.0" width="672" height="43.5"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="16"/>
                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -8788,9 +8815,9 @@ Email: redantsupport@united-us.net</string>
         <image name="add_180" width="180" height="180"/>
         <image name="album" width="48" height="48"/>
         <image name="assign" width="40" height="40"/>
-        <image name="btn_addtocart_large" width="124" height="39"/>
-        <image name="btn_addtoportfolio" width="124" height="39"/>
-        <image name="btn_addtowish" width="124" height="39"/>
+        <image name="btn_addtocart_large" width="123" height="39"/>
+        <image name="btn_addtoportfolio" width="123" height="39"/>
+        <image name="btn_addtowish" width="123" height="39"/>
         <image name="btn_cancel" width="102" height="30"/>
         <image name="btn_cancelorder" width="30" height="30"/>
         <image name="btn_ok" width="102" height="30"/>
@@ -8807,7 +8834,7 @@ Email: redantsupport@united-us.net</string>
         <image name="checkbox" width="16" height="16"/>
         <image name="close" width="32" height="32"/>
         <image name="contact" width="96" height="96"/>
-        <image name="continue" width="131" height="30"/>
+        <image name="continue" width="129" height="30"/>
         <image name="filter" width="32" height="32"/>
         <image name="layout_list" width="40" height="40"/>
         <image name="layout_small" width="40" height="40"/>
@@ -8820,7 +8847,7 @@ Email: redantsupport@united-us.net</string>
         <image name="more_color_larger" width="32" height="32"/>
         <image name="newcustomer" width="32" height="32"/>
         <image name="neworder" width="40" height="40"/>
-        <image name="notifyMe" width="124" height="39"/>
+        <image name="notifyMe" width="123" height="39"/>
         <image name="npd_logo" width="110" height="13"/>
         <image name="order" width="72" height="72"/>
         <image name="pick_bg" width="280" height="280"/>