新增实名及修复bug

This commit is contained in:
liyuhua
2024-03-28 19:56:25 +08:00
parent f776893134
commit b53b5c8a6a
17 changed files with 281 additions and 67 deletions

View File

@@ -37,6 +37,7 @@ class UserInfoVC: BaseViewController, HiddenNavigationBarProtocol {
view.addSubview(aboutView)
view.addSubview(logOffView)
view.addSubview(logoutBtn)
view.addSubview(autonymView)
backImgView.snp.makeConstraints { make in
make.edges.equalTo(view)
@@ -51,17 +52,25 @@ class UserInfoVC: BaseViewController, HiddenNavigationBarProtocol {
rechargeView.snp.makeConstraints { make in
make.left.equalTo(view).inset(28)
make.height.equalTo(68)
make.right.equalTo(myRoomView.snp.left).offset(-11)
make.right.equalTo(-28)
make.top.equalTo(view).offset(NavHeight + 20)
}
let width = (ScreenWidth - 56 - 11)/2
myRoomView.snp.makeConstraints { make in
make.centerY.height.width.equalTo(rechargeView)
make.right.equalTo(view).offset(-28)
make.height.equalTo(rechargeView)
make.width.equalTo(width)
make.top.equalTo(rechargeView.snp.bottom).offset(12)
make.left.equalTo(view).inset(28)
}
autonymView.snp.makeConstraints { make in
make.height.width.equalTo(myRoomView)
make.top.equalTo(rechargeView.snp.bottom).offset(12)
make.right.equalTo(view).inset(28)
}
mobileView.snp.makeConstraints { make in
make.left.equalTo(view).offset(28)
make.height.equalTo(68)
make.top.equalTo(rechargeView.snp.bottom).offset(12)
make.top.equalTo(myRoomView.snp.bottom).offset(12)
make.right.equalTo(passwordView.snp.left).offset(-11)
}
@@ -85,13 +94,15 @@ class UserInfoVC: BaseViewController, HiddenNavigationBarProtocol {
make.height.equalTo(48)
make.top.equalTo(logOffView.snp.bottom).offset(48)
}
}
@objc func logoutBtnAction() {
AuthViewModel.authVM.logout()
}
private lazy var backImgView: UIImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "auth_login_bg")
@@ -122,6 +133,13 @@ class UserInfoVC: BaseViewController, HiddenNavigationBarProtocol {
let item = UserFunctionItem(title: "我的房间", isHiddenIcon: true ,itmeType: .myRoom)
_myRoomView.item = item
return _myRoomView
}()
private lazy var autonymView: UserFunctionView = {
let _autonymView = UserFunctionView()
_autonymView.delegate = self
let item = UserFunctionItem(title: "实名认证", isHiddenIcon: true ,itmeType: .autonym)
_autonymView.item = item
return _autonymView
}()
private lazy var mobileView: UserFunctionView = {
let view = UserFunctionView()
@@ -181,12 +199,34 @@ extension UserInfoVC: UserFunctionViewProtocol{
self.navigationController?.pushViewController(vc, animated: true)
print("aaa")
case .myRoom:
let vc = RoomVC(roomUid: "\(AuthManager.userUid)")
vc.roomText = (self.info?.nick ?? "") + "的房间"
let nav = BaseNavigationViewController.init(rootViewController: vc)
nav.modalPresentationStyle = .fullScreen
self.present(nav, animated: true, completion: nil)
let params = ["uid":"\(AuthManager.userUid)","intoUid":"\(AuthManager.userUid)"]
RequestGet(path: "room/get", parma: params) { data in
if let info = Deserialized<RoomDataModel>.toModel(with: data) {
if info.isReselect{
if let isCertified = self.info?.isCertified,isCertified == false{
let popUpView = PlanetStarPopUpView.init(frame: CGRect(x: 0, y: 0, width: ScreenWidth, height: ScreenHeight))
self.view.addSubview(popUpView)
popUpView.textView.text = "为了营造更安全的网络环境\n在 开通个人房间前\n需要先进行实名认证"
popUpView.senderView.setTitle("去认证", for: .normal)
popUpView.bgPointView.isHidden = true
popUpView.pointTextView.isHidden = true
popUpView.clickSendBlcok = {[weak self] in
let web = WebViewController(url: "mew/\(H5Utils.autonym.rawValue)")
self?.navigationController?.pushViewController(web, animated: true)
}
}
}else{
let vc = RoomVC(roomUid: "\(AuthManager.userUid)")
vc.roomText = (self.info?.nick ?? "") + "的房间"
let nav = BaseNavigationViewController.init(rootViewController: vc)
nav.modalPresentationStyle = .fullScreen
self.present(nav, animated: true, completion: nil)
}
}
} fail: { code, message in
HUDTool.show(with: message)
}
case .mobile:
if self.info?.isBindPhone == true {
HUDTool.show(with: "您已绑定手机号")
@@ -202,12 +242,16 @@ extension UserInfoVC: UserFunctionViewProtocol{
} else {
self.navigationController?.pushViewController(BindMobileVC(), animated: true)
}
print("aaa")
case .logoff:
let web = WebViewController(url: "yinmeng/\(H5Utils.logoff.rawValue)")
self.navigationController?.pushViewController(web, animated: true)
case .about:
self.navigationController?.pushViewController(AboutUsVC(), animated: true)
case .autonym:
let web = WebViewController(url: "mew/\(H5Utils.autonym.rawValue)")
self.navigationController?.pushViewController(web, animated: true)
}
}
}