Commit b6d24b80 authored by Steven杜宇's avatar Steven杜宇

// 登录弹窗

parent d683e66e
...@@ -301,44 +301,74 @@ extension YHOneKeyLoginManager { ...@@ -301,44 +301,74 @@ extension YHOneKeyLoginManager {
model.privacyAlertIsNeedShow = true model.privacyAlertIsNeedShow = true
model.privacyAlertMaskAlpha = 0.5; model.privacyAlertMaskAlpha = 0.5;
model.privacyAlertMaskColor = .black model.privacyAlertMaskColor = .black
model.privacyAlertCornerRadiusArray = [3, 3, 3, 3] model.privacyAlertCornerRadiusArray = [6, 6, 6, 6]
model.privacyAlertBackgroundColor = .white model.privacyAlertBackgroundColor = .white
model.privacyAlertAlpha = 1.0 model.privacyAlertAlpha = 1.0
model.privacyAlertTitleBackgroundColor = .white model.privacyAlertTitleBackgroundColor = .white
model.privacyAlertContentBackgroundColor = .white model.privacyAlertContentBackgroundColor = .white
model.privacyAlertTitleFont = .PFSC_R(ofSize: 16) model.privacyAlertTitleFont = .PFSC_M(ofSize: 17)
model.privacyAlertContentFont = .PFSC_R(ofSize: 16)
model.privacyAlertTitleColor = UIColor.black model.privacyAlertTitleColor = UIColor.black
model.privacyAlertContentColors = [UIColor.gray, UIColor.orange] model.privacyAlertContentAlignment = .left
model.privacyAlertContentAlignment = .center
model.privacyAlertContentColors = [.black, .brandMainColor] model.privacyAlertContentColors = [.black, .brandMainColor]
let activeImage = TXCommonUtils.image(with: .brandMainColor, size: CGSizeMake(UIScreen.main.bounds.size.width - 2 * 18, 45), isRoundedCorner: true, radius: 6)! let activeImage = TXCommonUtils.image(with: .brandMainColor, size: CGSizeMake(UIScreen.main.bounds.size.width - 2 * 18, 45), isRoundedCorner: true, radius: 6)!
let hightLightImage = TXCommonUtils.image(with: .brandMainColor, size: CGSizeMake(UIScreen.main.bounds.size.width - 2 * 18, 45), isRoundedCorner: true, radius: 6)! let hightLightImage = TXCommonUtils.image(with: .brandMainColor, size: CGSizeMake(UIScreen.main.bounds.size.width - 2 * 18, 45), isRoundedCorner: true, radius: 6)!
model.privacyAlertBtnBackgroundImages = [activeImage, hightLightImage] model.privacyAlertBtnBackgroundImages = [activeImage, hightLightImage]
model.privacyAlertButtonTextColors = [UIColor.white, UIColor.white] model.privacyAlertButtonTextColors = [UIColor.white, UIColor.white]
model.privacyAlertButtonFont = .PFSC_R(ofSize: 16) model.privacyAlertButtonFont = .PFSC_M(ofSize: 14)
model.privacyAlertCloseButtonIsNeedShow = true model.privacyAlertCloseButtonIsNeedShow = true
model.privacyAlertMaskIsNeedShow = true model.privacyAlertMaskIsNeedShow = true
model.privacyAlertIsNeedAutoLogin = true model.privacyAlertIsNeedAutoLogin = true
model.tapPrivacyAlertMaskCloseAlert = false model.tapPrivacyAlertMaskCloseAlert = false
model.expandAuthPageCheckedScope = true model.expandAuthPageCheckedScope = true
model.privacyAlertCloseButtonIsNeedShow = true model.privacyAlertCloseButtonIsNeedShow = true
let alertGap = 38.0
let alertWidth = KScreenWidth-alertGap*2
let alertContentWidth = alertWidth-21.0*2
let titleHeight = 24.0
let alertBtnWith = alertWidth-16.0*2
let alertBtnHeight = 45.0
var currentTop = 0.0
model.privacyAlertTitleFrameBlock = { model.privacyAlertTitleFrameBlock = {
screenSize, superViewSize, frame in screenSize, superViewSize, frame in
return CGRectMake(0, 20, frame.size.width, 22) return CGRectMake(0, 15, frame.size.width, titleHeight)
} }
currentTop += 15.0+titleHeight
let text = "我已阅读并同意《中国移动认证服务条款》和《用户隐私协议》、《用户条款》"
let attributes = [NSAttributedString.Key.font: UIFont.PFSC_R(ofSize: 16)] as [NSAttributedString.Key : Any]
let boundingSize = (text as NSString).boundingRect(
with: CGSize(width: alertContentWidth, height: .greatestFiniteMagnitude),
options: .usesLineFragmentOrigin,
attributes: attributes,
context: nil
).size
let textHeight = ceill(boundingSize.height)
model.privacyAlertPrivacyContentFrameBlock = { model.privacyAlertPrivacyContentFrameBlock = {
screenSize, superViewSize, frame in screenSize, superViewSize, frame in
return CGRectMake(0, 20+22+20, frame.size.width-20, frame.size.height); return CGRectMake(21.0, 15+24+33, alertContentWidth, textHeight)
} }
currentTop += 33+textHeight
model.privacyAlertButtonFrameBlock = { model.privacyAlertButtonFrameBlock = {
screenSize, superViewSize, frame in screenSize, superViewSize, frame in
return CGRectMake(frame.origin.x, superViewSize.height - 50 - 20, frame.size.width, 45) return CGRectMake(16, 15+24+33+textHeight+36.0, alertBtnWith, alertBtnHeight)
} }
currentTop += 36.0+alertBtnHeight
let totalHeight = currentTop + 16.0
model.privacyAlertFrameBlock = { model.privacyAlertFrameBlock = {
screenSize, superViewSize, frame in screenSize, superViewSize, frame in
return CGRectMake(40, (superViewSize.height - 150)/2.0, screenSize.width-80, 200) return CGRectMake(alertGap, (superViewSize.height-totalHeight)/2.0, alertWidth, totalHeight)
}
if let closeImg = UIImage(named: "person_info_close_btn") {
model.privacyAlertCloseButtonImage = closeImg
}
model.privacyAlertCloseFrameBlock = {
screenSize, superViewSize, frame in
return CGRectMake(alertWidth-16.0-24.0, 15, 24, 24)
} }
return model return model
} }
......
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