Header.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. //
  2. // Header.h
  3. // Haishenghai-master
  4. //
  5. // Created by GG on 2018/12/29.
  6. // Copyright © 2018年 Haishenghai intelligence network technology. All rights reserved.
  7. //
  8. #ifndef Header_h
  9. #define Header_h
  10. #ifdef DEBUG
  11. //Debug状态下的测试API
  12. //#define BASE_URL @"http://47.110.138.172/hsh_app/"
  13. //#define PICBASE_URL @"http://fubangyun.com:4445/"
  14. //#define BASE_URL @"http://172.16.15.252:1551/"
  15. //#define PICBASE_URL @"http://172.16.15.252:1029/"
  16. #else
  17. //Release状态下的线上API
  18. //#define BASE_URL @"https://www.hsh-iot.com/test/hsh_app"
  19. //#define PICBASE_URL @"http://fubangyun.com:4445/"
  20. //#define BASE_URL @"http://172.16.15.252:1551/"
  21. //#define PICBASE_URL @"http://172.16.15.252:1029/"
  22. #endif
  23. /* define */
  24. #define ALERTSHOW(errorMessage) UIAlertController *_controller =[UIAlertController alertControllerWithTitle:@"温馨提示" message:errorMessage preferredStyle:UIAlertControllerStyleAlert];[_controller addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:nil]];[self presentViewController:_controller animated:YES completion:nil];
  25. //登录用的
  26. //rgb颜色转换
  27. #define SXUIColorFromRGB(rgbValue) [UIColor \
  28. colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
  29. green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
  30. blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
  31. //屏幕尺寸
  32. #define WIDTH [UIScreen mainScreen].bounds.size.width
  33. #define HEIGHT [UIScreen mainScreen].bounds.size.height
  34. //状态栏高度
  35. #define kStatusBarHeight [[UIApplication sharedApplication] statusBarFrame].size.height
  36. #define kNavBarHeight 44.0
  37. #define kTabBarHeight ([[UIApplication sharedApplication] statusBarFrame].size.height>20?83:49)
  38. #define kTopHeight (kStatusBarHeight + kNavBarHeight)
  39. #define IS_iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)/* header file */
  40. #import "MBProgressHUD.h"
  41. #import "NSMutableDictionary+NullSaf.h"
  42. #import <Masonry.h>
  43. #import <AFHTTPSessionManager.h>
  44. #import "AppDelegate.h"
  45. #import "ViewController.h"
  46. #import "UserLogin_VC.h"
  47. #import "UserRegister_VC.h"
  48. #import "ResetPassword_VC.h"
  49. #import "Addplace_VC.h"
  50. #import "AddDevece_VC.h"
  51. #import "popViewController.h"
  52. #import "CollectionViewCell.h"
  53. #import "DeveceList_VC.h"
  54. #import "Message_VC.h"
  55. #import "Person_VC.h"
  56. #import "ScanViewController.h"
  57. #import "DeveceDetail_VC.h"
  58. #import "PlaceList_VC.h"
  59. #import "ManageDeveceList_VC.h"
  60. #import "DetailTableViewCell.h"
  61. #import "FireAlarm_VC.h"
  62. #import "PushManage_VC.h"
  63. #import "ProblemViewController.h"
  64. #import "Service_VC.h"
  65. #import "DetailDeveceList_VC.h"
  66. #import "Contacts_VC.h"
  67. #import "Recorddetail_VC.h"
  68. #import "FireManage_VC.h"
  69. #import "SubmitInformation_VC.h"
  70. #import "CommitMessage_VC.h"
  71. #import "PlaceDetail_VC.h"
  72. #import "popMenuView.h"
  73. #import <MJRefresh.h>
  74. #import "DataSourceManager.h"
  75. #import <AMapFoundationKit/AMapFoundationKit.h>
  76. #import <MAMapKit/MAMapKit.h>
  77. #import <AMapSearchKit/AMapSearchKit.h>
  78. #import <AMapLocationKit/AMapLocationKit.h>
  79. #import <FLAnimatedImageView+WebCache.h>
  80. #import "About_VC.h"
  81. #import "Setting_VC.h"
  82. #import "detatilDeviceModel.h"
  83. #import "Protcol_VC.h"
  84. #import "privacy_VC.h"
  85. #import <Availability.h>
  86. #import "NSString+Category.h"
  87. #import "NSString+Path.h"
  88. #import "LanguageManager.h"
  89. #import "LoginShowControl.h"
  90. #import "CommonControl.h"
  91. #import "NSUserDefaultData.h"
  92. #import "MessageUI.h"
  93. #import "DeviceControl.h"
  94. // 开放平台App信息,需要在开放平台上面创建APP来生成,每一个APP对应一组不同并且唯一的平台信息,不能重复
  95. #define UUID "646bd6f4c60c4f2d940f103a585eddf7" //客户唯一标识
  96. #define APPKEY "44fed9d2cd9f4c82892e32dacdfd1940" //APP唯一标识
  97. #define APPSECRET "b1663cac01a94248b3e4e1cf7a7b4b86" //内容保护参数
  98. #define MOVECARD 3 //内容保护参数
  99. //#define UUID "79279113d6fc4bfcbd7a4a81705b1e53"
  100. //#define APPKEY "56f0aaa189054b4aa74ff64f35f5b957"
  101. //#define APPSECRET "03a83c7b448f4aedb978948bd3faa826"
  102. //#define MOVECARD 2 //4
  103. #define SZSTR(x) [x UTF8String]
  104. #define NSSTR(x) [NSString ToNSStr:x]
  105. #define STRNCPY(x,y) strncpy(x, y, sizeof(x))
  106. #ifdef __OBJC__
  107. #import <UIKit/UIKit.h>
  108. #import <Foundation/Foundation.h>
  109. #endif
  110. // 获取 系统的版本 号
  111. #define iOS_Version [UIDevice currentDevice].systemVersion.floatValue
  112. #define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
  113. // 导航栏颜色
  114. #define GlobalMainColor [UIColor colorWithRed:239/255.0 green:125/255.0 blue:56/255.0 alpha:1] //主色 亮红
  115. #define btnTextColor [UIColor colorWithRed:80/255.0 green:80/255.0 blue:80/255.0 alpha:1]
  116. #define btnBorderColor [UIColor colorWithRed:220/255.0 green:220/255.0 blue:220/255.0 alpha:1]
  117. #define NormalFontColor [UIColor blackColor] //通用字体色
  118. // 屏幕的宽度 和 高度
  119. #define ScreenWidth [[UIScreen mainScreen] bounds].size.width
  120. #define ScreenHeight ([[UIScreen mainScreen] bounds].size.height+20-APP_STATUSBAR_HEIGHT)
  121. #define APP_STATUSBAR_HEIGHT (CGRectGetHeight([UIApplication sharedApplication].statusBarFrame))
  122. #define NavAndStatusHight self.navigationController.navigationBar.frame.size.height+APP_STATUSBAR_HEIGHT
  123. #define realPlayViewHeight (ScreenHeight > 480 ? ScreenWidth * 0.8 : ScreenWidth * 0.8)
  124. #define DeviceVersion [[CommonControl getInstance] getDeviceString]
  125. #define NavHeight ((DeviceVersion == 10) ? 88 :64)
  126. #define Handle [self MsgHandle]
  127. #define SELF [self MsgHandle]
  128. #define OS_IOS 1
  129. //
  130. #import "SVProgressHUD.h"
  131. //
  132. #import "AppDelegate.h"
  133. //日期格式
  134. #define DateFormatter @"yyyy-MM-dd"
  135. //时间格式
  136. #define TimeFormatter @"yyyy-MM-dd HH:mm:ss"
  137. //时间格式
  138. #define TimeFormatter2 @"HH:mm:ss"
  139. //通知消息key
  140. #define MasterAccount @"MasterAccount"
  141. #define PushNotification @"PushNotification"
  142. #pragma mark - 设备类型定义
  143. NS_ENUM(NSInteger,XM_DEV_TYPE)
  144. {
  145. XM_DEV_DEV = 0,
  146. XM_DEV_SOCKET = 1, // 插座
  147. XM_DEV_BULB = 2, // 情景灯泡
  148. XM_DEV_BULB_SOCKET = 3, // 灯座
  149. XM_DEV_CAR = 4, // 汽车伴侣
  150. XM_DEV_BEYE = 5, // 大眼睛
  151. XM_DEV_SEYE = 6, // 小眼睛(小雨点)
  152. XM_DEV_ROBOT = 7, // 雄迈摇头机
  153. XM_DEV_SPORT_CAMERA = 8, // 运动摄像机
  154. XM_DEV_FEYE = 9, // 鱼眼小雨点(小雨点全景摄像机)
  155. XM_DEV_FISH_BULB = 10, // 鱼眼灯泡(智能全景摄像灯泡)
  156. XM_DEV_BOB = 11, // 小黄人
  157. XM_DEV_MUSIC_BOX = 12, // wifi音乐盒
  158. XM_DEV_SPEAKER = 13, // wifi音响
  159. XM_DEV_INTELLIGENT_CENTER = 14, // 智联中心
  160. XM_DEV_STRIP = 16, // 插排
  161. XM_DEV_DOORLOCK = 17, // 门磁
  162. XM_DEV_CENTER_COPY = 19, // 智能中心
  163. XM_DEV_UFO = 20, //飞碟
  164. XM_DEV_DOORBELL = 21, // 智能门铃
  165. XM_DEV_BULLET = 22, //E型枪机--XMJP_bullet_xxxx
  166. XM_DEV_DRUM = 23, //架子鼓--xmjp_drum_xxxx
  167. XM_DEV_GUNLOCK_510 = 24, // 雄迈枪机510
  168. XM_DEV_FEEDER = 25, //喂食器设备--feeder_xxxx
  169. XM_DEV_CAT = 26, // 猫眼
  170. XM_DEV_NSEYE = 601, //直播小雨点
  171. XM_DEV_INTELLIGENT_LOCK= 286326823, // 门铃锁
  172. XM_DEV_DOORLOCK_V2 = 0x11110031, // 门锁支持对讲 智联大迈
  173. XM_DEV_DOORBELL_A = 285409282, // 门铃
  174. XM_DEV_SMALL_V = 0x11110032, // 小V
  175. CZ_DOORBELL = 286457857, // 创泽门铃
  176. };
  177. #endif /* Header_h */