//
//  ICRAppMacro.h
//  Cruiser
//
//  Created by Xummer on 15/3/25.
//  Copyright (c) 2015年 Xummer. All rights reserved.
//

#ifndef Cruiser_ICRAppMacro_h
#define Cruiser_ICRAppMacro_h

// COLOR
#define ICR_TINTCOLOR                   [UIColor colorWithR:63 g:134 b:244 a:1]//天蓝色
#define ICR_VIEW_BG_COLOR               [UIColor whiteColor]

#define ICR_GRAY_BTN_COLOR              [UIColor lightGrayColor]
#define ICR_ORANGE_BTN_COLOR            [UIColor colorWithR:250 g:155 b:52 a:1]
#define ICR_DISABLE_BTN_COLOR           [UIColor colorWithW:202 a:1]
#define ICR_NAVIBAR_ITEM_COLOR          [UIColor whiteColor]
#define ICR_NAVIBAR_ITEM_DISABLE_COLOR  [UIColor colorWithW:1 a:.5f]
#define ICR_NAVIBAR_TITLE_COLOR         [UIColor whiteColor]
#define ICR_TABBAR_TINT_COLOR           [UIColor colorWithR:36 g:38 b:53 a:1] //黑色
#define ICR_IMAGE_BG_COLOR              [UIColor colorWithW:242 a:1]




// Import Headers
#import "GTOUtilsMacro.h"
#import "GTOVendorMacro.h"
#import "ICRHTTPController.h"
#import "ICRAppViewControllerManager.h"
#import "ICRDataBaseController.h"
#import "NSData+EncodeAdditions.h"
#import "UIScrollView+Content.h"
#import "GTOCommonTools.h"
#import "NSDictionary+Category.h"
#import "UIDevice+Helper.h"
#import "PYPhotoBrowseView.h"
#import "UIViewController+StoryBoard.h"


#define HexColor(colorStr)      [UIColor colorWithHexString:colorStr]
#define RGBA(R,G,B,A)           [UIColor colorWithRed:R/255.0f green:G/255.0f blue:B/255.0f alpha:A]
#define ScreenSize              ([[UIScreen mainScreen] bounds].size)
#define IOS7                    ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)
#define FontSize(num)           [UIFont systemFontOfSize:num]
#define AppWindow               [[UIApplication sharedApplication].delegate window]
#define GXF_NSUSERFEFTAULTS     [NSUserDefaults standardUserDefaults]




//先锋水果
#define GXF_THREETEENTH_SIZE    FontSize(13)
#define GXF_FOURTEENTH_SIZE     FontSize(14)
#define GXF_FIFTEENTEN_SIZE     FontSize(15)
#define GXF_SIXTEENTEH_SIZE     FontSize(16)
#define GXF_SEVENTEENTH_SIZE    FontSize(17)


//高度
#define SEARCH_TABLECELL_HEIGHT 50


//类型
#define GTO_PATROL_TEMPLATE        @"GTOPatrolTemplate"
#define GXF_BASECLASS_USER          @"User"
//选中的颜色
#define BASESELECT_COLOR                                RGBA(255, 127, 0, 1)
#define GXF_CONTENT_COLOR       HexColor(@"444444")
#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self
//更新VI检查任务列表
#define UPDATEPATROLONLINELIST @"UPDATEPATROLONLINELIST"
//VI检查答案
#define kNotiPatrolAnswerChange @"kNotiPatrolAnswerChange"
/**
 筛选按钮背景
 */
#define kChooseImage [UIImage imageNamed:@"chooseBg"]
/**
 总部code
 */
#define HQCODE @"0000"
/**
 成功回调
 */
typedef void (^SuccessBlock) (id returnValue);

/**
 失败回调
 */
typedef void (^ErrorBlock) (id errorValue);

/**
 进度回调
 */
typedef void (^ProgressBlock)(double progress);

/**
 结束刷新类型
 
 - EndRefreshDefault: 默认结束
 - EndRefreshNotData: 无数据结束
 */
