|
@@ -11,78 +11,78 @@ import UIKit
|
|
|
|
|
|
class MDPCompanyCell: BaseTableViewCell {
|
|
class MDPCompanyCell: BaseTableViewCell {
|
|
lazy var titleLab: UILabel = {
|
|
lazy var titleLab: UILabel = {
|
|
- let label = UILabel()
|
|
|
|
- label.font = .systemFont(ofSize: 16, weight: .semibold)
|
|
|
|
- label.textColor = _color("#333333񑘕")
|
|
|
|
- return label
|
|
|
|
|
|
+ let v = UILabel()
|
|
|
|
+ v.font = .pf_16_semibold
|
|
|
|
+ v.textColor = Color(0x333333)
|
|
|
|
+ return v
|
|
}()
|
|
}()
|
|
|
|
|
|
/// 公司名称
|
|
/// 公司名称
|
|
lazy var companyName: UILabel = {
|
|
lazy var companyName: UILabel = {
|
|
- let label = UILabel()
|
|
|
|
- label.font = .systemFont(ofSize: 12, weight: .regular)
|
|
|
|
- label.textColor = _color("#343434񓶊")
|
|
|
|
- return label
|
|
|
|
|
|
+ let v = UILabel()
|
|
|
|
+ v.font = .pf_12_regular
|
|
|
|
+ v.textColor = Color(0x343434)
|
|
|
|
+ return v
|
|
}()
|
|
}()
|
|
|
|
|
|
/// 证劵代码
|
|
/// 证劵代码
|
|
lazy var securityCode: UILabel = {
|
|
lazy var securityCode: UILabel = {
|
|
- let label = UILabel()
|
|
|
|
- label.font = .systemFont(ofSize: 12, weight: .regular)
|
|
|
|
- label.textColor = _color("#343434񓶊")
|
|
|
|
- return label
|
|
|
|
|
|
+ let v = UILabel()
|
|
|
|
+ v.font = .pf_12_regular
|
|
|
|
+ v.textColor = Color(0x343434)
|
|
|
|
+ return v
|
|
}()
|
|
}()
|
|
|
|
|
|
/// 上市场所
|
|
/// 上市场所
|
|
lazy var listingPlace: UILabel = {
|
|
lazy var listingPlace: UILabel = {
|
|
- let label = UILabel()
|
|
|
|
- label.font = .systemFont(ofSize: 12, weight: .regular)
|
|
|
|
- label.textColor = _color("#343434񓶊")
|
|
|
|
- return label
|
|
|
|
|
|
+ let v = UILabel()
|
|
|
|
+ v.font = .pf_12_regular
|
|
|
|
+ v.textColor = Color(0x343434)
|
|
|
|
+ return v
|
|
}()
|
|
}()
|
|
|
|
|
|
/// 上市日期
|
|
/// 上市日期
|
|
lazy var listingDate: UILabel = {
|
|
lazy var listingDate: UILabel = {
|
|
- let label = UILabel()
|
|
|
|
- label.font = .systemFont(ofSize: 12, weight: .regular)
|
|
|
|
- label.textColor = _color("#343434񓶊")
|
|
|
|
- return label
|
|
|
|
|
|
+ let v = UILabel()
|
|
|
|
+ v.font = .pf_12_regular
|
|
|
|
+ v.textColor = Color(0x343434)
|
|
|
|
+ return v
|
|
}()
|
|
}()
|
|
|
|
|
|
/// 所在地
|
|
/// 所在地
|
|
lazy var locationLabel: UILabel = {
|
|
lazy var locationLabel: UILabel = {
|
|
- let label = UILabel()
|
|
|
|
- label.font = .systemFont(ofSize: 12, weight: .regular)
|
|
|
|
- label.textColor = _color("#343434񓶊")
|
|
|
|
- return label
|
|
|
|
|
|
+ let v = UILabel()
|
|
|
|
+ v.font = .pf_12_regular
|
|
|
|
+ v.textColor = Color(0x343434)
|
|
|
|
+ return v
|
|
}()
|
|
}()
|
|
|
|
|
|
/// 董事长
|
|
/// 董事长
|
|
lazy var chairmanLabel: UILabel = {
|
|
lazy var chairmanLabel: UILabel = {
|
|
- let label = UILabel()
|
|
|
|
- label.font = .systemFont(ofSize: 12, weight: .regular)
|
|
|
|
- label.textColor = _color("#343434񓶊")
|
|
|
|
- return label
|
|
|
|
|
|
+ let v = UILabel()
|
|
|
|
+ v.font = .pf_12_regular
|
|
|
|
+ v.textColor = Color(0x343434)
|
|
|
|
+ return v
|
|
}()
|
|
}()
|
|
|
|
|
|
lazy var companypProfileTitle: UILabel = {
|
|
lazy var companypProfileTitle: UILabel = {
|
|
- let label = UILabel()
|
|
|
|
- label.numberOfLines = 2
|
|
|
|
- label.text = switchLanguage("公司简介")
|
|
|
|
- label.font = .systemFont(ofSize: 12, weight: .regular)
|
|
|
|
- label.textColor = _color("#999BA1ϧBA1")
|
|
|
|
- return label
|
|
|
|
|
|
+ let v = UILabel()
|
|
|
|
+ v.numberOfLines = 2
|
|
|
|
+ v.text = switchLanguage("公司简介")
|
|
|
|
+ v.font = .pf_12_regular
|
|
|
|
+ v.textColor = Color(0x999BA1)
|
|
|
|
+ return v
|
|
}()
|
|
}()
|
|
|
|
|
|
/// 公司简介
|
|
/// 公司简介
|
|
lazy var companypProfile: BSLabel = {
|
|
lazy var companypProfile: BSLabel = {
|
|
- let label = BSLabel()
|
|
|
|
- label.font = .systemFont(ofSize: 12, weight: .regular)
|
|
|
|
- label.numberOfLines = 0
|
|
|
|
- label.preferredMaxLayoutWidth = SCREEN_WIDTH - 89 - 17
|
|
|
|
- label.textVerticalAlignment = .top
|
|
|
|
- label.textColor = _color("#343434񓶊")
|
|
|
|
- return label
|
|
|
|
|
|
+ let v = BSLabel()
|
|
|
|
+ v.numberOfLines = 0
|
|
|
|
+ v.preferredMaxLayoutWidth = SCREEN_WIDTH - 95 - 17
|
|
|
|
+ v.textVerticalAlignment = .top
|
|
|
|
+ v.font = .pf_12_regular
|
|
|
|
+ v.textColor = Color(0x343434)
|
|
|
|
+ return v
|
|
}()
|
|
}()
|
|
|
|
|
|
lazy var stackView: UIStackView = {
|
|
lazy var stackView: UIStackView = {
|
|
@@ -137,6 +137,7 @@ class MDPCompanyCell: BaseTableViewCell {
|
|
|
|
|
|
override func awakeFromNib() {
|
|
override func awakeFromNib() {
|
|
super.awakeFromNib()
|
|
super.awakeFromNib()
|
|
|
|
+
|
|
backgroundColor = ALLBackGroundColor
|
|
backgroundColor = ALLBackGroundColor
|
|
contentView.addSubview(containerView)
|
|
contentView.addSubview(containerView)
|
|
containerView.snp.makeConstraints { make in
|
|
containerView.snp.makeConstraints { make in
|
|
@@ -146,7 +147,7 @@ class MDPCompanyCell: BaseTableViewCell {
|
|
containerView.addSubview(titleLab)
|
|
containerView.addSubview(titleLab)
|
|
titleLab.snp.makeConstraints { make in
|
|
titleLab.snp.makeConstraints { make in
|
|
make.left.equalToSuperview().offset(18)
|
|
make.left.equalToSuperview().offset(18)
|
|
- make.top.equalToSuperview().offset(14)
|
|
|
|
|
|
+ make.top.equalToSuperview()
|
|
}
|
|
}
|
|
|
|
|
|
containerView.addSubview(stackView)
|
|
containerView.addSubview(stackView)
|
|
@@ -184,8 +185,8 @@ class MDPCompanyCell: BaseTableViewCell {
|
|
make.left.equalToSuperview().offset(95)
|
|
make.left.equalToSuperview().offset(95)
|
|
make.top.equalTo(companypProfileTitle.snp.top)
|
|
make.top.equalTo(companypProfileTitle.snp.top)
|
|
make.right.equalToSuperview().offset(-17)
|
|
make.right.equalToSuperview().offset(-17)
|
|
- make.height.lessThanOrEqualTo(108)
|
|
|
|
- make.bottom.equalToSuperview().offset(-19)
|
|
|
|
|
|
+ make.height.lessThanOrEqualTo(95)
|
|
|
|
+ make.bottom.equalToSuperview().offset(-15)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -200,10 +201,10 @@ class MDPCompanyCell: BaseTableViewCell {
|
|
if string.count == 0 {
|
|
if string.count == 0 {
|
|
companypProfile.text = " "
|
|
companypProfile.text = " "
|
|
companypProfile.snp.remakeConstraints { make in
|
|
companypProfile.snp.remakeConstraints { make in
|
|
- make.left.equalToSuperview().offset(89)
|
|
|
|
|
|
+ make.left.equalToSuperview().offset(95)
|
|
make.top.equalTo(companypProfileTitle.snp.top)
|
|
make.top.equalTo(companypProfileTitle.snp.top)
|
|
make.right.equalToSuperview().offset(-17)
|
|
make.right.equalToSuperview().offset(-17)
|
|
- make.bottom.equalToSuperview().offset(-19)
|
|
|
|
|
|
+ make.bottom.equalToSuperview().offset(-15)
|
|
}
|
|
}
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -241,17 +242,16 @@ class MDPCompanyCell: BaseTableViewCell {
|
|
let temoToken = NSAttributedString.bs_attachmentString(with: expandLabel, contentMode: .center, attachmentSize: expandLabel.frame.size, alignTo: expandLabel.font, alignment: .center)
|
|
let temoToken = NSAttributedString.bs_attachmentString(with: expandLabel, contentMode: .center, attachmentSize: expandLabel.frame.size, alignTo: expandLabel.font, alignment: .center)
|
|
|
|
|
|
let image = UIImage(named: "zhankai")
|
|
let image = UIImage(named: "zhankai")
|
|
- if let attachment = NSMutableAttributedString.bs_attachmentString(with: image, contentMode: .center, attachmentSize: image?.size ?? .zero, alignTo: expandLabel.font, alignment: .center) {
|
|
|
|
- temoToken?.append(attachment)
|
|
|
|
- }
|
|
|
|
|
|
+ let attachment = NSMutableAttributedString.bs_attachmentString(with: image, contentMode: .center, width: 8, ascent: 9, descent: 0)
|
|
|
|
+ temoToken?.append(attachment)
|
|
temoToken?.bs_lineSpacing = 5
|
|
temoToken?.bs_lineSpacing = 5
|
|
companypProfile.truncationToken = temoToken
|
|
companypProfile.truncationToken = temoToken
|
|
companypProfile.snp.remakeConstraints { make in
|
|
companypProfile.snp.remakeConstraints { make in
|
|
- make.left.equalToSuperview().offset(89)
|
|
|
|
|
|
+ make.left.equalToSuperview().offset(95)
|
|
make.top.equalTo(companypProfileTitle.snp.top)
|
|
make.top.equalTo(companypProfileTitle.snp.top)
|
|
make.right.equalToSuperview().offset(-17)
|
|
make.right.equalToSuperview().offset(-17)
|
|
- make.height.lessThanOrEqualTo(108)
|
|
|
|
- make.bottom.equalToSuperview().offset(-19)
|
|
|
|
|
|
+ make.height.lessThanOrEqualTo(95)
|
|
|
|
+ make.bottom.equalToSuperview().offset(-15)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -260,16 +260,16 @@ class MDPCompanyCell: BaseTableViewCell {
|
|
if string.count == 0 {
|
|
if string.count == 0 {
|
|
companypProfile.text = " "
|
|
companypProfile.text = " "
|
|
companypProfile.snp.remakeConstraints { make in
|
|
companypProfile.snp.remakeConstraints { make in
|
|
- make.left.equalToSuperview().offset(89)
|
|
|
|
|
|
+ make.left.equalToSuperview().offset(95)
|
|
make.top.equalTo(companypProfileTitle.snp.top)
|
|
make.top.equalTo(companypProfileTitle.snp.top)
|
|
make.right.equalToSuperview().offset(-17)
|
|
make.right.equalToSuperview().offset(-17)
|
|
- make.bottom.equalToSuperview().offset(-19)
|
|
|
|
|
|
+ make.bottom.equalToSuperview().offset(-15)
|
|
}
|
|
}
|
|
return
|
|
return
|
|
}
|
|
}
|
|
companypProfile.text = string
|
|
companypProfile.text = string
|
|
|
|
|
|
- let collapseString = NSMutableAttributedString(string: " 收起")
|
|
|
|
|
|
+ let collapseString = NSMutableAttributedString(string: " 收起")
|
|
collapseString.bs_font = companypProfile.font
|
|
collapseString.bs_font = companypProfile.font
|
|
collapseString.bs_color = _color("#FF6F30&#FF6F30")
|
|
collapseString.bs_color = _color("#FF6F30&#FF6F30")
|
|
|
|
|
|
@@ -293,17 +293,17 @@ class MDPCompanyCell: BaseTableViewCell {
|
|
let attr = NSMutableAttributedString(string: string, attributes: attributs as [NSAttributedString.Key: Any])
|
|
let attr = NSMutableAttributedString(string: string, attributes: attributs as [NSAttributedString.Key: Any])
|
|
attr.append(collapseString)
|
|
attr.append(collapseString)
|
|
let image = UIImage(named: "shouqi")
|
|
let image = UIImage(named: "shouqi")
|
|
- if let attachment = NSMutableAttributedString.bs_attachmentString(with: image, contentMode: .center, attachmentSize: image?.size ?? .zero, alignTo: companypProfile.font, alignment: .center) {
|
|
|
|
- attr.append(attachment)
|
|
|
|
- }
|
|
|
|
|
|
+ let attachment = NSMutableAttributedString.bs_attachmentString(with: image, contentMode: .center, width: 8, ascent: 10, descent: 0)
|
|
|
|
+ attr.append(attachment)
|
|
|
|
+
|
|
attr.bs_lineSpacing = 5.0
|
|
attr.bs_lineSpacing = 5.0
|
|
companypProfile.attributedText = attr
|
|
companypProfile.attributedText = attr
|
|
companypProfile.sizeToFit()
|
|
companypProfile.sizeToFit()
|
|
companypProfile.snp.remakeConstraints { make in
|
|
companypProfile.snp.remakeConstraints { make in
|
|
- make.left.equalToSuperview().offset(89)
|
|
|
|
|
|
+ make.left.equalToSuperview().offset(95)
|
|
make.right.equalToSuperview().offset(-17)
|
|
make.right.equalToSuperview().offset(-17)
|
|
make.top.equalTo(self.companypProfileTitle.snp.top)
|
|
make.top.equalTo(self.companypProfileTitle.snp.top)
|
|
- make.bottom.equalToSuperview().offset(-19)
|
|
|
|
|
|
+ make.bottom.equalToSuperview().offset(-15)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -352,8 +352,8 @@ class MDPCompanyCell: BaseTableViewCell {
|
|
make.left.equalToSuperview().offset(95)
|
|
make.left.equalToSuperview().offset(95)
|
|
make.top.equalTo(companypProfileTitle.snp.top)
|
|
make.top.equalTo(companypProfileTitle.snp.top)
|
|
make.right.equalToSuperview().offset(-17)
|
|
make.right.equalToSuperview().offset(-17)
|
|
- make.height.lessThanOrEqualTo(108)
|
|
|
|
- make.bottom.equalToSuperview().offset(-19)
|
|
|
|
|
|
+ make.height.lessThanOrEqualTo(95)
|
|
|
|
+ make.bottom.equalToSuperview().offset(-15)
|
|
}
|
|
}
|
|
if !model.isExpand {
|
|
if !model.isExpand {
|
|
setCompanypProfile(model.comProfile)
|
|
setCompanypProfile(model.comProfile)
|
|
@@ -366,11 +366,11 @@ class MDPCompanyCell: BaseTableViewCell {
|
|
@discardableResult
|
|
@discardableResult
|
|
func structuralLayout(title: String, valueLabel: UILabel) -> UIView {
|
|
func structuralLayout(title: String, valueLabel: UILabel) -> UIView {
|
|
let conteView = UIView()
|
|
let conteView = UIView()
|
|
- let titleLabel = createLabel(text: switchLanguage(title), textColor: _color("#999BA1ϧBA1"), size: 12)
|
|
|
|
- titleLabel.setTextFont(.PFSR, 12)
|
|
|
|
|
|
+ let titleLabel = createLabel(text: switchLanguage(title), textColor: Color(0x999BA1), size: 12)
|
|
|
|
+ titleLabel.font = .pf_12_regular
|
|
titleLabel.numberOfLines = 2
|
|
titleLabel.numberOfLines = 2
|
|
titleLabel.textAlignment = .left
|
|
titleLabel.textAlignment = .left
|
|
- titleLabel.textAlignmentLeftAndRightWith(font: UIFont.getTextFont(.PFSR, 12), labelWidth: 48)
|
|
|
|
|
|
+ titleLabel.textAlignmentLeftAndRightWith(font: UIFont.pf_12_regular!, labelWidth: 48)
|
|
conteView.addSubview(titleLabel)
|
|
conteView.addSubview(titleLabel)
|
|
titleLabel.snp.makeConstraints { make in
|
|
titleLabel.snp.makeConstraints { make in
|
|
make.left.equalTo(conteView.snp.left).offset(18)
|
|
make.left.equalTo(conteView.snp.left).offset(18)
|
|
@@ -381,7 +381,8 @@ class MDPCompanyCell: BaseTableViewCell {
|
|
conteView.addSubview(valueLabel)
|
|
conteView.addSubview(valueLabel)
|
|
valueLabel.snp.makeConstraints { make in
|
|
valueLabel.snp.makeConstraints { make in
|
|
make.left.equalToSuperview().offset(95)
|
|
make.left.equalToSuperview().offset(95)
|
|
- make.height.equalTo(12)
|
|
|
|
|
|
+ make.right.equalTo(-17)
|
|
|
|
+ make.height.equalTo(20)
|
|
make.top.equalTo(titleLabel)
|
|
make.top.equalTo(titleLabel)
|
|
make.bottom.equalToSuperview()
|
|
make.bottom.equalToSuperview()
|
|
}
|
|
}
|