刘千军 11 månader sedan
förälder
incheckning
2a8085708b
47 ändrade filer med 2394 tillägg och 785 borttagningar
  1. 21 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDAnnouncementView/MDAnnouncementView.swift
  2. 24 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteInfoCell.swift
  3. 21 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteInfoCell.xib
  4. 24 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteKLinewCell.swift
  5. 21 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteKLinewCell.xib
  6. 15 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteView.swift
  7. 21 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDFinanceView/MDFinanceView.swift
  8. 21 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDNewsView/MDNewsView.swift
  9. 21 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDOptionsView/MDOptionsView.swift
  10. 21 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDProfileView/MDProfileView.swift
  11. 21 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MarketDetailNavView.swift
  12. 18 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MarketDetailNavView.xib
  13. 0 239
      Koala/Koala/Modular/Market/V/MarketListCell.swift
  14. 0 75
      Koala/Koala/Modular/Market/V/MarketNavView.swift
  15. 0 369
      Koala/Koala/Modular/Market/V/MarketView.swift
  16. 298 0
      Koala/Koala/Modular/Market/V/MarketView/MarketHeaderView.swift
  17. 276 0
      Koala/Koala/Modular/Market/V/MarketView/MarketHeaderView.xib
  18. 81 0
      Koala/Koala/Modular/Market/V/MarketView/MarketListCell.swift
  19. 94 0
      Koala/Koala/Modular/Market/V/MarketView/MarketListCell.xib
  20. 4 5
      Koala/Koala/Modular/Market/V/MarketView/MarketListHeaderView.swift
  21. 87 0
      Koala/Koala/Modular/Market/V/MarketView/MarketNavView.swift
  22. 99 0
      Koala/Koala/Modular/Market/V/MarketView/MarketOptionsListCell.swift
  23. 105 0
      Koala/Koala/Modular/Market/V/MarketView/MarketOptionsListCell.xib
  24. 0 0
      Koala/Koala/Modular/Market/V/MarketView/MarketPopView.swift
  25. 291 0
      Koala/Koala/Modular/Market/V/MarketView/MarketRecommendView.swift
  26. 147 0
      Koala/Koala/Modular/Market/V/MarketView/MarketRecommendView.xib
  27. 448 0
      Koala/Koala/Modular/Market/V/MarketView/MarketView.swift
  28. 30 0
      Koala/Koala/Modular/Market/VC/MarketDetailViewController.swift
  29. 13 0
      Koala/Koala/Modular/Market/VM/MDAnnouncementViewModel.swift
  30. 13 0
      Koala/Koala/Modular/Market/VM/MDAuoteViewModel.swift
  31. 13 0
      Koala/Koala/Modular/Market/VM/MDFinanceViewModel.swift
  32. 13 0
      Koala/Koala/Modular/Market/VM/MDNewsViewModel.swift
  33. 13 0
      Koala/Koala/Modular/Market/VM/MDOptionsViewModel.swift
  34. 13 0
      Koala/Koala/Modular/Market/VM/MDProfileViewModel.swift
  35. 0 97
      Koala/Koala/Modular/MarketDetail/V/MarketDetailNavView.swift
  36. 21 0
      Koala/Koala/Other/Assets.xcassets/Market/Market_W_Recommend_Hint.imageset/Contents.json
  37. BIN
      Koala/Koala/Other/Assets.xcassets/Market/Market_W_Recommend_Hint.imageset/no-data.png
  38. 21 0
      Koala/Koala/Other/Assets.xcassets/Market/Market_W_Screen.imageset/Contents.json
  39. BIN
      Koala/Koala/Other/Assets.xcassets/Market/Market_W_Screen.imageset/filter1.png
  40. 21 0
      Koala/Koala/Other/Assets.xcassets/Market/Market_W_Select.imageset/Contents.json
  41. BIN
      Koala/Koala/Other/Assets.xcassets/Market/Market_W_Select.imageset/check1.png
  42. 21 0
      Koala/Koala/Other/Assets.xcassets/Market/Market_W_unSelect.imageset/Contents.json
  43. BIN
      Koala/Koala/Other/Assets.xcassets/Market/Market_W_unSelect.imageset/check.png
  44. 23 0
      Koala/Koala/Other/Assets.xcassets/Market/Market_unCollection.imageset/Contents.json
  45. BIN
      Koala/Koala/Other/Assets.xcassets/Market/Market_unCollection.imageset/路径备份 4.png
  46. BIN
      Koala/Koala/Other/Assets.xcassets/Market/Market_unCollection.imageset/路径备份 4@2x.png
  47. BIN
      Koala/Koala/Other/Assets.xcassets/Market/Market_unCollection.imageset/路径备份 4@3x.png

+ 21 - 0
Koala/Koala/Modular/Market/V/MarketDetailView/MDAnnouncementView/MDAnnouncementView.swift

@@ -0,0 +1,21 @@
+//
+//  MDAnnouncementView.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/12.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MDAnnouncementView: BaseView {
+
+    /*
+    // Only override draw() if you perform custom drawing.
+    // An empty implementation adversely affects performance during animation.
+    override func draw(_ rect: CGRect) {
+        // Drawing code
+    }
+    */
+
+}

+ 24 - 0
Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteInfoCell.swift

@@ -0,0 +1,24 @@
+//
+//  MDAuoteInfoCell.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/12.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MDAuoteInfoCell: BaseTableViewCell {
+
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        // Initialization code
+    }
+
+    override func setSelected(_ selected: Bool, animated: Bool) {
+        super.setSelected(selected, animated: animated)
+
+        // Configure the view for the selected state
+    }
+    
+}

+ 21 - 0
Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteInfoCell.xib

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13142" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <dependencies>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="MDAuoteInfoCell" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
+                <rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
+                <autoresizingMask key="autoresizingMask"/>
+            </tableViewCellContentView>
+            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
+        </tableViewCell>
+    </objects>
+</document>

+ 24 - 0
Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteKLinewCell.swift

@@ -0,0 +1,24 @@
+//
+//  MDAuoteKLinewCell.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/12.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MDAuoteKLinewCell: BaseTableViewCell {
+
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        // Initialization code
+    }
+
+    override func setSelected(_ selected: Bool, animated: Bool) {
+        super.setSelected(selected, animated: animated)
+
+        // Configure the view for the selected state
+    }
+    
+}

+ 21 - 0
Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteKLinewCell.xib

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13142" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <dependencies>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="MDAuoteKLinewCell" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
+                <rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
+                <autoresizingMask key="autoresizingMask"/>
+            </tableViewCellContentView>
+            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
+        </tableViewCell>
+    </objects>
+</document>

+ 15 - 0
Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteView.swift

@@ -0,0 +1,15 @@
+//
+//  MDAuoteView.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/12.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MDAuoteView: BaseView {
+
+    
+
+}

+ 21 - 0
Koala/Koala/Modular/Market/V/MarketDetailView/MDFinanceView/MDFinanceView.swift

@@ -0,0 +1,21 @@
+//
+//  MDFinanceView.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/12.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MDFinanceView: BaseView {
+
+    /*
+    // Only override draw() if you perform custom drawing.
+    // An empty implementation adversely affects performance during animation.
+    override func draw(_ rect: CGRect) {
+        // Drawing code
+    }
+    */
+
+}

+ 21 - 0
Koala/Koala/Modular/Market/V/MarketDetailView/MDNewsView/MDNewsView.swift

@@ -0,0 +1,21 @@
+//
+//  MDNewsView.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/12.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MDNewsView: BaseView {
+
+    /*
+    // Only override draw() if you perform custom drawing.
+    // An empty implementation adversely affects performance during animation.
+    override func draw(_ rect: CGRect) {
+        // Drawing code
+    }
+    */
+
+}

+ 21 - 0
Koala/Koala/Modular/Market/V/MarketDetailView/MDOptionsView/MDOptionsView.swift

@@ -0,0 +1,21 @@
+//
+//  MDOptionsView.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/12.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MDOptionsView: BaseView {
+
+    /*
+    // Only override draw() if you perform custom drawing.
+    // An empty implementation adversely affects performance during animation.
+    override func draw(_ rect: CGRect) {
+        // Drawing code
+    }
+    */
+
+}

+ 21 - 0
Koala/Koala/Modular/Market/V/MarketDetailView/MDProfileView/MDProfileView.swift

@@ -0,0 +1,21 @@
+//
+//  MDProfileView.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/12.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MDProfileView: BaseView {
+
+    /*
+    // Only override draw() if you perform custom drawing.
+    // An empty implementation adversely affects performance during animation.
+    override func draw(_ rect: CGRect) {
+        // Drawing code
+    }
+    */
+
+}

+ 21 - 0
Koala/Koala/Modular/Market/V/MarketDetailView/MarketDetailNavView.swift

@@ -0,0 +1,21 @@
+//
+//  MarketDetailNavView.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/12.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MarketDetailNavView: BaseView {
+
+    /*
+    // Only override draw() if you perform custom drawing.
+    // An empty implementation adversely affects performance during animation.
+    override func draw(_ rect: CGRect) {
+        // Drawing code
+    }
+    */
+
+}

+ 18 - 0
Koala/Koala/Modular/Market/V/MarketDetailView/MarketDetailNavView.xib

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13142" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <dependencies>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="iN0-l3-epB">
+            <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+            <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
+        </view>
+    </objects>
+</document>

+ 0 - 239
Koala/Koala/Modular/Market/V/MarketListCell.swift

@@ -1,239 +0,0 @@
-//
-//  MarketCell.swift
-//  Koala
-//
-//  Created by mac on 2023/9/8.
-//  Copyright © 2023 刘千军. All rights reserved.
-//
-
-import Foundation
-import UIKit
-
-class MarketListCell: BaseTableViewCell {
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        
-        contentView.addSubview(collectionBtn)
-        collectionBtn.snp.makeConstraints { make in
-            make.centerY.equalTo(contentView)
-            make.left.equalTo(contentView.snp.left).offset(12)
-            make.size.equalTo(CGSize(width: 10, height: 10))
-        }
-        contentView.addSubview(nameLab)
-        
-        nameLab.snp.makeConstraints { make in
-            make.left.equalTo(collectionBtn.snp.right).offset(12)
-            make.top.equalTo(contentView.snp.top).offset(10)
-        }
-        
-        contentView.addSubview(hintLab)
-        hintLab.snp.makeConstraints { make in
-            make.left.equalTo(nameLab.snp.left)
-            make.bottom.equalTo(contentView.snp.bottom).offset(-7)
-        }
-        
-        contentView.addSubview(value1Lab)
-        value1Lab.snp.makeConstraints { make in
-            make.centerY.equalTo(contentView)
-            make.right.equalTo(contentView.snp.right).offset(-17)
-            make.size.equalTo(CGSize(width: 72, height: 23))
-        }
-        
-        contentView.addSubview(valueLab)
-        valueLab.snp.makeConstraints { make in
-            make.centerY.equalTo(value1Lab)
-            make.right.equalTo(value1Lab.snp.left).offset(-12)
-        }
-        contentView.addSubview(bottomLine)
-        bottomLine.snp.makeConstraints { make in
-            make.left.equalTo(nameLab.snp.left)
-            make.right.equalTo(value1Lab.snp.right)
-            make.bottom.equalTo(contentView.snp.bottom)
-            make.height.equalTo(1)
-        }
-        
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-//    @IBOutlet weak var leftConstraint: NSLayoutConstraint!
-//    @IBOutlet weak var collectionBtn: UIButton!
-//    @IBOutlet weak var currencyView: UIImageView!
-//    @IBOutlet weak var nameLab: UILabel!
-//    @IBOutlet weak var hintLab: UILabel!
-//    @IBOutlet weak var valueLab: UILabel!
-//    @IBOutlet weak var value1Lab: UILabel!
-    
-    lazy var currencyView : UIImageView = {
-        let v = UIImageView()
-        return v
-    }()
-    
-    lazy var collectionBtn : UIButton = {
-        
-        let v = UIButton(type: .custom)
-        v.setImage(_image("Market_W_unCollect&Market_W_unCollect"), for: .normal)
-        
-        v.addTarget(self, action: #selector(clickCollectionBtnAction), for: .touchUpInside)
-        
-        return v
-    }()
-    
-    lazy var nameLab: UILabel = {
-        
-        let v = UILabel()
-        v.textColor = UIColor.pg_color(withHexString: "333333")
-        v.font = .systemFont(ofSize: 16)
-        v.text = "苹果"
-        return v
-    }()
-    
-    lazy var hintLab: UILabel = {
-        
-        let v = UILabel()
-        v.textColor = UIColor.pg_color(withHexString: "959697")
-        v.font = .systemFont(ofSize: 12)
-        v.text = "AAPL"
-        return v
-    }()
-    
-    lazy var value1Lab : UILabel = {
-        
-        let v = UILabel()
-        v.textColor = UIColor.pg_color(withHexString: "FEFFFF")
-        v.font = .systemFont(ofSize: 14)
-        v.text = "+1.28%"
-        v.textAlignment = .center
-        v.backgroundColor = UIColor.pg_color(withHexString: "E86343")
-        v.layer.masksToBounds = true
-        v.layer.cornerRadius = 2
-        return v
-    }()
-    
-    lazy var valueLab : UILabel = {
-        
-        let v = UILabel()
-        v.textColor = UIColor.pg_color(withHexString: "E86343")
-        v.font = .systemFont(ofSize: 14)
-        v.text = "178.726"
-        v.textAlignment = .right
-        return v
-    }()
-    
-    lazy var bottomLine : UIView = {
-        let v = UIView()
-        v.backgroundColor = UIColor.pg_color(withHexString: "F2F2F2")
-        return v
-    }()
-    
-    
-    
-    var symbolModel:KSymbolModel?
-    var clickCollectionBlock: ((_ symbolModel: KSymbolModel) -> ())?
-    
-    override func awakeFromNib() {
-        super.awakeFromNib()
-        self.backgroundColor = .clear
-        self.contentView.backgroundColor = .clear
-        self.collectionBtn.isHidden = true
-        
-        self.currencyView.backgroundColor = InputBackGroundColor
-        self.currencyView.setViewLayerBorderColor(myColor: .clear, borderWidth: 0, maskBounds: 12)
-        self.currencyView.layer.masksToBounds = true
-        
-        self.nameLab.text = ""
-        self.hintLab.text = ""
-        self.valueLab.text = ""
-        self.value1Lab.text = ""
-        
-//        self.collectionBtn.addTarget(self, action: #selector(clickCollectionBtnAction), for: .touchUpInside)
-        
-    }
-    
-    override func setSelected(_ selected: Bool, animated: Bool) {
-        super.setSelected(selected, animated: animated)
-
-        // Configure the view for the selected state
-    }
-    
-   
-    @objc func clickCollectionBtnAction(){
-        self.clickCollectionBlock?(self.symbolModel!)
-    }
-}
-
-
-extension MarketListCell {
-    func updateHomeCellWith(model:KSymbolModel) -> Void {
-//        self.leftConstraint.constant = 15
-        self.nameLab.setTextFont(.PFSR, 14)
-        self.hintLab.setTextFont(.PFSR, 12)
-        self.valueLab.setTextFont(.PFSR, 16)
-        self.value1Lab.setTextFont(.PFSR, 12)
-        self.nameLab.textColor = TitleTextColor
-        self.hintLab.textColor = _color("#68727e&#68727e")
-        self.valueLab.textColor = TitleTextColor
-        
-        self.nameLab.text = model.symbol
-        self.hintLab.text = model.description
-
-        self.updateNewPrice(model: model)
-        
-        if let url = URL.init(string:fileLinkPackage(path:"png/"+model.symbol+".png")) {
-            self.currencyView.kf.setImage(with:url, placeholder: _image("Base_W_Default_Currency&Base_W_Default_Currency"))
-        }
-
-        
-        
-    }
-    
-    func updateNewPrice(model:KSymbolModel) -> Void {
-        self.valueLab.text = precisionString(with: model.newPrice, precision: model.digits)
-        self.value1Lab.text = precisionString(with: model.increase, precision: "2") + "%"
-//        self.value1Lab.textColor = exchangeColorAndImage(increase: conerData(model.increase as Any, .MyFloat).1!).0
-        
-        self.valueLab.textColor = exchangeColorAndImage(increase: conerData(model.increase as Any, .MyFloat).1!).0
-        self.value1Lab.backgroundColor = exchangeColorAndImage(increase: conerData(model.increase as Any, .MyFloat).1!).0
-    }
-    
-    func updateMarketCellWith(model:KSymbolModel) -> Void {
-        self.symbolModel = model
-//        self.leftConstraint.constant = 0
-        self.collectionBtn.isHidden = false
-        if model.isCollection{
-            self.collectionBtn .setImage(_image("Market_W_unCollect&Market_W_unCollect").imageWithTintColor(color: AllGreenColor), for: .normal)
-        }else{
-            self.collectionBtn .setImage(_image("Market_W_unCollect&Market_W_unCollect"), for: .normal)
-        }
-       
-        self.nameLab.setTextFont(.PFSR, 14)
-        self.hintLab.setTextFont(.PFSR, 12)
-        self.valueLab.setTextFont(.PFSR, 16)
-        self.value1Lab.setTextFont(.PFSR, 12)
-        self.nameLab.textColor = TitleTextColor
-        self.hintLab.textColor = _color("#68727e&#68727e")
-        self.valueLab.textColor = TitleTextColor
-       
-//        self.nameLab.text = model.symbol
-        
-        self.nameLab.text = model.title
-        
-//        self.hintLab.text = model.description
-        
-        self.hintLab.text = model.symbol
-
-        self.updateNewPrice(model: model)
-        
-        //www.ddse.io/png/AAPLm.png
-        
-        if let url = URL.init(string:fileLinkPackage(path:"png/"+model.symbol+".png")) {
-          
-            self.currencyView.kf.setImage(with:url, placeholder: _image("Base_W_Default_Currency&Base_W_Default_Currency"))
-        }
-//
-        
-    }
-}

+ 0 - 75
Koala/Koala/Modular/Market/V/MarketNavView.swift

@@ -1,75 +0,0 @@
-//
-//  MarketNavView.swift
-//  Koala
-//
-//  Created by mac on 2023/9/8.
-//  Copyright © 2023 刘千军. All rights reserved.
-//
-
-import Foundation
-import UIKit
-
-class MarketNavView: BaseView
-{
-
-    lazy var titleLb : UILabel = {
-        
-        let v = UILabel()
-        v.textColor = .black
-        v.font = .boldSystemFont(ofSize: 22)
-        v.text = "市场"
-        
-        return v
-    }()
-    
-    lazy var searchBtn : UIButton = {
-        
-        let  v = UIButton(type: .custom)
-        
-        v.setImage(UIImage(named: "Infomation_search"), for: .normal)
-        
-        return v
-    }()
-    
-    lazy var chatBtn : UIButton = {
-        
-        let v = UIButton(type: .custom)
-        v.setImage(UIImage(named: "Infomation_chat"), for: .normal)
-        
-        return v
-    }()
-    
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-    
-        backgroundColor = .white
-        
-        self.addSubview(titleLb)
-        titleLb.snp.makeConstraints { make in
-            make.left.equalTo(self.snp.left).offset(18)
-            make.bottom.equalTo(self.snp.bottom).offset(-16)
-        }
-        
-        self.addSubview(chatBtn)
-        chatBtn.snp.makeConstraints { make in
-            make.right.equalTo(self.snp.right).offset(-15)
-            make.bottom.equalTo(self.snp.bottom).offset(-15)
-            make.size.equalTo(CGSizeMake(24, 24))
-        }
-        
-        self.addSubview(searchBtn)
-        searchBtn.snp.makeConstraints { make in
-            make.right.equalTo(chatBtn.snp.left).offset(-14)
-            make.centerY.equalTo(chatBtn)
-            make.size.equalTo(CGSizeMake(24, 24))
-        }
-        
-        
-    }
-    
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    
-}

