CNLiveVitaeCerAddPhotoController.swift
7.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
//
// CNLiveVitaeCerAddPhotoController.swift
// metaCode
//
// Created by zx on 2024/7/27.
// 数字简历-添加证书示例页面
import Foundation
import SnapKit
class CNLiveVitaeCerAddPhotoController:CNLiveBaseViewController{
var isYuanJian = true//原件 or 截图
lazy var cerYuanJianBtn: UIButton = {
let closeBtn = UIButton(type: .custom)
closeBtn.setTitle("证书原件拍照", for: .normal)
closeBtn.setTitleColor(HexColor("#1961FE"), for: .normal)
closeBtn.addTarget(self, action: #selector(cerYuanJianBtnAction), for: .touchUpInside)
return closeBtn
}()
lazy var cerZhengMingBtn: UIButton = {
let closeBtn = UIButton(type: .custom)
closeBtn.setTitle("证书证明截图", for: .normal)
closeBtn.setTitleColor(HexColor("#333333"), for: .normal)
closeBtn.addTarget(self, action: #selector(cerZhengMingBtnAction), for: .touchUpInside)
return closeBtn
}()
lazy var lineView :UIView = {
let bottomNavView = UIView()
bottomNavView.backgroundColor = HexColor("#1961FE")
bottomNavView.layer.cornerRadius = 2
bottomNavView.clipsToBounds = true
return bottomNavView
}()
lazy var whiteBgView :UIView = {
let bottomNavView = UIView()
bottomNavView.backgroundColor = HexColor("#FFFFFF")
bottomNavView.layer.cornerRadius = 9
bottomNavView.clipsToBounds = true
return bottomNavView
}()
lazy var uploadTitleLabel: UILabel = {
let titleLabel = UILabel()
titleLabel.textColor = HexColor("#333333")
titleLabel.textAlignment = .left
titleLabel.text = "证书原件拍照上传"
titleLabel.font = BoldFont_15
return titleLabel
}()
lazy var uploadRealBgView :UIView = {
let bottomNavView = UIView()
bottomNavView.backgroundColor = HexColor("#F7F8FA")
return bottomNavView
}()
lazy var uploadRealTitleLabel: UILabel = {
let titleLabel = UILabel()
titleLabel.textColor = HexColor("#999999")
titleLabel.textAlignment = .left
titleLabel.numberOfLines = 3
titleLabel.text = "·证书图片需包含证书名称、证书编号、发证机构等字段信息\n·拍摄保持全面清晰完整\n·上传图片时请保持文字方向朝上"
titleLabel.font = Font_11
return titleLabel
}()
lazy var cerYuanJianImgView :UIImageView = {
let iconImgView = UIImageView()
iconImgView.image = UIImage(named: "mine_jianli_cerYuanJian")
return iconImgView
}()
override func viewDidLoad() {
super.viewDidLoad()
titleName = "证书上传正确示例"
navigationBarHidden = false
self.initUI()
}
deinit {}
func initUI(){
self.view.backgroundColor = HexColor("#F6F7FB")
self.view.addSubview(self.cerYuanJianBtn)
self.cerYuanJianBtn.snp.makeConstraints { make in
make.left.equalTo(0)
make.top.equalTo(KNavigationHeight+15)
make.height.equalTo(21)
make.width.equalTo(KSreenWidth/2)
}
self.view.addSubview(self.cerZhengMingBtn)
self.cerZhengMingBtn.snp.makeConstraints { make in
make.top.equalTo(KNavigationHeight+15)
make.height.equalTo(21)
make.width.equalTo(KSreenWidth/2)
make.right.equalToSuperview()
}
self.view.addSubview(self.lineView)
self.lineView.snp.makeConstraints { make in
make.top.equalTo(self.cerYuanJianBtn.snp.bottom).offset(5)
make.height.equalTo(4)
make.width.equalTo(25)
make.centerX.equalTo(self.cerYuanJianBtn.snp.centerX)
}
self.view.addSubview(self.whiteBgView)
self.whiteBgView.snp.makeConstraints { make in
make.top.equalTo(self.lineView.snp.bottom).offset(15)
make.height.equalTo(322)
make.left.equalTo(15)
make.right.equalToSuperview().offset(-15)
}
self.whiteBgView.addSubview(self.uploadTitleLabel)
self.uploadTitleLabel.snp.makeConstraints { make in
make.top.equalTo(15)
make.left.equalTo(15)
}
self.whiteBgView.addSubview(self.uploadRealBgView)
self.uploadRealBgView.snp.makeConstraints { make in
make.top.equalTo(self.uploadTitleLabel.snp.bottom).offset(10)
make.left.equalTo(15)
make.height.equalTo(65)
make.right.equalToSuperview().offset(-15)
}
self.uploadRealBgView.addSubview(self.uploadRealTitleLabel)
self.uploadRealTitleLabel.snp.makeConstraints { make in
make.left.equalTo(10)
make.right.equalToSuperview().offset(-10)
make.centerY.equalToSuperview()
}
self.whiteBgView.addSubview(self.cerYuanJianImgView)
self.cerYuanJianImgView.snp.makeConstraints { make in
make.top.equalTo(self.uploadRealBgView.snp.bottom).offset(15)
make.left.equalTo(15)
make.right.equalToSuperview().offset(-15)
make.bottom.equalToSuperview().offset(-15)
}
}
@objc func cerYuanJianBtnAction(){
self.isYuanJian = true
self.updateUI()
}
@objc func cerZhengMingBtnAction(){
self.isYuanJian = false
self.updateUI()
}
func updateUI(){
if self.isYuanJian == true{
self.cerYuanJianBtn.setTitleColor(HexColor("#1961FE"), for: .normal)
self.cerZhengMingBtn.setTitleColor(HexColor("#333333"), for: .normal)
self.lineView.snp.remakeConstraints { make in
make.top.equalTo(self.cerYuanJianBtn.snp.bottom).offset(5)
make.height.equalTo(4)
make.width.equalTo(25)
make.centerX.equalTo(self.cerYuanJianBtn.snp.centerX)
}
self.uploadTitleLabel.text = "证书原件拍照上传"
self.uploadRealTitleLabel.text = "·证书图片需包含证书名称、证书编号、发证机构等字段信息\n·拍摄保持全面清晰完整\n·上传图片时请保持文字方向朝上"
self.uploadRealTitleLabel.numberOfLines = 3
self.cerYuanJianImgView.image = UIImage(named: "mine_jianli_cerYuanJian")
}else{
self.cerYuanJianBtn.setTitleColor(HexColor("#333333"), for: .normal)
self.cerZhengMingBtn.setTitleColor(HexColor("#1961FE"), for: .normal)
self.lineView.snp.remakeConstraints { make in
make.top.equalTo(self.cerYuanJianBtn.snp.bottom).offset(5)
make.height.equalTo(4)
make.width.equalTo(25)
make.centerX.equalTo(self.cerZhengMingBtn.snp.centerX)
}
self.uploadTitleLabel.text = "截图/拍照证书信息上传"
self.uploadRealTitleLabel.text = "·拍照上传支持截图、纸条等\n ·包含字段需要带有证书名、身份证号、姓名等"
self.uploadRealTitleLabel.numberOfLines = 2
self.cerYuanJianImgView.image = UIImage(named: "mine_jianli_cerJieTu")
}
}
}