Forráskód Böngészése

优化简况页面

Vincent Hu 2 hete
szülő
commit
6696691582

+ 1 - 1
Koala/Koala/Modular/JDAssets/V/JDAFiatAccountBalanceCell.swift

@@ -74,7 +74,7 @@ class JDAFiatAccountBalanceCell: BaseTableViewCell {
         bgView.addSubview(nameLb)
         nameLb.snp.makeConstraints { make in
             make.centerY.equalTo(accountIcon)
-            make.left.equalToSuperview().offset(59)
+            make.left.equalTo(accountIcon.snp.right).offset(5)
             make.right.equalToSuperview().offset(-18)
         }
         

+ 67 - 66
Koala/Koala/Modular/Market/V/MarketDetailView/MDProfileView/MDPCompanyCell.swift

@@ -11,78 +11,78 @@ import UIKit
 
 class MDPCompanyCell: BaseTableViewCell {
     lazy var titleLab: UILabel = {
-        let label = UILabel()
-        label.font = .systemFont(ofSize: 16, weight: .semibold)
-        label.textColor = _color("#333333&#333333")
-        return label
+        let v = UILabel()
+        v.font = .pf_16_semibold
+        v.textColor = Color(0x333333)
+        return v
     }()
 
     /// 公司名称
     lazy var companyName: UILabel = {
-        let label = UILabel()
-        label.font = .systemFont(ofSize: 12, weight: .regular)
-        label.textColor = _color("#343434&#343434")
-        return label
+        let v = UILabel()
+        v.font = .pf_12_regular
+        v.textColor = Color(0x343434)
+        return v
     }()
 
     /// 证劵代码
     lazy var securityCode: UILabel = {
-        let label = UILabel()
-        label.font = .systemFont(ofSize: 12, weight: .regular)
-        label.textColor = _color("#343434&#343434")
-        return label
+        let v = UILabel()
+        v.font = .pf_12_regular
+        v.textColor = Color(0x343434)
+        return v
     }()
 
     /// 上市场所
     lazy var listingPlace: UILabel = {
-        let label = UILabel()
-        label.font = .systemFont(ofSize: 12, weight: .regular)
-        label.textColor = _color("#343434&#343434")
-        return label
+        let v = UILabel()
+        v.font = .pf_12_regular
+        v.textColor = Color(0x343434)
+        return v
     }()
 
     /// 上市日期
     lazy var listingDate: UILabel = {
-        let label = UILabel()
-        label.font = .systemFont(ofSize: 12, weight: .regular)
-        label.textColor = _color("#343434&#343434")
-        return label
+        let v = UILabel()
+        v.font = .pf_12_regular
+        v.textColor = Color(0x343434)
+        return v
     }()
 
     /// 所在地
     lazy var locationLabel: UILabel = {
-        let label = UILabel()
-        label.font = .systemFont(ofSize: 12, weight: .regular)
-        label.textColor = _color("#343434&#343434")
-        return label
+        let v = UILabel()
+        v.font = .pf_12_regular
+        v.textColor = Color(0x343434)
+        return v
     }()
 
     /// 董事长
     lazy var chairmanLabel: UILabel = {
-        let label = UILabel()
-        label.font = .systemFont(ofSize: 12, weight: .regular)
-        label.textColor = _color("#343434&#343434")
-        return label
+        let v = UILabel()
+        v.font = .pf_12_regular
+        v.textColor = Color(0x343434)
+        return v
     }()
 
     lazy var companypProfileTitle: UILabel = {
-        let label = UILabel()
-        label.numberOfLines = 2
-        label.text = switchLanguage("公司简介")
-        label.font = .systemFont(ofSize: 12, weight: .regular)
-        label.textColor = _color("#999BA1&#999BA1")
-        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 = {
-        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&#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 = {
@@ -137,6 +137,7 @@ class MDPCompanyCell: BaseTableViewCell {
 
     override func awakeFromNib() {
         super.awakeFromNib()
+        
         backgroundColor = ALLBackGroundColor
         contentView.addSubview(containerView)
         containerView.snp.makeConstraints { make in
@@ -146,7 +147,7 @@ class MDPCompanyCell: BaseTableViewCell {
         containerView.addSubview(titleLab)
         titleLab.snp.makeConstraints { make in
             make.left.equalToSuperview().offset(18)
-            make.top.equalToSuperview().offset(14)
+            make.top.equalToSuperview()
         }
         
         containerView.addSubview(stackView)
@@ -184,8 +185,8 @@ class MDPCompanyCell: BaseTableViewCell {
             make.left.equalToSuperview().offset(95)
             make.top.equalTo(companypProfileTitle.snp.top)
             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 {
             companypProfile.text = " "
             companypProfile.snp.remakeConstraints { make in
-                make.left.equalToSuperview().offset(89)
+                make.left.equalToSuperview().offset(95)
                 make.top.equalTo(companypProfileTitle.snp.top)
                 make.right.equalToSuperview().offset(-17)
-                make.bottom.equalToSuperview().offset(-19)
+                make.bottom.equalToSuperview().offset(-15)
             }
             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 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
         companypProfile.truncationToken = temoToken
         companypProfile.snp.remakeConstraints { make in
-            make.left.equalToSuperview().offset(89)
+            make.left.equalToSuperview().offset(95)
             make.top.equalTo(companypProfileTitle.snp.top)
             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 {
             companypProfile.text = " "
             companypProfile.snp.remakeConstraints { make in
-                make.left.equalToSuperview().offset(89)
+                make.left.equalToSuperview().offset(95)
                 make.top.equalTo(companypProfileTitle.snp.top)
                 make.right.equalToSuperview().offset(-17)
-                make.bottom.equalToSuperview().offset(-19)
+                make.bottom.equalToSuperview().offset(-15)
             }
             return
         }
         companypProfile.text = string
         
-        let collapseString = NSMutableAttributedString(string: "    收起")
+        let collapseString = NSMutableAttributedString(string: "  收起")
         collapseString.bs_font = companypProfile.font
         collapseString.bs_color = _color("#FF6F30&#FF6F30")
         
@@ -293,17 +293,17 @@ class MDPCompanyCell: BaseTableViewCell {
         let attr = NSMutableAttributedString(string: string, attributes: attributs as [NSAttributedString.Key: Any])
         attr.append(collapseString)
         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
         companypProfile.attributedText = attr
         companypProfile.sizeToFit()
         companypProfile.snp.remakeConstraints { make in
-            make.left.equalToSuperview().offset(89)
+            make.left.equalToSuperview().offset(95)
             make.right.equalToSuperview().offset(-17)
             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.top.equalTo(companypProfileTitle.snp.top)
                 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 {
                 setCompanypProfile(model.comProfile)
@@ -366,11 +366,11 @@ class MDPCompanyCell: BaseTableViewCell {
     @discardableResult
     func structuralLayout(title: String, valueLabel: UILabel) -> UIView {
         let conteView = UIView()
-        let titleLabel = createLabel(text: switchLanguage(title), textColor: _color("#999BA1&#999BA1"), 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.textAlignment = .left
-        titleLabel.textAlignmentLeftAndRightWith(font: UIFont.getTextFont(.PFSR, 12), labelWidth: 48)
+        titleLabel.textAlignmentLeftAndRightWith(font: UIFont.pf_12_regular!, labelWidth: 48)
         conteView.addSubview(titleLabel)
         titleLabel.snp.makeConstraints { make in
             make.left.equalTo(conteView.snp.left).offset(18)
@@ -381,7 +381,8 @@ class MDPCompanyCell: BaseTableViewCell {
         conteView.addSubview(valueLabel)
         valueLabel.snp.makeConstraints { make in
             make.left.equalToSuperview().offset(95)
-            make.height.equalTo(12)
+            make.right.equalTo(-17)
+            make.height.equalTo(20)
             make.top.equalTo(titleLabel)
             make.bottom.equalToSuperview()
         }

+ 2 - 2
Koala/Koala/Modular/Market/V/MarketDetailView/MDProfileView/MDPCompanyCell.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina6_12" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>

+ 4 - 4
Koala/Koala/Modular/Market/V/MarketDetailView/MDProfileView/MDPIndustryCell.swift

@@ -17,11 +17,11 @@ class MDPIndustryCell: BaseTableViewCell {
         self.backgroundColor = ALLBackGroundColor
         
         self.titleLab.text = forceSwitchingEnglish("所属行业")
-        self.titleLab.textColor = _color("#333333&#333333")
-        self.titleLab.setTextFont(.PFSM, 16)
+        self.titleLab.textColor = Color(0x333333)
+        self.titleLab.font = .pf_16_semibold
         
-        self.valueLab.textColor = _color("#090909&#090909")
-        self.valueLab.setTextFont(.PFSR, 13)
+        self.valueLab.textColor = Color(0x343434)
+        self.valueLab.font = .pf_12_regular
         self.valueLab.text = ""
     }
 

+ 6 - 6
Koala/Koala/Modular/Market/V/MarketDetailView/MDProfileView/MDPIndustryCell.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina6_12" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -18,22 +18,22 @@
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="B4i-IM-WwH">
-                        <rect key="frame" x="15" y="0.0" width="42" height="69"/>
+                        <rect key="frame" x="18" y="0.0" width="42" height="69"/>
                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
                         <nil key="textColor"/>
                         <nil key="highlightedColor"/>
                     </label>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="k27-yj-p7c">
-                        <rect key="frame" x="341" y="24" width="42" height="21"/>
+                        <rect key="frame" x="339" y="24" width="42" height="21"/>
                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
                         <nil key="textColor"/>
                         <nil key="highlightedColor"/>
                     </label>
                 </subviews>
                 <constraints>
-                    <constraint firstAttribute="trailing" secondItem="k27-yj-p7c" secondAttribute="trailing" constant="15" id="6Ih-Tv-Lja"/>
+                    <constraint firstAttribute="trailing" secondItem="k27-yj-p7c" secondAttribute="trailing" constant="17" id="6Ih-Tv-Lja"/>
                     <constraint firstItem="k27-yj-p7c" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="DiX-fb-ELd"/>
-                    <constraint firstItem="B4i-IM-WwH" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="FpM-2Q-gpy"/>
+                    <constraint firstItem="B4i-IM-WwH" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="18" id="FpM-2Q-gpy"/>
                     <constraint firstAttribute="bottom" secondItem="B4i-IM-WwH" secondAttribute="bottom" id="YxN-Q5-B1t"/>
                     <constraint firstItem="B4i-IM-WwH" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="g7V-4d-f0V"/>
                 </constraints>

+ 1 - 3
Koala/Koala/Modular/Market/V/MarketDetailView/MDProfileView/MDProfileView.swift

@@ -14,9 +14,7 @@ class MDProfileView: BaseView {
     var cells: [String] = []
     lazy var tableView: BaseTableView = { [weak self] in
         let tableView = BaseTableView(frame: .zero, style: .grouped)
-        tableView.separatorStyle = .singleLine
-        tableView.separatorColor = ViewBorderColor
-        tableView.separatorInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
+        tableView.separatorStyle = .none
         tableView.delegate = self
         tableView.dataSource = self
         tableView.backgroundColor = .clear

+ 46 - 43
Koala/Koala/Modular/Market/V/MarketDetailView/MDProfileView/MainBusinessCompCell.swift

@@ -11,11 +11,11 @@ import UIKit
 
 class MainBusinessCompCell: UITableViewCell {
     lazy var titleLabel: UILabel = {
-        let label = UILabel()
-        label.text = forceSwitchingEnglish("主营构成")
-        label.textColor = _color("#333333&#333333")
-        label.font = .systemFont(ofSize: 16, weight: .semibold)
-        return label
+        let v = UILabel()
+        v.text = forceSwitchingEnglish("主营构成")
+        v.textColor = Color(0x333333)
+        v.font = .pf_16_semibold
+        return v
     }()
     
     // 环形统计图
@@ -49,19 +49,19 @@ class MainBusinessCompCell: UITableViewCell {
     ]
     
     lazy var currencyLabel: UILabel = {
-        let label = UILabel()
-        label.text = "币种:USD"
-        label.font = .systemFont(ofSize: 12)
-        label.textColor = _color("#A7A7A7&#A7A7A7")
-        return label
+        let v = UILabel()
+        v.text = "币种:USD"
+        v.font = .pf_12_regular
+        v.textColor = Color(0x7C7C7C)
+        return v
     }()
     
     lazy var yearBtn: UIButton = {
-        let button = UIButton()
-        button.setTitle("年份", for: .normal)
-        button.setTitleColor(_color("#333333&#333333"), for: .normal)
-        button.titleLabel?.font = .systemFont(ofSize: 12)
-        return button
+        let v = UIButton()
+        v.setTitle("年份", for: .normal)
+        v.setTitleColor(Color(0x333333), for: .normal)
+        v.titleLabel?.font = .pf_12_regular
+        return v
     }()
     
     lazy var segmented: UISegmentedControl = {
@@ -69,7 +69,7 @@ class MainBusinessCompCell: UITableViewCell {
           items: [forceSwitchingEnglish("业务"),forceSwitchingEnglish("地区")])
         segmented.addTarget(self, action: #selector(segmentedChange), for: .valueChanged)
         segmented.selectedSegmentIndex = 0
-        segmented.setTitleTextAttributes([NSAttributedString.Key.font: UIFont.systemFont(ofSize: 14)], for: .normal)
+        segmented.setTitleTextAttributes([NSAttributedString.Key.font: UIFont.systemFont(ofSize: s(14))], for: .normal)
         // 2
         segmented.setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.white], for: UIControl.State.normal)
         // 3
@@ -85,17 +85,18 @@ class MainBusinessCompCell: UITableViewCell {
         let view = UIView()
         let title1 = UILabel()
         title1.text = "收入占比"
-        title1.textColor = _color("#7C7C7C&#7C7C7C")
-        title1.font = .systemFont(ofSize: 9)
+        title1.textColor = Color(0x7C7C7C)
+        title1.font = .pf_10_regular
         view.addSubview(title1)
         title1.snp.makeConstraints { make in
             make.right.equalToSuperview()
             make.top.bottom.equalToSuperview()
         }
+        
         let title2 = UILabel()
         title2.text = "营业收入"
-        title2.textColor = _color("#7C7C7C&#7C7C7C")
-        title2.font = .systemFont(ofSize: 9)
+        title2.textColor = Color(0x7C7C7C)
+        title2.font = .pf_10_regular
         view.addSubview(title2)
         title2.snp.makeConstraints { make in
             make.right.equalToSuperview().offset(-58)
@@ -140,7 +141,6 @@ class MainBusinessCompCell: UITableViewCell {
     override func setSelected(_ selected: Bool, animated: Bool) {
         super.setSelected(selected, animated: animated)
 
-        
     }
     
     func initWithUI() {
@@ -174,20 +174,21 @@ class MainBusinessCompCell: UITableViewCell {
             make.top.equalTo(segmented.snp.bottom).offset(36)
             make.height.equalTo(10)
         }
+        
+        contentView.addSubview(chartView)
+        chartView.snp.makeConstraints { make in
+            make.left.equalToSuperview().offset(18)
+            make.top.equalToSuperview().offset(125)
+            make.width.height.equalTo(110)
+        }
+        
         contentView.addSubview(stackView)
         stackView.snp.makeConstraints { make in
             make.top.equalTo(desValueTitle.snp.bottom).offset(12)
             make.right.equalToSuperview().offset(-17)
-            make.left.equalToSuperview().offset(117)
+            make.left.equalToSuperview().offset(135)
             make.bottom.equalToSuperview().offset(-20)
         }
-        
-        contentView.addSubview(chartView)
-        chartView.snp.makeConstraints { make in
-            make.left.equalToSuperview().offset(18)
-            make.top.equalToSuperview().offset(141)
-            make.width.height.equalTo(80)
-        }
     }
     
     @objc func segmentedChange() {
@@ -271,27 +272,29 @@ class MainBusinessCompCell: UITableViewCell {
             if dataArray.count > 3 {
                 chartView.snp.remakeConstraints { make in
                     make.left.equalToSuperview().offset(18)
-                    make.top.equalToSuperview().offset(141)
-                    make.width.height.equalTo(80)
+                    make.top.equalToSuperview().offset(125)
+                    make.width.height.equalTo(110)
                 }
+                
                 stackView.snp.remakeConstraints { make in
                     make.top.equalTo(desValueTitle.snp.bottom).offset(12)
                     make.right.equalToSuperview().offset(-17)
-                    make.left.equalToSuperview().offset(117)
+                    make.left.equalToSuperview().offset(135)
                     make.bottom.equalToSuperview().offset(-20)
                 }
-                
             } else {
                 chartView.snp.remakeConstraints { make in
                     make.left.equalToSuperview().offset(18)
-                    make.top.equalToSuperview().offset(141)
-                    make.width.height.equalTo(80)
+                    make.top.equalToSuperview().offset(125)
+                    make.width.height.equalTo(110)
                     make.bottom.equalToSuperview().offset(-20)
                 }
+                
                 stackView.snp.makeConstraints { make in
                     make.top.equalTo(desValueTitle.snp.bottom).offset(12)
                     make.right.equalToSuperview().offset(-17)
-                    make.left.equalToSuperview().offset(117)
+                    make.left.equalToSuperview().offset(135)
+                    make.bottom.equalToSuperview().offset(-20)
                 }
             }
         }
@@ -360,23 +363,23 @@ class PieChartDesView: UIView {
     /// 占比
     lazy var proportionLabel: UILabel = {
         let label = UILabel()
-        label.font = .systemFont(ofSize: 9)
-        label.textColor = _color("#313131&#313131")
+        label.font = .pf_10_regular
+        label.textColor = Color(0x313131)
         return label
     }()
 
     /// 营业收入
     lazy var businessIncome: UILabel = {
         let label = UILabel()
-        label.font = .systemFont(ofSize: 9)
-        label.textColor = _color("#313131&#313131")
+        label.font = .pf_10_regular
+        label.textColor = Color(0x313131)
         return label
     }()
     
     lazy var titleLabel: UILabel = {
         let label = UILabel()
-        label.font = .systemFont(ofSize: 9)
-        label.textColor = _color("#313131&#313131")
+        label.font = .pf_10_regular
+        label.textColor = Color(0x313131)
         return label
     }()
     
@@ -422,7 +425,7 @@ class PieChartDesView: UIView {
         titleLabel.snp.makeConstraints { make in
             make.left.equalToSuperview().offset(14)
             make.top.bottom.equalToSuperview()
-            make.width.lessThanOrEqualTo(96)
+            make.width.lessThanOrEqualTo(110)
         }
     }
 }

+ 43 - 40
Koala/Koala/Modular/Market/V/MarketDetailView/MDProfileView/ShareholdingCell.swift

@@ -15,25 +15,26 @@ class ShareholdingChartDataEntry: PieChartDataEntry {
 
 class ShareholdingCell: UITableViewCell {
     lazy var titleLabel: UILabel = {
-        let label = UILabel()
-        label.text = forceSwitchingEnglish("持股统计")
-        label.textColor = _color("#333333&#333333")
-        label.font = .systemFont(ofSize: 16, weight: .semibold)
-        return label
+        let v = UILabel()
+        v.text = forceSwitchingEnglish("持股统计")
+        v.textColor = Color(0x333333)
+        v.font = .pf_16_semibold
+        return v
     }()
     
     lazy var detLabel: UILabel = {
-        let label = UILabel()
-        label.text = " " + forceSwitchingEnglish("主要股东") + " "
-        label.textAlignment = .center
-        label.textColor = _color("#333333&#333333")
-        label.font = .systemFont(ofSize: 14, weight: .semibold)
-        label.layer.cornerRadius = 4
-        label.layer.borderWidth = 1
-        label.layer.borderColor = UIColor.black.cgColor
-        label.layer.masksToBounds = true
-        return label
+        let v = UILabel()
+        v.text = "  " + forceSwitchingEnglish("主要股东") + "  "
+        v.textAlignment = .left
+        v.textColor = Color(0x333333)
+        v.font = .pf_14_regular
+        v.layer.cornerRadius = 4
+        v.layer.borderWidth = 1
+        v.layer.borderColor = v.textColor.cgColor
+        v.layer.masksToBounds = true
+        return v
     }()
+    
     // 环形统计图
     lazy var chartView: PieChartView = {
         let chartView = PieChartView()
@@ -77,8 +78,8 @@ class ShareholdingCell: UITableViewCell {
         let view = UIView()
         let title1 = UILabel()
         title1.text = "机构名称"
-        title1.textColor = _color("#7C7C7C&#7C7C7C")
-        title1.font = .systemFont(ofSize: 9)
+        title1.textColor = Color(0x7C7C7C)
+        title1.font = .pf_10_regular
         view.addSubview(title1)
         title1.snp.makeConstraints { make in
             make.left.equalToSuperview().offset(26)
@@ -86,8 +87,8 @@ class ShareholdingCell: UITableViewCell {
         }
         let title2 = UILabel()
         title2.text = "持股比例"
-        title2.textColor = _color("#7C7C7C&#7C7C7C")
-        title2.font = .systemFont(ofSize: 9)
+        title2.textColor = Color(0x7C7C7C)
+        title2.font = .pf_10_regular
         view.addSubview(title2)
         title2.snp.makeConstraints { make in
             make.right.equalToSuperview().offset(-17)
@@ -137,7 +138,7 @@ class ShareholdingCell: UITableViewCell {
         contentView.addSubview(detLabel)
         detLabel.snp.makeConstraints { make in
             make.left.equalToSuperview().offset(18)
-            make.top.equalTo(titleLabel.snp.bottom).offset(21)
+            make.top.equalTo(titleLabel.snp.bottom).offset(15)
 //            make.width.equalTo(71)
             make.height.equalTo(26)
         }
@@ -146,14 +147,14 @@ class ShareholdingCell: UITableViewCell {
         chartView.snp.makeConstraints { make in
             make.centerX.equalToSuperview()
             make.top.equalToSuperview().offset(86)
-            make.width.height.equalTo(130)
+            make.width.height.equalTo(150)
         }
         
         contentView.addSubview(self.desValueTitle)
         desValueTitle.snp.makeConstraints { make in
             make.left.equalToSuperview().offset(17)
             make.right.equalToSuperview().offset(-17)
-            make.top.equalTo(detLabel.snp.bottom).offset(157)
+            make.top.equalTo(detLabel.snp.bottom).offset(150)
             make.height.equalTo(24)
         }
         
@@ -165,7 +166,6 @@ class ShareholdingCell: UITableViewCell {
             make.bottom.equalToSuperview().offset(-45)
         }
         
-        
         maskButton.snp.makeConstraints { make in
             make.left.right.top.equalToSuperview()
             make.bottom.equalTo(desValueTitle.snp.top)
@@ -210,7 +210,7 @@ class ShareholdingCell: UITableViewCell {
         pFormatter.multiplier = 1
         data.setValueFormatter(DefaultValueFormatter(formatter: pFormatter))
         data.setDrawValues(false)
-        data.setValueFont(.systemFont(ofSize: 11, weight: .light))
+        data.setValueFont(.systemFont(ofSize: s(11), weight: .light))
         chartView.data = data
         
         stackView.removeFromSuperview()
@@ -266,13 +266,15 @@ class ShareholdingCell: UITableViewCell {
         let blue = CGFloat.random(in: 0...1)
         return UIColor(red: red, green: green, blue: blue, alpha: 1.0)
     }
+    
     func selectInfoView(_ sel: ShareholdingDesView) {
         if self.selectView != sel {
             self.selectView?.backgroundColor = .white
-            sel.backgroundColor = _color("#EAECF0&#EAECF0")
+            sel.backgroundColor = Color(0xEEF0F3)
             self.selectView = sel
         }
     }
+    
     @objc func maskClick() {
         showView.isHidden = true
         selectView?.backgroundColor = .white
@@ -299,8 +301,9 @@ extension ShareholdingCell: ChartViewDelegate {
         showView.valueLabel.text = precisionString(with: value, precision: "2", isRound: true)+"%"
         contentView.addSubview(showView)
         showView.snp.makeConstraints { make in
-            make.left.equalToSuperview().offset(27)
+            make.left.equalToSuperview().offset(18)
             make.top.equalTo(detLabel.snp.bottom).offset(10)
+            make.width.greaterThanOrEqualTo(60)
             make.width.lessThanOrEqualTo(200)
         }
     }
@@ -310,15 +313,15 @@ class ShareholdingDesView: UIView {
     /// 占比
     lazy var proportionLabel: UILabel = {
         let label = UILabel()
-        label.font = .systemFont(ofSize: 9)
-        label.textColor = _color("#313131&#313131")
+        label.font = .pf_10_regular
+        label.textColor = Color(0x313131)
         return label
     }()
     
     lazy var titleLabel: UILabel = {
         let label = UILabel()
-        label.font = .systemFont(ofSize: 9)
-        label.textColor = _color("#313131&#313131")
+        label.font = .pf_10_regular
+        label.textColor = Color(0x313131)
         return label
     }()
     
@@ -351,7 +354,6 @@ class ShareholdingDesView: UIView {
             make.top.bottom.equalToSuperview()
         }
         
-        
         tagColor.snp.makeConstraints { make in
             make.centerY.equalToSuperview()
             make.left.equalToSuperview().offset(13)
@@ -360,9 +362,10 @@ class ShareholdingDesView: UIView {
         
         titleLabel.snp.makeConstraints { make in
             make.left.equalToSuperview().offset(26)
+            make.right.lessThanOrEqualTo(proportionLabel.snp.left).offset(-10)
             make.top.bottom.equalToSuperview()
-            make.width.lessThanOrEqualTo(96)
         }
+        
         button.snp.makeConstraints { make in
             make.edges.equalToSuperview()
         }
@@ -373,31 +376,31 @@ class ShareholdingDesView: UIView {
     }
 }
 
-
 class ShareholdingInfoShow: UIView {
     lazy var titleLabel: UILabel = {
         let label = UILabel()
         label.numberOfLines = 0
-        label.font = .systemFont(ofSize: 10)
-        label.textColor = _color("#313131&#313131")
+        label.font = .pf_10_regular
+        label.textColor = Color(0x313131)
         return label
     }()
     
     lazy var valueLabel: UILabel = {
         let label = UILabel()
-        label.font = .systemFont(ofSize: 10)
-        label.textColor = _color("#313131&#313131")
+        label.font = .pf_10_regular
+        label.textColor = Color(0x313131)
         return label
     }()
+    
     override init(frame: CGRect) {
         super.init(frame: frame)
+        
         initWithUI()
+        
         self.backgroundColor = .white
         self.layer.cornerRadius = 5
         self.layer.borderWidth = 1
-        self.layer.borderColor = _color("#3E80FF&#3E80FF").cgColor
-        self.layer.shadowColor = UIColor.black.withAlphaComponent(0.3).cgColor
-        self.layer.shadowRadius = 5
+        self.layer.borderColor = Color(0x3E80FF).cgColor
     }
     
     required init?(coder: NSCoder) {

+ 51 - 46
Koala/Koala/Modular/Market/V/MarketDetailView/MDProfileView/SubjectMatterConceptCell.swift

@@ -17,34 +17,34 @@ class SubjectMatterConceptCell: UITableViewCell {
     }()
 
     lazy var titleLabel: UILabel = {
-        let label = UILabel()
-        label.text = forceSwitchingEnglish("题材概念")
-        label.textColor = _color("#333333&#333333")
-        label.font = .systemFont(ofSize: 16, weight: .semibold)
-        return label
+        let v = UILabel()
+        v.text = forceSwitchingEnglish("题材概念")
+        v.textColor = Color(0x333333)
+        v.font = .pf_16_semibold
+        return v
     }()
 
     lazy var desTitleLabel: UILabel = {
-        let label = UILabel()
-        label.text = forceSwitchingEnglish("大数据(US)概念")
-        label.textColor = _color("#333333&#333333")
-        label.font = .systemFont(ofSize: 14, weight: .medium)
-        return label
+        let v = UILabel()
+        v.text = forceSwitchingEnglish("大数据(US)概念")
+        v.textColor = Color(0x333333)
+        v.font = .pf_14_medium
+        return v
     }()
 
     lazy var desContentLabel: UILabel = {
-        let label = UILabel()
-        label.text = "        NVIDIA 将 GPU 功能搬入数据中心中,重新定义了通用计算。思科、戴尔、富士通、日立、惠普以及IBM等厂商的服务器均采用NVIDIA GRID 技术来虚拟化企业 PC 以供移动劳动力使用,还利用该技术来加速前沿领域中的应用,例如大数据分析以及机器学习。"
-        label.numberOfLines = 0
-        label.textColor = _color("#343434&#343434")
-        label.font = .systemFont(ofSize: 12, weight: .regular)
-        return label
+        let v = UILabel()
+        v.text = "        NVIDIA 将 GPU 功能搬入数据中心中,重新定义了通用计算。思科、戴尔、富士通、日立、惠普以及IBM等厂商的服务器均采用NVIDIA GRID 技术来虚拟化企业 PC 以供移动劳动力使用,还利用该技术来加速前沿领域中的应用,例如大数据分析以及机器学习。"
+        v.numberOfLines = 0
+        v.textColor = Color(0x343434)
+        v.font = .pf_12_regular
+        return v
     }()
 
     lazy var tagContainer: TagListView = {
         let view = TagListView()
-        view.textFont = .systemFont(ofSize: 14)
-        view.textColor = _color("#999BA1&#999BA1")
+        view.textFont = .pf_14_regular ?? .systemFont(ofSize: s(14))
+        view.textColor = Color(0x999BA1)
         view.selectedTextColor = .white
         view.cornerRadius = 4
 //        view.paddingX = 12
@@ -53,10 +53,11 @@ class SubjectMatterConceptCell: UITableViewCell {
         view.marginY = 8
         view.tagBackgroundColor = .white
         view.selectedTextColor = .white
-        view.borderColor = _color("#E4E6EB&#E4E6EB")
+        view.borderColor = Color(0xE4E6EB)
+        view.selectedBorderColor = .black
         view.borderWidth = 1
         view.cornerRadius = 4
-        view.fixedWidth = (SCREEN_WIDTH - 18.0*2 - 8.0*2) / 3
+        view.fixedWidth = (SCREEN_WIDTH - 18.0 * 2 - 8.0 * 2) / 3
         view.tagHighlightedBackgroundColor = .black
         view.tagSelectedBackgroundColor = .black
         view.delegate = self
@@ -70,8 +71,8 @@ class SubjectMatterConceptCell: UITableViewCell {
     lazy var faucetTitleLabel: UILabel = {
         let label = UILabel()
         label.text = forceSwitchingEnglish("龙头股")
-        label.textColor = _color("#999BA1&#999BA1")
-        label.font = .systemFont(ofSize: 14, weight: .regular)
+        label.textColor = Color(0x999BA1)
+        label.font = .pf_14_regular
         return label
     }()
 
@@ -112,8 +113,8 @@ class SubjectMatterConceptCell: UITableViewCell {
     var showAllTag = false
     lazy var showAllTitleLabel: UILabel = {
         let label = UILabel()
-        label.font = .systemFont(ofSize: 12)
-        label.textColor = _color("#999BA1&#999BA1")
+        label.font = .pf_12_regular
+        label.textColor = Color(0x7C7C7C)
         label.text = forceSwitchingEnglish("余下全部")
         return label
     }()
@@ -246,17 +247,21 @@ class SubjectMatterConceptCell: UITableViewCell {
         } else {
             count = dataSource.count
         }
-        let sp = 8
-        var multiple = count / 3
-        let remainder = count % 3
-        if remainder > 0 {
-            multiple += 1
-        }
-        let height = (multiple - 1)*sp + multiple*36
+        
+        let rows = calculateNumberOfRows(totalItems: count, itemsPerRow: 3)
+        
+        let height = (rows - 1) * 8 + rows * 38
         tagContainer.snp.updateConstraints { make in
             make.height.equalTo(height)
         }
     }
+    
+    func calculateNumberOfRows(totalItems: Int, itemsPerRow: Int) -> Int {
+        guard itemsPerRow > 0 else { return 0 }
+
+        let numberOfRows = Int(ceil(Double(totalItems) / Double(itemsPerRow)))
+        return numberOfRows
+    }
 
     @objc func allButtonClick() {
         updataUI()
@@ -380,27 +385,27 @@ extension SubjectMatterConceptCell: UICollectionViewDataSource, UICollectionView
 
 class FaucetCell: UICollectionViewCell {
     lazy var nameLabel: UILabel = {
-        let label = UILabel()
-        label.text = "英伟达"
-        label.textColor = .black
-        label.font = .systemFont(ofSize: 13, weight: .semibold)
-        return label
+        let v = UILabel()
+        v.text = "英伟达"
+        v.textColor = .black
+        v.font = .systemFont(ofSize: s(13), weight: .medium)
+        return v
     }()
 
     lazy var priceLabel: UILabel = {
-        let label = UILabel()
-        label.text = "785.38"
-        label.textColor = _color("#FF4B30&#FF4B30")
-        label.font = .systemFont(ofSize: 14, weight: .regular)
-        return label
+        let v = UILabel()
+        v.text = "785.38"
+        v.textColor = Color(0xF24A40)
+        v.font = .pf_12_regular
+        return v
     }()
 
     lazy var riseFallLabel: UILabel = {
-        let label = UILabel()
-        label.text = "16.4%"
-        label.textColor = _color("#FF4B30&#FF4B30")
-        label.font = .systemFont(ofSize: 14, weight: .regular)
-        return label
+        let v = UILabel()
+        v.text = "16.4%"
+        v.textColor = Color(0xF24A40)
+        v.font = .pf_12_regular
+        return v
     }()
 
     var stockData: KSymbolModel?