+ 0 - 369
Koala/Koala/Modular/Market/V/MarketView.swift

@@ -1,369 +0,0 @@
-//
-//  MarketView.swift
-//  Koala
-//
-//  Created by 刘千军 on 2023/1/14.
-//  Copyright © 2023 刘千军. All rights reserved.
-//
-
-import UIKit
-
-class MarketView: BaseView {
-    var VM: MarketViewModel?
-    
-    lazy var navView : MarketNavView = {
-        
-        let v = MarketNavView(frame: .zero)
-        
-        return v
-    }()
-    
-    lazy var segmentedControl:HMSegmentedControl = {
-        let segmentedControl:HMSegmentedControl = HMSegmentedControl.init(frame: CGRect(x: 0, y:NavigationViewHeight+StatusBarHeight, width:SCREEN_WIDTH-50, height: 40))
-        segmentedControl.selectedSegmentIndex = 1
-        segmentedControl.backgroundColor = .clear
-        segmentedControl.titleTextAttributes = [NSAttributedString.Key.foregroundColor : TitleTextColor,NSAttributedString.Key.font:_PFSR(16)]
-        segmentedControl.selectedTitleTextAttributes = [NSAttributedString.Key.foregroundColor : MainBackGroundColor,NSAttributedString.Key.font:_PFSR(18)]
-        segmentedControl.selectionIndicatorHeight = 2
-        segmentedControl.segmentWidthStyle = .dynamic
-        segmentedControl.selectionStyle = .fullWidthStripe
-        segmentedControl.selectionIndicatorLocation = .down
-        segmentedControl.selectionIndicatorColor = MainBackGroundColor
-        segmentedControl.segmentEdgeInset = UIEdgeInsets.init(top: 0, left: 20, bottom: 0, right: 0)
-        segmentedControl.indexChangeBlock = {[weak self](index) in
-            if index == 0 && !OperationalUserInfoData.getLogin(){
-                self?.segmentedControl.selectedSegmentIndex = UInt(self!.VM!.index)
-                getIntoLogin(myData: nil)
-                
-            }else{
-                self?.VM?.index = Int(index)
-            }
-           
-        }
-        segmentedControl.sectionTitles = ["",""]
-        return segmentedControl
-    }()
-    
-    
-    lazy var searchView:BaseSearchView = {
-        let view:BaseSearchView = BaseSearchView()
-        view.textFieldBlock = {[weak self] text in
-            self?.VM?.screenText = text
-        }
-        return view
-    }()
-    
-    lazy var searchBgView:UIView = {
-        let view:UIView = UIView()
-        view.addSubview(self.searchView)
-        self.searchView.snp.makeConstraints { make in
-            make.top.equalTo(5)
-            make.left.equalTo(15)
-            make.right.equalTo(-15)
-            make.bottom.equalTo(-5)
-        }
-        return view
-    }()
-    
-    lazy var listHeader:MarketListHeaderView = {
-        let view = MarketListHeaderView()
-//        view.leftBtn.setTextFont(.PFSM, 16)
-//        view.rightBtn.setTextFont(.PFSM, 16)
-        view.clickLeftBtnBlock = {
-            self.VM?.increaseSort = 0
-            if self.VM?.symbolSort == 0{
-                self.VM?.symbolSort = 1
-            }
-            else if self.VM?.symbolSort == 1{
-                self.VM?.symbolSort = 2
-            }
-            else if self.VM?.symbolSort == 2{
-                self.VM?.symbolSort = 0
-            }
-        }
-        view.clickRightBtnBlock = {
-            self.VM?.symbolSort = 0
-            if self.VM?.increaseSort == 0{
-                self.VM?.increaseSort = 1
-            }
-            else if self.VM?.increaseSort == 1{
-                self.VM?.increaseSort = 2
-            }
-            else if self.VM?.increaseSort == 2{
-                self.VM?.increaseSort = 0
-            }
-        }
-        return view
-    }()
-    
-    lazy var listHeaderBgView:UIView = {
-        let view:UIView = UIView()
-        view.addSubview(self.listHeader)
-        self.listHeader.snp.makeConstraints { make in
-            make.left.equalTo(15)
-            make.right.equalTo(-15)
-            make.top.bottom.equalToSuperview()
-        }
-        return view
-    }()
-    
-    lazy var tableView: BaseTableView = { [weak self] in
-        let tableView = BaseTableView.init(frame: .zero, style: .plain)
-        tableView.separatorStyle = .none
-        tableView.delegate = self
-        tableView.dataSource = self
-        tableView.backgroundColor = .clear
-        tableView.tableHeaderView = UIView()
-        tableView.tableFooterView = UIView()
-        tableView.showsHorizontalScrollIndicator = false
-        tableView.showsVerticalScrollIndicator = false
-        
-        tableView.register(UINib.init(nibName: "HomeInfoCell", bundle: nil), forCellReuseIdentifier: "HomeInfoCell")
-        
-        tableView.register(UINib.init(nibName: "BaseCurrencyListCell", bundle: nil), forCellReuseIdentifier: "BaseCurrencyListCell")
-        
-        tableView.register(MarketListCell.self, forCellReuseIdentifier: MarketListCell.description())
-        
-        if #available(iOS 11, *){
-            tableView.contentInsetAdjustmentBehavior = .never
-        }
-        return tableView
-    }()
-    
-    lazy var menuBtn : UIButton = {
-        let v = UIButton(type: .custom)
-        v.setImage(UIImage(named: "market_menu"), for: .normal)
-        
-        return v
-    }()
-
-    
-    override func subView() {
-        self.backgroundColor = .white //ALLBackGroundColor
-        
-        self.addSubview(navView)
-        self.addSubview(segmentedControl)
-//        self.addSubview(searchBgView)
-        self.addSubview(menuBtn)
-        self.addSubview(listHeaderBgView)
-        self.addSubview(tableView)
-        mySwitchLanguage()
-        mySwitchSkin()
-    }
-    
-    override func layoutSubviews() {
-        super.layoutSubviews()
-        
-        self.navView.snp.makeConstraints { make in
-            make.top.left.right.equalTo(self)
-            make.height.equalTo(NavigationViewHeight+StatusBarHeight)
-        }
-        
-//        self.searchBgView.snp.makeConstraints { make in
-//            make.left.right.equalToSuperview()
-//            make.height.equalTo(50)
-////            make.top.equalTo(51)
-//            make.top.equalTo(NavigationViewHeight+StatusBarHeight+51)
-//
-//        }
-        
-        self.menuBtn.snp.makeConstraints { make in
-            make.centerY.equalTo(segmentedControl)
-            make.right.equalTo(self.snp.right).offset(-17)
-            make.size.equalTo(CGSize(width: 25, height: 25))
-        }
-        self.listHeaderBgView.snp.makeConstraints { make in
-            make.left.right.equalToSuperview()
-            make.height.equalTo(40)
-//            make.top.equalTo(self.searchBgView.snp.bottom).offset(1)
-            make.top.equalTo(NavigationViewHeight + StatusBarHeight + 40)
-        }
-        
-        tableView.snp.makeConstraints { make in
-            make.bottom.right.left.equalToSuperview()
-            make.top.equalTo(self.listHeaderBgView.snp.bottom)
-        }
-    }
-    
-    override func setViewModel(viewmodel: AnyObject) {
-        guard viewmodel is MarketViewModel else {
-            return
-        }
-        self.VM = viewmodel as? MarketViewModel
-        super.setViewModel(viewmodel: viewmodel)
-       
-    }
-    
-    override func mySwitchLanguage() {
-      
-        self.searchView.setTextPlaceholder(text: switchLanguage("搜索"))
-        self.listHeader.priceBtn.setTitle(switchLanguage("价格"), for: .normal)
-        self.listHeader.upDownBtn.setTitle(switchLanguage("涨跌幅"), for: .normal)
-        self.listHeader.priceBtn.setImage(_image("Market_W_Sort_Normal&Market_W_Sort_Normal"), for: .normal)
-        self.listHeader.upDownBtn.setImage(_image("Market_W_Sort_Normal&Market_W_Sort_Normal"), for: .normal)
-        self.listHeader.priceBtn.layoutButtonEdgeInsetStyle(type: .right, space: 5);
-        self.listHeader.upDownBtn.layoutButtonEdgeInsetStyle(type: .right, space: 5);
-    }
-    
-    override func mySwitchSkin() {
-        self.tableView.backgroundColor = .clear
-        self.backgroundColor = .white//ViewBorderColor
-        
-        self.segmentedControl.backgroundColor = ALLBackGroundColor
-        self.searchBgView.backgroundColor = ALLBackGroundColor
-        self.searchView.textField.backgroundColor = InputBackGroundColor
-        self.searchView.mySwitchSkin()
-        
-        self.listHeaderBgView.backgroundColor = ALLBackGroundColor
-        self.tableView.backgroundColor = ALLBackGroundColor
-        self.listHeader.priceBtn.setTitleColor(_color("#68727e&#68727e"), for: .normal)
-        self.listHeader.upDownBtn.setTitleColor(_color("#68727e&#68727e"), for: .normal)
-        
-        segmentedControl.titleTextAttributes = [NSAttributedString.Key.foregroundColor : TitleTextColor,NSAttributedString.Key.font:_PFSR(14)]
-        segmentedControl.selectedTitleTextAttributes = [NSAttributedString.Key.foregroundColor : MainBackGroundColor,NSAttributedString.Key.font:_PFSM(14)]
-        segmentedControl.selectionIndicatorColor = MainBackGroundColor
-    }
-    
-
-    override func blindModel() {
-        VM?.groupListAction.values.observeValues({[weak self] (success) in
-            guard let self = self else { return }
-            if success {
-                var nameList = [String]()
-                for model in self.VM!.productGroupList {
-                    if conerData(model.id, .MyInt).0! < 1{
-                        nameList.append(model.title)
-                    }else{
-                        
-                        nameList.append(model.title)
-//                        for m in model.langList {
-//                            if OpretationalLanguage.getLanguageStatus() == .ChineseLanguage{
-//                                if m.language == "zh-CN"{
-//                                    nameList.append(m.title)
-//                                }
-//                            }else{
-//                                if m.language == "en"{
-//                                    nameList.append(m.title)
-//                                }
-//                            }
-//                        }
-                    }
-                   
-                    
-                }
-                self.segmentedControl.sectionTitles = nameList
-            }
-        })
-        
-        VM?.insertProductUserAction.values.observeValues({[weak self] (success) in
-            guard let self = self else { return }
-            if success {
-                self.reloadTable()
-            }
-        })
-        
-        VM?.deleteProductUserAction.values.observeValues({[weak self] (success) in
-            guard let self = self else { return }
-            if success {
-                self.reloadTable()
-            }
-        })
-        
-        VM?.signalScreen.observeValues({ [weak self] (success) in
-            guard let self = self else { return }
-            if success {
-                self.reloadTable()
-            }
-        })
-        
-        VM?.signalSymbol.observeValues({ [weak self] (isSocket) in
-            guard let self = self else { return }
-            if isSocket {
-                self.updateSocketCellData()
-            }
-        })
-        
-        
-    }
-    
-    func updateSocketCellData() -> Void {
-        for (i,model) in self.VM!.screenSymbolList.enumerated() {
-            if let cell:BaseCurrencyListCell = self.tableView.cellForRow(at: IndexPath(row: i, section: 0)) as? BaseCurrencyListCell{
-                cell.updateNewPrice(model: model)
-            }
-        }
-    }
-    
-    func reloadTable() {
-        DispatchQueue.main.async {
-//            self.tableView.mj_header!.endRefreshing()
-            self.tableView.reloadData()
-        }
-    }
-    
-    
-    
-}
-
-//代理
-extension MarketView:UITableViewDelegate,UITableViewDataSource{
-   
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-       
-        return self.VM?.screenSymbolList.count ?? 0
-    }
-    
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-//        let cell:BaseCurrencyListCell = tableView.dequeueReusableCell(withIdentifier: "BaseCurrencyListCell") as! BaseCurrencyListCell
-        let cell = tableView.dequeueReusableCell(withIdentifier: MarketListCell.description()) as! MarketListCell
-        let model:KSymbolModel = (self.VM?.screenSymbolList[indexPath.row])!;
-        cell.updateMarketCellWith(model: model)
-        cell.clickCollectionBlock = { symbolModel in
-            if symbolModel.isCollection{
-                self.VM?.netDeleteProductUser(symbol: symbolModel.symbol)
-            }else{
-                self.VM?.netInsertProductUser(symbol: symbolModel.symbol)
-            }
-            
-        }
-        return cell
-    }
-    
-    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-        return 55
-    }
-    
-    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
-        return UIView()
-    }
-    
-    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
-        return UIView()
-    }
-    
-    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        return 0
-    }
-    
-    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
-        return 0
-    }
-    
-    
-    
-    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
-        let model = self.VM?.screenSymbolList[indexPath.row]
-//        let vc = CTKLineViewController()
-//        vc.viewModel.symbolModel = model!
-//        currentVc()?.navigationController?.pushViewController(vc, animated: true)
-       
-        let vc = MarketMainDetailViewController()
-        vc.viewModel.symbolModel = model!
-        currentVc()?.navigationController?.pushViewController(vc, animated: true)
-    }
-    
-}
-
-
-
-

+ 298 - 0
Koala/Koala/Modular/Market/V/MarketView/MarketHeaderView.swift

@@ -0,0 +1,298 @@
+//
+//  MarketHeaderView.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/10.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MarketHeaderView: BaseView {
+
+    @IBOutlet weak var bg1View: UIView!
+    @IBOutlet weak var menuBg1View: UIView!
+    @IBOutlet weak var menu1Btn: UIButton!
+    
+    @IBOutlet weak var btn1: UIButton!
+    @IBOutlet weak var btn2: UIButton!
+    @IBOutlet weak var btn3: UIButton!
+    @IBOutlet weak var btn4: UIButton!
+    
+    @IBOutlet weak var priceBtn: UIButton!
+    @IBOutlet weak var changeBtn: UIButton!
+    
+    
+    @IBOutlet weak var bg2View: UIView!
+    @IBOutlet weak var menuBg2View: UIView!
+    @IBOutlet weak var menu2Btn: UIButton!
+   
+    @IBOutlet weak var optionLab: UILabel!
+    
+    @IBOutlet weak var collectionView: UICollectionView!
+    @IBOutlet weak var screenBtn: UIButton!
+    
+    
+    @IBOutlet weak var optionsTitleLab: UILabel!
+    @IBOutlet weak var optionsChangeBtn: UIButton!
+    @IBOutlet weak var optionsMeanBtn: UIButton!
+    @IBOutlet weak var optionsVirtualBtn: UIButton!
+    
+    var clickLeftBtnBlock: (() -> ())?
+    
+    var clickRightBtnBlock: (() -> ())?
+    
+    var clickTimerBlock: ((_ index:Int) -> ())?
+    
+    var listData:[OptionsTimerModel] = [OptionsTimerModel]()
+    
+    lazy var segmentedControl:HMSegmentedControl = {
+        let segmentedControl:HMSegmentedControl = HMSegmentedControl.init(frame: CGRect(x: 10, y:0, width:SCREEN_WIDTH-74, height: 44))
+        segmentedControl.selectedSegmentIndex = 0
+        segmentedControl.backgroundColor = .clear
+      
+        segmentedControl.selectionIndicatorHeight = 2
+        segmentedControl.segmentWidthStyle = .dynamic
+        segmentedControl.selectionStyle = .textWidthStripe
+        segmentedControl.selectionIndicatorLocation = .down
+        segmentedControl.selectionIndicatorColor = MainBackGroundColor
+        segmentedControl.segmentEdgeInset = UIEdgeInsets.init(top: 0, left: 10, bottom: 0, right: 10)
+
+        segmentedControl.sectionTitles = ["",""]
+        return segmentedControl
+    }()
+    
+    lazy var segmented2Control:HMSegmentedControl = {
+        let segmentedControl:HMSegmentedControl = HMSegmentedControl.init(frame: CGRect(x: 10, y:0, width:SCREEN_WIDTH-74, height: 44))
+        segmentedControl.selectedSegmentIndex = 0
+        segmentedControl.backgroundColor = .clear
+      
+        segmentedControl.selectionIndicatorHeight = 2
+        segmentedControl.segmentWidthStyle = .dynamic
+        segmentedControl.selectionStyle = .textWidthStripe
+        segmentedControl.selectionIndicatorLocation = .down
+        segmentedControl.selectionIndicatorColor = MainBackGroundColor
+        segmentedControl.segmentEdgeInset = UIEdgeInsets.init(top: 0, left: 10, bottom: 0, right: 10)
+
+        segmentedControl.sectionTitles = ["",""]
+        return segmentedControl
+    }()
+    
+    
+    
+    var headerView: UIView!
+    
+    func loadFromNib() -> UIView {
+        return Bundle.main.loadNibNamed("MarketHeaderView", owner: self, options: nil)?.first as! UIView
+    }
+
+    
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        headerView = loadFromNib()
+        addSubview(headerView)
+        headerView.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+        
+        self.menuBg1View.addSubview(self.segmentedControl)
+        
+        self.menuBg2View.addSubview(self.segmented2Control)
+        
+        
+        self.priceBtn.setTextFont(.PFSR, 12)
+        self.changeBtn.setTextFont(.PFSR, 12)
+        
+        self.optionLab.setTextFont(.PFSR, 14)
+        
+        self.screenBtn.setTextFont(.PFSR, 14)
+        
+        self.optionsTitleLab.setTextFont(.PFSR, 12)
+        self.optionsChangeBtn.setTextFont(.PFSR, 12)
+        self.optionsMeanBtn.setTextFont(.PFSR, 12)
+        self.optionsVirtualBtn.setTextFont(.PFSR, 12)
+        
+    }
+    
+    override func mySwitchLanguage() {
+        self.priceBtn.setTitle(switchLanguage("价格"), for: .normal)
+        self.changeBtn.setTitle(switchLanguage("涨跌幅"), for: .normal)
+        
+        self.optionLab.text = switchLanguage("期权")
+        self.screenBtn.setTitle(switchLanguage("筛选"), for: .normal)
+        
+        self.optionsTitleLab.text = switchLanguage("标的")
+        self.optionsChangeBtn.setTitle(switchLanguage("涨跌幅"), for: .normal)
+        self.optionsMeanBtn.setTitle(switchLanguage("平值"), for: .normal)
+        self.optionsVirtualBtn.setTitle(switchLanguage("虚值105"), for: .normal)
+        
+    }
+    
+    override func mySwitchSkin() {
+        headerView.backgroundColor = ALLBackGroundColor
+        
+        segmentedControl.titleTextAttributes = [NSAttributedString.Key.foregroundColor : TitleTextColor,NSAttributedString.Key.font:_PFSR(14)]
+        segmentedControl.selectedTitleTextAttributes = [NSAttributedString.Key.foregroundColor : MainBackGroundColor,NSAttributedString.Key.font:_PFSR(16)]
+        segmentedControl.selectionIndicatorColor = MainBackGroundColor
+        
+        self.menu1Btn.setImage(_image("market_menu&market_menu"), for: .normal)
+        
+        self.btn1.setImage(_image("market_trans&market_trans"), for: .normal)
+        self.btn2.setImage(_image("market_chart&market_chart"), for: .normal)
+        self.btn3.setImage(_image("market_rect&market_rect"), for: .normal)
+        self.btn4.setImage(_image("market_setting&market_setting"), for: .normal)
+        
+     
+        self.priceBtn.setTitleColor(TitleTextColor, for: .normal)
+        self.changeBtn.setTitleColor(TitleTextColor, for: .normal)
+        
+        self.priceBtn.setImage(_image("Market_W_Sort_Normal&Market_W_Sort_Normal"), for: .normal)
+        self.changeBtn.setImage(_image("Market_W_Sort_Normal&Market_W_Sort_Normal"), for: .normal)
+        self.priceBtn.layoutButtonEdgeInsetStyle(type: .right, space: 5);
+        self.changeBtn.layoutButtonEdgeInsetStyle(type: .right, space: 5);
+        
+        
+        segmented2Control.titleTextAttributes = [NSAttributedString.Key.foregroundColor : TitleTextColor,NSAttributedString.Key.font:_PFSR(14)]
+        segmented2Control.selectedTitleTextAttributes = [NSAttributedString.Key.foregroundColor : MainBackGroundColor,NSAttributedString.Key.font:_PFSR(16)]
+        segmented2Control.selectionIndicatorColor = MainBackGroundColor
+        
+        self.menu2Btn.setImage(_image("market_menu&market_menu"), for: .normal)
+        
+        self.optionLab.textColor = MidTextColor
+        
+        let layout = UICollectionViewFlowLayout.init()
+        layout.scrollDirection = UICollectionView.ScrollDirection.vertical
+        layout.minimumInteritemSpacing = 5
+        layout.minimumLineSpacing = 0
+        collectionView.setCollectionViewLayout(layout, animated: true)
+        collectionView.delegate = self
+        collectionView.dataSource = self
+        collectionView.showsVerticalScrollIndicator = false
+        collectionView.showsHorizontalScrollIndicator = false
+        collectionView.backgroundColor = UIColor.clear
+        collectionView.base_registerCell(cellClass: MHTimerCell.self)
+       
+        self.screenBtn.setTitleColor(MidTextColor, for: .normal)
+        self.screenBtn.setImage(_image("Market_W_Screen&Market_W_Screen"), for: .normal)
+        self.screenBtn.layoutButtonEdgeInsetStyle(type: .right, space: 5);
+        
+        
+        self.optionsTitleLab.textColor = MidTextColor
+        self.optionsChangeBtn.setTitleColor(MidTextColor, for: .normal)
+        self.optionsMeanBtn.setTitleColor(MidTextColor, for: .normal)
+        self.optionsVirtualBtn.setTitleColor(MidTextColor, for: .normal)
+        
+        self.optionsChangeBtn.setImage(_image("Market_W_Sort_Normal&Market_W_Sort_Normal"), for: .normal)
+        self.optionsMeanBtn.setImage(_image("Market_W_Sort_Normal&Market_W_Sort_Normal"), for: .normal)
+        self.optionsVirtualBtn.setImage(_image("Market_W_Sort_Normal&Market_W_Sort_Normal"), for: .normal)
+        self.optionsChangeBtn.layoutButtonEdgeInsetStyle(type: .right, space: 5);
+        self.optionsMeanBtn.layoutButtonEdgeInsetStyle(type: .right, space: 5);
+        self.optionsVirtualBtn.layoutButtonEdgeInsetStyle(type: .right, space: 5);
+    }
+    
+
+    required init?(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+    }
+    
+    
+    func updateLayer(index:Int) -> Void {
+        self.bg1View.isHidden = true
+        self.bg2View.isHidden = true
+        if index == 0 {
+            self.bg1View.isHidden = false
+            self.menuBg1View.isHidden = true
+        }
+        else if index == 1{
+            self.bg1View.isHidden = false
+            self.menuBg1View.isHidden = false
+        }
+        else{
+            self.bg2View.isHidden = false
+        }
+    }
+    
+    func updateOptionsTimer(list:[OptionsTimerModel]){
+        self.listData = list
+        self.collectionView.reloadData()
+    }
+
+}
+
+extension MarketHeaderView : UICollectionViewDelegateFlowLayout, UICollectionViewDelegate, UICollectionViewDataSource{
+    
+    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        return self.listData.count
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        let cell = collectionView.base_dequeueReusableCell(indexPath: indexPath) as MHTimerCell
+        let model:OptionsTimerModel = self.listData[indexPath.row]
+        cell.updateCellDataWith(model:model)
+       
+        return cell
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
+        return CGSize(width:30, height: collectionView.frame.height)
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+        for model in self.listData {
+            model.isSelect = false
+        }
+        
+        let model:OptionsTimerModel = self.listData[indexPath.row]
+        model.isSelect = true
+        self.collectionView.reloadData()
+        self.clickTimerBlock?(indexPath.row)
+    }
+
+}
+
+class MHTimerCell: UICollectionViewCell {
+   
+    lazy var titleLab:UILabel = {
+        let lab:UILabel = UILabel.init()
+        lab.setTextFont(.PFSR, 12)
+        lab.textColor = TitleTextColor
+        lab.textAlignment = .center
+        return lab
+    }()
+    
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        contentView.addSubview(titleLab)
+        self.backgroundColor = .clear
+        self.contentView.setViewLayerBorderColor(myColor: .clear, borderWidth: 0, maskBounds: 4)
+        self.contentView.layer.masksToBounds = true
+    }
+    
+    override func layoutSubviews() {
+        super.layoutSubviews()
+        self.titleLab.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+        
+    }
+    
+    required init?(coder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+
+    func updateCellDataWith(model:OptionsTimerModel) -> Void {
+        self.titleLab.text = model.title
+        if model.isSelect {
+            self.contentView.backgroundColor = _color("#FFF1F1&#FFF1F1")
+            self.titleLab.textColor = _color("#EA4A45&#EA4A45")
+        }else{
+            self.contentView.backgroundColor = ViewBorderColor
+            self.titleLab.textColor = MidTextColor
+        }
+    }
+   
+  
+
+}
+
+

+ 276 - 0
Koala/Koala/Modular/Market/V/MarketView/MarketHeaderView.xib

