Commit 97c9302f by pierce

如果手机没有安装微信。则隐藏微信

parent ca022a7e
......@@ -534,6 +534,8 @@ class LoginViewController: BaseViewController {
// } else {
// visitorBtn.isHidden = true
if let wechatOpenUrl = URL(string: "weixin://"), UIApplication.shared.canOpenURL(wechatOpenUrl) == true {
wechatBtn.isHidden = false
qqBtn.snp.makeConstraints { (make) in
make.size.equalTo(60)
make.centerX.equalToSuperview()
......@@ -551,6 +553,22 @@ class LoginViewController: BaseViewController {
make.left.equalTo(qqBtn.snp.right).offset(20)
make.bottom.equalTo(qqBtn)
}
} else {
wechatBtn.isHidden = true
qqBtn.snp.makeConstraints { (make) in
make.size.equalTo(60)
make.centerX.equalToSuperview().offset(-60)
make.bottom.equalTo(bottomLayoutGuide.snp.top).offset(-50)
}
appleBtn.snp.makeConstraints { (make) in
make.size.equalTo(60)
make.centerX.equalToSuperview().offset(60)
make.bottom.equalTo(qqBtn)
}
}
// }
} else {
......@@ -576,6 +594,10 @@ class LoginViewController: BaseViewController {
// }
// } else {
// visitorBtn.isHidden = true
if let wechatOpenUrl = URL(string: "weixin://"), UIApplication.shared.canOpenURL(wechatOpenUrl) == true {
wechatBtn.isHidden = false
qqBtn.snp.makeConstraints { (make) in
make.size.equalTo(60)
make.centerX.equalToSuperview().offset(60)
......@@ -587,6 +609,16 @@ class LoginViewController: BaseViewController {
make.centerX.equalToSuperview().offset(-60)
make.bottom.equalTo(qqBtn)
}
} else {
wechatBtn.isHidden = true
qqBtn.snp.makeConstraints { (make) in
make.size.equalTo(60)
make.centerX.equalToSuperview()
make.bottom.equalTo(bottomLayoutGuide.snp.top).offset(-50)
}
}
// }
}
......
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 sign in to comment