Просмотр исходного кода

1.修改NPD,将dic2data方法调用类RAUtils替换为RAConvert。
2.CommonEditor增加BannerCell。

Pen Li 8 лет назад
Родитель
Сommit
19e0ca7d58

+ 29 - 0
RedAnt ERP Mobile/common/CommonEditor/CommonEditorBannerCell.h

@@ -0,0 +1,29 @@
+//
+//  CommonEditorBannerCell.h
+//  TestPhoto
+//
+//  Created by Jack on 2017/11/30.
+//  Copyright © 2017年 Jack. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class CommonEditorBannerCell;
+@protocol CommonEditorBannerDelegate <NSObject>
+
+//@required
+//- (void)commonEditorBannerCell:(CommonEditorBannerCell *)cell didLoadImage:(UIImage *)img atIndexPath:(NSIndexPath *)indexPath;
+
+@optional
+- (void)commonEditorBannerCell:(CommonEditorBannerCell *)cell didClickItemAtIndexPath:(NSIndexPath *)indexPath;
+
+@end
+
+@interface CommonEditorBannerCell : UITableViewCell
+
+@property (nonatomic,weak) UIViewController<CommonEditorBannerDelegate> *delegate;
+
+- (void)setContent:(NSDictionary *)content;
+- (NSDictionary *)content;
+
+@end

+ 292 - 0
RedAnt ERP Mobile/common/CommonEditor/CommonEditorBannerCell.m

