| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347 |
- //
- // MOGlobal.h
- // MiMoLive
- //
- // Created by SuperC on 2023/10/9.
- //
- #ifndef MOGlobal_h
- #define MOGlobal_h
- /**
- * kAPP_Environment 1为正式环境 2为测试环境
- */
- #define kAPP_Environment 2
- #if kAPP_Environment == 1
- #pragma mark - 正式环境配置
- #define kNetPath_Base @"https://api.mimolive.co"
- #define kNetPath_Web_Base @"https://h5.mimolive.vip"
- #define kNetPath_Share_Url_Base @"https://share.mimolive.vip"
- #define IMAppKey @"1149240218157628#mimolive"
- #define AgoraAppID @"807160febd034c4e9dab52f486b80e3f"
- #define AgoraCertifi @"54aadf82c4644937a4b97842c4ef975d"
- //声网API - ID
- #define AgoraAPIID @"946bed82d830407989ecd8dcddf89610"
- //声网API - Secret
- #define AgoraAPISecret @"8c6a0f9e7cd243779e216d2404ffc052"
- //商品默认ID
- #define MODefaultProductID @"com.jiehe.mimo.36"
- #define KBuglyKeyId @"2dfcd63fa5"
- //Aps 推送证书名字
- #define KApsName @"jiehe_prod"
- //Tent License Str
- #define TentLicense @"https://license.vod-pro.com/license/v2/1328154336_1/v_cube.license"
- //Tent Key Str
- #define TentKeyStr @"7c089614fbfaa5070a814002290d393f"
- //腾讯云天御验证码
- #define kTentCaptchaAppIdStr @"189987190"
- //腾讯IM APPID
- #define KTentIMAppID 80000289
- //在使用腾讯IM的情况下, 没使用KTentSDKAppKey
- #define KTentSDKAppKey @""
- #define kTentPushID 15826
- //云上曲率
- #define kYunSoundAppId @"81700198"
- #define kYunSoundSecretKey @"YWE5M2UyOTAtNmU2MS00N2NjLTk1MmItMGQ3YWYxZmFmZWFm"
- #elif kAPP_Environment == 2
- #pragma mark - 测试环境配置
- //#define kNetPath_Base @"http://8.217.173.156:8080"
- //#define kNetPath_Web_Base @"http://8.217.173.156:8802"
- //#define kNetPath_Base @"http://api.uat.mimolive.cc"
- //#define kNetPath_Web_Base @"http://app-h5.uat.mimolive.cc"
- #define kNetPath_Base @"http://api-new.mimolive.cc"
- #define kNetPath_Web_Base @"http://h5-new.mimolive.cc"
- //#define kNetPath_Web_Base @"http://test.mimolive.cc:8802"
- #define kNetPath_Share_Url_Base @"http://8.217.173.156:8808"
- //Web 测试本地包地址 - 需要时更换上面的 kNetPath_Web_Base
- #define kNetPath_Test_Url @"http://192.168.3.14:1838/#/"
- #define IMAppKey @"1148230921209149#demo"
- #define AgoraAppID @"d8e48cf84bf14a16830dc8ac625c0100"
- #define AgoraCertifi @"537a9f12cc13425eb6103947b9a5754a"
- //声网API - ID
- #define AgoraAPIID @"946bed82d830407989ecd8dcddf89610"
- //声网API - Secret
- #define AgoraAPISecret @"8c6a0f9e7cd243779e216d2404ffc052"
- //商品默认ID
- #define MODefaultProductID @"com.jiehe.mimo.debug.100"
- #define KBuglyKeyId @"b31a80a2a0"
- //Aps 推送证书名字
- #define KApsName @"jiehe123"
- //Tent License Str
- #define TentLicense @"https://license.vod-pro.com/license/v2/1328154336_1/v_cube.license"
- //Tent Key Str
- #define TentKeyStr @"7c089614fbfaa5070a814002290d393f"
- //腾讯云天御验证码
- #define kTentCaptchaAppIdStr @"189987190"
- //腾讯IM APPID
- #define KTentIMAppID 80000266
- //在使用腾讯IM的情况下, 没使用KTentSDKAppKey
- #define KTentSDKAppKey @"kh3k2lw25iMRKDEVYiRO1CX7DA880mYQa1bN8qDOswGlQxPyGc3POYTrPPJIKXC5"
- #define kTentPushID 15824
- //云上曲率
- #define kYunSoundAppId @"81700191"
- #define kYunSoundSecretKey @"YzQyOGU1ZGQtYWI3Mi00ZDAxLWJjNmYtNTE1YmE0ZDRkN2My"
- #endif
- //通用标题字体
- #define kNormalTitleFontStr @"Gilroy"
- //通用内容字体
- #define kNormalContentFontStr @"Roboto"
- //@"Roboto-Bold"粗体
- #define kNormalContentBlodFontStr @"Roboto-Bold"
- //类型1 标题字体
- #define kTypeOneTitleFontStr @"Source Sans Pro"
- //礼物数量 字体
- #define kNormalGiftNumFontStre @"ExtensionBoldItalic"
- //Poppins
- #define kPoppinsRegularFontStr @"Inter-Regular"
- #define kPoppinsMediumFontStr @"Inter-Regular_Medium"
- #define kPoppinsSemiBoldFontStr @"Inter-Regular_SemiBold"
- #define kPoppinsBoldFontStr @"Inter-Regular_Bold"
- #define kPoppinsExtraBoldFontStr @"Inter-Regular_ExtraBold"
- #define kPoppinsMediumItalicFontStr @"Inter-Regular_Medium-Italic"
- #define kPoppinsBoldItalicFontStr @"Inter-Regular_Bold-Italic"
- #define kPoppinsLightFontStr @"Inter-Regular_Light"
- //Oswald (Oswald-DemiBold)
- #define kOswaldFontStr @"Oswald"
- //当前token
- #define kToken @"mimotoken"
- #define kAvatar @"kUserAvatarUrl"
- #define kUserId @"kUserId"
- #define kUserNo @"kUserNo"
- #define kNickName @"kNickName"
- #define kUserInfo @"kUserInfo"
- #define kGender @"kGender"
- #define kImToken @"kImToken"
- #define kAgoraId @"kAgoraId"
- #define kIsMobile @"kIsMobile"
- #define kIsAnchor @"kIsAnchor"
- #define kIsHaveGuild @"kIsHaveGuild"
- #define kIsCreatFansClub @"kIsCreatFansClub"
- #define kCloseJoinFansClub @"kCloseJoinFansClub"
- #define kLiveDiscount @"kLiveDiscount"
- #define kUserVipType @"kUserVipType"
- #define kUserVipExpirTime @"kUserVipExpirTime"
- #define kUserConsumeDiamond @"kUserConsumeDiamond"
- #define kUserBubble @"kUserBubble"
- #define kUserBubbleCode @"kUserBubbleCode"
- #define kUserHeaddress @"kUserHeaddress"
- #define kUserEnterBar @"kUserEnterBar"
- #define kUserLevel @"kUserLevel"
- #define kUserHeaddressType @"kUserHeaddressType"
- #define kCardFrameCode @"kCardFrameCode"
- #define kEnterFloatingCode @"kEnterFloatingCode"
- #define kRewardBannerCode @"kRewardBannerCode"
- #define kLinkMicFrameCode @"kLinkMicFrameCode"
- #define kLiveBarrageCode @"kLiveBarrageCode"
- #define kMineUserInfo @"kMineUserInfo"
- #define kCountryArrInfo @"kCountryArrInfo"
- #define kFirstLaunchInfo @"kFirstLaunchInfo"
- #define kQualityNum @"kQualityNum"
- #define kRedSysTime @"kRedSysTime"
- #define kIsMultiple @"kIsMultiple"
- #define kAgentInviteCode @"kAgentInviteCode"
- #define kAgentInviteCodeKey @"inviteCode"
- #define kAgentJumpRoomId @"kAgentJumpRoomId"
- #define kAgentJumpRoomIdKey @"roomId"
- #define kTent_ImToken @"kTent_ImToken"
- #define kOnlyUseTimIM @"kOnlyUseTimIM"
- #define kIsMysterious @"kIsMysterious"
- #define kNewUserGiftPack @"kNewUserGiftPack"
- #define kAllowViewerLink @"kAllowViewerLink"
- //基础过渡色左
- #define kBaseColorLeft [MOTools colorWithHexString:@"#FF4DA6" alpha:1.0]
- //基础过渡色右
- #define kBaseColorRight [MOTools colorWithHexString:@"#4363FF" alpha:1.0]
- //按钮基础色
- #define kBaseBtnBgColor [MOTools colorWithHexString:@"#0BDDFC" alpha:1.0]
- //文字颜色
- #define kBaseTextColor_1 [MOTools colorWithHexString:@"#17171A" alpha:1.0]
- #define kBaseTextColor_2 [MOTools colorWithHexString:@"#5C5E66" alpha:1.0]
- #define kBaseTextColor_3 [MOTools colorWithHexString:@"#878A99" alpha:1.0]
- #define kBaseTextColor_4 [MOTools colorWithHexString:@"#DADCE6" alpha:1.0]
- #define kBaseTextColor_5 [MOTools colorWithHexString:@"#F3F4FA" alpha:1.0]
- #define kBaseTextColor_6 [MOTools colorWithHexString:@"#FFFFFF" alpha:1.0]
- //公屏高亮
- #define kBaseTextHightlightColor_1 [MOTools colorWithHexString:@"#19FFB2" alpha:1.0]
- #define GetToken [[NSUserDefaults standardUserDefaults] objectForKey:kToken]
- #define GetImToken [[NSUserDefaults standardUserDefaults] objectForKey:kImToken]
- #define GetAvatar [[NSUserDefaults standardUserDefaults] objectForKey:kAvatar]
- #define GetUserId [[NSUserDefaults standardUserDefaults] objectForKey:kUserId]
- #define GetUserNo [[NSUserDefaults standardUserDefaults] objectForKey:kUserNo]
- #define GetNickName [[NSUserDefaults standardUserDefaults] objectForKey:kNickName]
- #define GetUserInfo [[MODataCache sharedYYCache] objectForKey:kUserInfo]
- #define GetGender [[[NSUserDefaults standardUserDefaults] objectForKey:kGender] integerValue]
- #define GetAgoraId [[[NSUserDefaults standardUserDefaults] objectForKey:kAgoraId] integerValue]
- #define GetIsHaveMobile [[NSUserDefaults standardUserDefaults] boolForKey:kIsMobile];
- #define GetIsAnchor [[NSUserDefaults standardUserDefaults] boolForKey:kIsAnchor];
- #define GetIsHaveGuild [[NSUserDefaults standardUserDefaults] boolForKey:kIsHaveGuild];
- #define GetIsCreatFansClub [[NSUserDefaults standardUserDefaults] boolForKey:kIsCreatFansClub];
- #define GetCloseJoinFansClub [[NSUserDefaults standardUserDefaults] boolForKey:kCloseJoinFansClub];
- #define GetLiveDiscount [[NSUserDefaults standardUserDefaults] boolForKey:kLiveDiscount];
- #define GetAPPVersion [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
- #define GetUserVipType [[[NSUserDefaults standardUserDefaults] objectForKey:kUserVipType] integerValue]
- #define GetUserVipExpirTime [[[NSUserDefaults standardUserDefaults] objectForKey:kUserVipExpirTime] integerValue]
- #define GetUserConsumeDiamond [[[NSUserDefaults standardUserDefaults] objectForKey:kUserConsumeDiamond] integerValue]
- #define GetUserBubble [[NSUserDefaults standardUserDefaults] objectForKey:kUserBubble]
- #define GetUserBubbleCode [[[NSUserDefaults standardUserDefaults] objectForKey:kUserBubbleCode] integerValue]
- #define GetUserHeaddress [[NSUserDefaults standardUserDefaults] objectForKey:kUserHeaddress]
- #define GetUserEnterBar [[[NSUserDefaults standardUserDefaults] objectForKey:kUserEnterBar] integerValue]
- #define GetUserLevel [[[NSUserDefaults standardUserDefaults] objectForKey:kUserLevel] integerValue]
- #define GetRedSysTime [[[NSUserDefaults standardUserDefaults] objectForKey:kRedSysTime] longLongValue]
- #define GetIsMultiple [[NSUserDefaults standardUserDefaults] boolForKey:kIsMultiple];
- #define GetUserHeaddressType [[[NSUserDefaults standardUserDefaults] objectForKey:kUserHeaddressType] integerValue]
- #define GetTentImToken [[NSUserDefaults standardUserDefaults] objectForKey:kTent_ImToken]
- #define GetOnlyUserTimBool [[NSUserDefaults standardUserDefaults] boolForKey:kOnlyUseTimIM]
- #define GetIsMysterious [[NSUserDefaults standardUserDefaults] boolForKey:kIsMysterious];
- #define GetUserCardFrameCode [[[NSUserDefaults standardUserDefaults] objectForKey:kCardFrameCode] integerValue]
- #define GetUserEnterFloatingCode [[[NSUserDefaults standardUserDefaults] objectForKey:kEnterFloatingCode] integerValue]
- #define GetUserRewardBannerCode [[[NSUserDefaults standardUserDefaults] objectForKey:kRewardBannerCode] integerValue]
- #define GetUserLinkMicFrameCode [[[NSUserDefaults standardUserDefaults] objectForKey:kLinkMicFrameCode] integerValue]
- #define GetUserLiveBarrageCode [[[NSUserDefaults standardUserDefaults] objectForKey:kLiveBarrageCode] integerValue]
- #define GetIsTest [[NSUserDefaults standardUserDefaults] boolForKey:@"k_MiMo_Test"];
- #define kUserGiftSelectTypeNum @"kUserGiftSelectTypeNum"
- #define kKeyWindow [UIApplication sharedApplication].keyWindow
- #define KIsiPhoneX ((SCREENHEIGHT >= 812)?YES:NO)
- //大小
- #define SCREENHEIGHT [[UIScreen mainScreen] bounds].size.height
- #define SCREENWIDTH [[UIScreen mainScreen] bounds].size.width
- //相对宽度
- #define kScaleWidth(width) (width / 375.0) * SCREENWIDTH
- #define HOME_KEY_HEIGHT (KIsiPhoneX?34:0)//iphoneX的home键高度
- #define STATUS_BAR_HEIGHT ([UIApplication sharedApplication].statusBarFrame.size.height)
- #define NAV_BAR_HEIGHT (44+STATUS_BAR_HEIGHT)
- // 顶部安全区域
- #define kTopSafeAreaInset ({ \
- CGFloat topInset = 0; \
- if (@available(iOS 11.0, *)) { \
- UIWindow *window = [UIApplication sharedApplication].windows.firstObject; \
- topInset = window.safeAreaInsets.top; \
- } else { \
- topInset = [UIApplication sharedApplication].statusBarFrame.size.height; \
- } \
- topInset; \
- })
- // 底部安全区域
- #define kBottomSafeAreaInset ({ \
- CGFloat bottomInset = 0; \
- if (@available(iOS 11.0, *)) { \
- UIWindow *window = [UIApplication sharedApplication].windows.firstObject; \
- bottomInset = window.safeAreaInsets.bottom; \
- } \
- bottomInset; \
- })
- #define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]
- #define UIColorFromHex(HexValue) [UIColor colorWithRed:((float)((HexValue & 0xFF0000) >> 16))/255.0 green:((float)((HexValue & 0xFF00) >> 8))/255.0 blue:((float)(HexValue & 0xFF))/255.0 alpha:1.0]
- #pragma mark - block相关
- #define WEAKSELF typeof(self) __weak weakSelf = self;
- #define kTimeBlock(block) dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1.5 * NSEC_PER_SEC), dispatch_get_main_queue(), block)
- #define kAfterTimeBlock(block) dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.4 * NSEC_PER_SEC), dispatch_get_main_queue(), block)
- #define kSomeTimeBlock(number,block) dispatch_after(dispatch_time(DISPATCH_TIME_NOW, number * NSEC_PER_SEC), dispatch_get_main_queue(), block)
- #define kMainThreadBlock(block) dispatch_async(dispatch_get_main_queue(), block);
- #define kCode_Success \
- (data != nil && ([data[@"code"]integerValue] == 0 || [data[@"code"]integerValue] == 200))\
- #define kShowNetError(data) \
- NSString *errorString = [MODataManager objectOrNilForKey:@"msg" fromDictionary:data];\
- if(errorString.length > 0){\
- [MBProgressHUD showTipMessageInWindow:errorString];\
- }\
- else{\
- [MBProgressHUD showTipMessageInWindow:NSLocalString(@"mimo_common_data_error")];\
- }\
- #pragma mark - NSNotification
- #define ReceiveNotification(methodAction,string)\
- [[NSNotificationCenter defaultCenter] addObserver:self selector:(methodAction) name:string object:nil];\
- #define SendNotification(string)\
- [[NSNotificationCenter defaultCenter] postNotificationName:string object:nil];\
- #pragma mark - NSNotification + obj
- #define SendObjNotification(string,data)\
- [[NSNotificationCenter defaultCenter] postNotificationName:string object:data];\
- #define NSLocalString(a) (NSLocalizedString(a, nil))
- //返回一个保证大于零的值
- #define GetParamNotZero(param) ((param != 0) ? param : 1)
- #define MOCurrentProductKey @"MOCurrentProductKey"
- #define MOCurrentIAProductID [[NSUserDefaults standardUserDefaults] objectForKey:MOCurrentProductKey]
- #define VipTimeColor_1 [MOTools colorWithHexString:@"#FFEA5A" alpha:1.0]
- #define VipTimeColor_2 [MOTools colorWithHexString:@"#FF3F31" alpha:1.0]
- #define VipTimeColor_3 [MOTools colorWithHexString:@"#FC58FF" alpha:1.0]
- #define VipTimeColor_4 [MOTools colorWithHexString:@"#4ADFFD" alpha:1.0]
- #define VipNameColor_White_4 [MOTools colorWithHexString:@"#282828" alpha:1.0]
- #define VipNameColor_4 [MOTools colorWithHexString:@"#BDCED7" alpha:1.0]
- #define VipNameColorArr_3 @[[MOTools colorWithHexString:@"#FC94FF" alpha:1.0],[MOTools colorWithHexString:@"#6EB6FF" alpha:1.0]]
- #define VipNameColorArr_black_2 @[[MOTools colorWithHexString:@"#FF3AEA" alpha:1.0],[MOTools colorWithHexString:@"#FF3F31" alpha:1.0],[MOTools colorWithHexString:@"#FFFFFF" alpha:0.8]]
- #define VipNameColorArr_black_1 @[[MOTools colorWithHexString:@"#FFB515" alpha:1.0],[MOTools colorWithHexString:@"#F7FF11" alpha:1.0],[MOTools colorWithHexString:@"#FFFFFF" alpha:0.8]]
- #define VipNameColorArr_white_2 @[[MOTools colorWithHexString:@"#FF3AEA" alpha:1.0],[MOTools colorWithHexString:@"#FF3F31" alpha:1.0],[MOTools colorWithHexString:@"#FFFFFF" alpha:0.8]]
- #define VipNameColorArr_white_1 @[[MOTools colorWithHexString:@"#FFB515" alpha:1.0],[MOTools colorWithHexString:@"#F7FF11" alpha:1.0],[MOTools colorWithHexString:@"#FFFFFF" alpha:0.8]]
- #endif /* MOGlobal_h */
|