@@ -0,0 +1,276 @@
+<?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">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MarketHeaderView" customModule="Koala" customModuleProvider="target">
+            <connections>
+                <outlet property="bg1View" destination="dhn-Yo-3At" id="pag-QQ-TwN"/>
+                <outlet property="bg2View" destination="3Lf-8d-mW6" id="zY1-hV-Nhn"/>
+                <outlet property="btn1" destination="bjO-Ms-oDa" id="dmY-V9-NXa"/>
+                <outlet property="btn2" destination="X9m-PT-T4f" id="hhG-M8-az3"/>
+                <outlet property="btn3" destination="vgq-N0-c5V" id="1Yl-Pe-rdA"/>
+                <outlet property="btn4" destination="Ib7-dm-kXr" id="dyQ-i7-q1r"/>
+                <outlet property="changeBtn" destination="Sau-Ax-z7A" id="Rlh-gT-scu"/>
+                <outlet property="collectionView" destination="0dO-ui-Xej" id="tpp-zC-7ru"/>
+                <outlet property="menu1Btn" destination="6sQ-sv-M6s" id="i2b-aN-yTY"/>
+                <outlet property="menu2Btn" destination="e3r-Jt-afI" id="NCN-pF-aZP"/>
+                <outlet property="menuBg1View" destination="qPY-Qn-rJ7" id="qwU-3b-gvA"/>
+                <outlet property="menuBg2View" destination="wbH-Ad-VQF" id="ikF-OT-8yR"/>
+                <outlet property="optionLab" destination="IXb-az-D5L" id="z2R-V5-XIb"/>
+                <outlet property="optionsChangeBtn" destination="aqe-M7-dkg" id="iY7-pX-FqT"/>
+                <outlet property="optionsMeanBtn" destination="YDn-eS-upl" id="c9t-wA-2nW"/>
+                <outlet property="optionsTitleLab" destination="RzD-CQ-O2w" id="VgI-wb-rjJ"/>
+                <outlet property="optionsVirtualBtn" destination="4er-hb-wzS" id="xeS-2x-MQ5"/>
+                <outlet property="priceBtn" destination="WoH-d7-CQB" id="cQW-Rg-yuw"/>
+                <outlet property="screenBtn" destination="dd7-Uq-DM3" id="bJv-b6-VWt"/>
+            </connections>
+        </placeholder>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="iN0-l3-epB">
+            <rect key="frame" x="0.0" y="0.0" width="491" height="156"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="QAl-3w-QIE">
+                    <rect key="frame" x="0.0" y="12" width="491" height="144"/>
+                    <subviews>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dhn-Yo-3At">
+                            <rect key="frame" x="0.0" y="0.0" width="491" height="144"/>
+                            <subviews>
+                                <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="ZmW-bX-Dma">
+                                    <rect key="frame" x="0.0" y="0.0" width="491" height="144"/>
+                                    <subviews>
+                                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qPY-Qn-rJ7">
+                                            <rect key="frame" x="0.0" y="0.0" width="491" height="44"/>
+                                            <subviews>
+                                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6sQ-sv-M6s">
+                                                    <rect key="frame" x="447" y="0.0" width="44" height="44"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" secondItem="6sQ-sv-M6s" secondAttribute="height" multiplier="1:1" id="zq2-XM-5Qf"/>
+                                                    </constraints>
+                                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                                </button>
+                                            </subviews>
+                                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                            <constraints>
+                                                <constraint firstAttribute="bottom" secondItem="6sQ-sv-M6s" secondAttribute="bottom" id="33G-ZZ-l2V"/>
+                                                <constraint firstAttribute="trailing" secondItem="6sQ-sv-M6s" secondAttribute="trailing" id="QFB-va-nkb"/>
+                                                <constraint firstItem="6sQ-sv-M6s" firstAttribute="top" secondItem="qPY-Qn-rJ7" secondAttribute="top" id="aJz-YM-hyS"/>
+                                                <constraint firstAttribute="height" constant="44" id="k9R-52-xJj"/>
+                                            </constraints>
+                                        </view>
+                                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DA8-n0-KD4">
+                                            <rect key="frame" x="0.0" y="44" width="491" height="100"/>
+                                            <subviews>
+                                                <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qpU-vK-NwD">
+                                                    <rect key="frame" x="10" y="0.0" width="266.66666666666669" height="100"/>
+                                                    <subviews>
+                                                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bjO-Ms-oDa">
+                                                            <rect key="frame" x="0.0" y="0.0" width="66.666666666666671" height="100"/>
+                                                            <constraints>
+                                                                <constraint firstAttribute="width" secondItem="bjO-Ms-oDa" secondAttribute="height" multiplier="1:1.5" id="B1z-2V-Hqi"/>
+                                                            </constraints>
+                                                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                                        </button>
+                                                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="X9m-PT-T4f">
+                                                            <rect key="frame" x="66.666666666666657" y="0.0" width="66.666666666666657" height="100"/>
+                                                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                                        </button>
+                                                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vgq-N0-c5V">
+                                                            <rect key="frame" x="133.33333333333334" y="0.0" width="66.666666666666657" height="100"/>
+                                                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                                        </button>
+                                                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ib7-dm-kXr">
+                                                            <rect key="frame" x="200" y="0.0" width="66.666666666666686" height="100"/>
+                                                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                                        </button>
+                                                    </subviews>
+                                                    <constraints>
+                                                        <constraint firstItem="Ib7-dm-kXr" firstAttribute="width" secondItem="bjO-Ms-oDa" secondAttribute="width" id="AIJ-aZ-Z4k"/>
+                                                        <constraint firstItem="vgq-N0-c5V" firstAttribute="width" secondItem="bjO-Ms-oDa" secondAttribute="width" id="Qx8-LA-GVY"/>
+                                                        <constraint firstItem="X9m-PT-T4f" firstAttribute="width" secondItem="bjO-Ms-oDa" secondAttribute="width" id="aOa-dd-JaW"/>
+                                                    </constraints>
+                                                </stackView>
+                                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="trailing" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="WoH-d7-CQB">
+                                                    <rect key="frame" x="391" y="0.0" width="80" height="100"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" constant="80" id="3aJ-TO-KIM"/>
+                                                    </constraints>
+                                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                                </button>
+                                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="trailing" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Sau-Ax-z7A">
+                                                    <rect key="frame" x="351" y="0.0" width="30" height="100"/>
+                                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                                </button>
+                                            </subviews>
+                                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                            <constraints>
+                                                <constraint firstItem="qpU-vK-NwD" firstAttribute="leading" secondItem="DA8-n0-KD4" secondAttribute="leading" constant="10" id="0HK-rq-vso"/>
+                                                <constraint firstItem="WoH-d7-CQB" firstAttribute="top" secondItem="DA8-n0-KD4" secondAttribute="top" id="8gd-YZ-KCn"/>
+                                                <constraint firstAttribute="bottom" secondItem="Sau-Ax-z7A" secondAttribute="bottom" id="D0r-cj-xOi"/>
+                                                <constraint firstAttribute="bottom" secondItem="WoH-d7-CQB" secondAttribute="bottom" id="PHC-VW-aHo"/>
+                                                <constraint firstItem="Sau-Ax-z7A" firstAttribute="top" secondItem="DA8-n0-KD4" secondAttribute="top" id="f7K-GZ-g7L"/>
+                                                <constraint firstAttribute="trailing" secondItem="WoH-d7-CQB" secondAttribute="trailing" constant="20" id="fwf-gH-toT"/>
+                                                <constraint firstItem="qpU-vK-NwD" firstAttribute="top" secondItem="DA8-n0-KD4" secondAttribute="top" id="mqA-oW-Dym"/>
+                                                <constraint firstItem="WoH-d7-CQB" firstAttribute="leading" secondItem="Sau-Ax-z7A" secondAttribute="trailing" constant="10" id="n6J-ET-PjL"/>
+                                                <constraint firstAttribute="bottom" secondItem="qpU-vK-NwD" secondAttribute="bottom" id="oEf-uc-PiY"/>
+                                            </constraints>
+                                        </view>
+                                    </subviews>
+                                </stackView>
+                            </subviews>
+                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            <constraints>
+                                <constraint firstItem="ZmW-bX-Dma" firstAttribute="top" secondItem="dhn-Yo-3At" secondAttribute="top" id="8gG-PS-C2a"/>
+                                <constraint firstItem="ZmW-bX-Dma" firstAttribute="leading" secondItem="dhn-Yo-3At" secondAttribute="leading" id="DKN-tw-CwX"/>
+                                <constraint firstAttribute="trailing" secondItem="ZmW-bX-Dma" secondAttribute="trailing" id="MhA-2B-EAQ"/>
+                                <constraint firstAttribute="bottom" secondItem="ZmW-bX-Dma" secondAttribute="bottom" id="qIw-Tw-HWR"/>
+                            </constraints>
+                        </view>
+                        <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="3Lf-8d-mW6">
+                            <rect key="frame" x="0.0" y="0.0" width="491" height="88"/>
+                            <subviews>
+                                <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="6Hg-H7-N36">
+                                    <rect key="frame" x="0.0" y="0.0" width="491" height="88"/>
+                                    <subviews>
+                                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wbH-Ad-VQF">
+                                            <rect key="frame" x="0.0" y="0.0" width="491" height="44"/>
+                                            <subviews>
+                                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="e3r-Jt-afI">
+                                                    <rect key="frame" x="447" y="0.0" width="44" height="44"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" secondItem="e3r-Jt-afI" secondAttribute="height" multiplier="1:1" id="Kl6-3z-fdB"/>
+                                                    </constraints>
+                                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                                </button>
+                                            </subviews>
+                                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                            <constraints>
+                                                <constraint firstAttribute="height" constant="44" id="2ql-ew-Cxg"/>
+                                                <constraint firstAttribute="trailing" secondItem="e3r-Jt-afI" secondAttribute="trailing" id="9Tp-z3-qjr"/>
+                                                <constraint firstAttribute="bottom" secondItem="e3r-Jt-afI" secondAttribute="bottom" id="FCz-VH-fDM"/>
+                                                <constraint firstItem="e3r-Jt-afI" firstAttribute="top" secondItem="wbH-Ad-VQF" secondAttribute="top" id="SL3-Mc-fhB"/>
+                                            </constraints>
+                                        </view>
+                                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Wni-0S-Tge">
+                                            <rect key="frame" x="0.0" y="44" width="491" height="44"/>
+                                            <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="IXb-az-D5L">
+                                                    <rect key="frame" x="20.000000000000004" y="11.999999999999998" width="41.333333333333343" height="20.333333333333329"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="0dO-ui-Xej">
+                                                    <rect key="frame" x="71.333333333333343" y="12" width="369.66666666666663" height="20"/>
+                                                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="height" constant="20" id="fUY-yN-sHU"/>
+                                                    </constraints>
+                                                    <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="31z-1G-YbT">
+                                                        <size key="itemSize" width="128" height="128"/>
+                                                        <size key="headerReferenceSize" width="0.0" height="0.0"/>
+                                                        <size key="footerReferenceSize" width="0.0" height="0.0"/>
+                                                        <inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
+                                                    </collectionViewFlowLayout>
+                                                </collectionView>
+                                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dd7-Uq-DM3">
+                                                    <rect key="frame" x="451" y="0.0" width="30" height="44"/>
+                                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                                </button>
+                                            </subviews>
+                                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                            <constraints>
+                                                <constraint firstAttribute="trailing" secondItem="dd7-Uq-DM3" secondAttribute="trailing" constant="10" id="29V-5q-N1y"/>
+                                                <constraint firstItem="IXb-az-D5L" firstAttribute="centerY" secondItem="Wni-0S-Tge" secondAttribute="centerY" id="Hjk-0G-CtO"/>
+                                                <constraint firstItem="dd7-Uq-DM3" firstAttribute="leading" secondItem="0dO-ui-Xej" secondAttribute="trailing" constant="10" id="IxT-Ah-9AR"/>
+                                                <constraint firstItem="IXb-az-D5L" firstAttribute="leading" secondItem="Wni-0S-Tge" secondAttribute="leading" constant="20" id="Po8-3r-kdn"/>
+                                                <constraint firstAttribute="height" constant="44" id="QWd-9S-hPZ"/>
+                                                <constraint firstAttribute="bottom" secondItem="dd7-Uq-DM3" secondAttribute="bottom" id="RYb-rB-m0I"/>
+                                                <constraint firstItem="0dO-ui-Xej" firstAttribute="leading" secondItem="IXb-az-D5L" secondAttribute="trailing" constant="10" id="VU4-x5-AE0"/>
+                                                <constraint firstItem="0dO-ui-Xej" firstAttribute="centerY" secondItem="Wni-0S-Tge" secondAttribute="centerY" id="jZS-wB-E2l"/>
+                                                <constraint firstItem="dd7-Uq-DM3" firstAttribute="top" secondItem="Wni-0S-Tge" secondAttribute="top" id="oMG-uw-w87"/>
+                                            </constraints>
+                                        </view>
+                                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Fr8-Zb-coO">
+                                            <rect key="frame" x="0.0" y="88" width="491" height="0.0"/>
+                                            <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="RzD-CQ-O2w">
+                                                    <rect key="frame" x="20.000000000000004" y="-10" width="41.333333333333343" height="20.333333333333332"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="trailing" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4er-hb-wzS">
+                                                    <rect key="frame" x="391" y="0.0" width="80" height="0.0"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" constant="80" id="hJK-pI-Dbk"/>
+                                                    </constraints>
+                                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                                </button>
+                                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="trailing" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="YDn-eS-upl">
+                                                    <rect key="frame" x="311" y="0.0" width="80" height="0.0"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" constant="80" id="3KR-iV-pGh"/>
+                                                        <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="80" id="hr3-wy-7ci"/>
+                                                    </constraints>
+                                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                                </button>
+                                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="trailing" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="aqe-M7-dkg">
+                                                    <rect key="frame" x="281" y="0.0" width="30" height="0.0"/>
+                                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                                </button>
+                                            </subviews>
+                                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                            <constraints>
+                                                <constraint firstItem="YDn-eS-upl" firstAttribute="leading" secondItem="aqe-M7-dkg" secondAttribute="trailing" id="1Jq-fG-C1k"/>
+                                                <constraint firstAttribute="bottom" secondItem="aqe-M7-dkg" secondAttribute="bottom" id="Cjb-H7-Kzd"/>
+                                                <constraint firstItem="4er-hb-wzS" firstAttribute="leading" secondItem="YDn-eS-upl" secondAttribute="trailing" id="MTZ-l2-Odc"/>
+                                                <constraint firstItem="RzD-CQ-O2w" firstAttribute="leading" secondItem="Fr8-Zb-coO" secondAttribute="leading" constant="20" id="Nao-mz-4H0"/>
+                                                <constraint firstItem="4er-hb-wzS" firstAttribute="top" secondItem="Fr8-Zb-coO" secondAttribute="top" id="ZHh-Pw-7tl"/>
+                                                <constraint firstItem="RzD-CQ-O2w" firstAttribute="centerY" secondItem="Fr8-Zb-coO" secondAttribute="centerY" id="a3k-18-sTY"/>
+                                                <constraint firstAttribute="bottom" secondItem="4er-hb-wzS" secondAttribute="bottom" id="aaK-ct-BuF"/>
+                                                <constraint firstItem="aqe-M7-dkg" firstAttribute="top" secondItem="Fr8-Zb-coO" secondAttribute="top" id="ghQ-op-BmQ"/>
+                                                <constraint firstAttribute="trailing" secondItem="4er-hb-wzS" secondAttribute="trailing" constant="20" id="tTB-fU-hco"/>
+                                                <constraint firstItem="YDn-eS-upl" firstAttribute="top" secondItem="Fr8-Zb-coO" secondAttribute="top" id="vRR-jv-K9U"/>
+                                                <constraint firstAttribute="bottom" secondItem="YDn-eS-upl" secondAttribute="bottom" id="zAi-hi-8dJ"/>
+                                            </constraints>
+                                        </view>
+                                    </subviews>
+                                </stackView>
+                            </subviews>
+                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            <constraints>
+                                <constraint firstItem="6Hg-H7-N36" firstAttribute="leading" secondItem="3Lf-8d-mW6" secondAttribute="leading" id="4aa-35-OMY"/>
+                                <constraint firstItem="6Hg-H7-N36" firstAttribute="top" secondItem="3Lf-8d-mW6" secondAttribute="top" id="Edy-98-Twd"/>
+                                <constraint firstAttribute="trailing" secondItem="6Hg-H7-N36" secondAttribute="trailing" id="JkT-CP-Ne1"/>
+                                <constraint firstAttribute="bottom" secondItem="6Hg-H7-N36" secondAttribute="bottom" id="KSo-nb-Gz1"/>
+                            </constraints>
+                        </view>
+                    </subviews>
+                </stackView>
+            </subviews>
+            <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
+            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+            <constraints>
+                <constraint firstItem="QAl-3w-QIE" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="12" id="0f7-V8-HyI"/>
+                <constraint firstAttribute="bottom" secondItem="QAl-3w-QIE" secondAttribute="bottom" id="Wla-hL-Xg2"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="QAl-3w-QIE" secondAttribute="trailing" id="tOq-Rk-dH4"/>
+                <constraint firstItem="QAl-3w-QIE" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="yAY-dD-C0w"/>
+            </constraints>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <point key="canvasLocation" x="-8.3969465648854964" y="123.94366197183099"/>
+        </view>
+    </objects>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 81 - 0
Koala/Koala/Modular/Market/V/MarketView/MarketListCell.swift

