Commit 203cd5b0 authored by Steven杜宇's avatar Steven杜宇

// plan

parent 640e57a3
...@@ -18,12 +18,12 @@ class YHPlanShareBgView: UIView, JXSegmentedListContainerViewListDelegate { ...@@ -18,12 +18,12 @@ class YHPlanShareBgView: UIView, JXSegmentedListContainerViewListDelegate {
let bgWidth = 293.0 let bgWidth = 293.0
let bgHeight = 380.0 let bgHeight = 380.0
var index: YHPlanShareBgType = .link { var type: YHPlanShareBgType = .link {
didSet { didSet {
imgV.image = index == .link ? UIImage(named: "plan_share_link_bg") : UIImage(named: "plan_share_pdf_bg") imgV.image = type == .link ? UIImage(named: "plan_share_link_bg") : UIImage(named: "plan_share_pdf_bg")
imgV.snp.remakeConstraints { make in imgV.snp.remakeConstraints { make in
make.width.equalTo( index == .link ? bgWidth : 217) make.width.equalTo( type == .link ? bgWidth : 217)
make.height.equalTo(bgHeight) make.height.equalTo(bgHeight)
make.centerX.equalToSuperview() make.centerX.equalToSuperview()
make.centerY.equalToSuperview() make.centerY.equalToSuperview()
...@@ -66,6 +66,8 @@ class YHPlanShareBgView: UIView, JXSegmentedListContainerViewListDelegate { ...@@ -66,6 +66,8 @@ class YHPlanShareBgView: UIView, JXSegmentedListContainerViewListDelegate {
class YHPlanShareViewController: YHBaseViewController { class YHPlanShareViewController: YHBaseViewController {
var type: YHPlanShareBgType = .link
let segmentTitles = ["分享链接", "分享PDF"] let segmentTitles = ["分享链接", "分享PDF"]
let bgWidth = 293.0 let bgWidth = 293.0
let bgHeight = 380.0 let bgHeight = 380.0
...@@ -108,18 +110,19 @@ class YHPlanShareViewController: YHBaseViewController { ...@@ -108,18 +110,19 @@ class YHPlanShareViewController: YHBaseViewController {
lazy var bottomShareView: YHPlanShareView = { lazy var bottomShareView: YHPlanShareView = {
let v = YHPlanShareView(frame: .zero) let v = YHPlanShareView(frame: .zero)
v.type = .link
return v return v
}() }()
lazy var shareLinkBgView: YHPlanShareBgView = { lazy var shareLinkBgView: YHPlanShareBgView = {
let v = YHPlanShareBgView() let v = YHPlanShareBgView()
v.index = .link v.type = .link
return v return v
}() }()
lazy var sharePdfBgView: YHPlanShareBgView = { lazy var sharePdfBgView: YHPlanShareBgView = {
let v = YHPlanShareBgView() let v = YHPlanShareBgView()
v.index = .pdf v.type = .pdf
return v return v
}() }()
...@@ -156,6 +159,12 @@ extension YHPlanShareViewController: JXSegmentedViewDelegate { ...@@ -156,6 +159,12 @@ extension YHPlanShareViewController: JXSegmentedViewDelegate {
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) { func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
if index == 1 {
self.type = .pdf
} else {
self.type = .link
}
bottomShareView.type = self.type
} }
} }
......
...@@ -15,6 +15,19 @@ class YHPlanShareView: UIView { ...@@ -15,6 +15,19 @@ class YHPlanShareView: UIView {
let saveImgTag = 9529 let saveImgTag = 9529
let cancelTag = 9530 let cancelTag = 9530
var type: YHPlanShareBgType = .link {
didSet {
if type == .link {
copyLinkBtn.iconImgV.image = UIImage(named: "plan_share_copy")
copyLinkBtn.textLabel.text = "复制链接"
} else if type == .pdf {
copyLinkBtn.iconImgV.image = UIImage(named: "plan_share_save")
copyLinkBtn.textLabel.text = "保存PDF"
}
}
}
var clickBlock: ((YHPlanShareItemButtonType) -> Void)? var clickBlock: ((YHPlanShareItemButtonType) -> Void)?
lazy var whiteContentView: UIView = { lazy var whiteContentView: UIView = {
......
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