Compare commits
15 Commits
appstore_2
...
appstore_2
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6e8aec1495 | ||
![]() |
fdc2ba2b5f | ||
![]() |
cd1565b230 | ||
![]() |
1455e352b7 | ||
![]() |
628b4f0c9f | ||
![]() |
a75f291364 | ||
![]() |
470ecd99e7 | ||
![]() |
c670d7be6d | ||
![]() |
10a1e6e09e | ||
![]() |
5c057821a7 | ||
![]() |
6007611a3b | ||
![]() |
3a576925a2 | ||
![]() |
1bd2382d6a | ||
![]() |
509c47cc2a | ||
![]() |
0f47ed8ed7 |
5
Podfile
@@ -11,6 +11,7 @@ target 'YuMi' do
|
||||
pod 'FBSDKLoginKit'
|
||||
pod 'FBSDKCoreKit'
|
||||
pod 'FBSDKShareKit'
|
||||
pod 'LineSDKSwift'
|
||||
# 滑动标签栏
|
||||
pod 'JXCategoryView'
|
||||
pod 'JXPagingView/Pager'
|
||||
@@ -61,10 +62,10 @@ target 'YuMi' do
|
||||
pod 'SVGAPlayer'
|
||||
|
||||
pod 'GoogleSignIn'
|
||||
pod 'mob_linksdk_pro'
|
||||
#pod 'mob_linksdk_pro'
|
||||
pod 'mob_sharesdk'
|
||||
pod 'mob_sharesdk/ShareSDKPlatforms/Apple'
|
||||
pod 'mob_sharesdk/ShareSDKPlatforms/Line'
|
||||
#pod 'mob_sharesdk/ShareSDKPlatforms/Line'
|
||||
pod 'mob_sharesdk/ShareSDKExtension'
|
||||
|
||||
pod 'UMCommon'
|
||||
|
@@ -206,6 +206,7 @@
|
||||
234489082AC3C5DA0070E5D5 /* SudMGP.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 234489072AC3C5DA0070E5D5 /* SudMGP.framework */; };
|
||||
234489092AC3C5FF0070E5D5 /* SudMGP.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 234489072AC3C5DA0070E5D5 /* SudMGP.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
234D821E2AEC57CF0022EFEB /* YYTextAsyncLayer+PITextAsyncLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 234D821D2AEC57CF0022EFEB /* YYTextAsyncLayer+PITextAsyncLayer.m */; };
|
||||
234F44E32B3EA4F900E2B532 /* PILineManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 234F44E22B3EA4F900E2B532 /* PILineManager.swift */; };
|
||||
235A451A2B04A352009753F5 /* PIRoomActivityWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = 235A45192B04A352009753F5 /* PIRoomActivityWebView.m */; };
|
||||
235A451D2B04A452009753F5 /* PIRoomActivityWebCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 235A451C2B04A452009753F5 /* PIRoomActivityWebCell.m */; };
|
||||
235A45232B04BEB6009753F5 /* PIBaseModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 235A45222B04BEB6009753F5 /* PIBaseModel.m */; };
|
||||
@@ -302,6 +303,7 @@
|
||||
23942E912A86424500D0ECC2 /* XPLoginAuthCodeVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 23942E902A86424500D0ECC2 /* XPLoginAuthCodeVC.m */; };
|
||||
2396FCE42B22BE5D0014021D /* pi_area_info.json in Resources */ = {isa = PBXBuildFile; fileRef = 2396FCE32B22BE5D0014021D /* pi_area_info.json */; };
|
||||
239BEEDB2AA1E058005CDA94 /* PIHoemCategoryTitleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 239BEEDA2AA1E058005CDA94 /* PIHoemCategoryTitleView.m */; };
|
||||
23A03F2D2B4408CD0094227A /* pi_room_lucky_gift.svga in Resources */ = {isa = PBXBuildFile; fileRef = 23A03F2C2B4408CD0094227A /* pi_room_lucky_gift.svga */; };
|
||||
23A439742AA1CF7C002E6039 /* XPNewHomeHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23A439732AA1CF7C002E6039 /* XPNewHomeHeadView.m */; };
|
||||
23B2AEC12A64E9C200543D17 /* LoginForgetEditView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23B2AEC02A64E9C200543D17 /* LoginForgetEditView.m */; };
|
||||
23B2AEC42A6516C200543D17 /* LoginForgetPasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 23B2AEC22A6516C200543D17 /* LoginForgetPasswordViewController.m */; };
|
||||
@@ -1874,6 +1876,7 @@
|
||||
234489072AC3C5DA0070E5D5 /* SudMGP.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = SudMGP.framework; sourceTree = "<group>"; };
|
||||
234D821C2AEC57CF0022EFEB /* YYTextAsyncLayer+PITextAsyncLayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "YYTextAsyncLayer+PITextAsyncLayer.h"; path = "YuMi/Appdelegate/YYTextAsyncLayer+PITextAsyncLayer.h"; sourceTree = SOURCE_ROOT; };
|
||||
234D821D2AEC57CF0022EFEB /* YYTextAsyncLayer+PITextAsyncLayer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "YYTextAsyncLayer+PITextAsyncLayer.m"; path = "YuMi/Appdelegate/YYTextAsyncLayer+PITextAsyncLayer.m"; sourceTree = SOURCE_ROOT; };
|
||||
234F44E22B3EA4F900E2B532 /* PILineManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PILineManager.swift; sourceTree = "<group>"; };
|
||||
235A45182B04A352009753F5 /* PIRoomActivityWebView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIRoomActivityWebView.h; sourceTree = "<group>"; };
|
||||
235A45192B04A352009753F5 /* PIRoomActivityWebView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIRoomActivityWebView.m; sourceTree = "<group>"; };
|
||||
235A451B2B04A452009753F5 /* PIRoomActivityWebCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIRoomActivityWebCell.h; sourceTree = "<group>"; };
|
||||
@@ -2067,6 +2070,7 @@
|
||||
2396FCE32B22BE5D0014021D /* pi_area_info.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = pi_area_info.json; sourceTree = "<group>"; };
|
||||
239BEED92AA1E058005CDA94 /* PIHoemCategoryTitleView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIHoemCategoryTitleView.h; sourceTree = "<group>"; };
|
||||
239BEEDA2AA1E058005CDA94 /* PIHoemCategoryTitleView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIHoemCategoryTitleView.m; sourceTree = "<group>"; };
|
||||
23A03F2C2B4408CD0094227A /* pi_room_lucky_gift.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = pi_room_lucky_gift.svga; sourceTree = "<group>"; };
|
||||
23A439722AA1CF7C002E6039 /* XPNewHomeHeadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNewHomeHeadView.h; sourceTree = "<group>"; };
|
||||
23A439732AA1CF7C002E6039 /* XPNewHomeHeadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewHomeHeadView.m; sourceTree = "<group>"; };
|
||||
23B2AEBF2A64E9C200543D17 /* LoginForgetEditView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginForgetEditView.h; sourceTree = "<group>"; };
|
||||
@@ -4790,6 +4794,7 @@
|
||||
189DD5A726DFA09700AB55B1 /* Tools */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
234F44E12B3EA4DC00E2B532 /* YMLine */,
|
||||
23CEFC082AFB8FC100576D89 /* sdkContent */,
|
||||
23FF255C2ABA8EEE0064E904 /* PIIAPTool */,
|
||||
23E9EA9B2A84C42B00B792F2 /* SGYProgressView */,
|
||||
@@ -5367,6 +5372,14 @@
|
||||
path = UILabel;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
234F44E12B3EA4DC00E2B532 /* YMLine */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
234F44E22B3EA4F900E2B532 /* PILineManager.swift */,
|
||||
);
|
||||
path = YMLine;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
236B2E1B2AA0786E003967A8 /* Library */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -9365,6 +9378,7 @@
|
||||
E8A1E45C276220B100B294CA /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
23A03F2C2B4408CD0094227A /* pi_room_lucky_gift.svga */,
|
||||
23FF256F2ABD456C0064E904 /* pi_home_new_play.svga */,
|
||||
23FF25612ABAE6310064E904 /* pi_room_game_fine_love.svga */,
|
||||
232C444A2AB4363200D4B2ED /* pi_room_tarrow_h5_banner.svga */,
|
||||
@@ -10645,6 +10659,7 @@
|
||||
E80EC87128ACD84000D133C5 /* emoji_160@2x.png in Resources */,
|
||||
23E9EB252A84E98300B792F2 /* pi_new_mine_info_online.svga in Resources */,
|
||||
23FF42652AA5AC040055733C /* home_heat.gif in Resources */,
|
||||
23A03F2D2B4408CD0094227A /* pi_room_lucky_gift.svga in Resources */,
|
||||
E80EC86D28ACD84000D133C5 /* emoji_35@2x.png in Resources */,
|
||||
E80EC86528ACD84000D133C5 /* emoji_03@2x.png in Resources */,
|
||||
E80EC85B28ACD84000D133C5 /* emoji_69@2x.png in Resources */,
|
||||
@@ -11861,6 +11876,7 @@
|
||||
238B37D62AC55A2C00BFC9D5 /* XPTreasureFairyTrialsView.m in Sources */,
|
||||
E82109AD26F1C8A000FC3319 /* CountDownHelper.m in Sources */,
|
||||
E878B8582835F0D300E22DCF /* MonentsInteractiveModel.m in Sources */,
|
||||
234F44E32B3EA4F900E2B532 /* PILineManager.swift in Sources */,
|
||||
E87DF4E42A42CAD2009C1185 /* XPHomeSearchNavView.m in Sources */,
|
||||
9BD2ECCE288F829600F5CD9A /* XPMineFootPrintViewController.m in Sources */,
|
||||
9B4E920028E57A620033419E /* XPGiftHeadTypeView.m in Sources */,
|
||||
@@ -12201,10 +12217,11 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 20.20.4;
|
||||
MARKETING_VERSION = 20.20.7;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = 1;
|
||||
};
|
||||
@@ -12236,10 +12253,11 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 20.20.4;
|
||||
MARKETING_VERSION = 20.20.7;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = 1;
|
||||
};
|
||||
|
@@ -26,10 +26,14 @@
|
||||
|
||||
#import <Bugly/Bugly.h>
|
||||
|
||||
#import "YuMi-swift.h"
|
||||
|
||||
|
||||
UIKIT_EXTERN NSString * kYouMiNumberCountKey;
|
||||
UIKIT_EXTERN NSString * adImageName;
|
||||
|
||||
|
||||
|
||||
@implementation AppDelegate (ThirdConfig)
|
||||
|
||||
|
||||
@@ -103,9 +107,9 @@ UIKIT_EXTERN NSString * adImageName;
|
||||
[Adjust appDidLaunch:adjustConfig];
|
||||
}
|
||||
- (void)configShareSDK {
|
||||
|
||||
|
||||
|
||||
|
||||
[PILineLoginManager registerLine];
|
||||
|
||||
[ShareSDK registPlatforms:^(SSDKRegister *platformsRegister) {
|
||||
///faceBook
|
||||
// [platformsRegister setupFacebookWithAppkey:@"1266232494209868" appSecret:@"c9b170b383f8be9cdf118823b8632821" displayName:YMLocalizedString(@"AppDelegate_ThirdConfig0")];
|
||||
|
@@ -19,6 +19,7 @@
|
||||
#import <GoogleSignIn/GoogleSignIn.h>
|
||||
#import "XPLoginViewController.h"
|
||||
#import "AccountModel.h"
|
||||
#import "YuMi-swift.h"
|
||||
@import Firebase;
|
||||
UIKIT_EXTERN NSString * const kOpenRoomNotification;
|
||||
|
||||
@@ -106,8 +107,10 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
|
||||
|
||||
///URL Scheme跳转
|
||||
-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options{
|
||||
|
||||
|
||||
NSString *bundleID = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"];
|
||||
if ([url.scheme isEqualToString:[NSString stringWithFormat:@"line3rdp.%@",bundleID]]) {
|
||||
return [PILineLoginManager applicationOpenurl:app open:url];
|
||||
}
|
||||
|
||||
NSString *text = [url query];
|
||||
if(text.length){
|
||||
|
BIN
YuMi/Assets.xcassets/AppIcon.appiconset/1024.png
Normal file
After Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 74 KiB |
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "1024*1024.png",
|
||||
"filename" : "1024.png",
|
||||
"idiom" : "universal",
|
||||
"platform" : "ios",
|
||||
"size" : "1024x1024"
|
||||
|
Before Width: | Height: | Size: 639 B After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1013 B After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 647 B After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 810 B After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 557 B After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 945 B After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 4.9 KiB |
21
YuMi/Assets.xcassets/yna/AcrossRoomPK/room_across_pk_assist.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "room_across_pk_assist.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/yna/AcrossRoomPK/room_across_pk_assist.imageset/room_across_pk_assist.png
vendored
Normal file
After Width: | Height: | Size: 3.0 KiB |
21
YuMi/Assets.xcassets/yna/AcrossRoomPK/room_across_pk_onlookers.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "room_across_pk_onlookers.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/yna/AcrossRoomPK/room_across_pk_onlookers.imageset/room_across_pk_onlookers.png
vendored
Normal file
After Width: | Height: | Size: 2.8 KiB |
@@ -76,10 +76,10 @@
|
||||
self.numberLabel.hidden = !imageInfo.isSelect;
|
||||
self.chooseButton.selected = imageInfo.isSelect;
|
||||
if (!imageInfo.originImage) {
|
||||
[[TZImageManager manager] getPhotoWithAsset:imageInfo.assetInfo.asset photoWidth:200 completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
|
||||
[[TZImageManager manager] getPhotoWithAsset:imageInfo.assetInfo.asset completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
|
||||
self.logoImageView.image = photo;
|
||||
self.imageInfo.originImage = photo;
|
||||
UIImage * image = [photo compressWithMaxLength:1024 * 10];
|
||||
UIImage * image = [photo compressWithMaxLength:1024 * 30];
|
||||
self.imageInfo.compressImage = image;
|
||||
} progressHandler:nil networkAccessAllowed:NO];
|
||||
} else {
|
||||
|
@@ -161,6 +161,7 @@
|
||||
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
|
||||
[pasteboard setString:urlString];
|
||||
[XNDJTDDLoadingTool showSuccessWithMessage:YMLocalizedString(@"XPShareView0")];
|
||||
|
||||
[TTPopup dismiss];
|
||||
return;
|
||||
}
|
||||
@@ -177,8 +178,20 @@
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPShareView2")];
|
||||
return;
|
||||
}
|
||||
FBtype = PlatformOfLine;
|
||||
[shareParams SSDKSetupLineParamsByText:encodedUrl image:nil type:SSDKContentTypeAuto];
|
||||
NSString*contentKey= [encodedUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet];
|
||||
NSString*contentType =@"text";
|
||||
NSString*urlString = [NSString stringWithFormat:@"line://msg/%@/%@",contentType, contentKey];
|
||||
|
||||
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:urlString] options:@{} completionHandler:^(BOOL success) {
|
||||
|
||||
}];
|
||||
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:didSuccess:)]) {
|
||||
[self.delegate shareView:self didSuccess:self.shareInfo];
|
||||
}
|
||||
|
||||
// FBtype = PlatformOfLine;
|
||||
// [shareParams SSDKSetupLineParamsByText:encodedUrl image:nil type:SSDKContentTypeAuto];
|
||||
} else {
|
||||
title = YMLocalizedString(@"XPShareView3");
|
||||
platformType = SSDKPlatformTypeFacebook;
|
||||
|
@@ -52,4 +52,5 @@ typedef NS_ENUM(NSUInteger, GradientType) {
|
||||
|
||||
-(UIImage *)compressWithMaxLength:(NSUInteger)maxLength;
|
||||
- (UIImage *)roundedImageWithCornerRadius:(CGFloat)cornerRadius size:(CGSize)size;
|
||||
|
||||
@end
|
||||
|
@@ -65,7 +65,7 @@ NSString * const KeyWithType(Pi_KeyType type) {
|
||||
NSDictionary * dic = @{
|
||||
@(KeyType_PasswordEncode) : @"1ea53d260ecf11e7b56e00163e046a26",
|
||||
@(KeyType_NTESQuickLoginBusinessId) : @"09c1214706c34f4798d3f05d86148608",
|
||||
@(KeyType_Agora) : @"7ae1a8dabe7a44a9a67c829faa409e70",
|
||||
@(KeyType_Agora) : @"f8713b6ec98c4c01adaf34cb4fa091b1",
|
||||
@(KeyType_TRTC) : @"1400741885",
|
||||
@(KeyType_NetEase) : @"1c3b8c6bf8467d8e4c33a004dbec5c94",
|
||||
@(keyType_YiDunBussinessId) : @"yinyouApnsDebug",
|
||||
|
@@ -49,7 +49,7 @@ isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaIns
|
||||
|
||||
|
||||
///内置版本号
|
||||
#define PI_App_Version @"2.4.0"
|
||||
#define PI_App_Version @"2.5.0"
|
||||
///渠道
|
||||
#define PI_App_Source @"appstore"
|
||||
//#define PI_App_Source @"pi_tf"
|
||||
|
@@ -54,7 +54,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>9</string>
|
||||
<string>2</string>
|
||||
<key>FacebookAppID</key>
|
||||
<string>1266232494209868</string>
|
||||
<key>FacebookClientToken</key>
|
||||
|
@@ -25,6 +25,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
-(void)thirdLoginByGoogleWithPresentingViewController:(UIViewController *)presentingViewController configuration:(GIDConfiguration *)configuration;
|
||||
///第三方登录,fb登录
|
||||
-(void)thirdLoginByFBWithPresentingViewController:(UIViewController *)presentingViewController;
|
||||
///第三方登录,line登录
|
||||
-(void)thirdLoginByLine:(UIViewController *)presentingViewController;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -23,7 +23,7 @@
|
||||
|
||||
#import <FBSDKCoreKit/FBSDKCoreKit.h>
|
||||
#import <FBSDKLoginKit/FBSDKLoginKit.h>
|
||||
|
||||
#import "YuMi-swift.h"
|
||||
|
||||
@implementation LoginPresenter
|
||||
- (void)dealloc{
|
||||
@@ -159,6 +159,30 @@
|
||||
} showLoading:YES] openid:openid unionid:unionid access_token:access_token type:[NSString stringWithFormat:@"%lu", (unsigned long)type]];
|
||||
|
||||
|
||||
}
|
||||
-(void)thirdLoginByLine:(UIViewController *)presentingViewController {
|
||||
PILineLoginManager *line = [PILineLoginManager getSharedInstance];
|
||||
[XNDJTDDLoadingTool showOnlyView:kWindow];
|
||||
[line loginLineFromController:presentingViewController completeWithError:^(LineLoginResultStatus loginStatus, NSString * _Nullable token, NSString * _Nullable userId, NSString * _Nullable emali, NSError * _Nullable error) {
|
||||
|
||||
if (loginStatus == LineLoginResultStatusSuccess) {
|
||||
ThirdUserInfo * userInfo = [[ThirdUserInfo alloc] init];
|
||||
NSString * openid = userId.length > 0 ? userId : @"";
|
||||
NSString * access_token = token.length > 0 ? token : @"";
|
||||
NSString * unionid = userId.length > 0 ? userId : @"";
|
||||
userInfo.openid = openid;
|
||||
userInfo.access_token = access_token;
|
||||
userInfo.unionid = unionid;
|
||||
[AccountInfoStorage instance].thirdUserInfo = userInfo;
|
||||
[self loginWithThirdPartWithType:ThirdLoginType_Line];
|
||||
} else if (loginStatus == LineLoginResultStatusCancelled) {
|
||||
[XNDJTDDLoadingTool hideOnlyView:kWindow];
|
||||
[[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter0")];
|
||||
} else if (loginStatus == LineLoginResultStatusError) {
|
||||
[XNDJTDDLoadingTool hideOnlyView:kWindow];
|
||||
[[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter1")];
|
||||
}
|
||||
}];
|
||||
}
|
||||
-(void)thirdLoginByFBWithPresentingViewController:(UIViewController *)presentingViewController {
|
||||
[FBSDKProfile enableUpdatesOnAccessTokenChange:YES];
|
||||
|
@@ -47,7 +47,8 @@
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
self.pi_phoneAreaCode = @"852";
|
||||
NSString *code = [NSString getCountryCode];
|
||||
self.pi_phoneAreaCode = [code stringByReplacingOccurrencesOfString:@"+" withString:@""];
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
[self initEvents];
|
||||
|
@@ -44,7 +44,8 @@
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
self.pi_phoneAreaCode = @"852";
|
||||
NSString *code = [NSString getCountryCode];
|
||||
self.pi_phoneAreaCode = [code stringByReplacingOccurrencesOfString:@"+" withString:@""];
|
||||
|
||||
[super viewDidLoad];
|
||||
[self createUI];
|
||||
|
@@ -67,7 +67,8 @@
|
||||
|
||||
- (void)viewDidLoad {
|
||||
self.selectType = 0;
|
||||
self.pi_phoneAreaCode = @"852";
|
||||
NSString *code = [NSString getCountryCode];
|
||||
self.pi_phoneAreaCode = [code stringByReplacingOccurrencesOfString:@"+" withString:@""];
|
||||
[super viewDidLoad];
|
||||
[self createUI];
|
||||
[self racBind];
|
||||
|
@@ -260,6 +260,9 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
|
||||
}else if(type == ThirdLoginType_FB){
|
||||
[self.presenter thirdLoginByFBWithPresentingViewController:self];
|
||||
return;
|
||||
}else if(type == ThirdLoginType_Line){
|
||||
[self.presenter thirdLoginByLine:self];
|
||||
return;
|
||||
}
|
||||
[self.presenter thirdLoginWithType:type];
|
||||
|
||||
|
@@ -54,7 +54,8 @@
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
self.pi_phoneAreaCode = @"852";
|
||||
NSString *code = [NSString getCountryCode];
|
||||
self.pi_phoneAreaCode = [code stringByReplacingOccurrencesOfString:@"+" withString:@""];
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
[self setConfigs];
|
||||
|
@@ -12,7 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@interface Api (Message)
|
||||
|
||||
+ (void)getChatLimit:(HttpRequestHelperCompletion)complection receiverUid:(NSString *)receiverUid ;
|
||||
|
||||
///获取私聊限制接口
|
||||
+(void)getPrivateChatCheck:(HttpRequestHelperCompletion)complection content:(NSString *)content toUid:(NSString *)toUid;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -13,5 +13,8 @@
|
||||
NSString * fang = [NSString stringFromBase64String:@"cHJpdmF0ZUNoYXQvbGltaXQ="];///privateChat/limit
|
||||
[self makeRequest:fang method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, receiverUid,nil];
|
||||
}
|
||||
|
||||
///获取私聊限制接口
|
||||
+(void)getPrivateChatCheck:(HttpRequestHelperCompletion)complection content:(NSString *)content toUid:(NSString *)toUid{
|
||||
[self makeRequest:@"privateChat/check" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, content,toUid,nil];
|
||||
}
|
||||
@end
|
||||
|
@@ -24,6 +24,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
// 获取用户信息
|
||||
- (void)getUserInfoWithUid:(NSString *)uid;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -77,7 +77,7 @@
|
||||
///P
|
||||
#import "MessagePresenter.h"
|
||||
#import "MessageProtocol.h"
|
||||
|
||||
#import "Api+Message.h"
|
||||
|
||||
@interface SessionViewController ()<MessageProtocol, UITableViewDelegate, UITableViewDataSource, NIMChatManagerDelegate, NIMConversationManagerDelegate, NIMMediaManagerDelegate, MessageCellDelegate, TZImagePickerControllerDelegate, SessionNavViewDelegate, SessionRiskViewDelegate,QInputBarViewDelegate, QInputBarViewDataSource,InputBoardDataSource ,InputBoardDelegate , QEmotionBoardViewDelegate, QinputPhotoViewDelegate, SessionUserInfoTableViewCellDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate>
|
||||
|
||||
@@ -746,31 +746,60 @@
|
||||
}
|
||||
|
||||
- (void)didFailRetry:(NIMMessage *)message {
|
||||
if (message.isReceivedMsg) {
|
||||
[[NIMSDK sharedSDK].chatManager fetchMessageAttachment:message error:nil];
|
||||
} else {
|
||||
[[NIMSDK sharedSDK].chatManager resendMessage:message error:nil];
|
||||
}
|
||||
[Api getPrivateChatCheck:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if(code == 200){
|
||||
if (message.isReceivedMsg) {
|
||||
[[NIMSDK sharedSDK].chatManager fetchMessageAttachment:message error:nil];
|
||||
} else {
|
||||
[[NIMSDK sharedSDK].chatManager resendMessage:message error:nil];
|
||||
}
|
||||
return;
|
||||
}
|
||||
[self showErrorToast:msg];
|
||||
} content:@"" toUid:self.session.sessionId];
|
||||
|
||||
}
|
||||
|
||||
- (void)sendTextMessage:(NSString *)text {
|
||||
NIMMessage *message = [NIMMessageMaker msgWithText:text];
|
||||
[[[NIMSDK sharedSDK] chatManager] sendMessage:message toSession:self.session error:nil];
|
||||
[Api getPrivateChatCheck:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if(code == 200){
|
||||
NIMMessage *message = [NIMMessageMaker msgWithText:text];
|
||||
[[[NIMSDK sharedSDK] chatManager] sendMessage:message toSession:self.session error:nil];
|
||||
return;
|
||||
}
|
||||
[self showErrorToast:msg];
|
||||
} content:text toUid:self.session.sessionId];
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)audioRecordCompletion:(NSString *)recordPath {
|
||||
NIMMessage *message = [NIMMessageMaker msgWithAudio:recordPath];
|
||||
[[[NIMSDK sharedSDK] chatManager] sendMessage:message toSession:self.session error:nil];
|
||||
[Api getPrivateChatCheck:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if(code == 200){
|
||||
NIMMessage *message = [NIMMessageMaker msgWithAudio:recordPath];
|
||||
[[[NIMSDK sharedSDK] chatManager] sendMessage:message toSession:self.session error:nil];
|
||||
return;
|
||||
}
|
||||
[self showErrorToast:msg];
|
||||
} content:@"" toUid:self.session.sessionId];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - TZImagePickerControllerDelegate
|
||||
- (void)imagePickerController:(TZImagePickerController *)picker didFinishPickingPhotos:(NSArray<UIImage *> *)photos sourceAssets:(NSArray *)assets isSelectOriginalPhoto:(BOOL)isSelectOriginalPhoto infos:(NSArray<NSDictionary *> *)infos {
|
||||
[photos enumerateObjectsUsingBlock:^(UIImage * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (obj) {
|
||||
// 构造出具体会话
|
||||
NIMMessage * message = [NIMMessageMaker msgWithImage:obj];
|
||||
// 发送消息
|
||||
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:self.session error:nil];
|
||||
[Api getPrivateChatCheck:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if(code == 200){
|
||||
// 构造出具体会话
|
||||
NIMMessage * message = [NIMMessageMaker msgWithImage:obj];
|
||||
// 发送消息
|
||||
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:self.session error:nil];
|
||||
return;
|
||||
}
|
||||
[self showErrorToast:msg];
|
||||
} content:@"" toUid:self.session.sessionId];
|
||||
|
||||
}
|
||||
}];
|
||||
}
|
||||
@@ -1024,11 +1053,18 @@
|
||||
if (image == nil){
|
||||
continue;
|
||||
}
|
||||
|
||||
// 发送消息
|
||||
NIMMessage * message = [NIMMessageMaker msgWithImage:image];
|
||||
// 发送消息
|
||||
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:self.session error:nil];
|
||||
[view resetChoosePhotos];
|
||||
[Api getPrivateChatCheck:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if(code == 200){
|
||||
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:self.session error:nil];
|
||||
[view resetChoosePhotos];
|
||||
return;
|
||||
}
|
||||
[self showErrorToast:msg];
|
||||
} content:@"" toUid:self.session.sessionId];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1051,10 +1087,17 @@
|
||||
if (picker.sourceType == UIImagePickerControllerSourceTypeCamera) {
|
||||
UIImageWriteToSavedPhotosAlbum(selectedPhoto, nil, nil, nil);
|
||||
}
|
||||
// 构造出具体会话
|
||||
NIMMessage * message = [NIMMessageMaker msgWithImage:selectedPhoto];
|
||||
// 发送消息
|
||||
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:self.session error:nil];
|
||||
[Api getPrivateChatCheck:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if(code == 200){
|
||||
// 构造出具体会话
|
||||
NIMMessage * message = [NIMMessageMaker msgWithImage:selectedPhoto];
|
||||
// 发送消息
|
||||
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:self.session error:nil];
|
||||
return;
|
||||
}
|
||||
[self showErrorToast:msg];
|
||||
} content:@"" toUid:self.session.sessionId];
|
||||
|
||||
}
|
||||
[picker dismissViewControllerAnimated:YES completion:^{}];
|
||||
}
|
||||
|
@@ -57,6 +57,8 @@
|
||||
@property (nonatomic,strong) XPClanSectionView *sectionView;
|
||||
///是否请求了数据
|
||||
@property (nonatomic,assign) BOOL isRequest;
|
||||
///公会成员
|
||||
@property(nonatomic,assign) NSInteger memberNum;
|
||||
@end
|
||||
|
||||
@implementation XPMineClanViewController
|
||||
@@ -161,7 +163,7 @@
|
||||
if (cell == nil) {
|
||||
cell = [[XPClanMemberTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPClanMemberTableViewCell class])];
|
||||
}
|
||||
self.sectionView.title = [NSString stringWithFormat:YMLocalizedString(@"XPMineClanViewController1"), self.datasource.count];
|
||||
self.sectionView.title = [NSString stringWithFormat:YMLocalizedString(@"XPMineClanViewController1"), self.memberNum];
|
||||
cell.cellType = ClanMemberTableViewCellType_Normal;
|
||||
ClanMemberInfoModel * memberInfo = [self.datasource safeObjectAtIndex1:indexPath.row-1];
|
||||
cell.isLast = (self.datasource.count -1) == indexPath.row-1;
|
||||
@@ -241,6 +243,7 @@
|
||||
} else {
|
||||
self.hasNoMoreData = YES;
|
||||
}
|
||||
self.memberNum = memberInfo.count;
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
|
@@ -38,8 +38,7 @@ UIKIT_EXTERN NSString * kUpdateSoundInfo;
|
||||
@property (nonatomic,strong) UITableView *tableView;
|
||||
///数据源
|
||||
@property (nonatomic,strong) NSArray *datasouce;
|
||||
/// 日期选择器
|
||||
@property (nonatomic,strong) XPMineUserInfoDateView *dateView;
|
||||
|
||||
///用户信息
|
||||
@property (nonatomic,strong) UserInfoModel *userInfo;
|
||||
///地区列表
|
||||
@@ -145,15 +144,24 @@ UIKIT_EXTERN NSString * kUpdateSoundInfo;
|
||||
[TTPopup alertWithConfig:config confirmHandler:^{
|
||||
NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
|
||||
if ([[UIApplication sharedApplication] canOpenURL:url]) {
|
||||
[[UIApplication sharedApplication] openURL:url];
|
||||
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:^(BOOL success) {
|
||||
|
||||
}];
|
||||
}
|
||||
} cancelHandler:^{
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)showDatePickerView {
|
||||
self.dateView.time = self.userInfo.birth/1000;
|
||||
[TTPopup popupView:self.dateView style:TTPopupStyleActionSheet];
|
||||
XPMineUserInfoDateView *dateView = [[XPMineUserInfoDateView alloc] initWithFrame:CGRectMake(0, KScreenHeight, KScreenWidth,KScreenHeight)];
|
||||
dateView.delegate = self;
|
||||
dateView.time = self.userInfo.birth/1000;
|
||||
[kWindow addSubview:dateView];
|
||||
[UIView animateWithDuration:0.5 animations:^{
|
||||
dateView.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight);
|
||||
}completion:^(BOOL finished) {
|
||||
dateView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
|
||||
}];
|
||||
}
|
||||
#pragma mark - XPMineUserInfoTagVCDelegate
|
||||
- (void)xPMineUserInfoTagVC:(XPMineUserInfoTagVC *)vc didClickComplete:(NSArray *)meLabels{
|
||||
@@ -305,15 +313,13 @@ UIKIT_EXTERN NSString * kUpdateSoundInfo;
|
||||
|
||||
#pragma mark - XPMineUserInfoDateViewDelegate
|
||||
- (void)xPMineUserInfoDateView:(XPMineUserInfoDateView *)view didClickSureButton:(NSString *)dateStr{
|
||||
[TTPopup dismiss];
|
||||
|
||||
if (dateStr.length > 0) {
|
||||
[self.presenter complectionInfoWithAvatar:nil nick:nil birth:dateStr userDesc:nil];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)xPMineUserInfoDateView:(XPMineUserInfoDateView *)view didClickCancleButton:(UIButton *)sender {
|
||||
[TTPopup dismiss];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - XPMineUserInfoNickViewControllerDelegate
|
||||
- (void)xPMineUserInfoNickViewController:(XPMineUserInfoNickViewController *)viewController updateNick:(NSString *)nick {
|
||||
@@ -413,12 +419,6 @@ UIKIT_EXTERN NSString * kUpdateSoundInfo;
|
||||
return _tableView;
|
||||
}
|
||||
|
||||
- (XPMineUserInfoDateView *)dateView {
|
||||
if (!_dateView) {
|
||||
_dateView = [[XPMineUserInfoDateView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, 216+kSafeAreaBottomHeight+54)];
|
||||
_dateView.delegate = self;
|
||||
}
|
||||
return _dateView;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
@@ -10,8 +10,7 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class XPMineUserInfoDateView;
|
||||
@protocol XPMineUserInfoDateViewDelegate <NSObject>
|
||||
///取消
|
||||
- (void)xPMineUserInfoDateView:(XPMineUserInfoDateView *)view didClickCancleButton:(UIButton *)sender;
|
||||
|
||||
///确定
|
||||
- (void)xPMineUserInfoDateView:(XPMineUserInfoDateView *)view didClickSureButton:(NSString *)dateStr;
|
||||
@end
|
||||
|
@@ -11,15 +11,24 @@
|
||||
///Tool
|
||||
#import "DJDKMIMOMColor.h"
|
||||
|
||||
@interface XPMineUserInfoDateView ()
|
||||
@interface XPMineUserInfoDateView ()<UIPickerViewDelegate,UIPickerViewDataSource>
|
||||
@property (nonatomic,strong)NSMutableArray * selDateArray;
|
||||
|
||||
@property (nonatomic,strong)NSDateComponents * components;//时间结构体、可计算时间间隔、获取年月日时分、
|
||||
@property(nonatomic,strong) UIView *bgView;
|
||||
///
|
||||
@property (nonatomic,strong) UIButton *cancleButton;
|
||||
///
|
||||
@property (nonatomic,strong) UIButton *sureButton;
|
||||
///
|
||||
@property (nonatomic, strong) UIDatePicker *datePicker;
|
||||
@property (nonatomic, strong) UIPickerView *pickerView;
|
||||
///样式
|
||||
@property (nonatomic, strong) NSDateFormatter *dateFormatter;
|
||||
///年龄
|
||||
@property(nonatomic,strong) UILabel *ageView;
|
||||
///星座
|
||||
@property(nonatomic,strong) UILabel *starView;
|
||||
@property(nonatomic,strong) NSMutableArray *dataSourceArray;
|
||||
@end
|
||||
|
||||
@implementation XPMineUserInfoDateView
|
||||
@@ -35,60 +44,260 @@
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.backgroundColor = [UIColor whiteColor];
|
||||
[self addSubview:self.cancleButton];
|
||||
[self addSubview:self.sureButton];
|
||||
[self addSubview:self.datePicker];
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
[self addSubview:self.cancleButton];
|
||||
[self addSubview:self.bgView];
|
||||
[self.bgView addSubview:self.ageView];
|
||||
[self.bgView addSubview:self.starView];
|
||||
[self.bgView addSubview:self.sureButton];
|
||||
[self.bgView addSubview:self.pickerView];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.datePicker mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self);
|
||||
make.bottom.mas_equalTo(self);
|
||||
make.top.mas_equalTo(self.cancleButton.mas_bottom);
|
||||
}];
|
||||
|
||||
[self.cancleButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.top.mas_equalTo(self);
|
||||
make.height.mas_equalTo(30);
|
||||
make.width.mas_equalTo(50);
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.bottom.trailing.equalTo(self).inset(kGetScaleWidth(0));
|
||||
make.height.mas_equalTo(kGetScaleWidth(383));
|
||||
}];
|
||||
[self.ageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(16));
|
||||
make.width.mas_equalTo(kGetScaleWidth(98));
|
||||
make.height.mas_equalTo(kGetScaleWidth(36));
|
||||
make.leading.mas_equalTo(kGetScaleWidth(80));
|
||||
}];
|
||||
[self.starView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.trailing.mas_equalTo(-kGetScaleWidth(80));
|
||||
make.top.mas_equalTo(kGetScaleWidth(16));
|
||||
make.width.mas_equalTo(kGetScaleWidth(98));
|
||||
make.height.mas_equalTo(kGetScaleWidth(36));
|
||||
}];
|
||||
[self.sureButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(self);
|
||||
make.width.height.centerY.mas_equalTo(self.cancleButton);
|
||||
make.bottom.mas_equalTo(-kGetScaleWidth(42));
|
||||
make.centerX.equalTo(self.bgView);
|
||||
make.width.mas_equalTo(kGetScaleWidth(303));
|
||||
make.height.mas_equalTo(kGetScaleWidth(48));
|
||||
}];
|
||||
[self.pickerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self);
|
||||
make.bottom.equalTo(self.sureButton.mas_top);
|
||||
make.top.equalTo(self.starView.mas_bottom).mas_offset(kGetScaleWidth(10));
|
||||
|
||||
}];
|
||||
}
|
||||
#pragma mark- UIPickerViewDelegate,UIPickerViewDataSource
|
||||
-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{
|
||||
|
||||
return 3;
|
||||
}
|
||||
|
||||
-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{
|
||||
|
||||
return [_dataSourceArray[component] count];
|
||||
}
|
||||
|
||||
-(CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component{
|
||||
|
||||
return KScreenWidth/3;
|
||||
}
|
||||
-(CGFloat)pickerView:(UIPickerView *)pickerView rowHeightForComponent:(NSInteger)component{
|
||||
return kGetScaleWidth(40);
|
||||
}
|
||||
|
||||
-(UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view{
|
||||
[self changeSpearatorLineColor];
|
||||
UIView *bgView = (UIView *)view;
|
||||
UILabel *lab = [view viewWithTag:100];
|
||||
if (!bgView) {
|
||||
bgView = [UIView new];
|
||||
bgView.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
if(!lab){
|
||||
lab = [UILabel labelInitWithText:@"" font:kFontRegular(20) textColor:UIColorFromRGB(0x1E1E1F)];
|
||||
[bgView addSubview:lab];
|
||||
CGFloat x ;
|
||||
if(component == 0){
|
||||
x = kGetScaleWidth(20) ;
|
||||
}else if(component == 1){
|
||||
x = kGetScaleWidth(10) ;
|
||||
}else{
|
||||
x = 0 ;
|
||||
}
|
||||
[lab mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(bgView);
|
||||
make.leading.mas_equalTo(kGetScaleWidth(x));
|
||||
make.width.mas_equalTo(kGetScaleWidth(98));
|
||||
make.height.mas_equalTo(kGetScaleWidth(40));
|
||||
}];
|
||||
lab.layer.cornerRadius = kGetScaleWidth(8);
|
||||
lab.layer.masksToBounds = YES;
|
||||
lab.textAlignment = NSTextAlignmentCenter;
|
||||
lab.tag = 100;
|
||||
}else{
|
||||
CGFloat x ;
|
||||
if(component == 0){
|
||||
x = kGetScaleWidth(20) ;
|
||||
}else if(component == 1){
|
||||
x = kGetScaleWidth(10) ;
|
||||
}else{
|
||||
x = 0 ;
|
||||
}
|
||||
[lab mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(bgView);
|
||||
make.leading.mas_equalTo(kGetScaleWidth(x));
|
||||
make.width.mas_equalTo(kGetScaleWidth(98));
|
||||
make.height.mas_equalTo(kGetScaleWidth(40));
|
||||
}];
|
||||
}
|
||||
|
||||
NSArray *yearArr = @[YMLocalizedString(@"XPIncomeRecordGoldDetailsPickViewView3") ,YMLocalizedString(@"XPIncomeRecordGoldDetailsPickViewView4"),YMLocalizedString(@"XPIncomeRecordGoldDetailsPickViewView5")];
|
||||
if ([self.selDateArray[component]isEqualToString:self.dataSourceArray[component][row]] ) {
|
||||
lab.backgroundColor = UIColorFromRGB(0xF7F7F7);
|
||||
lab.font = kFontRegular(20);
|
||||
lab.text = [NSString stringWithFormat:@"%@%@",self.selDateArray[component],yearArr[component]];
|
||||
lab.textColor = UIColorFromRGB(0x1E1E1F);
|
||||
}else{
|
||||
lab.backgroundColor = [UIColor clearColor];
|
||||
lab.font = kFontRegular(18);
|
||||
lab.text = [NSString stringWithFormat:@"%@%@",self.dataSourceArray[component][row],yearArr[component]];
|
||||
lab.textColor = UIColorRGBAlpha(0x1E1E1F, 0.6);
|
||||
}
|
||||
return bgView;
|
||||
}
|
||||
#pragma mark - 改变分割线的颜色
|
||||
- (void)changeSpearatorLineColor {
|
||||
for(UIView *speartorView in _pickerView.subviews) {
|
||||
if (speartorView.frame.size.height < 80) {//找出当前的 View
|
||||
speartorView.backgroundColor = [UIColor clearColor];
|
||||
}else{
|
||||
speartorView.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
}
|
||||
}
|
||||
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
|
||||
[self.selDateArray replaceObjectAtIndex:component withObject:self.dataSourceArray[component][row]];
|
||||
[pickerView reloadAllComponents];
|
||||
NSString *time = [NSString stringWithFormat:@"%@-%@-%@",self.selDateArray[0],self.selDateArray[1],self.selDateArray[2]];
|
||||
NSDate *date = [NSDate at_dateFromString:time];
|
||||
NSTimeInterval interval = [date timeIntervalSince1970] * 1000;
|
||||
self.ageView.text = [NSString stringWithFormat:@"%ld%@",[PLTimeUtil ageWithDateFromBirth:interval],YMLocalizedString(@"XPMineUserInfoDateView3")];
|
||||
self.starView.text = [NSString stringWithFormat:@"%@%@",[NSString getCalculateConstellationTextWithMonth:interval],YMLocalizedString(@"XPMineUserInfoDateView4")] ;
|
||||
}
|
||||
//数据源
|
||||
-(NSMutableArray *)dataSourceArray{
|
||||
if(!_dataSourceArray){
|
||||
NSMutableArray * yearArr = [@[]mutableCopy];
|
||||
for (int i = 1900; i < 2050; i++) {
|
||||
[yearArr addObject:@(i).stringValue];
|
||||
}
|
||||
NSArray * monthArr = @[@"01",@"02",@"03",@"04",@"05",@"06",@"07",@"08",@"09",@"10",@"11",@"12"];
|
||||
NSArray * dayArr = [self dayArrayMonth:self.components.month year:self.components.year];
|
||||
|
||||
NSArray * array = @[yearArr,monthArr,dayArr];
|
||||
_dataSourceArray = [array mutableCopy];
|
||||
}
|
||||
|
||||
return _dataSourceArray;
|
||||
}
|
||||
|
||||
//根据月份返回日期
|
||||
-(NSArray *)dayArrayMonth:(NSInteger)month year:(NSInteger)year{
|
||||
NSArray * dayArr = [[NSArray alloc]init];
|
||||
|
||||
switch (month) {
|
||||
case 1: case 3: case 5: case 7: case 8: case 10: case 12:
|
||||
dayArr = @[@"01",@"02",@"03",@"04",@"05",@"06",@"07",@"08",@"09",@"10",@"11",@"12",@"13",@"14",@"15",@"16",@"17",@"18",@"19",@"20",@"21",@"22",@"23",@"24",@"25",@"26",@"27",@"28",@"29",@"30",@"31"];
|
||||
|
||||
break;
|
||||
case 4: case 6: case 9: case 11:
|
||||
dayArr = @[@"01",@"02",@"03",@"04",@"05",@"06",@"07",@"08",@"09",@"10",@"11",@"12",@"13",@"14",@"15",@"16",@"17",@"18",@"19",@"20",@"21",@"22",@"23",@"24",@"25",@"26",@"27",@"28",@"29",@"30"];
|
||||
break;
|
||||
case 2:
|
||||
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {///是润年
|
||||
dayArr = @[@"01",@"02",@"03",@"04",@"05",@"06",@"07",@"08",@"09",@"10",@"11",@"12",@"13",@"14",@"15",@"16",@"17",@"18",@"19",@"20",@"21",@"22",@"23",@"24",@"25",@"26",@"27",@"28",@"29"];
|
||||
}else{
|
||||
dayArr = @[@"01",@"02",@"03",@"04",@"05",@"06",@"07",@"08",@"09",@"10",@"11",@"12",@"13",@"14",@"15",@"16",@"17",@"18",@"19",@"20",@"21",@"22",@"23",@"24",@"25",@"26",@"27",@"28"];
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return dayArr;
|
||||
|
||||
}
|
||||
#pragma mark - Event
|
||||
- (void)onClickCancelButton:(UIButton *)sender {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineUserInfoDateView:didClickCancleButton:)]) {
|
||||
[self.delegate xPMineUserInfoDateView:self didClickCancleButton:sender];
|
||||
}
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
[UIView animateWithDuration:0.5 animations:^{
|
||||
self.frame = CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight);
|
||||
}completion:^(BOOL finished) {
|
||||
[self removeFromSuperview];
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (void)onClickSureButton:(UIButton *)sender {
|
||||
NSDate * date = self.datePicker.date;
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineUserInfoDateView:didClickSureButton:)]) {
|
||||
NSTimeZone *timeZone= [NSTimeZone systemTimeZone];
|
||||
NSInteger seconds= [timeZone secondsFromGMTForDate:date];
|
||||
NSDate *newDate= [date dateByAddingTimeInterval:seconds];
|
||||
NSString *dateStr = [self.dateFormatter stringFromDate:newDate];
|
||||
[self.delegate xPMineUserInfoDateView:self didClickSureButton:dateStr];
|
||||
}
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineUserInfoDateView:didClickSureButton:)]) {
|
||||
NSString *time = [NSString stringWithFormat:@"%@-%@-%@",self.selDateArray[0],self.selDateArray[1],self.selDateArray[2]];
|
||||
[self.delegate xPMineUserInfoDateView:self didClickSureButton:time];
|
||||
}
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
[UIView animateWithDuration:0.5 animations:^{
|
||||
self.frame = CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight);
|
||||
}completion:^(BOOL finished) {
|
||||
[self removeFromSuperview];
|
||||
}];
|
||||
|
||||
}
|
||||
//分解传来需要显示的时间
|
||||
-(NSArray *)receiveTime:(NSString *)timeStr{
|
||||
|
||||
NSArray * timeArray = [timeStr componentsSeparatedByString:@"-"];
|
||||
NSMutableArray * timeArr = [[NSMutableArray alloc]init];
|
||||
for (int i = 0; i<timeArray.count; i++) {
|
||||
NSString * str = [timeArray objectAtIndex:i];
|
||||
if (str.length == 1) {
|
||||
[timeArr addObject:[NSString stringWithFormat:@"0%@",str]];
|
||||
}else if(str.length == 0){
|
||||
[timeArr addObject:@"00"];
|
||||
}else{
|
||||
[timeArr addObject:str];
|
||||
}
|
||||
}
|
||||
|
||||
return timeArr;
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setTime:(NSTimeInterval)time {
|
||||
_time = time;
|
||||
NSDate *date = [NSDate dateWithTimeIntervalSince1970:time];
|
||||
self.datePicker.date = date;
|
||||
NSTimeZone *timeZone= [NSTimeZone systemTimeZone];
|
||||
NSInteger seconds= [timeZone secondsFromGMTForDate:date];
|
||||
NSDate *newDate= [date dateByAddingTimeInterval:seconds];
|
||||
NSString *dateStr = [self.dateFormatter stringFromDate:newDate];
|
||||
NSArray * timeArr = [[NSArray alloc]init];
|
||||
if (dateStr) {
|
||||
timeArr = [self receiveTime:dateStr];
|
||||
}
|
||||
if (timeArr.count == 3) {//需要显示传入的时间
|
||||
self.selDateArray = [timeArr mutableCopy];
|
||||
for (int i = 0; i < 3; i++) {
|
||||
[self.pickerView selectRow: [self.dataSourceArray[i] indexOfObject:self.selDateArray[i]] inComponent:i animated:YES];
|
||||
}
|
||||
|
||||
}
|
||||
self.ageView.text = [NSString stringWithFormat:@"%ld%@",[PLTimeUtil ageWithDateFromBirth:time*1000],YMLocalizedString(@"XPMineUserInfoDateView3")];
|
||||
self.starView.text = [NSString stringWithFormat:@"%@%@",[NSString getCalculateConstellationTextWithMonth:time*1000],YMLocalizedString(@"XPMineUserInfoDateView4")] ;
|
||||
}
|
||||
- (UIButton *)cancleButton {
|
||||
if (!_cancleButton) {
|
||||
_cancleButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_cancleButton setTitle:YMLocalizedString(@"XPMineUserInfoDateView0") forState:UIControlStateNormal];
|
||||
[_cancleButton addTarget:self action:@selector(onClickCancelButton:) forControlEvents:UIControlEventTouchUpInside];
|
||||
_cancleButton.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
[_cancleButton setTitleColor:[DJDKMIMOMColor secondTextColor] forState:UIControlStateNormal];
|
||||
|
||||
}
|
||||
return _cancleButton;
|
||||
}
|
||||
@@ -96,10 +305,14 @@
|
||||
- (UIButton *)sureButton {
|
||||
if (!_sureButton) {
|
||||
_sureButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_sureButton setTitle:YMLocalizedString(@"XPMineUserInfoDateView1") forState:UIControlStateNormal];
|
||||
[_sureButton setTitle:YMLocalizedString(@"XPMineUserInfoDateView2") forState:UIControlStateNormal];
|
||||
[_sureButton addTarget:self action:@selector(onClickSureButton:) forControlEvents:UIControlEventTouchUpInside];
|
||||
_sureButton.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
[_sureButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
|
||||
_sureButton.titleLabel.font = kFontMedium(16);
|
||||
[_sureButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
UIImage *image = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor],[DJDKMIMOMColor confirmButtonGradientMiddleColor],[DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(303), kGetScaleWidth(48))];
|
||||
[_sureButton setBackgroundImage:image forState:UIControlStateNormal];
|
||||
_sureButton.layer.cornerRadius = kGetScaleWidth(48)/2;
|
||||
_sureButton.layer.masksToBounds = YES;
|
||||
}
|
||||
return _sureButton;
|
||||
}
|
||||
@@ -112,22 +325,45 @@
|
||||
return _dateFormatter;
|
||||
}
|
||||
|
||||
- (UIDatePicker *)datePicker {
|
||||
if (!_datePicker){
|
||||
_datePicker = [[UIDatePicker alloc] init];
|
||||
_datePicker.datePickerMode = UIDatePickerModeDate;
|
||||
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"];
|
||||
_datePicker.locale = locale;
|
||||
_datePicker.layer.cornerRadius = 5;
|
||||
_datePicker.layer.masksToBounds = YES;
|
||||
if (@available(iOS 13.4, *)) {
|
||||
_datePicker.preferredDatePickerStyle = UIDatePickerStyleWheels;
|
||||
}
|
||||
NSDate *date = [self.dateFormatter dateFromString:@"2000-07-01"];
|
||||
_datePicker.date = date;
|
||||
_datePicker.backgroundColor = [UIColor whiteColor];
|
||||
}
|
||||
return _datePicker;
|
||||
- (UIPickerView *)pickerView{
|
||||
if (!_pickerView){
|
||||
_pickerView = [[UIPickerView alloc]initWithFrame:CGRectZero];
|
||||
_pickerView.delegate = self;
|
||||
_pickerView.dataSource = self;
|
||||
}
|
||||
return _pickerView;
|
||||
}
|
||||
- (UIView *)bgView{
|
||||
if(!_bgView){
|
||||
_bgView = [UIView new];
|
||||
_bgView.backgroundColor = [UIColor whiteColor];
|
||||
[_bgView setCornerWithLeftTopCorner:kGetScaleWidth(20) rightTopCorner:kGetScaleWidth(20) bottomLeftCorner:0 bottomRightCorner:0 size:CGSizeMake(KScreenWidth, kGetScaleWidth(383))];
|
||||
}
|
||||
return _bgView;
|
||||
}
|
||||
- (UILabel *)ageView{
|
||||
if(!_ageView){
|
||||
_ageView = [UILabel labelInitWithText:@"" font:kFontMedium(16) textColor:UIColorFromRGB(0x1E1E1F)];
|
||||
[_ageView setCornerWithLeftTopCorner:kGetScaleWidth(7) rightTopCorner:kGetScaleWidth(7) bottomLeftCorner:kGetScaleWidth(7) bottomRightCorner:kGetScaleWidth(7) size:CGSizeMake(kGetScaleWidth(98), kGetScaleWidth(36))];
|
||||
_ageView.backgroundColor = UIColorFromRGB(0xF7F7F7);
|
||||
_ageView.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _ageView;
|
||||
}
|
||||
- (UILabel *)starView{
|
||||
if(!_starView){
|
||||
_starView = [UILabel labelInitWithText:@"" font:kFontMedium(16) textColor:UIColorFromRGB(0x1E1E1F)];
|
||||
[_starView setCornerWithLeftTopCorner:kGetScaleWidth(7) rightTopCorner:kGetScaleWidth(7) bottomLeftCorner:kGetScaleWidth(7) bottomRightCorner:kGetScaleWidth(7) size:CGSizeMake(kGetScaleWidth(98), kGetScaleWidth(36))];
|
||||
_starView.backgroundColor = UIColorFromRGB(0xF7F7F7);
|
||||
_starView.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _starView;
|
||||
}
|
||||
- (NSDateComponents *)components{
|
||||
if(!_components){
|
||||
NSCalendar * calender = [NSCalendar currentCalendar];
|
||||
_components = [calender components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitHour|NSCalendarUnitMinute fromDate:[NSDate date]];
|
||||
}
|
||||
return _components;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -605,14 +605,23 @@
|
||||
}] ;
|
||||
}
|
||||
self.charmImageView.hidden = userInfo.userLevelVo.charmUrl.length <= 0;
|
||||
|
||||
if (userInfo.nameplateWord.length>0 && userInfo.nameplatePic.length>0) {
|
||||
self.nameplateImageView.imageUrl = userInfo.nameplatePic;
|
||||
self.nameplateLabel.text = userInfo.nameplateWord;
|
||||
self.namePlateView.hidden = NO;
|
||||
} else {
|
||||
self.namePlateView.hidden = YES;
|
||||
if(userInfo.isCustomWord == YES){
|
||||
if (userInfo.nameplateWord.length>0) {
|
||||
self.nameplateImageView.imageUrl = userInfo.nameplatePic;
|
||||
self.namePlateView.hidden = NO;
|
||||
} else {
|
||||
self.namePlateView.hidden = YES;
|
||||
}
|
||||
}else{
|
||||
if (userInfo.nameplateWord.length>0 && userInfo.nameplatePic.length>0) {
|
||||
self.nameplateImageView.imageUrl = userInfo.nameplatePic;
|
||||
self.nameplateLabel.text = userInfo.nameplateWord;
|
||||
self.namePlateView.hidden = NO;
|
||||
} else {
|
||||
self.namePlateView.hidden = YES;
|
||||
}
|
||||
}
|
||||
|
||||
self.rechargeImageView.hidden = !_userInfo.isRechargeUser;
|
||||
[self.userPhtotArray removeAllObjects];
|
||||
// 轮播图
|
||||
|
@@ -258,6 +258,29 @@
|
||||
|
||||
|
||||
///铭牌
|
||||
- (NSMutableAttributedString *)createNameplateAttibuteWithImage:(NSString *)imageName{
|
||||
NetImageConfig *config = [[NetImageConfig alloc]init];
|
||||
///先这样吧
|
||||
config.autoLoad = YES;
|
||||
NetImageView *imageView = [[NetImageView alloc]initWithUrl:imageName config:config];
|
||||
UIImage* image = imageView.image;
|
||||
if (image) {
|
||||
CGFloat scale = image.size.width / (image.size.height > 0 ? image.size.height : 1);
|
||||
imageView.bounds = CGRectMake(0, 0, 20 * scale, 20);
|
||||
} else {
|
||||
NSURL *imgUrl = [NSURL URLWithString:imageName];
|
||||
UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]];
|
||||
CGFloat scale = myImage.size.width / (myImage.size.height > 0 ? myImage.size.height : 1);
|
||||
if (scale == 0) {
|
||||
imageView.bounds = CGRectMake(0, 0, 60, 20);
|
||||
}else {
|
||||
imageView.bounds = CGRectMake(0, 0, 20 * scale, 20);
|
||||
}
|
||||
}
|
||||
imageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
NSMutableAttributedString *string = [NSMutableAttributedString yy_attachmentStringWithContent:imageView contentMode:UIViewContentModeScaleAspectFit attachmentSize:imageView.bounds.size alignToFont:[UIFont boldSystemFontOfSize:12] alignment:YYTextVerticalAlignmentCenter];
|
||||
return string;
|
||||
}
|
||||
- (NSMutableAttributedString *)createNameplateAttibute:(NSString *)tagName image:(NSString *)imageName textFont:(UIFont *)textFont {
|
||||
NetImageConfig *config = [[NetImageConfig alloc]init];
|
||||
///先这样吧
|
||||
@@ -325,12 +348,20 @@
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//主播认证
|
||||
if (userInfo.nameplateWord.length > 0 && userInfo.nameplatePic.length>0) {
|
||||
[self createNameplateAttibute:userInfo.nameplateWord image:userInfo.nameplatePic textFont:[UIFont systemFontOfSize:9]];
|
||||
[attributedString appendAttributedString:[self createSapceAttribute:2]];
|
||||
}
|
||||
if(userInfo.isCertified == YES){
|
||||
//主播认证
|
||||
if (userInfo.nameplatePic.length > 0) {
|
||||
[self createNameplateAttibuteWithImage:userInfo.nameplatePic];
|
||||
[attributedString appendAttributedString:[self createSapceAttribute:2]];
|
||||
}
|
||||
}else{
|
||||
//主播认证
|
||||
if (userInfo.nameplateWord.length > 0 && userInfo.nameplatePic.length>0) {
|
||||
[self createNameplateAttibute:userInfo.nameplateWord image:userInfo.nameplatePic textFont:[UIFont systemFontOfSize:9]];
|
||||
[attributedString appendAttributedString:[self createSapceAttribute:2]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// userRank 用户级别
|
||||
if (userInfo.userLevelVo.experUrl) {
|
||||
|
@@ -67,6 +67,8 @@ typedef NS_ENUM(NSInteger, MonentsContentType) {
|
||||
@property (nonatomic, copy) NSString *nameplateWord;
|
||||
///铭牌图片
|
||||
@property (nonatomic, copy) NSString *nameplatePic;
|
||||
///是否自定义铭牌,
|
||||
@property(nonatomic,assign) BOOL isCustomWord;
|
||||
///话题id
|
||||
@property (nonatomic, assign) long worldId;
|
||||
///话题名字
|
||||
|
@@ -255,14 +255,23 @@
|
||||
}
|
||||
|
||||
self.charmImageView.hidden = _monentsInfo.charmLevelPic.length <= 0;
|
||||
|
||||
if (_monentsInfo.nameplateWord.length>0 && _monentsInfo.nameplatePic.length>0) {
|
||||
self.nameplateImageView.imageUrl = _monentsInfo.nameplatePic;
|
||||
self.nameplateLabel.text = _monentsInfo.nameplateWord;
|
||||
self.namePlateView.hidden = NO;
|
||||
} else {
|
||||
self.namePlateView.hidden = YES;
|
||||
if(_monentsInfo.isCustomWord == YES){
|
||||
if (_monentsInfo.nameplateWord.length>0) {
|
||||
self.nameplateImageView.imageUrl = _monentsInfo.nameplatePic;
|
||||
self.namePlateView.hidden = NO;
|
||||
} else {
|
||||
self.namePlateView.hidden = YES;
|
||||
}
|
||||
}else{
|
||||
if (_monentsInfo.nameplateWord.length>0 && _monentsInfo.nameplatePic.length>0) {
|
||||
self.nameplateImageView.imageUrl = _monentsInfo.nameplatePic;
|
||||
self.nameplateLabel.text = _monentsInfo.nameplateWord;
|
||||
self.namePlateView.hidden = NO;
|
||||
} else {
|
||||
self.namePlateView.hidden = YES;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
NSString * headwearUrl= _monentsInfo.headwearEffect.length > 0 ? _monentsInfo.headwearEffect : _monentsInfo.headwearPic;
|
||||
|
@@ -324,9 +324,11 @@
|
||||
self.isEdited = NO;
|
||||
}
|
||||
NSArray * array;
|
||||
if (self.datasource.count < 9 && self.datasource.count > 1) {
|
||||
array = [self.datasource subarrayWithRange:NSMakeRange(0, self.datasource.count - 1)];
|
||||
}
|
||||
if([self.datasource containsObject:self.addPicImage] && self.datasource.count > 1){
|
||||
array = [self.datasource subarrayWithRange:NSMakeRange(0, self.datasource.count - 1)];
|
||||
}else if(![self.datasource containsObject:self.addPicImage] && self.datasource.count == 9){
|
||||
array = self.datasource;
|
||||
}
|
||||
self.uploadImageList = array;
|
||||
}
|
||||
|
||||
|
@@ -46,7 +46,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
//是否为周榜top1
|
||||
@property(nonatomic,assign) BOOL isWeekTop1;
|
||||
@property(nonatomic,copy) NSString *inRoomUid;
|
||||
|
||||
//是否在麦位
|
||||
@property(nonatomic,assign) BOOL inMic;
|
||||
///是否在线
|
||||
|
@@ -24,7 +24,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@interface XPNewHomePartyTableViewCell : UITableViewCell
|
||||
|
||||
@property (nonatomic,strong) HomePlayRoomModel *roomInfo;
|
||||
@property (nonatomic,strong) HomeRecommendRoomModel *roomInfo1;
|
||||
|
||||
@property(nonatomic,weak) id<XPNewHomePartyTableViewCellDelegate>delegate;
|
||||
///声音卡时,svga是否播放动画
|
||||
-(void)setPlaySoundStatus:(BOOL)isPlay;
|
||||
|
@@ -243,14 +243,7 @@
|
||||
-(void)setPlaySoundTime:(NSInteger)time{
|
||||
_audioView.voiceDura = @(time).stringValue;
|
||||
}
|
||||
- (void)setRoomInfo1:(HomeRecommendRoomModel *)roomInfo1 {
|
||||
_roomInfo1 = roomInfo1;
|
||||
if (_roomInfo1) {
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-(void)didSelectItemAction{
|
||||
|
||||
|
@@ -431,6 +431,7 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
|
||||
-(void)xPNewHomePartyTableViewCell:(XPNewHomePartyTableViewCell *_Nullable)cell didSelectChat:(HomePlayRoomModel *_Nonnull)roomModel{
|
||||
if(roomModel.inMic == YES){
|
||||
[XPRoomViewController openRoom:roomModel.inRoomUid fromNick:roomModel.nick fromType:UserEnterRoomFromType_Follow_User fromUid:roomModel.uid viewController:self];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -53,6 +53,11 @@
|
||||
}];
|
||||
return code == 0;
|
||||
}
|
||||
/// 静音某个人
|
||||
/// @param userId 用户id
|
||||
- (BOOL)muteRemote:(BOOL)mute userId:(NSString *)userId {
|
||||
return [self.engine muteRemoteAudioStream:[userId integerValue] mute:mute];
|
||||
}
|
||||
|
||||
- (BOOL)muteRemote:(BOOL)mute {
|
||||
return [self.engine muteAllRemoteAudioStreams:mute] == 0;
|
||||
@@ -73,6 +78,20 @@
|
||||
}
|
||||
}];
|
||||
}
|
||||
///发起跨房通话
|
||||
- (void)connectOtherRoom:(NSString *)roomUid userId:(NSString *)uid {
|
||||
AgoraChannelMediaRelayConfiguration *config = [[AgoraChannelMediaRelayConfiguration alloc]init];
|
||||
config.sourceInfo = [[AgoraChannelMediaRelayInfo alloc]initWithToken:nil];
|
||||
AgoraChannelMediaRelayInfo *destinationInfo = [[AgoraChannelMediaRelayInfo alloc]initWithToken:nil];
|
||||
[config setDestinationInfo:destinationInfo forChannelName:roomUid];
|
||||
[self.engine startOrUpdateChannelMediaRelay:config];
|
||||
}
|
||||
|
||||
///退出跨房通话
|
||||
- (void)disconnectOtherRoom {
|
||||
[self.engine stopChannelMediaRelay];
|
||||
}
|
||||
|
||||
|
||||
- (void)destory {
|
||||
[AgoraRtcEngineKit destroy];
|
||||
@@ -131,6 +150,23 @@
|
||||
}
|
||||
|
||||
#pragma mark - AgoraRtcEngineDelegate
|
||||
///监听跨房语音
|
||||
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine
|
||||
channelMediaRelayStateDidChange:(AgoraChannelMediaRelayState)state
|
||||
error:(AgoraChannelMediaRelayError)error NS_SWIFT_NAME(rtcEngine(_:channelMediaRelayStateDidChange:error:)){
|
||||
switch (state) {
|
||||
case AgoraChannelMediaRelayStateRunning:
|
||||
|
||||
break;
|
||||
case AgoraChannelMediaRelayStateFailure:
|
||||
|
||||
break;
|
||||
case AgoraChannelMediaRelayStateIdle:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
- (void)rtcEngine:(AgoraRtcEngineKit *)engine reportAudioVolumeIndicationOfSpeakers:(NSArray *)speakers totalVolume:(NSInteger)totalVolume {
|
||||
NSMutableArray *uids = [NSMutableArray array];
|
||||
for (AgoraRtcAudioVolumeInfo *userInfo in speakers) {
|
||||
|
@@ -39,6 +39,14 @@
|
||||
|
||||
- (void)destory {
|
||||
|
||||
}
|
||||
///发起跨房PK
|
||||
- (void)connectOtherRoom:(NSString *)roomUid userId:(NSString *)uid{
|
||||
|
||||
}
|
||||
|
||||
///退出跨房通话
|
||||
- (void)disconnectOtherRoom{
|
||||
|
||||
}
|
||||
@end
|
||||
|
@@ -127,7 +127,7 @@
|
||||
/// @param roomUserId 房主的uid
|
||||
/// @param roundId 相亲进行到哪一步
|
||||
+ (void)changeRoomDatingState:(HttpRequestHelperCompletion)completion roomUserId:(NSString *)roomUserId roundId:(NSString *)roundId {
|
||||
NSString * fang = [NSString stringFromBase64String:@"dXNlcnJvb20vaW5WMg=="];///
|
||||
NSString * fang = @"blind-date/state";///
|
||||
[self makeRequest:fang method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, roomUserId, roundId, nil];
|
||||
}
|
||||
|
||||
|
@@ -82,6 +82,7 @@
|
||||
extModel.carName = userInfo.carName;
|
||||
extModel.inRoomNameplatePic = userInfo.nameplatePic;
|
||||
extModel.inRoomNameplateWord = userInfo.nameplateWord;
|
||||
extModel.isCustomWord = userInfo.isCustomWord;
|
||||
extModel.charmUrl = userInfo.userLevelVo.charmUrl;
|
||||
extModel.experLevelSeq = userInfo.userLevelVo.experLevelSeq;
|
||||
extModel.experUrl = userInfo.userLevelVo.experUrl;
|
||||
|
@@ -18,7 +18,10 @@
|
||||
@"csRank" : [AcrossRoomPkRankModel class]
|
||||
};
|
||||
}
|
||||
|
||||
///如果一个模型中需要字段映射的话 比如id -> ID name -> other.name
|
||||
+ (NSDictionary *)replacedKeyFromPropertyName {
|
||||
return @{@"aMicStatus":@"amicStatus"};
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
|
@@ -820,7 +820,7 @@
|
||||
- (UIButton *)assistButton {
|
||||
if (!_assistButton) {
|
||||
_assistButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_assistButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor], [DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
|
||||
[_assistButton setBackgroundImage:kImage(@"room_across_pk_assist") forState:UIControlStateNormal];
|
||||
[_assistButton setTitle:YMLocalizedString(@"XPAcrpssRoomPKPanelView2") forState:UIControlStateNormal];
|
||||
_assistButton.titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
|
||||
[_assistButton setTitleColor:[DJDKMIMOMColor confirmButtonTextColor] forState:UIControlStateNormal];
|
||||
@@ -836,7 +836,7 @@
|
||||
- (UIButton *)onlookButton {
|
||||
if (!_onlookButton) {
|
||||
_onlookButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_onlookButton setBackgroundImage:[UIImage imageWithColor:[DJDKMIMOMColor disableButtonColor]] forState:UIControlStateNormal];
|
||||
[_onlookButton setBackgroundImage:kImage(@"room_across_pk_onlookers") forState:UIControlStateNormal];
|
||||
[_onlookButton setTitle:YMLocalizedString(@"XPAcrpssRoomPKPanelView3") forState:UIControlStateNormal];
|
||||
_onlookButton.titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
|
||||
[_onlookButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
|
@@ -273,18 +273,24 @@
|
||||
self.nameLabel.text = self.model.anchorNick;
|
||||
self.countLabel.text = [NSString stringWithFormat:YMLocalizedString(@"XPAnchorFansTeamViewController0"), self.model.teamNum];
|
||||
|
||||
XPAnchorFansPrivilegeModel *nameplateModel = self.model.privilegeConfigVos[0];
|
||||
self.nameplateImageView.imageUrl = nameplateModel.icon;
|
||||
self.nameplateLabel.text = nameplateModel.name;
|
||||
self.nameplateDescLabel.text = nameplateModel.desc;
|
||||
XPAnchorFansPrivilegeModel *giftModel = self.model.privilegeConfigVos[1];
|
||||
self.giftImageView.imageUrl = giftModel.icon;
|
||||
self.giftLabel.text = giftModel.name;
|
||||
self.giftDescLabel.text = giftModel.desc;
|
||||
for (XPAnchorFansPrivilegeModel *obj in self.model.privilegeConfigVos) {
|
||||
if(obj.type == 1){
|
||||
XPAnchorFansPrivilegeModel *nameplateModel = obj;
|
||||
self.nameplateImageView.imageUrl = nameplateModel.icon;
|
||||
self.nameplateLabel.text = nameplateModel.name;
|
||||
self.nameplateDescLabel.text = nameplateModel.desc;
|
||||
}else if(obj.type == 2){
|
||||
XPAnchorFansPrivilegeModel *giftModel = obj;
|
||||
self.giftImageView.imageUrl = giftModel.icon;
|
||||
self.giftLabel.text = giftModel.name;
|
||||
self.giftDescLabel.text = giftModel.desc;
|
||||
}else if(obj.type == 3){
|
||||
XPAnchorFansPrivilegeModel *joinModel = obj;
|
||||
self.joinLabel.text = joinModel.name;
|
||||
self.iconImageView.imageUrl = joinModel.icon;
|
||||
}
|
||||
}
|
||||
|
||||
XPAnchorFansPrivilegeModel *joinModel = self.model.privilegeConfigVos[2];
|
||||
self.joinLabel.text = joinModel.name;
|
||||
self.iconImageView.imageUrl = joinModel.icon;
|
||||
|
||||
CGFloat margin = 8;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
@@ -323,7 +329,14 @@
|
||||
|
||||
- (void)joinButtonAction:(UIButton *)button {
|
||||
button.userInteractionEnabled = NO;
|
||||
XPAnchorFansPrivilegeModel *joinModel = self.model.privilegeConfigVos[2];
|
||||
XPAnchorFansPrivilegeModel *joinModel;
|
||||
for (XPAnchorFansPrivilegeModel *obj in self.model.privilegeConfigVos) {
|
||||
if(obj.type == 3){
|
||||
joinModel = obj;
|
||||
}
|
||||
}
|
||||
if(joinModel == nil)return;
|
||||
|
||||
[Api requestSendAnchorFansGift:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
[self showSuccessToast:YMLocalizedString(@"XPAnchorFansTeamViewController1")];
|
||||
|
@@ -16,6 +16,7 @@ typedef enum : NSUInteger {
|
||||
GiftBannerType_Fairy,///夺宝精灵
|
||||
GiftBannerType_Tarrow,//塔罗
|
||||
GiftBannerType_Common_H5,//通用h5
|
||||
GiftBannerType_Magic_House,//魔法屋
|
||||
} GiftBannerType;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -25,6 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@property(nonatomic, copy)NSString *nick;
|
||||
@property(nonatomic, copy)NSString *giftName;
|
||||
@property(nonatomic, copy) NSString *giftNum;
|
||||
@property (nonatomic,copy) NSString *luckyBagName;
|
||||
@property (nonatomic,copy) NSString *roomTitle;
|
||||
@property (nonatomic,assign) NSInteger uid;
|
||||
@@ -41,6 +43,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,copy) NSString * bannerId;
|
||||
@property(nonatomic,copy) NSString *drawGoldNum;
|
||||
@property(nonatomic,copy) NSString *content;
|
||||
///福袋图片
|
||||
@property(nonatomic,copy) NSString *luckyBagGiftPic;
|
||||
///礼物图片
|
||||
@property(nonatomic,copy) NSString *giftPic;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -16,6 +16,7 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface PIRoomGiftBroadcastWindow : UIView
|
||||
@property(nonatomic,assign) BOOL isLuck;///是否是福袋
|
||||
@property(nonatomic,copy) NSString *roomName;
|
||||
@property(nonatomic,copy) NSString *roodUid;
|
||||
@property(nonatomic,weak) id<PIRoomGiftBroadcastWindowDelegate>delegate;
|
||||
|
@@ -96,6 +96,16 @@
|
||||
}
|
||||
-(void)selectAction:(UIButton *)sender{
|
||||
sender.selected = !sender.selected;
|
||||
|
||||
if(self.isLuck == YES){
|
||||
if(sender.selected == YES){
|
||||
[[NSUserDefaults standardUserDefaults]setValue:@(YES) forKey:@"kSaveLuckSelectState"];
|
||||
[[NSUserDefaults standardUserDefaults]synchronize];
|
||||
}else{
|
||||
[[NSUserDefaults standardUserDefaults]removeObjectForKey:@"kSaveLuckSelectState"];
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(sender.selected == YES){
|
||||
[[NSUserDefaults standardUserDefaults]setValue:@(YES) forKey:@"kSaveBrooadcastSelectState"];
|
||||
[[NSUserDefaults standardUserDefaults]synchronize];
|
||||
|
@@ -111,8 +111,7 @@
|
||||
@property (nonatomic,strong) NSMutableSet<NetImageView *> * giftVisibleArray;
|
||||
|
||||
|
||||
///魔法小屋合成礼物的队列
|
||||
@property (nonatomic,strong) NSMutableArray *compoundGiftQueue;
|
||||
|
||||
|
||||
///大礼物是否正在播放
|
||||
@property (nonatomic,assign) BOOL isLargeGiftAnimating;
|
||||
@@ -183,8 +182,7 @@
|
||||
self.delegate = delegate;
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
return self;
|
||||
@@ -1181,13 +1179,18 @@
|
||||
#pragma mark - 魔法小屋礼物合成
|
||||
- (void)receiveGiftCompound:(AttachmentModel *)attachment {
|
||||
if ([self isInSudGame]) {return;}
|
||||
if (self.compoundGiftQueue.count == 0) {
|
||||
[self createGiftCompoundBannerAnimation:attachment];
|
||||
PIBaseAnimationViewModel *magicModel =[PIBaseAnimationViewModel new];
|
||||
magicModel.data = attachment.data;
|
||||
magicModel.type = GiftBannerType_Magic_House;
|
||||
if(self.animationListB.count == 0 && self.isPlayOfB == NO){
|
||||
[self createGiftCompoundBannerAnimation:magicModel];
|
||||
}
|
||||
[self.compoundGiftQueue addObject:attachment];
|
||||
[self.animationListB addObject:magicModel];
|
||||
|
||||
}
|
||||
|
||||
- (void)createGiftCompoundBannerAnimation:(AttachmentModel *)attachment {
|
||||
- (void)createGiftCompoundBannerAnimation:(PIBaseAnimationViewModel *)attachment {
|
||||
self.isPlayOfB = YES;
|
||||
XPRoomGiftCompoundView *compoundGiftView = [[XPRoomGiftCompoundView alloc] initWithFrame:CGRectMake(KScreenWidth, kNavigationHeight + 15, KScreenWidth, 45)];
|
||||
compoundGiftView.compoundGiftInfo = attachment.data;
|
||||
[self.middleLevelView addSubview:compoundGiftView];
|
||||
@@ -1210,13 +1213,16 @@
|
||||
@kStrongify(self);
|
||||
if (finished) {
|
||||
[compoundGiftView removeFromSuperview];
|
||||
if (self.compoundGiftQueue.count > 0) {
|
||||
[self.compoundGiftQueue removeObjectAtIndex:0];
|
||||
}
|
||||
|
||||
if (self.compoundGiftQueue.count > 0) {
|
||||
[self createGiftCompoundBannerAnimation:self.compoundGiftQueue.firstObject];
|
||||
self.isPlayOfB = NO;
|
||||
if(self.animationListB.count > 0){
|
||||
[self.animationListB removeObjectAtIndex:0];
|
||||
}
|
||||
// if(self.isAnimationListAFinish == YES){
|
||||
// self.isAnimationListAFinish = NO;
|
||||
// [self playAnimationWithModel];
|
||||
// return;
|
||||
// }
|
||||
[self playAnimationWithModel];
|
||||
}
|
||||
}];
|
||||
[compoundGiftView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"];
|
||||
@@ -1619,7 +1625,7 @@
|
||||
|
||||
|
||||
self.isLuckyGiftAnimation = YES;
|
||||
XPRoomLuckyBigPrizeView * luckyGiftEffectView = [[XPRoomLuckyBigPrizeView alloc] initWithFrame:CGRectMake(KScreenWidth, top, 375, 60)];
|
||||
XPRoomLuckyBigPrizeView * luckyGiftEffectView = [[XPRoomLuckyBigPrizeView alloc] initWithFrame:CGRectMake(KScreenWidth, top, 375, 71)];
|
||||
luckyGiftEffectView.delegate = self;
|
||||
[self.highLevleView addSubview:luckyGiftEffectView];
|
||||
luckyGiftEffectView.giftInfo = prizeModel;
|
||||
@@ -1629,19 +1635,35 @@
|
||||
springAnimation.springBounciness = 10.f;
|
||||
springAnimation.fromValue = [NSValue valueWithCGPoint:luckyGiftEffectView.center];
|
||||
springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(KScreenWidth / 2, luckyGiftEffectView.center.y)];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 6 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
|
||||
[luckyGiftEffectView removeFromSuperview];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 7 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
|
||||
POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter];
|
||||
moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, luckyGiftEffectView.center.y)];
|
||||
moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2, luckyGiftEffectView.center.y)];
|
||||
moveAnimation.beginTime = CACurrentMediaTime();
|
||||
moveAnimation.duration = 0.5;
|
||||
moveAnimation.repeatCount = 1;
|
||||
moveAnimation.removedOnCompletion = YES;
|
||||
@kWeakify(self);
|
||||
[moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
|
||||
@kStrongify(self);
|
||||
if (finished) {
|
||||
[luckyGiftEffectView removeFromSuperview];
|
||||
|
||||
if (self.animationListB.count > 0) {
|
||||
[self.animationListB removeObjectAtIndex:0];
|
||||
}
|
||||
self.isPlayOfB = NO;
|
||||
// if(self.isAnimationListAFinish == YES){
|
||||
// self.isAnimationListAFinish = NO;
|
||||
// [self playAnimationWithModel];
|
||||
// return;
|
||||
// }
|
||||
[self playAnimationWithModel];
|
||||
}
|
||||
}];
|
||||
[luckyGiftEffectView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"];
|
||||
|
||||
|
||||
if (self.animationListB.count > 0) {
|
||||
[self.animationListB removeObjectAtIndex:0];
|
||||
}
|
||||
self.isPlayOfB = NO;
|
||||
// if(self.isAnimationListAFinish == YES){
|
||||
// self.isAnimationListAFinish = NO;
|
||||
// [self playAnimationWithModel];
|
||||
// return;
|
||||
// }
|
||||
[self playAnimationWithModel];
|
||||
});
|
||||
[luckyGiftEffectView pop_addAnimation:springAnimation forKey:@"nobleLevelUpspingOutAnimation"];
|
||||
}
|
||||
@@ -1665,6 +1687,8 @@
|
||||
[self createTarotBannerAnimation:model];
|
||||
}else if(model.type == GiftBannerType_Common_H5){
|
||||
[self createCommonH5BannerAnimation:model];
|
||||
}else if(model.type == GiftBannerType_Magic_House){
|
||||
[self createGiftCompoundBannerAnimation:model];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1699,18 +1723,35 @@
|
||||
[self createTarotBannerAnimation:model];
|
||||
}else if(model.type == GiftBannerType_Common_H5){
|
||||
[self createCommonH5BannerAnimation:model];
|
||||
}else if(model.type == GiftBannerType_Magic_House){
|
||||
[self createGiftCompoundBannerAnimation:model];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - XPRoomLuckyBigPrizeViewDelegate
|
||||
- (void)xPRoomLuckyBigPrizeView:(XPRoomLuckyBigPrizeView *)view luckyGiftInfo:(PIBaseAnimationViewModel *)giftInfo {
|
||||
if (!giftInfo.isInRoomVisiable && giftInfo.roomUid.length > 0 && giftInfo.roomUid.integerValue != self.delegate.getRoomInfo.uid) {
|
||||
[self.delegate exitRoom];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[XPRoomViewController openRoom:giftInfo.roomUid viewController:[XCCurrentVCStackManager shareManager].getCurrentVC];
|
||||
});
|
||||
}
|
||||
id isShowBroadcastView = [[NSUserDefaults standardUserDefaults]valueForKey:@"kSaveLuckSelectState"];
|
||||
if(isShowBroadcastView == nil){
|
||||
PIRoomGiftBroadcastWindow *broadcastView = [[PIRoomGiftBroadcastWindow alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
|
||||
broadcastView.isLuck = YES;
|
||||
broadcastView.roodUid = giftInfo.roomUid;
|
||||
broadcastView.roomName = giftInfo.roomTitle;
|
||||
broadcastView.delegate = self;
|
||||
[kWindow addSubview:broadcastView];
|
||||
return;
|
||||
}
|
||||
if (!giftInfo.isInRoomVisiable && giftInfo.roomUid.length > 0 && giftInfo.roomUid.integerValue != self.delegate.getRoomInfo.uid) {
|
||||
[self.delegate exitRoom];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[XPRoomViewController openRoom:giftInfo.roomUid viewController:[XCCurrentVCStackManager shareManager].getCurrentVC];
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - 普通礼物
|
||||
@@ -2590,13 +2631,6 @@
|
||||
|
||||
|
||||
|
||||
- (NSMutableArray *)compoundGiftQueue {
|
||||
if (!_compoundGiftQueue) {
|
||||
_compoundGiftQueue = [NSMutableArray array];
|
||||
}
|
||||
return _compoundGiftQueue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (NSMutableArray<NSDictionary *> *)carEffectQueue {
|
||||
|
@@ -277,7 +277,8 @@
|
||||
[leftAttribut addAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:28], NSForegroundColorAttributeName:[UIColor whiteColor]} range:NSMakeRange(0, leftTitle.length)];
|
||||
[self.datingSvgaImageView setAttributedText:leftAttribut forKey:@"y_yhname"];
|
||||
@kWeakify(self);
|
||||
[self.parser parseWithURL:[NSURL URLWithString:model.svgaUrl] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||
NSString *url = [model.svgaUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
|
||||
[self.parser parseWithURL:[NSURL URLWithString:url] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||
@kStrongify(self);
|
||||
self.datingSvgaImageView.hidden = NO;
|
||||
self.datingSvgaImageView.videoItem = videoItem;
|
||||
|
@@ -22,7 +22,10 @@
|
||||
@interface XPRoomLuckyBigPrizeView ()<SVGAPlayerDelegate>
|
||||
///动画管理类
|
||||
@property (strong, nonatomic) SVGAParser *parser;
|
||||
@property (nonatomic, strong) XPSVGAPlayer *giftImageView;
|
||||
@property (nonatomic, strong) XPSVGAPlayer *giftSvgaView;
|
||||
@property(nonatomic,strong) NetImageView *chestImageView;
|
||||
@property(nonatomic,strong) NetImageView *giftImageView;
|
||||
@property(nonatomic,strong) UILabel *contentView;
|
||||
@end
|
||||
|
||||
@implementation XPRoomLuckyBigPrizeView
|
||||
@@ -38,15 +41,31 @@
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.giftImageView];
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapRecognizer:)];
|
||||
[self addGestureRecognizer:tap];
|
||||
[self addSubview:self.giftSvgaView];
|
||||
[self addSubview:self.chestImageView];
|
||||
[self addSubview:self.giftImageView];
|
||||
[self addSubview:self.contentView];
|
||||
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
[self.giftSvgaView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self);
|
||||
}];
|
||||
[self.chestImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(9);
|
||||
make.centerY.equalTo(self);
|
||||
make.height.width.mas_equalTo(60);
|
||||
}];
|
||||
[self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.trailing.mas_equalTo(-9);
|
||||
make.centerY.equalTo(self);
|
||||
make.height.width.mas_equalTo(60);
|
||||
}];
|
||||
[self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.trailing.equalTo(self).inset(69);
|
||||
make.centerY.equalTo(self);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Event Response
|
||||
@@ -55,72 +74,71 @@
|
||||
[self.delegate xPRoomLuckyBigPrizeView:self luckyGiftInfo:self.giftInfo];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)chestImageViewTapRecognizer:(UITapGestureRecognizer *)tap{
|
||||
[self tapRecognizer:tap];
|
||||
}
|
||||
- (void)giftImageViewTapRecognizer:(UITapGestureRecognizer *)tap{
|
||||
[self tapRecognizer:tap];
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setGiftInfo:(PIBaseAnimationViewModel*)giftInfo {
|
||||
_giftInfo = giftInfo;
|
||||
if (_giftInfo) {
|
||||
if (_giftInfo) {
|
||||
NSString * nick = _giftInfo.nick ?: @"";
|
||||
if (nick.length > 6) {
|
||||
nick = [nick substringToIndex:6];
|
||||
}
|
||||
NSString *goldPrice = _giftInfo.goldPrice ?: @"";
|
||||
if (nick.length > 5) {
|
||||
nick = [nick substringToIndex:5];
|
||||
}
|
||||
NSString *goldPrice = _giftInfo.goldPrice ?: @"0";
|
||||
NSString *giftName = _giftInfo.giftName ?: @"";
|
||||
NSString *luckyBagName = _giftInfo.luckyBagName ?: @"";
|
||||
CGFloat fontSize = 22;
|
||||
NSDictionary * dic = @{NSFontAttributeName:[UIFont systemFontOfSize:fontSize], NSForegroundColorAttributeName:[UIColor whiteColor]};
|
||||
NSDictionary * mainDic = @{NSFontAttributeName:[UIFont systemFontOfSize:fontSize], NSForegroundColorAttributeName:[DJDKMIMOMColor appMainColor]};
|
||||
NSString *giftNum = _giftInfo.giftNum ?: @"0";
|
||||
NSString *mainText = [NSString stringWithFormat:YMLocalizedString(@"XPRoomLuckyBigPrizeView0"),nick,luckyBagName,goldPrice,giftName];
|
||||
if([giftNum integerValue] > 1){
|
||||
mainText = [NSString stringWithFormat:@"%@ X%@",mainText,giftNum];
|
||||
}
|
||||
CGFloat fontSize = 12;
|
||||
NSDictionary * dic = @{NSFontAttributeName:[UIFont systemFontOfSize:fontSize weight:UIFontWeightMedium], NSForegroundColorAttributeName:UIColorFromRGB(0xFFF45E)};
|
||||
NSDictionary * mainDic = @{NSFontAttributeName:[UIFont systemFontOfSize:fontSize weight:UIFontWeightMedium], NSForegroundColorAttributeName:[UIColor whiteColor]};
|
||||
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] init];
|
||||
[attributedString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPGiftLuckyGiftBroadcastCell0") attributes:dic]];
|
||||
[attributedString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:mainText attributes:mainDic]];
|
||||
|
||||
[attributedString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:nick attributes:mainDic]];
|
||||
|
||||
|
||||
[attributedString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:YMLocalizedString(@"XPRoomLuckyBigPrizeView1"),luckyBagName] attributes:dic]];
|
||||
|
||||
[attributedString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:goldPrice attributes:mainDic]];
|
||||
|
||||
[attributedString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:giftName attributes:mainDic]];
|
||||
NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new];
|
||||
paragraphStyle.lineBreakMode = NSLineBreakByCharWrapping;
|
||||
paragraphStyle.alignment = NSTextAlignmentLeft;
|
||||
paragraphStyle.lineSpacing = 4.0f;//行间距
|
||||
// 强制排版(从左到右)
|
||||
paragraphStyle.alignment = NSTextAlignmentLeft;
|
||||
paragraphStyle.baseWritingDirection = NSWritingDirectionLeftToRight;
|
||||
[attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attributedString.length)];
|
||||
if (_giftInfo.isInRoomVisiable) {
|
||||
[self.giftImageView setHidden:YES forKey:@"img_206"];
|
||||
} else {
|
||||
[self.giftImageView setHidden:NO forKey:@"img_206"];
|
||||
}
|
||||
[attributedString addAttributes:dic range:[mainText rangeOfString:nick]];
|
||||
[attributedString addAttributes:dic range:[mainText rangeOfString:luckyBagName]];
|
||||
[attributedString addAttributes:dic range:[mainText rangeOfString:goldPrice]];
|
||||
[attributedString addAttributes:dic range:[mainText rangeOfString:giftName]];
|
||||
if([giftNum integerValue] > 1){
|
||||
[attributedString addAttributes:dic range:[mainText rangeOfString:giftNum]];
|
||||
}
|
||||
_contentView.attributedText = attributedString;
|
||||
_chestImageView.imageUrl = _giftInfo.luckyBagGiftPic;
|
||||
_giftImageView.imageUrl = _giftInfo.giftPic;
|
||||
@kWeakify(self);
|
||||
[self.giftImageView setAttributedText:attributedString forKey:@"fdpp_copywriting"];
|
||||
NSString * anatomiser1Name = [NSString stringWithFormat:@"%@/lucky_gift_streamer.svga", API_Image_URL];
|
||||
[self.parser parseWithURL:[NSURL URLWithString:anatomiser1Name] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||
@kStrongify(self);
|
||||
self.hidden = NO;
|
||||
self.giftImageView.hidden = NO;
|
||||
self.giftImageView.videoItem = videoItem;
|
||||
self.giftImageView.loops = 1;
|
||||
self.giftImageView.clearsAfterStop = YES;
|
||||
[self.giftImageView startAnimation];
|
||||
} failureBlock:^(NSError * _Nonnull error) {
|
||||
|
||||
}];
|
||||
|
||||
[self.parser parseWithNamed:@"pi_room_lucky_gift" inBundle:nil completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||
@kStrongify(self);
|
||||
self.hidden = NO;
|
||||
self.giftSvgaView.hidden = NO;
|
||||
self.giftSvgaView.videoItem = videoItem;
|
||||
self.giftSvgaView.loops = 10000;
|
||||
self.giftSvgaView.clearsAfterStop = YES;
|
||||
[self.giftSvgaView startAnimation];
|
||||
} failureBlock:^(NSError * _Nullable error) {
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
- (void)svgaPlayerDidFinishedAnimation:(SVGAPlayer *)player{
|
||||
NSLog(@"11111");
|
||||
}
|
||||
- (XPSVGAPlayer *)giftImageView {
|
||||
if (!_giftImageView) {
|
||||
_giftImageView = [[XPSVGAPlayer alloc]init];
|
||||
_giftImageView.backgroundColor = [UIColor clearColor];
|
||||
_giftImageView.userInteractionEnabled = NO;
|
||||
_giftImageView.delegate = self;
|
||||
- (XPSVGAPlayer *)giftSvgaView {
|
||||
if (!_giftSvgaView) {
|
||||
_giftSvgaView = [[XPSVGAPlayer alloc]init];
|
||||
_giftSvgaView.backgroundColor = [UIColor clearColor];
|
||||
_giftSvgaView.userInteractionEnabled = NO;
|
||||
_giftSvgaView.delegate = self;
|
||||
}
|
||||
return _giftImageView;
|
||||
return _giftSvgaView;
|
||||
}
|
||||
|
||||
- (SVGAParser *)parser {
|
||||
@@ -129,4 +147,30 @@
|
||||
}
|
||||
return _parser;
|
||||
}
|
||||
- (NetImageView *)chestImageView{
|
||||
if(!_chestImageView){
|
||||
_chestImageView = [NetImageView new];
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(chestImageViewTapRecognizer:)];
|
||||
_chestImageView.userInteractionEnabled = YES;
|
||||
[_chestImageView addGestureRecognizer:tap];
|
||||
}
|
||||
return _chestImageView;
|
||||
}
|
||||
- (NetImageView *)giftImageView{
|
||||
if(!_giftImageView){
|
||||
_giftImageView = [NetImageView new];
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(giftImageViewTapRecognizer:)];
|
||||
_giftImageView.userInteractionEnabled = YES;
|
||||
[_giftImageView addGestureRecognizer:tap];
|
||||
}
|
||||
return _giftImageView;
|
||||
}
|
||||
- (UILabel *)contentView{
|
||||
if(!_contentView){
|
||||
_contentView = [UILabel labelInitWithText:@"" font:kFontMedium(10) textColor:[UIColor whiteColor]];
|
||||
_contentView.textAlignment = NSTextAlignmentCenter;
|
||||
_contentView.numberOfLines = 2;
|
||||
}
|
||||
return _contentView;
|
||||
}
|
||||
@end
|
||||
|
@@ -28,7 +28,7 @@
|
||||
[[self getView] getRoomArrangeMicListSuccess:model state:state];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] getRoomArrangeMicListFail:msg state:state];
|
||||
} showLoading:YES] roomUid:roomUid operUid:uid page:pageStr pageSize:pageSizeStr];
|
||||
} showLoading:NO] roomUid:roomUid operUid:uid page:pageStr pageSize:pageSizeStr];
|
||||
}
|
||||
|
||||
/// 申请排麦
|
||||
@@ -67,7 +67,7 @@
|
||||
[[self getView] getRoomPKMemberListSuccess:model state:state];
|
||||
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] getRoomPKMemberListFail:msg state:state];
|
||||
} showLoading:YES] roomUid:roomUid operUid:uid page:pageStr pageSize:pageSizeStr];
|
||||
} showLoading:NO] roomUid:roomUid operUid:uid page:pageStr pageSize:pageSizeStr];
|
||||
}
|
||||
|
||||
/// 申请房间内PK排麦
|
||||
|
@@ -501,6 +501,7 @@
|
||||
}
|
||||
|
||||
- (void)getRoomPKMemberListSuccess:(ArrangeMicModel *)listModel state:(int)state {
|
||||
|
||||
self.arrangeMicInfo = listModel;
|
||||
if (state == 0) {
|
||||
[self.datasource removeAllObjects];
|
||||
|
@@ -997,30 +997,10 @@
|
||||
if (currentUserModel) {
|
||||
if (!self.musicEnterButton.superview) {
|
||||
[self addSubview:self.musicEnterButton];
|
||||
CGFloat topOffY = self.delegate.getRoomInfo.type == RoomType_Anchor || self.delegate.getRoomInfo.isPermitRoom == PermitRoomType_Licnese ? (kNavigationHeight+ 4 + 22 + 18) : (kNavigationHeight+ 4);
|
||||
if (self.delegate.getRoomInfo.roomModeType == RoomModeType_Open_Blind) {//相亲厅播放音乐
|
||||
[self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.centerY.mas_equalTo(self.contributeEnterView);
|
||||
make.width.mas_equalTo(22);
|
||||
make.height.mas_equalTo(22);
|
||||
}];
|
||||
[self setViewConstraints];
|
||||
} else {
|
||||
if (self.hourRankEntranceView.superview) {
|
||||
[self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.hourRankEntranceView.mas_right).mas_offset(4);
|
||||
make.centerY.mas_equalTo(self.contributeEnterView);
|
||||
make.width.mas_equalTo(22);
|
||||
make.height.mas_equalTo(22);
|
||||
}];
|
||||
} else {
|
||||
[self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.centerY.mas_equalTo(self.contributeEnterView);
|
||||
make.width.mas_equalTo(22);
|
||||
make.height.mas_equalTo(22);
|
||||
}];
|
||||
}
|
||||
[self setViewConstraints];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -1689,36 +1669,32 @@
|
||||
if (currentUserModel) {
|
||||
if (!self.musicEnterButton.superview) {
|
||||
[self addSubview:self.musicEnterButton];
|
||||
CGFloat topOffY = (self.delegate.getRoomInfo.type == RoomType_Anchor || self.delegate.getRoomInfo.isPermitRoom == PermitRoomType_Licnese) ? (kNavigationHeight+ 4 + 22 + 18) : (kNavigationHeight+ 4);
|
||||
if (self.delegate.getRoomInfo.roomModeType == RoomModeType_Open_Blind) {//相亲厅播放音乐
|
||||
[self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.centerY.mas_equalTo(self.contributeEnterView);
|
||||
make.width.mas_equalTo(22);
|
||||
make.height.mas_equalTo(22);
|
||||
}];
|
||||
[self setViewConstraints];
|
||||
} else {
|
||||
if (self.hourRankEntranceView.superview) {
|
||||
[self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.hourRankEntranceView.mas_right).mas_offset(4);
|
||||
make.centerY.mas_equalTo(self.contributeEnterView);
|
||||
make.width.mas_equalTo(22);
|
||||
make.height.mas_equalTo(22);
|
||||
}];
|
||||
} else {
|
||||
[self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.centerY.mas_equalTo(self.contributeEnterView);
|
||||
make.width.mas_equalTo(22);
|
||||
make.height.mas_equalTo(22);
|
||||
}];
|
||||
}
|
||||
[self setViewConstraints];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-(void)setViewConstraints{
|
||||
if (self.hourRankEntranceView.superview) {
|
||||
[self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.hourRankEntranceView.mas_right).mas_offset(4);
|
||||
make.centerY.mas_equalTo(self.contributeEnterView);
|
||||
make.width.mas_equalTo(22);
|
||||
make.height.mas_equalTo(22);
|
||||
}];
|
||||
} else {
|
||||
[self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.centerY.mas_equalTo(self.contributeEnterView);
|
||||
make.width.mas_equalTo(22);
|
||||
make.height.mas_equalTo(22);
|
||||
}];
|
||||
}
|
||||
}
|
||||
///跨房PK预约倒计时
|
||||
- (void)showAcrossPkCountDownViewWithTime:(long long)time {
|
||||
if (self.acrossPKCountView.superview) {
|
||||
|
@@ -104,9 +104,6 @@
|
||||
#else
|
||||
isTestEnv = NO;
|
||||
#endif
|
||||
if(isEnterprise == NO){
|
||||
[[SudMGP getCfg]setBackgroundMode:NO];
|
||||
}
|
||||
[SudMGP initSDK:KeyWithType(KeyType_SudGameAppID) appKey:KeyWithType(KeyType_SudGameAppKey) isTestEnv:isTestEnv listener:^(int retCode, const NSString *retMsg) {
|
||||
if (retCode == 0) {
|
||||
if (!self.currentmgId) {
|
||||
@@ -594,6 +591,7 @@
|
||||
|
||||
/// 命中 关键词状态 (你画我猜)
|
||||
- (void)notifyChangeTextHitState:(NSString *)keyWord {
|
||||
if([keyWord isKindOfClass:[NSNull class]])return;
|
||||
if (keyWord.length && [keyWord containsString:self.DrawSomethingKeyWord]) {
|
||||
NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:@(true), @"isHit", self.DrawSomethingKeyWord, @"keyWord", self.DrawSomethingKeyWord, @"text", nil];
|
||||
[self notifyStateChange:APP_COMMON_SELF_TEXT_HIT dataJson:[SudCommon dictionaryToJson:dic]];
|
||||
|
@@ -68,6 +68,7 @@
|
||||
extModel.carName = userInfo.carName;
|
||||
extModel.inRoomNameplatePic = userInfo.nameplatePic;
|
||||
extModel.inRoomNameplateWord = userInfo.nameplateWord;
|
||||
extModel.isCustomWord = userInfo.isCustomWord;
|
||||
extModel.charmUrl = userInfo.userLevelVo.charmUrl;
|
||||
extModel.experLevelSeq = userInfo.userLevelVo.experLevelSeq;
|
||||
extModel.experUrl = userInfo.userLevelVo.experUrl;
|
||||
|
@@ -8,10 +8,13 @@
|
||||
#import "NSObject+MJExtension.h"
|
||||
#import "UserLevelVo.h"
|
||||
#import "YUMINNNN.h"
|
||||
#import "UserVipInfoVo.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPMessageRemoteExtModel : PIBaseModel
|
||||
|
||||
@property (nonatomic , strong) UserLevelVo * userLevelVo;
|
||||
///贵族信息
|
||||
@property (nonatomic, strong) UserVipInfoVo *userVipInfoVO;
|
||||
///魅力等级
|
||||
@property (nonatomic,copy) NSString *charmUrl;
|
||||
@property (nonatomic,assign) NSInteger erbanNo;
|
||||
@@ -33,6 +36,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,copy) NSString *fromNick;
|
||||
@property (nonatomic,assign) UserEnterRoomFromType fromType;
|
||||
@property (nonatomic,copy) NSString *fromUid;
|
||||
@property(nonatomic,copy) NSString *uid;
|
||||
///名牌的
|
||||
@property (nonatomic,copy) NSString *inRoomNameplatePic;
|
||||
///铭牌的字
|
||||
@@ -55,6 +59,15 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,assign) BOOL fromSayHelloChannel;
|
||||
/// 0 普通 1超管
|
||||
@property (nonatomic,assign) NSInteger platformRole;
|
||||
@property(nonatomic,copy) NSString *avatar;
|
||||
@property(nonatomic,copy) NSString *nick;
|
||||
@property(nonatomic,assign) BOOL inMic;
|
||||
@property(nonatomic,copy) NSString *memberType;
|
||||
///铭牌,
|
||||
@property(nonatomic,copy) NSString *nameplatePic;
|
||||
@property(nonatomic,copy) NSString *nameplateWord;
|
||||
///是否自定义铭牌,
|
||||
@property(nonatomic,assign) BOOL isCustomWord;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -210,14 +210,22 @@
|
||||
[attribute appendAttributedString:[self createUrlImageAttribute:model.experUrl]];
|
||||
[attribute appendAttributedString:[self createSapceAttribute:2]];
|
||||
}
|
||||
|
||||
if (model.inRoomNameplatePic.length > 0 && model.inRoomNameplateWord.length > 0) { //铭牌有图片加文字
|
||||
[attribute appendAttributedString:[self createNameplateAttibute:model.inRoomNameplateWord image:model.inRoomNameplatePic textFont:[UIFont systemFontOfSize:9]]];
|
||||
[attribute appendAttributedString:[self createSapceAttribute:2]];
|
||||
} else if (model.inRoomNameplatePic.length > 0) {//铭牌只有图片
|
||||
[attribute appendAttributedString:[self createUrlImageAttribute:model.inRoomNameplatePic]];
|
||||
[attribute appendAttributedString:[self createSapceAttribute:2]];
|
||||
}
|
||||
if(model.isCustomWord == YES){
|
||||
if (model.inRoomNameplatePic.length > 0){
|
||||
[attribute appendAttributedString:[self createUrlImageAttribute:model.inRoomNameplatePic]];
|
||||
[attribute appendAttributedString:[self createSapceAttribute:2]];
|
||||
}
|
||||
|
||||
}else{
|
||||
if (model.inRoomNameplatePic.length > 0 && model.inRoomNameplateWord.length > 0) { //铭牌有图片加文字
|
||||
[attribute appendAttributedString:[self createNameplateAttibute:model.inRoomNameplateWord image:model.inRoomNameplatePic textFont:[UIFont systemFontOfSize:9]]];
|
||||
[attribute appendAttributedString:[self createSapceAttribute:2]];
|
||||
} else if (model.inRoomNameplatePic.length > 0) {//铭牌只有图片
|
||||
[attribute appendAttributedString:[self createUrlImageAttribute:model.inRoomNameplatePic]];
|
||||
[attribute appendAttributedString:[self createSapceAttribute:2]];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[attribute appendAttributedString:[self createTextAttribute:nick color:[DJDKMIMOMColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
|
||||
@@ -303,10 +311,18 @@
|
||||
[attribute appendAttributedString:[self createUrlImageAttribute:extModel.experUrl]];
|
||||
[attribute appendAttributedString:[self createSapceAttribute:2]];
|
||||
}
|
||||
if (extModel.inRoomNameplatePic.length > 0 && extModel.inRoomNameplateWord.length > 0) {
|
||||
[attribute appendAttributedString:[self createNameplateAttibute:extModel.inRoomNameplateWord image:extModel.inRoomNameplatePic textFont:[UIFont systemFontOfSize:9]]];
|
||||
[attribute appendAttributedString:[self createSapceAttribute:2]];
|
||||
}
|
||||
if(extModel.isCustomWord == YES){
|
||||
if (extModel.inRoomNameplatePic.length > 0) {
|
||||
[attribute appendAttributedString:[self createUrlImageAttribute:extModel.inRoomNameplatePic]];
|
||||
[attribute appendAttributedString:[self createSapceAttribute:2]];
|
||||
}
|
||||
}else{
|
||||
if (extModel.inRoomNameplatePic.length > 0 && extModel.inRoomNameplateWord.length > 0) {
|
||||
[attribute appendAttributedString:[self createNameplateAttibute:extModel.inRoomNameplateWord image:extModel.inRoomNameplatePic textFont:[UIFont systemFontOfSize:9]]];
|
||||
[attribute appendAttributedString:[self createSapceAttribute:2]];
|
||||
}
|
||||
}
|
||||
|
||||
[attribute appendAttributedString:[self createNickAtrribute:nick uid:message.from.integerValue]];
|
||||
if (extModel.carName.length > 0) {
|
||||
[attribute appendAttributedString:[self createTextAttribute:YMLocalizedString(@"XPRoomMessageParser1") color:[DJDKMIMOMColor messageTextColor] font:kRoomMessageDefalutFont]];
|
||||
@@ -780,7 +796,7 @@
|
||||
[attribute appendAttributedString:[self createTextAttribute:YMLocalizedString(@"XPRoomMessageParser62") color:[DJDKMIMOMColor messageTextColor] font:kRoomMessageDefalutFont]];
|
||||
NSString * targetNick = datingModel.targetNickname ? datingModel.targetNickname : @"";
|
||||
[attribute appendAttributedString:[self createNickAtrribute:targetNick uid:datingModel.targetUid]];
|
||||
[attribute appendAttributedString:[self createTextAttribute:YMLocalizedString(@"XPRoomMessageParser63") color:UIColorFromRGB(0xF84C95) font:kRoomMessageDefalutFont]];
|
||||
[attribute appendAttributedString:[self createTextAttribute:YMLocalizedString(@"XPRoomMessageParser63") color:[UIColor whiteColor] font:kRoomMessageDefalutFont]];
|
||||
} else if (attachment.second == Custom_Message_Sub_Room_Play_Dating_Result_Not_Mutual) {///不是互选
|
||||
DatingInfoModel * datingModel = [DatingInfoModel modelWithDictionary:attachment.data];
|
||||
NSString * nick = datingModel.nickname ? datingModel.nickname : @"";
|
||||
|
@@ -115,6 +115,7 @@
|
||||
extModel.carName = userInfo.carName;
|
||||
extModel.inRoomNameplatePic = userInfo.nameplatePic;
|
||||
extModel.inRoomNameplateWord = userInfo.nameplateWord;
|
||||
extModel.isCustomWord = userInfo.isCustomWord;
|
||||
extModel.charmUrl = userInfo.userLevelVo.charmUrl;
|
||||
extModel.experLevelSeq = userInfo.userLevelVo.experLevelSeq;
|
||||
extModel.experUrl = userInfo.userLevelVo.experUrl;
|
||||
|
@@ -23,6 +23,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)configGiftUsers:(NSArray<XPGiftUserInfoModel *> *)users;
|
||||
///代理
|
||||
@property (nonatomic,weak) id<XPGiftUsersViewDelegate> delegate;
|
||||
|
||||
-(NSMutableArray<NSString *>*)getSelectUserList;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -175,7 +175,9 @@
|
||||
[self.collectionView reloadData];
|
||||
NSString * selectUid = [NSString stringWithFormat:@"%ld", queue.uid];
|
||||
if (queue.isSelect) {
|
||||
[self.selectUserArray addObject:selectUid];
|
||||
if (![self.selectUserArray containsObject:selectUid]) {
|
||||
[self.selectUserArray addObject:selectUid];
|
||||
}
|
||||
} else {
|
||||
if ([self.selectUserArray containsObject:selectUid]) {
|
||||
[self.selectUserArray removeObject:selectUid];
|
||||
@@ -193,6 +195,18 @@
|
||||
[self.delegate xPGiftUsersView:self didSelectUsers:self.selectUserArray];
|
||||
}
|
||||
}
|
||||
-(NSMutableArray<NSString *>*)getSelectUserList{
|
||||
NSMutableArray *userList = [NSMutableArray array];
|
||||
for (XPGiftUserInfoModel * queue in self.userArray) {
|
||||
if(queue.isSelect == YES){
|
||||
NSString * selectUid = [NSString stringWithFormat:@"%ld", queue.uid];
|
||||
if(![userList containsObject:selectUid]){
|
||||
[userList addObject:selectUid];
|
||||
}
|
||||
}
|
||||
}
|
||||
return userList;
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
- (UIStackView *)stackView {
|
||||
if (!_stackView) {
|
||||
|
@@ -360,7 +360,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
}
|
||||
|
||||
- (RoomSendGiftType)dealRoomSendGiftType:(GiftInfoModel *)giftInfo giftCount:(XPGiftCountModel *)giftCount {
|
||||
NSArray * uids = self.userView.selectUserArray;
|
||||
NSArray * uids = [self.userView getSelectUserList];
|
||||
RoomSendGiftType roomSendGiftType;
|
||||
if (self.userView.isSelectAll) {
|
||||
if (giftInfo.sourceType == GiftSourceType_Pack && giftCount.isTotal && giftInfo && uids.count > 1) {
|
||||
@@ -368,13 +368,13 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
return -1;
|
||||
}
|
||||
roomSendGiftType = RoomSendGiftType_AllMic;
|
||||
} else if(self.userView.selectUserArray.count > 1) {
|
||||
} else if(uids.count > 1) {
|
||||
if (giftInfo.sourceType == GiftSourceType_Pack && giftCount.isTotal) {
|
||||
[self showErrorToast:YMLocalizedString(@"XPSendGiftView1")];
|
||||
return -1;
|
||||
}
|
||||
roomSendGiftType = RoomSendGiftType_MutableOnMic;
|
||||
} else if(self.userView.selectUserArray.count == 1) {
|
||||
} else if(uids.count == 1) {
|
||||
roomSendGiftType = RoomSendGiftType_ToOne;
|
||||
} else {
|
||||
roomSendGiftType = -1;
|
||||
@@ -395,7 +395,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
#pragma mark - XPGiftBarViewDelegate
|
||||
- (void)xPGiftBarView:(XPGiftBarView *)view didClickSendGift:(XPGiftCountModel *)giftCount {
|
||||
///总礼物 三要素 送礼物的人 送的什么礼物 送多少个礼物
|
||||
NSArray * uids = self.userView.selectUserArray;
|
||||
NSArray * uids = [self.userView getSelectUserList];
|
||||
GiftInfoModel * giftInfo = self.giftInfoView.lastSelectGift;
|
||||
if (self.usingplaceType == SendGiftType_Room) {
|
||||
if (uids.count > 0) {
|
||||
@@ -561,7 +561,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
self.graffitiView.hidden = NO;
|
||||
self.graffitiView.price = info.goldPrice;
|
||||
self.giftBarView.drawGiftCount = 0;
|
||||
self.graffitiView.selectUidNumber = self.userView.selectUserArray.count;
|
||||
self.graffitiView.selectUidNumber = [self.userView getSelectUserList].count;
|
||||
[[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:info.giftUrl] options:SDWebImageProgressiveLoad progress:nil completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
|
||||
if (error == nil && image) {
|
||||
self.graffitiView.image = image;
|
||||
|
@@ -68,7 +68,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param completion 完成
|
||||
/// @param uid uid
|
||||
+ (void)getRoomClassifyList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid;
|
||||
|
||||
/// 获取房间在线用户
|
||||
/// @param completion 完成
|
||||
/// @param roomUid roomUid
|
||||
+(void)requestRoomOnlineUserList:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -97,5 +97,10 @@
|
||||
NSString * fang = [NSString stringFromBase64String:@"c2luZ2xlL2Jyb2FkY2FzdC9zb3J0"];///single/broadcast/sort
|
||||
[self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, nil];
|
||||
}
|
||||
|
||||
/// 获取房间在线用户
|
||||
/// @param completion 完成
|
||||
/// @param roomUid roomUid
|
||||
+(void)requestRoomOnlineUserList:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid{
|
||||
[self makeRequest:@"room/v2/online" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, roomUid, nil];
|
||||
}
|
||||
@end
|
||||
|
@@ -58,6 +58,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
type:(RoomType)type
|
||||
itemType:(RoomSettingItemType)itemType
|
||||
mgId:(NSString *)mgId;
|
||||
/// 获取房间在线用户
|
||||
/// @param roomUid roomUid
|
||||
-(void)getRoomOnlineUserListWithRoomUid:(NSString *)roomUid;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -17,7 +17,7 @@
|
||||
#import "RoomInfoModel.h"
|
||||
///P
|
||||
#import "XPRoomSettingProtocol.h"
|
||||
|
||||
#import "XPMessageRemoteExtModel.h"
|
||||
@implementation XPRoomSettingPresenter
|
||||
|
||||
- (void)getRoomSettingList:(RoomInfoModel *)roomInfo isSuperAdmin:(BOOL)isSuperAdmin {
|
||||
@@ -349,5 +349,14 @@
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
/// 获取房间在线用户
|
||||
/// @param roomUid roomUid
|
||||
-(void)getRoomOnlineUserListWithRoomUid:(NSString *)roomUid{
|
||||
[Api requestRoomOnlineUserList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
NSArray *list = [XPMessageRemoteExtModel modelsWithArray:data.data];
|
||||
[[self getView]getRoomOnlineUserListSuccess:list];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
|
||||
}] roomUid:roomUid];
|
||||
}
|
||||
@end
|
||||
|
@@ -11,7 +11,7 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class RoomInfoModel;
|
||||
@protocol XPRoomSettingProtocol <NSObject>
|
||||
|
||||
@optional
|
||||
///房间设置的列表数据
|
||||
- (void)getRoomSettingListSuccess:(NSArray *)list;
|
||||
///获取房间信息成功
|
||||
@@ -30,6 +30,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)updateRoomInfoSuccess:(RoomInfoModel *)roomInfo itemType:(RoomSettingItemType)itemType;
|
||||
///更新房间信息失败
|
||||
- (void)updateRoomInfoFail:(NSString *)message;
|
||||
//获取房间在线用户成功
|
||||
-(void)getRoomOnlineUserListSuccess:(NSArray *)list;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -6,7 +6,7 @@
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "XPMessageRemoteExtModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class NIMChatroomMember;
|
||||
typedef NS_ENUM(NSInteger, RoomOnLineType) {
|
||||
@@ -21,6 +21,7 @@ typedef NS_ENUM(NSInteger, RoomOnLineType) {
|
||||
@property (nonatomic,assign) RoomOnLineType onlineType;
|
||||
///云信用户实体
|
||||
@property (strong, nonatomic) NIMChatroomMember *member;
|
||||
@property(nonatomic,strong) XPMessageRemoteExtModel *userInfo;
|
||||
///是否在麦序上
|
||||
@property (nonatomic,assign) BOOL isOnMicro;
|
||||
@end
|
||||
|
@@ -138,7 +138,7 @@
|
||||
[self.onMicroStatusLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.contentView);
|
||||
make.right.mas_equalTo(-15);
|
||||
make.width.mas_equalTo(32);
|
||||
make.width.mas_equalTo(40);
|
||||
make.height.mas_equalTo(14);
|
||||
}];
|
||||
[self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -149,6 +149,67 @@
|
||||
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setUserInfo:(XPMessageRemoteExtModel *)userInfo{
|
||||
_userInfo = userInfo;
|
||||
|
||||
self.sexImageView.backgroundColor = userInfo.gender == GenderType_Male ? UIColorFromRGB(0x6BB3FF) :UIColorFromRGB(0xFF80CC);
|
||||
self.sexImageView.titleEdgeInsets = userInfo.gender != GenderType_Male ? UIEdgeInsetsMake(0, 2, 0, 0):UIEdgeInsetsMake(0, -1, 0, 0);
|
||||
self.sexImageView.selected = userInfo.gender != GenderType_Male;
|
||||
|
||||
|
||||
|
||||
if (userInfo.userLevelVo.experUrl) {
|
||||
self.experImageView.imageUrl = userInfo.userLevelVo.experUrl;
|
||||
}
|
||||
self.experImageView.hidden = userInfo.userLevelVo.experUrl.length <= 0;
|
||||
|
||||
if (userInfo.userLevelVo.charmUrl) {
|
||||
self.charmImageView.imageUrl = userInfo.userLevelVo.charmUrl;
|
||||
}
|
||||
self.charmImageView.hidden = userInfo.userLevelVo.charmUrl.length <= 0;
|
||||
if(userInfo.isCustomWord == YES){
|
||||
if (userInfo.nameplatePic.length > 0){
|
||||
self.nameplateImageView.imageUrl = userInfo.nameplatePic;
|
||||
}
|
||||
}else{
|
||||
if (userInfo.nameplatePic.length>0 && userInfo.nameplateWord.length>0) {
|
||||
self.nameplateImageView.imageUrl = userInfo.nameplatePic;
|
||||
self.nameplateLabel.text = userInfo.nameplateWord;
|
||||
self.namePlateView.hidden = NO;
|
||||
} else {
|
||||
self.namePlateView.hidden = YES;
|
||||
}
|
||||
}
|
||||
self.roleButton.hidden = YES;
|
||||
if ([userInfo.memberType isEqualToString:@"CREATOR"] || [userInfo.memberType isEqualToString:@"MANAGER"]) {
|
||||
|
||||
if ([userInfo.memberType isEqualToString:@"CREATOR"]) {
|
||||
self.roleButton.hidden = NO;
|
||||
[self.roleButton setBackgroundColor:[DJDKMIMOMColor appEmphasizeColor2]];
|
||||
[self.roleButton setTitle:YMLocalizedString(@"XPRoomOnlineTableViewCell0") forState:UIControlStateNormal];
|
||||
} else if([userInfo.memberType isEqualToString:@"MANAGER"]) {
|
||||
self.roleButton.hidden = NO;
|
||||
[self.roleButton setBackgroundColor:[DJDKMIMOMColor appEmphasizeColor]];
|
||||
[self.roleButton setTitle:YMLocalizedString(@"XPRoomOnlineTableViewCell1") forState:UIControlStateNormal];
|
||||
}
|
||||
}
|
||||
if(self.roleButton.hidden == NO){
|
||||
|
||||
}
|
||||
self.isOnMicro = userInfo.inMic;
|
||||
if (userInfo.userVipInfoVO.enterHide == YES) {
|
||||
self.nickLabel.text = YMLocalizedString(@"XPRoomOnlineTableViewCell2");
|
||||
self.avatarImageView.image = [UIImage imageNamed:@"room_secretMan"];
|
||||
self.sexImageView.hidden = YES;
|
||||
self.tagStackView.hidden = YES;
|
||||
self.isOnMicro = NO;
|
||||
} else {
|
||||
self.avatarImageView.imageUrl = userInfo.avatar;
|
||||
self.nickLabel.text = userInfo.nick;
|
||||
self.sexImageView.hidden = NO;
|
||||
}
|
||||
|
||||
}
|
||||
- (void)setMember:(NIMChatroomMember *)member {
|
||||
_member = member;
|
||||
if (_member) {
|
||||
@@ -167,27 +228,33 @@
|
||||
self.sexImageView.titleEdgeInsets = user.userInfo.gender != GenderType_Male ? UIEdgeInsetsMake(0, 2, 0, 0):UIEdgeInsetsMake(0, -1, 0, 0);
|
||||
self.sexImageView.selected = user.userInfo.gender != GenderType_Male;
|
||||
}
|
||||
if (userInfo.experUrl) {
|
||||
self.experImageView.imageUrl = userInfo.experUrl;
|
||||
}
|
||||
self.experImageView.hidden = userInfo.experUrl.length <= 0;
|
||||
|
||||
if (userInfo.charmUrl) {
|
||||
self.charmImageView.imageUrl = userInfo.charmUrl;
|
||||
}
|
||||
self.charmImageView.hidden = userInfo.charmUrl.length <= 0;
|
||||
if(userInfo.isCustomWord == YES){
|
||||
if (userInfo.inRoomNameplatePic.length>0) {
|
||||
self.nameplateImageView.imageUrl = userInfo.inRoomNameplatePic;
|
||||
self.namePlateView.hidden = NO;
|
||||
} else {
|
||||
self.namePlateView.hidden = YES;
|
||||
}
|
||||
}else{
|
||||
if (userInfo.inRoomNameplatePic.length>0 && userInfo.inRoomNameplateWord.length>0) {
|
||||
self.nameplateImageView.imageUrl = userInfo.inRoomNameplatePic;
|
||||
self.nameplateLabel.text = userInfo.inRoomNameplateWord;
|
||||
self.namePlateView.hidden = NO;
|
||||
} else {
|
||||
self.namePlateView.hidden = YES;
|
||||
}
|
||||
}
|
||||
self.roleButton.hidden = YES;
|
||||
if (extDic.allKeys.count > 0 || (member.type == NIMTeamMemberTypeOwner || member.type == NIMChatroomMemberTypeManager)) {
|
||||
self.tagStackView.hidden = NO;
|
||||
|
||||
if (userInfo.experUrl) {
|
||||
self.experImageView.imageUrl = userInfo.experUrl;
|
||||
}
|
||||
self.experImageView.hidden = userInfo.experUrl.length <= 0;
|
||||
|
||||
if (userInfo.charmUrl) {
|
||||
self.charmImageView.imageUrl = userInfo.charmUrl;
|
||||
}
|
||||
self.charmImageView.hidden = userInfo.charmUrl.length <= 0;
|
||||
|
||||
if (userInfo.inRoomNameplatePic.length>0 && userInfo.inRoomNameplateWord.length>0) {
|
||||
self.nameplateImageView.imageUrl = userInfo.inRoomNameplatePic;
|
||||
self.nameplateLabel.text = userInfo.inRoomNameplateWord;
|
||||
self.namePlateView.hidden = NO;
|
||||
} else {
|
||||
self.namePlateView.hidden = YES;
|
||||
}
|
||||
|
||||
if (_member.type == NIMTeamMemberTypeOwner) {
|
||||
self.roleButton.hidden = NO;
|
||||
[self.roleButton setBackgroundColor:[DJDKMIMOMColor appEmphasizeColor2]];
|
||||
@@ -196,12 +263,9 @@
|
||||
self.roleButton.hidden = NO;
|
||||
[self.roleButton setBackgroundColor:[DJDKMIMOMColor appEmphasizeColor]];
|
||||
[self.roleButton setTitle:YMLocalizedString(@"XPRoomOnlineTableViewCell1") forState:UIControlStateNormal];
|
||||
} else {
|
||||
self.roleButton.hidden = YES;
|
||||
}
|
||||
} else {
|
||||
self.tagStackView.hidden = YES;
|
||||
}
|
||||
|
||||
if (userInfo.enterHide) {
|
||||
self.nickLabel.text = YMLocalizedString(@"XPRoomOnlineTableViewCell2");
|
||||
self.avatarImageView.image = [UIImage imageNamed:@"room_secretMan"];
|
||||
|
@@ -5,11 +5,11 @@
|
||||
// Created by YUMI on 2021/12/29.
|
||||
//
|
||||
|
||||
#import "BaseViewController.h"
|
||||
#import "MvpViewController.h"
|
||||
#import "RoomHostDelegate.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPRoomOnLineViewController : BaseViewController
|
||||
@interface XPRoomOnLineViewController : MvpViewController
|
||||
|
||||
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate;
|
||||
@end
|
||||
|
@@ -27,8 +27,9 @@
|
||||
#import "XPRoomRoleEmptyTableViewCell.h"
|
||||
///VC
|
||||
#import "XPUserCardViewController.h"
|
||||
|
||||
@interface XPRoomOnLineViewController ()<UITableViewDelegate, UITableViewDataSource, NIMChatManagerDelegate>
|
||||
#import "XPRoomSettingPresenter.h"
|
||||
#import "XPRoomSettingProtocol.h"
|
||||
@interface XPRoomOnLineViewController ()<XPUserCardViewControllerDelegate,UITableViewDelegate, UITableViewDataSource, NIMChatManagerDelegate,XPRoomSettingProtocol>
|
||||
///导航栏
|
||||
@property (nonatomic,strong) UIView * navView;
|
||||
///返回按钮
|
||||
@@ -37,33 +38,28 @@
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
///背景图
|
||||
@property (nonatomic,strong) UIImageView *backImageView;
|
||||
///总的数据
|
||||
@property (nonatomic,strong) NSMutableArray *originArray;
|
||||
///需要显示的数据
|
||||
@property (nonatomic,strong) NSMutableArray *datasource;
|
||||
///列表
|
||||
@property (nonatomic,strong) UITableView *tableView;
|
||||
///最后一个
|
||||
@property (nonatomic,strong) NIMChatroomMember *lastMember;
|
||||
///临时成员最后一个
|
||||
@property (nonatomic,strong) NIMChatroomMember *tmpLastMember;
|
||||
///host
|
||||
@property (nonatomic,weak) id<RoomHostDelegate>hostDelegate;
|
||||
///房间的id
|
||||
@property (nonatomic,copy) NSString *roomId;
|
||||
///是否正在刷新
|
||||
@property (nonatomic, assign) BOOL refreshing;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPRoomOnLineViewController
|
||||
- (void)dealloc {
|
||||
[[NIMSDK sharedSDK].chatManager removeDelegate:self];
|
||||
}
|
||||
|
||||
- (XPRoomSettingPresenter *)createPresenter {
|
||||
return [[XPRoomSettingPresenter alloc] init];
|
||||
}
|
||||
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate {
|
||||
if (self = [super init]) {
|
||||
self.hostDelegate = delegate;
|
||||
self.roomId= [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.roomId];
|
||||
self.roomId= [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -81,9 +77,9 @@
|
||||
[super viewDidLoad];
|
||||
//监听云信消息
|
||||
[[NIMSDK sharedSDK].chatManager addDelegate:self];
|
||||
[self initHeaderAndFooterRrfresh];
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
[self refreshData];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
@@ -123,164 +119,19 @@
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)initHeaderAndFooterRrfresh {
|
||||
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)];
|
||||
header.stateLabel.font = [UIFont systemFontOfSize:10.0];
|
||||
header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0];
|
||||
header.stateLabel.textColor = [DJDKMIMOMColor secondTextColor];
|
||||
header.lastUpdatedTimeLabel.textColor = [DJDKMIMOMColor secondTextColor];
|
||||
self.tableView.mj_header = header;
|
||||
|
||||
MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRefresh)];
|
||||
footer.stateLabel.textColor = [DJDKMIMOMColor secondTextColor];
|
||||
footer.stateLabel.font = [UIFont systemFontOfSize:10.0];
|
||||
self.tableView.mj_footer = footer;
|
||||
|
||||
[self headerRefresh];
|
||||
- (void)refreshData {
|
||||
[self.presenter getRoomOnlineUserListWithRoomUid:self.roomId];
|
||||
}
|
||||
|
||||
- (void)headerRefresh {
|
||||
if (self.refreshing) {
|
||||
return;
|
||||
}
|
||||
self.refreshing = YES;
|
||||
self.lastMember= nil;
|
||||
self.tmpLastMember = nil;
|
||||
[self.datasource removeAllObjects];
|
||||
[[self loadChatRoomRegularMemberList] subscribeNext:^(id _Nullable x) {
|
||||
NSArray * regularList = x;
|
||||
[regularList enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
NIMChatroomMember * member = obj;
|
||||
if (member.type == NIMTeamMemberTypeOwner) {
|
||||
[self.datasource insertObject:member atIndex:0];
|
||||
}else {
|
||||
[self.datasource addObject:member];
|
||||
}
|
||||
}];
|
||||
|
||||
[[self loadChatRoomTmpMemberList] subscribeNext:^(id _Nullable x) {
|
||||
NSArray * tmpList = x;
|
||||
|
||||
[self.datasource addObjectsFromArray:tmpList];
|
||||
[self.tableView reloadData];
|
||||
self.refreshing = NO;
|
||||
}];
|
||||
|
||||
}];
|
||||
|
||||
|
||||
//获取房间在线用户成功
|
||||
-(void)getRoomOnlineUserListSuccess:(NSArray *)list{
|
||||
self.datasource = [NSMutableArray arrayWithArray:list];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
- (void)footerRefresh {
|
||||
if (self.refreshing) {
|
||||
return;
|
||||
}
|
||||
self.refreshing = YES;
|
||||
[[self loadChatRoomRegularMemberList] subscribeNext:^(id _Nullable x) {
|
||||
NSArray * regularList = x;
|
||||
[regularList enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
NIMChatroomMember * member = obj;
|
||||
if (member.type == NIMTeamMemberTypeOwner) {
|
||||
[self.datasource insertObject:member atIndex:0];
|
||||
}else {
|
||||
[self.datasource addObject:member];
|
||||
}
|
||||
}];
|
||||
|
||||
[[self loadChatRoomTmpMemberList] subscribeNext:^(id _Nullable x) {
|
||||
NSArray * tmpList = x;
|
||||
[tmpList enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
[self.datasource addObject:obj];
|
||||
}];
|
||||
[self.tableView reloadData];
|
||||
self.refreshing = NO;
|
||||
}];
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
- (RACSignal *)loadChatRoomRegularMemberList {
|
||||
return [RACSignal createSignal:^RACDisposable * _Nullable(id<RACSubscriber> _Nonnull subscriber) {
|
||||
NIMChatroomMemberRequest *request = [[NIMChatroomMemberRequest alloc] init];
|
||||
request.roomId = self.roomId;
|
||||
request.type = NIMChatroomFetchMemberTypeRegular;
|
||||
request.lastMember = self.lastMember;
|
||||
request.limit = 200;
|
||||
[[NIMSDK sharedSDK].chatroomManager fetchChatroomMembers:request completion:^(NSError * _Nullable error, NSArray<NIMChatroomMember *> * _Nullable members) {
|
||||
if (error == nil) {
|
||||
if (members.count > 0) {
|
||||
self.lastMember = members.lastObject;
|
||||
}
|
||||
NSMutableArray * array = [NSMutableArray array];
|
||||
[members enumerateObjectsUsingBlock:^(NIMChatroomMember * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (obj.isOnline && !obj.isInBlackList) {
|
||||
[array addObject:obj];
|
||||
}
|
||||
}];
|
||||
[subscriber sendNext:array];
|
||||
[subscriber sendCompleted];
|
||||
} else {
|
||||
[subscriber sendNext:nil];
|
||||
[subscriber sendCompleted];
|
||||
}
|
||||
}];
|
||||
return nil;
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (RACSignal *)loadChatRoomTmpMemberList {
|
||||
return [RACSignal createSignal:^RACDisposable * _Nullable(id<RACSubscriber> _Nonnull subscriber) {
|
||||
NIMChatroomMemberRequest *request = [[NIMChatroomMemberRequest alloc] init];
|
||||
request.roomId = self.roomId;
|
||||
request.type = NIMChatroomFetchMemberTypeTemp;
|
||||
request.lastMember = self.tmpLastMember;
|
||||
request.limit = 20;
|
||||
[[NIMSDK sharedSDK].chatroomManager fetchChatroomMembers:request completion:^(NSError * _Nullable error, NSArray<NIMChatroomMember *> * _Nullable members) {
|
||||
[self.tableView.mj_header endRefreshing];
|
||||
[self.tableView.mj_footer endRefreshing];
|
||||
if (error == nil) {
|
||||
if (members.count > 0) {
|
||||
self.tmpLastMember = members.lastObject;
|
||||
}
|
||||
NSMutableArray * array = [NSMutableArray array];
|
||||
[members enumerateObjectsUsingBlock:^(NIMChatroomMember * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
BOOL isSuperAmind = NO;
|
||||
if (obj.roomExt.length > 0) {
|
||||
NSData *jsonData = [obj.roomExt dataUsingEncoding:NSUTF8StringEncoding];
|
||||
NSError *error;
|
||||
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&error];
|
||||
XPMessageRemoteExtModel * model = [XPMessageRemoteExtModel modelWithDictionary:[dic objectForKey:obj.userId]];
|
||||
isSuperAmind = model.platformRole == 1;
|
||||
}
|
||||
|
||||
if (obj.isOnline && !obj.isInBlackList && !isSuperAmind) {
|
||||
[array addObject:obj];
|
||||
}
|
||||
}];
|
||||
[subscriber sendNext:array];
|
||||
[subscriber sendCompleted];
|
||||
} else {
|
||||
[subscriber sendNext:nil];
|
||||
[subscriber sendCompleted];
|
||||
}
|
||||
}];
|
||||
return nil;
|
||||
}];
|
||||
}
|
||||
|
||||
///判断是否在麦上
|
||||
- (BOOL)memberIsOnMicro:(NSString *)userId{
|
||||
NSArray *chatRoomMicSequences = [self.hostDelegate.getMicroQueue allValues] ;
|
||||
if (chatRoomMicSequences != nil && chatRoomMicSequences.count > 0) {
|
||||
for (int i = 0; i < chatRoomMicSequences.count; i ++) {
|
||||
MicroQueueModel *chatRoomMicSequence = chatRoomMicSequences[i];
|
||||
if (chatRoomMicSequence.userInfo.uid == userId.integerValue) {
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
#pragma mark - NIMChatManagerDelegate
|
||||
- (void)onRecvMessages:(NSArray<NIMMessage *> *)messages {
|
||||
@@ -306,7 +157,7 @@
|
||||
case NIMChatroomEventTypeRemoveBlack:
|
||||
case NIMChatroomEventTypeQueueChange:
|
||||
case NIMChatroomEventTypeKicked:
|
||||
[self headerRefresh];
|
||||
[self refreshData];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -328,9 +179,8 @@
|
||||
if (cell == nil) {
|
||||
cell = [[XPRoomOnlineTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPRoomOnlineTableViewCell class])];
|
||||
}
|
||||
NIMChatroomMember * member = [self.datasource safeObjectAtIndex1:indexPath.row];
|
||||
cell.isOnMicro = [self memberIsOnMicro:member.userId];
|
||||
cell.member = member;
|
||||
XPMessageRemoteExtModel * member = [self.datasource safeObjectAtIndex1:indexPath.row];
|
||||
cell.userInfo = member;
|
||||
return cell;
|
||||
}
|
||||
|
||||
@@ -353,14 +203,12 @@
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
if (self.datasource.count > 0) {
|
||||
NIMChatroomMember * member = [self.datasource safeObjectAtIndex1:indexPath.row];
|
||||
NSDictionary * extDic = [member.roomExt toJSONObject];
|
||||
XPMessageRemoteExtModel * userInfo = [XPMessageRemoteExtModel modelWithDictionary:[extDic objectForKey:member.userId]];
|
||||
XPMessageRemoteExtModel * userInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
|
||||
if (userInfo.enterHide) {
|
||||
return;
|
||||
}
|
||||
RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo;
|
||||
NSString * targetUid = member.userId;
|
||||
NSString * targetUid = userInfo.uid;
|
||||
XPUserCardInfoModel * model = [[XPUserCardInfoModel alloc] init];
|
||||
[[self.hostDelegate.getMicroQueue allValues] enumerateObjectsUsingBlock:^(MicroQueueModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (targetUid.integerValue == obj.userInfo.uid) {
|
||||
@@ -378,11 +226,15 @@
|
||||
model.micQueue = self.hostDelegate.getMicroQueue;
|
||||
model.hideSendGiftItem = YES;
|
||||
XPUserCardViewController * userCardVC = [[XPUserCardViewController alloc] initWithUser:model];
|
||||
userCardVC.delegate = self;
|
||||
[self.navigationController presentViewController:userCardVC animated:YES completion:nil];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#pragma mark- XPUserCardViewControllerDelegate
|
||||
-(void)clickChatAction{
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
#pragma mark - Event Response
|
||||
- (void)backButtonAction:(UIButton *)sender {
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
|
@@ -83,7 +83,7 @@
|
||||
} else {
|
||||
if (position == -1) {
|
||||
self.postionLabel.hidden = YES;
|
||||
self.sexImageView.hidden = NO;
|
||||
self.sexImageView.hidden = YES;
|
||||
} else {
|
||||
self.postionLabel.hidden = NO;
|
||||
self.sexImageView.hidden = YES;
|
||||
@@ -146,8 +146,13 @@
|
||||
|
||||
self.pickButton.hidden = YES;
|
||||
if (position == -1) {return;}
|
||||
|
||||
///相亲进行的阶段
|
||||
if (roomInfo.blindDateState == RoomPlayDateingType_Pick) {
|
||||
if (userInfo) {
|
||||
self.pickButton.hidden = NO;
|
||||
[self configPickTitle:@"未选择" backmImageName:@"room_mode_dating_not_select"];
|
||||
}
|
||||
///如果我是主持的话 主持人视角 可以看到麦上用户的选择情况,精准到选择对象
|
||||
MicroQueueModel * presideModel = [self.getMicroQueue objectForKey:@"-1"];
|
||||
if (presideModel.userInfo && presideModel.userInfo.uid == [AccountInfoStorage instance].getUid.integerValue) {
|
||||
|
@@ -196,7 +196,44 @@
|
||||
[[NIMSDK sharedSDK].chatroomManager updateChatroomQueueObject:request completion:^(NSError * _Nullable error) {
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)updateNIMMicroQueues{
|
||||
RoomInfoModel* roomInfo = self.hostDelegate.getRoomInfo;
|
||||
// 获取麦位的状态,并初始化 self.micQueue 。
|
||||
[[NIMSDK sharedSDK].chatroomManager fetchChatroomInfo:[NSString stringWithFormat:@"%ld", (long)roomInfo.roomId] completion:^(NSError * _Nullable error, NIMChatroom * _Nullable chatroom) {
|
||||
if (error) {
|
||||
return;
|
||||
}
|
||||
NSDictionary *info = (NSDictionary *)[chatroom.ext toJSONObject];
|
||||
NSDictionary *micState = [info[@"micQueue"] toJSONObject];
|
||||
for (NSString *position in micState.allKeys) {
|
||||
MicroStateModel *state = [MicroStateModel modelWithJSON:micState[position]];
|
||||
MicroQueueModel *sequence = [self.micQueue objectForKey:position];
|
||||
sequence.microState = state;
|
||||
}
|
||||
[self microQueueUpdated: NO];
|
||||
}];
|
||||
self.hadGetQueueInfoSuccess = NO;
|
||||
// 获取麦位的用户,并初始化 self.micQueue 。
|
||||
[[NIMSDK sharedSDK].chatroomManager fetchChatroomQueue:[NSString stringWithFormat:@"%ld", (long)roomInfo.roomId] completion:^(NSError * _Nullable error, NSArray<NSDictionary<NSString *,NSString *> *> * _Nullable info) {
|
||||
if (error) return;
|
||||
BOOL ownerRTCChange = NO;
|
||||
|
||||
for (NSDictionary *item in info) {
|
||||
UserInfoModel *userInfo = [UserInfoModel modelWithJSON:item.allValues.firstObject];
|
||||
NSString *position = item.allKeys.firstObject;
|
||||
MicroQueueModel *sequence = [self.micQueue objectForKey:position];
|
||||
sequence.userInfo = userInfo;
|
||||
if (userInfo.uid == [AccountInfoStorage instance].getUid.integerValue) {
|
||||
ownerRTCChange = YES;
|
||||
}
|
||||
}
|
||||
[self microQueueUpdated:ownerRTCChange];
|
||||
[self.hostDelegate onMicroQueueUpdate:self.micQueue];
|
||||
self.hadGetQueueInfoSuccess = YES;
|
||||
|
||||
}];
|
||||
|
||||
}
|
||||
- (void)initGiftValue{
|
||||
RoomInfoModel* roomInfo = self.hostDelegate.getRoomInfo;
|
||||
// 获取礼物值
|
||||
@@ -402,8 +439,14 @@
|
||||
[view resetGiftValue];
|
||||
}
|
||||
}
|
||||
|
||||
// [self microQueueUpdated];
|
||||
if (self.hostDelegate.getRoomInfo.roomModeType == RoomModeType_Open_Blind && self.hostDelegate.getRoomInfo.blindDateState == RoomPlayDateingType_Pick) {
|
||||
for (int i = 0; i < self.countOfMircoView; i++) {
|
||||
MicroQueueModel * model = [self.micQueue objectForKey:[self indexToPosition:i]];
|
||||
UIView<MicroViewProtocol> * view = [self findMicroViewByIndex:i];
|
||||
[view configRoomInfo:roomInfo];
|
||||
[view configMicroView:model];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)handleNIMNotificationMessage:(NIMMessage *)message {
|
||||
@@ -502,8 +545,10 @@
|
||||
for (MicroQueueModel *sequence in self.micQueue.allValues) {
|
||||
if ([AccountInfoStorage instance].getUid.integerValue == sequence.userInfo.uid) {
|
||||
NIMChatroomQueueUpdateRequest *request = [[NIMChatroomQueueUpdateRequest alloc]init];
|
||||
NSMutableDictionary *userInfo = [[NSMutableDictionary alloc]initWithDictionary:[sequence.userInfo toJSONObject]];
|
||||
[userInfo setValue:@(YES) forKey:@"isNoProhibitMic"];
|
||||
request.key = @(sequence.microState.position).stringValue;
|
||||
request.value = [sequence.userInfo toJSONString];
|
||||
request.value = [userInfo toJSONString];
|
||||
request.roomId = roomId;
|
||||
request.transient = YES;
|
||||
[[NIMSDK sharedSDK].chatroomManager updateChatroomQueueObject:request completion:^(NSError * _Nullable error) {
|
||||
@@ -513,7 +558,7 @@
|
||||
}
|
||||
}
|
||||
if (content.source.userId.integerValue == [AccountInfoStorage instance].getUid.integerValue){
|
||||
[self initNIMMicroQueues];
|
||||
[self updateNIMMicroQueues];
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -10,7 +10,14 @@
|
||||
#import "XPUserCardInfoModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol XPUserCardViewControllerDelegate <NSObject>
|
||||
|
||||
-(void)clickChatAction;
|
||||
|
||||
@end
|
||||
|
||||
@interface XPUserCardViewController : MvpViewController
|
||||
@property(nonatomic,weak) id<XPUserCardViewControllerDelegate>delegate;
|
||||
- (instancetype)initWithUser:(XPUserCardInfoModel *)cardInfo;
|
||||
|
||||
@end
|
||||
|
@@ -574,13 +574,23 @@
|
||||
}
|
||||
self.charmImageView.hidden = userInfo.userLevelVo.charmUrl.length <= 0;
|
||||
self.copysIdImageView.hidden = NO;
|
||||
if (userInfo.nameplateWord.length>0 && userInfo.nameplatePic.length>0) {
|
||||
self.nameplateImageView.imageUrl = userInfo.nameplatePic;
|
||||
self.nameplateLabel.text = userInfo.nameplateWord;
|
||||
self.namePlateView.hidden = NO;
|
||||
} else {
|
||||
self.namePlateView.hidden = YES;
|
||||
}
|
||||
if(userInfo.isCustomWord == YES){
|
||||
if ( userInfo.nameplatePic.length>0) {
|
||||
self.nameplateImageView.imageUrl = userInfo.nameplatePic;
|
||||
self.namePlateView.hidden = NO;
|
||||
} else {
|
||||
self.namePlateView.hidden = YES;
|
||||
}
|
||||
}else{
|
||||
if (userInfo.nameplateWord.length>0 && userInfo.nameplatePic.length>0) {
|
||||
self.nameplateImageView.imageUrl = userInfo.nameplatePic;
|
||||
self.nameplateLabel.text = userInfo.nameplateWord;
|
||||
self.namePlateView.hidden = NO;
|
||||
} else {
|
||||
self.namePlateView.hidden = YES;
|
||||
}
|
||||
}
|
||||
|
||||
self.idLabel.text = [NSString stringWithFormat:@"ID:%ld", userInfo.erbanNo];
|
||||
|
||||
NSString * headwearUrl= userInfo.headwearEffect.length > 0 ? userInfo.headwearEffect : userInfo.headwearPic;
|
||||
@@ -771,6 +781,9 @@
|
||||
case UserCardItemType_Chat:
|
||||
{
|
||||
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventroom_mike_click eventAttributes:@{@"actionType" : @"chat"}];
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(clickChatAction)]){
|
||||
[self.delegate clickChatAction];
|
||||
}
|
||||
[self dismissViewControllerAnimated:YES completion:^{
|
||||
UIViewController * controller = (UIViewController *)self.cardInfo.delegate;
|
||||
XPRoomHalfMessageView *halfMessageView = [[XPRoomHalfMessageView alloc] initWithFrame:CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight) controller:controller];
|
||||
@@ -960,6 +973,9 @@
|
||||
break;
|
||||
case UserCardItemType_AtUser:
|
||||
{
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(clickChatAction)]){
|
||||
[self.delegate clickChatAction];
|
||||
}
|
||||
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventroom_mike_click eventAttributes:@{@"actionType" : @"atUser"}];
|
||||
if (self.cardInfo.roomInfo.isCloseScreen) {
|
||||
[self showErrorToast:YMLocalizedString(@"XPUserCardViewController16")];
|
||||
|
@@ -433,7 +433,7 @@
|
||||
- (void)createBigPrizeAnimation:(PIBaseAnimationViewModel *)prizeModel {
|
||||
self.isPlayOfB = YES;
|
||||
CGFloat top = self.isPlayOfA == YES ? (self.broadCastHieght + statusbarHeight) : (kNavigationHeight + 15);
|
||||
XPRoomLuckyBigPrizeView * luckyGiftEffectView = [[XPRoomLuckyBigPrizeView alloc] initWithFrame:CGRectMake(KScreenWidth, top, 375, 60)];
|
||||
XPRoomLuckyBigPrizeView * luckyGiftEffectView = [[XPRoomLuckyBigPrizeView alloc] initWithFrame:CGRectMake(KScreenWidth, top, 375, 71)];
|
||||
luckyGiftEffectView.delegate = self;
|
||||
[kWindow addSubview:luckyGiftEffectView];
|
||||
|
||||
@@ -444,36 +444,51 @@
|
||||
springAnimation.springBounciness = 10.f;
|
||||
springAnimation.fromValue = [NSValue valueWithCGPoint:luckyGiftEffectView.center];
|
||||
springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(KScreenWidth / 2, luckyGiftEffectView.center.y)];
|
||||
[springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
|
||||
if (finished) {
|
||||
POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter];
|
||||
moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(KScreenWidth / 2, luckyGiftEffectView.center.y)];
|
||||
moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth, luckyGiftEffectView.center.y)];
|
||||
moveAnimation.beginTime = CACurrentMediaTime() + 3;
|
||||
moveAnimation.duration = 0.5;
|
||||
moveAnimation.repeatCount = 1;
|
||||
moveAnimation.removedOnCompletion = YES;
|
||||
[moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 7 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
|
||||
POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter];
|
||||
moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, luckyGiftEffectView.center.y)];
|
||||
moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2, luckyGiftEffectView.center.y)];
|
||||
moveAnimation.beginTime = CACurrentMediaTime();
|
||||
moveAnimation.duration = 0.5;
|
||||
moveAnimation.repeatCount = 1;
|
||||
moveAnimation.removedOnCompletion = YES;
|
||||
@kWeakify(self);
|
||||
[moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
|
||||
@kStrongify(self);
|
||||
if (finished) {
|
||||
[luckyGiftEffectView removeFromSuperview];
|
||||
|
||||
if (self.animationListB.count > 0) {
|
||||
[self.animationListB removeObjectAtIndex:0];
|
||||
}
|
||||
self.isPlayOfB = NO;
|
||||
// if(self.isAnimationListAFinish == YES){
|
||||
// self.isAnimationListAFinish = NO;
|
||||
// [self playAnimationWithModel];
|
||||
// return;
|
||||
// }
|
||||
// if(self.isAnimationListAFinish == YES){
|
||||
// self.isAnimationListAFinish = NO;
|
||||
// [self playAnimationWithModel];
|
||||
// return;
|
||||
// }
|
||||
[self playAnimationWithModel];
|
||||
|
||||
}];
|
||||
[luckyGiftEffectView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"];
|
||||
}
|
||||
}];
|
||||
}
|
||||
}];
|
||||
[luckyGiftEffectView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"];
|
||||
|
||||
|
||||
});
|
||||
[luckyGiftEffectView pop_addAnimation:springAnimation forKey:@"nobleLevelUpspingOutAnimation"];
|
||||
}
|
||||
#pragma mark - XPRoomLuckyBigPrizeViewDelegate
|
||||
- (void)xPRoomLuckyBigPrizeView:(XPRoomLuckyBigPrizeView *)view luckyGiftInfo:(PIBaseAnimationViewModel *)giftInfo {
|
||||
|
||||
id isShowBroadcastView = [[NSUserDefaults standardUserDefaults]valueForKey:@"kSaveLuckSelectState"];
|
||||
if(isShowBroadcastView == nil){
|
||||
PIRoomGiftBroadcastWindow *broadcastView = [[PIRoomGiftBroadcastWindow alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
|
||||
broadcastView.isLuck = YES;
|
||||
broadcastView.roodUid = giftInfo.roomUid;
|
||||
broadcastView.roomName = giftInfo.roomTitle;
|
||||
broadcastView.delegate = self;
|
||||
[kWindow addSubview:broadcastView];
|
||||
return;
|
||||
}
|
||||
if (!giftInfo.isInRoomVisiable && giftInfo.roomUid.length > 0 ) {
|
||||
[XPRoomViewController openRoom:giftInfo.roomUid viewController:[XCCurrentVCStackManager shareManager].getCurrentVC];
|
||||
}
|
||||
|
@@ -171,9 +171,10 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showNewUserRecharge) name:kNewUserRechargeKey object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showAnchorCardKey:) name:kTabShowAnchorCardKey object:nil];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
BIN
YuMi/Resources/pi_room_lucky_gift.svga
Normal file
@@ -70,6 +70,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic, copy) NSString *nameplatePic;
|
||||
///铭牌名称
|
||||
@property (nonatomic, copy) NSString *nameplateWord;
|
||||
///是否自定义铭牌,
|
||||
@property(nonatomic,assign) BOOL isCustomWord;
|
||||
///如果在房间有直播中字段
|
||||
@property(nonatomic, copy) NSString * roomUid;
|
||||
///如果在房间,房间的标题
|
||||
|
@@ -56,4 +56,6 @@ isEnterprise = [bundleID isEqualToString:@"com.hflighting.yumi"];\
|
||||
#import "HttpRequestHelper.h"
|
||||
#import "BSNetListenModel.h"
|
||||
#import "PIBaseModel.h"
|
||||
#import "PLTimeUtil.h"
|
||||
|
||||
#endif /* PrefixHeader_pch */
|
||||
|
@@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (NSString *)stringForFormat:(NSString *)format;
|
||||
|
||||
+ (NSString *)stringFromDate:(NSDate *)date;
|
||||
|
||||
+ (NSDate *)at_dateFromString:(NSString *)dateString;
|
||||
+(NSString *)getNowTimeTimestamp;
|
||||
+ (NSString *)getCurrentTimeWithFormat:(NSString *)format;
|
||||
+(NSString *)timestampSwitchTime:(NSInteger)timestamp andFormatter:(NSString *)format;
|
||||
|