@@ -0,0 +1,81 @@
+//
+//  MarketListCell.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/9.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MarketListCell: BaseTableViewCell {
+    @IBOutlet weak var nameLab: UILabel!
+    @IBOutlet weak var markBtn: UIButton!
+    @IBOutlet weak var numberLab: UILabel!
+    
+    @IBOutlet weak var priceLab: UILabel!
+    
+    @IBOutlet weak var changeLab: UILabel!
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        
+        self.backgroundColor = .clear
+        
+        self.nameLab.setTextFont(.PFSM, 15)
+        
+        self.markBtn.setTextFont(.PFSR, 12)
+        self.markBtn.contentEdgeInsets = UIEdgeInsets(top: 0, left: 4, bottom: 0, right: 4)
+        self.markBtn .setViewLayerBorderColor(myColor: .clear, borderWidth: 0, maskBounds: 2)
+        
+        self.numberLab.setTextFont(.PFSR, 12)
+        
+        self.priceLab.setTextFont(.PFSR, 14)
+        
+        self.changeLab.setTextFont(.PFSR, 14)
+        
+        self.changeLab.setViewLayerBorderColor(myColor: .clear, borderWidth: 0, maskBounds: 4)
+    }
+    
+    
+    override func mySwitchColor() {
+        self.backgroundColor = ALLBackGroundColor
+        self.nameLab.textColor = TitleTextColor
+      
+        self.numberLab.textColor = LightTextColor
+        
+        self.priceLab.textColor = GrayTextColor
+        
+        self.changeLab.textColor = WhiteTextColor
+    }
+    
+    override func setSelected(_ selected: Bool, animated: Bool) {
+        super.setSelected(selected, animated: animated)
+
+        // Configure the view for the selected state
+    }
+    
+    func updateCellWith(model:KSymbolModel) -> Void {
+        self.mySwitchColor()
+        self.nameLab.text = model.title
+        self.markBtn.setTitle(model.market, for: .normal)
+        self.numberLab.text = model.symbol
+        if model.market == "HK"{
+            self.markBtn.backgroundColor = _color("#EDF6FF&#EDF6FF")
+            self.markBtn.setTitleColor(_color("#1989FF&#1989FF"), for: .normal)
+        }else{
+            self.markBtn.backgroundColor = _color("#FFF1F1&#FFF1F1")
+            self.markBtn.setTitleColor(_color("#EA4A45&#EA4A45"), for: .normal)
+        }
+        
+        self.updateNewPrice(model: model)
+        
+    }
+    
+    func updateNewPrice(model:KSymbolModel) -> Void {
+        self.priceLab.text = precisionString(with: model.newPrice, precision: model.digits)
+        self.priceLab.textColor = exchangeColorAndImage(increase: conerData(model.increase as Any, .MyFloat).1!).0
+        self.changeLab.text = precisionString(with: model.increase, precision: "2") + "%"
+        self.changeLab.backgroundColor = exchangeColorAndImage(increase: conerData(model.increase as Any, .MyFloat).1!).0
+    }
+    
+}

+ 94 - 0
Koala/Koala/Modular/Market/V/MarketView/MarketListCell.xib

@@ -0,0 +1,94 @@
+<?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">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="92" id="KGk-i7-Jjw" customClass="MarketListCell" customModule="Koala" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="430" height="92"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
+                <rect key="frame" x="0.0" y="0.0" width="430" height="92"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="HTm-fO-hm9">
+                        <rect key="frame" x="20" y="25.333333333333332" width="240" height="41.333333333333343"/>
+                        <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="BLh-ui-ydO">
+                                <rect key="frame" x="0.0" y="0.0" width="240" height="20.333333333333332"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gnf-VG-7IY">
+                                <rect key="frame" x="0.0" y="25.333333333333329" width="240" height="16"/>
+                                <subviews>
+                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gJC-GR-xvw">
+                                        <rect key="frame" x="0.0" y="0.0" width="30" height="16"/>
+                                        <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                    </button>
+                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5Nz-bq-hom">
+                                        <rect key="frame" x="35" y="0.0" width="41.333333333333343" height="16"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                        <nil key="textColor"/>
+                                        <nil key="highlightedColor"/>
+                                    </label>
+                                </subviews>
+                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                <constraints>
+                                    <constraint firstItem="gJC-GR-xvw" firstAttribute="leading" secondItem="gnf-VG-7IY" secondAttribute="leading" id="F9K-Wh-Drp"/>
+                                    <constraint firstItem="5Nz-bq-hom" firstAttribute="top" secondItem="gnf-VG-7IY" secondAttribute="top" id="Ka9-r4-u7D"/>
+                                    <constraint firstAttribute="height" constant="16" id="OZf-85-uZd"/>
+                                    <constraint firstItem="5Nz-bq-hom" firstAttribute="leading" secondItem="gJC-GR-xvw" secondAttribute="trailing" constant="5" id="WNO-ej-kHB"/>
+                                    <constraint firstItem="gJC-GR-xvw" firstAttribute="top" secondItem="gnf-VG-7IY" secondAttribute="top" id="ZwQ-Vb-u0L"/>
+                                    <constraint firstAttribute="bottom" secondItem="5Nz-bq-hom" secondAttribute="bottom" id="c5Z-vq-w1l"/>
+                                    <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="5Nz-bq-hom" secondAttribute="trailing" id="tDn-bn-cVH"/>
+                                    <constraint firstAttribute="bottom" secondItem="gJC-GR-xvw" secondAttribute="bottom" id="yfT-5b-zvH"/>
+                                </constraints>
+                            </view>
+                        </subviews>
+                    </stackView>
+                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EPp-Mg-NgL">
+                        <rect key="frame" x="330" y="31" width="80" height="30"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="80" id="in2-0g-Ox1"/>
+                            <constraint firstAttribute="height" constant="30" id="vMh-UL-0GR"/>
+                        </constraints>
+                        <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="XkU-xO-HDX">
+                        <rect key="frame" x="278.66666666666669" y="36" width="41.333333333333314" height="20.333333333333329"/>
+                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                        <nil key="textColor"/>
+                        <nil key="highlightedColor"/>
+                    </label>
+                </subviews>
+                <constraints>
+                    <constraint firstItem="EPp-Mg-NgL" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="X6J-Qs-emX"/>
+                    <constraint firstItem="HTm-fO-hm9" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="Y5T-fZ-xVe"/>
+                    <constraint firstItem="HTm-fO-hm9" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="20" id="dPm-Cg-3tm"/>
+                    <constraint firstAttribute="trailing" secondItem="EPp-Mg-NgL" secondAttribute="trailing" constant="20" id="ge8-Fc-Aey"/>
+                    <constraint firstItem="EPp-Mg-NgL" firstAttribute="leading" secondItem="XkU-xO-HDX" secondAttribute="trailing" constant="10" id="mL8-Tz-l60"/>
+                    <constraint firstItem="XkU-xO-HDX" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="uTS-d4-TTM"/>
+                </constraints>
+            </tableViewCellContentView>
+            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
+            <connections>
+                <outlet property="changeLab" destination="EPp-Mg-NgL" id="Mr4-BT-n7b"/>
+                <outlet property="markBtn" destination="gJC-GR-xvw" id="4kB-Wh-Uwq"/>
+                <outlet property="nameLab" destination="BLh-ui-ydO" id="347-IA-u7U"/>
+                <outlet property="numberLab" destination="5Nz-bq-hom" id="gZp-v3-MAL"/>
+                <outlet property="priceLab" destination="XkU-xO-HDX" id="ikY-br-R0s"/>
+            </connections>
+            <point key="canvasLocation" x="180" y="39"/>
+        </tableViewCell>
+    </objects>
+</document>

+ 4 - 5
Koala/Koala/Modular/Market/V/MarketListHeaderView.swift → Koala/Koala/Modular/Market/V/MarketView/MarketListHeaderView.swift

