Commit 8b27616c authored by Sandy's avatar Sandy

增加演示Demo的target

parent 913bf261
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>生鲜采购</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.2.12</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
This diff is collapsed.
......@@ -9,31 +9,31 @@
#import "ICRAppViewControllerManager.h"
#import "ICRUIAppearance.h"
#import "BusinessViewController.h"
#import "IBTUINavigationController.h"
#import "ICRLoginViewController.h"
#import "ICRHomeViewController.h"
#import "BusinessViewController.h"
#import "ReportViewController.h"
#import "ICRLoginViewController.h"
#import "ICRSyncViewController.h"
#import "ICRSystemViewController.h"
#import "ReportDetailViewController.h"
@interface ICRAppViewControllerManager ()
<
UITabBarControllerDelegate
>
#import "ReportViewController.h"
@interface ICRAppViewControllerManager () <UITabBarControllerDelegate>
@end
@implementation ICRAppViewControllerManager
+ (UINavigationController *)getCurrentNavigationController {
+ (UINavigationController *)getCurrentNavigationController
{
return nil;
}
+ (IBTTabBarController *)getTabBarController {
+ (IBTTabBarController *)getTabBarController
{
return [[self getAppViewControllerManager] getTabBarController];
}
+ (ICRAppViewControllerManager *)getAppViewControllerManager {
+ (ICRAppViewControllerManager *)getAppViewControllerManager
{
static ICRAppViewControllerManager *_sharedMgr = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
......@@ -44,7 +44,8 @@
return _sharedMgr;
}
- (id)initWithWindow:(UIWindow *)window {
- (id)initWithWindow:(UIWindow *)window
{
self = [super init];
if (!self) {
return nil;
......@@ -60,15 +61,15 @@
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
if ([userUtil isLogin]) {
[self openMainFrame];
}
else {
} else {
[self openFirstView];
}
return self;
}
- (void)dealloc {
- (void)dealloc
{
m_window = nil;
m_arrViewController = nil;
m_arrTabBarBaseViewController = nil;
......@@ -76,34 +77,38 @@
}
#pragma mark - Public Method
- (CGSize)getRootViewSize {
- (CGSize)getRootViewSize
{
return m_window.rootViewController.view.frame.size;
}
- (IBTTabBarController *)getTabBarController {
- (IBTTabBarController *)getTabBarController
{
return m_tabbarController;
}
- (NSUInteger)getCurTabBarIndex {
- (NSUInteger)getCurTabBarIndex
{
return m_tabbarController.selectedIndex;
}
- (UIViewController *)getTabBarBaseViewController:(CRTapBarItemIndex)index {
- (UIViewController *)getTabBarBaseViewController:(CRTapBarItemIndex)index
{
if (index > kCRSystem || index > [m_arrTabBarBaseViewController count]) {
return nil;
}
return m_arrTabBarBaseViewController[ index ];
return m_arrTabBarBaseViewController[index];
}
- (void)openFirstView {
- (void)openFirstView
{
if ([m_window.rootViewController isKindOfClass:[IBTUINavigationController class]]) {
IBTUINavigationController *navCtrl = (IBTUINavigationController *)m_window.rootViewController;
if ([[navCtrl.viewControllers lastObject] isKindOfClass:[ICRLoginViewController class]]) {
return;
}
else if ([[navCtrl.viewControllers firstObject] isKindOfClass:[ICRLoginViewController class]]) {
} else if ([[navCtrl.viewControllers firstObject] isKindOfClass:[ICRLoginViewController class]]) {
[navCtrl popToRootViewControllerAnimated:YES];
return;
}
......@@ -116,38 +121,41 @@
m_window.rootViewController = naviCtrl;
}
// 主页面
- (void)openMainFrame {
if (m_window.rootViewController &&
m_window.rootViewController == m_tabbarController) {
- (void)openMainFrame
{
if (m_window.rootViewController && m_window.rootViewController == m_tabbarController) {
return;
}
[m_arrTabBarBaseViewController removeAllObjects];
[m_arrViewController removeAllObjects];
[self createHomeViewController];//首页
[self createHomeViewController]; //首页
[self createBusinessViewController];//业务
if ([IBTCommon checkIsPermission:Report_ACTION_Check]) {
[self createReportViewController];
}
[self createSyncViewController];
#ifdef Demonstrate
#else
[self createSyncViewController];
#endif
[self createSystemViewController];
if (!m_tabbarController) {
m_tabbarController = [[IBTTabBarController alloc] init];
m_tabbarController.delegate = self;
}
// 添加 首页 门店 同步 系统
// 添加 首页 门店 同步 系统
[m_tabbarController setViewControllers:m_arrViewController];
// 默认首次进入
// 默认首次进入
[m_tabbarController setSelectedIndex:kCRHome];
// 底部bar
// 底部bar
m_window.rootViewController = m_tabbarController;
}
#pragma mark - Actions
- (void)doLogout {
- (void)doLogout
{
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
[userUtil logout];
[ICRDataBaseController CleanUpDBPath];
......@@ -156,9 +164,10 @@
}
#pragma mark - Creation
- (void)createHomeViewController {
- (void)createHomeViewController
{
NSString *nsTitle = ACETapBarItemNames[ kCRHome ];
NSString *nsTitle = ACETapBarItemNames[kCRHome];
ICRHomeViewController *homeVCtrl = [[ICRHomeViewController alloc] init];
[m_arrTabBarBaseViewController addObject:homeVCtrl];
......@@ -169,23 +178,23 @@
navCtrl.title = nsTitle;
}
-(void)createBusinessViewController
- (void)createBusinessViewController
{
NSString *nsTitle = ACETapBarItemNames[ kCRBusiness ];
BusinessViewController *businessVCtrl=[[BusinessViewController alloc]init];
NSString *nsTitle = ACETapBarItemNames[kCRBusiness];
BusinessViewController *businessVCtrl = [[BusinessViewController alloc] init];
[m_arrTabBarBaseViewController addObject:businessVCtrl];
businessVCtrl.title=[IBTCommon localizableString:nsTitle];
businessVCtrl.title = [IBTCommon localizableString:nsTitle];
IBTUINavigationController *navCtrl = [[IBTUINavigationController alloc] initWithRootViewController:businessVCtrl];
[m_arrViewController addObject:navCtrl];
navCtrl.title = nsTitle;
}
- (void)createReportViewController {
- (void)createReportViewController
{
//如果登陆的是子节点
ICRUserUtil *user = [ICRUserUtil sharedInstance];
if (user.belongOrgIsLeaf) {
Compass *com = [[Compass alloc]init];
Compass *com = [[Compass alloc] init];
com.orgCode = user.org_code;
com.orgName = user.org_name;
com.orgUuid = user.org_uuid;
......@@ -194,14 +203,14 @@
[m_arrTabBarBaseViewController addObject:storeVCtrl];
storeVCtrl.title = com.orgName;
NSString *nsTitle = ACETapBarItemNames[ kCRReport ];
NSString *nsTitle = ACETapBarItemNames[kCRReport];
IBTUINavigationController *navCtrl = [[IBTUINavigationController alloc] initWithRootViewController:storeVCtrl];
[m_arrViewController addObject:navCtrl];
navCtrl.title = nsTitle;
}else{
NSString *nsTitle = ACETapBarItemNames[ kCRReport ];
} else {
NSString *nsTitle = ACETapBarItemNames[kCRReport];
ReportViewController *storeVCtrl = [[ReportViewController alloc] init];
[m_arrTabBarBaseViewController addObject:storeVCtrl];
storeVCtrl.title = [IBTCommon localizableString:nsTitle];
......@@ -213,8 +222,9 @@
}
}
- (void)createSyncViewController {
NSString *nsTitle = ACETapBarItemNames[ kCRSync ];
- (void)createSyncViewController
{
NSString *nsTitle = ACETapBarItemNames[kCRSync];
ICRSyncViewController *syncVCtrl = [[ICRSyncViewController alloc] init];
[m_arrTabBarBaseViewController addObject:syncVCtrl];
......@@ -226,8 +236,9 @@
navCtrl.title = nsTitle;
}
- (void)createSystemViewController {
NSString *nsTitle = ACETapBarItemNames[ kCRSystem ];
- (void)createSystemViewController
{
NSString *nsTitle = ACETapBarItemNames[kCRSystem];
ICRSystemViewController *systemVCtrl = [[ICRSystemViewController alloc] init];
[m_arrTabBarBaseViewController addObject:systemVCtrl];
......
......@@ -226,7 +226,12 @@
self.m_titleLabel.font = [UIFont systemFontOfSize:19.0f];
self.m_titleLabel.textColor = [UIColor whiteColor];
self.m_titleLabel.textAlignment = NSTextAlignmentCenter;
self.m_titleLabel.text = @"移动管理平台";//[IBTCommon localizableString:@"XFFruit"];
#ifdef Demonstrate
self.m_titleLabel.text = @"生鲜采购管理平台";
#else
self.m_titleLabel.text = @"移动管理平台";
#endif
//[IBTCommon localizableString:@"XFFruit"];
[self addSubview:_m_titleLabel];
......
......@@ -29,10 +29,16 @@
//#define HTTP_REST_API_BASE_URL @"http://122.224.171.126:7280/cruiser-server/rest"
//********正式环境*********
#define HTTP_REST_API_BASE_URL @"http://122.224.171.126:7380/cruiser-server/rest"
////********正式环境*********
//#define HTTP_REST_API_BASE_URL @"http://122.224.171.126:7380/cruiser-server/rest"
////
//#define HTTP_REST_REPORT_BASE_URL @"http://122.224.171.126:7380"
//********演示环境*********
#define HTTP_REST_API_BASE_URL @"http://jdcg.demo.hd123.cn:7080/cruiser-server/rest"
//
#define HTTP_REST_REPORT_BASE_URL @"http://122.224.171.126:7380"
#define HTTP_REST_REPORT_BASE_URL @"http://jdcg.demo.hd123.cn:7080"
// HTTP
//#define HTTP_REST_API_BASE_URL @"http://115.28.191.44:8080/IPatrol/rest"
//10月23 122.224.171.126:7280
......
......@@ -19,20 +19,23 @@
@implementation ICRAboutViewController
- (void)viewDidLoad {
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
[self initTableViewInfo];
}
- (void)didReceiveMemoryWarning {
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Private Method
- (void)initTableViewInfo {
- (void)initTableViewInfo
{
self.title = [IBTCommon localizableString:@"About"];
......@@ -41,35 +44,19 @@
IBTTableView *tableV = [_m_tableViewInfo getTableView];
[self.view addSubview:tableV];
IBTUIView *tableHeader = [[IBTUIView alloc] init];
tableHeader.backgroundColor = [UIColor clearColor];
tableHeader.frame = (CGRect){
.origin.x = 0,
.origin.y = 0,
.size.width = tableV.width,
.size.height = 160
};
tableHeader.frame = (CGRect){.origin.x = 0, .origin.y = 0, .size.width = tableV.width, .size.height = 160 };
CGFloat fNameH = 40;
self.m_viewAvatarImage = [[UIImageView alloc] init];
_m_viewAvatarImage.frame = (CGRect){
.origin.x = (tableHeader.width - IBT_APP_ICON_WIDTH) * .5f,
.origin.y = (tableHeader.height - IBT_APP_ICON_WIDTH - fNameH) * IBT_GOLDEN_RATIO,
.size.width = IBT_APP_ICON_WIDTH,
.size.height = IBT_APP_ICON_WIDTH
};
_m_viewAvatarImage.frame = (CGRect){.origin.x = (tableHeader.width - IBT_APP_ICON_WIDTH) * .5f, .origin.y = (tableHeader.height - IBT_APP_ICON_WIDTH - fNameH) * IBT_GOLDEN_RATIO, .size.width = IBT_APP_ICON_WIDTH, .size.height = IBT_APP_ICON_WIDTH };
_m_viewAvatarImage.layer.cornerRadius = IBT_APP_ICON_WIDTH / 10;
_m_viewAvatarImage.layer.masksToBounds = YES;
CGFloat fMargin = 10;
UILabel *appNameLabel = [[UILabel alloc] init];
appNameLabel.frame = (CGRect){
.origin.x = fMargin,
.origin.y = _m_viewAvatarImage.bottom,
.size.width = tableHeader.width - 2 * fMargin,
.size.height = fNameH
};
appNameLabel.frame = (CGRect){.origin.x = fMargin, .origin.y = _m_viewAvatarImage.bottom, .size.width = tableHeader.width - 2 * fMargin, .size.height = fNameH };
appNameLabel.font = [UIFont boldSystemFontOfSize:18];
appNameLabel.textColor = IBT_TINTCOLOR;
......@@ -80,20 +67,24 @@
tableV.tableHeaderView = tableHeader;
// Footer
CGRect frame = self.view.frame;
frame.size.height = 20;
frame.origin.y = self.view.height - CGRectGetHeight(frame) -20;
frame.origin.y = self.view.height - CGRectGetHeight(frame) - 20;
UILabel *label = [[UILabel alloc] initWithFrame:frame];
label.font = [UIFont systemFontOfSize:16];
label.text = @"Copyright@2014";
#ifdef Demonstrate
label.text = @"上海海鼎信息工程股份有限公司";
#else
label.text = @"Copyright © 2014";
#endif
label.backgroundColor = [UIColor clearColor];
label.textAlignment = NSTextAlignmentCenter;
label.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
//tableV.tableFooterView = label;
// tableV.tableFooterView = label;
[self.view addSubview:label];
/*
......@@ -110,11 +101,11 @@
};
*/
NSArray *arrIcons = [[NSBundle mainBundle] infoDictionary][ @"CFBundleIcons" ][ @"CFBundlePrimaryIcon" ][ @"CFBundleIconFiles" ];
NSArray *arrIcons = [[NSBundle mainBundle] infoDictionary][@"CFBundleIcons"][@"CFBundlePrimaryIcon"][@"CFBundleIconFiles"];
UIImage *appIcon = nil;
NSUInteger uiIconCount = [arrIcons count];
for (NSInteger i = uiIconCount - 1; i >= 0; i -- ) {
appIcon = [UIImage imageNamed:arrIcons[ i ]];
for (NSInteger i = uiIconCount - 1; i >= 0; i--) {
appIcon = [UIImage imageNamed:arrIcons[i]];
if (appIcon) {
break;
}
......@@ -126,7 +117,7 @@
// Section 0
IBTTableViewSectionInfo *sec0Info = [IBTTableViewSectionInfo sectionInfoDefaut];
// Version
// Version
#if DEBUG
NSString *nsBuild = IBT_APP_BUILD_STR;
NSString *nsVersion = IBT_APP_VERSION_STR;
......@@ -136,19 +127,25 @@
#endif
IBTTableViewCellInfo *versionCellInfo =
[IBTTableViewCellInfo normalCellForSel:nil target:nil
title:[IBTCommon localizableString:@"Version"]
rightValue:nsV
accessoryType:UITableViewCellAccessoryNone];
[IBTTableViewCellInfo normalCellForSel:nil target:nil title:[IBTCommon localizableString:@"Version"] rightValue:nsV accessoryType:UITableViewCellAccessoryNone];
versionCellInfo.selectionStyle = UITableViewCellSelectionStyleNone;
[sec0Info addCell:versionCellInfo];
IBTTableViewCellInfo *phoneCellInfo =
[IBTTableViewCellInfo normalCellForSel:nil target:nil
#ifdef Demonstrate
IBTTableViewCellInfo *phoneCellInfo = [IBTTableViewCellInfo normalCellForSel:nil
target:nil
title:[IBTCommon localizableString:@"Phone Number"]
rightValue:@"021-54325000"
accessoryType:UITableViewCellAccessoryNone];
#else
IBTTableViewCellInfo *phoneCellInfo = [IBTTableViewCellInfo normalCellForSel:nil
target:nil
title:[IBTCommon localizableString:@"Phone Number"]
rightValue:@"400-400-4000"
accessoryType:UITableViewCellAccessoryNone];
#endif
phoneCellInfo.selectionStyle = UITableViewCellSelectionStyleNone;
[sec0Info addCell:phoneCellInfo];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment