Commit aa2a99d2 authored by David黄金龙's avatar David黄金龙

Merge branch 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into develop

* 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS:
  // 我的证件
  //  我的证件
  // 相册权限提示
parents af29f083 d9e5f0e8
......@@ -12,7 +12,6 @@ import AttributedString
class YHCertificateInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHCertificateNameCell"
var status : YHCertificateUploadStatus = .preUpload
......@@ -22,21 +21,7 @@ class YHCertificateInfoCell: UITableViewCell {
var infoLabel: UILabel!
var statusLabel: UILabel!
var rightArrowImgV: UIImageView!
private lazy var templateLabel : UILabel = {
let label = UILabel(frame: CGRect(x: 0, y: 0, width: 48, height: 16))
label.text = "资料模版"
label.font = .PFSC_M(ofSize: 10)
label.backgroundColor = .brandMainColor8
label.textColor = .brandMainColor
label.layer.cornerRadius = 3
label.clipsToBounds = true
label.textAlignment = .center
label.isUserInteractionEnabled = true
let tap = UITapGestureRecognizer(target: self, action: #selector(didTemplateBtnClicked))
label.addGestureRecognizer(tap)
return label
}()
var templateButton: UIButton!
required init?(coder: NSCoder) {
super.init(coder: coder)
......@@ -81,7 +66,7 @@ class YHCertificateInfoCell: UITableViewCell {
} else {
nameTextView.attributed.text = """
\(model.name, .foreground(UIColor.mainTextColor), .font(UIFont.PFSC_M(ofSize: 16))) \(.view(templateLabel, .original(.center)))
\(model.name, .foreground(UIColor.mainTextColor), .font(UIFont.PFSC_M(ofSize: 16))) \(.view(templateButton, .original(.center)))
"""
}
infoLabel.text = "类型: \(model.typeName) 所属人: \(model.nameExtra.userName)"
......@@ -112,8 +97,18 @@ class YHCertificateInfoCell: UITableViewCell {
nameTextView.isSelectable = false
whiteView.addSubview(nameTextView)
templateButton = UIButton()
templateButton.frame = CGRect(x: 0, y: 0, width: 48, height: 16)
templateButton.setTitle("资料模版", for: .normal)
templateButton.titleLabel?.font = .PFSC_M(ofSize: 10)
templateButton.setTitleColor(.brandMainColor, for: .normal)
templateButton.layer.cornerRadius = 3
templateButton.clipsToBounds = true
templateButton.backgroundColor = .brandMainColor8
templateButton.addTarget(self, action: #selector(didTemplateBtnClicked), for: .touchUpInside)
nameTextView.attributed.text = """
\("资料名称", .foreground(UIColor.mainTextColor), .font(UIFont.PFSC_M(ofSize: 16))) \(.view(templateLabel, .original(.center)))
\("资料名称", .foreground(UIColor.mainTextColor), .font(UIFont.PFSC_M(ofSize: 16))) \(.view(templateButton, .original(.center))))
"""
infoLabel = UILabel()
......@@ -164,5 +159,12 @@ class YHCertificateInfoCell: UITableViewCell {
make.centerY.equalToSuperview()
}
}
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
let hitView = super.hitTest(point, with: event)
if hitView == nameTextView {
return self
}
return hitView
}
}
......@@ -383,7 +383,10 @@ extension YHCertificateUploadSheetView: (UIImagePickerControllerDelegate & UINav
}
func takePhoto() {
guard getPhotoLibraryAuthorization() else { return }
guard getPhotoLibraryAuthorization() else {
YHHUD.flash(message: "请打开相册权限")
return
}
if UIImagePickerController.isSourceTypeAvailable(.camera){
//创建图片控制器
let imagePicker = UIImagePickerController()
......@@ -401,7 +404,10 @@ extension YHCertificateUploadSheetView: (UIImagePickerControllerDelegate & UINav
}
func selectPhoto() {
guard getPhotoLibraryAuthorization() else { return }
guard getPhotoLibraryAuthorization() else {
YHHUD.flash(message: "请打开相册权限")
return
}
if UIImagePickerController.isSourceTypeAvailable(.photoLibrary){
let imagePicker = UIImagePickerController()
imagePicker.delegate = self
......
......@@ -165,7 +165,10 @@ class YHImagePickerView: UIView {
}
@objc func takePhoto() {
guard getPhotoLibraryAuthorization() else { return }
guard getPhotoLibraryAuthorization() else {
YHHUD.flash(message: "请打开相册权限")
return
}
if UIImagePickerController.isSourceTypeAvailable(.camera){
//创建图片控制器
let imagePicker = UIImagePickerController()
......@@ -183,7 +186,10 @@ class YHImagePickerView: UIView {
}
@objc func selectPhoto() {
guard getPhotoLibraryAuthorization() else { return }
guard getPhotoLibraryAuthorization() else {
YHHUD.flash(message: "请打开相册权限")
return
}
if UIImagePickerController.isSourceTypeAvailable(.photoLibrary){
let imagePicker = UIImagePickerController()
imagePicker.delegate = self
......
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