|
@@ -13,6 +13,9 @@ import RxSwift
|
|
|
class UpdateVersionView: FWPopupView {
|
|
|
|
|
|
let disposeBag = DisposeBag()
|
|
|
+ let titleStr = UpdateVersionModel.shared.object()?.title
|
|
|
+ let contentStr = UpdateVersionModel.shared.object()?.content
|
|
|
+
|
|
|
|
|
|
override init(frame: CGRect) {
|
|
|
super.init(frame: frame)
|
|
@@ -32,6 +35,7 @@ class UpdateVersionView: FWPopupView {
|
|
|
addSubview(titleLabel)
|
|
|
addSubview(detailTitleLabel)
|
|
|
addSubview(scrollView)
|
|
|
+ scrollView.addSubview(titleContentLabel)
|
|
|
scrollView.addSubview(contentLabel)
|
|
|
addSubview(lineLabel)
|
|
|
addSubview(v_lineLabel)
|
|
@@ -56,9 +60,14 @@ class UpdateVersionView: FWPopupView {
|
|
|
make.left.equalTo(20)
|
|
|
make.height.equalTo(132)
|
|
|
}
|
|
|
- contentLabel.snp.makeConstraints { (make) in
|
|
|
+ titleContentLabel.snp.makeConstraints { (make) in
|
|
|
make.top.left.width.equalToSuperview()
|
|
|
- make.height.equalTo(str.heightForComment(font: kRegularFont14!, width: 302 - 40))
|
|
|
+ make.height.equalTo((titleStr?.heightForComment(font: kRegularFont14!, width: 302 - 40) ?? 0))
|
|
|
+ }
|
|
|
+ contentLabel.snp.makeConstraints { (make) in
|
|
|
+ make.top.equalTo(titleContentLabel.snp.bottom)
|
|
|
+ make.left.width.equalToSuperview()
|
|
|
+ make.height.equalTo(contentStr?.heightForComment(font: kRegularFont14!, width: 302 - 40) ?? 0)
|
|
|
}
|
|
|
|
|
|
lineLabel.snp.makeConstraints { (make) in
|
|
@@ -109,15 +118,25 @@ class UpdateVersionView: FWPopupView {
|
|
|
|
|
|
lazy var scrollView: UIScrollView = {
|
|
|
let scrollView = UIScrollView()
|
|
|
- scrollView.contentSize = CGSize(width: 302-40, height: str.heightForComment(font: kRegularFont14!, width: 302 - 40))
|
|
|
+ scrollView.contentSize = CGSize(width: 302-40, height: (contentStr?.heightForComment(font: kRegularFont14!, width: 302 - 40) ?? 0) + (titleStr?.heightForComment(font: kRegularFont14!, width: 302 - 40) ?? 0))
|
|
|
return scrollView
|
|
|
}()
|
|
|
|
|
|
- let str = "升级功能:\n1、全新首页为你改变,资产事项一目了然。\n2、全新兑换专区,淘U票好物,享生活优惠。\n3、关注名家专栏,发现更多你感兴趣的内容。"
|
|
|
+
|
|
|
+
|
|
|
+ lazy var titleContentLabel: UILabel = {
|
|
|
+ let titleContentLabel = UILabel()
|
|
|
+ titleContentLabel.text = titleStr
|
|
|
+ titleContentLabel.textColor = k666666Color
|
|
|
+ titleContentLabel.font = kRegularFont14
|
|
|
+ titleContentLabel.numberOfLines = 0
|
|
|
+ return titleContentLabel
|
|
|
+ }()
|
|
|
+
|
|
|
|
|
|
lazy var contentLabel: UILabel = {
|
|
|
let contentLabel = UILabel()
|
|
|
- contentLabel.text = str
|
|
|
+ contentLabel.text = contentStr
|
|
|
contentLabel.textColor = k666666Color
|
|
|
contentLabel.font = kRegularFont14
|
|
|
contentLabel.numberOfLines = 0
|
|
@@ -152,11 +171,7 @@ class UpdateVersionView: FWPopupView {
|
|
|
return v_lineLabel
|
|
|
}()
|
|
|
|
|
|
- /// 隐藏View
|
|
|
- class func dismissView() {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
+ /// 初始化View
|
|
|
class func updateVersionView() -> UpdateVersionView {
|
|
|
let view = UpdateVersionView()
|
|
|
let vProperty = FWPopupViewProperty()
|
|
@@ -164,7 +179,7 @@ class UpdateVersionView: FWPopupView {
|
|
|
vProperty.popupViewEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
|
|
|
vProperty.popupAnimationType = .scale
|
|
|
vProperty.maskViewColor = UIColor(white: 0, alpha: 0.5)
|
|
|
- vProperty.touchWildToHide = "1"
|
|
|
+ vProperty.touchWildToHide = "0"
|
|
|
view.vProperty = vProperty
|
|
|
view.show()
|
|
|
view.leftButton.rx.tap.subscribe(onNext: { (data) in
|