@@ -0,0 +1,292 @@
+//
+//  CommonEditorBannerCell.m
+//  TestPhoto
+//
+//  Created by Jack on 2017/11/30.
+//  Copyright © 2017年 Jack. All rights reserved.
+//
+
+#import "CommonEditorBannerCell.h"
+#import "CommonEditorBannerItemCell.h"
+#import "YTPlayerView.h"
+
+@interface CommonEditorBannerCell () <UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
+{
+    NSMutableDictionary *_contentJson;
+}
+
+@property (weak, nonatomic) IBOutlet YTPlayerView *playerView;
+@property (strong, nonatomic) IBOutlet UIPageControl *pageControlView;
+@property (strong, nonatomic) IBOutlet UICollectionView *bannerCollectionView;
+@property (nonatomic,strong) UICollectionViewFlowLayout *flowLayout;
+
+@end
+
+
+@implementation CommonEditorBannerCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+    [self configBanner];
+}
+
+- (instancetype)initWithCoder:(NSCoder *)aDecoder {
+    if (self = [super initWithCoder:aDecoder]) {
+        [self configBanner];
+    }
+    return self;
+}
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        [self configBanner];
+    }
+    return self;
+}
+
+- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
+    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
+        [self configBanner];
+    }
+    return self;
+}
+
+#pragma mark -
+
+- (void)configBanner {
+    if (self.bannerCollectionView) {
+        [self.bannerCollectionView registerNib:[UINib nibWithNibName:@"Phone_Banner_Item_Cell" bundle:nil] forCellWithReuseIdentifier:@"CommonEditorBannerItemCell"];
+        self.flowLayout = (UICollectionViewFlowLayout *)self.bannerCollectionView.collectionViewLayout;
+    }
+}
+
+- (void)layoutSubviews {
+    [super layoutSubviews];
+    [self.flowLayout invalidateLayout];
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+
+#pragma mark - Interface
+
+- (NSDictionary *)content {
+    return _contentJson;
+}
+
+- (void)setContent:(NSDictionary *)content {
+    _contentJson = [content mutableCopy];
+    
+    int count = [[_contentJson objectForKey:@"count"] intValue];
+    
+    self.pageControlView.numberOfPages = count;
+    self.pageControlView.currentPage = 0;
+    
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        
+        for(int i=0;i<count;i++)
+        {
+            
+            NSDictionary* item_json=[_contentJson objectForKey:[NSString stringWithFormat:@"item_%d",i]];
+            
+            NSString* type = item_json[@"type"];
+
+            
+            NSString* img_url = [item_json valueForKey:@"s"];
+            
+            NSString* file_name=[img_url lastPathComponent];
+            NSData* img_data=nil;
+            
+            if([type isEqualToString:@"video"])
+            {
+                img_data = UIImagePNGRepresentation([UIImage imageNamed:@"play"]);
+            }
+            else
+            {
+                NSLog(@"load img : %@",img_url);
+                if([item_json[@"is_localfile"] boolValue])
+                    img_data = [NSData dataWithContentsOfFile:img_url];
+//                else
+//                    img_data = [iSalesDB load_cached_img:file_name loadFrom:img_url];
+            }
+            
+            if(img_data!=nil)
+            {
+                dispatch_async(dispatch_get_main_queue(), ^{
+                    UIImage * img =[UIImage imageWithData:img_data];
+                    [self updateImage:img atIndex:i];
+
+                });
+            }
+            else
+            {
+                NSData*  downloadimg_data = nil;
+                
+                downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]];
+                NSLog(@"load img");
+                dispatch_async(dispatch_get_main_queue(), ^{
+                    
+                    if(downloadimg_data!=nil)
+                    {
+                        
+//                        [iSalesDB cache_img:downloadimg_data filename:file_name saveTo:img_url];
+                        
+                        UIImage * img =[UIImage imageWithData:downloadimg_data];
+                        [self updateImage:img atIndex:i];
+
+                    }
+                    else
+                    {
+
+                        UIImage * img =[UIImage imageNamed:@"notfound_l"];
+                        [self updateImage:img atIndex:i];
+
+                    }
+                    
+                }); // gcd
+                
+            } // else
+
+        } // for
+
+    });// gcd
+    
+    [self.bannerCollectionView reloadData];
+}
+
+- (void)updateImage:(UIImage *)img atIndex:(NSInteger)index {
+    if (img == nil) {
+        NSLog(@"empty image at %ld",index);
+        return;
+    }
+    NSLog(@"loaded image %@ at %ld",img,index);
+    
+    NSString *key = [NSString stringWithFormat:@"item_%ld",index];
+    NSMutableDictionary *item_json = [[_contentJson objectForKey:key] mutableCopy];
+    [item_json setObject:img forKey:@"image"];
+    [_contentJson setObject:item_json forKey:key];
+    
+    NSArray<NSIndexPath *> *visibleArr = [self.bannerCollectionView indexPathsForVisibleItems];
+    for (NSIndexPath *indexPath in visibleArr) {
+        if (indexPath.row == index) {
+            // 更新视图
+            dispatch_async(dispatch_get_main_queue(), ^{
+                [self.bannerCollectionView reloadItemsAtIndexPaths:@[indexPath]];
+            });
+        }
+    }
+}
+
+#pragma mark - Private
+
+- (IBAction)closePlayerBtnClick:(UIButton *)sender {
+    [self.playerView stopVideo];
+    self.playerView.hidden=true;
+}
+
+
+#pragma mark - DataSource & Delegate
+
+- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
+    int count = [[_contentJson objectForKey:@"count"] intValue];
+    return count;
+}
+
+- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
+    
+    CommonEditorBannerItemCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"CommonEditorBannerItemCell" forIndexPath:indexPath];
+    
+    NSString *key = [NSString stringWithFormat:@"item_%ld",indexPath.row];
+    NSMutableDictionary *item_json = [[_contentJson objectForKey:key] mutableCopy];
+    
+    [cell setItem:item_json];
+    
+    return cell;
+}
+
+- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
+    return collectionView.bounds.size;
+}
+
+- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section {
+    return 0;
+}
+
+- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
+    if (scrollView == self.bannerCollectionView) {
+        
+        CGFloat offsetX = scrollView.contentOffset.x;
+        CGFloat page = offsetX / CGRectGetWidth(scrollView.bounds);
+        self.pageControlView.currentPage = (int)page;
+    }
+}
+
+- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
+    
+    
+    
+    NSDictionary* item= _contentJson[[NSString stringWithFormat:@"item_%ld",indexPath.row]];
+    
+    if([item[@"type"] isEqualToString:@"video"])
+    {
+        
+        NSString* video_code=item[@"code"];
+
+        NSString* video_id=[self.playerView Embed2VID:video_code];
+        
+        NSDictionary *playerVars = @{
+                                     @"playsinline" : @1,
+                                     @"autoplay" : @(1),
+                                     @"rel":@0,
+                                     @"showinfo": @0,
+                                     @"modestbranding":@0,
+                                     @"enablejsapi":@1
+                                     };
+        
+        [self.playerView loadWithVideoId:video_id playerVars:playerVars];
+        for(UIView *v in self.playerView.subviews)
+        {
+            if([v isKindOfClass:[UIButton class] ])
+                [self.playerView bringSubviewToFront:v];
+        }
+        if (@available(iOS 9.0, *)) {
+            self.playerView.webView.allowsPictureInPictureMediaPlayback=false;
+        } else {
+            // Fallback on earlier versions
+        }
+        self.playerView.hidden=false;
+        
+        return;
+    }
+    else
+    {
+//        ContentPreviewController *preVC = [[UIStoryboard storyboardWithName:@"PhotoList" bundle:nil] instantiateViewControllerWithIdentifier:@"ContentPreviewController"];
+//        preVC.content = self.stack_contents;
+//
+//        [preVC setOffset:index];
+//        UIViewController *superVC= [RAUtils getViewController:self];
+//        [superVC.navigationController pushViewController:preVC animated:true];
+        
+        
+        if (self.delegate && [self.delegate respondsToSelector:@selector(commonEditorBannerCell:didClickItemAtIndexPath:)]) {
+            [self.delegate commonEditorBannerCell:self didClickItemAtIndexPath:indexPath];
+        }
+        
+        return;
+    }
+    
+
+//    // 调用展示窗口
+//    ImageScrollerViewController *imgShow = [[ImageScrollerViewController alloc] initWithSourceData:[self.photos mutableCopy] withIndex:index];
+//
+//    UIViewController *vc= [RAUtils getViewController:self];
+//    [vc.navigationController pushViewController:imgShow animated:true];
+    
+
+}
+
+@end

+ 15 - 0
RedAnt ERP Mobile/common/CommonEditor/CommonEditorBannerItemCell.h

@@ -0,0 +1,15 @@
+//
+//  CommonEditorBannerItemCell.h
+//  TestPhoto
+//
+//  Created by Jack on 2017/11/30.
+//  Copyright © 2017年 Jack. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface CommonEditorBannerItemCell : UICollectionViewCell
+
+- (void)setItem:(NSDictionary *)item;
+
+@end

+ 23 - 0
RedAnt ERP Mobile/common/CommonEditor/CommonEditorBannerItemCell.m

@@ -0,0 +1,23 @@
+//
+//  CommonEditorBannerItemCell.m
+//  TestPhoto
+//
+//  Created by Jack on 2017/11/30.
+//  Copyright © 2017年 Jack. All rights reserved.
+//
+
+#import "CommonEditorBannerItemCell.h"
+
+@interface CommonEditorBannerItemCell ()
+@property (strong, nonatomic) IBOutlet UIImageView *coverImageView;
+
+@end
+
+@implementation CommonEditorBannerItemCell
+
+- (void)setItem:(NSDictionary *)item {
+    UIImage *img = [item objectForKey:@"image"];
+    self.coverImageView.image = img;
+}
+
+@end

+ 54 - 2
RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.m

@@ -49,6 +49,7 @@
 #import "EnumSelectAndSortViewController.h"
 #import "CommonEditorRangeCell.h"
 #import "CommonEditorWebCell.h"
+#import "CommonEditorBannerCell.h"
 
 
 
@@ -58,7 +59,7 @@
 
 @implementation subitem_data
 @end
-@interface CommonEditorViewController ()<CommonEditorRangeDelegate,CommonEditorWebCellDelegate>
+@interface CommonEditorViewController ()<CommonEditorRangeDelegate,CommonEditorWebCellDelegate,CommonEditorBannerDelegate>
 
 @end
 
@@ -135,6 +136,7 @@
     [self.editorTable registerNib:[UINib nibWithNibName:@"Phone_TextView_Cell" bundle:nil] forCellReuseIdentifier:@"CommonEditorCellTextView"];
     [self.editorTable registerNib:[UINib nibWithNibName:@"Phone_Range_Cell" bundle:nil] forCellReuseIdentifier:@"CommonEditorRangeCell"];
     [self.editorTable registerNib:[UINib nibWithNibName:@"Phone_Web_Cell" bundle:nil] forCellReuseIdentifier:@"CommonEditorWebCell"];
+    [self.editorTable registerNib:[UINib nibWithNibName:@"Phone_Banner_Cell" bundle:nil] forCellReuseIdentifier:@"CommonEditorBannerCell"];
 }
 
 - (void)setupEditorTable {
@@ -2861,7 +2863,9 @@
                 height=44;
             return height;
         }
-        
+        else if ([control isEqualToString:@"banner"]) {
+            return 200;
+        }
         return 80;
     } else {
         if([control isEqualToString:@"model"])
@@ -4169,6 +4173,44 @@
             
             return cell;
         }
+        else if ([control isEqualToString:@"banner"]) {
+            CommonEditorBannerCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CommonEditorBannerCell" forIndexPath:indexPath];
+            
+//            NSDictionary *item_json = @{
+//                                  @"control" : @"banner",
+//                                  @"item_4": @{
+//                                          @"type" : @"image",
+//                                          @"s": @"http://127.0.0.1/s2.jpg",
+//                                          @"l": @"http://192.168.0.133:8080/site/u/NPD/20160615/108237-318N_7528.jpg"
+//                                          },
+//                                  @"count": @(5),
+//                                  @"item_2": @{
+//                                          @"type" : @"image",
+//                                          @"s": @"http://127.0.0.1/s3.jpg",
+//                                          @"l": @"http://192.168.0.133:8080/site/u/NPD/20160615/108237-318N_7526.jpg"
+//                                          },
+//                                  @"item_3": @{
+//                                          @"type" : @"image",
+//                                          @"s": @"http://127.0.0.1/s4.jpg",
+//                                          @"l": @"http://192.168.0.133:8080/site/u/NPD/20160615/108237-318N_7527.jpg"
+//                                          },
+//                                  @"item_0": @{
+//                                          @"type" : @"image",
+//                                          @"s": @"http://127.0.0.1/s1.jpg",
+//                                          @"l": @"http://192.168.0.133:8080/site/u/NPD/20160615/108237-318N_7524.jpg"
+//                                          },
+//                                  @"item_1": @{
+//                                          @"type" : @"image",
+//                                          @"s": @"http://127.0.0.1/s5.jpg",
+//                                          @"l": @"http://192.168.0.133:8080/site/u/NPD/20160615/108237-318N_7525.jpg"
+//                                          }
+//                                  };
+            
+            [cell setContent:item_json];
+            cell.delegate = self;
+            
+            return cell;
+        }
         else
         {
             CellIdentifier = @"CommonEditorCellEdit";
@@ -6242,6 +6284,16 @@
  
 }
 
+#pragma mark - Banner Delegate
+
+- (void)commonEditorBannerCell:(CommonEditorBannerCell *)cell didClickItemAtIndexPath:(NSIndexPath *)indexPath {
+//    ContentPreviewController *preVC = [[UIStoryboard storyboardWithName:@"PhotoList" bundle:nil] instantiateViewControllerWithIdentifier:@"ContentPreviewController"];
+//    preVC.content = [cell content];
+//
+//    [preVC setOffset:indexPath.row];
+//    [self presentViewController:preVC animated:true completion:nil];
+}
+
 @end
 
 

