RQConstant.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. //
  2. // RQConstant.h
  3. // RQCommon
  4. //
  5. // Created by 张嵘 on 2018/11/13.
  6. // Copyright © 2018 张嵘. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. /// Block
  11. typedef void (^VoidBlock)(void);
  12. typedef BOOL (^BoolBlock)(void);
  13. typedef int (^IntBlock) (void);
  14. typedef NSInteger (^IntegerBlock) (void);
  15. typedef id (^IDBlock) (void);
  16. typedef void (^VoidBlock_int)(int);
  17. typedef BOOL (^BoolBlock_int)(int);
  18. typedef int (^IntBlock_int) (int);
  19. typedef NSInteger (^IntegerBlock_int) (int);
  20. typedef id (^IDBlock_int) (int);
  21. typedef void (^VoidBlock_integer)(NSInteger);
  22. typedef BOOL (^BoolBlock_integer)(NSInteger);
  23. typedef int (^IntBlock_integer) (NSInteger);
  24. typedef NSInteger (^NSIntegerBlock_integer) (NSInteger);
  25. typedef id (^IDBlock_integer) (NSInteger);
  26. typedef void (^VoidBlock_string)(NSString *);
  27. typedef BOOL (^BoolBlock_string)(NSString *);
  28. typedef int (^IntBlock_string) (NSString *);
  29. typedef NSInteger (^IntegerBlock_string) (NSString *);
  30. typedef id (^IDBlock_string) (NSString *);
  31. typedef void (^VoidBlock_id)(id);
  32. typedef BOOL (^BoolBlock_id)(id);
  33. typedef int (^IntBlock_id) (id);
  34. typedef NSInteger (^IntegerBlock_id) (id);
  35. typedef id (^IDBlock_id) (id);
  36. typedef void (^VoidBlock_Bool)(BOOL);
  37. #pragma mark - 应用相关的
  38. /// 切换根控制器的通知 新特性
  39. FOUNDATION_EXTERN NSString * const RQSwitchRootViewControllerNotification;
  40. /// 切换根控制器的通知 UserInfo key
  41. FOUNDATION_EXTERN NSString * const RQSwitchRootViewControllerUserInfoKey;
  42. /// 插件Switch按钮值改变
  43. FOUNDATION_EXTERN NSString * const RQPlugSwitchValueDidChangedNotification;
  44. /// 切换首页的通知
  45. FOUNDATION_EXTERN NSString * const RQSwitchHomePageViewControllerNotification;
  46. /// 切换首页的通知 UserInfo key
  47. FOUNDATION_EXTERN NSString * const RQSwitchHomePageViewControllerUserInfoKey;
  48. /// 切换个人页的通知
  49. FOUNDATION_EXTERN NSString * const RQSwitchProfilePageViewControllerNotification;
  50. /// 切换个人页的通知 UserInfo key
  51. FOUNDATION_EXTERN NSString * const RQSwitchProfilePageViewControllerUserInfoKey;
  52. /// Loding通用标题
  53. FOUNDATION_EXTERN NSString * const RQLodingCommonTitleString;
  54. /// 全局分割线高度 .5
  55. FOUNDATION_EXTERN CGFloat const RQGlobalBottomLineHeight;
  56. /// 个性签名的最大字数为30
  57. FOUNDATION_EXTERN NSUInteger const RQFeatureSignatureMaxWords;
  58. /// 用户昵称的最大字数为20
  59. FOUNDATION_EXTERN NSUInteger const RQNicknameMaxWords;
  60. /// 简书首页地址
  61. FOUNDATION_EXTERN NSString * const RQMyBlogHomepageUrl ;
  62. /// 国家区号
  63. FOUNDATION_EXTERN NSString * const RQMobileLoginZoneCodeKey ;
  64. /// 手机号码
  65. FOUNDATION_EXTERN NSString * const RQMobileLoginPhoneKey ;
  66. /// 密码
  67. FOUNDATION_EXTERN NSString * const RQMobileLoginPasswordKey;
  68. /// 验证码
  69. FOUNDATION_EXTERN NSString * const RQCaptchaKey ;
  70. /// 验证码时间
  71. FOUNDATION_EXTERN NSUInteger const RQCaptchaFetchMaxWords;
  72. /// 温州人脸比对次数
  73. FOUNDATION_EXTERN NSUInteger const RQWenZhouFaceNum;
  74. /// 莆田人脸比对次数
  75. FOUNDATION_EXTERN NSUInteger const RQPuTianFaceNum;
  76. /// 微信支付状态
  77. typedef NS_ENUM(NSInteger, RQWeChatPayStatus) {
  78. /// 默认
  79. RQWeChatPayStatusDefault = 0,
  80. /// 支付成功
  81. RQWeChatPayStatusSuccess = 1,
  82. /// 支付失败
  83. RQWeChatPayStatusFailed = 2,
  84. };
  85. /// 朋友圈
  86. /// 类型
  87. typedef NS_ENUM(NSUInteger, RQMomentContentType) {
  88. RQMomentContentTypeAttitude = 0, /// 点赞
  89. RQMomentContentTypeComment , /// 评论
  90. };
  91. typedef NS_ENUM(NSUInteger, RQDefaultAvatarType) {
  92. RQDefaultAvatarTypeSmall = 0, /// 小图 34x34
  93. RQDefaultAvatarTypeDefualt, /// 默认 50x50
  94. RQDefaultAvatarTypeBig, /// 大图 85x85
  95. };
  96. /// 占位头像
  97. static inline UIImage *RQDefaultAvatar(RQDefaultAvatarType type)
  98. {
  99. switch (type) {
  100. case RQDefaultAvatarTypeSmall:
  101. return [UIImage imageNamed:@"wx_avatar_default_small"];
  102. break;
  103. case RQDefaultAvatarTypeBig:
  104. return [UIImage imageNamed:@"wx_avatar_default_big"];
  105. break;
  106. default:
  107. return [UIImage imageNamed:@"wx_avatar_default"];
  108. break;
  109. }
  110. }
  111. /// 配图的占位图片
  112. static inline UIImage *RQPicturePlaceholder()
  113. {
  114. return [UIImage imageNamed:@"wx_timeline_image_placeholder"];
  115. }
  116. /// 全局细下滑线颜色 以及分割线颜色
  117. #define WXGlobalBottomLineColor [UIColor colorFromHexString:@"#D9D8D9"]
  118. /// 全局黑色字体
  119. #define WXGlobalBlackTextColor [UIColor colorFromHexString:@"#000000"]
  120. /// 全局灰色背景
  121. #define WXGlobalGrayBackgroundColor [UIColor colorFromHexString:@"#EFEFF4"]
  122. /// 全局分割线高度
  123. FOUNDATION_EXTERN CGFloat const WXGlobalBottomLineHeight;
  124. /// 常量定义区
  125. /// 头像宽高 15
  126. FOUNDATION_EXTERN CGFloat const RQMomentProfileViewAvatarViewWH;
  127. /// 消息tips宽高 40
  128. FOUNDATION_EXTERN CGFloat const RQMomentProfileViewTipsViewHeight ;
  129. /// 消息tips宽高 181
  130. FOUNDATION_EXTERN CGFloat const RQMomentProfileViewTipsViewWidth ;
  131. /// 消息tipsView内部的头像宽高 30
  132. FOUNDATION_EXTERN CGFloat const RQMomentProfileViewTipsViewAvatarWH ;
  133. /// 消息tipsView内部的头像距离tipsView边距 5
  134. FOUNDATION_EXTERN CGFloat const RQMomentProfileViewTipsViewInnerInset ;
  135. /// 消息tipsView内部的右箭头距离tipsView边距 11
  136. FOUNDATION_EXTERN CGFloat const RQMomentProfileViewTipsViewRightInset ;
  137. /// 消息tipsView内部的右箭头宽高 15
  138. FOUNDATION_EXTERN CGFloat const RQMomentProfileViewTipsViewRightArrowWH ;
  139. //// 朋友圈说说
  140. /// 说说内容距离顶部的间距 16
  141. FOUNDATION_EXTERN CGFloat const RQMomentContentTopInset;
  142. /// 说说内容距离左右屏幕的间距 20
  143. FOUNDATION_EXTERN CGFloat const RQMomentContentLeftOrRightInset;
  144. /// 内容(控件)之间的的间距 10
  145. FOUNDATION_EXTERN CGFloat const RQMomentContentInnerMargin;
  146. /// 用户头像的大小 44x44
  147. FOUNDATION_EXTERN CGFloat const RQMomentAvatarWH;
  148. /// 向上箭头W
  149. FOUNDATION_EXTERN CGFloat const RQMomentUpArrowViewWidth ;
  150. /// 向上箭头H
  151. FOUNDATION_EXTERN CGFloat const RQMomentUpArrowViewHeight ;
  152. /// 全文、收起W
  153. FOUNDATION_EXTERN CGFloat const RQMomentExpandButtonWidth ;
  154. /// 全文、收起H
  155. FOUNDATION_EXTERN CGFloat const RQMomentExpandButtonHeight ;
  156. /// pictureView中图片之间的的间距 6
  157. FOUNDATION_EXTERN CGFloat const RQMomentPhotosViewItemInnerMargin;
  158. /// pictureView中图片的大小 86x86 (屏幕尺寸>320)
  159. FOUNDATION_EXTERN CGFloat const RQMomentPhotosViewItemWH1;
  160. /// pictureView中图片的大小 70x70 (屏幕尺寸<=320)
  161. FOUNDATION_EXTERN CGFloat const RQMomentPhotosViewItemWH2;
  162. /// 分享内容高度
  163. FOUNDATION_EXTERN CGFloat const RQMomentShareInfoViewHeight;
  164. /// videoView高度
  165. FOUNDATION_EXTERN CGFloat const RQMomentVideoViewHeight ;
  166. /// videoView宽度
  167. FOUNDATION_EXTERN CGFloat const RQMomentVideoViewWidth ;
  168. /// 正文内容的显示最大行数(PS:如果超过最大值,那么正文内容就单行显示,可以点击正文内容查看全部内容)
  169. FOUNDATION_EXTERN NSUInteger const RQMomentContentTextMaxCriticalRow ;
  170. /// 正文内容显示(全文/收起)的临界行
  171. FOUNDATION_EXTERN NSUInteger const RQMomentContentTextExpandCriticalRow ;
  172. /// pictureView最多显示的图片数
  173. FOUNDATION_EXTERN NSUInteger const RQMomentPhotosMaxCount ;
  174. /// pictureView显示图片的最大列数
  175. #define RQMomentMaxCols(__photosCount) ((__photosCount==4)?2:3)
  176. /// 昵称字体大小
  177. #define RQMomentScreenNameFont RQMediumFont(16.0f)
  178. /// 正文字体大小
  179. #define RQMomentContentFont RQRegularFont_15
  180. /// 地址+时间+来源的字体大小
  181. #define RQMomentCreatedAtFont RQRegularFont_12
  182. ///(全文/收起)字体大小
  183. #define RQMomentExpandTextFont RQRegularFont_16
  184. /// 评论正文字体大小
  185. #define RQMomentCommentContentFont RQRegularFont_14
  186. /// 评论的昵称的字体大小
  187. #define RQMomentCommentScreenNameFont RQMediumFont(14.0f)
  188. /// 昵称字体颜色
  189. #define RQMomentScreenNameTextColor [UIColor colorFromHexString:@"#5B6A92"]
  190. /// 正文(链接、电话)的颜色
  191. #define RQMomentContentUrlTextColor [UIColor colorFromHexString:@"#4380D1"]
  192. /// 正文字体颜色
  193. #define RQMomentCOLOR_TEXT WXGlobalBlackTextColor
  194. /// 时间颜色
  195. #define RQMomentCreatedAtTextColor [UIColor colorFromHexString:@"#737373"]
  196. /// 点击文字高亮的颜色
  197. #define RQMomentTextHighlightBackgroundColor [UIColor colorFromHexString:@"#C7C7C7"]
  198. /// 单张图片的最大高度(等比例)180 (ps:别问我为什么,我量出来的)
  199. FOUNDATION_EXTERN CGFloat const RQMomentPhotosViewSingleItemMaxHeight;
  200. /// 更多按钮宽高 (实际:25x25)
  201. FOUNDATION_EXTERN CGFloat const RQMomentOperationMoreBtnWH ;
  202. /// footerViewHeight
  203. FOUNDATION_EXTERN CGFloat const RQMomentFooterViewHeight ;
  204. //// 评论和点赞view 常量
  205. /// 评论内容距离顶部的间距 5
  206. FOUNDATION_EXTERN CGFloat const RQMomentCommentViewContentTopOrBottomInset;
  207. /// 评论内容距离评论View左右屏幕的间距 9
  208. FOUNDATION_EXTERN CGFloat const RQMomentCommentViewContentLeftOrRightInset;
  209. /// 点赞内容距离顶部的间距 7
  210. FOUNDATION_EXTERN CGFloat const RQMomentCommentViewAttitudesTopOrBottomInset;
  211. /// 评论or点赞 view的背景色
  212. #define RQMomentCommentViewBackgroundColor [UIColor colorFromHexString:@"#F3F3F5"]
  213. /// 评论or点赞 view的选中的背景色
  214. #define RQMomentCommentViewSelectedBackgroundColor [UIColor colorFromHexString:@"#CED2DE"]
  215. /// 更多操作View的Size 181x39
  216. /// 更多操作View的Size 181x39
  217. FOUNDATION_EXTERN CGFloat const RQMomentOperationMoreViewWidth ;
  218. FOUNDATION_EXTERN CGFloat const RQMomentOperationMoreViewHeight ;
  219. /// 动画时间 .25f
  220. FOUNDATION_EXTERN NSTimeInterval const RQMommentAnimatedDuration;
  221. /**
  222. YYTextHighlight *highlight = [YYTextHighlight new];
  223. highlight.userInfo = @{kWBLinkHrefName : href};
  224. */
  225. //// 这里是点击文本链接(or其他)跳转,通过该key从userInfo中取出对应的数据
  226. /// 点击链接
  227. FOUNDATION_EXTERN NSString * const RQMomentLinkUrlKey ;
  228. /// 电话号码key
  229. FOUNDATION_EXTERN NSString * const RQMomentPhoneNumberKey ;
  230. /// 点击位置
  231. FOUNDATION_EXTERN NSString * const RQMomentLocationNameKey;
  232. /// 点击用户昵称
  233. FOUNDATION_EXTERN NSString * const RQMomentUserInfoKey;
  234. /// 评论View
  235. /** 弹出评论框View最小高度 */
  236. FOUNDATION_EXTERN CGFloat const RQMomentCommentToolViewMinHeight;
  237. /** 弹出评论框View最大高度 */
  238. FOUNDATION_EXTERN CGFloat const RQMomentCommentToolViewMaxHeight ;
  239. /** 弹出评论框View的除了编辑框的高度 */
  240. FOUNDATION_EXTERN CGFloat const RQMomentCommentToolViewWithNoTextViewHeight;
  241. //// ---------------- inline ----------------
  242. /// 图片的宽度 (九宫格)
  243. static inline CGFloat RQMomentPhotosViewItemWidth(){
  244. CGFloat itemW = ([UIScreen mainScreen].bounds.size.width<=320)? RQMomentPhotosViewItemWH2:RQMomentPhotosViewItemWH1;
  245. return itemW;
  246. }
  247. /// 单张图片的最大宽度(方形or等比例)
  248. static inline CGFloat RQMomentPhotosViewSingleItemMaxWidth(){
  249. CGFloat itemW = RQMomentPhotosViewItemWidth();
  250. return RQMomentPhotosViewItemInnerMargin + itemW*2;
  251. }
  252. /// 计算正文的limitWidth或者评论View的宽度
  253. static inline CGFloat RQMomentCommentViewWidth() {
  254. return ([UIScreen mainScreen].bounds.size.width - RQMomentContentLeftOrRightInset*2 -RQMomentAvatarWH - RQMomentContentInnerMargin);
  255. }
  256. static inline NSArray *RQCarTypeArray() {
  257. return @[@"A1-大型客车",
  258. @"A2-牵引车",
  259. @"A3-城市公交车",
  260. @"B1-中型客车",
  261. @"B2-大型货车",
  262. @"C1-小型汽车",
  263. @"C2-小型自动挡汽车",
  264. @"C3-低速载货汽车",
  265. @"C4-三轮汽车",
  266. @"C5-残疾人专用小型自动挡载客汽车",
  267. @"D-普通三轮摩托车",
  268. @"E-普通二轮摩托车",
  269. @"F-轻便摩托车",
  270. @"M-轮式自行机械车",
  271. @"N-无轨电车",
  272. @"P-有轨电车"];
  273. }
  274. /// 首页轮播图key
  275. FOUNDATION_EXTERN NSString * const RQSignUpCycleImagesKey;
  276. /// 首页轮播图Modelkey
  277. FOUNDATION_EXTERN NSString * const RQSignUpCycleModelsKey;
  278. /// 计时轮播图Modelkey
  279. FOUNDATION_EXTERN NSString * const RQTimingCycleModelsKey;
  280. /// 启动广告图key
  281. FOUNDATION_EXTERN NSString * const RQStudentWelcomeImageModelKey;
  282. /// 隐私政策地址
  283. FOUNDATION_EXTERN NSString * const RQPrivacyPolicyUrl;
  284. /// 公司名称
  285. FOUNDATION_EXTERN NSString * const RQCompanyName;