礼物
2
Podfile
@@ -10,6 +10,7 @@ target 'yinmeng-ios' do
|
||||
pod 'Moya'
|
||||
pod 'MBProgressHUD'
|
||||
pod 'SVGAPlayer'
|
||||
pod 'YYText'
|
||||
# 滑动标签栏
|
||||
pod 'JXCategoryView'
|
||||
pod 'JXPagingView/Pager'
|
||||
@@ -35,6 +36,7 @@ target 'yinmeng-ios' do
|
||||
pod 'FFPopup'
|
||||
pod 'TXLiteAVSDK_TRTC', '~> 11.4.14530'
|
||||
pod 'MJExtension'
|
||||
pod 'QGVAPlayer'
|
||||
#声网
|
||||
pod 'AgoraRtcEngine_iOS', '~> 4.2.2'
|
||||
# Pods for yinmeng-ios
|
||||
|
@@ -70,7 +70,23 @@
|
||||
23630BBD2BAD379C003AD25D /* YinRoomAudioManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23630BBC2BAD379C003AD25D /* YinRoomAudioManager.swift */; };
|
||||
23630BBF2BAD37B7003AD25D /* YinRoomTRTCManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23630BBE2BAD37B7003AD25D /* YinRoomTRTCManager.swift */; };
|
||||
23630BC12BAD5537003AD25D /* YinRoomAgoraManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23630BC02BAD5537003AD25D /* YinRoomAgoraManager.swift */; };
|
||||
23630BC32BAD7868003AD25D /* SendGiftVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23630BC22BAD7868003AD25D /* SendGiftVC.swift */; };
|
||||
23630BC72BAD7A94003AD25D /* SendGiftView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23630BC62BAD7A94003AD25D /* SendGiftView.swift */; };
|
||||
23630BC92BAD7BCB003AD25D /* SendGiftCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23630BC82BAD7BCB003AD25D /* SendGiftCell.swift */; };
|
||||
23630BCB2BAD84B0003AD25D /* SendGiftModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23630BCA2BAD84B0003AD25D /* SendGiftModel.swift */; };
|
||||
23630BCD2BAD908D003AD25D /* SendGiftSendView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23630BCC2BAD908D003AD25D /* SendGiftSendView.swift */; };
|
||||
23630BCF2BADA7D9003AD25D /* SendGiftSendNumView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23630BCE2BADA7D9003AD25D /* SendGiftSendNumView.swift */; };
|
||||
23630BD12BADA900003AD25D /* SendGiftSendNumCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23630BD02BADA900003AD25D /* SendGiftSendNumCell.swift */; };
|
||||
23630BD32BADA9FF003AD25D /* SendGiftSendNumModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23630BD22BADA9FF003AD25D /* SendGiftSendNumModel.swift */; };
|
||||
238A900C2BAAC6C600828123 /* HomeVoiceSearchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 238A900B2BAAC6C600828123 /* HomeVoiceSearchView.swift */; };
|
||||
239EA6442BAE898300570127 /* RectiveGiftModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 239EA6432BAE898300570127 /* RectiveGiftModel.swift */; };
|
||||
239EA6462BAE8A6600570127 /* RectiveGiftUserModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 239EA6452BAE8A6600570127 /* RectiveGiftUserModel.swift */; };
|
||||
239EA6482BAE8D5E00570127 /* ChatCustomMsgModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 239EA6472BAE8D5E00570127 /* ChatCustomMsgModel.swift */; };
|
||||
239EA64C2BAE90B700570127 /* ChatMsgRemoteModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 239EA64B2BAE90B700570127 /* ChatMsgRemoteModel.swift */; };
|
||||
239EA64E2BAE949200570127 /* RoomChatScreenManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 239EA64D2BAE949200570127 /* RoomChatScreenManager.swift */; };
|
||||
239EA6512BAE998E00570127 /* YYTextAsyncLayer+YinTextAsyncLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 239EA6502BAE998E00570127 /* YYTextAsyncLayer+YinTextAsyncLayer.m */; };
|
||||
239EA6532BAEA73100570127 /* RoomChatScreenContentCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 239EA6522BAEA73100570127 /* RoomChatScreenContentCell.swift */; };
|
||||
239EA65A2BAEB48A00570127 /* RoomDynamicEffectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 239EA6592BAEB48A00570127 /* RoomDynamicEffectView.swift */; };
|
||||
23EE96E02B9EB22100475D69 /* RoomMenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23EE96DF2B9EB22100475D69 /* RoomMenuView.swift */; };
|
||||
23EE96E22B9EB22F00475D69 /* RoomSendTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23EE96E12B9EB22F00475D69 /* RoomSendTextView.swift */; };
|
||||
23EE96E62B9EE79A00475D69 /* RoomVCViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23EE96E52B9EE79A00475D69 /* RoomVCViewModel.swift */; };
|
||||
@@ -81,7 +97,6 @@
|
||||
23EE96F42BA048F100475D69 /* MicSeatGiftValueModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23EE96F32BA048F100475D69 /* MicSeatGiftValueModel.swift */; };
|
||||
23EE96F62BA061DE00475D69 /* RoomMsgListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23EE96F52BA061DE00475D69 /* RoomMsgListModel.swift */; };
|
||||
23EE96FA2BA1A3A300475D69 /* YinSpeak.svga in Resources */ = {isa = PBXBuildFile; fileRef = 23EE96F92BA1A3A200475D69 /* YinSpeak.svga */; };
|
||||
23EE97012BA29B3200475D69 /* SendGiftFaceplateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23EE97002BA29B3200475D69 /* SendGiftFaceplateView.swift */; };
|
||||
23EE97032BA29F1E00475D69 /* SendGiftTopView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23EE97022BA29F1E00475D69 /* SendGiftTopView.swift */; };
|
||||
23EE97052BA2A67300475D69 /* SendGiftUserView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23EE97042BA2A67300475D69 /* SendGiftUserView.swift */; };
|
||||
23EE97072BA2AC8300475D69 /* SendGiftUserCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23EE97062BA2AC8300475D69 /* SendGiftUserCell.swift */; };
|
||||
@@ -221,7 +236,24 @@
|
||||
23630BBC2BAD379C003AD25D /* YinRoomAudioManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YinRoomAudioManager.swift; sourceTree = "<group>"; };
|
||||
23630BBE2BAD37B7003AD25D /* YinRoomTRTCManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YinRoomTRTCManager.swift; sourceTree = "<group>"; };
|
||||
23630BC02BAD5537003AD25D /* YinRoomAgoraManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YinRoomAgoraManager.swift; sourceTree = "<group>"; };
|
||||
23630BC22BAD7868003AD25D /* SendGiftVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendGiftVC.swift; sourceTree = "<group>"; };
|
||||
23630BC62BAD7A94003AD25D /* SendGiftView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendGiftView.swift; sourceTree = "<group>"; };
|
||||
23630BC82BAD7BCB003AD25D /* SendGiftCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendGiftCell.swift; sourceTree = "<group>"; };
|
||||
23630BCA2BAD84B0003AD25D /* SendGiftModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendGiftModel.swift; sourceTree = "<group>"; };
|
||||
23630BCC2BAD908D003AD25D /* SendGiftSendView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendGiftSendView.swift; sourceTree = "<group>"; };
|
||||
23630BCE2BADA7D9003AD25D /* SendGiftSendNumView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendGiftSendNumView.swift; sourceTree = "<group>"; };
|
||||
23630BD02BADA900003AD25D /* SendGiftSendNumCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendGiftSendNumCell.swift; sourceTree = "<group>"; };
|
||||
23630BD22BADA9FF003AD25D /* SendGiftSendNumModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendGiftSendNumModel.swift; sourceTree = "<group>"; };
|
||||
238A900B2BAAC6C600828123 /* HomeVoiceSearchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeVoiceSearchView.swift; sourceTree = "<group>"; };
|
||||
239EA6432BAE898300570127 /* RectiveGiftModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RectiveGiftModel.swift; sourceTree = "<group>"; };
|
||||
239EA6452BAE8A6600570127 /* RectiveGiftUserModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RectiveGiftUserModel.swift; sourceTree = "<group>"; };
|
||||
239EA6472BAE8D5E00570127 /* ChatCustomMsgModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatCustomMsgModel.swift; sourceTree = "<group>"; };
|
||||
239EA64B2BAE90B700570127 /* ChatMsgRemoteModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatMsgRemoteModel.swift; sourceTree = "<group>"; };
|
||||
239EA64D2BAE949200570127 /* RoomChatScreenManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomChatScreenManager.swift; sourceTree = "<group>"; };
|
||||
239EA64F2BAE998E00570127 /* YYTextAsyncLayer+YinTextAsyncLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "YYTextAsyncLayer+YinTextAsyncLayer.h"; sourceTree = "<group>"; };
|
||||
239EA6502BAE998E00570127 /* YYTextAsyncLayer+YinTextAsyncLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "YYTextAsyncLayer+YinTextAsyncLayer.m"; sourceTree = "<group>"; };
|
||||
239EA6522BAEA73100570127 /* RoomChatScreenContentCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomChatScreenContentCell.swift; sourceTree = "<group>"; };
|
||||
239EA6592BAEB48A00570127 /* RoomDynamicEffectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomDynamicEffectView.swift; sourceTree = "<group>"; };
|
||||
23EE96DF2B9EB22100475D69 /* RoomMenuView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomMenuView.swift; sourceTree = "<group>"; };
|
||||
23EE96E12B9EB22F00475D69 /* RoomSendTextView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomSendTextView.swift; sourceTree = "<group>"; };
|
||||
23EE96E52B9EE79A00475D69 /* RoomVCViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RoomVCViewModel.swift; sourceTree = "<group>"; };
|
||||
@@ -232,7 +264,6 @@
|
||||
23EE96F32BA048F100475D69 /* MicSeatGiftValueModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MicSeatGiftValueModel.swift; sourceTree = "<group>"; };
|
||||
23EE96F52BA061DE00475D69 /* RoomMsgListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomMsgListModel.swift; sourceTree = "<group>"; };
|
||||
23EE96F92BA1A3A200475D69 /* YinSpeak.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = YinSpeak.svga; sourceTree = "<group>"; };
|
||||
23EE97002BA29B3200475D69 /* SendGiftFaceplateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendGiftFaceplateView.swift; sourceTree = "<group>"; };
|
||||
23EE97022BA29F1E00475D69 /* SendGiftTopView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendGiftTopView.swift; sourceTree = "<group>"; };
|
||||
23EE97042BA2A67300475D69 /* SendGiftUserView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendGiftUserView.swift; sourceTree = "<group>"; };
|
||||
23EE97062BA2AC8300475D69 /* SendGiftUserCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendGiftUserCell.swift; sourceTree = "<group>"; };
|
||||
@@ -379,6 +410,7 @@
|
||||
234E2DED2B98411800433CF7 /* View */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
239EA6542BAEB47900570127 /* RoomDynamicEffectView */,
|
||||
23EE96FB2BA29AFF00475D69 /* SendGift */,
|
||||
23EE96DA2B9EB17D00475D69 /* RoomMenuView */,
|
||||
234E2E2B2B9AFCDB00433CF7 /* RoomChatScreenView */,
|
||||
@@ -573,6 +605,7 @@
|
||||
234E2E2C2B9AFCDB00433CF7 /* ViewModel */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
239EA64D2BAE949200570127 /* RoomChatScreenManager.swift */,
|
||||
);
|
||||
path = ViewModel;
|
||||
sourceTree = "<group>";
|
||||
@@ -591,6 +624,7 @@
|
||||
234E2E302B9B001A00433CF7 /* RoomChatScreenView.swift */,
|
||||
234E2E322B9B019B00433CF7 /* RoomChatScreenHeaderView.swift */,
|
||||
234E2E342B9B06E800433CF7 /* RoomChatScreenUserChatCell.swift */,
|
||||
239EA6522BAEA73100570127 /* RoomChatScreenContentCell.swift */,
|
||||
);
|
||||
path = View;
|
||||
sourceTree = "<group>";
|
||||
@@ -620,6 +654,46 @@
|
||||
path = View;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
239EA6542BAEB47900570127 /* RoomDynamicEffectView */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
239EA6552BAEB47900570127 /* ViewModel */,
|
||||
239EA6562BAEB47900570127 /* Model */,
|
||||
239EA6572BAEB47900570127 /* View */,
|
||||
239EA6582BAEB47900570127 /* Tool */,
|
||||
);
|
||||
path = RoomDynamicEffectView;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
239EA6552BAEB47900570127 /* ViewModel */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
path = ViewModel;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
239EA6562BAEB47900570127 /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
239EA6572BAEB47900570127 /* View */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
239EA6592BAEB48A00570127 /* RoomDynamicEffectView.swift */,
|
||||
);
|
||||
path = View;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
239EA6582BAEB47900570127 /* Tool */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
path = Tool;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
23EE96DA2B9EB17D00475D69 /* RoomMenuView */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -683,6 +757,10 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
23EE970E2BA3006800475D69 /* SendGiftUserModel.swift */,
|
||||
23630BCA2BAD84B0003AD25D /* SendGiftModel.swift */,
|
||||
23630BD22BADA9FF003AD25D /* SendGiftSendNumModel.swift */,
|
||||
239EA6432BAE898300570127 /* RectiveGiftModel.swift */,
|
||||
239EA6452BAE8A6600570127 /* RectiveGiftUserModel.swift */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
@@ -690,10 +768,15 @@
|
||||
23EE96FE2BA29AFF00475D69 /* View */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
23EE97002BA29B3200475D69 /* SendGiftFaceplateView.swift */,
|
||||
23630BC22BAD7868003AD25D /* SendGiftVC.swift */,
|
||||
23EE97022BA29F1E00475D69 /* SendGiftTopView.swift */,
|
||||
23EE97042BA2A67300475D69 /* SendGiftUserView.swift */,
|
||||
23EE97062BA2AC8300475D69 /* SendGiftUserCell.swift */,
|
||||
23630BC62BAD7A94003AD25D /* SendGiftView.swift */,
|
||||
23630BC82BAD7BCB003AD25D /* SendGiftCell.swift */,
|
||||
23630BCC2BAD908D003AD25D /* SendGiftSendView.swift */,
|
||||
23630BCE2BADA7D9003AD25D /* SendGiftSendNumView.swift */,
|
||||
23630BD02BADA900003AD25D /* SendGiftSendNumCell.swift */,
|
||||
);
|
||||
path = View;
|
||||
sourceTree = "<group>";
|
||||
@@ -758,6 +841,8 @@
|
||||
children = (
|
||||
E8479E402B8DC6BC009AF878 /* ChatBaseObject.swift */,
|
||||
E8479E422B8DD077009AF878 /* ChatUIConfig.swift */,
|
||||
239EA6472BAE8D5E00570127 /* ChatCustomMsgModel.swift */,
|
||||
239EA64B2BAE90B700570127 /* ChatMsgRemoteModel.swift */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
@@ -1118,6 +1203,8 @@
|
||||
E81A7BA92B885B1F009E736E /* yinmeng-ios-Bridging-Header.h */,
|
||||
2311D6C92B91BBF2001C70AB /* RecordVoiceManager.h */,
|
||||
2311D6CA2B91BBF2001C70AB /* RecordVoiceManager.m */,
|
||||
239EA64F2BAE998E00570127 /* YYTextAsyncLayer+YinTextAsyncLayer.h */,
|
||||
239EA6502BAE998E00570127 /* YYTextAsyncLayer+YinTextAsyncLayer.m */,
|
||||
);
|
||||
path = Security;
|
||||
sourceTree = "<group>";
|
||||
@@ -1252,14 +1339,15 @@
|
||||
E8D15A9F2B89AED600369467 /* AuthManager.swift in Sources */,
|
||||
23630BB02BAD2708003AD25D /* YinRoomRankModel.swift in Sources */,
|
||||
E8479E382B8DC5CD009AF878 /* ChatListVC.swift in Sources */,
|
||||
239EA6482BAE8D5E00570127 /* ChatCustomMsgModel.swift in Sources */,
|
||||
E89F19AF2B91C00F0098E797 /* BindMobileVC.swift in Sources */,
|
||||
23EE970F2BA3006800475D69 /* SendGiftUserModel.swift in Sources */,
|
||||
23EE97012BA29B3200475D69 /* SendGiftFaceplateView.swift in Sources */,
|
||||
234E2DFA2B9851F000433CF7 /* UIButton+.swift in Sources */,
|
||||
E86A43B02B85E11B0084C04D /* BaseNavigationViewController.swift in Sources */,
|
||||
E86A43E82B884C5E0084C04D /* String+.swift in Sources */,
|
||||
23630BBD2BAD379C003AD25D /* YinRoomAudioManager.swift in Sources */,
|
||||
2311D6D12B91DDDF001C70AB /* UserPayViewModel.swift in Sources */,
|
||||
239EA6532BAEA73100570127 /* RoomChatScreenContentCell.swift in Sources */,
|
||||
2311D6B12B9062A3001C70AB /* HomeVoiceFollowCell.swift in Sources */,
|
||||
234E2E312B9B001A00433CF7 /* RoomChatScreenView.swift in Sources */,
|
||||
E8D15AA32B89B03D00369467 /* Deserialized.swift in Sources */,
|
||||
@@ -1272,11 +1360,13 @@
|
||||
234E2E1E2B9AB43700433CF7 /* RoomNormalMicSeatView.swift in Sources */,
|
||||
2311D6AF2B906148001C70AB /* HomeVoiceFollowView.swift in Sources */,
|
||||
23630B9D2BAC0DEA003AD25D /* HomeSearchRoomVC.swift in Sources */,
|
||||
239EA64E2BAE949200570127 /* RoomChatScreenManager.swift in Sources */,
|
||||
E86A43DA2B877A840084C04D /* AppConfigObject.swift in Sources */,
|
||||
2311D6BC2B909A4F001C70AB /* HomeVoicePublishView.swift in Sources */,
|
||||
23630BB52BAD2725003AD25D /* YinRoomRankView.swift in Sources */,
|
||||
2311D6AD2B9058AA001C70AB /* HomeVoiceModel.swift in Sources */,
|
||||
2311D6AB2B9024A9001C70AB /* HomeVoicePlayMusicItemView.swift in Sources */,
|
||||
239EA6442BAE898300570127 /* RectiveGiftModel.swift in Sources */,
|
||||
E8D15AA62B89B0C600369467 /* List+.swift in Sources */,
|
||||
234E2E042B986D8400433CF7 /* RoomQuitModel.swift in Sources */,
|
||||
234E2E0A2B98779900433CF7 /* RoomQuitUserInfoEmptyCell.swift in Sources */,
|
||||
@@ -1290,13 +1380,16 @@
|
||||
234E2E082B98738D00433CF7 /* RoomQuitUserInfoCell.swift in Sources */,
|
||||
E8E4AAB52B8F8E3A0096D77C /* AuthItmeButton.swift in Sources */,
|
||||
234E2E112B99B50400433CF7 /* RoomQuitViewModel.swift in Sources */,
|
||||
239EA65A2BAEB48A00570127 /* RoomDynamicEffectView.swift in Sources */,
|
||||
E86A43BC2B85FA640084C04D /* AuthForgetVC.swift in Sources */,
|
||||
E86A43C32B8628AF0084C04D /* BaseTabBarViewController.swift in Sources */,
|
||||
234E2E022B986D7600433CF7 /* RoomQuitView.swift in Sources */,
|
||||
E8479E3B2B8DC5FA009AF878 /* ChatViewModel.swift in Sources */,
|
||||
E8479E412B8DC6BC009AF878 /* ChatBaseObject.swift in Sources */,
|
||||
239EA64C2BAE90B700570127 /* ChatMsgRemoteModel.swift in Sources */,
|
||||
E86A43AA2B85DFA90084C04D /* BaseViewController.swift in Sources */,
|
||||
23EE96E22B9EB22F00475D69 /* RoomSendTextView.swift in Sources */,
|
||||
23630BCD2BAD908D003AD25D /* SendGiftSendView.swift in Sources */,
|
||||
23EE96F62BA061DE00475D69 /* RoomMsgListModel.swift in Sources */,
|
||||
E8E4AB1F2B901BFC0096D77C /* ChatGrowingTextView.swift in Sources */,
|
||||
E884E85F2B6900C500ADE6EE /* AppDelegate.swift in Sources */,
|
||||
@@ -1305,6 +1398,7 @@
|
||||
E8D15AEA2B8CD77800369467 /* H5Utils.swift in Sources */,
|
||||
E8D15AAA2B8ACC6B00369467 /* YMNetworkFun.swift in Sources */,
|
||||
234E2E202B9AB44800433CF7 /* MicSeatSuperView.swift in Sources */,
|
||||
23630BCF2BADA7D9003AD25D /* SendGiftSendNumView.swift in Sources */,
|
||||
E8D15AB82B8B003C00369467 /* UserInfoVC.swift in Sources */,
|
||||
E86A43B82B85F0B80084C04D /* AuthLaunchVC.swift in Sources */,
|
||||
E8E4AB252B901E400096D77C /* ChatMoreMenuCell.swift in Sources */,
|
||||
@@ -1312,6 +1406,7 @@
|
||||
E86A43C82B8743EA0084C04D /* AuthFillDataVC.swift in Sources */,
|
||||
23EE96F42BA048F100475D69 /* MicSeatGiftValueModel.swift in Sources */,
|
||||
E86A43CD2B874C8E0084C04D /* BaseView.swift in Sources */,
|
||||
23630BCB2BAD84B0003AD25D /* SendGiftModel.swift in Sources */,
|
||||
E8D15AE82B8CD47100369467 /* WebViewController.swift in Sources */,
|
||||
E89F194B2B919ECB0098E797 /* ChatImageCell.swift in Sources */,
|
||||
234E2E2A2B9AC07B00433CF7 /* MicSeatGiftValueView.swift in Sources */,
|
||||
@@ -1321,8 +1416,10 @@
|
||||
233E515B2B8C849600582F9C /* PlanetStarClickItemView.swift in Sources */,
|
||||
E8FF28B42B90ADBE005D2BE7 /* AppKeys.swift in Sources */,
|
||||
2311D6A92B8F405F001C70AB /* HomeVoiceChooseTypeView.swift in Sources */,
|
||||
239EA6462BAE8A6600570127 /* RectiveGiftUserModel.swift in Sources */,
|
||||
234E2DF42B9847A700433CF7 /* RoomBackgroundView.swift in Sources */,
|
||||
E89F19B52B91E3A50098E797 /* PasswordSetView.swift in Sources */,
|
||||
23630BC32BAD7868003AD25D /* SendGiftVC.swift in Sources */,
|
||||
E89F19492B919EB80098E797 /* ChatVoiceCell.swift in Sources */,
|
||||
234E2E062B986E2100433CF7 /* Enum.swift in Sources */,
|
||||
23EE96EC2B9F273A00475D69 /* MicSeatModel.swift in Sources */,
|
||||
@@ -1350,13 +1447,16 @@
|
||||
E86A43BF2B8620C40084C04D /* Utils.swift in Sources */,
|
||||
E86A43BA2B85F1360084C04D /* AuthLoginVC.swift in Sources */,
|
||||
E8D15ABC2B8B87BA00369467 /* UserViewModel.swift in Sources */,
|
||||
239EA6512BAE998E00570127 /* YYTextAsyncLayer+YinTextAsyncLayer.m in Sources */,
|
||||
E8479E432B8DD077009AF878 /* ChatUIConfig.swift in Sources */,
|
||||
23630BC92BAD7BCB003AD25D /* SendGiftCell.swift in Sources */,
|
||||
23EE97032BA29F1E00475D69 /* SendGiftTopView.swift in Sources */,
|
||||
234E2E252B9AB64700433CF7 /* NormalMicSeatCell.swift in Sources */,
|
||||
E8479E4D2B8DDBC5009AF878 /* ChatAttributeTool.swift in Sources */,
|
||||
E81A7BAF2B885B20009E736E /* MAIDESEncryptTool.m in Sources */,
|
||||
23630B9B2BABCEA5003AD25D /* HomeSearchNavView.swift in Sources */,
|
||||
E8D15AA82B89B74700369467 /* YMRequestX.swift in Sources */,
|
||||
23630BD32BADA9FF003AD25D /* SendGiftSendNumModel.swift in Sources */,
|
||||
E8E4AB1D2B901B9D0096D77C /* ChatKeyboard+.swift in Sources */,
|
||||
2311D6C62B917949001C70AB /* HomeVoiceRecordBtnView.swift in Sources */,
|
||||
23EE97072BA2AC8300475D69 /* SendGiftUserCell.swift in Sources */,
|
||||
@@ -1372,6 +1472,7 @@
|
||||
E8D15AB32B8B000400369467 /* PlanetStarVC.swift in Sources */,
|
||||
E8FF28B62B90ED6C005D2BE7 /* ChatNavView.swift in Sources */,
|
||||
234E2E332B9B019B00433CF7 /* RoomChatScreenHeaderView.swift in Sources */,
|
||||
23630BD12BADA900003AD25D /* SendGiftSendNumCell.swift in Sources */,
|
||||
E8D15A9D2B899E1500369467 /* YMNetworkHelper.swift in Sources */,
|
||||
E8E4AB1B2B901AF50096D77C /* UIView+.swift in Sources */,
|
||||
2311D69D2B8DC311001C70AB /* PlanetStarModel.swift in Sources */,
|
||||
@@ -1379,6 +1480,7 @@
|
||||
2311D6CB2B91BBF2001C70AB /* RecordVoiceManager.m in Sources */,
|
||||
23630B992BABCE52003AD25D /* HomeSearchVC.swift in Sources */,
|
||||
2311D6C42B917619001C70AB /* HomeVoiceRecordView.swift in Sources */,
|
||||
23630BC72BAD7A94003AD25D /* SendGiftView.swift in Sources */,
|
||||
23EE97052BA2A67300475D69 /* SendGiftUserView.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
6
yinmeng-ios/Assets.xcassets/room/Gift/Contents.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
22
yinmeng-ios/Assets.xcassets/room/Gift/room_gift_slect_bg.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_gift_slect_bg@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_gift_slect_bg@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
yinmeng-ios/Assets.xcassets/room/Gift/room_gift_slect_bg.imageset/room_gift_slect_bg@2x.png
vendored
Normal file
After Width: | Height: | Size: 643 B |
BIN
yinmeng-ios/Assets.xcassets/room/Gift/room_gift_slect_bg.imageset/room_gift_slect_bg@3x.png
vendored
Normal file
After Width: | Height: | Size: 997 B |
22
yinmeng-ios/Assets.xcassets/room/Gift/yin_room_gift_arrow.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "yin_room_gift_arrow@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "yin_room_gift_arrow@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
yinmeng-ios/Assets.xcassets/room/Gift/yin_room_gift_arrow.imageset/yin_room_gift_arrow@2x.png
vendored
Normal file
After Width: | Height: | Size: 181 B |
BIN
yinmeng-ios/Assets.xcassets/room/Gift/yin_room_gift_arrow.imageset/yin_room_gift_arrow@3x.png
vendored
Normal file
After Width: | Height: | Size: 254 B |
22
yinmeng-ios/Assets.xcassets/room/Gift/yin_room_gift_diamond.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "yin_room_gift_diamond@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "yin_room_gift_diamond@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
yinmeng-ios/Assets.xcassets/room/Gift/yin_room_gift_diamond.imageset/yin_room_gift_diamond@2x.png
vendored
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
yinmeng-ios/Assets.xcassets/room/Gift/yin_room_gift_diamond.imageset/yin_room_gift_diamond@3x.png
vendored
Normal file
After Width: | Height: | Size: 2.5 KiB |
22
yinmeng-ios/Assets.xcassets/room/Gift/yin_room_gift_select.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "yin_room_gift_select@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "yin_room_gift_select@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
yinmeng-ios/Assets.xcassets/room/Gift/yin_room_gift_select.imageset/yin_room_gift_select@2x.png
vendored
Normal file
After Width: | Height: | Size: 643 B |
BIN
yinmeng-ios/Assets.xcassets/room/Gift/yin_room_gift_select.imageset/yin_room_gift_select@3x.png
vendored
Normal file
After Width: | Height: | Size: 997 B |
22
yinmeng-ios/Assets.xcassets/room/Gift/yin_room_gift_tag_dedicated.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "yin_room_gift_tag_dedicated@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "yin_room_gift_tag_dedicated@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 666 B |
After Width: | Height: | Size: 1.1 KiB |
22
yinmeng-ios/Assets.xcassets/room/Gift/yin_room_gift_tag_effect.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "yin_room_gift_tag_effect@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "yin_room_gift_tag_effect@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 748 B |
After Width: | Height: | Size: 1.1 KiB |
22
yinmeng-ios/Assets.xcassets/room/Gift/yin_room_gift_tag_latest.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "yin_room_gift_tag_latest@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "yin_room_gift_tag_latest@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
22
yinmeng-ios/Assets.xcassets/room/Gift/yin_room_gift_tag_limit.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "yin_room_gift_tag_limit@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "yin_room_gift_tag_limit@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.7 KiB |
22
yinmeng-ios/Assets.xcassets/room/Gift/yin_room_gift_up_arrow.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "yin_room_gift_up_arrow@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "yin_room_gift_up_arrow@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
yinmeng-ios/Assets.xcassets/room/Gift/yin_room_gift_up_arrow.imageset/yin_room_gift_up_arrow@2x.png
vendored
Normal file
After Width: | Height: | Size: 222 B |
BIN
yinmeng-ios/Assets.xcassets/room/Gift/yin_room_gift_up_arrow.imageset/yin_room_gift_up_arrow@3x.png
vendored
Normal file
After Width: | Height: | Size: 292 B |
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// YYTextAsyncLayer+XPTextAsyncLayer.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by duoban on 2023/10/28.
|
||||
//
|
||||
|
||||
#import <YYText/YYTextAsyncLayer.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YYTextAsyncLayer (YinTextAsyncLayer)
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// YYTextAsyncLayer+XPTextAsyncLayer.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by duoban on 2023/10/28.
|
||||
//
|
||||
|
||||
#import "YYTextAsyncLayer+YinTextAsyncLayer.h"
|
||||
#import <objc/runtime.h>
|
||||
|
||||
|
||||
@implementation YYTextAsyncLayer (YinTextAsyncLayer)
|
||||
|
||||
+(void)load {
|
||||
Method yin_displayMethod = class_getInstanceMethod(self, @selector(display));
|
||||
Method yin_swizzingMethod = class_getInstanceMethod(self, @selector(yin_swizzing_display));
|
||||
method_exchangeImplementations(yin_displayMethod, yin_swizzingMethod);
|
||||
}
|
||||
-(void)yin_swizzing_display{
|
||||
if (self.bounds.size.width <= 0 || self.bounds.size.height <= 0) {
|
||||
self.contents = nil;
|
||||
return;
|
||||
} else {
|
||||
[self yin_swizzing_display];
|
||||
}
|
||||
}
|
||||
@end
|
@@ -13,3 +13,6 @@
|
||||
#import <JXCategoryView/JXCategoryView.h>
|
||||
#import <JXCategoryView/JXCategoryListContainerView.h>
|
||||
#import <AgoraRtcKit/AgoraRtcEngineKit.h>
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
#import <YYText/YYText.h>
|
||||
#import "UIView+VAP.h"
|
||||
|
@@ -35,14 +35,23 @@ extension UIButton {
|
||||
return bounds.contains(point)
|
||||
}
|
||||
|
||||
static func getCustomBtn(type:UIButton.ButtonType = .custom, text:String? = nil,selectedText:String? = nil,font:UIFont? = nil,color:UIColor? = nil,selectedColor:UIColor? = nil,image:UIImage? = nil,selectedImage:UIImage? = nil,bgImage:UIImage? = nil,selectedBgImage:UIImage? = nil) -> UIButton{
|
||||
static func getCustomBtn(type:UIButton.ButtonType = .custom, text:String? = nil,selectedText:String? = nil,disabledText:String? = nil,font:UIFont? = nil,color:UIColor? = nil,selectedColor:UIColor? = nil,disabledColor:UIColor? = nil,image:UIImage? = nil,selectedImage:UIImage? = nil,bgImage:UIImage? = nil,selectedBgImage:UIImage? = nil,disabledBgImage:UIImage? = nil,masksToBounds:Bool = false,cornerRadius:CGFloat = 0,borderWidth:CGFloat = 0,borderColor:UIColor? = nil) -> UIButton{
|
||||
let customBtn = UIButton(type: type)
|
||||
customBtn.layer.masksToBounds = masksToBounds
|
||||
customBtn.layer.cornerRadius = cornerRadius
|
||||
customBtn.layer.borderWidth = borderWidth
|
||||
if let _borderColor = borderColor{
|
||||
customBtn.layer.borderColor = _borderColor.cgColor
|
||||
}
|
||||
if let _text = text{
|
||||
customBtn.setTitle(_text, for: .normal)
|
||||
}
|
||||
if let _selectedText = selectedText{
|
||||
customBtn.setTitle(_selectedText, for: .selected)
|
||||
}
|
||||
if let _disabledText = disabledText{
|
||||
customBtn.setTitle(_disabledText, for: .disabled)
|
||||
}
|
||||
if let _font = font{
|
||||
customBtn.titleLabel?.font = _font
|
||||
}
|
||||
@@ -52,6 +61,9 @@ extension UIButton {
|
||||
if let _selectedColor = selectedColor{
|
||||
customBtn.setTitleColor(_selectedColor, for: .selected)
|
||||
}
|
||||
if let _disabledColor = disabledColor{
|
||||
customBtn.setTitleColor(_disabledColor, for: .disabled)
|
||||
}
|
||||
if let _image = image{
|
||||
customBtn.setImage(_image, for: .normal)
|
||||
}
|
||||
@@ -64,6 +76,9 @@ extension UIButton {
|
||||
if let _selectedBgImage = selectedBgImage{
|
||||
customBtn.setBackgroundImage(_selectedBgImage, for: .selected)
|
||||
}
|
||||
if let _disabledBgImage = disabledBgImage{
|
||||
customBtn.setBackgroundImage(_disabledBgImage, for: .disabled)
|
||||
}
|
||||
return customBtn
|
||||
}
|
||||
|
||||
|
23
yinmeng-ios/Modules/Chat/Model/ChatCustomMsgModel.swift
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// ChatCustomMsgModel.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/3/23.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import HandyJSON
|
||||
|
||||
class ChatCustomMsgModel: NSObject, HandyJSON,NIMCustomAttachment {
|
||||
required override init(){
|
||||
|
||||
}
|
||||
var first = 0
|
||||
var second = 0
|
||||
var data:[String:Any] = [:]
|
||||
// encodeAttachment
|
||||
func encode() -> String {
|
||||
return self.toJSONString() ?? ""
|
||||
}
|
||||
|
||||
}
|
16
yinmeng-ios/Modules/Chat/Model/ChatMsgRemoteModel.swift
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// ChatMsgRemoteModel.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/3/23.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import HandyJSON
|
||||
|
||||
class ChatMsgRemoteModel: HandyJSON {
|
||||
required init() {
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -140,6 +140,12 @@ class HomeVoiceUserInfoView: UIView {
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
@objc func sendGiftBtnAction(){
|
||||
if let _clickBtnBlock = clickBtnBlock,let uid = self.user?.uid{
|
||||
_clickBtnBlock(5,"\(uid)")
|
||||
self.removeFromSuperview()
|
||||
}
|
||||
}
|
||||
@objc func attentionBtnAction(){
|
||||
if self.type == 1{
|
||||
if let _clickBtnBlock = clickBtnBlock,let uid = self.model?.uid{
|
||||
@@ -175,9 +181,10 @@ class HomeVoiceUserInfoView: UIView {
|
||||
if let _clickBtnBlock = clickBtnBlock, let uid = self.model?.uid{
|
||||
_clickBtnBlock(0,"\(uid)")
|
||||
}
|
||||
if let _clickBtnBlock = clickBtnBlock,let uid = self.user?.uid{
|
||||
if let _clickBtnBlock = clickBtnBlock, let uid = self.user?.uid{
|
||||
_clickBtnBlock(0,"\(uid)")
|
||||
}
|
||||
|
||||
}
|
||||
@objc func playVoiceAction(){
|
||||
guard let userVoice = self.model?.userVoice else {
|
||||
@@ -409,7 +416,7 @@ class HomeVoiceUserInfoView: UIView {
|
||||
|
||||
_sendGfitBtn.titleLabel?.font = UIFont.systemFont(ofSize: 15, weight: .medium)
|
||||
_sendGfitBtn.setImage(UIImage(named: "yin_plane_star_send_gift_icon"), for: .selected)
|
||||
_sendGfitBtn.addTarget(self, action: #selector(attentionBtnAction), for: .touchUpInside)
|
||||
_sendGfitBtn.addTarget(self, action: #selector(sendGiftBtnAction), for: .touchUpInside)
|
||||
return _sendGfitBtn
|
||||
|
||||
|
||||
|
@@ -90,7 +90,52 @@ class PlayVoiceManager: NSObject,AVAudioPlayerDelegate {
|
||||
downloadTask.resume()
|
||||
}
|
||||
|
||||
|
||||
static func downloadFile(url:String,complete:@escaping(_ url:String)->Void,fail:@escaping()->Void){
|
||||
let list = url.components(separatedBy: "/")
|
||||
var name = "FileList"
|
||||
if list.isEmpty == false,let getName = list.last{
|
||||
name = getName
|
||||
}
|
||||
let path = NSSearchPathForDirectoriesInDomains(.documentDirectory,.userDomainMask,true)[0] as String
|
||||
let allPath = path + "/kUserFile/" + name
|
||||
if FileManager.default.fileExists(atPath: allPath){
|
||||
complete(allPath)
|
||||
}else{
|
||||
do {
|
||||
try FileManager.default.createDirectory(atPath: allPath, withIntermediateDirectories: true, attributes: nil)
|
||||
//请求
|
||||
let request = URLRequest(url: URL(string: url)!)
|
||||
let session = URLSession.shared
|
||||
//下载任务
|
||||
let downloadTask = session.downloadTask(with: request,
|
||||
completionHandler: { (location:URL?, response:URLResponse?, error:Error?)
|
||||
-> Void in
|
||||
guard let locationPath = location?.path else{return}
|
||||
|
||||
do {
|
||||
if FileManager.default.fileExists(atPath: allPath){
|
||||
try FileManager.default.removeItem(atPath: allPath)
|
||||
}
|
||||
// 文件移动至document
|
||||
try FileManager.default.copyItem(atPath: locationPath, toPath: allPath)
|
||||
// main
|
||||
DispatchQueue.main.async {
|
||||
complete(allPath)
|
||||
}
|
||||
} catch let error {
|
||||
fail()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
//使用resume方法启动任务
|
||||
downloadTask.resume()
|
||||
}catch let error{
|
||||
fail()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -7,25 +7,20 @@
|
||||
|
||||
import UIKit
|
||||
|
||||
enum YinRoomAudMioanagerType {
|
||||
enum YinRoomAudioManagerType {
|
||||
case trtc,agora
|
||||
}
|
||||
|
||||
class YinRoomAudMioanager: NSObject {
|
||||
static let share = YinRoomAudMioanager()
|
||||
var type:YinRoomAudMioanagerType = .trtc
|
||||
|
||||
|
||||
class YinRoomAudioManager: NSObject {
|
||||
static let share = YinRoomAudioManager()
|
||||
var type:YinRoomAudioManagerType = .trtc
|
||||
func dealWithChatData(roomData:RoomDataModel){
|
||||
type = roomData.audioSdkType == "trtc" ? .trtc : .agora
|
||||
if type == .trtc{
|
||||
roomTRTCManager.roomData = roomData
|
||||
roomTRTCManager.setTRTC()
|
||||
}else{
|
||||
|
||||
agoraManager.initAgora(roomUid: roomData.roomId)
|
||||
|
||||
|
||||
agoraManager.initAgora(roomUid: roomData.roomId)
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -33,12 +33,11 @@ class YinRoomTRTCManager: NSObject {
|
||||
cloud.enableAudioVolumeEvaluation(true, with: params)
|
||||
let yinParams = TRTCParams()
|
||||
if AuthViewModel.authVM.appId.isEmpty{
|
||||
|
||||
yinParams.sdkAppId = UInt32("1400798783") ?? 0
|
||||
}else{
|
||||
yinParams.sdkAppId = UInt32(AuthViewModel.authVM.appId) ?? 0
|
||||
}
|
||||
yinParams.roomId = UInt32(curRoomId) ?? 0
|
||||
yinParams.roomId = UInt32(curRoomId) ?? 0
|
||||
let uid = "\(AuthManager.userUid)"
|
||||
yinParams.userId = uid
|
||||
let sign = self.roomData?.trtcSig ?? ""
|
||||
|
@@ -13,7 +13,7 @@ class RoomVC: BaseViewController, HiddenNavigationBarProtocol {
|
||||
self.roomUid = roomUid
|
||||
}
|
||||
deinit {
|
||||
YinRoomAudMioanager.share.destroySharedIntance()
|
||||
YinRoomAudioManager.share.destroySharedIntance()
|
||||
}
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
@@ -24,33 +24,100 @@ class RoomVC: BaseViewController, HiddenNavigationBarProtocol {
|
||||
requestData()
|
||||
addNIMSDKManager()
|
||||
addChild(chatListVC)
|
||||
menuView.clickMenuViewBlcok = {[weak self] in
|
||||
menuView.clickMenuViewBlcok = {[weak self] type in
|
||||
guard let self = self else { return}
|
||||
self.view.addSubview(self.bgChatView)
|
||||
self.bgChatView.snp.makeConstraints { make in
|
||||
make.edges.equalTo(self.view)
|
||||
}
|
||||
let height = ScreenHeight * 2 / 3
|
||||
self.view.addSubview(self.chatListVC.view)
|
||||
self.chatListVC.view.layer.cornerRadius = 20
|
||||
self.chatListVC.view.layer.masksToBounds = true
|
||||
self.chatListVC.view.frame = CGRect(x: 0, y: ScreenHeight, width: ScreenWidth, height: height)
|
||||
UIView.animate(withDuration: 0.1) {
|
||||
self.chatListVC.view.frame = CGRect(x: 0, y:ScreenHeight - height, width: ScreenWidth, height: height)
|
||||
if type == .chat{
|
||||
self.view.addSubview(self.bgChatView)
|
||||
self.bgChatView.snp.makeConstraints { make in
|
||||
make.edges.equalTo(self.view)
|
||||
}
|
||||
let height = ScreenHeight * 2 / 3
|
||||
self.view.addSubview(self.chatListVC.view)
|
||||
self.chatListVC.view.layer.cornerRadius = 20
|
||||
self.chatListVC.view.layer.masksToBounds = true
|
||||
self.chatListVC.view.frame = CGRect(x: 0, y: ScreenHeight, width: ScreenWidth, height: height)
|
||||
UIView.animate(withDuration: 0.1) {
|
||||
self.chatListVC.view.frame = CGRect(x: 0, y:ScreenHeight - height, width: ScreenWidth, height: height)
|
||||
}
|
||||
}else{
|
||||
let sendGiftVC = SendGiftVC()
|
||||
let nav = BaseNavigationViewController.init(rootViewController: sendGiftVC)
|
||||
nav.modalPresentationStyle = .overCurrentContext
|
||||
let list = micSeatView.getMicUser()
|
||||
var userList:[SendGiftUserModel] = []
|
||||
for item:[String:UserObject] in list {
|
||||
|
||||
|
||||
if let first = item.keys.first,let user = item[first],let uid = user.uid,uid != AuthManager.userUid{
|
||||
let model = SendGiftUserModel()
|
||||
model.position = first
|
||||
model.nick = user.nick ?? ""
|
||||
model.avatar = user.avatar ?? ""
|
||||
model.uid = user.uid ?? 0
|
||||
userList.append(model)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
sendGiftVC.userList = userList
|
||||
sendGiftVC.roomUid = self.roomUid
|
||||
sendGiftVC.roomId = self.roomInfo?.roomId ?? ""
|
||||
sendGiftVC.userData = self.userData
|
||||
self.present(nav, animated: true, completion: nil)
|
||||
}
|
||||
|
||||
}
|
||||
micSeatView.showUserInfoBlock = {[weak self] user in
|
||||
guard let weakSelf = self else { return }
|
||||
let userInfoView:HomeVoiceUserInfoView = HomeVoiceUserInfoView.init(frame: .zero)
|
||||
userInfoView.clickBtnBlock = {[weak self] (type,uid) in
|
||||
guard let weakSelf = self else {
|
||||
return
|
||||
}
|
||||
if type == 0{
|
||||
let session = NIMSession(uid, type: .P2P)
|
||||
let chatVC = ChatVC.init(session: session)
|
||||
weakSelf.navigationController?.pushViewController(chatVC, animated: true)
|
||||
}else if (type == 5){
|
||||
if let first = user.keys.first,let userModel = user[first],let uid = userModel.uid,uid != AuthManager.userUid{
|
||||
var userList:[SendGiftUserModel] = []
|
||||
let model = SendGiftUserModel()
|
||||
model.position = first
|
||||
model.nick = userModel.nick ?? ""
|
||||
model.avatar = userModel.avatar ?? ""
|
||||
model.uid = userModel.uid ?? 0
|
||||
userList.append(model)
|
||||
let sendGiftVC = SendGiftVC()
|
||||
let nav = BaseNavigationViewController.init(rootViewController: sendGiftVC)
|
||||
nav.modalPresentationStyle = .overCurrentContext
|
||||
sendGiftVC.userList = userList
|
||||
sendGiftVC.roomUid = weakSelf.roomUid
|
||||
sendGiftVC.roomId = weakSelf.roomInfo?.roomId ?? ""
|
||||
sendGiftVC.userData = weakSelf.userData
|
||||
sendGiftVC.isSendPerson = true
|
||||
weakSelf.present(nav, animated: true, completion: nil)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
userInfoView.type = 2
|
||||
userInfoView.user = user.values.first
|
||||
weakSelf.view.addSubview(userInfoView)
|
||||
userInfoView.snp.makeConstraints { make in
|
||||
make.edges.equalTo(weakSelf.view)
|
||||
}
|
||||
}
|
||||
|
||||
topView.didClickTypeBlcok = {[weak self] (type,uid) in
|
||||
guard let self = self else { return}
|
||||
if type == 0{
|
||||
YinRoomAudMioanager.share.exitRoom()
|
||||
YinRoomAudioManager.share.exitRoom()
|
||||
RoomVCViewModel.roomVM.isMute = true
|
||||
NIMSDK.shared().chatroomManager.exitChatroom(self.roomInfo?.roomId ?? "")
|
||||
self.dismiss(animated: true, completion: nil)
|
||||
|
||||
}else if type == 1 {
|
||||
|
||||
YinRoomAudMioanager.share.exitRoom()
|
||||
YinRoomAudioManager.share.exitRoom()
|
||||
RoomVCViewModel.roomVM.isMute = true
|
||||
NIMSDK.shared().chatroomManager.exitChatroom(self.roomInfo?.roomId ?? "")
|
||||
self.dismiss(animated: true, completion: nil)
|
||||
@@ -84,6 +151,7 @@ class RoomVC: BaseViewController, HiddenNavigationBarProtocol {
|
||||
view.addSubview(micSeatView)
|
||||
view.addSubview(chatScreenView)
|
||||
view.addSubview(menuView)
|
||||
view.addSubview(roomEffectView)
|
||||
backgroundView.snp.makeConstraints { make in
|
||||
make.edges.equalTo(self.view)
|
||||
}
|
||||
@@ -108,27 +176,10 @@ class RoomVC: BaseViewController, HiddenNavigationBarProtocol {
|
||||
make.bottom.equalTo(-bottom)
|
||||
make.height.equalTo(UIDevice.scaleWidth(width: 40))
|
||||
}
|
||||
micSeatView.showUserInfoBlock = {[weak self] user in
|
||||
guard let weakSelf = self else { return }
|
||||
let userInfoView:HomeVoiceUserInfoView = HomeVoiceUserInfoView.init(frame: .zero)
|
||||
userInfoView.clickBtnBlock = {[weak self] (type,uid) in
|
||||
guard let weakSelf = self else {
|
||||
return
|
||||
}
|
||||
if type == 0{
|
||||
let session = NIMSession(uid, type: .P2P)
|
||||
let chatVC = ChatVC.init(session: session)
|
||||
weakSelf.navigationController?.pushViewController(chatVC, animated: true)
|
||||
}
|
||||
|
||||
}
|
||||
userInfoView.type = 2
|
||||
userInfoView.user = user
|
||||
weakSelf.view.addSubview(userInfoView)
|
||||
userInfoView.snp.makeConstraints { make in
|
||||
make.edges.equalTo(weakSelf.view)
|
||||
}
|
||||
roomEffectView.snp.makeConstraints { make in
|
||||
make.edges.equalTo(view)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private func requestData(){
|
||||
@@ -143,6 +194,7 @@ class RoomVC: BaseViewController, HiddenNavigationBarProtocol {
|
||||
RoomVCViewModel.roomVM.NIMSDKEnterRoom(roomId:roomid , user: result)
|
||||
self?.micSeatView.userData = result
|
||||
self?.menuView.user = result
|
||||
self?.userData = result
|
||||
}
|
||||
|
||||
}).disposed(by: rx.disposeBag)
|
||||
@@ -160,7 +212,7 @@ class RoomVC: BaseViewController, HiddenNavigationBarProtocol {
|
||||
topView.roomData = self.roomInfo
|
||||
micSeatView.roomData = self.roomInfo
|
||||
if let roomInfo = self.roomInfo{
|
||||
YinRoomAudMioanager.share.dealWithChatData(roomData:roomInfo)
|
||||
YinRoomAudioManager.share.dealWithChatData(roomData:roomInfo)
|
||||
}
|
||||
micSeatView.setMicList()
|
||||
menuView.roomUid = self.roomInfo?.roomId ?? ""
|
||||
@@ -192,6 +244,7 @@ class RoomVC: BaseViewController, HiddenNavigationBarProtocol {
|
||||
var roomUid:String = ""
|
||||
var roomText:String = ""
|
||||
var roomInfo:RoomDataModel?
|
||||
var userData:UserObject?
|
||||
//MARK: - 懒加载
|
||||
private lazy var backgroundView:RoomBackgroundView = {
|
||||
let _backgroundView = RoomBackgroundView(frame: .zero)
|
||||
@@ -229,6 +282,11 @@ class RoomVC: BaseViewController, HiddenNavigationBarProtocol {
|
||||
|
||||
return _chatListVC
|
||||
}()
|
||||
private lazy var roomEffectView:RoomDynamicEffectView = {
|
||||
let _roomEffectView = RoomDynamicEffectView(frame: .zero)
|
||||
_roomEffectView.isUserInteractionEnabled = false
|
||||
return _roomEffectView
|
||||
}()
|
||||
|
||||
}
|
||||
|
||||
@@ -266,6 +324,9 @@ extension RoomVC : NIMChatManagerDelegate, NIMChatroomManagerDelegate, NIMLoginM
|
||||
self.topView.roomData = self.roomInfo
|
||||
}else if msg.messageType == .text{
|
||||
chatScreenView.getTextMsg(msg: msg)
|
||||
}else if msg.messageType == .custom{
|
||||
chatScreenView.dealWithCustomMsg(msg: msg)
|
||||
roomEffectView.dealWithCustomMsg(msg: msg)
|
||||
}
|
||||
micSeatView.dealWithNotMessage(msg: msg)
|
||||
menuView.dealWithNotMessage(msg: msg)
|
||||
@@ -278,6 +339,9 @@ extension RoomVC : NIMChatManagerDelegate, NIMChatroomManagerDelegate, NIMLoginM
|
||||
}
|
||||
if message.messageType == .text{
|
||||
chatScreenView.getTextMsg(msg: message)
|
||||
}else if message.messageType == .custom{
|
||||
chatScreenView.dealWithCustomMsg(msg: message)
|
||||
roomEffectView.dealWithCustomMsg(msg: message)
|
||||
}
|
||||
}
|
||||
func updateOnlineNum(num:Int){
|
||||
|
@@ -10,7 +10,7 @@ import NIMSDK
|
||||
import MJExtension
|
||||
|
||||
|
||||
typealias ShowUserInfoBlock = (_ user:UserObject)->Void
|
||||
typealias ShowUserInfoBlock = (_ user:[String:UserObject])->Void
|
||||
|
||||
class NormalMicSeatSuperView: MicSeatSuperView {
|
||||
var showUserInfoBlock:ShowUserInfoBlock?
|
||||
@@ -29,7 +29,7 @@ class NormalMicSeatSuperView: MicSeatSuperView {
|
||||
|
||||
if let userInfo = not.userInfo as? [NSString:Any],let type = userInfo["type"] as? String{
|
||||
var uidList:[String] = []
|
||||
if let userVolumes: [TRTCVolumeInfo] = userInfo["userVolumes"] as? [TRTCVolumeInfo],let totalVolume = userInfo["totalVolume"] as? Int ,type == "trtc"{
|
||||
if let userVolumes: [TRTCVolumeInfo] = userInfo["userVolumes"] as? [TRTCVolumeInfo],type == "trtc"{
|
||||
|
||||
for item in userVolumes {
|
||||
|
||||
@@ -142,7 +142,9 @@ class NormalMicSeatSuperView: MicSeatSuperView {
|
||||
return
|
||||
}
|
||||
|
||||
HUDTool.show(with: "该麦位已经有人了哦~")
|
||||
if let showUserInfoBlock = self.showUserInfoBlock,let user = roomOwnerView.user{
|
||||
showUserInfoBlock(["-1":user])
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -200,6 +202,21 @@ class NormalMicSeatSuperView: MicSeatSuperView {
|
||||
|
||||
}
|
||||
}
|
||||
func getMicUser()->[[String:UserObject]]{
|
||||
var list:[[String:UserObject]] = []
|
||||
if let user = roomOwnerView.user{
|
||||
|
||||
list.append(["-1":user])
|
||||
}
|
||||
for i in 0..<8 {
|
||||
if let cell = collectionView.cellForItem(at: IndexPath(row: i, section: 0)) as? NormalMicSeatCell{
|
||||
if let user = cell.user{
|
||||
list.append(["\(i)":user])
|
||||
}
|
||||
}
|
||||
}
|
||||
return list
|
||||
}
|
||||
//MARK: - 懒加载
|
||||
var roomUserList:[MicSequenceModel] = []
|
||||
var roomData:RoomDataModel?
|
||||
@@ -275,7 +292,7 @@ extension NormalMicSeatSuperView:UICollectionViewDelegate,UICollectionViewDataSo
|
||||
return
|
||||
}
|
||||
if let showUserInfoBlock = self.showUserInfoBlock,let user = user.user{
|
||||
showUserInfoBlock(user)
|
||||
showUserInfoBlock(["\(indexPath.row)":user])
|
||||
}
|
||||
|
||||
}else{
|
||||
|
@@ -24,4 +24,6 @@ struct RoomMsgListModel: HandyJSON {
|
||||
var text = ""
|
||||
var avatar = ""
|
||||
var height:CGFloat = 0
|
||||
var isGift = false
|
||||
var att:NSMutableAttributedString?
|
||||
}
|
||||
|
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// RoomChatScreenContentCell.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/3/23.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class RoomChatScreenContentCell: UITableViewCell {
|
||||
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
setUILayout()
|
||||
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
var textAtt:NSMutableAttributedString? = nil{
|
||||
didSet{
|
||||
guard let _textAtt = textAtt else { return }
|
||||
textView.attributedText = _textAtt
|
||||
}
|
||||
}
|
||||
|
||||
private func setUILayout(){
|
||||
selectionStyle = .none
|
||||
backgroundColor = .clear
|
||||
contentView.addSubview(bgImageView)
|
||||
contentView.addSubview(textView)
|
||||
let width = ScreenWidth - UIDevice.scaleWidth(width: 148)
|
||||
bgImageView.snp.makeConstraints { make in
|
||||
make.leading.trailing.top.equalTo(contentView)
|
||||
make.bottom.equalTo(-UIDevice.scaleWidth(width: 10))
|
||||
|
||||
}
|
||||
textView.snp.makeConstraints { make in
|
||||
make.leading.equalTo(UIDevice.scaleWidth(width: 12))
|
||||
make.trailing.top.bottom.equalTo(bgImageView).inset(UIDevice.scaleWidth(width: 10))
|
||||
}
|
||||
}
|
||||
|
||||
//MARK: - 懒加载
|
||||
private lazy var bgImageView:UIImageView = {
|
||||
let _bgImageView = UIImageView()
|
||||
_bgImageView.layer.cornerRadius = UIDevice.scaleWidth(width: 7)
|
||||
_bgImageView.isUserInteractionEnabled = true
|
||||
_bgImageView.layer.masksToBounds = true
|
||||
let image = UIImage.image(color: ThemeColor(hexStr: "#FFFFFF", alpha: 0.15))
|
||||
_bgImageView.image = image
|
||||
return _bgImageView
|
||||
}()
|
||||
private lazy var textView:YYLabel = {
|
||||
let _textView = YYLabel()
|
||||
_textView.numberOfLines = 0
|
||||
return _textView
|
||||
}()
|
||||
|
||||
override func awakeFromNib() {
|
||||
super.awakeFromNib()
|
||||
// Initialization code
|
||||
}
|
||||
|
||||
override func setSelected(_ selected: Bool, animated: Bool) {
|
||||
super.setSelected(selected, animated: animated)
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
}
|
@@ -70,10 +70,10 @@ class RoomChatScreenUserChatCell: UITableViewCell {
|
||||
}
|
||||
let width = ScreenWidth - UIDevice.scaleWidth(width: 148)
|
||||
bgTextView.snp.makeConstraints { make in
|
||||
make.top.equalTo(tagStackView.snp.bottom).offset(UIDevice.scaleWidth(width: 6))
|
||||
make.top.equalTo(UIDevice.scaleWidth(width: 50))
|
||||
make.leading.equalTo(tagStackView)
|
||||
make.width.lessThanOrEqualTo(width)
|
||||
make.height.greaterThanOrEqualTo(10)
|
||||
make.bottom.equalTo(-UIDevice.scaleWidth(width: 10))
|
||||
}
|
||||
|
||||
textView.snp.makeConstraints { make in
|
||||
|
@@ -40,6 +40,107 @@ class RoomChatScreenView: UIView {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private func setUILayout(){
|
||||
addSubview(chatTableView)
|
||||
chatTableView.snp.makeConstraints { make in
|
||||
make.leading.equalTo(UIDevice.scaleWidth(width: 15))
|
||||
make.top.bottom.right.equalTo(self)
|
||||
}
|
||||
|
||||
}
|
||||
private func registerCell(){
|
||||
chatTableView.delegate = self
|
||||
chatTableView.dataSource = self
|
||||
chatTableView.tableHeaderView = tableHeaderView
|
||||
chatTableView.register(RoomChatScreenUserChatCell.self, forCellReuseIdentifier: "RoomChatScreenUserChatCell")
|
||||
chatTableView.register(RoomChatScreenContentCell.self, forCellReuseIdentifier: "RoomChatScreenContentCell")
|
||||
}
|
||||
|
||||
|
||||
//MARK: - 懒加载
|
||||
var roomId = ""
|
||||
var msgList:[RoomMsgListModel] = []
|
||||
private lazy var chatTableView:UITableView = {
|
||||
let _chatTableView = UITableView(frame: .zero, style: .plain)
|
||||
_chatTableView.tableFooterView = UIView()
|
||||
_chatTableView.separatorStyle = .none
|
||||
_chatTableView.backgroundColor = .clear
|
||||
_chatTableView.showsVerticalScrollIndicator = false
|
||||
_chatTableView.tag = 888
|
||||
|
||||
|
||||
return _chatTableView
|
||||
}()
|
||||
private lazy var tableHeaderView:RoomChatScreenHeaderView = {
|
||||
let _tableHeaderView = RoomChatScreenHeaderView(frame: .zero)
|
||||
|
||||
return _tableHeaderView
|
||||
}()
|
||||
private lazy var chatManager:RoomChatScreenManager = {
|
||||
let _chatManager = RoomChatScreenManager()
|
||||
|
||||
return _chatManager
|
||||
}()
|
||||
}
|
||||
extension RoomChatScreenView:UITableViewDelegate,UITableViewDataSource{
|
||||
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
return msgList.count
|
||||
}
|
||||
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
|
||||
// let model = msgList[indexPath.row]
|
||||
// return model.height
|
||||
return UITableView.automaticDimension
|
||||
}
|
||||
func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
|
||||
return 100
|
||||
}
|
||||
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let model = msgList[safe: indexPath.row]
|
||||
if let _model = model, _model.isGift == true {
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "RoomChatScreenContentCell", for: indexPath) as! RoomChatScreenContentCell
|
||||
cell.textAtt = _model.att
|
||||
return cell
|
||||
}
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "RoomChatScreenUserChatCell", for: indexPath) as! RoomChatScreenUserChatCell
|
||||
|
||||
cell.model = model
|
||||
return cell
|
||||
}
|
||||
|
||||
func isAddMsg(msg:NIMMessage)->Bool{
|
||||
if let obj = msg.messageObject as? NIMCustomObject,let customObj = obj.attachment as? ChatCustomMsgModel{
|
||||
if customObj.first == 3 || customObj.first == 12{
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
|
||||
}
|
||||
func dealWithCustomMsg(msg:NIMMessage){
|
||||
guard isAddMsg(msg: msg) else { return }
|
||||
if let obj = msg.messageObject as? NIMCustomObject,let customObj = obj.attachment as? ChatCustomMsgModel{
|
||||
if customObj.first == 3{
|
||||
let att = chatManager.getSendGfitAtt(model: customObj, sendText: " 送给 ")
|
||||
var model = RoomMsgListModel()
|
||||
model.isGift = true
|
||||
model.att = att
|
||||
msgList.append(model)
|
||||
chatTableView.reloadData()
|
||||
}else if customObj.first == 12{
|
||||
let att = chatManager.getSendAllGfitAtt(model: customObj, sendText: " 全麦送出 ")
|
||||
var model = RoomMsgListModel()
|
||||
model.isGift = true
|
||||
model.att = att
|
||||
msgList.append(model)
|
||||
chatTableView.reloadData()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
func getTextMsg(msg:NIMMessage){
|
||||
dealWithMsg(msg: msg)
|
||||
chatTableView.reloadData()
|
||||
@@ -81,56 +182,4 @@ class RoomChatScreenView: UIView {
|
||||
self.msgList.append(model)
|
||||
|
||||
}
|
||||
var roomId = ""
|
||||
private func setUILayout(){
|
||||
addSubview(chatTableView)
|
||||
chatTableView.snp.makeConstraints { make in
|
||||
make.leading.equalTo(UIDevice.scaleWidth(width: 15))
|
||||
make.top.bottom.right.equalTo(self)
|
||||
}
|
||||
|
||||
}
|
||||
private func registerCell(){
|
||||
chatTableView.delegate = self
|
||||
chatTableView.dataSource = self
|
||||
chatTableView.tableHeaderView = tableHeaderView
|
||||
chatTableView.register(RoomChatScreenUserChatCell.self, forCellReuseIdentifier: "RoomChatScreenUserChatCell")
|
||||
}
|
||||
|
||||
|
||||
var msgList:[RoomMsgListModel] = []
|
||||
//MARK: - 懒加载
|
||||
private lazy var chatTableView:UITableView = {
|
||||
let _chatTableView = UITableView(frame: .zero, style: .plain)
|
||||
_chatTableView.tableFooterView = UIView()
|
||||
_chatTableView.separatorStyle = .none
|
||||
_chatTableView.backgroundColor = .clear
|
||||
_chatTableView.showsVerticalScrollIndicator = false
|
||||
_chatTableView.tag = 888
|
||||
|
||||
|
||||
return _chatTableView
|
||||
}()
|
||||
private lazy var tableHeaderView:RoomChatScreenHeaderView = {
|
||||
let _tableHeaderView = RoomChatScreenHeaderView(frame: .zero)
|
||||
|
||||
return _tableHeaderView
|
||||
}()
|
||||
}
|
||||
extension RoomChatScreenView:UITableViewDelegate,UITableViewDataSource{
|
||||
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
return msgList.count
|
||||
}
|
||||
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
|
||||
let model = msgList[indexPath.row]
|
||||
return model.height
|
||||
}
|
||||
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "RoomChatScreenUserChatCell", for: indexPath) as! RoomChatScreenUserChatCell
|
||||
let model = msgList[indexPath.row]
|
||||
cell.model = model
|
||||
return cell
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,92 @@
|
||||
//
|
||||
// RoomChatScreenManager.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/3/23.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import Nuke
|
||||
|
||||
class RoomChatScreenManager: NSObject {
|
||||
|
||||
func getSendGfitAtt(model:ChatCustomMsgModel,sendText:String)->NSMutableAttributedString?{
|
||||
|
||||
if let model = Deserialized<RectiveGiftModel>.toModel(with: model.data) {
|
||||
let giftData = model.gift == nil ? model.giftInfo : model.gift
|
||||
let giftUrl = giftData?.giftUrl ?? ""
|
||||
|
||||
let att = NSMutableAttributedString()
|
||||
att.append(getTextAtt(text: model.nick, color: ThemeColor(hexStr: "#FFD98C"), font: 12))
|
||||
att.append(getPlaceholderAtt(width: 2))
|
||||
att.append(getTextAtt(text: sendText, color: ThemeColor(hexStr: "#fffffe",alpha: 0.5), font: 12))
|
||||
att.append(getPlaceholderAtt(width: 2))
|
||||
att.append(getTextAtt(text: model.targetNick, color: ThemeColor(hexStr: "#FFD98C"), font: 12))
|
||||
att.append(getPlaceholderAtt(width: 2))
|
||||
att.append(getImageAtt(url: giftUrl))
|
||||
att.append(getPlaceholderAtt(width: 2))
|
||||
att.append(getTextAtt(text: "X\(model.giftNum)", color: .white, font: 12))
|
||||
return att
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func getSendAllGfitAtt(model:ChatCustomMsgModel,sendText:String)->NSMutableAttributedString?{
|
||||
|
||||
if let model = Deserialized<RectiveGiftModel>.toModel(with: model.data) {
|
||||
let giftData = model.gift == nil ? model.giftInfo : model.gift
|
||||
let giftUrl = giftData?.giftUrl ?? ""
|
||||
|
||||
let att = NSMutableAttributedString()
|
||||
att.append(getTextAtt(text: model.nick, color: ThemeColor(hexStr: "#FFD98C"), font: 12))
|
||||
att.append(getPlaceholderAtt(width: 2))
|
||||
att.append(getTextAtt(text: sendText, color: ThemeColor(hexStr: "#fffffe",alpha: 0.5), font: 12))
|
||||
att.append(getPlaceholderAtt(width: 2))
|
||||
att.append(getImageAtt(url: giftUrl))
|
||||
att.append(getPlaceholderAtt(width: 2))
|
||||
att.append(getTextAtt(text: "X\(model.giftNum)", color: .white, font: 12))
|
||||
return att
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func getPlaceholderAtt(width:CGFloat)->NSMutableAttributedString{
|
||||
let placeholderView = UIView()
|
||||
placeholderView.backgroundColor = .clear
|
||||
let width = placeholderView.bounds.size.width
|
||||
let height = placeholderView.bounds.size.height
|
||||
placeholderView.bounds = CGRect(x: 0, y: 0, width: UIDevice.scaleWidth(width: width), height: UIDevice.scaleWidth(width: 10))
|
||||
let att = NSMutableAttributedString.yy_attachmentString(withContent: placeholderView, contentMode: .scaleAspectFit, attachmentSize: CGSize(width: width, height: height), alignTo: UIFont.getScaleFont(ofSize: 15, weight: .regular), alignment: .center)
|
||||
return att
|
||||
}
|
||||
func getTextAtt(text:String,color:UIColor,font:CGFloat)->NSMutableAttributedString{
|
||||
let att = NSMutableAttributedString(string: text)
|
||||
att.yy_font = UIFont.getScaleFont(ofSize: font, weight: .regular)
|
||||
att.yy_color = color
|
||||
att.yy_paragraphStyle = getParagraphStyle()
|
||||
return att
|
||||
}
|
||||
func getParagraphStyle()->NSMutableParagraphStyle{
|
||||
let paragraphStyle = NSMutableParagraphStyle()
|
||||
paragraphStyle.lineSpacing = UIDevice.scaleWidth(width: 4)
|
||||
paragraphStyle.alignment = .left
|
||||
paragraphStyle.baseWritingDirection = .leftToRight
|
||||
return paragraphStyle
|
||||
}
|
||||
func getImageAtt(url:String)->NSMutableAttributedString{
|
||||
let imageView = UIImageView()
|
||||
Nuke.loadImage(with: url, into: imageView, completion: nil)
|
||||
|
||||
var bounds = CGRect(x: 0, y: 0, width:UIDevice.scaleWidth(width: 16) , height: UIDevice.scaleWidth(width: 16))
|
||||
if let image = imageView.image {
|
||||
let scale = image.size.width / (image.size.height == 0 ? 1 : image.size.height)
|
||||
bounds = CGRect(x: 0, y: 0, width:UIDevice.scaleWidth(width: 16) * scale , height: UIDevice.scaleWidth(width: 16))
|
||||
|
||||
}
|
||||
imageView.bounds = bounds
|
||||
imageView.layer.masksToBounds = true
|
||||
imageView.contentMode = .scaleAspectFit
|
||||
let width = imageView.bounds.size.width
|
||||
let height = imageView.bounds.size.height
|
||||
let att = NSMutableAttributedString.yy_attachmentString(withContent: imageView, contentMode: .scaleAspectFit, attachmentSize: CGSize(width:width , height: height), alignTo: UIFont.getScaleFont(ofSize: 15, weight: .regular), alignment: .center)
|
||||
return att
|
||||
}
|
||||
}
|
@@ -0,0 +1,169 @@
|
||||
//
|
||||
// RoomDynamicEffectView.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/3/23.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
|
||||
class RoomDynamicEffectView: UIView{
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
setUILayout()
|
||||
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
private func setUILayout(){
|
||||
addSubview(vapView)
|
||||
addSubview(svgaView)
|
||||
vapView.snp.makeConstraints { make in
|
||||
make.edges.equalTo(self)
|
||||
}
|
||||
svgaView.snp.makeConstraints { make in
|
||||
make.edges.equalTo(self)
|
||||
}
|
||||
}
|
||||
//MARK: - 懒加载
|
||||
var giftList:[RectiveGiftModel] = []
|
||||
var isPlay:Bool = false
|
||||
private lazy var vapView:UIView = {
|
||||
let _vapView = UIView()
|
||||
_vapView.backgroundColor = ThemeColor(hexStr: "#000000", alpha: 0.5)
|
||||
_vapView.isUserInteractionEnabled = true
|
||||
_vapView.contentMode = .scaleAspectFill
|
||||
_vapView.isHidden = true
|
||||
return _vapView
|
||||
}()
|
||||
private lazy var svgaView:SVGAImageView = {
|
||||
let _svgaView = SVGAImageView()
|
||||
_svgaView.backgroundColor = ThemeColor(hexStr: "#000000", alpha: 0.5)
|
||||
_svgaView.isUserInteractionEnabled = true
|
||||
_svgaView.delegate = self
|
||||
_svgaView.isHidden = true
|
||||
return _svgaView
|
||||
}()
|
||||
private lazy var svgaParser:SVGAParser = {
|
||||
let _svgaParser = SVGAParser()
|
||||
|
||||
return _svgaParser
|
||||
}()
|
||||
|
||||
}
|
||||
|
||||
extension RoomDynamicEffectView:SVGAPlayerDelegate,HWDMP4PlayDelegate {
|
||||
func viewDidFinishPlayMP4(_ totalFrameCount: Int, view container: UIView!) {
|
||||
DispatchQueue.main.async {
|
||||
self.playEffect()
|
||||
}
|
||||
|
||||
}
|
||||
func svgaPlayerDidFinishedAnimation(_ player: SVGAPlayer!) {
|
||||
playEffect()
|
||||
}
|
||||
func playSvgaEffect(model:RectiveGiftModel){
|
||||
guard let gift = model.gift == nil ? model.giftInfo : model.gift else { return }
|
||||
if let url = URL(string: gift.vggUrl){
|
||||
svgaView.isHidden = false
|
||||
svgaParser.parse(with: url) { item in
|
||||
if let _item = item{
|
||||
let width = _item.videoSize.width
|
||||
let height = _item.videoSize.height
|
||||
if width > height{
|
||||
self.svgaView.contentMode = .scaleAspectFit
|
||||
}else{
|
||||
let h = ScreenWidth * height / width
|
||||
self.svgaView.contentMode = h > ScreenHeight ? .scaleAspectFill : .scaleAspectFit
|
||||
}
|
||||
self.svgaView.loops = 1
|
||||
self.svgaView.clearsAfterStop = true
|
||||
self.svgaView.videoItem = item
|
||||
self.svgaView.startAnimation()
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
self.isPlay = false
|
||||
self.svgaView.isHidden = true
|
||||
}
|
||||
return
|
||||
}
|
||||
isPlay = false
|
||||
svgaView.isHidden = true
|
||||
}
|
||||
func playMp4Effect(model:RectiveGiftModel){
|
||||
if let gift = model.gift == nil ? model.giftInfo : model.gift{
|
||||
PlayVoiceManager.downloadFile(url: gift.viewUrl) { url in
|
||||
self.vapView.isHidden = false
|
||||
self.vapView.setMute(true)
|
||||
self.vapView.playHWDMP4(url, repeatCount: 1, delegate: self)
|
||||
}fail: {
|
||||
self.isPlay = false
|
||||
self.vapView.isHidden = true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
func playEffect(){
|
||||
if !giftList.isEmpty{
|
||||
giftList.removeFirst()
|
||||
}
|
||||
if !giftList.isEmpty{
|
||||
guard let model = giftList.first, let gift = model.gift == nil ? model.giftInfo : model.gift else {
|
||||
isPlay = false
|
||||
vapView.isHidden = true
|
||||
svgaView.isHidden = true
|
||||
return
|
||||
}
|
||||
if !gift.vggUrl.isEmpty{
|
||||
giftList.append(model)
|
||||
if isPlay == false{
|
||||
isPlay = true
|
||||
playSvgaEffect(model: model)
|
||||
}
|
||||
}else if !gift.viewUrl.isEmpty{
|
||||
giftList.append(model)
|
||||
if isPlay == false{
|
||||
isPlay = true
|
||||
playMp4Effect(model: model)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
isPlay = false
|
||||
vapView.isHidden = true
|
||||
svgaView.isHidden = true
|
||||
}
|
||||
func dealWithCustomMsg(msg:NIMMessage){
|
||||
|
||||
if let obj = msg.messageObject as? NIMCustomObject,let customObj = obj.attachment as? ChatCustomMsgModel{
|
||||
if customObj.first == 3 || customObj.first == 12{
|
||||
if let model = Deserialized<RectiveGiftModel>.toModel(with: customObj.data),let gift = model.gift == nil ? model.giftInfo : model.gift {
|
||||
|
||||
|
||||
if !gift.vggUrl.isEmpty{
|
||||
giftList.append(model)
|
||||
if isPlay == false{
|
||||
isPlay = true
|
||||
playSvgaEffect(model: model)
|
||||
}
|
||||
}else if !gift.viewUrl.isEmpty{
|
||||
giftList.append(model)
|
||||
if isPlay == false{
|
||||
isPlay = true
|
||||
playMp4Effect(model: model)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -7,8 +7,10 @@
|
||||
|
||||
import UIKit
|
||||
import NIMSDK
|
||||
typealias ClickMenuViewBlcok = () -> Void
|
||||
|
||||
typealias ClickMenuViewBlcok = (_ type:RoomMenuType) -> Void
|
||||
enum RoomMenuType {
|
||||
case chat,sendGift
|
||||
}
|
||||
|
||||
class RoomMenuView: UIView {
|
||||
|
||||
@@ -59,18 +61,23 @@ class RoomMenuView: UIView {
|
||||
}
|
||||
@objc func clickChatViewAction(){
|
||||
if let _clickMenuViewBlcok = clickMenuViewBlcok{
|
||||
_clickMenuViewBlcok()
|
||||
_clickMenuViewBlcok(.chat)
|
||||
}
|
||||
|
||||
}
|
||||
@objc func clickSendGiftAction(){
|
||||
if let _clickMenuViewBlcok = clickMenuViewBlcok{
|
||||
_clickMenuViewBlcok(.sendGift)
|
||||
}
|
||||
}
|
||||
@objc func clickMicBtnAction(){
|
||||
micBtn.isSelected = !micBtn.isSelected
|
||||
if micBtn.isSelected {
|
||||
YinRoomAudMioanager.share.muteLocalAudio(mute: true)
|
||||
YinRoomAudioManager.share.muteLocalAudio(mute: true)
|
||||
RoomVCViewModel.roomVM.isMute = true
|
||||
return
|
||||
}
|
||||
YinRoomAudMioanager.share.muteLocalAudio(mute: false)
|
||||
YinRoomAudioManager.share.muteLocalAudio(mute: false)
|
||||
RoomVCViewModel.roomVM.isMute = false
|
||||
}
|
||||
|
||||
@@ -91,14 +98,14 @@ class RoomMenuView: UIView {
|
||||
micBtn.isHidden = false
|
||||
micBtn.isSelected = true
|
||||
isHaveChange = true
|
||||
YinRoomAudMioanager.share.muteLocalAudio(mute: true)
|
||||
YinRoomAudioManager.share.muteLocalAudio(mute: true)
|
||||
RoomVCViewModel.roomVM.isMute = true
|
||||
}
|
||||
}else if changeType == 2{
|
||||
|
||||
if AuthManager.userUid == userData.uid{
|
||||
micBtn.isHidden = true
|
||||
YinRoomAudMioanager.share.muteLocalAudio(mute: true)
|
||||
YinRoomAudioManager.share.muteLocalAudio(mute: true)
|
||||
RoomVCViewModel.roomVM.isMute = true
|
||||
}
|
||||
}
|
||||
@@ -106,7 +113,7 @@ class RoomMenuView: UIView {
|
||||
|
||||
}
|
||||
if isHaveChange{
|
||||
YinRoomAudMioanager.share.setBroadcast(isChange: isHaveChange)
|
||||
YinRoomAudioManager.share.setBroadcast(isChange: isHaveChange)
|
||||
|
||||
}
|
||||
|
||||
@@ -161,6 +168,7 @@ class RoomMenuView: UIView {
|
||||
private lazy var sendGiftBtn :UIButton = {
|
||||
let _sendGiftBtn = UIButton()
|
||||
_sendGiftBtn.setImage(UIImage(named: "room_send_gift_icon"), for: .normal)
|
||||
_sendGiftBtn.addTarget(self, action: #selector(clickSendGiftAction), for: .touchUpInside)
|
||||
return _sendGiftBtn
|
||||
}()
|
||||
}
|
||||
|
@@ -8,8 +8,10 @@
|
||||
import UIKit
|
||||
import NIMSDK
|
||||
|
||||
class RoomSendTextView: UIView {
|
||||
typealias SendGiftNumBlock = (_ text:String) -> Void
|
||||
|
||||
class RoomSendTextView: UIView {
|
||||
var sendGiftNumBlock:SendGiftNumBlock?
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
setUILayout()
|
||||
@@ -66,7 +68,22 @@ class RoomSendTextView: UIView {
|
||||
}
|
||||
|
||||
@objc func sendTextAction(){
|
||||
if isSendGiftNum {
|
||||
if let _sendGiftNumBlock = self.sendGiftNumBlock{
|
||||
if let text = textFiled.text,text.isEmpty{
|
||||
HUDTool.show(with: "请输入礼物数量")
|
||||
return
|
||||
}
|
||||
_sendGiftNumBlock(self.textFiled.text ?? "")
|
||||
textFiled.resignFirstResponder()
|
||||
textFiled.text = ""
|
||||
}
|
||||
return
|
||||
}
|
||||
guard let user = self.user else { return }
|
||||
|
||||
|
||||
|
||||
let msg = NIMMessage()
|
||||
msg.text = textFiled.text
|
||||
let ext = ["\(AuthManager.userUid)":["erbanNo":"\(user.erbanNo ?? 0)","charmUrl":user.userLevelVo?.charmUrl,"experUrl":user.userLevelVo?.experUrl]]
|
||||
@@ -82,6 +99,14 @@ class RoomSendTextView: UIView {
|
||||
|
||||
}
|
||||
@objc func textFieldEditChanged(textField:UITextField){
|
||||
if isSendGiftNum {
|
||||
if let text = textField.text,text.count > 0{
|
||||
if Int(text) ?? 0 > 9999{
|
||||
textField.text = "9999"
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
guard let text = textField.text else {
|
||||
sendTextBtn.isEnabled = false
|
||||
return
|
||||
@@ -91,6 +116,15 @@ class RoomSendTextView: UIView {
|
||||
//MARK: - 懒加载
|
||||
var user:UserObject?
|
||||
var roomUid = ""
|
||||
var isSendGiftNum:Bool = false {
|
||||
didSet{
|
||||
sendTextBtn.isEnabled = true
|
||||
|
||||
let textAtt = NSAttributedString(string: "请输入赠送数额", attributes: [.font:UIFont.getScaleFont(ofSize: 15, weight: .regular),.foregroundColor:ThemeColor(hexStr: "#878B9C")])
|
||||
textFiled.attributedPlaceholder = textAtt
|
||||
sendTextBtn.setTitle("确认", for: .normal)
|
||||
}
|
||||
}
|
||||
lazy var textFiled:UITextField = {
|
||||
let _textFiled = UITextField()
|
||||
let textAtt = NSAttributedString(string: "请输入消息...", attributes: [.font:UIFont.getScaleFont(ofSize: 15, weight: .regular),.foregroundColor:ThemeColor(hexStr: "#878B9C")])
|
||||
@@ -122,7 +156,30 @@ class RoomSendTextView: UIView {
|
||||
}
|
||||
extension RoomSendTextView:UITextFieldDelegate{
|
||||
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
|
||||
|
||||
|
||||
textField.resignFirstResponder()
|
||||
return true
|
||||
}
|
||||
|
||||
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
|
||||
if self.isSendGiftNum{
|
||||
let length = string.lengthOfBytes(using: String.Encoding.utf8)
|
||||
for loopIndex in 0..<length {
|
||||
let char = (string as NSString).character(at: loopIndex)
|
||||
if char < 48 {
|
||||
return false
|
||||
}
|
||||
if char > 57 {
|
||||
return false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ class YinRoomRankItemView: UIView {
|
||||
let amount = _model.goldAmount
|
||||
var text = "\(amount)"
|
||||
if amount >= 10000{
|
||||
text = String(format: "%.1fw", amount / 10000)
|
||||
text = String(format: "%.1fw", Double(amount) / 10000.0)
|
||||
}
|
||||
numView.text = text
|
||||
}
|
||||
|
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// RectiveGiftModel.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/3/23.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import HandyJSON
|
||||
class RectiveGiftModel: HandyJSON{
|
||||
required init(){
|
||||
|
||||
}
|
||||
var targetUid = ""
|
||||
|
||||
var targetAvatar = ""
|
||||
var targetNick = ""
|
||||
var targetUids:[String] = []
|
||||
|
||||
var gift:SendGiftModel?
|
||||
|
||||
var giftInfo:SendGiftModel?
|
||||
|
||||
var uid = ""
|
||||
|
||||
var giftId = ""
|
||||
|
||||
var nick = ""
|
||||
|
||||
var avatar = ""
|
||||
var giftNum = 0
|
||||
var giftName = ""
|
||||
var vggUrl = ""
|
||||
var viewUrl = ""
|
||||
var targetUsers:[RectiveGiftUserModel] = []
|
||||
var sourceType = 0
|
||||
var roomSendGiftType = 0
|
||||
var isBatch = false
|
||||
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// RectiveGiftUserModel.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/3/23.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import HandyJSON
|
||||
class RectiveGiftUserModel: HandyJSON {
|
||||
required init(){
|
||||
|
||||
}
|
||||
|
||||
var nick = ""
|
||||
var avatar = ""
|
||||
var uid = 0
|
||||
}
|
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// SendGiftModel.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/3/22.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import HandyJSON
|
||||
|
||||
class SendGiftModel: HandyJSON{
|
||||
required init() {
|
||||
|
||||
}
|
||||
var giftType = ""
|
||||
var giftId = 0
|
||||
|
||||
var giftName = ""
|
||||
|
||||
var goldPrice = 0
|
||||
|
||||
var giftUrl = ""
|
||||
|
||||
var hasVggPic = false
|
||||
|
||||
var vggUrl = ""
|
||||
|
||||
var hasLatest = false
|
||||
|
||||
var hasTimeLimit = false
|
||||
|
||||
var hasEffect = false
|
||||
|
||||
var roomExclude = false
|
||||
|
||||
var isSendMsg = false
|
||||
|
||||
|
||||
var viewUrl = ""
|
||||
|
||||
|
||||
var count = 0
|
||||
var reciveCount = 0
|
||||
|
||||
|
||||
var isSelected = false
|
||||
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// SendGiftSendNumModel.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/3/22.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import HandyJSON
|
||||
class SendGiftSendNumModel: HandyJSON{
|
||||
required init() {
|
||||
|
||||
}
|
||||
|
||||
required init(text:String,num:String){
|
||||
self.text = text
|
||||
self.num = num
|
||||
}
|
||||
var text = ""
|
||||
var num = ""
|
||||
var isCustom = false
|
||||
}
|
@@ -8,7 +8,10 @@
|
||||
import UIKit
|
||||
import HandyJSON
|
||||
|
||||
struct SendGiftUserModel: HandyJSON{
|
||||
class SendGiftUserModel: HandyJSON{
|
||||
required init(){
|
||||
|
||||
}
|
||||
var avatar = ""
|
||||
var nick = ""
|
||||
var position = ""
|
||||
|
153
yinmeng-ios/Modules/Room/View/SendGift/View/SendGiftCell.swift
Normal file
@@ -0,0 +1,153 @@
|
||||
//
|
||||
// SendGiftCell.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/3/22.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import Nuke
|
||||
|
||||
class SendGiftCell: UICollectionViewCell {
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
setUILayout()
|
||||
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
private func setUILayout(){
|
||||
contentView.addSubview(selectView)
|
||||
contentView.addSubview(tagContainerView)
|
||||
contentView.addSubview(giftView)
|
||||
contentView.addSubview(nameView)
|
||||
contentView.addSubview(diamondContainerView)
|
||||
contentView.addSubview(giftNumView)
|
||||
|
||||
tagContainerView.addArrangedSubview(tagDedicatedView)
|
||||
tagContainerView.addArrangedSubview(tagLatestView)
|
||||
tagContainerView.addArrangedSubview(tagLimitView)
|
||||
tagContainerView.addArrangedSubview(tagEffectView)
|
||||
|
||||
diamondContainerView.addArrangedSubview(diamondView)
|
||||
diamondContainerView.addArrangedSubview(diamondNumView)
|
||||
|
||||
selectView.snp.makeConstraints { make in
|
||||
make.edges.equalTo(contentView)
|
||||
}
|
||||
tagContainerView.snp.makeConstraints { make in
|
||||
make.trailing.top.equalTo(contentView).inset(UIDevice.scaleWidth(width: 3))
|
||||
make.height.equalTo(UIDevice.scaleWidth(width: 14))
|
||||
}
|
||||
giftView.snp.makeConstraints { make in
|
||||
make.width.height.equalTo(UIDevice.scaleWidth(width: 48))
|
||||
make.top.equalTo(UIDevice.scaleWidth(width: 18))
|
||||
make.centerX.equalTo(contentView)
|
||||
}
|
||||
nameView.snp.makeConstraints { make in
|
||||
make.top.equalTo(giftView.snp.bottom).offset(UIDevice.scaleWidth(width: 3))
|
||||
make.centerX.equalTo(contentView)
|
||||
}
|
||||
diamondContainerView.snp.makeConstraints { make in
|
||||
make.top.equalTo(nameView.snp.bottom).offset(UIDevice.scaleWidth(width: 5))
|
||||
make.centerX.equalTo(contentView)
|
||||
make.height.equalTo(UIDevice.scaleWidth(width: 10))
|
||||
}
|
||||
diamondView.snp.makeConstraints { make in
|
||||
make.width.equalTo(UIDevice.scaleWidth(width: 10))
|
||||
}
|
||||
giftNumView.snp.makeConstraints { make in
|
||||
make.top.equalTo(UIDevice.scaleWidth(width: 4.5))
|
||||
make.leading.equalTo(UIDevice.scaleWidth(width: 6))
|
||||
}
|
||||
|
||||
}
|
||||
var giftModel:SendGiftModel? = nil{
|
||||
didSet{
|
||||
guard let _giftModel = giftModel else { return }
|
||||
Nuke.loadImage(with: _giftModel.giftUrl, into: giftView, completion: nil)
|
||||
nameView.text = _giftModel.giftName
|
||||
diamondNumView.text = "\(_giftModel.goldPrice)"
|
||||
giftNumView.isHidden = _giftModel.count <= 0
|
||||
giftNumView.text = "x\(_giftModel.count)"
|
||||
tagDedicatedView.isHidden = !_giftModel.roomExclude
|
||||
tagLatestView.isHidden = !_giftModel.hasLatest
|
||||
tagLimitView.isHidden = !_giftModel.hasTimeLimit
|
||||
tagEffectView.isHidden = !_giftModel.hasEffect
|
||||
selectView.isHidden = !_giftModel.isSelected
|
||||
|
||||
}
|
||||
}
|
||||
//MARK: - 懒加载
|
||||
private lazy var tagContainerView:UIStackView = {
|
||||
let _tagContainerView = UIStackView()
|
||||
_tagContainerView.axis = .horizontal
|
||||
_tagContainerView.distribution = .fill
|
||||
_tagContainerView.alignment = .center
|
||||
_tagContainerView.spacing = UIDevice.scaleWidth(width: 2)
|
||||
|
||||
return _tagContainerView
|
||||
}()
|
||||
private lazy var tagDedicatedView:UIImageView = {
|
||||
let _tagDedicatedView = UIImageView()
|
||||
_tagDedicatedView.image = UIImage(named: "yin_room_gift_tag_dedicated")
|
||||
|
||||
return _tagDedicatedView
|
||||
}()
|
||||
private lazy var tagLimitView:UIImageView = {
|
||||
let _tagLimitView = UIImageView()
|
||||
_tagLimitView.image = UIImage(named: "yin_room_gift_tag_limit")
|
||||
return _tagLimitView
|
||||
}()
|
||||
private lazy var tagEffectView:UIImageView = {
|
||||
let _tagEffectView = UIImageView()
|
||||
_tagEffectView.image = UIImage(named: "yin_room_gift_tag_effect")
|
||||
return _tagEffectView
|
||||
}()
|
||||
private lazy var tagLatestView:UIImageView = {
|
||||
let _tagLatestView = UIImageView()
|
||||
_tagLatestView.image = UIImage(named: "yin_room_gift_tag_latest")
|
||||
return _tagLatestView
|
||||
}()
|
||||
private lazy var diamondContainerView:UIStackView = {
|
||||
let _diamondContainerView = UIStackView()
|
||||
_diamondContainerView.axis = .horizontal
|
||||
_diamondContainerView.distribution = .fill
|
||||
_diamondContainerView.alignment = .center
|
||||
_diamondContainerView.spacing = UIDevice.scaleWidth(width: 2)
|
||||
|
||||
return _diamondContainerView
|
||||
}()
|
||||
private lazy var diamondView:UIImageView = {
|
||||
let _diamondView = UIImageView()
|
||||
_diamondView.image = UIImage(named: "yin_room_gift_diamond")
|
||||
return _diamondView
|
||||
}()
|
||||
private lazy var diamondNumView:UILabel = {
|
||||
let _diamondNumView = UILabel.getCustomLabel(text: "0",font: UIFont.getScaleFont(ofSize: 9, weight: .regular),color: .white)
|
||||
return _diamondNumView
|
||||
}()
|
||||
private lazy var nameView:UILabel = {
|
||||
let _nameView = UILabel.getCustomLabel(text: "",font: UIFont.getScaleFont(ofSize: 10, weight: .semibold),color: .white,textAlignment: .center)
|
||||
|
||||
return _nameView
|
||||
}()
|
||||
private lazy var giftNumView:UILabel = {
|
||||
let _giftNumView = UILabel.getCustomLabel(font: UIFont.getScaleFont(ofSize: 10, weight: .regular),color: UIColor(white: 1, alpha: 0.6))
|
||||
|
||||
return _giftNumView
|
||||
}()
|
||||
private lazy var giftView:UIImageView = {
|
||||
let _giftView = UIImageView()
|
||||
|
||||
return _giftView
|
||||
}()
|
||||
private lazy var selectView:UIImageView = {
|
||||
let _selectView = UIImageView()
|
||||
_selectView.image = UIImage(named: "yin_room_gift_select")
|
||||
|
||||
return _selectView
|
||||
}()
|
||||
}
|
@@ -1,46 +0,0 @@
|
||||
//
|
||||
// SendGiftFaceplateView.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/3/14.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class SendGiftFaceplateView: UIView {
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
setUILayout()
|
||||
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
private func setUILayout(){
|
||||
addSubview(dissBtn)
|
||||
addSubview(bgMaskView)
|
||||
addSubview(contentStackView)
|
||||
}
|
||||
//MARK: - 懒加载
|
||||
private lazy var dissBtn:UIButton = {
|
||||
let _dissBtn = UIButton()
|
||||
return _dissBtn
|
||||
}()
|
||||
private lazy var bgMaskView:UIVisualEffectView = {
|
||||
let blur = UIBlurEffect(style: .dark)
|
||||
let _bgMaskView = UIVisualEffectView(effect: blur)
|
||||
|
||||
return _bgMaskView
|
||||
}()
|
||||
private lazy var contentStackView:UIStackView = {
|
||||
let _contentStackView = UIStackView()
|
||||
_contentStackView.axis = .vertical
|
||||
_contentStackView.distribution = .fill
|
||||
_contentStackView.alignment = .fill
|
||||
_contentStackView.spacing = 0
|
||||
_contentStackView.backgroundColor = .clear
|
||||
return _contentStackView
|
||||
}()
|
||||
}
|
@@ -0,0 +1,80 @@
|
||||
//
|
||||
// SendGiftSendNumCell.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/3/22.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class SendGiftSendNumCell: UITableViewCell {
|
||||
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
setUILayout()
|
||||
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
private func setUILayout(){
|
||||
selectionStyle = .none
|
||||
backgroundColor = .clear
|
||||
contentView.backgroundColor = .clear
|
||||
contentView.addSubview(textVeiw)
|
||||
contentView.addSubview(numView)
|
||||
contentView.addSubview(arrowView)
|
||||
textVeiw.snp.makeConstraints { make in
|
||||
make.leading.equalTo(UIDevice.scaleWidth(width: 20))
|
||||
make.centerY.equalTo(self.contentView)
|
||||
|
||||
}
|
||||
numView.snp.makeConstraints { make in
|
||||
make.trailing.equalTo(-UIDevice.scaleWidth(width: 20))
|
||||
make.centerY.equalTo(self.contentView)
|
||||
make.leading.greaterThanOrEqualTo(textVeiw.snp.trailing).offset(UIDevice.scaleWidth(width: 5))
|
||||
}
|
||||
arrowView.snp.makeConstraints { make in
|
||||
make.trailing.equalTo(-UIDevice.scaleWidth(width: 20))
|
||||
make.centerY.equalTo(self.contentView)
|
||||
make.width.height.equalTo(UIDevice.scaleWidth(width: 10))
|
||||
}
|
||||
}
|
||||
|
||||
//MARK: - 懒加载
|
||||
var model:SendGiftSendNumModel? = nil{
|
||||
didSet{
|
||||
guard let _model = model else { return}
|
||||
textVeiw.text = _model.text
|
||||
numView.text = _model.num
|
||||
arrowView.isHidden = !_model.isCustom
|
||||
}
|
||||
}
|
||||
private lazy var numView:UILabel = {
|
||||
let _numView = UILabel.getCustomLabel(font: UIFont.getScaleFont(ofSize: 14, weight: .regular),color: ThemeColor(hexStr: "#FFE710"),textAlignment: .right)
|
||||
|
||||
return _numView
|
||||
}()
|
||||
private lazy var textVeiw:UILabel = {
|
||||
let _textVeiw = UILabel.getCustomLabel(font: UIFont.getScaleFont(ofSize: 13, weight: .regular),color: .white)
|
||||
|
||||
return _textVeiw
|
||||
}()
|
||||
private lazy var arrowView:UIImageView = {
|
||||
let _arrowView = UIImageView()
|
||||
_arrowView.image = UIImage(named: "yin_room_gift_arrow")
|
||||
|
||||
return _arrowView
|
||||
}()
|
||||
override func awakeFromNib() {
|
||||
super.awakeFromNib()
|
||||
// Initialization code
|
||||
}
|
||||
|
||||
override func setSelected(_ selected: Bool, animated: Bool) {
|
||||
super.setSelected(selected, animated: animated)
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,98 @@
|
||||
//
|
||||
// SendGiftSendNumView.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/3/22.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
typealias ClickSendNumBlcok = (_ model:SendGiftSendNumModel) -> Void
|
||||
|
||||
|
||||
class SendGiftSendNumView: UIView {
|
||||
var clickSendNumBlcok:ClickSendNumBlcok?
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
setUILayout()
|
||||
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
private func setUILayout(){
|
||||
layer.cornerRadius = UIDevice.scaleWidth(width: 12)
|
||||
layer.masksToBounds = true
|
||||
let model1 = SendGiftSendNumModel(text: "一心一意", num: "1")
|
||||
let model10 = SendGiftSendNumModel(text: "十全十美", num: "10")
|
||||
let model66 = SendGiftSendNumModel(text: "一切顺利", num: "66")
|
||||
let model99 = SendGiftSendNumModel(text: "长长久久", num: "99")
|
||||
let model188 = SendGiftSendNumModel(text: "要抱抱", num: "188")
|
||||
let model520 = SendGiftSendNumModel(text: "我爱你", num: "520")
|
||||
let model1314 = SendGiftSendNumModel(text: "一生一世", num: "1314")
|
||||
let otherModel = SendGiftSendNumModel(text: "其他数额", num: "")
|
||||
otherModel.isCustom = true
|
||||
listData.append(model1)
|
||||
listData.append(model10)
|
||||
listData.append(model66)
|
||||
listData.append(model99)
|
||||
listData.append(model188)
|
||||
listData.append(model520)
|
||||
listData.append(model1314)
|
||||
listData.append(otherModel)
|
||||
|
||||
|
||||
addSubview(visualEffectView)
|
||||
addSubview(tableView)
|
||||
|
||||
visualEffectView.snp.makeConstraints { make in
|
||||
make.edges.equalTo(self)
|
||||
}
|
||||
tableView.snp.makeConstraints { make in
|
||||
make.edges.equalTo(self)
|
||||
}
|
||||
tableView.delegate = self
|
||||
tableView.dataSource = self
|
||||
tableView.register(SendGiftSendNumCell.self, forCellReuseIdentifier: "SendGiftSendNumCell")
|
||||
|
||||
|
||||
}
|
||||
//MARK: - 懒加载
|
||||
var listData:[SendGiftSendNumModel] = []
|
||||
private lazy var visualEffectView:UIVisualEffectView = {
|
||||
let blue = UIBlurEffect(style: .dark)
|
||||
let _visualEffectView = UIVisualEffectView.init(effect: blue)
|
||||
|
||||
return _visualEffectView
|
||||
}()
|
||||
private lazy var tableView:UITableView = {
|
||||
let _tableView = UITableView(frame: .zero, style: .plain)
|
||||
_tableView.separatorStyle = .none
|
||||
_tableView.backgroundColor = ThemeColor(hexStr: "#000000", alpha: 0.1)
|
||||
|
||||
return _tableView
|
||||
}()
|
||||
}
|
||||
extension SendGiftSendNumView:UITableViewDelegate,UITableViewDataSource{
|
||||
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
return listData.count
|
||||
}
|
||||
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
|
||||
return UIDevice.scaleWidth(width: 28)
|
||||
}
|
||||
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "SendGiftSendNumCell", for: indexPath) as! SendGiftSendNumCell
|
||||
cell.model = listData[safe: indexPath.row]
|
||||
return cell
|
||||
}
|
||||
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
|
||||
if let _clickSendNumBlcok = clickSendNumBlcok{
|
||||
let model = listData[safe: indexPath.row]!
|
||||
_clickSendNumBlcok(model)
|
||||
self.removeFromSuperview()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,204 @@
|
||||
//
|
||||
// SendGiftSendView.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/3/22.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
enum SendGiftSendViewType {
|
||||
case pay,send
|
||||
}
|
||||
typealias ClickSendGiftBlock = (_ type:SendGiftSendViewType,_ count:String)->Void
|
||||
|
||||
class SendGiftSendView: UIView {
|
||||
var clickSendGiftBlock:ClickSendGiftBlock?
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
setUILayout()
|
||||
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
private func setUILayout(){
|
||||
backgroundColor = .clear
|
||||
addSubview(bgRechargeView)
|
||||
addSubview(sendStackView)
|
||||
|
||||
bgRechargeView.addArrangedSubview(diamondView)
|
||||
bgRechargeView.addArrangedSubview(diamondNumView)
|
||||
bgRechargeView.addArrangedSubview(arrowView)
|
||||
|
||||
sendStackView.addArrangedSubview(numView)
|
||||
sendStackView.addArrangedSubview(sendArrowView)
|
||||
sendStackView.addArrangedSubview(sendBtn)
|
||||
self.snp.makeConstraints { make in
|
||||
make.height.equalTo(UIDevice.scaleWidth(width: 45) + SafeAraeBottomHeight)
|
||||
}
|
||||
bgRechargeView.snp.makeConstraints { make in
|
||||
make.leading.equalTo(UIDevice.scaleWidth(width: 15))
|
||||
make.height.equalTo(UIDevice.scaleWidth(width: 32))
|
||||
make.centerY.equalTo(sendBtn)
|
||||
}
|
||||
sendStackView.snp.makeConstraints { make in
|
||||
make.trailing.equalTo(-UIDevice.scaleWidth(width: 15))
|
||||
make.top.equalTo(UIDevice.scaleWidth(width: 11))
|
||||
make.height.equalTo(UIDevice.scaleWidth(width: 32))
|
||||
}
|
||||
diamondView.snp.makeConstraints { make in
|
||||
make.leading.equalTo(UIDevice.scaleWidth(width: 10))
|
||||
make.width.height.equalTo(UIDevice.scaleWidth(width: 14))
|
||||
}
|
||||
arrowView.snp.makeConstraints { make in
|
||||
make.trailing.equalTo(-UIDevice.scaleWidth(width: 10))
|
||||
make.width.height.equalTo(UIDevice.scaleWidth(width: 15))
|
||||
}
|
||||
numView.snp.makeConstraints { make in
|
||||
make.width.equalTo(UIDevice.scaleWidth(width: 40))
|
||||
make.height.equalTo(UIDevice.scaleWidth(width: 30))
|
||||
}
|
||||
sendArrowView.snp.makeConstraints { make in
|
||||
make.width.height.equalTo(UIDevice.scaleWidth(width: 30))
|
||||
}
|
||||
sendBtn.snp.makeConstraints { make in
|
||||
make.width.equalTo(UIDevice.scaleWidth(width: 60))
|
||||
make.height.equalTo(UIDevice.scaleWidth(width: 30))
|
||||
}
|
||||
sendNumView.clickSendNumBlcok = {[weak self] model in
|
||||
guard let self = self else { return }
|
||||
if model.isCustom{
|
||||
|
||||
self.superview?.superview?.superview?.addSubview(self.sendTextView)
|
||||
self.sendTextView.textFiled.becomeFirstResponder()
|
||||
return
|
||||
}
|
||||
self.numView.text = model.num
|
||||
|
||||
}
|
||||
sendTextView.sendGiftNumBlock = {[weak self] text in
|
||||
guard let self = self else { return }
|
||||
self.numView.text = text
|
||||
|
||||
}
|
||||
let tap = UITapGestureRecognizer.init(target: self, action: #selector(clickPyaAction))
|
||||
bgRechargeView.isUserInteractionEnabled = true
|
||||
bgRechargeView.addGestureRecognizer(tap)
|
||||
|
||||
}
|
||||
@objc func clickPyaAction(){
|
||||
if let clickSendGiftBlock = self.clickSendGiftBlock{
|
||||
clickSendGiftBlock(.pay,"0")
|
||||
}
|
||||
}
|
||||
|
||||
@objc func clickSendGiftAction(){
|
||||
if let clickSendGiftBlock = self.clickSendGiftBlock,let text = numView.text{
|
||||
clickSendGiftBlock(.send,text)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@objc func clickSendArrowAction(){
|
||||
if (sendNumView.superview == nil){
|
||||
superview?.superview?.addSubview(sendNumView)
|
||||
let bottom = -UIDevice.scaleWidth(width: 45)-SafeAraeBottomHeight
|
||||
sendNumView.snp.makeConstraints { make in
|
||||
make.trailing.equalTo(-UIDevice.scaleWidth(width: 15))
|
||||
make.bottom.equalTo( bottom)
|
||||
make.width.equalTo(UIDevice.scaleWidth(width: 135))
|
||||
make.height.equalTo(UIDevice.scaleWidth(width: 224))
|
||||
}
|
||||
}
|
||||
sendArrowView.isSelected = !sendArrowView.isSelected
|
||||
sendNumView.isHidden = !sendArrowView.isSelected
|
||||
}
|
||||
//MARK: - 懒加载
|
||||
var diamond:String = "0"{
|
||||
didSet{
|
||||
diamondNumView.text = diamond
|
||||
}
|
||||
}
|
||||
var isEnabled = true{
|
||||
didSet{
|
||||
sendBtn.isEnabled = isEnabled
|
||||
}
|
||||
}
|
||||
private lazy var bgRechargeView:UIStackView = {
|
||||
let _bgRechargeView = UIStackView()
|
||||
_bgRechargeView.axis = .horizontal
|
||||
_bgRechargeView.distribution = .fill
|
||||
_bgRechargeView.alignment = .center
|
||||
_bgRechargeView.spacing = UIDevice.scaleWidth(width: 3)
|
||||
_bgRechargeView.backgroundColor = ThemeColor(hexStr: "#000000")
|
||||
_bgRechargeView.layer.cornerRadius = UIDevice.scaleWidth(width: 32)/2
|
||||
_bgRechargeView.layer.masksToBounds = true
|
||||
return _bgRechargeView
|
||||
}()
|
||||
private lazy var diamondView:UIImageView = {
|
||||
let _diamondView = UIImageView()
|
||||
_diamondView.image = UIImage(named: "yin_room_gift_diamond")
|
||||
return _diamondView
|
||||
}()
|
||||
private lazy var diamondNumView:UILabel = {
|
||||
let _diamondNumView = UILabel.getCustomLabel(text: "0",font: UIFont.getScaleFont(ofSize: 13, weight: .regular),color:.white)
|
||||
|
||||
return _diamondNumView
|
||||
}()
|
||||
private lazy var arrowView:UIImageView = {
|
||||
let _arrowView = UIImageView()
|
||||
_arrowView.image = UIImage(named: "yin_room_gift_arrow")
|
||||
|
||||
return _arrowView
|
||||
}()
|
||||
|
||||
private lazy var sendStackView:UIStackView = {
|
||||
let _sendStackView = UIStackView()
|
||||
_sendStackView.axis = .horizontal
|
||||
_sendStackView.distribution = .fill
|
||||
_sendStackView.alignment = .center
|
||||
_sendStackView.spacing = 1
|
||||
_sendStackView.layer.masksToBounds = true
|
||||
_sendStackView.layer.cornerRadius = UIDevice.scaleWidth(width: 15)
|
||||
_sendStackView.layer.borderColor = ThemeColor(hexStr: "#FFE710").cgColor
|
||||
_sendStackView.layer.borderWidth = 1
|
||||
|
||||
return _sendStackView
|
||||
}()
|
||||
private lazy var numView:UILabel = {
|
||||
let _numView = UILabel.getCustomLabel(text: "1",font: UIFont.getScaleFont(ofSize: 13, weight: .regular),color: .white,textAlignment: .center)
|
||||
|
||||
return _numView
|
||||
}()
|
||||
private lazy var sendArrowView:UIButton = {
|
||||
let _sendArrowView = UIButton()
|
||||
_sendArrowView.setImage( UIImage(named: "yin_room_gift_up_arrow"), for: .normal)
|
||||
_sendArrowView.transform = CGAffineTransform(rotationAngle: Double.pi)
|
||||
_sendArrowView.addTarget(self, action: #selector(clickSendArrowAction), for: .touchUpInside)
|
||||
return _sendArrowView
|
||||
}()
|
||||
private lazy var sendBtn:UIButton = {
|
||||
let image = UIImage.image(color: ThemeColor(hexStr: "#FFE710"))
|
||||
let disabledImage = UIImage.image(color: ThemeColor(hexStr: "#F2F3F6"))
|
||||
let selectedImage = UIImage.image(color: ThemeColor(hexStr: "#F2F3F6"))
|
||||
|
||||
let _sendBtn = UIButton.getCustomBtn(text: "赠送",selectedText: "赠送中",disabledText: "赠送中...", font: UIFont.getScaleFont(ofSize: 14, weight: .medium),color: ThemeColor(hexStr: "#282828"),disabledColor: ThemeColor(hexStr: "#878B9C"),bgImage: image,selectedBgImage: selectedImage,disabledBgImage: disabledImage,masksToBounds: true)
|
||||
|
||||
_sendBtn.addTarget(self, action: #selector(clickSendGiftAction), for: .touchUpInside)
|
||||
return _sendBtn
|
||||
}()
|
||||
private lazy var sendNumView:SendGiftSendNumView = {
|
||||
let _sendNumView = SendGiftSendNumView(frame: .zero)
|
||||
|
||||
return _sendNumView
|
||||
}()
|
||||
|
||||
var sendTextView:RoomSendTextView = {
|
||||
let bottom = ScreenHeight + 40
|
||||
let _sendTextView = RoomSendTextView(frame: CGRect(x: 0, y: bottom, width: ScreenWidth, height: UIDevice.scaleWidth(width: 40)))
|
||||
_sendTextView.isSendGiftNum = true
|
||||
return _sendTextView
|
||||
}()
|
||||
}
|
@@ -21,6 +21,9 @@ class SendGiftTopView: UIView {
|
||||
private func setUILayout(){
|
||||
addSubview(giftBtn)
|
||||
addSubview(lineView)
|
||||
self.snp.makeConstraints { make in
|
||||
make.height.equalTo(UIDevice.scaleWidth(width: 44))
|
||||
}
|
||||
giftBtn.snp.makeConstraints { make in
|
||||
make.leading.equalTo(UIDevice.scaleWidth(width: 16))
|
||||
make.centerY.equalTo(self)
|
||||
|
@@ -31,6 +31,7 @@ class SendGiftUserCell: UICollectionViewCell {
|
||||
}
|
||||
numView.snp.makeConstraints { make in
|
||||
make.height.equalTo(UIDevice.scaleWidth(width: 10))
|
||||
make.width.equalTo(UIDevice.scaleWidth(width: 10))
|
||||
make.centerY.equalTo(avatarView.snp.bottom)
|
||||
make.centerX.equalTo(avatarView)
|
||||
}
|
||||
@@ -42,6 +43,10 @@ class SendGiftUserCell: UICollectionViewCell {
|
||||
guard let _model = model else { return}
|
||||
if let position = Int(_model.position){
|
||||
numView.text = position == -1 ? "房主" : "\(position + 1)"
|
||||
let width:CGFloat = position == -1 ? 28 : 10
|
||||
numView.snp.updateConstraints { make in
|
||||
make.width.equalTo(UIDevice.scaleWidth(width: width))
|
||||
}
|
||||
}
|
||||
Nuke.loadImage(with: _model.avatar, into: avatarView, completion: nil)
|
||||
avatarView.layer.borderWidth = _model.isChoose ? 2 : 0
|
||||
|
@@ -19,28 +19,119 @@ class SendGiftUserView: UIView {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
private func setUILayout(){
|
||||
backgroundColor = .clear
|
||||
addSubview(textVeiw)
|
||||
addSubview(collectionView)
|
||||
addSubview(allUserBtn)
|
||||
addSubview(lineView)
|
||||
self.snp.makeConstraints { make in
|
||||
make.height.equalTo(UIDevice.scaleWidth(width: 73))
|
||||
}
|
||||
textVeiw.snp.makeConstraints { make in
|
||||
make.leading.equalTo(UIDevice.scaleWidth(width: 10))
|
||||
make.centerY.equalTo(self)
|
||||
make.width.equalTo(UIDevice.scaleWidth(width: 53))
|
||||
make.height.equalTo(UIDevice.scaleWidth(width: 43))
|
||||
}
|
||||
allUserBtn.snp.makeConstraints { make in
|
||||
make.width.equalTo(UIDevice.scaleWidth(width: 36))
|
||||
make.height.equalTo(UIDevice.scaleWidth(width: 18))
|
||||
make.trailing.equalTo(-UIDevice.scaleWidth(width: 10))
|
||||
make.centerY.equalTo(self)
|
||||
}
|
||||
collectionView.snp.makeConstraints { make in
|
||||
make.height.equalTo(UIDevice.scaleWidth(width: 43))
|
||||
make.leading.equalTo(textVeiw.snp.trailing).offset((UIDevice.scaleWidth(width: 10)))
|
||||
make.trailing.equalTo(allUserBtn.snp.leading).offset(-UIDevice.scaleWidth(width:10))
|
||||
make.centerY.equalTo(self)
|
||||
}
|
||||
lineView.snp.makeConstraints { make in
|
||||
make.height.equalTo(1)
|
||||
make.leading.trailing.bottom.equalTo(self)
|
||||
|
||||
}
|
||||
collectionView.register(SendGiftUserCell.self, forCellWithReuseIdentifier: "SendGiftUserCell")
|
||||
collectionView.delegate = self
|
||||
collectionView.dataSource = self
|
||||
}
|
||||
@objc func clickAllChooseAction(){
|
||||
allUserBtn.isSelected = !allUserBtn.isSelected
|
||||
for model in userList {
|
||||
model.isChoose = allUserBtn.isSelected
|
||||
}
|
||||
collectionView.reloadData()
|
||||
}
|
||||
func getSendGiftUserList()->(Bool,[String]){
|
||||
var list:[String] = []
|
||||
for itme in userList{
|
||||
if itme.isChoose{
|
||||
list.append("\(itme.uid)")
|
||||
}
|
||||
}
|
||||
return (allUserBtn.isSelected,list)
|
||||
|
||||
}
|
||||
//MARK: - 懒加载
|
||||
var userList:[SendGiftUserModel] = []{
|
||||
didSet{
|
||||
collectionView.reloadData()
|
||||
}
|
||||
}
|
||||
|
||||
private lazy var textVeiw:UILabel = {
|
||||
let _textView = UILabel.getCustomLabel(text: "送给",font: UIFont.getScaleFont(ofSize: 13, weight: .medium),color: .white,textAlignment: .center)
|
||||
return _textView
|
||||
}()
|
||||
private lazy var allUserBtn:UIButton = {
|
||||
lazy var allUserBtn:UIButton = {
|
||||
let normalImage = UIImage.image(color: ThemeColor(hexStr: "#878B9C"))
|
||||
let selectedImage = UIImage.image(color: ThemeColor(hexStr: "#FFE710"))
|
||||
let _allUserBtn = UIButton.getCustomBtn(text: "全选",font: UIFont.getScaleFont(ofSize: 13, weight: .medium),color: .white,selectedColor: ThemeColor(hexStr: "#28282"),bgImage: normalImage,selectedBgImage: selectedImage)
|
||||
_allUserBtn.layer.cornerRadius = UIDevice.scaleWidth(width: 18)/2
|
||||
_allUserBtn.layer.masksToBounds = true
|
||||
_allUserBtn.addTarget(self, action: #selector(clickAllChooseAction), for: .touchUpInside)
|
||||
return _allUserBtn
|
||||
}()
|
||||
private lazy var collectionView:UICollectionView = {
|
||||
let flowLayout = UICollectionViewFlowLayout()
|
||||
flowLayout.scrollDirection = .horizontal
|
||||
flowLayout.itemSize = CGSize(width: UIDevice.scaleWidth(width: 38), height: UIDevice.scaleWidth(width: 43))
|
||||
let _collectionView = UICollectionView()
|
||||
flowLayout.minimumInteritemSpacing = UIDevice.scaleWidth(width: 4)
|
||||
flowLayout.sectionInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
|
||||
let _collectionView = UICollectionView(frame: .zero,collectionViewLayout: flowLayout)
|
||||
_collectionView.backgroundColor = .clear
|
||||
_collectionView.showsHorizontalScrollIndicator = false
|
||||
|
||||
|
||||
return _collectionView
|
||||
}()
|
||||
private lazy var lineView:UIView = {
|
||||
let _lineView = UIView()
|
||||
_lineView.backgroundColor = ThemeColor(hexStr: "#FFFFFF", alpha: 0.1)
|
||||
return _lineView
|
||||
}()
|
||||
}
|
||||
extension SendGiftUserView:UICollectionViewDelegate ,UICollectionViewDataSource{
|
||||
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
||||
return userList.count
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "SendGiftUserCell", for: indexPath) as! SendGiftUserCell
|
||||
cell.model = userList[safe: indexPath.row]
|
||||
return cell
|
||||
}
|
||||
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
||||
let model = userList[indexPath.row]
|
||||
model.isChoose = !model.isChoose
|
||||
var isAllChoose = true
|
||||
for model in userList {
|
||||
if !model.isChoose{
|
||||
isAllChoose = false
|
||||
break
|
||||
}
|
||||
}
|
||||
allUserBtn.isSelected = isAllChoose
|
||||
collectionView.reloadData()
|
||||
}
|
||||
|
||||
}
|
||||
|
245
yinmeng-ios/Modules/Room/View/SendGift/View/SendGiftVC.swift
Normal file
@@ -0,0 +1,245 @@
|
||||
//
|
||||
// SendGiftVC.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/3/22.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class SendGiftVC: BaseViewController, HiddenNavigationBarProtocol {
|
||||
var roomUid = ""
|
||||
var roomId = ""
|
||||
var userData:UserObject?
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
setUILayout()
|
||||
requestData()
|
||||
}
|
||||
private func requestData(){
|
||||
getDiamondNum()
|
||||
RequestGet(path: "gift/listV5", parma: ["roomUid":roomUid]) { data in
|
||||
if let _data = data as? [String : Any],let giftData = _data["normalGift"]{
|
||||
if let list = Deserialized<SendGiftModel>.toArray(with: giftData),!list.isEmpty {
|
||||
let model = list.first
|
||||
model?.isSelected = true
|
||||
self.sendGiftView.giftList = list
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} fail: { code, data in
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
func getDiamondNum(){
|
||||
RequestGet(path: "purse/query", parma: ["channelType":"8"]) { data in
|
||||
if let model = Deserialized<UserPayViewModel>.toModel(with: data) {
|
||||
self.sendView.diamond = model.diamonds
|
||||
}
|
||||
|
||||
} fail: { code, data in
|
||||
|
||||
}
|
||||
}
|
||||
private func setUILayout(){
|
||||
view.backgroundColor = .clear
|
||||
view.addSubview(dissBtn)
|
||||
view.addSubview(contentView)
|
||||
contentView.addSubview(bgMaskView)
|
||||
contentView.addSubview(contentStackView)
|
||||
|
||||
contentStackView.addArrangedSubview(topView)
|
||||
contentStackView.addArrangedSubview(sendUserView)
|
||||
contentStackView.addArrangedSubview(sendGiftView)
|
||||
contentStackView.addArrangedSubview(sendView)
|
||||
|
||||
dissBtn.snp.makeConstraints { make in
|
||||
make.edges.equalTo(view)
|
||||
}
|
||||
contentView.snp.makeConstraints { make in
|
||||
make.top.equalTo(contentStackView.snp.top)
|
||||
make.width.equalTo(ScreenWidth)
|
||||
make.leading.bottom.equalTo(UIDevice.scaleWidth(width: 0))
|
||||
}
|
||||
bgMaskView.snp.makeConstraints { make in
|
||||
make.leading.trailing.top.bottom.equalTo(contentView)
|
||||
}
|
||||
contentStackView.snp.makeConstraints { make in
|
||||
make.leading.trailing.bottom.equalTo(contentView)
|
||||
}
|
||||
sendView.clickSendGiftBlock = {[weak self] (type,text) in
|
||||
guard let self = self else { return }
|
||||
if type == .pay{
|
||||
let vc = UserPayViewController()
|
||||
self.navigationController?.pushViewController(vc, animated: true)
|
||||
}else if type == .send{
|
||||
self.sendGiftAction(text: text)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
func sendGiftAction(text:String){
|
||||
let userList = sendUserView.getSendGiftUserList()
|
||||
guard !userList.1.isEmpty else{
|
||||
HUDTool.show(with: "请选择至少一个用户")
|
||||
return
|
||||
}
|
||||
guard let selectModel = sendGiftView.selectModel else {
|
||||
HUDTool.show(with: "请选择赠送的礼物")
|
||||
return
|
||||
}
|
||||
|
||||
let giftNum = Int(text) ?? 0
|
||||
let type = "3"
|
||||
let sourceType = "1"
|
||||
let giftId = "\(selectModel.giftId)"
|
||||
let userUidText = getUserText(list: userList.1)
|
||||
let giftType = selectModel.giftType
|
||||
var roomType = userList.0 ? 0 : 1
|
||||
if userList.0 == false,userList.1.count == 1{
|
||||
roomType = 2
|
||||
}
|
||||
if isSendPerson {
|
||||
roomType = 2
|
||||
}
|
||||
sendView.isEnabled = false
|
||||
let parmas = ["giftNum":giftNum,"targetUids":userUidText,"sendType":type,"giftId":giftId,"giftSource":sourceType,"giftType":selectModel.giftType,"msg":"","roomUid":roomUid,"uid":"\(AuthManager.userUid)"] as [String : Any]
|
||||
RequestPost(path: "gift/sendV4", parma:parmas) { data in
|
||||
if let model = Deserialized<RectiveGiftModel>.toModel(with: data),let _data = data as? [String:Any] {
|
||||
model.sourceType = Int(sourceType) ?? 1
|
||||
model.roomSendGiftType = roomType
|
||||
self.sendGiftSuccess(model: model, data: _data, uidList: userList.1)
|
||||
}
|
||||
|
||||
} fail: { code, data in
|
||||
self.sendView.isEnabled = true
|
||||
HUDTool.show(with: data)
|
||||
}
|
||||
|
||||
}
|
||||
func sendGiftSuccess(model:RectiveGiftModel,data:[String:Any],uidList:[String]){
|
||||
getDiamondNum()
|
||||
self.sendView.isEnabled = true
|
||||
if model.roomSendGiftType == 0{
|
||||
let customMsgModel = ChatCustomMsgModel()
|
||||
customMsgModel.first = 12
|
||||
customMsgModel.second = 121
|
||||
var getData = data
|
||||
var list:[String] = []
|
||||
for item in model.targetUsers {
|
||||
list.append("\(item.uid)")
|
||||
}
|
||||
getData["targetUids"] = list
|
||||
customMsgModel.data = getData
|
||||
sendMsg(model: customMsgModel)
|
||||
|
||||
}else if model.roomSendGiftType == 1{
|
||||
let customMsgModel = ChatCustomMsgModel()
|
||||
customMsgModel.first = 12
|
||||
customMsgModel.second = 123
|
||||
customMsgModel.data = data
|
||||
sendMsg(model: customMsgModel)
|
||||
}else{
|
||||
let customMsgModel = ChatCustomMsgModel()
|
||||
customMsgModel.first = 3
|
||||
customMsgModel.second = 31
|
||||
var getData = data
|
||||
if let curModel = model.targetUsers[safe: 0]{
|
||||
getData["targetUid"] = curModel.uid
|
||||
getData["targetNick"] = curModel.nick
|
||||
getData["targetAvatar"] = curModel.avatar
|
||||
}
|
||||
customMsgModel.data = getData
|
||||
sendMsg(model: customMsgModel)
|
||||
}
|
||||
|
||||
}
|
||||
func sendMsg(model:ChatCustomMsgModel){
|
||||
let msgId = self.roomId
|
||||
let msg = NIMMessage()
|
||||
let obj = NIMCustomObject()
|
||||
obj.attachment = model
|
||||
msg.messageObject = obj
|
||||
|
||||
let session = NIMSession.init(msgId, type: .chatroom)
|
||||
try? NIMSDK.shared().chatManager.send(msg, to: session)
|
||||
}
|
||||
func getUserText(list:[String])->String{
|
||||
var text = ""
|
||||
for uid in list {
|
||||
text = text.isEmpty ? uid : text + "," + uid
|
||||
}
|
||||
return text
|
||||
}
|
||||
@objc func clickDissBtnAction(){
|
||||
self.dismiss(animated: true)
|
||||
}
|
||||
//MARK: - 懒加载
|
||||
var isSendPerson = false {
|
||||
didSet{
|
||||
sendUserView.allUserBtn.isHidden = true
|
||||
}
|
||||
}
|
||||
var userList:[SendGiftUserModel] = []{
|
||||
didSet{
|
||||
if userList.isEmpty{
|
||||
sendUserView.isHidden = true
|
||||
return
|
||||
}
|
||||
sendUserView.userList = userList
|
||||
}
|
||||
}
|
||||
private lazy var dissBtn:UIButton = {
|
||||
let _dissBtn = UIButton()
|
||||
_dissBtn.addTarget(self, action: #selector(clickDissBtnAction), for: .touchUpInside)
|
||||
return _dissBtn
|
||||
}()
|
||||
private lazy var bgMaskView:UIVisualEffectView = {
|
||||
let blur = UIBlurEffect(style: .dark)
|
||||
let _bgMaskView = UIVisualEffectView(effect: blur)
|
||||
|
||||
return _bgMaskView
|
||||
}()
|
||||
private lazy var contentView:UIView = {
|
||||
let _contentView = UIView()
|
||||
let path = UIBezierPath.init(roundedRect: CGRect(x: 0, y: 0, width: ScreenWidth, height: ScreenHeight), byRoundingCorners: [.topLeft,.topRight], cornerRadii: CGSize(width: 8, height: 8))
|
||||
let layer = CAShapeLayer()
|
||||
layer.frame = CGRect(x: 0, y: 0, width: ScreenWidth, height: ScreenHeight)
|
||||
layer.path = path.cgPath
|
||||
_contentView.layer.mask = layer
|
||||
return _contentView
|
||||
}()
|
||||
private lazy var contentStackView:UIStackView = {
|
||||
let _contentStackView = UIStackView()
|
||||
_contentStackView.axis = .vertical
|
||||
_contentStackView.distribution = .fill
|
||||
_contentStackView.alignment = .fill
|
||||
_contentStackView.spacing = 0
|
||||
_contentStackView.backgroundColor = .clear
|
||||
return _contentStackView
|
||||
}()
|
||||
private lazy var topView:SendGiftTopView = {
|
||||
let _topView = SendGiftTopView(frame: .zero)
|
||||
|
||||
return _topView
|
||||
}()
|
||||
private lazy var sendUserView:SendGiftUserView = {
|
||||
let _sendUserView = SendGiftUserView(frame: .zero)
|
||||
|
||||
return _sendUserView
|
||||
}()
|
||||
private lazy var sendGiftView:SendGiftView = {
|
||||
let _sendGiftView = SendGiftView(frame: .zero)
|
||||
|
||||
return _sendGiftView
|
||||
}()
|
||||
private lazy var sendView:SendGiftSendView = {
|
||||
let _sendView = SendGiftSendView(frame: .zero)
|
||||
|
||||
return _sendView
|
||||
}()
|
||||
}
|
@@ -0,0 +1,91 @@
|
||||
//
|
||||
// SendGiftView.swift
|
||||
// yinmeng-ios
|
||||
//
|
||||
// Created by duoban on 2024/3/22.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class SendGiftView: UIView {
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
setUILayout()
|
||||
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
private func setUILayout(){
|
||||
addSubview(giftBtn)
|
||||
addSubview(collectionView)
|
||||
self.snp.makeConstraints { make in
|
||||
make.height.equalTo(UIDevice.scaleWidth(width: 271))
|
||||
}
|
||||
giftBtn.snp.makeConstraints { make in
|
||||
make.width.height.equalTo(UIDevice.scaleWidth(width: 30))
|
||||
make.leading.equalTo(UIDevice.scaleWidth(width: 15))
|
||||
make.top.equalTo(self)
|
||||
}
|
||||
collectionView.snp.makeConstraints { make in
|
||||
make.height.equalTo(UIDevice.scaleWidth(width: 236))
|
||||
make.top.equalTo(giftBtn.snp.bottom).offset(UIDevice.scaleWidth(width: 10))
|
||||
make.leading.trailing.equalTo(self).inset(UIDevice.scaleWidth(width: 0))
|
||||
}
|
||||
collectionView.delegate = self
|
||||
collectionView.dataSource = self
|
||||
collectionView.register(SendGiftCell.self, forCellWithReuseIdentifier: "SendGiftCell")
|
||||
}
|
||||
@objc func clickGiftBntAction(){
|
||||
|
||||
}
|
||||
var giftList:[SendGiftModel] = []{
|
||||
didSet{
|
||||
guard !giftList.isEmpty else { return}
|
||||
selectModel = giftList.first
|
||||
collectionView.reloadData()
|
||||
}
|
||||
}
|
||||
var selectModel:SendGiftModel?
|
||||
//MARK: - 懒加载
|
||||
private lazy var giftBtn:UIButton = {
|
||||
let _giftBtn = UIButton.getCustomBtn(type: .custom,text: "普通",font: UIFont.getScaleFont(ofSize: 13, weight: .semibold),color: ThemeColor(hexStr: "#BDBFD0"),selectedColor: ThemeColor(hexStr: "#FFE710"))
|
||||
_giftBtn.isSelected = true
|
||||
_giftBtn.addTarget(self, action: #selector(clickGiftBntAction), for: .touchUpInside)
|
||||
return _giftBtn
|
||||
}()
|
||||
private lazy var collectionView:UICollectionView = {
|
||||
let flowLayout = UICollectionViewFlowLayout()
|
||||
let itemWidth = (ScreenWidth - UIDevice.scaleWidth(width: 45)) / 4;
|
||||
flowLayout.itemSize = CGSizeMake(itemWidth, UIDevice.scaleWidth(width: 108))
|
||||
flowLayout.sectionInset = UIEdgeInsets(top: 0, left: UIDevice.scaleWidth(width: 14), bottom: 0, right: UIDevice.scaleWidth(width: 14))
|
||||
flowLayout.minimumLineSpacing = UIDevice.scaleWidth(width: 5)
|
||||
flowLayout.minimumInteritemSpacing = UIDevice.scaleWidth(width: 5)
|
||||
let _collectionView = UICollectionView(frame: .zero,collectionViewLayout: flowLayout)
|
||||
_collectionView.backgroundColor = .clear
|
||||
return _collectionView
|
||||
}()
|
||||
}
|
||||
extension SendGiftView:UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout{
|
||||
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
||||
return giftList.count
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "SendGiftCell", for: indexPath) as! SendGiftCell
|
||||
cell.giftModel = giftList[safe: indexPath.row]
|
||||
return cell
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
||||
for item in giftList {
|
||||
item.isSelected = false
|
||||
}
|
||||
var model = giftList[safe: indexPath.row]
|
||||
selectModel = model
|
||||
model?.isSelected = true
|
||||
collectionView.reloadData()
|
||||
}
|
||||
}
|