@@ -41,7 +41,7 @@ class MarketListHeaderView: BaseView {
     
     lazy var upDownBtn : UIButton = {
         let v = UIButton(type: .custom)
-       
+        v.contentHorizontalAlignment = .right
         v.setTextFont(.PFSR, 14)
         
      
@@ -83,7 +83,7 @@ class MarketListHeaderView: BaseView {
         addSubview(transBtn)
         transBtn.snp.makeConstraints { make in
             make.centerY.equalTo(self)
-            make.left.equalTo(self.snp.left).offset(17)
+            make.left.equalTo(self.snp.left).offset(20)
             make.size.equalTo(CGSize(width: 18, height: 18))
         }
         
@@ -110,15 +110,14 @@ class MarketListHeaderView: BaseView {
         addSubview(upDownBtn)
         upDownBtn.snp.makeConstraints { make in
             make.centerY.equalTo(self)
-            make.right.equalTo(self.snp.right).offset(-18)
-            make.size.equalTo(CGSize(width: 46, height: 12))
+            make.right.equalTo(self.snp.right).offset(-20)
+            make.width.equalTo(80)
         }
         
         addSubview(priceBtn)
         priceBtn.snp.makeConstraints { make in
             make.centerY.equalTo(self)
             make.right.equalTo(self.snp.right).offset(-100)
-            make.size.equalTo(CGSize(width: 46, height: 12))
         }
        
         

+ 87 - 0
Koala/Koala/Modular/Market/V/MarketView/MarketNavView.swift

@@ -0,0 +1,87 @@
+//
+//  MarketNavView.swift
+//  Koala
+//
+//  Created by mac on 2023/9/8.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import Foundation
+import UIKit
+
+class MarketNavView: BaseView
+{
+    
+    lazy var segmentedControl:HMSegmentedControl = {
+        let segmentedControl:HMSegmentedControl = HMSegmentedControl.init(frame: CGRect(x: 10, y:StatusBarHeight, width:SCREEN_WIDTH-98, height: 44))
+    
+        segmentedControl.backgroundColor = .clear
+        segmentedControl.selectionIndicatorHeight = 2
+        segmentedControl.segmentWidthStyle = .dynamic
+        segmentedControl.selectionIndicatorLocation = .down
+        segmentedControl.selectionIndicatorColor = .clear
+        segmentedControl.segmentEdgeInset = UIEdgeInsets.init(top: 0, left: 10, bottom: 0, right: 10)
+        segmentedControl.sectionTitles = [switchLanguage("自选"),switchLanguage("市场"),switchLanguage("个股期权")]
+        return segmentedControl
+    }()
+    
+    lazy var searchBtn : UIButton = {
+        
+        let  v = UIButton(type: .custom)
+        
+        v.setImage(UIImage(named: "Infomation_search"), for: .normal)
+        
+        return v
+    }()
+    
+    lazy var chatBtn : UIButton = {
+        
+        let v = UIButton(type: .custom)
+        v.setImage(UIImage(named: "Infomation_chat"), for: .normal)
+        
+        return v
+    }()
+    
+    
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        self.mySwitchSkin()
+        self.mySwitchLanguage()
+        backgroundColor = ALLBackGroundColor
+        
+        self.addSubview(segmentedControl)
+       
+        self.addSubview(chatBtn)
+        
+      
+        
+        chatBtn.snp.makeConstraints { make in
+            make.right.equalTo(self.snp.right)
+            make.bottom.equalTo(self.snp.bottom)
+            make.size.equalTo(CGSizeMake(44, 44))
+        }
+        
+        self.addSubview(searchBtn)
+        searchBtn.snp.makeConstraints { make in
+            make.right.equalTo(chatBtn.snp.left)
+            make.centerY.equalTo(chatBtn)
+            make.size.equalTo(CGSizeMake(44, 44))
+        }
+        
+        
+    }
+    
+    required init?(coder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    override func mySwitchSkin() {
+        segmentedControl.titleTextAttributes = [NSAttributedString.Key.foregroundColor : TitleTextColor,NSAttributedString.Key.font:_PFSR(18)]
+        segmentedControl.selectedTitleTextAttributes = [NSAttributedString.Key.foregroundColor : TitleTextColor,NSAttributedString.Key.font:_PFSM(20)]
+    }
+    
+    override func mySwitchLanguage() {
+        self.segmentedControl.sectionTitles = [switchLanguage("自选"),switchLanguage("市场"),switchLanguage("个股期权")]
+    }
+    
+}

+ 99 - 0
Koala/Koala/Modular/Market/V/MarketView/MarketOptionsListCell.swift

@@ -0,0 +1,99 @@
+//
+//  MarketOptionsListCell.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/11.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MarketOptionsListCell: BaseTableViewCell {
+    @IBOutlet weak var nameLab: UILabel!
+    @IBOutlet weak var markBtn: UIButton!
+    @IBOutlet weak var numberLab: UILabel!
+    
+    @IBOutlet weak var changeLab: UILabel!
+    
+    @IBOutlet weak var meanLab: UILabel!
+    
+    @IBOutlet weak var virtualLab: UILabel!
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        
+        self.nameLab.setTextFont(.PFSM, 15)
+        
+        self.markBtn.setTextFont(.PFSR, 12)
+        self.markBtn.contentEdgeInsets = UIEdgeInsets(top: 0, left: 4, bottom: 0, right: 4)
+        self.markBtn .setViewLayerBorderColor(myColor: .clear, borderWidth: 0, maskBounds: 2)
+        
+        self.numberLab.setTextFont(.PFSR, 12)
+        
+        self.changeLab.setTextFont(.PFSR, 14)
+        
+        self.meanLab.setTextFont(.PFSR, 14)
+        
+        self.virtualLab.setTextFont(.PFSR, 14)
+        
+    }
+    
+    override func mySwitchColor() {
+        self.backgroundColor = ALLBackGroundColor
+        self.nameLab.textColor = TitleTextColor
+      
+        self.numberLab.textColor = LightTextColor
+        
+        self.meanLab.textColor = MidTextColor
+        
+        self.virtualLab.textColor = MidTextColor
+    }
+    
+
+    override func setSelected(_ selected: Bool, animated: Bool) {
+        super.setSelected(selected, animated: animated)
+
+        // Configure the view for the selected state
+    }
+    
+    func updateCellWith(VM:MarketViewModel,model:OptionsListModel) -> Void {
+        self.mySwitchColor()
+        self.nameLab.text = model.symbolData.title
+        self.markBtn.setTitle(model.symbolData.market, for: .normal)
+        self.numberLab.text = model.code
+        
+        
+        let dict = model.toJSON()
+        let key:String = VM.getOptionsTimer()
+        
+        if let pricelist:String = dict?[key] as? String{
+            
+            let arr = pricelist.replacingOccurrences(of: " ", with: "").components(separatedBy: ",")
+            if arr.count == 2{
+                self.meanLab.text = precisionString(with: String(format: "%@", arr.first!), precision: "2") + "%"
+                self.virtualLab.text = precisionString(with:String(format: "%@",arr.last!) , precision: "2") + "%"
+            }else{
+                self.meanLab.text = "0.00%"
+                self.virtualLab.text = "0.00%"
+            }
+        }
+        
+        if model.symbolData.market == "HK"{
+            self.markBtn.backgroundColor = _color("#EDF6FF&#EDF6FF")
+            self.markBtn.setTitleColor(_color("#1989FF&#1989FF"), for: .normal)
+        }else{
+            self.markBtn.backgroundColor = _color("#FFF1F1&#FFF1F1")
+            self.markBtn.setTitleColor(_color("#EA4A45&#EA4A45"), for: .normal)
+        }
+        
+        self.updateNewPrice(model: model.symbolData)
+        
+    }
+    
+    func updateNewPrice(model:KSymbolModel) -> Void {
+       
+        self.changeLab.text = precisionString(with: model.increase, precision: "2") + "%"
+        self.changeLab.textColor = exchangeColorAndImage(increase: conerData(model.increase as Any, .MyFloat).1!).0
+    }
+    
+}

+ 105 - 0
Koala/Koala/Modular/Market/V/MarketView/MarketOptionsListCell.xib

@@ -0,0 +1,105 @@
+<?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">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="100" id="KGk-i7-Jjw" customClass="MarketOptionsListCell" customModule="Koala" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="600" height="100"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
+                <rect key="frame" x="0.0" y="0.0" width="600" height="100"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="4" translatesAutoresizingMaskIntoConstraints="NO" id="5jM-Io-JcT">
+                        <rect key="frame" x="20" y="30.000000000000004" width="240" height="40.333333333333343"/>
+                        <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="GeQ-TH-FPJ">
+                                <rect key="frame" x="0.0" y="0.0" width="240" height="20.333333333333332"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9B2-jZ-6Wp">
+                                <rect key="frame" x="0.0" y="24.333333333333336" width="240" height="16"/>
+                                <subviews>
+                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="2eA-Th-nTN">
+                                        <rect key="frame" x="0.0" y="0.0" width="30" height="16"/>
+                                        <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                    </button>
+                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sIB-7e-Moq">
+                                        <rect key="frame" x="35" y="0.0" width="41.333333333333343" height="16"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                        <nil key="textColor"/>
+                                        <nil key="highlightedColor"/>
+                                    </label>
+                                </subviews>
+                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                <constraints>
+                                    <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="sIB-7e-Moq" secondAttribute="trailing" id="46q-Wd-FLL"/>
+                                    <constraint firstItem="sIB-7e-Moq" firstAttribute="top" secondItem="9B2-jZ-6Wp" secondAttribute="top" id="Dys-7N-n3E"/>
+                                    <constraint firstAttribute="height" constant="16" id="QbR-48-c2s"/>
+                                    <constraint firstItem="2eA-Th-nTN" firstAttribute="leading" secondItem="9B2-jZ-6Wp" secondAttribute="leading" id="YV6-vR-sSe"/>
+                                    <constraint firstItem="2eA-Th-nTN" firstAttribute="top" secondItem="9B2-jZ-6Wp" secondAttribute="top" id="fpY-by-O1S"/>
+                                    <constraint firstAttribute="bottom" secondItem="2eA-Th-nTN" secondAttribute="bottom" id="jXM-em-bPy"/>
+                                    <constraint firstItem="sIB-7e-Moq" firstAttribute="leading" secondItem="2eA-Th-nTN" secondAttribute="trailing" constant="5" id="sCK-5Y-ph7"/>
+                                    <constraint firstAttribute="bottom" secondItem="sIB-7e-Moq" secondAttribute="bottom" id="zeK-jw-llk"/>
+                                </constraints>
+                            </view>
+                        </subviews>
+                    </stackView>
+                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="HY3-II-ISV">
+                        <rect key="frame" x="500" y="40" width="80" height="20.333333333333329"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="80" id="J7O-Kg-jy5"/>
+                        </constraints>
+                        <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="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="prB-iA-Tcm">
+                        <rect key="frame" x="420" y="40" width="80" height="20.333333333333329"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="80" id="Lxd-Yi-rHZ"/>
+                        </constraints>
+                        <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="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mbs-vo-DGN">
+                        <rect key="frame" x="378.66666666666669" y="40" width="41.333333333333314" height="20.333333333333329"/>
+                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                        <nil key="textColor"/>
+                        <nil key="highlightedColor"/>
+                    </label>
+                </subviews>
+                <constraints>
+                    <constraint firstItem="mbs-vo-DGN" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="1tF-ax-L0K"/>
+                    <constraint firstItem="prB-iA-Tcm" firstAttribute="leading" secondItem="mbs-vo-DGN" secondAttribute="trailing" id="6e3-sa-KQk"/>
+                    <constraint firstItem="HY3-II-ISV" firstAttribute="leading" secondItem="prB-iA-Tcm" secondAttribute="trailing" id="DRw-5p-WV5"/>
+                    <constraint firstItem="5jM-Io-JcT" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="20" id="PhV-YK-xac"/>
+                    <constraint firstItem="HY3-II-ISV" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="fXh-GX-qcE"/>
+                    <constraint firstAttribute="trailing" secondItem="HY3-II-ISV" secondAttribute="trailing" constant="20" id="k63-h7-fd2"/>
+                    <constraint firstItem="prB-iA-Tcm" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="n9L-hY-eXK"/>
+                    <constraint firstItem="5jM-Io-JcT" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="rYJ-Ei-AMY"/>
+                </constraints>
+            </tableViewCellContentView>
+            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
+            <connections>
+                <outlet property="changeLab" destination="mbs-vo-DGN" id="Tlo-gK-WAL"/>
+                <outlet property="markBtn" destination="2eA-Th-nTN" id="Sn2-Sj-rtC"/>
+                <outlet property="meanLab" destination="prB-iA-Tcm" id="aqV-xm-03b"/>
+                <outlet property="nameLab" destination="GeQ-TH-FPJ" id="1Om-mh-yNT"/>
+                <outlet property="numberLab" destination="sIB-7e-Moq" id="rSp-N7-NWL"/>
+                <outlet property="virtualLab" destination="HY3-II-ISV" id="PjE-si-Y6F"/>
+            </connections>
+            <point key="canvasLocation" x="352.67175572519085" y="27.464788732394368"/>
+        </tableViewCell>
+    </objects>
+</document>

+ 0 - 0
Koala/Koala/Modular/Market/V/MarketPopView.swift → Koala/Koala/Modular/Market/V/MarketView/MarketPopView.swift


+ 291 - 0
Koala/Koala/Modular/Market/V/MarketView/MarketRecommendView.swift

@@ -0,0 +1,291 @@
+//
+//  MarketRecommendView.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/9.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MarketRecommendView: BaseView {
+    @IBOutlet weak var topBgView: UIView!
+    @IBOutlet weak var imgView: UIImageView!
+    @IBOutlet weak var hintLab: UILabel!
+    @IBOutlet weak var searchBtn: UIButton!
+    
+    @IBOutlet weak var titleLab: UILabel!
+    @IBOutlet weak var collectionView: UICollectionView!
+    
+    @IBOutlet weak var addBtn: UIButton!
+   
+    var clickAddBtnBlock: ((_ symbols: String) -> ())?
+    
+    var clickSearchBtnBlock: (() -> ())?
+    
+    var symbols:String = ""
+    
+    lazy var listData:[KSymbolModel] = {
+        let arr:[KSymbolModel] = [KSymbolModel]()
+        return arr
+    }()
+    
+    var bgView: UIView!
+    
+    
+    func loadFromNib() -> UIView {
+        return Bundle.main.loadNibNamed("MarketRecommendView", owner: self, options: nil)?.first as! UIView
+    }
+
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        bgView = loadFromNib()
+        addSubview(bgView)
+        bgView.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+        
+        self.hintLab.setTextFont(.PFSR, 12)
+        self.hintLab.numberOfLines = 0
+        
+        self.searchBtn.setTextFont(.PFSR, 10)
+        
+        self.searchBtn.setViewLayerBorderColor(myColor: .clear, borderWidth: 0, maskBounds: 15)
+        
+        self.topBgView.setViewLayerBorderColor(myColor: .clear, borderWidth: 0, maskBounds: 8)
+        
+        self.titleLab.setTextFont(.PFSM, 18)
+        
+        self.addBtn.setTextFont(.PFSR, 14)
+        self.addBtn.setViewLayerBorderColor(myColor: .clear, borderWidth: 0, maskBounds: 8)
+        
+        let layout = UICollectionViewFlowLayout.init()
+        layout.scrollDirection = UICollectionView.ScrollDirection.horizontal
+        layout.minimumInteritemSpacing = 10
+        layout.minimumLineSpacing = 10
+        collectionView.setCollectionViewLayout(layout, animated: true)
+        collectionView.delegate = self
+        collectionView.dataSource = self
+        collectionView.showsVerticalScrollIndicator = false
+        collectionView.showsHorizontalScrollIndicator = false
+        collectionView.backgroundColor = UIColor.clear
+        collectionView.base_registerCell(cellClass: MarketRecommendCell.self)
+        
+        
+        self.mySwitchLanguage()
+        self.mySwitchSkin()
+       
+        self.addBtn.addTarget(self, action: #selector(clickAddBtnAction), for: .touchUpInside)
+        
+        self.searchBtn.addTarget(self, action: #selector(clickSearchBtnAction), for: .touchUpInside)
+        
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+    }
+    
+    override func mySwitchLanguage() {
+        self.hintLab.text = switchLanguage("添加感兴趣的品种,查看实时行情")
+        self.searchBtn.setTitle(switchLanguage("+添加品种"), for: .normal)
+        
+        self.titleLab.text = switchLanguage("推荐股票")
+        
+        self.addBtn.setTitle(switchLanguage("一键添加自选"), for: .normal)
+        
+    }
+    
+    override func mySwitchSkin() {
+        self.bgView.backgroundColor = ALLBackGroundColor;
+        self.topBgView.backgroundColor = _color("#FFF1F1&#FFF1F1")
+        self.imgView.image = _image("Market_W_Recommend_Hint&Market_W_Recommend_Hint")
+        
+        self.hintLab.textColor = TitleTextColor
+        self.searchBtn.setTitleColor(WhiteTextColor, for: .normal)
+        self.searchBtn.backgroundColor = MainBackGroundColor
+        
+        self.titleLab.textColor = TitleTextColor
+        
+        self.addBtn.backgroundColor = MainBackGroundColor
+        self.addBtn.setTitleColor(WhiteTextColor, for: .normal)
+    }
+    
+    func updateRecommendData(list:[KSymbolModel]) -> Void {
+        self.listData.removeAll()
+        self.listData = list
+        self.collectionView.reloadData()
+    }
+    
+    func updateSocketRecommendData(list:[KSymbolModel]) -> Void {
+        for (i,model) in list.enumerated() {
+            if let cell:MarketRecommendCell = self.collectionView.cellForItem(at: IndexPath(row: i, section: 0)) as? MarketRecommendCell{
+                cell.updateCellChangeWith(model: model)
+            }
+        }
+    }
+    
+    
+    @objc func clickSearchBtnAction(){
+        self.clickSearchBtnBlock?()
+    }
+
+    @objc func clickAddBtnAction(){
+        self.symbols = ""
+        for model in self.listData{
+            if model.isSelect {
+                if self.symbols.length == 0 {
+                    self.symbols = model.symbol
+                }else{
+                    self.symbols = self.symbols + "," + model.symbol
+                }
+               
+            }
+        }
+    
+        if self.symbols.length == 0 {
+            ProgressHUD.showInfo(status: switchLanguage("请求勾选股票"))
+            return
+        }
+        
+        self.clickAddBtnBlock?(self.symbols)
+    }
+
+}
+
+extension MarketRecommendView : UICollectionViewDelegateFlowLayout, UICollectionViewDelegate, UICollectionViewDataSource{
+    
+    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        return self.listData.count
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        let cell = collectionView.base_dequeueReusableCell(indexPath: indexPath) as MarketRecommendCell
+         let model:KSymbolModel = self.listData[indexPath.row]
+        cell.updateCellDataWith(model: model)
+        return cell
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
+        return CGSize(width: (SCREEN_WIDTH-50)/2, height: (collectionView.frame.height-30)/4)
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+        let model = self.listData[indexPath.row];
+        model.isSelect = !model.isSelect
+        self.collectionView.reloadData()
+        
+    }
+
+}
+
+
+class MarketRecommendCell: UICollectionViewCell {
+   
+    lazy var titleLab:UILabel = {
+        let lab:UILabel = UILabel.init()
+        lab.setTextFont(.PFSM, 14)
+        lab.textAlignment = .left
+        return lab
+    }()
+    
+    lazy var imgView:UIImageView = {
+        let view:UIImageView = UIImageView.init()
+        return view
+    }()
+    
+    lazy var numberLab:UILabel = {
+        let lab:UILabel = UILabel.init()
+        lab.setTextFont(.PFSR, 12)
+        lab.textAlignment = .left
+        return lab
+    }()
+    
+    lazy var changeLab:UILabel = {
+        let lab:UILabel = UILabel.init()
+        lab.setTextFont(.PFSM, 14)
+        lab.textAlignment = .right
+        return lab
+    }()
+    
+    lazy var bgView:UIView = {
+        let view:UIView = UIView.init()
+        view.addSubview(self.titleLab)
+        view.addSubview(self.imgView)
+        view.addSubview(self.numberLab)
+        view.addSubview(self.changeLab)
+        
+        self.titleLab.snp.makeConstraints { make in
+            make.left.top.equalTo(10)
+        }
+        
+        self.imgView.snp.makeConstraints { make in
+            make.top.equalTo(10)
+            make.right.equalTo(-10)
+            make.size.equalTo(CGSize.init(width: 15, height: 15))
+        }
+        
+        self.numberLab.snp.makeConstraints { make in
+            make.left.equalTo(10)
+            make.bottom.equalTo(-10)
+        }
+        
+        self.changeLab.snp.makeConstraints { make in
+            make.right.equalTo(-10)
+            make.bottom.equalTo(-10)
+        }
+        
+        
+        return view
+    }()
+    
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        contentView.addSubview(bgView)
+        self.backgroundColor = .clear
+        self.bgView.setViewLayerBorderColor(myColor: ViewBorderColor, borderWidth: 1, maskBounds: 4)
+        self.bgView.layer.masksToBounds = true
+    }
+    
+    override func layoutSubviews() {
+        super.layoutSubviews()
+        self.bgView.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+        
+    }
+    
+    required init?(coder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    func mySwitchSkin() {
+        self.bgView.setViewLayerBorderColor(myColor: ViewBorderColor, borderWidth: 1, maskBounds: 4)
+        self.titleLab.textColor = TitleTextColor
+        self.numberLab.textColor = LightTextColor
+    }
+
+    func updateCellDataWith(model:KSymbolModel) -> Void {
+        
+        self.mySwitchSkin()
+        
+        self.titleLab.text = model.title
+        
+        self.numberLab.text = model.symbol
+        
+        self.updateCellChangeWith(model: model)
+        if model.isSelect{
+            self.imgView.image = _image("Market_W_Select&Market_W_Select")
+        }else{
+            self.imgView.image = _image("Market_W_unSelect&Market_W_unSelect")
+        }
+    }
+    
+    func updateCellChangeWith(model:KSymbolModel) -> Void {
+        self.changeLab.text = precisionString(with: model.increase, precision: "2") + "%"
+        self.changeLab.textColor = exchangeColorAndImage(increase: conerData(model.increase as Any, .MyFloat).1!).0
+    }
+  
+
+}
+
+

+ 147 - 0
Koala/Koala/Modular/Market/V/MarketView/MarketRecommendView.xib

@@ -0,0 +1,147 @@
+<?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" colorMatched="YES">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MarketRecommendView" customModule="Koala" customModuleProvider="target">
+            <connections>
+                <outlet property="addBtn" destination="V3j-Gx-Jn2" id="OaW-Ie-UEC"/>
+                <outlet property="collectionView" destination="RNw-Jq-8nF" id="vxj-kg-gbH"/>
+                <outlet property="hintLab" destination="UlZ-y3-5Xe" id="G6E-u5-zr9"/>
+                <outlet property="imgView" destination="qB7-k3-jVB" id="OuW-uL-zBo"/>
+                <outlet property="searchBtn" destination="SKa-Nz-gVV" id="t4p-EW-ElR"/>
+                <outlet property="titleLab" destination="Ql7-hF-6wq" id="pCK-Y8-SGN"/>
+                <outlet property="topBgView" destination="I3U-iK-0kg" id="cTH-VG-94u"/>
+            </connections>
+        </placeholder>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="iN0-l3-epB">
+            <rect key="frame" x="0.0" y="0.0" width="383" height="507"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="ZVg-nM-9Vk">
+                    <rect key="frame" x="20" y="10" width="343" height="470"/>
+                    <subviews>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="I3U-iK-0kg">
+                            <rect key="frame" x="0.0" y="0.0" width="343" height="100"/>
+                            <subviews>
+                                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="qB7-k3-jVB">
+                                    <rect key="frame" x="9.9999999999999929" y="10" width="117.33333333333331" height="80"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" secondItem="qB7-k3-jVB" secondAttribute="height" multiplier="346:236" id="0mU-0r-hRr"/>
+                                    </constraints>
+                                </imageView>
+                                <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="fKJ-KJ-foj">
+                                    <rect key="frame" x="137.33333333333337" y="20.000000000000004" width="195.66666666666663" height="60.333333333333343"/>
+                                    <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="UlZ-y3-5Xe">
+                                            <rect key="frame" x="0.0" y="0.0" width="195.66666666666666" height="20.333333333333332"/>
+                                            <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                            <nil key="textColor"/>
+                                            <nil key="highlightedColor"/>
+                                        </label>
+                                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="8YI-NY-Rf3">
+                                            <rect key="frame" x="0.0" y="30.333333333333336" width="195.66666666666666" height="30"/>
+                                            <subviews>
+                                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="SKa-Nz-gVV">
+                                                    <rect key="frame" x="0.0" y="0.0" width="80" height="30"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="height" constant="30" id="4rn-JI-CuQ"/>
+                                                        <constraint firstAttribute="width" constant="80" id="Hal-zn-gcF"/>
+                                                    </constraints>
+                                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                                </button>
+                                            </subviews>
+                                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                            <constraints>
+                                                <constraint firstItem="SKa-Nz-gVV" firstAttribute="top" secondItem="8YI-NY-Rf3" secondAttribute="top" id="Txn-bW-673"/>
+                                                <constraint firstItem="SKa-Nz-gVV" firstAttribute="leading" secondItem="8YI-NY-Rf3" secondAttribute="leading" id="ioY-zW-3HW"/>
+                                                <constraint firstAttribute="bottom" secondItem="SKa-Nz-gVV" secondAttribute="bottom" id="j1h-vd-Zu5"/>
+                                            </constraints>
+                                        </view>
+                                    </subviews>
+                                </stackView>
+                            </subviews>
+                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            <constraints>
+                                <constraint firstItem="qB7-k3-jVB" firstAttribute="leading" secondItem="I3U-iK-0kg" secondAttribute="leading" constant="10" id="GGV-un-NgW"/>
+                                <constraint firstAttribute="bottom" secondItem="qB7-k3-jVB" secondAttribute="bottom" constant="10" id="dNl-jz-Zm9"/>
+                                <constraint firstAttribute="height" constant="100" id="eVe-Zs-c94"/>
+                                <constraint firstItem="fKJ-KJ-foj" firstAttribute="centerY" secondItem="I3U-iK-0kg" secondAttribute="centerY" id="qHF-HE-mvr"/>
+                                <constraint firstAttribute="trailing" secondItem="fKJ-KJ-foj" secondAttribute="trailing" constant="10" id="qbw-hM-Zab"/>
+                                <constraint firstItem="fKJ-KJ-foj" firstAttribute="leading" secondItem="qB7-k3-jVB" secondAttribute="trailing" constant="10" id="viV-kA-7mT"/>
+                                <constraint firstItem="qB7-k3-jVB" firstAttribute="top" secondItem="I3U-iK-0kg" secondAttribute="top" constant="10" id="wC2-Vz-yPQ"/>
+                            </constraints>
+                        </view>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Toq-Bf-2BY">
+                            <rect key="frame" x="0.0" y="100" width="343" height="50"/>
+                            <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="Ql7-hF-6wq">
+                                    <rect key="frame" x="151" y="14.999999999999998" width="41.333333333333343" height="20.333333333333329"/>
+                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                    <nil key="textColor"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                            </subviews>
+                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="50" id="JRX-aG-Kea"/>
+                                <constraint firstItem="Ql7-hF-6wq" firstAttribute="centerX" secondItem="Toq-Bf-2BY" secondAttribute="centerX" id="rEM-tN-qDN"/>
+                                <constraint firstItem="Ql7-hF-6wq" firstAttribute="centerY" secondItem="Toq-Bf-2BY" secondAttribute="centerY" id="rut-S0-Agm"/>
+                            </constraints>
+                        </view>
+                        <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="RNw-Jq-8nF">
+                            <rect key="frame" x="0.0" y="150" width="343" height="270"/>
+                            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="270" id="8Pr-Un-LPv"/>
+                            </constraints>
+                            <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="yPa-9z-r5c">
+                                <size key="itemSize" width="128" height="128"/>
+                                <size key="headerReferenceSize" width="0.0" height="0.0"/>
+                                <size key="footerReferenceSize" width="0.0" height="0.0"/>
+                                <inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
+                            </collectionViewFlowLayout>
+                        </collectionView>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="c3j-Bk-LkI">
+                            <rect key="frame" x="0.0" y="420" width="343" height="50"/>
+                            <subviews>
+                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="V3j-Gx-Jn2">
+                                    <rect key="frame" x="0.0" y="10" width="343" height="40"/>
+                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                    <state key="normal" title="Button"/>
+                                </button>
+                            </subviews>
+                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            <constraints>
+                                <constraint firstAttribute="trailing" secondItem="V3j-Gx-Jn2" secondAttribute="trailing" id="5pL-bk-Odw"/>
+                                <constraint firstItem="V3j-Gx-Jn2" firstAttribute="top" secondItem="c3j-Bk-LkI" secondAttribute="top" constant="10" id="FjC-Hu-Wzo"/>
+                                <constraint firstAttribute="height" constant="50" id="J6i-Sd-QbL"/>
+                                <constraint firstAttribute="bottom" secondItem="V3j-Gx-Jn2" secondAttribute="bottom" id="k0f-0d-tvg"/>
+                                <constraint firstItem="V3j-Gx-Jn2" firstAttribute="leading" secondItem="c3j-Bk-LkI" secondAttribute="leading" id="lnf-st-JaU"/>
+                            </constraints>
+                        </view>
+                    </subviews>
+                </stackView>
+            </subviews>
+            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+            <constraints>
+                <constraint firstItem="ZVg-nM-9Vk" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" id="XG1-pa-h6g"/>
+                <constraint firstAttribute="trailing" secondItem="ZVg-nM-9Vk" secondAttribute="trailing" constant="20" id="od1-Oz-hLD"/>
+                <constraint firstItem="ZVg-nM-9Vk" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="10" id="p6A-ry-MbJ"/>
+            </constraints>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <point key="canvasLocation" x="31.297709923664122" y="139.08450704225353"/>
+        </view>
+    </objects>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 448 - 0
Koala/Koala/Modular/Market/V/MarketView/MarketView.swift

@@ -0,0 +1,448 @@
+//
+//  MarketView.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/1/14.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+import MJRefresh
+class MarketView: BaseView {
+    var VM: MarketViewModel?
+    
+    lazy var navView : MarketNavView = {
+        
+        let v = MarketNavView(frame: .zero)
+        v.segmentedControl.selectedSegmentIndex = UInt(self.VM!.topIndex)
+        v.segmentedControl.indexChangeBlock = {[weak self](index) in
+            if index == 0 && !OperationalUserInfoData.getLogin(){
+                v.segmentedControl.selectedSegmentIndex = UInt(self!.VM!.topIndex)
+            }else{
+                if index == 0 {
+                    self?.recommendView.isHidden = self!.VM!.collectionSymbolList.count > 0
+                    self?.VM?.index = -2
+                    
+                }
+                else if index == 1{
+                    self?.VM?.index = 0
+                }
+                else{
+                    self?.VM?.optionsIndex = 0
+                }
+                
+                if index != 0 {
+                    self?.recommendView.isHidden = true
+                }
+                self!.VM!.screenSymbolListAction()
+                self?.VM?.topIndex = Int(index)
+                self?.headerView.updateLayer(index: Int(index));
+                if (index == 0){
+                    self?.headerView.frame = CGRect(x: 0, y:TopHeight, width: SCREEN_WIDTH, height: 100-44)
+                }else if index == 1{
+                    self?.headerView.frame = CGRect(x: 0, y:TopHeight, width: SCREEN_WIDTH, height: 100)
+                }else{
+                    self?.headerView.frame = CGRect(x: 0, y:TopHeight, width: SCREEN_WIDTH, height: 144)
+                }
+            }
+        }
+        return v
+    }()
+    
+    
+    lazy var searchView:BaseSearchView = {
+        let view:BaseSearchView = BaseSearchView()
+        view.textFieldBlock = {[weak self] text in
+            self?.VM?.screenText = text
+        }
+        return view
+    }()
+    
+    lazy var searchBgView:UIView = {
+        let view:UIView = UIView()
+        view.addSubview(self.searchView)
+        self.searchView.snp.makeConstraints { make in
+            make.top.equalTo(5)
+            make.left.equalTo(15)
+            make.right.equalTo(-15)
+            make.bottom.equalTo(-5)
+        }
+        return view
+    }()
+    
+    lazy var headerView:MarketHeaderView = {
+        let view = MarketHeaderView.init(frame: CGRect(x: 0, y:TopHeight, width: SCREEN_WIDTH, height: 100))
+        
+        view.segmentedControl.indexChangeBlock = {[weak self](index) in
+            self?.VM?.index = Int(index)
+            
+        }
+        
+        view.segmented2Control.indexChangeBlock = {[weak self](index) in
+            self?.VM?.optionsIndex = Int(index)
+        }
+        
+        view.clickTimerBlock = { index in
+            self.VM?.optionsTimerIndex = index
+            self.reloadTable()
+        }
+        
+        view.clickLeftBtnBlock = {
+            self.VM?.increaseSort = 0
+            if self.VM?.symbolSort == 0{
+                self.VM?.symbolSort = 1
+            }
+            else if self.VM?.symbolSort == 1{
+                self.VM?.symbolSort = 2
+            }
+            else if self.VM?.symbolSort == 2{
+                self.VM?.symbolSort = 0
+            }
+        }
+        
+        view.clickRightBtnBlock = {
+            self.VM?.symbolSort = 0
+            if self.VM?.increaseSort == 0{
+                self.VM?.increaseSort = 1
+            }
+            else if self.VM?.increaseSort == 1{
+                self.VM?.increaseSort = 2
+            }
+            else if self.VM?.increaseSort == 2{
+                self.VM?.increaseSort = 0
+            }
+        }
+        
+        return view
+    }()
+    
+    
+    lazy var recommendView:MarketRecommendView = {
+        
+        let view = MarketRecommendView.init(frame: CGRect(x: 0, y:TopHeight, width: SCREEN_WIDTH, height: SCREEN_HEIGHT))
+        view.isHidden = true
+        view.clickSearchBtnBlock = {
+            
+        }
+        
+        view.clickAddBtnBlock = { [weak self] symbols in
+            self?.VM?.netInsertProductUser(symbol: symbols)
+        }
+        return view
+    }()
+    
+    lazy var tableView: BaseTableView = { [weak self] in
+        let tableView = BaseTableView.init(frame: .zero, style: .plain)
+        tableView.separatorStyle = .singleLine
+        tableView.delegate = self
+        tableView.dataSource = self
+        tableView.backgroundColor = .clear
+        tableView.tableHeaderView = UIView()
+        tableView.tableFooterView = UIView()
+        tableView.showsHorizontalScrollIndicator = false
+        tableView.showsVerticalScrollIndicator = false
+        
+        tableView.register(UINib.init(nibName: "MarketOptionsListCell", bundle: nil), forCellReuseIdentifier: "MarketOptionsListCell")
+        
+        tableView.register(UINib.init(nibName: "MarketListCell", bundle: nil), forCellReuseIdentifier: "MarketListCell")
+        
+        if #available(iOS 11, *){
+            tableView.contentInsetAdjustmentBehavior = .never
+        }
+        
+        tableView.ly_emptyView = self!.showEmptyView()
+        
+        tableView.mj_header = MJRefreshHeader(refreshingBlock: { [weak self] in
+            if self?.VM?.topIndex == 0 {
+                self?.VM?.netUserList()
+            }else if self?.VM?.topIndex == 1{
+                self?.VM?.netSymbolList(isUp: false)
+            }
+            else {
+                self?.VM?.netOptionProductListGroup(isUp: false)
+            }
+           
+        })
+        tableView.mj_footer = MJRefreshAutoFooter.init(refreshingBlock: { [weak self] in
+            if self?.VM?.topIndex == 0 {
+                self?.VM?.netUserList()
+            }else if self?.VM?.topIndex == 1{
+                self?.VM?.netSymbolList(isUp: true)
+            }
+            else {
+                self?.VM?.netOptionProductListGroup(isUp: true)
+            }
+            
+        })
+        
+        return tableView
+    }()
+    
+    lazy var menuBtn : UIButton = {
+        let v = UIButton(type: .custom)
+        v.setImage(UIImage(named: "market_menu"), for: .normal)
+        
+        return v
+    }()
+
+    
+    override func subView() {
+        self.backgroundColor = .white //ALLBackGroundColor
+        
+        self.headerView.segmented2Control.sectionTitles = self.VM!.getOptionsMarketTitleList()
+        self.headerView.updateOptionsTimer(list: self.VM!.getOptionsTimerList())
+        self.addSubview(navView)
+        self.addSubview(headerView)
+        self.addSubview(tableView)
+        
+        self.addSubview(recommendView)
+        
+        mySwitchLanguage()
+        mySwitchSkin()
+    }
+    
+    override func layoutSubviews() {
+        super.layoutSubviews()
+        
+        self.navView.snp.makeConstraints { make in
+            make.top.left.right.equalTo(self)
+            make.height.equalTo(TopHeight)
+        }
+        
+        
+        tableView.snp.makeConstraints { make in
+            make.bottom.right.left.equalToSuperview()
+            make.top.equalTo(self.headerView.snp.bottom)
+        }
+    }
+    
+    override func setViewModel(viewmodel: AnyObject) {
+        guard viewmodel is MarketViewModel else {
+            return
+        }
+        self.VM = viewmodel as? MarketViewModel
+        super.setViewModel(viewmodel: viewmodel)
+       
+    }
+    
+    override func mySwitchLanguage() {
+      
+        self.headerView.mySwitchLanguage()
+        self.navView.mySwitchLanguage()
+        
+    }
+    
+    override func mySwitchSkin() {
+        self.tableView.backgroundColor = .clear
+        self.backgroundColor = ALLBackGroundColor
+        
+        self.searchBgView.backgroundColor = ALLBackGroundColor
+        self.searchView.textField.backgroundColor = InputBackGroundColor
+        self.searchView.mySwitchSkin()
+        
+        self.navView.mySwitchSkin()
+        self.headerView.mySwitchSkin()
+        
+        self.tableView.separatorColor = ViewBorderColor
+        self.tableView.separatorInset = UIEdgeInsets(top: 20, left: 0, bottom: 0, right: 20)
+    
+        
+      
+    }
+    
+
+    override func blindModel() {
+        VM?.groupListAction.values.observeValues({[weak self] (success) in
+            guard let self = self else { return }
+            if success {
+                var nameList = [String]()
+                for model in self.VM!.productGroupList {
+                    if conerData(model.id, .MyInt).0! < 1{
+                        nameList.append(model.title)
+                    }else{
+                        nameList.append(model.title)
+                    }
+                }
+                self.headerView.segmentedControl.sectionTitles = nameList
+            }
+        })
+        
+        VM?.userListAction.values.observeValues({[weak self] (success) in
+            guard let self = self else{return}
+            DispatchQueue.main.async {
+                self.tableView.mj_header!.endRefreshing()
+                self.tableView.mj_footer!.endRefreshing()
+                if self.VM?.topIndex == 0 {
+                    if self.VM!.collectionSymbolList.count > 0{
+                        self.recommendView.isHidden = true
+                    }else{
+                        self.recommendView.isHidden = false;
+                    }
+                }
+                
+                self.reloadTable()
+            }
+            
+        })
+        
+        VM?.recommendSymbolListAction.values.observeValues({[weak self] (success) in
+            guard let self = self else{return}
+            self.recommendView.updateRecommendData(list: self.VM!.recommendList)
+            
+        })
+        
+       
+        VM?.symbolListAction.values.observeValues({[weak self] (success) in
+            guard let self = self else{return}
+            DispatchQueue.main.async {
+                self.tableView.reloadData()
+                self.tableView.mj_header!.endRefreshing()
+                self.tableView.mj_footer!.endRefreshing()
+                if success {
+                    self.tableView.mj_footer!.endRefreshingWithNoMoreData()
+                }
+            }
+        })
+        
+        VM?.optionProductListGroupAction.values.observeValues({[weak self] (success) in
+            guard let self = self else{return}
+            DispatchQueue.main.async {
+                self.tableView.reloadData()
+                self.tableView.mj_header!.endRefreshing()
+                self.tableView.mj_footer!.endRefreshing()
+                if success {
+                    self.tableView.mj_footer!.endRefreshingWithNoMoreData()
+                }
+            }
+        })
+        
+        VM?.insertProductUserAction.values.observeValues({[weak self] (success) in
+            guard let self = self else { return }
+            if success {
+                self.VM?.netUserList()
+            }
+        })
+        
+        VM?.deleteProductUserAction.values.observeValues({[weak self] (success) in
+            guard let self = self else { return }
+            if success {
+                self.reloadTable()
+            }
+        })
+        
+        VM?.signalScreen.observeValues({ [weak self] (success) in
+            guard let self = self else { return }
+            if success {
+                self.reloadTable()
+            }
+        })
+        
+        VM?.signalSymbol.observeValues({ [weak self] (isSocket) in
+            guard let self = self else { return }
+            if isSocket {
+                self.updateSocketCellData()
+            }
+        })
+        
+        
+    }
+    
+    func updateSocketCellData() -> Void {
+        for (i,model) in self.VM!.screenSymbolList.enumerated() {
+            if let cell:MarketListCell = self.tableView.cellForRow(at: IndexPath(row: i, section: 0)) as? MarketListCell{
+                cell.updateNewPrice(model: model)
+            }
+        }
+        
+        self.recommendView.updateSocketRecommendData(list: self.VM!.recommendList)
+        
+        
+    }
+    
+    func reloadTable() {
+        DispatchQueue.main.async {
+//            self.tableView.mj_header!.endRefreshing()
+            self.tableView.reloadData()
+        }
+    }
+    
+    
+    
+}
+
+//代理
+extension MarketView:UITableViewDelegate,UITableViewDataSource{
+   
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        if (self.VM?.topIndex == 2){
+            return self.VM?.screenOptionList.count ?? 0
+        }else{
+            return self.VM?.screenSymbolList.count ?? 0
+        }
+       
+    }
+    
+    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+        if (self.VM?.topIndex == 2){
+            let cell:MarketOptionsListCell = tableView.dequeueReusableCell(withIdentifier: "MarketOptionsListCell") as! MarketOptionsListCell
+          
+            guard (self.VM?.screenOptionList.count)! > indexPath.row else {
+                return cell
+            }
+          
+            let model:OptionsListModel = (self.VM?.screenOptionList[indexPath.row])!;
+            cell.updateCellWith(VM: self.VM!, model: model)
+            return cell
+        }else{
+            let cell:MarketListCell = tableView.dequeueReusableCell(withIdentifier: "MarketListCell") as! MarketListCell
+          
+            guard (self.VM?.screenSymbolList.count)! > indexPath.row else {
+                return cell
+            }
+          
+            let model:KSymbolModel = (self.VM?.screenSymbolList[indexPath.row])!;
+            cell.updateCellWith(model: model)
+           
+            return cell
+        }
+       
+    }
+    
+    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
+        return 60
+    }
+    
+    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
+        return UIView()
+    }
+    
+    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
+        return UIView()
+    }
+    
+    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
+        return 0
+    }
+    
+    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
+        return 0
+    }
+    
+    
+    
+    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
+        let model = self.VM?.screenSymbolList[indexPath.row]
+//        let vc = CTKLineViewController()
+//        vc.viewModel.symbolModel = model!
+//        currentVc()?.navigationController?.pushViewController(vc, animated: true)
+       
+        let vc = MarketMainDetailViewController()
+        vc.viewModel.symbolModel = model!
+        currentVc()?.navigationController?.pushViewController(vc, animated: true)
+    }
+    
+}
+
+
+
+

