1. 修正登录页 UI 布局和文案

2. 调整首页 tab 关注逻辑
This commit is contained in:
eggmanQQQ
2024-07-17 12:19:18 +08:00
parent 7109bdbd11
commit 5e097ba6f9
7 changed files with 159 additions and 70 deletions

View File

@@ -19,21 +19,21 @@ var window: UIWindow?
self.window = UIWindow.init(frame: UIScreen.main.bounds)
self.window?.backgroundColor = UIColor.white
self.window?.rootViewController = BaseNavigationViewController(rootViewController:AuthLaunchVC())
loadNIMSDK()
loginStateListener()
loadNIMSDK()
loginStateListener()
return true
}
private func loginStateListener() {
AuthViewModel.authVM.appClientConfig()
///
AuthViewModel.authVM.checkUserIsLogin()
AuthViewModel.authVM.loginSuccess.subscribe(onNext: { result in
print("是否登录成功\(result)")
AuthViewModel.authVM.loginSuccess.subscribe(onNext: { [weak self] result in
guard let strongSelf = self else { return }
if result == true {
///tabbar
self.window?.rootViewController = BaseTabBarViewController()
strongSelf.window?.rootViewController = BaseTabBarViewController()
let uid = AuthManager.userUid
if uid > 0 {
UserViewModel.userVM.getUserInfo(uid: uid)
@@ -41,29 +41,31 @@ var window: UIWindow?
if NIMSDK.shared().loginManager.isLogined() == false {
if let uid = LoginTokenConfig.config.getAccountInfo()?.uid, let token = LoginTokenConfig.config.getAccountInfo()?.netEaseToken {
NIMSDK.shared().loginManager.login("\(uid)", token: token) { error in
print("aaa")
print("login error: \(String(describing: error))")
}
} else {
///
self.window?.rootViewController = BaseNavigationViewController(rootViewController:AuthLaunchVC())
strongSelf.showLoginPage()
}
}
} else {
///
self.window?.rootViewController = BaseNavigationViewController(rootViewController:AuthLaunchVC())
strongSelf.showLoginPage()
}
}).disposed(by: rx.disposeBag)
UserViewModel.userVM.selfInfo.subscribe(onNext: { result in
UserViewModel.userVM.selfInfo.subscribe(onNext: { [weak self] result in
guard let strongSelf = self else { return }
if result.nick?.count ?? 0 <= 0 || result.avatar?.count ?? 0 <= 0 {
let fillVC = AuthFillDataVC()
fillVC.modalPresentationStyle = .fullScreen
self.window?.rootViewController = fillVC
strongSelf.window?.rootViewController = fillVC
}
}).disposed(by: rx.disposeBag)
}
private func showLoginPage() {
self.window?.rootViewController = BaseNavigationViewController(rootViewController:AuthLaunchVC())
}
private func loadNIMSDK() {
let opt = NIMSDKOption(appKey: AppKeys.nimAppid)
opt.apnsCername = "yinmeng_anps"