Commit 45d7c6e7 authored by David黄金龙's avatar David黄金龙

信息提交成功 提示框

parent 5a28bab0
......@@ -85,6 +85,8 @@ target 'galaxy' do
############# 网易云信 IM相关 end #############
#富文本库
pod 'AttributedString','3.3.5'
end
......
......@@ -129,6 +129,7 @@
A5FD63C12B62616D00D1D9DA /* YHInformationPerfectModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63C02B62616D00D1D9DA /* YHInformationPerfectModel.swift */; };
A5FD63C32B63438A00D1D9DA /* YHContactMainItemStatusModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63C22B63438A00D1D9DA /* YHContactMainItemStatusModel.swift */; };
A5FD63C52B637EE000D1D9DA /* YHSubmitAllInfoCheckView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63C42B637EE000D1D9DA /* YHSubmitAllInfoCheckView.swift */; };
A5FD63C72B638CA000D1D9DA /* YHSubmintAllInfoSuccessTipView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63C62B638CA000D1D9DA /* YHSubmintAllInfoSuccessTipView.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
......@@ -290,6 +291,7 @@
A5FD63C02B62616D00D1D9DA /* YHInformationPerfectModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInformationPerfectModel.swift; sourceTree = "<group>"; };
A5FD63C22B63438A00D1D9DA /* YHContactMainItemStatusModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHContactMainItemStatusModel.swift; sourceTree = "<group>"; };
A5FD63C42B637EE000D1D9DA /* YHSubmitAllInfoCheckView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSubmitAllInfoCheckView.swift; sourceTree = "<group>"; };
A5FD63C62B638CA000D1D9DA /* YHSubmintAllInfoSuccessTipView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSubmintAllInfoSuccessTipView.swift; sourceTree = "<group>"; };
B6BB01E4C5DB87B66F0ECE84 /* Pods-galaxy.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.release.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
......@@ -752,6 +754,7 @@
A56D2D602B62020C009C83A8 /* YHContractMainItemStatusCell.swift */,
A5FD63BE2B6250BC00D1D9DA /* YHInformationPerfectCell.swift */,
A5FD63C42B637EE000D1D9DA /* YHSubmitAllInfoCheckView.swift */,
A5FD63C62B638CA000D1D9DA /* YHSubmintAllInfoSuccessTipView.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -1132,6 +1135,7 @@
A5C5B3122B57B47D00A7C5D1 /* YHDavidCell0.swift in Sources */,
A56D2D612B62020C009C83A8 /* YHContractMainItemStatusCell.swift in Sources */,
0468D43A2B579EAC00CFB916 /* YHLoginViewModel.swift in Sources */,
A5FD63C72B638CA000D1D9DA /* YHSubmintAllInfoSuccessTipView.swift in Sources */,
041B528F2B5E620E007EBCEB /* YHFormItemInputTextCell.swift in Sources */,
A5ACE9402B4564F7002C94D2 /* String+Extension.swift in Sources */,
A5ACE9482B4564F7002C94D2 /* BsHUDWariningView.swift in Sources */,
......
......@@ -92,6 +92,14 @@ extension YHInformationPerfectListVC {
YHSubmitAllInfoCheckView.showCheckView { agree in
if agree == true {
printLog("点击了 确认 按钮")
YHSubmintAllInfoSuccessTipView.showCheckView { agree in
if agree == true {
printLog("点击了 确认2 按钮")
} else {
printLog("点击了 取消2 按钮")
}
}
} else {
printLog("点击了 取消 按钮")
}
......
//
// YHSubmintAllInfoSuccessTipView.swift
// galaxy
//
// Created by davidhuangA on 2024/1/26.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHSubmintAllInfoSuccessTipView: UIView {
typealias Block = (Bool) -> ()
var block: Block?
var centerView: UIView!
var titleLabel: UILabel!
var messageLabel: UILabel!
var agreeButton: UIButton!
var disAgressButton: UIButton!
//头部背景图片
lazy var headBkgImagV: UIImageView = {
let imagV = UIImageView()
imagV.image = UIImage(named: "submit_success_bkg")
imagV.contentMode = .scaleAspectFill
return imagV
}()
//头部背景图片
lazy var successIcon: UIImageView = {
let imagV = UIImageView()
imagV.image = UIImage(named: "submit_success_icon")
imagV.contentMode = .scaleAspectFill
return imagV
}()
static func showCheckView(callBack: @escaping Block) {
let view = YHSubmintAllInfoSuccessTipView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
view.block = callBack
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()
}
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 = 12
return view
}()
addSubview(centerView)
centerView.snp.makeConstraints { make in
make.center.equalToSuperview()
make.width.equalTo(299)
make.height.equalTo(338)
}
centerView.addSubview(headBkgImagV)
headBkgImagV.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(159)
}
centerView.addSubview(successIcon)
successIcon.snp.makeConstraints { make in
make.top.equalTo(39)
make.centerX.equalToSuperview()
make.height.width.equalTo(73)
}
let lable = UILabel(text: "提交成功")
lable.textAlignment = .center
lable.font = kFont(name: "PingFangSC-Medium", size: 17)
lable.textColor = UIColor(hex:0x222222)
headBkgImagV.addSubview(lable)
lable.snp.makeConstraints { make in
make.bottom.equalToSuperview().offset(6)
make.left.right.equalToSuperview()
}
let lable2 = UILabel(text: "根据您填写的资料,您的评分如下:")
lable2.textAlignment = .center
lable2.font = kFont(name: "PingFangSC-Medium", size: 14)
lable2.textColor = UIColor(hex:0x222222)
centerView.addSubview(lable2)
lable2.snp.makeConstraints { make in
make.top.equalTo(headBkgImagV.snp.bottom).offset(10)
make.left.right.equalToSuperview()
}
messageLabel = {
let label = UILabel()
label.text = "90分"
// label.font = kFont(name: "DINAlternate-Bold", size: 22)
// label.textColor = UIColor(hex:0xFF9900)
label.textAlignment = .center
label.numberOfLines = 1
return label
}()
messageLabel.backgroundColor = .clear//for test hjl
centerView.addSubview(messageLabel)
messageLabel.snp.makeConstraints { make in
make.top.equalTo(lable2.snp.bottom).offset(10)
make.left.right.equalToSuperview()
make.height.equalTo(50)
}
let a: ASAttributedString = .init("90", .font(kFont(name: "DINAlternate-Bold", size: 32)),.foreground(UIColor(hex:0xFF9900)))
let b: ASAttributedString = .init("分", .font(kFont(name: "PingFang SC", size: 12)),.foreground(UIColor(hex:0x888F98)))
messageLabel.attributed.text = a + b
disAgressButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0xffffff)
button.titleLabel?.font = kBoldFont(size: 14)
button.contentHorizontalAlignment = .center
button.setTitle("取消", for: .normal)
button.setTitleColor( UIColor(hex:0x3c86f8), for: .normal)
button.layer.cornerRadius = 8
button.layer.borderWidth = 1
button.layer.borderColor = UIColor(hex: 0x3c86f8).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(hex:0x3c86f8)
button.titleLabel?.font = kBoldFont(size: 14)
button.contentHorizontalAlignment = .center
button.setTitle("评分详情", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = 8
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)
}
}
@objc func agree() {
block?(true)
dismiss()
}
@objc private func handleTap(_ sender: AnyObject?) {
print("处理点击手势")
dismiss()
}
@objc func disagree() {
block?(false)
dismiss()
}
func dismiss() {
removeFromSuperview()
}
}
extension YHSubmintAllInfoSuccessTipView: UIGestureRecognizerDelegate {
func gestureRecognizer(_ gestureRecognizer:UIGestureRecognizer, shouldReceive touch:UITouch) -> Bool {
if touch.view == self {
return true
}
return false
}
}
{
"images" : [
{
"filename" : "Rectangle 2519.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Rectangle 2519@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Rectangle 2519@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Group 3117.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 3117@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 3117@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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