typedef NS_ENUM(NSInteger,EndRefreshType) {
    EndRefreshDefault = 0,
    EndRefreshNotData
};

/**
 过滤器类型
 */
typedef NS_ENUM(NSInteger,FILTER_TYPE) {
    FILTER_TIME = 0,                 //时间筛选
    FILTER_AREA,                     //区域筛选
    FILTER_STORE,                    //门店筛选
    FILTER_STORE_TYPE,               //门店类型
    FILTER_SUPERVISOR,               //督导人员
    FILTER_STOREUSERS,               //门店人员
    FILTER_INSPECTTASK,              //自检任务项任务项
    FILTER_INSPECTTASK_STATE,        //自检任务状态
    FILTER_PATROL_INSPECTTASK,       //VI检查任务项任务项
    FILTER_PATROL_RECTIFICATIONSTATE,//整改列表状态
    FILTER_PATROL_RECTIFICATIONTYPE, //整改类型
    FILTER_PATROL_RECTIFICATIONPRIORITY, //整改优先级
    FILTER_PATROL_INSPECTTASK_STATE, //VI检查任务状态
    FILTER_PATROL_REPAIRS_STATE,     //设备报修状态
    FILTER_PATROL_WORKREPORT_STATE,     //工作汇报状态
    FILTER_PATROL_WORKREPORT_LIKE,      //工作汇报关键字类似于
    FILTER_CHECKITEM,                //自检检查项
    FILTER_KEYWORDLIKEINPUT,         //优秀案例关键字类似于
    FILTER_CONTENTLIKEINPUT,         //优秀案例内容类似于
    FILTER_SIGNTYPE,                 //签到类型
    FILTER_SIGNSTATISTICALTIME,      //签到统计时间筛选
    FILTER_SIGNINSTATE,              //签到状态
    FILTER_SORT                      //排序方式
};
/**
 地图类型
 
 - MapType_Google: 谷歌地图
 - MapType_Baidu:  百度地图
 */
typedef NS_ENUM(NSInteger, MapType) {
    MapType_Google = 1,
    MapType_Baidu
};

/**
 附件类型
 
 - ATTACHMENT_IMAGE: 图片
 - ATTACHMENT_VIDEO: 视频
 */
typedef NS_ENUM(NSInteger,ATTACHMENT_TYPE){
    ATTACHMENT_IMAGE,
    ATTACHMENT_VIDEO
};

/**
 VI检查拍照类型

 - PHOTO_TYPE_NO: 不允许拍照
 - PHOTO_TYPE_ONLYPHOTO: 只允许拍照
 - PHOTO_TYPE_ONLYLBUM: 只允许从相册选取
 - PHOTO_TYPE_ALL: 可以拍照，可以从相册获取
 */
typedef NS_ENUM(NSInteger,PHOTO_TYPE) {
    PHOTO_TYPE_NO = 0,
    PHOTO_TYPE_ONLYPHOTO,
    PHOTO_TYPE_ONLYLBUM,
    PHOTO_TYPE_ALL
};
static PHOTO_TYPE photoType(NSString *type) {
    if ([type isEqualToString:@"no"]) {
        return PHOTO_TYPE_NO;
    }
    if ([type isEqualToString:@"onlyphoto"]) {
        return PHOTO_TYPE_ONLYPHOTO;
    }
    if ([type isEqualToString:@"onlyalbum"]) {
        return PHOTO_TYPE_ONLYLBUM;
    }
    if ([type isEqualToString:@"all"]) {
        return PHOTO_TYPE_ALL;
    }
    return PHOTO_TYPE_ONLYPHOTO;
};


/**
 附件位置
 - ATTACHMENT_HTTP:  网络
 - ATTACHMENT_LOCAL: 本地
 */
typedef NS_ENUM(NSInteger,ATTACHMENT_LOCATION){
    ATTACHMENT_HTTP,
    ATTACHMENT_LOCAL
};

////阿里云测试
//#define HTTP_REST_API_BASE_URL        @"http://218.244.151.129:7580/total-server/rest" //
//#define HTTP_LOCAL_BASE_URL    @"http://218.244.151.129:7580"

//正式环境
//#define HTTP_REST_API_BASE_URL        @"http://139.196.39.77:7080/total-server/rest"
//#define HTTP_LOCAL_BASE_URL    @"http://139.196.39.77:7080"

//测试环境
//#define HTTP_REST_API_BASE_URL        @"http://139.196.39.77:8180/total-server/rest"
//#define HTTP_LOCAL_BASE_URL    @"http://139.196.39.77:8180"

//测试VI检查、VI抽查、VI检查结果模块使用
//#define VIHTTP_REST_API_BASE_URL        @"http://139.196.39.77:8280/total-server/rest"
//#define VIHTTP_LOCAL_BASE_URL    @"http://139.196.39.77:8280"

//正式VI检查、VI抽查、VI检查结果模块使用
//#define VIHTTP_REST_API_BASE_URL        @"http://139.196.39.77:7280/total-server/rest"
//#define VIHTTP_LOCAL_BASE_URL    @"http://139.196.39.77:7280"


//开发环境
#define HTTP_LOCAL_BASE_URL      @"http://192.168.1.176:8083"
#define HTTP_REST_API_BASE_URL   @"http://192.168.1.176:8083/total-server/rest"
#define VIHTTP_REST_API_BASE_URL @"http://192.168.1.176:8083/total-server/rest"
#define VIHTTP_LOCAL_BASE_URL    @"http://192.168.1.176:8083"


//外网映射开发环境
//#define HTTP_LOCAL_BASE_URL    @"http://dev.gomoretech.com"
//#define HTTP_REST_API_BASE_URL        @"http://dev.gomoretech.com/total-server/rest/"

#define   HTTP_WEATHER_URL @"http://apis.baidu.com/heweather/weather/free"
//refreshUpdateDate
#define PurchaseNoticeUpdateDate    @"purchaseNoticeUpdateDate"
#define TemplateNameUpdateDate    @"templateNameUpdateDate"
//color  以VI检查结果显示的界面为标准
#define GTO_LINE_COLOR          HexColor(@"e5e5e5")
#define GTO_GRAY_TINT_COLOR        HexColor(@"#6C6C6C")   //17 topView
#define GTO_GRAY_SHALLOW_TINT_COLOR   HexColor(@"#C6C6C6")   // category 较浅的灰色
#define GTO_BLUE_TINT_COLOR        HexColor(@"#226AAD")   //17 topView
#define GTO_BLUE_SHALLOW_TINT_COLOR   HexColor(@"#71D2F4")   // category 较浅的蓝色
#define GTO_BLUE_DEEP_COLOR   HexColor(@"#005CA5") // 深蓝
#define GTO_RED_COLOR   HexColor(@"#E6002E")  //红色
#define GTO_GREEN_COLOR   HexColor(@"#7FD18D")  //红色
#define   GXF_ORIGIN_COLOR HexColor(@"f69100") //橙色
#define GTO_BACKGROUND_GRAY_SHALLOW_COLOR              RGBA(246,246,246,1)

//间距
#define GTO_LEFT_PADDING     (15)
#define GTO_VERTICAL_PADDING     (7)
#define GTO_TOP_VERTICAL_PADDING     (7)

#define ICR_BLUE_BTN_COLOR              ICR_TINTCOLOR

#define XXFBgColor              RGBA(246,246,246,1)

#define NavigationBarHeight 64
#define BottomViewHeight 60


#define SCREEN_SIZE  [UIScreen mainScreen].bounds.size


//问题类型
typedef NS_ENUM(NSUInteger, ICRQestionType) {
    kICRQestionTypeSingleSel = 0,
    kICRQestionTypeMultipleSel,
    kICRQestionTypeReply,
    kICRQestionTypeScore,
    kICRQestionTypeStoreInv,
    kICRQestionTypeSpeciesInv,
    kICRQestionTypeStarNum,
    kICRQestionTypeSingleScore,//单选打分（新增加）
    kICRQestionTypeYesOrNO      //是非题
};

#define GXF_DETAIL_COLOR        HexColor(@"888888")
//refreshUpdateDate
#define GTO_REPAIR_UPDATEDATE             @"repairUpdateDate"
//拓站 任务状态
#define GTO_PIONEERING_STATE_LOCAL  @"local"
#define GTO_PIONEERING_STATE_INITIAL  @"initial"
#define GTO_PIONEERING_STATE_SUBMITTED  @"submitted"
//#define GTO_PIONEERING_STATE_FINISHED  @"finished"

//报修状态
#define GTO_REPAIR_STATE_INITIAL  @"initial"
#define GTO_REPAIR_STATE_SUBMITTED  @"submitted"  //后台已经提交，而且没有一个许可证时，为”待处理“
#define GTO_REPAIR_STATE_PROCESSING  @"processing"//至少有一个许可证
#define GTO_REPAIR_STATE_APPLICATION  @"application"
#define GTO_REPAIR_STATE_FINISHED  @"finished"

//许可证状态
#define GTO_LICENCE_STATE_LOCAL  @"local"
#define GTO_LICENCE_STATE_INITIAL  @"initial"
#define GTO_LICENCE__STATE_SUBMITTED  @"submitted"
#define GTO_LICENCE__STATE_ASKFORAPPROVE @"askforapprove"
#define GTO_LICENCE__STATE_APPROVED  @"approved"
#define GTO_LICENCE__STATE_REJECTED  @"rejected"
#define GTO_LICENCE__STATE_EXPIRED @"expired"
#define GTO_LICENCE__STATE_FINISHED  @"finished"
//许可证风险等级
#define GTO_LICENCE_RISK_HIGHT  @"高"
#define GTO_LICENCE__RISK_MIDDLE  @"中"

//附件的 实体类型
#define GTO_ENTITYTYPE_AFFICHE   @"affiche"   //公告
#define GTO_ENTITYTYPE_EMPLATE   @"template"  //所以模板
#define GTO_ENTITYTYPE_PATROL_QUESTION   @"patrolQuestion"  //VI检查问题
#define GTO_ENTITYTYPE_PATROL_ANSWER   @"patrolAnswer"   //VI检查结果
#define GTO_ENTITYTYPE_LICENCE_QUESTION   @"licenceQuestion"  //许可证问题
#define GTO_ENTITYTYPE_LICENCE_ANSWER   @"licenceAnswer"  //许可证结果
#define GTO_ENTITYTYPE_PIONEER_QUESTION  @"pioneerQuestion" //拓站问题
#define GTO_ENTITYTYPE_PIONEER_ANSWER   @"pioneerAnswer" //拓站结果
#define GTO_ENTITYTYPE_REPAIR   @"repair"  //保修单

//VI检查
// 下载VI检查任务的时间类型
#define GTO_PATROL_DATE_TYPE_BEFORE @"before"
#define GTO_PATROL_DATE_TYPE_AFTER @"after"
//VI检查状态
#define GTO_PATROL_STATE_INITIAL @"0"
#define GTO_PATROL_STATE_SUBMITTED @"1"
#define GTO_PATROL_STATE_PROCESSING @"2"
#define GTO_PATROL_STATE_FINISHED @"3"
#define GTO_PATROL_STATE_CANCLED @"4"













////许可证结果页面审批时 ：是由哪个界面跳转过来的：1.查看报修， 2.查看许可证， 3.许可证审批
//#define GTO_LICENCE__PUSH_REPAIR  @"repair"
//#define GTO_LICENCE__PUSH_LICENCE_SEE @"licenceSee"
//#define GTO_LICENCE__PUSH_LICENCE_CHECK  @"licenceCheck"
#endif