+ 97 - 0
RedAnt ERP Mobile/common/CommonEditor/Phone_Banner_Cell.xib

@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CommonEditorBannerCell"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="CommonEditorBannerCell" rowHeight="200" id="E8q-bo-mcp" customClass="CommonEditorBannerCell">
+            <rect key="frame" x="0.0" y="0.0" width="597" height="195"/>
+            <autoresizingMask key="autoresizingMask"/>
+            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="E8q-bo-mcp" id="sgK-xT-zL1">
+                <rect key="frame" x="0.0" y="0.0" width="597" height="194.5"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ILR-pL-388">
+                        <rect key="frame" x="0.0" y="0.0" width="597" height="200"/>
+                        <subviews>
+                            <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" alwaysBounceHorizontal="YES" pagingEnabled="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="dim-uJ-xoH">
+                                <rect key="frame" x="0.0" y="0.0" width="597" height="200"/>
+                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                <collectionViewFlowLayout key="collectionViewLayout" scrollDirection="horizontal" minimumLineSpacing="10" minimumInteritemSpacing="10" id="iRW-wb-XZe">
+                                    <size key="itemSize" width="50" height="50"/>
+                                    <size key="headerReferenceSize" width="0.0" height="0.0"/>
+                                    <size key="footerReferenceSize" width="0.0" height="0.0"/>
+                                    <inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
+                                </collectionViewFlowLayout>
+                                <connections>
+                                    <outlet property="dataSource" destination="E8q-bo-mcp" id="1Ka-oU-6XU"/>
+                                    <outlet property="delegate" destination="E8q-bo-mcp" id="Pku-SP-Yhg"/>
+                                </connections>
+                            </collectionView>
+                            <pageControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" hidesForSinglePage="YES" numberOfPages="3" translatesAutoresizingMaskIntoConstraints="NO" id="jgm-U6-Z9N">
+                                <rect key="frame" x="279" y="165" width="39" height="20"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="20" id="wcZ-1d-53o"/>
+                                </constraints>
+                                <color key="pageIndicatorTintColor" red="0.95751700129999995" green="0.95751700129999995" blue="0.95751700129999995" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <color key="currentPageIndicatorTintColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
+                            </pageControl>
+                            <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HOS-2H-C9K" customClass="YTPlayerView">
+                                <rect key="frame" x="0.0" y="0.0" width="597" height="200"/>
+                                <subviews>
+                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fGW-SJ-BKG">
+                                        <rect key="frame" x="547" y="10" width="40" height="40"/>
+                                        <constraints>
+                                            <constraint firstAttribute="width" constant="40" id="9aV-iZ-V7l"/>
+                                            <constraint firstAttribute="height" constant="40" id="sbU-Ky-1gA"/>
+                                        </constraints>
+                                        <state key="normal" title="Click"/>
+                                        <connections>
+                                            <action selector="closePlayerBtnClick:" destination="E8q-bo-mcp" eventType="touchUpInside" id="ZUw-nl-LTT"/>
+                                        </connections>
+                                    </button>
+                                </subviews>
+                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                <constraints>
+                                    <constraint firstItem="fGW-SJ-BKG" firstAttribute="top" secondItem="HOS-2H-C9K" secondAttribute="top" constant="10" id="eoT-k1-E97"/>
+                                    <constraint firstAttribute="trailing" secondItem="fGW-SJ-BKG" secondAttribute="trailing" constant="10" id="h63-Zc-iwa"/>
+                                </constraints>
+                            </view>
+                        </subviews>
+                        <constraints>
+                            <constraint firstItem="HOS-2H-C9K" firstAttribute="width" secondItem="dim-uJ-xoH" secondAttribute="width" id="8Rr-f1-J4n"/>
+                            <constraint firstItem="dim-uJ-xoH" firstAttribute="leading" secondItem="ILR-pL-388" secondAttribute="leading" id="8qw-SX-zW4"/>
+                            <constraint firstItem="HOS-2H-C9K" firstAttribute="top" secondItem="dim-uJ-xoH" secondAttribute="top" id="CFH-ft-nGh"/>
+                            <constraint firstAttribute="trailing" secondItem="dim-uJ-xoH" secondAttribute="trailing" id="HcU-au-46u"/>
+                            <constraint firstItem="jgm-U6-Z9N" firstAttribute="centerX" secondItem="dim-uJ-xoH" secondAttribute="centerX" id="OcS-gH-MBc"/>
+                            <constraint firstItem="HOS-2H-C9K" firstAttribute="leading" secondItem="dim-uJ-xoH" secondAttribute="leading" id="Q3h-Al-oBr"/>
+                            <constraint firstItem="dim-uJ-xoH" firstAttribute="top" secondItem="ILR-pL-388" secondAttribute="top" id="Yts-tl-DH6"/>
+                            <constraint firstAttribute="bottom" secondItem="jgm-U6-Z9N" secondAttribute="bottom" constant="15" id="crp-Nk-04a"/>
+                            <constraint firstItem="HOS-2H-C9K" firstAttribute="height" secondItem="dim-uJ-xoH" secondAttribute="height" id="e9P-R8-U7x"/>
+                            <constraint firstAttribute="bottom" secondItem="dim-uJ-xoH" secondAttribute="bottom" id="erb-RQ-eHv"/>
+                            <constraint firstAttribute="height" constant="200" id="j8H-yL-qY0"/>
+                        </constraints>
+                    </view>
+                </subviews>
+                <constraints>
+                    <constraint firstItem="ILR-pL-388" firstAttribute="leading" secondItem="sgK-xT-zL1" secondAttribute="leading" id="3ge-Ud-7vq"/>
+                    <constraint firstItem="ILR-pL-388" firstAttribute="top" secondItem="sgK-xT-zL1" secondAttribute="top" id="VEr-Vj-vEG"/>
+                    <constraint firstAttribute="trailing" secondItem="ILR-pL-388" secondAttribute="trailing" id="YwD-Yd-SgA"/>
+                </constraints>
+            </tableViewCellContentView>
+            <connections>
+                <outlet property="bannerCollectionView" destination="dim-uJ-xoH" id="zFo-4H-Sng"/>
+                <outlet property="pageControlView" destination="jgm-U6-Z9N" id="qJa-V3-1Ry"/>
+                <outlet property="playerView" destination="HOS-2H-C9K" id="plZ-PC-aQb"/>
+            </connections>
+            <point key="canvasLocation" x="189.5" y="189.5"/>
+        </tableViewCell>
+    </objects>
+</document>

+ 39 - 0
RedAnt ERP Mobile/common/CommonEditor/Phone_Banner_Item_Cell.xib

@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="CommonEditorBannerItemCell" id="IwU-pd-Orb" customClass="CommonEditorBannerItemCell">
+            <rect key="frame" x="0.0" y="0.0" width="526" height="175"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+            <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO">
+                <rect key="frame" x="0.0" y="0.0" width="526" height="175"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <imageView contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" insetsLayoutMarginsFromSafeArea="NO" translatesAutoresizingMaskIntoConstraints="NO" id="USb-tr-kud">
+                        <rect key="frame" x="0.0" y="0.0" width="526" height="175"/>
+                    </imageView>
+                </subviews>
+            </view>
+            <constraints>
+                <constraint firstItem="USb-tr-kud" firstAttribute="leading" secondItem="IwU-pd-Orb" secondAttribute="leading" id="4M6-ws-mcC"/>
+                <constraint firstItem="USb-tr-kud" firstAttribute="top" secondItem="IwU-pd-Orb" secondAttribute="top" id="FsR-DF-peO"/>
+                <constraint firstAttribute="bottom" secondItem="USb-tr-kud" secondAttribute="bottom" id="TJL-Gw-lse"/>
+                <constraint firstAttribute="trailing" secondItem="USb-tr-kud" secondAttribute="trailing" id="gAU-4C-dLm"/>
+            </constraints>
+            <size key="customSize" width="526" height="175"/>
+            <connections>
+                <outlet property="coverImageView" destination="USb-tr-kud" id="bjB-e6-VZT"/>
+            </connections>
+            <point key="canvasLocation" x="6" y="107"/>
+        </collectionViewCell>
+    </objects>
+</document>

+ 53 - 53
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

@@ -1554,7 +1554,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     ret[@"more_order_info"] = moreInfo;
     
     
-    return [RAUtils dict2data:ret];
+    return [RAConvertor dict2data:ret];
     */
     DebugLog(@"debug sales order data:%@", [RAConvertor dict2string:data]);
     return data;
@@ -1587,11 +1587,11 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
         [dic setObject:[NSNumber numberWithInteger:RESULT_TRUE] forKey:@"result"];
         [dic setObject:file forKey:@"pdf_path"];
         dic[@"isLocalFile"]=@"true";
-        return [RAUtils dict2data:dic];
+        return [RAConvertor dict2data:dic];
     }
     [dic setObject:[NSNumber numberWithInteger:RESULT_FALSE] forKey:@"result"];
     dic[@"isLocalFile"]=@"true";
-    return [RAUtils dict2data:dic];
+    return [RAConvertor dict2data:dic];
 }
 +(NSData*) offline_request_tearsheet :(NSMutableDictionary *) params
 {
@@ -1621,11 +1621,11 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
         [dic setObject:[NSNumber numberWithInteger:RESULT_TRUE] forKey:@"result"];
         [dic setObject:file forKey:@"pdf_path"];
             dic[@"isLocalFile"]=@"true";
-        return [RAUtils dict2data:dic];
+        return [RAConvertor dict2data:dic];
     }
     [dic setObject:[NSNumber numberWithInteger:RESULT_FALSE] forKey:@"result"];
     dic[@"isLocalFile"]=@"true";
-    return [RAUtils dict2data:dic];
+    return [RAConvertor dict2data:dic];
 }
 +(NSString*) get_offline_soid:(sqlite3*)db
 {
@@ -3805,7 +3805,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     
     [iSalesDB close_db:db];
     
-    return [RAUtils dict2data:ret];
+    return [RAConvertor dict2data:ret];
     
 }
 
