Commit 0831de19 authored by pete谢兆麟's avatar pete谢兆麟

图片裁剪 复原事件 地址选择器

parent 5e5d8f72
......@@ -227,7 +227,7 @@ class YHAddressPickView: UIView {
@objc private func onClickHotCity(sender: UIButton) {
let hotProvince = ["北京市","上海市","广东省","广东省","浙江省","江苏省","江苏省","天津市","湖北省","湖南省","重庆市","四川省"]
let hotCity = ["北京市","上海市","广州市","深圳市","杭州市","南京市","苏州市","天津市","武汉市","长沙市","重庆市","成都市"]
let hotCity = ["市辖区","市辖区","广州市","深圳市","杭州市","南京市","苏州市","天津市","武汉市","长沙市","市辖区","成都市"]
let tag = sender.tag
setHotCityData(province: hotProvince[tag], city: hotCity[tag])
}
......
......@@ -24,10 +24,12 @@ class YHCardExampleView: UIView {
switch type {
case .identity:
messageLabel.isHidden = false
titleLabel.text = "身份证示例模板"
topImageView.image = UIImage(named: "service_card_id_back")
bottomImageView.image = UIImage(named: "service_card_id_frant")
case .passport:
messageLabel.isHidden = true
titleLabel.text = "港澳通行证示例模板"
topImageView.image = UIImage(named: "service_card_passport_frant")
bottomImageView.image = UIImage(named: "service_card_passport_back")
topImageView.snp.remakeConstraints { make in
......
......@@ -331,9 +331,6 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
}
}
}
// if let block = self.informationBlock {
// block(self.type, image, false)
// }
}
}
......@@ -393,9 +390,6 @@ class YHMainInformationCardTableViewCell: UITableViewCell {
}
}
}
// if let block = self.informationBlock {
// block(self.type, image, true)
// }
}
}
......
......@@ -31,13 +31,18 @@ class YHImageClipperViewController: YHBaseViewController {
public var successClippedHandler:SuccessClippedHandlerBlock?
public func setBaseImg(_ baseImg: UIImage, resultImgSize: CGSize, type: YHClipperType) {
self.baseImg = baseImg
self.resultImgSize = resultImgSize
clipperView = YHClipperView(frame: CGRect(x: 0, y: (isIphoneX() ? 88:64), width: KScreenWidth, height: KScreenHeight - k_Height_safeAreaInsetsBottom() - 54 - (isIphoneX() ? 88:64)))
clipperView?.resultImgSize = resultImgSize
clipperView?.baseImg = baseImg
clipperView?.type = type
self.view.addSubview(clipperView!)
self.view.sendSubviewToBack(clipperView!)
}
private var baseImg: UIImage!
private var resultImgSize: CGSize!
//MARK Private
private var clipperView: YHClipperView?
private var cannalButton: YHClipperButton!
......@@ -59,6 +64,17 @@ class YHImageClipperViewController: YHBaseViewController {
}
func setView() {
let bottomView = {
let bottom = UIView()
bottom.backgroundColor = .black
return bottom
}()
view.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(k_Height_safeAreaInsetsBottom() + 64)
}
sureButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
......@@ -117,6 +133,8 @@ class YHImageClipperViewController: YHBaseViewController {
}
@objc private func backImageBtnClick() {
clipperView?.resultImgSize = resultImgSize
clipperView?.baseImg = baseImg
// if cancelClippedHandler != nil {
// cancelClippedHandler!()
// }
......
......@@ -16,6 +16,7 @@ enum YHClipperType {
class YHClipperView: UIView {
public var resultImgSize:CGSize?{
didSet{
self.clipperView?.removeFromSuperview()
self.setClipperView()
}
}
......
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