Commit 522c74a0 authored by David黄金龙's avatar David黄金龙

统一使用 YHCommonAlertView

完善 YHCommonAlertView的功能
parent 6a67d94a
...@@ -409,8 +409,6 @@ ...@@ -409,8 +409,6 @@
A5C382CC2B5EA11800C5E65C /* YHContractCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C382CB2B5EA11800C5E65C /* YHContractCell.swift */; }; A5C382CC2B5EA11800C5E65C /* YHContractCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C382CB2B5EA11800C5E65C /* YHContractCell.swift */; };
A5C382CF2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C382CE2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift */; }; A5C382CF2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C382CE2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift */; };
A5C382D12B5FAAB300C5E65C /* YHContactItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C382D02B5FAAB300C5E65C /* YHContactItemModel.swift */; }; A5C382D12B5FAAB300C5E65C /* YHContactItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C382D02B5FAAB300C5E65C /* YHContactItemModel.swift */; };
A5C468572BFB1DAB0015E726 /* YHCommonAlertView2.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C468562BFB1DAB0015E726 /* YHCommonAlertView2.swift */; };
A5C468592BFB37380015E726 /* YHCommonAlertView3.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C468582BFB37380015E726 /* YHCommonAlertView3.swift */; };
A5C5B2EE2B4F9B8800A7C5D1 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = A5C5B2ED2B4F9B8800A7C5D1 /* Localizable.xcstrings */; }; A5C5B2EE2B4F9B8800A7C5D1 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = A5C5B2ED2B4F9B8800A7C5D1 /* Localizable.xcstrings */; };
A5D001212BAA9D99001F003C /* YHChoiceButtonHoldView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5D001202BAA9D99001F003C /* YHChoiceButtonHoldView.swift */; }; A5D001212BAA9D99001F003C /* YHChoiceButtonHoldView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5D001202BAA9D99001F003C /* YHChoiceButtonHoldView.swift */; };
A5D0012A2BABC84A001F003C /* YHFileListHeaerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5D001272BABC84A001F003C /* YHFileListHeaerView.swift */; }; A5D0012A2BABC84A001F003C /* YHFileListHeaerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5D001272BABC84A001F003C /* YHFileListHeaerView.swift */; };
...@@ -881,8 +879,6 @@ ...@@ -881,8 +879,6 @@
A5C382CB2B5EA11800C5E65C /* YHContractCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHContractCell.swift; sourceTree = "<group>"; }; A5C382CB2B5EA11800C5E65C /* YHContractCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHContractCell.swift; sourceTree = "<group>"; };
A5C382CE2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceCenterMainViewModel.swift; sourceTree = "<group>"; }; A5C382CE2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceCenterMainViewModel.swift; sourceTree = "<group>"; };
A5C382D02B5FAAB300C5E65C /* YHContactItemModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHContactItemModel.swift; sourceTree = "<group>"; }; A5C382D02B5FAAB300C5E65C /* YHContactItemModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHContactItemModel.swift; sourceTree = "<group>"; };
A5C468562BFB1DAB0015E726 /* YHCommonAlertView2.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCommonAlertView2.swift; sourceTree = "<group>"; };
A5C468582BFB37380015E726 /* YHCommonAlertView3.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCommonAlertView3.swift; sourceTree = "<group>"; };
A5C5B2ED2B4F9B8800A7C5D1 /* Localizable.xcstrings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; }; A5C5B2ED2B4F9B8800A7C5D1 /* Localizable.xcstrings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };
A5D001202BAA9D99001F003C /* YHChoiceButtonHoldView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHChoiceButtonHoldView.swift; sourceTree = "<group>"; }; A5D001202BAA9D99001F003C /* YHChoiceButtonHoldView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHChoiceButtonHoldView.swift; sourceTree = "<group>"; };
A5D001272BABC84A001F003C /* YHFileListHeaerView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHFileListHeaerView.swift; sourceTree = "<group>"; }; A5D001272BABC84A001F003C /* YHFileListHeaerView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHFileListHeaerView.swift; sourceTree = "<group>"; };
...@@ -1414,8 +1410,6 @@ ...@@ -1414,8 +1410,6 @@
0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.swift */, 0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.swift */,
044CF8D32BB6BCF700008CE8 /* YHSignatureUploadTableViewCell.swift */, 044CF8D32BB6BCF700008CE8 /* YHSignatureUploadTableViewCell.swift */,
0435FA7E2BA178C100024EAE /* YHCommonAlertView.swift */, 0435FA7E2BA178C100024EAE /* YHCommonAlertView.swift */,
A5C468562BFB1DAB0015E726 /* YHCommonAlertView2.swift */,
A5C468582BFB37380015E726 /* YHCommonAlertView3.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2836,7 +2830,6 @@ ...@@ -2836,7 +2830,6 @@
045EEE932B9F171A0022A143 /* YHPreviewInfoSingleLineTitleView.swift in Sources */, 045EEE932B9F171A0022A143 /* YHPreviewInfoSingleLineTitleView.swift in Sources */,
045EEF1D2B9F171A0022A143 /* YHAddressPickView.swift in Sources */, 045EEF1D2B9F171A0022A143 /* YHAddressPickView.swift in Sources */,
A58AC0A12BAC0B2900A30FA9 /* YHFileListItemView.swift in Sources */, A58AC0A12BAC0B2900A30FA9 /* YHFileListItemView.swift in Sources */,
A5C468572BFB1DAB0015E726 /* YHCommonAlertView2.swift in Sources */,
045EEED12B9F171A0022A143 /* YHScorePersonInfoCell.swift in Sources */, 045EEED12B9F171A0022A143 /* YHScorePersonInfoCell.swift in Sources */,
044CF8D42BB6BCF700008CE8 /* YHSignatureUploadTableViewCell.swift in Sources */, 044CF8D42BB6BCF700008CE8 /* YHSignatureUploadTableViewCell.swift in Sources */,
A567E5B02BD7643D00D5D5A0 /* YHHomeWebBottomView.swift in Sources */, A567E5B02BD7643D00D5D5A0 /* YHHomeWebBottomView.swift in Sources */,
...@@ -2971,7 +2964,6 @@ ...@@ -2971,7 +2964,6 @@
A5ACE9302B4564F7002C94D2 /* Algorithm.swift in Sources */, A5ACE9302B4564F7002C94D2 /* Algorithm.swift in Sources */,
045EEED52B9F171A0022A143 /* YHEducationRequestViewModel.swift in Sources */, 045EEED52B9F171A0022A143 /* YHEducationRequestViewModel.swift in Sources */,
045EEEB62B9F171A0022A143 /* YHWorkExperienceItemView.swift in Sources */, 045EEEB62B9F171A0022A143 /* YHWorkExperienceItemView.swift in Sources */,
A5C468592BFB37380015E726 /* YHCommonAlertView3.swift in Sources */,
A58A8C942BA6C7C600632765 /* YHCertificateEntryModel.swift in Sources */, A58A8C942BA6C7C600632765 /* YHCertificateEntryModel.swift in Sources */,
045EEEB82B9F171A0022A143 /* YHWorkExampleMessageView.swift in Sources */, 045EEEB82B9F171A0022A143 /* YHWorkExampleMessageView.swift in Sources */,
04F4B76B2BAA7E1E00D13284 /* YHCertificateTemplateSheetView.swift in Sources */, 04F4B76B2BAA7E1E00D13284 /* YHCertificateTemplateSheetView.swift in Sources */,
......
...@@ -39,30 +39,83 @@ class YHCommonAlertView: UIView { ...@@ -39,30 +39,83 @@ class YHCommonAlertView: UIView {
addGestureRecognizer(tap) addGestureRecognizer(tap)
setView() setView()
} }
func setContent(_ title: String? = nil, _ message: String? = nil, _ leftButtonString: String? = nil, _ rightButtonString: String? = nil) { func setContent(_ title: String? = nil, _ message: String? = nil, _ leftButtonString: String? = nil, _ rightButtonString: String? = nil) {
self.titleLabel.text = title titleLabel.text = title
self.messageLabel.text = message messageLabel.text = message
self.disAgressButton.setTitle(leftButtonString, for: .normal) disAgressButton.setTitle(leftButtonString, for: .normal)
self.agreeButton.setTitle(rightButtonString, for: .normal) agreeButton.setTitle(rightButtonString, for: .normal)
centerView.snp.remakeConstraints { make in
make.center.equalToSuperview()
make.width.equalTo(299)
// make.height.equalTo(164)
}
if title?.count == 0 || title == nil { if title?.count == 0 || title == nil {
centerView.snp.remakeConstraints { make in lineView.isHidden = true
make.center.equalToSuperview()
make.width.equalTo(299)
make.height.equalTo(164)
}
messageLabel.snp.remakeConstraints { make in messageLabel.snp.remakeConstraints { make in
make.left.equalTo(22) make.left.equalTo(22)
make.right.equalTo(-22) make.right.equalTo(-22)
make.height.lessThanOrEqualTo(60) make.height.greaterThanOrEqualTo(21)
make.top.equalTo(37) make.top.equalTo(37)
} }
lineView.isHidden = true
} else { } else {
lineView.isHidden = false lineView.isHidden = false
messageLabel.snp.remakeConstraints { make in
make.left.equalTo(22)
make.right.equalTo(-22)
make.height.greaterThanOrEqualTo(21)
make.top.equalTo(lineView.snp.bottom).offset(21)
}
}
if leftButtonString?.isEmpty == false && rightButtonString?.isEmpty == false {
disAgressButton.isHidden = false
agreeButton.isHidden = false
disAgressButton.snp.remakeConstraints { make in
make.top.equalTo(messageLabel.snp.bottom).offset(36)
make.left.equalTo(16)
make.bottom.equalTo(-21)
make.width.equalTo(128)
make.height.equalTo(45)
}
agreeButton.snp.remakeConstraints { make in
make.top.equalTo(disAgressButton.snp.top)
make.width.equalTo(disAgressButton.snp.width)
make.height.equalTo(disAgressButton.snp.height)
make.right.equalToSuperview().offset(-kMargin)
}
} else {
disAgressButton.isHidden = true
agreeButton.isHidden = false
agreeButton.snp.remakeConstraints { make in
make.top.equalTo(messageLabel.snp.bottom).offset(36)
make.height.equalTo(45)
make.right.equalToSuperview().offset(-kMargin)
make.left.equalToSuperview().offset(kMargin)
make.bottom.equalToSuperview().offset(-kMargin)
}
if rightButtonString?.isEmpty == true && leftButtonString?.isEmpty == true {
agreeButton.setTitle("我知道了", for: .normal)
} else if leftButtonString?.isEmpty == true {
} else {
agreeButton.setTitle(leftButtonString, for: .normal)
}
} }
} }
...@@ -104,7 +157,6 @@ class YHCommonAlertView: UIView { ...@@ -104,7 +157,6 @@ class YHCommonAlertView: UIView {
messageLabel = { messageLabel = {
let label = UILabel() let label = UILabel()
label.textAlignment = .center
label.textColor = UIColor.mainTextColor label.textColor = UIColor.mainTextColor
label.font = UIFont.PFSC_R(ofSize: 16) label.font = UIFont.PFSC_R(ofSize: 16)
label.numberOfLines = 0 label.numberOfLines = 0
...@@ -122,7 +174,7 @@ class YHCommonAlertView: UIView { ...@@ -122,7 +174,7 @@ class YHCommonAlertView: UIView {
disAgressButton = { disAgressButton = {
let button = UIButton(type: .custom) let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0xffffff) button.backgroundColor = UIColor(hex:0xffffff)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15) button.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
button.contentHorizontalAlignment = .center button.contentHorizontalAlignment = .center
button.setTitle("不同意", for: .normal) button.setTitle("不同意", for: .normal)
button.setTitleColor( UIColor.brandMainColor, for: .normal) button.setTitleColor( UIColor.brandMainColor, for: .normal)
...@@ -143,7 +195,7 @@ class YHCommonAlertView: UIView { ...@@ -143,7 +195,7 @@ class YHCommonAlertView: UIView {
agreeButton = { agreeButton = {
let button = UIButton(type: .custom) let button = UIButton(type: .custom)
button.backgroundColor = UIColor.brandMainColor button.backgroundColor = UIColor.brandMainColor
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15) button.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
button.contentHorizontalAlignment = .center button.contentHorizontalAlignment = .center
button.setTitle("同意", for: .normal) button.setTitle("同意", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal) button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
......
//
// YHCommonAlertView2.swift
// galaxy
//
// Created by davidhuangA on 2024/5/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCommonAlertView2: UIView {
typealias AgreeBlock = () -> ()
var agreeBlock: AgreeBlock?
var cancelBlcok: AgreeBlock?
var centerView: UIView!
var titleLabel: UILabel!
var lineView: UIView!
var messageLabel: UILabel!
var agreeButton: UIButton!
var disAgressButton: UIButton!
var isFullGuestureEnabel : Bool = true //view响应全局手势 默认响应
static func show(_ title: String? = nil, _ message: String? = nil, _ leftButtonString: String? = nil, _ rightButtonString: String? = nil,fullGuestureEnable : Bool = true,cancelCallBack: (() -> Void)? = nil, callBack: @escaping (() -> Void)) {
let view = YHCommonAlertView2(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
view.agreeBlock = callBack
view.cancelBlcok = cancelCallBack
view.setContent(title, message, leftButtonString, rightButtonString)
view.isFullGuestureEnabel = fullGuestureEnable
let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
}
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = UIColor(white: 0.5, alpha: 0.1)
let tap = UITapGestureRecognizer(target: self, action: #selector(handleTap))
tap.delegate = self
addGestureRecognizer(tap)
setView()
}
func setContent(_ title: String? = nil, _ message: String? = nil, _ leftButtonString: String? = nil, _ rightButtonString: String? = nil) {
self.titleLabel.text = title
self.messageLabel.text = message
self.disAgressButton.setTitle(leftButtonString, for: .normal)
self.agreeButton.setTitle(rightButtonString, for: .normal)
if title?.count == 0 || title == nil {
centerView.snp.remakeConstraints { make in
make.center.equalToSuperview()
make.width.equalTo(299)
make.height.equalTo(164)
}
messageLabel.snp.remakeConstraints { make in
make.left.equalTo(22)
make.right.equalTo(-22)
make.height.lessThanOrEqualTo(60)
make.top.equalTo(37)
}
lineView.isHidden = true
} else {
lineView.isHidden = false
centerView.snp.remakeConstraints { make in
make.center.equalToSuperview()
make.width.equalTo(299)
make.height.equalTo(334)
}
messageLabel.snp.remakeConstraints { make in
make.left.equalTo(22)
make.right.equalTo(-22)
make.height.equalTo(172)
make.top.equalTo(lineView.snp.bottom).offset(21)
}
}
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setView() {
backgroundColor = UIColor(hex: 0x0000, alpha: 0.5)
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
addSubview(centerView)
centerView.snp.makeConstraints { make in
make.center.equalToSuperview()
make.width.equalTo(299)
make.height.equalTo(187)
}
titleLabel = {
let label = UILabel()
label.textAlignment = .center
label.textColor = UIColor.mainTextColor
label.font = UIFont.PFSC_M(ofSize: 17)
label.numberOfLines = 0
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(22)
make.right.equalTo(-22)
make.height.equalTo(20)
make.top.equalTo(16)
}
messageLabel = {
let label = UILabel()
label.textAlignment = .left
label.textColor = UIColor.mainTextColor
label.font = UIFont.PFSC_R(ofSize: 16)
label.numberOfLines = 0
return label
}()
centerView.addSubview(messageLabel)
messageLabel.snp.makeConstraints { make in
make.left.equalTo(22)
make.right.equalTo(-22)
make.height.equalTo(42)
make.top.equalTo(63)
}
disAgressButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0xffffff)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.contentHorizontalAlignment = .center
button.setTitle("不同意", for: .normal)
button.setTitleColor( UIColor.brandMainColor, for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.layer.borderWidth = 1
button.layer.borderColor = UIColor.brandMainColor.cgColor
button.addTarget(self, action: #selector(disagree), for: .touchUpInside)
return button
}()
centerView.addSubview(disAgressButton)
disAgressButton.snp.makeConstraints { make in
make.left.equalTo(16)
make.bottom.equalTo(-21)
make.width.equalTo(128)
make.height.equalTo(45)
}
agreeButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor.brandMainColor
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.contentHorizontalAlignment = .center
button.setTitle("同意", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.addTarget(self, action: #selector(agree), for: .touchUpInside)
return button
}()
centerView.addSubview(agreeButton)
agreeButton.snp.makeConstraints { make in
make.right.equalTo(-16)
make.bottom.equalTo(-21)
make.width.equalTo(128)
make.height.equalTo(45)
}
lineView = {
let line = UIView()
line.backgroundColor = UIColor(hex: 0xF0F0F0)
return line
}()
centerView.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.left.right.equalTo(0)
make.height.equalTo(1)
make.top.equalTo(titleLabel.snp.bottom).offset(12)
}
}
@objc func agree() {
if let block = self.agreeBlock {
block()
}
dismiss()
}
@objc private func handleTap(_ sender: AnyObject?) {
print("处理点击手势")
if isFullGuestureEnabel {
dismiss()
}
}
@objc func disagree() {
if let block = self.cancelBlcok {
block()
}
dismiss()
}
func dismiss() {
removeFromSuperview()
}
}
extension YHCommonAlertView2: UIGestureRecognizerDelegate {
func gestureRecognizer(_ gestureRecognizer:UIGestureRecognizer, shouldReceive touch:UITouch) -> Bool {
if touch.view == self {
return true
}
return false
}
}
//
// YHCommonAlertView3.swift
// galaxy
//
// Created by davidhuangA on 2024/5/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCommonAlertView3: UIView {
typealias AgreeBlock = () -> ()
var agreeBlock: AgreeBlock?
var cancelBlcok: AgreeBlock?
var centerView: UIView!
var titleLabel: UILabel!
var lineView: UIView!
var messageLabel: UILabel!
var agreeButton: UIButton!
var disAgressButton: UIButton!
var isFullGuestureEnabel : Bool = true //view响应全局手势 默认响应
static func show(_ title: String? = nil, _ message: String? = nil, _ leftButtonString: String? = nil, _ rightButtonString: String? = nil,fullGuestureEnable : Bool = true,cancelCallBack: (() -> Void)? = nil, callBack: @escaping (() -> Void)) {
let view = YHCommonAlertView3(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
view.agreeBlock = callBack
view.cancelBlcok = cancelCallBack
view.setContent(title, message, leftButtonString, rightButtonString)
view.isFullGuestureEnabel = fullGuestureEnable
let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
}
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = UIColor(white: 0.5, alpha: 0.1)
let tap = UITapGestureRecognizer(target: self, action: #selector(handleTap))
tap.delegate = self
addGestureRecognizer(tap)
setView()
}
func setContent(_ title: String? = nil, _ message: String? = nil, _ leftButtonString: String? = nil, _ rightButtonString: String? = nil) {
self.titleLabel.text = title
self.messageLabel.text = message
self.disAgressButton.setTitle(leftButtonString, for: .normal)
self.agreeButton.setTitle(rightButtonString, for: .normal)
if title?.count == 0 || title == nil {
centerView.snp.remakeConstraints { make in
make.center.equalToSuperview()
make.width.equalTo(299)
make.height.equalTo(164)
}
messageLabel.snp.remakeConstraints { make in
make.left.equalTo(22)
make.right.equalTo(-22)
make.height.lessThanOrEqualTo(60)
make.top.equalTo(37)
}
lineView.isHidden = true
} else {
lineView.isHidden = false
centerView.snp.remakeConstraints { make in
make.center.equalToSuperview()
make.width.equalTo(299)
// make.height.equalTo(257 + 18)
}
messageLabel.snp.remakeConstraints { make in
make.left.equalTo(22)
make.right.equalTo(-22)
// make.height.equalTo(88 + 18)
make.top.equalTo(lineView.snp.bottom).offset(21)
}
disAgressButton.isHidden = true
agreeButton.snp.remakeConstraints { make in
make.right.equalTo(-16)
make.bottom.equalTo(-17)
make.left.equalTo(kMargin)
make.height.equalTo(45)
make.top.equalTo(messageLabel.snp.bottom).offset(28)
}
}
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setView() {
backgroundColor = UIColor(hex: 0x0000, alpha: 0.5)
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
addSubview(centerView)
centerView.snp.makeConstraints { make in
make.center.equalToSuperview()
make.width.equalTo(299)
make.height.equalTo(187)
}
titleLabel = {
let label = UILabel()
label.textAlignment = .center
label.textColor = UIColor.mainTextColor
label.font = UIFont.PFSC_M(ofSize: 17)
label.numberOfLines = 0
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(22)
make.right.equalTo(-22)
make.height.equalTo(20)
make.top.equalTo(16)
}
messageLabel = {
let label = UILabel()
label.textAlignment = .left
label.textColor = UIColor.mainTextColor
label.font = UIFont.PFSC_R(ofSize: 16)
label.numberOfLines = 0
return label
}()
centerView.addSubview(messageLabel)
messageLabel.snp.makeConstraints { make in
make.left.equalTo(22)
make.right.equalTo(-22)
make.height.equalTo(42)
make.top.equalTo(63)
}
disAgressButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0xffffff)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.contentHorizontalAlignment = .center
button.setTitle("不同意", for: .normal)
button.setTitleColor( UIColor.brandMainColor, for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.layer.borderWidth = 1
button.layer.borderColor = UIColor.brandMainColor.cgColor
button.addTarget(self, action: #selector(disagree), for: .touchUpInside)
return button
}()
centerView.addSubview(disAgressButton)
disAgressButton.snp.makeConstraints { make in
make.left.equalTo(16)
make.bottom.equalTo(-21)
make.width.equalTo(128)
make.height.equalTo(45)
}
agreeButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor.brandMainColor
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.contentHorizontalAlignment = .center
button.setTitle("同意", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.addTarget(self, action: #selector(agree), for: .touchUpInside)
return button
}()
centerView.addSubview(agreeButton)
agreeButton.snp.makeConstraints { make in
make.right.equalTo(-16)
make.bottom.equalTo(-21)
make.width.equalTo(128)
make.height.equalTo(45)
}
lineView = {
let line = UIView()
line.backgroundColor = UIColor(hex: 0xF0F0F0)
return line
}()
centerView.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.left.right.equalTo(0)
make.height.equalTo(1)
make.top.equalTo(titleLabel.snp.bottom).offset(12)
}
}
@objc func agree() {
if let block = self.agreeBlock {
block()
}
dismiss()
}
@objc private func handleTap(_ sender: AnyObject?) {
print("处理点击手势")
if isFullGuestureEnabel {
dismiss()
}
}
@objc func disagree() {
if let block = self.cancelBlcok {
block()
}
dismiss()
}
func dismiss() {
removeFromSuperview()
}
}
extension YHCommonAlertView3: UIGestureRecognizerDelegate {
func gestureRecognizer(_ gestureRecognizer:UIGestureRecognizer, shouldReceive touch:UITouch) -> Bool {
if touch.view == self {
return true
}
return false
}
}
...@@ -180,7 +180,7 @@ class YHCodeSueecssViewController: YHBaseViewController { ...@@ -180,7 +180,7 @@ class YHCodeSueecssViewController: YHBaseViewController {
if success == false { if success == false {
if error?.errorCode == YHErrorCode.unregisterError.rawValue { if error?.errorCode == YHErrorCode.unregisterError.rawValue {
YHCommonAlertView3.show("状态提示", "您的账号已注销,暂时无法登录app \n \r\n具体详情可邮件联系\r\nnick.gzm@galaxyoversea.com", "取消", "我知道了") { YHCommonAlertView.show("状态提示", "您的账号已注销,暂时无法登录app \n \r\n具体详情可邮件联系\r\nnick.gzm@galaxyoversea.com", "", "我知道了") {
self.navigationController?.popViewController() self.navigationController?.popViewController()
} }
} else { } else {
......
...@@ -96,7 +96,7 @@ extension YHCodeSueecssWithVideoBkgViewController { ...@@ -96,7 +96,7 @@ extension YHCodeSueecssWithVideoBkgViewController {
if success == false { if success == false {
if error?.errorCode == YHErrorCode.unregisterError.rawValue { if error?.errorCode == YHErrorCode.unregisterError.rawValue {
YHCommonAlertView3.show("状态提示", "您的账号已注销,暂时无法登录app \n \r\n具体详情可邮件联系\r\nnick.gzm@galaxyoversea.com", "取消", "我知道了") { YHCommonAlertView.show("状态提示", "您的账号已注销,暂时无法登录app \n \r\n具体详情可邮件联系\r\nnick.gzm@galaxyoversea.com", "", "我知道了") {
self.navigationController?.popViewController() self.navigationController?.popViewController()
} }
} else { } else {
......
...@@ -180,7 +180,7 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget ...@@ -180,7 +180,7 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget
//点击注销按钮 //点击注销按钮
@objc func clickRegBtn() { @objc func clickRegBtn() {
YHCommonAlertView2.show("风险提示", "您正在进行账号注销操作,一旦完成注销,您将无法再登录\"银河港生活\"APP,并因此无法在APP中继续现有的服务流程。\n \n真心希望您能留下来,继续享受银河港生活为您提供的精彩服务。", "取消", "坚持注销") { YHCommonAlertView.show("风险提示", "您正在进行账号注销操作,一旦完成注销,您将无法再登录\"银河港生活\"APP,并因此无法在APP中继续现有的服务流程。\n \n真心希望您能留下来,继续享受银河港生活为您提供的精彩服务。", "取消", "坚持注销") {
self.unRegisterAPPOp() self.unRegisterAPPOp()
} }
......
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