@@ -3839,7 +3839,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     
     [iSalesDB close_db:db];
     
-    return [RAUtils dict2data:ret];
+    return [RAConvertor dict2data:ret];
     
     
 }
@@ -3968,7 +3968,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
                 
                 [iSalesDB close_db:db];
                 DebugLog(@"add to cart error");
-                return [RAUtils dict2data:ret];
+                return [RAConvertor dict2data:ret];
             }
         }
         
@@ -3994,7 +3994,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     [iSalesDB execSql:@"END TRANSACTION" db:db];
     [iSalesDB close_db:db];
     
-    return [RAUtils dict2data:ret];
+    return [RAConvertor dict2data:ret];
 }
 
 +(NSDictionary*) model_bundle:(int) item_id db:(sqlite3*)db compute_part:(bool)compute contactID:(NSString *)contactID
@@ -4436,7 +4436,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     
     ret[@"general_note"]= general_note;
     
-    return [RAUtils dict2data:ret];
+    return [RAConvertor dict2data:ret];
 }
 +(NSData*) offline_login :(NSMutableDictionary *) params
 {
@@ -4571,7 +4571,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
    
     DebugLog(@"data string: %@",[RAConvertor dict2string:ret] );
     
-    return [RAUtils dict2data:ret];
+    return [RAConvertor dict2data:ret];
 }
 +(NSDictionary*) offline_contactinfo :(NSMutableDictionary *) params
 {
@@ -4916,7 +4916,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
         //        {
         //            DebugLog(@"Create offline_createimg folder failed");
         //            [ret setValue:[NSNumber numberWithInt:RESULT_ERROR] forKey:@"result"];
-        //            return [RAUtils dict2data:ret];
+        //            return [RAConvertor dict2data:ret];
         //        }
         
         //        if(bsuccess)
@@ -4970,7 +4970,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
         {
             DebugLog(@"Create offline_createimg folder failed");
             [ret setValue:[NSNumber numberWithInt:RESULT_ERROR] forKey:@"result"];
-            return [RAUtils dict2data:ret];
+            return [RAConvertor dict2data:ret];
         }
         
         //        if(bsuccess)
@@ -5016,7 +5016,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     }
     
     
-    return [RAUtils dict2data:ret];
+    return [RAConvertor dict2data:ret];
 }
 
 +(NSDictionary*) model_NIYMAL:(NSString*) category db:(sqlite3 *)db
@@ -5597,7 +5597,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
             NSMutableDictionary *retDic = [[NSJSONSerialization JSONObjectWithData:ret options:NSJSONReadingMutableContainers error:nil] mutableCopy];
             [retDic setValue:[NSNumber numberWithInteger:count] forKey:@"count"];
             
-            ret = [RAUtils dict2data:retDic];
+            ret = [RAConvertor dict2data:retDic];
         }
         
         
@@ -5610,7 +5610,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
         NSMutableDictionary *retDic = [self offline_add2wishlist:newParams.mutableCopy].mutableCopy;
         [retDic setValue:[NSNumber numberWithInteger:count] forKey:@"count"];
         
-        ret = [RAUtils dict2data:retDic];
+        ret = [RAConvertor dict2data:retDic];
         
         
     } else if([add_to isEqualToString:@"portfolio"]) {
@@ -5624,7 +5624,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
         
         [retDic setValue:[NSNumber numberWithInteger:count] forKey:@"count"];
         
-        ret = [RAUtils dict2data:retDic];
+        ret = [RAConvertor dict2data:retDic];
     }
     
     return ret;
@@ -6622,7 +6622,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
 +(NSData *) offline_contactAdvancedSearch:(NSMutableDictionary *) params
 {
     NSMutableDictionary *contactAdvanceDic = [self dictionaryFileName:@"contactAdvanceSearch.json"];
-    return [RAUtils dict2data:contactAdvanceDic];
+    return [RAConvertor dict2data:contactAdvanceDic];
 }
 
 #pragma mark create new contact
@@ -6741,7 +6741,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     
     [ret setValue:section_0 forKey:@"section_0"];
     
-    return [RAUtils dict2data:ret];
+    return [RAConvertor dict2data:ret];
 }
 
 #pragma mark save
@@ -7233,7 +7233,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     
     [ret setValue:section_0 forKey:@"section_0"];
     
-    return [RAUtils dict2data:ret];
+    return [RAConvertor dict2data:ret];
 }
 
 #pragma mark save contact
@@ -8570,7 +8570,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     
     ret[@"count"] = @(5);
     
-    return [RAUtils dict2data:ret];
+    return [RAConvertor dict2data:ret];
     
 }
 
@@ -8955,7 +8955,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     [iSalesDB execSql:@"END TRANSACTION" db:db];
     [iSalesDB close_db:db];
 
-    return [RAUtils dict2data:ret];
+    return [RAConvertor dict2data:ret];
 }
 
 #pragma mark  update gnotes
@@ -8975,7 +8975,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     [dic setValue:@"Regular Mode" forKey:@"mode"];
 //    [dic setValue:@"160409" forKey:@"min_ver"];
     
-    return [RAUtils dict2data:dic];
+    return [RAConvertor dict2data:dic];
 }
 
 #pragma mark move to wishlist
@@ -9043,7 +9043,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     
     [iSalesDB close_db:db1];
     
-    return [RAUtils dict2data:dic];
+    return [RAConvertor dict2data:dic];
 }
 
 #pragma mark cart delete
@@ -9067,7 +9067,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     [dic setValue:@"Regular Mode" forKey:@"mode"];
 //    [dic setValue:@"160409" forKey:@"min_ver"];
     
-    return [RAUtils dict2data:dic];
+    return [RAConvertor dict2data:dic];
 }
 
 #pragma mark set price
@@ -9113,7 +9113,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     [dic setValue:@"Regular Mode" forKey:@"mode"];
 //    [dic setValue:@"160409" forKey:@"min_ver"];
     
-    return [RAUtils dict2data:dic];
+    return [RAConvertor dict2data:dic];
     
 }
 
@@ -9134,7 +9134,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     [dic setValue:@"Regular Mode" forKey:@"mode"];
 //    [dic setValue:@"160409" forKey:@"min_ver"];
     
-    return [RAUtils dict2data:dic];
+    return [RAConvertor dict2data:dic];
 }
 
 #pragma mark set qty
@@ -9164,7 +9164,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
         if (out_of_stock) { // 缺货
             [dic setValue:[NSNumber numberWithInteger:8] forKey:@"result"];
             [dic setObject:@"Item is out of stock" forKey:@"err_msg"];
-            return [RAUtils dict2data:dic];
+            return [RAConvertor dict2data:dic];
         }
 
     }
@@ -9193,7 +9193,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     [dic setValue:bsubtotaljson[@"weight"] forKey:@"weight"];
     [dic setValue:bsubtotaljson[@"carton"] forKey:@"carton"];
     
-    return [RAUtils dict2data:dic];
+    return [RAConvertor dict2data:dic];
 
 }
 
@@ -11103,7 +11103,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
             [resultDic setObject:[NSString stringWithFormat:@"some item(s) are out of stock,please remove them from cart before placing order with %@ or try again after sync",COMPANY_SHORT_NAME] forKey:@"err_msg"];
             [resultDic setObject:[NSNumber numberWithInt:8] forKey:@"result"];
             
-            return [RAUtils dict2data:resultDic];
+            return [RAConvertor dict2data:resultDic];
         }
 
     }
@@ -11220,7 +11220,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     
     [iSalesDB close_db:db];
     
-    return [RAUtils dict2data:ret];
+    return [RAConvertor dict2data:ret];
 //    return nil;
 }
 
@@ -11387,7 +11387,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     
     [ret setValue:new_section_0 forKey:@"section_0"];
     
-    return [RAUtils dict2data:ret];
+    return [RAConvertor dict2data:ret];
 }
 
 #pragma mark save addr
@@ -11433,7 +11433,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     [dic setValue:@"Regular Mode" forKey:@"mode"];
 //    [dic setValue:@"160409" forKey:@"min_ver"];
     
-    return [RAUtils dict2data:dic];
+    return [RAConvertor dict2data:dic];
     
 }
 
@@ -11461,7 +11461,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     [dic setValue:@"Regular Mode" forKey:@"mode"];
 //    [dic setValue:@"160409" forKey:@"min_ver"];
     
-    return [RAUtils dict2data:dic];
+    return [RAConvertor dict2data:dic];
 
 }
 
@@ -11876,7 +11876,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     [dic setValue:@"Regular Mode" forKey:@"mode"];
     //    [dic setValue:@"160409" forKey:@"min_ver"];
     [dic setObject:so_id forKey:@"so#"];
-    return [RAUtils dict2data:dic];
+    return [RAConvertor dict2data:dic];
 
 }
 
@@ -11947,7 +11947,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     
     NSMutableDictionary *dic = [NSMutableDictionary dictionary];
     [dic setValue:[NSNumber numberWithInteger:2] forKey:@"result"];
-    return [RAUtils dict2data:dic];
+    return [RAConvertor dict2data:dic];
 }
 
 #pragma mark submit order
@@ -11978,7 +11978,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
         [ret setObject:[NSNumber numberWithInteger:RESULT_FALSE] forKey:@"result"];
         [iSalesDB execSql:@"END TRANSACTION" db:db];
         [iSalesDB close_db:db];
-        return [RAUtils dict2data:ret];
+        return [RAConvertor dict2data:ret];
     }
     
     // new order
@@ -11997,7 +11997,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
         [ret setObject:[NSNumber numberWithInteger:RESULT_FALSE] forKey:@"result"];
         [iSalesDB execSql:@"END TRANSACTION" db:db];
         [iSalesDB close_db:db];
-        return [RAUtils dict2data:ret];
+        return [RAConvertor dict2data:ret];
     }
 
     
@@ -12030,7 +12030,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     }
     [ret setObject:new_order_code forKey:@"so_id"];
 
-    return [RAUtils dict2data:ret];
+    return [RAConvertor dict2data:ret];
 }
 
 #pragma mark move wish list to cart
@@ -12084,7 +12084,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
             retDic = [NSMutableDictionary dictionary];
             retDic[@"result"] = [NSNumber numberWithInteger:8];
             retDic[@"err_msg"] = [NSString stringWithFormat:@"%d item is out of stock",number_of_outOfStock];
