|
@@ -6,10 +6,10 @@
|
|
//
|
|
//
|
|
|
|
|
|
import AuthenticationServices
|
|
import AuthenticationServices
|
|
-import JWTDecode
|
|
|
|
-import UIKit
|
|
|
|
import BFFramework
|
|
import BFFramework
|
|
|
|
+import JWTDecode
|
|
import TYAttributedLabel
|
|
import TYAttributedLabel
|
|
|
|
+import UIKit
|
|
|
|
|
|
class MVLoginController: MVBaseController {
|
|
class MVLoginController: MVBaseController {
|
|
let nomalH: CGFloat = cDefaultMargin * 5
|
|
let nomalH: CGFloat = cDefaultMargin * 5
|
|
@@ -65,9 +65,9 @@ class MVLoginController: MVBaseController {
|
|
return phoneLoginBtn
|
|
return phoneLoginBtn
|
|
}()
|
|
}()
|
|
|
|
|
|
- //icon
|
|
|
|
|
|
+ // icon
|
|
lazy var IconView: UIImageView = {
|
|
lazy var IconView: UIImageView = {
|
|
- let IconView = UIImageView.init(image: UIImage(named: "1024x1024px"))
|
|
|
|
|
|
+ let IconView = UIImageView(image: UIImage(named: "1024x1024px"))
|
|
return IconView
|
|
return IconView
|
|
}()
|
|
}()
|
|
|
|
|
|
@@ -86,12 +86,12 @@ class MVLoginController: MVBaseController {
|
|
remindBtn.setTitle(" \(remindTitle ?? "登录") ", for: .normal)
|
|
remindBtn.setTitle(" \(remindTitle ?? "登录") ", for: .normal)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
@objc override func backBtnClick() {
|
|
@objc override func backBtnClick() {
|
|
dismiss(animated: true, completion: nil)
|
|
dismiss(animated: true, completion: nil)
|
|
}
|
|
}
|
|
|
|
|
|
- override func viewDidLoad() {
|
|
|
|
|
|
+ override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
super.viewDidLoad()
|
|
view.addSubview(IconView)
|
|
view.addSubview(IconView)
|
|
view.addSubview(remindBtn)
|
|
view.addSubview(remindBtn)
|
|
@@ -110,20 +110,21 @@ class MVLoginController: MVBaseController {
|
|
self?.loginBtn.setTitle(nil, for: .normal)
|
|
self?.loginBtn.setTitle(nil, for: .normal)
|
|
self?.phoneLoginBtn.setTitle(nil, for: .normal)
|
|
self?.phoneLoginBtn.setTitle(nil, for: .normal)
|
|
}
|
|
}
|
|
- self?.loginBtn.setImage(UIImage.init(named: "mi_upload_share_friend"), for: .normal)
|
|
|
|
|
|
+ self?.loginBtn.setImage(UIImage(named: "mi_upload_share_friend"), for: .normal)
|
|
self?.loginBtn.backgroundColor = UIColor.black
|
|
self?.loginBtn.backgroundColor = UIColor.black
|
|
- }else{
|
|
|
|
- self?.loginBtn.setImage(UIImage.init(named: "weichatLogin"), for: .normal)
|
|
|
|
|
|
+ } else {
|
|
|
|
+ self?.loginBtn.setImage(UIImage(named: "weichatLogin"), for: .normal)
|
|
self?.loginBtn.backgroundColor = UIColor.white
|
|
self?.loginBtn.backgroundColor = UIColor.white
|
|
}
|
|
}
|
|
self?.addLayout()
|
|
self?.addLayout()
|
|
self?.phoneLoginBtn.isHidden = !PQSingletoMemoryUtil.shared.needLogin
|
|
self?.phoneLoginBtn.isHidden = !PQSingletoMemoryUtil.shared.needLogin
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
IconView.snp.makeConstraints { make in
|
|
IconView.snp.makeConstraints { make in
|
|
make.center.equalToSuperview()
|
|
make.center.equalToSuperview()
|
|
make.height.width.equalTo(260)
|
|
make.height.width.equalTo(260)
|
|
}
|
|
}
|
|
|
|
+ addNotification(self, selector: #selector(dismissVC), name: cLoginSuccesssNotiKey, object: nil)
|
|
}
|
|
}
|
|
|
|
|
|
override func viewWillAppear(_: Bool) {
|
|
override func viewWillAppear(_: Bool) {
|
|
@@ -131,12 +132,10 @@ class MVLoginController: MVBaseController {
|
|
|
|
|
|
showNavigation()
|
|
showNavigation()
|
|
leftButton(image: "close")
|
|
leftButton(image: "close")
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
override public func viewWillDisappear(_: Bool) {
|
|
override public func viewWillDisappear(_: Bool) {
|
|
super.viewWillDisappear(true)
|
|
super.viewWillDisappear(true)
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
func addLayout() {
|
|
func addLayout() {
|
|
@@ -146,7 +145,7 @@ class MVLoginController: MVBaseController {
|
|
make.right.equalTo(view).offset(-cDefaultMargin * 2)
|
|
make.right.equalTo(view).offset(-cDefaultMargin * 2)
|
|
make.height.equalTo(cScreenHeigth <= 568 ? cDefaultMargin * 4 : cDefaultMargin * 6)
|
|
make.height.equalTo(cScreenHeigth <= 568 ? cDefaultMargin * 4 : cDefaultMargin * 6)
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
remindBtn.snp.makeConstraints { make in
|
|
remindBtn.snp.makeConstraints { make in
|
|
// make.width.equalTo(cDefaultMargin * 13)
|
|
// make.width.equalTo(cDefaultMargin * 13)
|
|
make.height.equalTo(cDefaultMargin * 4)
|
|
make.height.equalTo(cDefaultMargin * 4)
|
|
@@ -154,7 +153,7 @@ class MVLoginController: MVBaseController {
|
|
make.top.equalTo(IconView.snp_bottom).offset(cDefaultMargin * 4)
|
|
make.top.equalTo(IconView.snp_bottom).offset(cDefaultMargin * 4)
|
|
}
|
|
}
|
|
let isInstallWX = PQSingletoWXApiUtil.shared.isInstallWX()
|
|
let isInstallWX = PQSingletoWXApiUtil.shared.isInstallWX()
|
|
-
|
|
|
|
|
|
+
|
|
if PQSingletoMemoryUtil.shared.needLogin {
|
|
if PQSingletoMemoryUtil.shared.needLogin {
|
|
if #available(iOS 13.0, *) {
|
|
if #available(iOS 13.0, *) {
|
|
if isInstallWX {
|
|
if isInstallWX {
|
|
@@ -211,6 +210,14 @@ class MVLoginController: MVBaseController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ deinit {
|
|
|
|
+ PQNotification.removeObserver(self)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @objc func dismissVC() {
|
|
|
|
+ dismiss(animated: true, completion: nil)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
extension MVLoginController: TYAttributedLabelDelegate {
|
|
extension MVLoginController: TYAttributedLabelDelegate {
|
|
@@ -233,7 +240,6 @@ extension MVLoginController: TYAttributedLabelDelegate {
|
|
|
|
|
|
extension MVLoginController: ASAuthorizationControllerDelegate, ASAuthorizationControllerPresentationContextProviding {
|
|
extension MVLoginController: ASAuthorizationControllerDelegate, ASAuthorizationControllerPresentationContextProviding {
|
|
@objc func wechatLoginAction() {
|
|
@objc func wechatLoginAction() {
|
|
-
|
|
|
|
if !PQSingletoWXApiUtil.shared.isInstallWX() {
|
|
if !PQSingletoWXApiUtil.shared.isInstallWX() {
|
|
cShowHUB(superView: nil, msg: "您还未安装微信客户端!")
|
|
cShowHUB(superView: nil, msg: "您还未安装微信客户端!")
|
|
return
|
|
return
|
|
@@ -257,7 +263,8 @@ extension MVLoginController: ASAuthorizationControllerDelegate, ASAuthorizationC
|
|
|
|
|
|
@objc func phoneLoginAction() {
|
|
@objc func phoneLoginAction() {
|
|
let vc = PQPhoneLoginController()
|
|
let vc = PQPhoneLoginController()
|
|
- navigationController?.pushViewController(vc, animated: true)
|
|
|
|
|
|
+ vc.modalPresentationStyle = .fullScreen
|
|
|
|
+ present(vc, animated: true, completion: nil)
|
|
}
|
|
}
|
|
|
|
|
|
@objc func appleLoginAction() {
|
|
@objc func appleLoginAction() {
|