+ 30 - 0
Koala/Koala/Modular/Market/VC/MarketDetailViewController.swift

@@ -0,0 +1,30 @@
+//
+//  MarketDetailViewController.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/12.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MarketDetailViewController: BaseViewController {
+
+    override func viewDidLoad() {
+        super.viewDidLoad()
+
+        // Do any additional setup after loading the view.
+    }
+    
+
+    /*
+    // MARK: - Navigation
+
+    // In a storyboard-based application, you will often want to do a little preparation before navigation
+    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
+        // Get the new view controller using segue.destination.
+        // Pass the selected object to the new view controller.
+    }
+    */
+
+}

+ 13 - 0
Koala/Koala/Modular/Market/VM/MDAnnouncementViewModel.swift

@@ -0,0 +1,13 @@
+//
+//  MDAnnouncementViewModel.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/12.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MDAnnouncementViewModel: BaseViewModel {
+
+}

+ 13 - 0
Koala/Koala/Modular/Market/VM/MDAuoteViewModel.swift

@@ -0,0 +1,13 @@
+//
+//  MDAuoteViewModel.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/12.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MDAuoteViewModel: BaseViewModel {
+
+}

+ 13 - 0
Koala/Koala/Modular/Market/VM/MDFinanceViewModel.swift

@@ -0,0 +1,13 @@
+//
+//  MDFinanceViewModel.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/12.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MDFinanceViewModel: BaseViewModel {
+
+}