-            return [RAUtils dict2data:retDic];
+            return [RAConvertor dict2data:retDic];
         }
 
     }
@@ -12120,7 +12120,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     }
     
     
-    return [RAUtils dict2data:retDic];
+    return [RAConvertor dict2data:retDic];
     
 }
 
@@ -12242,7 +12242,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     [dic setValue:[dic objectForKey:@"count"] forKey:@"total_count"];
     [dic setValue:@"Regular Mode" forKey:@"mode"];
     
-    return [RAUtils dict2data:dic];
+    return [RAConvertor dict2data:dic];
 }
 
 + (int)model_QTY:(NSString *)product_id db:(sqlite3 *)db {
@@ -12378,7 +12378,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
         
         [resultDictionary setObject:[resultDic objectForKey:@"result"] forKey:@"result"];
         
-        return [RAUtils dict2data:resultDictionary];
+        return [RAConvertor dict2data:resultDictionary];
     }
     
     NSString *model_info = [RAConvertor dict2string:dic];
@@ -12421,7 +12421,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     [fileManager moveItemAtPath:pdf_path toPath:newPath error:&error];
     if (error) { // 移动文件失败
         [resultDictionary setObject:[NSNumber numberWithInt:RESULT_FALSE] forKey:@"result"];
-        return [RAUtils dict2data:resultDictionary];
+        return [RAConvertor dict2data:resultDictionary];
     }
     [resultDictionary setObject:newPath forKey:@"pdf_path"];
     pdf_path = [newPath lastPathComponent];
@@ -12459,7 +12459,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
         [self offline_removePortfolio:@{@"portfolioId" : item_ids}.mutableCopy];
     }
     
-    return [RAUtils dict2data:resultDictionary];
+    return [RAConvertor dict2data:resultDictionary];
 }
 
 + (NSData *)offline_direct_save_TearSheet:(NSMutableDictionary *)params {
@@ -12543,7 +12543,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     
     [dic setValue:@"Regular Mode" forKey:@"mode"];
 
-    return [RAUtils dict2data:dic];
+    return [RAConvertor dict2data:dic];
 }
 
 + (NSData *)offline_add2Portfolio:(NSMutableDictionary *)params {
@@ -12571,7 +12571,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     }
     
     [dic setValue:@"Regular Mode" forKey:@"mode"];
-    return [RAUtils dict2data:dic];
+    return [RAConvertor dict2data:dic];
 }
 
 + (NSData *)offline_createTearSheet:(NSMutableDictionary *)params {
@@ -12620,7 +12620,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     [section1 setObject:price forKey:@"item_2"];
     [dic setObject:section1 forKey:@"section_1"];
     
-    return [RAUtils dict2data:dic];
+    return [RAConvertor dict2data:dic];
 }
 
 + (NSData *)offline_model_qty:(NSMutableDictionary *)params {
@@ -12646,7 +12646,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
                                 }.mutableCopy;
 
     
-    return [RAUtils dict2data:dic];
+    return [RAConvertor dict2data:dic];
     
     
 }
@@ -12731,7 +12731,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     [dic setObject:[NSNumber numberWithInt:result] forKey:@"result"];
     [dic setObject:@"Regular Mode" forKey:@"mode"];
     
-    return [RAUtils dict2data:dic];
+    return [RAConvertor dict2data:dic];
 }
 
 + (NSData *)offline_removePortfolio:(NSMutableDictionary *)params {
@@ -12755,7 +12755,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     
     [iSalesDB close_db:db];
     
-    return [RAUtils dict2data:dic];
+    return [RAConvertor dict2data:dic];
     
 }
 
@@ -12796,7 +12796,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
         [dic setObject:[NSNumber numberWithInt:RESULT_FALSE] forKey:@"result"];
         [dic setObject:@"Regular Mode" forKey:@"mode"];
         [dic setObject:@"Only Delete Your Owns" forKey:@"err_msg"];
-        return [RAUtils dict2data:dic];
+        return [RAConvertor dict2data:dic];
     }
     
     NSString *is_local_sql = [NSString stringWithFormat:@"select is_local,pdf_path from offline_pdf where _id = %d and create_user = '%@';",tearsheetsId,[self translateSingleQuote:user]];
@@ -12824,7 +12824,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     [dic setObject:[NSNumber numberWithInt:result] forKey:@"result"];
     [dic setObject:@"Regular Mode" forKey:@"mode"];
     
-    return [RAUtils dict2data:dic];
+    return [RAConvertor dict2data:dic];
 }
 
 +(NSMutableDictionary*) preparePortfolio:(NSString* ) serial

+ 1 - 1
RedAnt ERP Mobile/common/RAUtils.h

@@ -20,7 +20,7 @@
 
 @interface RAUtils : NSObject
 + (BOOL)isNumeric:(NSString*)string;
-+(NSData*) dict2data:(NSDictionary*) dict;
+//+(NSData*) dict2data:(NSDictionary*) dict;
 +(NSString*) FloatFormat:(float)value;
 +(UIViewController*) getViewController:(UIView*) view;
 + (CGRect)relativeFrameForScreenWithView:(UIView *)v;