增加房间

This commit is contained in:
liyuhua
2024-03-08 10:05:28 +08:00
parent e91d324a90
commit d9dc765504
8 changed files with 177 additions and 30 deletions

View File

@@ -27,7 +27,9 @@ target 'yinmeng-ios' do
pod 'TZImagePickerController'
pod 'LookinServer', :configurations => ['Debug']
#pop动画
pod 'pop', '~> 1.0.12'
pod 'FFPopup'
# Pods for yinmeng-ios

View File

@@ -48,6 +48,7 @@
234E2E0C2B9879D400433CF7 /* RoomQuitClickCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 234E2E0B2B9879D400433CF7 /* RoomQuitClickCell.swift */; };
234E2E0E2B99A24F00433CF7 /* RoomQuitItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 234E2E0D2B99A24F00433CF7 /* RoomQuitItemModel.swift */; };
234E2E112B99B50400433CF7 /* RoomQuitViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 234E2E102B99B50400433CF7 /* RoomQuitViewModel.swift */; };
234E2E142B99F23C00433CF7 /* RoomNormalMicSeatView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 234E2E132B99F23C00433CF7 /* RoomNormalMicSeatView.swift */; };
25C63BC8F805551E8754E409 /* Pods_yinmeng_ios.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2F175918AD0811681497739 /* Pods_yinmeng_ios.framework */; };
E81A7BAE2B885B20009E736E /* Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = E81A7BAA2B885B20009E736E /* Base64.m */; };
E81A7BAF2B885B20009E736E /* MAIDESEncryptTool.m in Sources */ = {isa = PBXBuildFile; fileRef = E81A7BAB2B885B20009E736E /* MAIDESEncryptTool.m */; };
@@ -161,6 +162,7 @@
234E2E0B2B9879D400433CF7 /* RoomQuitClickCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomQuitClickCell.swift; sourceTree = "<group>"; };
234E2E0D2B99A24F00433CF7 /* RoomQuitItemModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomQuitItemModel.swift; sourceTree = "<group>"; };
234E2E102B99B50400433CF7 /* RoomQuitViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomQuitViewModel.swift; sourceTree = "<group>"; };
234E2E132B99F23C00433CF7 /* RoomNormalMicSeatView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomNormalMicSeatView.swift; sourceTree = "<group>"; };
A9FB906EB4D17C552C15A2B3 /* Pods-yinmeng-ios.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-yinmeng-ios.debug.xcconfig"; path = "Target Support Files/Pods-yinmeng-ios/Pods-yinmeng-ios.debug.xcconfig"; sourceTree = "<group>"; };
B2F175918AD0811681497739 /* Pods_yinmeng_ios.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_yinmeng_ios.framework; sourceTree = BUILT_PRODUCTS_DIR; };
CB0AC98C54C1D41FA4CA102B /* Pods-yinmeng-ios.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-yinmeng-ios.release.xcconfig"; path = "Target Support Files/Pods-yinmeng-ios/Pods-yinmeng-ios.release.xcconfig"; sourceTree = "<group>"; };
@@ -300,6 +302,7 @@
234E2DED2B98411800433CF7 /* View */ = {
isa = PBXGroup;
children = (
234E2E122B99F21600433CF7 /* MicSeatView */,
234E2DFE2B986D6600433CF7 /* RoomQuitView */,
234E2DF52B984FA800433CF7 /* RoomTopView */,
234E2DF22B98479B00433CF7 /* RoomBackgroundView */,
@@ -392,6 +395,14 @@
path = VM;
sourceTree = "<group>";
};
234E2E122B99F21600433CF7 /* MicSeatView */ = {
isa = PBXGroup;
children = (
234E2E132B99F23C00433CF7 /* RoomNormalMicSeatView.swift */,
);
path = MicSeatView;
sourceTree = "<group>";
};
4B36689ACEFDA475774E1FD5 /* Pods */ = {
isa = PBXGroup;
children = (
@@ -938,6 +949,7 @@
E8E4AAB72B8F95CA0096D77C /* AuthAppleManager.swift in Sources */,
E89F19452B917DBA0098E797 /* ChatSendVoiceView.swift in Sources */,
E8D15AC22B8C703C00369467 /* UserFunctionView.swift in Sources */,
234E2E142B99F23C00433CF7 /* RoomNormalMicSeatView.swift in Sources */,
2311D6AF2B906148001C70AB /* HomeVoiceFollowView.swift in Sources */,
E86A43DA2B877A840084C04D /* AppConfigObject.swift in Sources */,
2311D6BC2B909A4F001C70AB /* HomeVoicePublishView.swift in Sources */,

View File

@@ -6,5 +6,5 @@
#import <SVGAPlayer/SVGA.h>
#import "RecordVoiceManager.h"
#import <Qiniu/QiniuSDK.h>
#import <FFPopup/FFPopup.h>

View File

@@ -15,9 +15,15 @@ class RoomVC: BaseViewController, HiddenNavigationBarProtocol {
}
private func setUILayout(){
view.addSubview(backgroundView)
view.addSubview(topView)
backgroundView.snp.makeConstraints { make in
make.edges.equalTo(self.view)
}
topView.snp.makeConstraints { make in
make.leading.trailing.top.equalTo(self.view)
make.height.equalTo(UIDevice.scaleWidth(width: NavHeight))
}
}
private func requestData(){
@@ -27,4 +33,9 @@ class RoomVC: BaseViewController, HiddenNavigationBarProtocol {
let _backgroundView = RoomBackgroundView(frame: .zero)
return _backgroundView
}()
private lazy var topView:RoomTopView = {
let _topView = RoomTopView(frame: .zero)
return _topView
}()
}

View File

@@ -0,0 +1,20 @@
//
// RoomNormalMicSeatView.swift
// yinmeng-ios
//
// Created by duoban on 2024/3/7.
//
import UIKit
class RoomNormalMicSeatView: UIView {
/*
// Only override draw() if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
override func draw(_ rect: CGRect) {
// Drawing code
}
*/
}

View File

@@ -8,6 +8,7 @@
import UIKit
import Nuke
class RoomQuitClickCell: UICollectionViewCell {
override init(frame: CGRect) {
super.init(frame: frame)
setUILayout()
@@ -32,7 +33,7 @@ class RoomQuitClickCell: UICollectionViewCell {
make.height.equalTo(UIDevice.scaleWidth(width: 12))
}
}
var model:RoomQuitItemModel{
var model:RoomQuitItemModel = RoomQuitItemModel() {
didSet{
avatarView.image = UIImage(named: model.image)
nameView.text = model.text

View File

@@ -7,6 +7,8 @@
import UIKit
protocol RoomQuitViewProtocol{
func didClickTypeWithModel(clickModel:RoomQuitItemModel) -> Void
func didChooseRoomWithModel(roomModel:RoomQuitModel?) -> Void
@@ -24,40 +26,53 @@ class RoomQuitView: UIView {
fatalError("init(coder:) has not been implemented")
}
private func setUILayout(){
addSubview(dissBtn)
addSubview(bgMaskView)
addSubview(collectionView)
addSubview(textView)
addSubview(tableView)
bgMaskView.snp.makeConstraints { make in
dissBtn.snp.makeConstraints { make in
make.edges.equalTo(self)
}
bgMaskView.snp.makeConstraints { make in
make.trailing.top.bottom.equalTo(self)
make.width.equalTo(UIDevice.scaleWidth(width: 250))
}
collectionView.snp.makeConstraints { make in
make.leading.trailing.equalTo(self).inset(0)
make.leading.trailing.equalTo(bgMaskView).inset(0)
make.top.equalTo(UIDevice.scaleWidth(width: 8) + StatusBarHeight)
make.height.equalTo(UIDevice.scaleWidth(width: 164))
}
textView.snp.makeConstraints { make in
make.top.equalTo(collectionView.snp.bottom).offset(UIDevice.scaleWidth(width: 16))
make.leading.equalTo(UIDevice.scaleWidth(width: 11))
make.leading.equalTo(bgMaskView.snp.leading).offset((UIDevice.scaleWidth(width: 11)))
}
tableView.snp.makeConstraints { make in
make.leading.trailing.bottom.equalTo(0)
make.leading.trailing.bottom.equalTo(bgMaskView)
make.top.equalTo(textView.snp.bottom).offset(UIDevice.scaleWidth(width: 0))
}
}
private func registerCell(){
collectionView.register(RoomQuitClickCell.self, forCellWithReuseIdentifier: "RoomQuitClickCell")
collectionView.delegate = self
collectionView.dataSource = self
tableView.register(RoomQuitUserInfoEmptyCell.self, forCellReuseIdentifier: "RoomQuitUserInfoEmptyCell")
tableView.register(RoomQuitUserInfoCell.self, forCellReuseIdentifier: "RoomQuitUserInfoEmptyCell")
tableView.register(RoomQuitUserInfoCell.self, forCellReuseIdentifier: "RoomQuitUserInfoCell")
tableView.delegate = self
tableView.dataSource = self
}
//MARK: - UIButtonTarget
@objc func dissViewAction(){
UIView.animate(withDuration: 0.1) {
self.frame = CGRect(x: ScreenWidth, y: 0, width: ScreenWidth, height: ScreenHeight)
}completion: { iscompletion in
self.removeFromSuperview()
}
}
//MARK: -
let emptyCellHeight = ScreenHeight - StatusBarHeight - UIDevice.scaleWidth(width: 128)
var delegate:RoomQuitViewProtocol?
@@ -72,6 +87,13 @@ class RoomQuitView: UIView {
return [quitModel,reportModel]
}
var roomModelList:[RoomQuitModel] = []
private lazy var dissBtn:UIButton = {
let _dissBtn = UIButton()
_dissBtn.addTarget(self, action: #selector(dissViewAction), for: .touchUpInside)
return _dissBtn
}()
private lazy var bgMaskView:UIVisualEffectView = {
var _bgMaskView = UIVisualEffectView()
let blurEffect = UIBlurEffect(style: .dark)

View File

@@ -7,6 +7,7 @@
import UIKit
import MarqueeLabel
import FFPopup
class RoomTopView: UIView {
@@ -20,18 +21,100 @@ class RoomTopView: UIView {
fatalError("init(coder:) has not been implemented")
}
private func setUILayout(){
addSubview(superStackView)
addSubview(settingBnt)
superStackView.addSubview(avatarView)
superStackView.addSubview(nameStackView)
superStackView.addSubview(colectRoomBtn)
nameStackView.addArrangedSubview(textStackView)
nameStackView.addArrangedSubview(onlineNumStackView)
onlineNumStackView.addArrangedSubview(userIdView)
onlineNumStackView.addArrangedSubview(greenPointView)
onlineNumStackView.addArrangedSubview(onlineNumView)
textStackView.addArrangedSubview(textView)
textStackView.addArrangedSubview(giftIconView)
textStackView.addArrangedSubview(lockIconView)
superStackView.snp.makeConstraints { make in
make.leading.equalTo(UIDevice.scaleWidth(width: 15))
make.bottom.equalTo(-UIDevice.scaleWidth(width: 5))
make.height.equalTo(UIDevice.scaleWidth(width: 34))
make.width.greaterThanOrEqualTo(10)
make.trailing.equalTo(colectRoomBtn.snp.trailing).offset(UIDevice.scaleWidth(width: 5))
}
settingBnt.snp.makeConstraints { make in
make.trailing.equalTo(-UIDevice.scaleWidth(width: 13))
make.centerY.equalTo(nameStackView)
make.width.height.equalTo(UIDevice.scaleWidth(width: 25))
}
avatarView.snp.makeConstraints { make in
make.leading.top.equalTo(UIDevice.scaleWidth(width: 0))
make.width.height.equalTo(nameStackView.snp.height)
}
nameStackView.snp.makeConstraints { make in
make.leading.equalTo(avatarView.snp.trailing).offset((UIDevice.scaleWidth(width: 5)))
make.bottom.equalTo(0)
make.height.equalTo(UIDevice.scaleWidth(width: 34))
}
colectRoomBtn.snp.makeConstraints { make in
make.leading.equalTo(textStackView.snp.trailing).offset((UIDevice.scaleWidth(width: 5)))
make.height.equalTo(UIDevice.scaleWidth(width: 20))
make.width.equalTo(UIDevice.scaleWidth(width: 40))
make.centerY.equalTo(superStackView)
}
textView.snp.makeConstraints { make in
make.width.lessThanOrEqualTo(UIDevice.scaleWidth(width: 90))
make.height.equalTo(UIDevice.scaleWidth(width: 18))
}
greenPointView.snp.makeConstraints { make in
make.width.height.equalTo(UIDevice.scaleWidth(width: 3))
}
userIdView.snp.makeConstraints { make in
make.height.equalTo(UIDevice.scaleWidth(width: 16))
}
giftIconView.snp.makeConstraints { make in
make.width.height.equalTo(UIDevice.scaleWidth(width: 10))
}
lockIconView.snp.makeConstraints { make in
make.width.height.equalTo(UIDevice.scaleWidth(width: 18))
}
}
//MARK: - bntTarget
@objc func colectRoomAction(){
colectRoomBtn.isSelected = !colectRoomBtn.isSelected
let width:CGFloat = !colectRoomBtn.isSelected ? 40 : 50
colectRoomBtn.snp.updateConstraints { make in
make.width.equalTo(UIDevice.scaleWidth(width: width))
}
}
@objc func settingBntAction(){
let quitView = RoomQuitView(frame: .zero)
quitView.delegate = self
quitView.frame = CGRect(x: ScreenWidth, y: 0, width: ScreenWidth, height: ScreenHeight)
keyWindow.addSubview(quitView)
UIView.animate(withDuration: 0.1) {
quitView.frame = CGRect(x: 0, y: 0, width:ScreenWidth, height: ScreenHeight)
}
}
//MARK: -
private lazy var settingBnt:UIButton = {
let _settingBtn = UIButton.getCustomBtn(image: UIImage(named: "yin_room_top_right"))
_settingBtn.setBtnClickRadius = UIEdgeInsets(top: 8, left: 8, bottom: 8, right: 8)
_settingBtn.addTarget(self, action: #selector(settingBntAction), for: .touchUpInside)
return _settingBtn
}()
private lazy var colectRoomBtn:UIButton = {
@@ -41,7 +124,7 @@ class RoomTopView: UIView {
_colectRoomBtn.layer.masksToBounds = true
_colectRoomBtn.contentEdgeInsets = UIEdgeInsets(top: 0, left: UIDevice.scaleWidth(width: 7), bottom: 0, right: UIDevice.scaleWidth(width: 7))
_colectRoomBtn.addTarget(self, action: #selector(colectRoomAction), for: .touchUpInside)
_colectRoomBtn.isHidden = true
// _colectRoomBtn.isHidden = true
return _colectRoomBtn
}()
private lazy var nameStackView:UIStackView = {
@@ -61,11 +144,12 @@ class RoomTopView: UIView {
}()
private lazy var textView:MarqueeLabel = {
let _textView = MarqueeLabel()
_textView.text = "我是一个小萌新"
_textView.speed = .duration(8)
_textView.fadeLength = UIDevice.scaleWidth(width: 6)
_textView.font = UIFont.getScaleFont(ofSize: 12, weight: .medium)
_textView.textColor = .white
_textView.isUserInteractionEnabled = true
// _textView.isUserInteractionEnabled = true
return _textView
}()
private lazy var giftIconView:UIImageView = {
@@ -78,7 +162,7 @@ class RoomTopView: UIView {
let _lockIconView = UIImageView()
_lockIconView.image = UIImage(named: "yin_room_top_lock_icon")
_lockIconView.isUserInteractionEnabled = true
_lockIconView.isHidden = true
// _lockIconView.isHidden = true
return _lockIconView
}()
@@ -94,16 +178,16 @@ class RoomTopView: UIView {
let _greenPointView = UIView()
_greenPointView.backgroundColor = ThemeColor(hexStr: "#3EFED7")
_greenPointView.layer.cornerRadius = UIDevice.scaleWidth(width: 3)/2
_greenPointView.layer.masksToBounds = true
// _greenPointView.layer.masksToBounds = true
return _greenPointView
}()
private lazy var userIdView:UILabel = {
let _userIdView = UILabel.getCustomLabel(font: UIFont.getScaleFont(ofSize: 10, weight: .regular),color: .white)
let _userIdView = UILabel.getCustomLabel(text:"ID837283",font: UIFont.getScaleFont(ofSize: 10, weight: .regular),color: .white)
return _userIdView
}()
private lazy var onlineNumView:UILabel = {
let _onlineNumView = UILabel.getCustomLabel(font: UIFont.getScaleFont(ofSize: 10, weight: .regular),color: .white)
let _onlineNumView = UILabel.getCustomLabel(text:"100",font: UIFont.getScaleFont(ofSize: 10, weight: .regular),color: .white)
return _onlineNumView
}()
@@ -113,23 +197,18 @@ class RoomTopView: UIView {
_avatarView.layer.masksToBounds = true
_avatarView.layer.cornerRadius = UIDevice.scaleWidth(width: 17)
_avatarView.contentMode = .scaleAspectFill
_avatarView.backgroundColor = .yellow
return _avatarView
}()
private lazy var superStackView:UIStackView = {
let _superStackView = UIStackView()
_superStackView.axis = .horizontal
_superStackView.distribution = .fill
_superStackView.alignment = .center
_superStackView.spacing = UIDevice.scaleWidth(width: 4)
private lazy var superStackView:UIView = {
let _superStackView = UIView()
_superStackView.backgroundColor = UIColor(white: 1, alpha: 0.1)
_superStackView.layer.cornerRadius = UIDevice.scaleWidth(width: 17)
return _superStackView
}()
private lazy var quitView:RoomQuitView = {
let _quitView = RoomQuitView(frame: .zero)
_quitView.delegate = self
return _quitView
}()
}
extension RoomTopView:RoomQuitViewProtocol{