+ 13 - 0
Koala/Koala/Modular/Market/VM/MDNewsViewModel.swift

@@ -0,0 +1,13 @@
+//
+//  MDNewsViewModel.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/12.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MDNewsViewModel: BaseViewModel {
+
+}

+ 13 - 0
Koala/Koala/Modular/Market/VM/MDOptionsViewModel.swift

@@ -0,0 +1,13 @@
+//
+//  MDOptionsViewModel.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/12.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MDOptionsViewModel: BaseViewModel {
+
+}

+ 13 - 0
Koala/Koala/Modular/Market/VM/MDProfileViewModel.swift

@@ -0,0 +1,13 @@
+//
+//  MDProfileViewModel.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/12.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MDProfileViewModel: BaseViewModel {
+
+}

+ 0 - 97
Koala/Koala/Modular/MarketDetail/V/MarketDetailNavView.swift

@@ -1,97 +0,0 @@
-//
-//  MarketDetailNavView.swift
-//  Koala
-//
-//  Created by mac on 2023/9/1.
-//  Copyright © 2023 刘千军. All rights reserved.
-//
-
-import Foundation
-import UIKit
-
-class MarketDetailNavView: BaseView
-{
-
-    lazy var titleLb : UILabel = {
-        
-        let v = UILabel()
-        v.textColor = .black
-        v.font = .boldSystemFont(ofSize: 22)
-        v.text = "特斯拉"
-        
-        return v
-    }()
-    
-    lazy var backBtn : UIButton = {
-        
-        let  v = UIButton(type: .custom)
-        
-        v.setImage(UIImage(named: "Base_W_Black"), for: .normal)
-        v.addTarget(self, action: #selector(backAction), for: .touchUpInside)
-        return v
-    }()
-    
-    @objc func backAction(){
-        
-        currentVc()?.navigationController?.popViewController(animated: true)
-        
-    }
-    
-    lazy var shareBtn : UIButton = {
-        
-        let  v = UIButton(type: .custom)
-        
-        v.setImage(UIImage(named: "Market_share"), for: .normal)
-        
-        return v
-    }()
-    
-    lazy var collectionBtn : UIButton = {
-        
-        let v = UIButton(type: .custom)
-        v.setImage(UIImage(named: "Market_collection"), for: .normal)
-        
-        return v
-    }()
-    
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-    
-        backgroundColor = .white
-        
-        
-        
-        self.addSubview(titleLb)
-        titleLb.snp.makeConstraints { make in
-            make.centerX.equalTo(self)
-            make.bottom.equalTo(self.snp.bottom).offset(-16)
-        }
-        
-        self.addSubview(collectionBtn)
-        collectionBtn.snp.makeConstraints { make in
-            make.right.equalTo(self.snp.right).offset(-15)
-            make.bottom.equalTo(self.snp.bottom).offset(-15)
-            make.size.equalTo(CGSizeMake(24, 24))
-        }
-        
-        self.addSubview(shareBtn)
-        shareBtn.snp.makeConstraints { make in
-            make.right.equalTo(collectionBtn.snp.left).offset(-14)
-            make.centerY.equalTo(collectionBtn)
-            make.size.equalTo(CGSizeMake(24, 24))
-        }
-        
-        self.addSubview(backBtn)
-        backBtn.snp.makeConstraints { make in
-            make.centerY.equalTo(collectionBtn)
-            make.left.equalTo(self.snp.left).offset(9)
-            make.size.equalTo(CGSize(width: 24, height: 24))
-        }
-
-    }
-    
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-}

+ 21 - 0
Koala/Koala/Other/Assets.xcassets/Market/Market_W_Recommend_Hint.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "no-data.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
Koala/Koala/Other/Assets.xcassets/Market/Market_W_Recommend_Hint.imageset/no-data.png


+ 21 - 0
Koala/Koala/Other/Assets.xcassets/Market/Market_W_Screen.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "filter1.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
Koala/Koala/Other/Assets.xcassets/Market/Market_W_Screen.imageset/filter1.png


+ 21 - 0
Koala/Koala/Other/Assets.xcassets/Market/Market_W_Select.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "check1.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
Koala/Koala/Other/Assets.xcassets/Market/Market_W_Select.imageset/check1.png


+ 21 - 0
Koala/Koala/Other/Assets.xcassets/Market/Market_W_unSelect.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "check.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
Koala/Koala/Other/Assets.xcassets/Market/Market_W_unSelect.imageset/check.png


+ 23 - 0
Koala/Koala/Other/Assets.xcassets/Market/Market_unCollection.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "filename" : "路径备份 4.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "路径备份 4@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "路径备份 4@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
Koala/Koala/Other/Assets.xcassets/Market/Market_unCollection.imageset/路径备份 4.png


BIN
Koala/Koala/Other/Assets.xcassets/Market/Market_unCollection.imageset/路径备份 4@2x.png


BIN
Koala/Koala/Other/Assets.xcassets/Market/Market_unCollection.imageset/路径备份 4@3x.png