Commit 5c18623b authored by pete谢兆麟's avatar pete谢兆麟

增加隐私协议弹窗前置

parent 7e714463
...@@ -326,6 +326,7 @@ class YHOtherLoginViewController: YHBaseViewController { ...@@ -326,6 +326,7 @@ class YHOtherLoginViewController: YHBaseViewController {
} }
@objc func wechatLogin() { @objc func wechatLogin() {
if privacyView.isAgree {
let login = YHShareManager.shared let login = YHShareManager.shared
login.sendLogin() login.sendLogin()
login.success = { [weak self] unionId in login.success = { [weak self] unionId in
...@@ -351,14 +352,31 @@ class YHOtherLoginViewController: YHBaseViewController { ...@@ -351,14 +352,31 @@ class YHOtherLoginViewController: YHBaseViewController {
} }
} }
} }
} else {
let view = YHPrivacyAlertView(frame: view.bounds)
view.urlBlock = { [weak self] (type,url) in
guard let self = self else { return }
let vc = YHWebViewViewController()
vc.url = url
if type == 0 {
vc.navTitle = "银河港生活隐私政策"
} else if type == 1 {
vc.navTitle = "银河港生活用户条款"
}
self.navigationController?.pushViewController(vc)
}
view.agreeBlock = { [weak self] in
guard let self = self else { return }
self.privacyView.isAgree = true
self.wechatLogin()
}
self.view.addSubview(view)
}
} }
@objc func appleLogin() { @objc func appleLogin() {
//第一次appid登录跳转逻辑 if privacyView.isAgree {
// let vc = YHOtherLoginViewController()
// vc.type = .apple
// navigationController?.pushViewController(vc)
YHAppleLoginManager.shared.success = { YHAppleLoginManager.shared.success = {
dict in dict in
...@@ -396,6 +414,27 @@ class YHOtherLoginViewController: YHBaseViewController { ...@@ -396,6 +414,27 @@ class YHOtherLoginViewController: YHBaseViewController {
} }
} }
YHAppleLoginManager.shared.appleLogin() YHAppleLoginManager.shared.appleLogin()
} else {
let view = YHPrivacyAlertView(frame: view.bounds)
view.urlBlock = { [weak self] (type,url) in
guard let self = self else { return }
let vc = YHWebViewViewController()
vc.url = url
if type == 0 {
vc.navTitle = "银河港生活隐私政策"
} else if type == 1 {
vc.navTitle = "银河港生活用户条款"
}
self.navigationController?.pushViewController(vc)
}
view.agreeBlock = { [weak self] in
guard let self = self else { return }
self.privacyView.isAgree = true
self.appleLogin()
}
self.view.addSubview(view)
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment