刘千军 11 месяцев назад
Родитель
Сommit
6d8be637d5
43 измененных файлов с 3797 добавлено и 111 удалено
  1. 64 4
      Koala/Koala.xcodeproj/project.pbxproj
  2. 85 41
      Koala/Koala/FX/Macro/PublicMethod.swift
  3. 1 1
      Koala/Koala/FX/NetClass/Network.swift
  4. 12 2
      Koala/Koala/FX/NetClass/URLS.swift
  5. 1 1
      Koala/Koala/FX/OpretationalDataClass/OperationalNetworkData.swift
  6. 162 0
      Koala/Koala/Modular/Home/V/HomeOptionsCell.swift
  7. 196 0
      Koala/Koala/Modular/Home/V/HomeOptionsCell.xib
  8. 34 13
      Koala/Koala/Modular/Home/V/HomeView.swift
  9. 6 1
      Koala/Koala/Modular/Home/V/JDHomeExponentCell.swift
  10. 3 0
      Koala/Koala/Modular/Home/VC/HomeViewController.swift
  11. 53 1
      Koala/Koala/Modular/Home/VM/HomeViewModel.swift
  12. 151 0
      Koala/Koala/Modular/Market/M/MarketModel.swift
  13. 221 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteDepthCell.swift
  14. 182 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteDepthCell.xib
  15. 80 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteDepthListCell.swift
  16. 88 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteDepthListCell.xib
  17. 38 6
      Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteInfoCell.swift
  18. 49 5
      Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteView.swift
  19. 2 1
      Koala/Koala/Modular/Market/V/MarketDetailView/MDFinanceView/BalloonMarker.swift
  20. 216 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDFinanceView/BarBalloonMarker.swift
  21. 279 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDFinanceView/MDFinanceCell.swift
  22. 149 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDFinanceView/MDFinanceCell.xib
  23. 58 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDFinanceView/MDFinanceListCell.swift
  24. 120 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDFinanceView/MDFinanceListCell.xib
  25. 167 6
      Koala/Koala/Modular/Market/V/MarketDetailView/MDFinanceView/MDFinanceView.swift
  26. 471 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDFinanceView/MDIndicatorCell.swift
  27. 117 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDFinanceView/MDIndicatorCell.xib
  28. 43 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDNewsView/MDNewsListCell.swift
  29. 49 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDNewsView/MDNewsListCell.xib
  30. 141 7
      Koala/Koala/Modular/Market/V/MarketDetailView/MDNewsView/MDNewsView.swift
  31. 4 0
      Koala/Koala/Modular/Market/V/MarketView/MarketListCell.swift
  32. 30 0
      Koala/Koala/Modular/Market/V/MarketView/MarketOptionsListCell.swift
  33. 36 12
      Koala/Koala/Modular/Market/V/MarketView/MarketView.swift
  34. 104 6
      Koala/Koala/Modular/Market/VC/MarketDetailViewController.swift
  35. 5 3
      Koala/Koala/Modular/Market/VC/MarketViewController.swift
  36. 75 1
      Koala/Koala/Modular/Market/VM/MDAuoteViewModel.swift
  37. 195 0
      Koala/Koala/Modular/Market/VM/MDFinanceViewModel.swift
  38. 67 0
      Koala/Koala/Modular/Market/VM/MDNewsViewModel.swift
  39. 22 0
      Koala/Koala/Other/Assets.xcassets/Base/Base_Share.imageset/Contents.json
  40. BIN
      Koala/Koala/Other/Assets.xcassets/Base/Base_Share.imageset/极度iPhoneApp_60pt@2x.png
  41. BIN
      Koala/Koala/Other/Assets.xcassets/Base/Base_Share.imageset/极度iPhoneApp_60pt@3x.png
  42. 21 0
      Koala/Koala/Other/Assets.xcassets/Home/Home_W_Hot.imageset/Contents.json
  43. BIN
      Koala/Koala/Other/Assets.xcassets/Home/Home_W_Hot.imageset/hot.png

+ 64 - 4
Koala/Koala.xcodeproj/project.pbxproj

@@ -530,7 +530,6 @@
 		6C7F446C29556B6000DC6771 /* BaseAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C7F446B29556B6000DC6771 /* BaseAlertView.swift */; };
 		6C8652F629AA6E9D00A2E7FB /* TDStatisticsProfitCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C8652F429AA6E9D00A2E7FB /* TDStatisticsProfitCell.swift */; };
 		6C8652F729AA6E9D00A2E7FB /* TDStatisticsProfitCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6C8652F529AA6E9D00A2E7FB /* TDStatisticsProfitCell.xib */; };
-		6C8652FC29AB496200A2E7FB /* BalloonMarker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C8652FB29AB496200A2E7FB /* BalloonMarker.swift */; };
 		6C8652FF29ABB1A500A2E7FB /* TDStatisticsRecordCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C8652FD29ABB1A500A2E7FB /* TDStatisticsRecordCell.swift */; };
 		6C86530029ABB1A500A2E7FB /* TDStatisticsRecordCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6C8652FE29ABB1A500A2E7FB /* TDStatisticsRecordCell.xib */; };
 		6C86530329ACF3E400A2E7FB /* TDStatisticsRecordListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C86530129ACF3E400A2E7FB /* TDStatisticsRecordListCell.swift */; };
@@ -611,6 +610,22 @@
 		6CBB62F62AD83CD00045A4C9 /* MDAuoteInfoCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6CBB62F42AD83CD00045A4C9 /* MDAuoteInfoCell.xib */; };
 		6CBB62F92AD84E2D0045A4C9 /* MDAuoteKLinewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB62F72AD84E2D0045A4C9 /* MDAuoteKLinewCell.swift */; };
 		6CBB62FA2AD84E2D0045A4C9 /* MDAuoteKLinewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6CBB62F82AD84E2D0045A4C9 /* MDAuoteKLinewCell.xib */; };
+		6CBB62FF2AD977AF0045A4C9 /* MDAuoteDepthCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB62FD2AD977AF0045A4C9 /* MDAuoteDepthCell.swift */; };
+		6CBB63002AD977AF0045A4C9 /* MDAuoteDepthCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6CBB62FE2AD977AF0045A4C9 /* MDAuoteDepthCell.xib */; };
+		6CBB63052AD982190045A4C9 /* MDAuoteDepthListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB63032AD982190045A4C9 /* MDAuoteDepthListCell.swift */; };
+		6CBB63062AD982190045A4C9 /* MDAuoteDepthListCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6CBB63042AD982190045A4C9 /* MDAuoteDepthListCell.xib */; };
+		6CBB630C2ADA78030045A4C9 /* MDFinanceCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB630A2ADA78030045A4C9 /* MDFinanceCell.swift */; };
+		6CBB630D2ADA78030045A4C9 /* MDFinanceCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6CBB630B2ADA78030045A4C9 /* MDFinanceCell.xib */; };
+		6CBB63102ADA840E0045A4C9 /* MDFinanceListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB630E2ADA840E0045A4C9 /* MDFinanceListCell.swift */; };
+		6CBB63112ADA840E0045A4C9 /* MDFinanceListCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6CBB630F2ADA840E0045A4C9 /* MDFinanceListCell.xib */; };
+		6CBB63132ADAE34E0045A4C9 /* BalloonMarker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB63122ADAE34D0045A4C9 /* BalloonMarker.swift */; };
+		6CBB63162ADAEE880045A4C9 /* MDIndicatorCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB63142ADAEE880045A4C9 /* MDIndicatorCell.swift */; };
+		6CBB63172ADAEE880045A4C9 /* MDIndicatorCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6CBB63152ADAEE880045A4C9 /* MDIndicatorCell.xib */; };
+		6CBB63192ADBD4020045A4C9 /* BarBalloonMarker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB63182ADBD4020045A4C9 /* BarBalloonMarker.swift */; };
+		6CBB631C2ADC112F0045A4C9 /* HomeOptionsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB631A2ADC112F0045A4C9 /* HomeOptionsCell.swift */; };
+		6CBB631D2ADC112F0045A4C9 /* HomeOptionsCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6CBB631B2ADC112F0045A4C9 /* HomeOptionsCell.xib */; };
+		6CBB63202ADC37280045A4C9 /* MDNewsListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB631E2ADC37280045A4C9 /* MDNewsListCell.swift */; };
+		6CBB63212ADC37280045A4C9 /* MDNewsListCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6CBB631F2ADC37280045A4C9 /* MDNewsListCell.xib */; };
 		6CBDC8F32972F352003E068F /* ScriptMessageProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBDC8F22972F352003E068F /* ScriptMessageProxy.swift */; };
 		6CBDC8F52972F443003E068F /* WKWebViewConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBDC8F42972F443003E068F /* WKWebViewConfiguration.swift */; };
 		6CBDC8F72972FB69003E068F /* BaseWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBDC8F62972FB69003E068F /* BaseWebViewController.swift */; };
@@ -1314,7 +1329,6 @@
 		6C7F446B29556B6000DC6771 /* BaseAlertView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseAlertView.swift; sourceTree = "<group>"; };
 		6C8652F429AA6E9D00A2E7FB /* TDStatisticsProfitCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TDStatisticsProfitCell.swift; sourceTree = "<group>"; };
 		6C8652F529AA6E9D00A2E7FB /* TDStatisticsProfitCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TDStatisticsProfitCell.xib; sourceTree = "<group>"; };
-		6C8652FB29AB496200A2E7FB /* BalloonMarker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BalloonMarker.swift; sourceTree = "<group>"; };
 		6C8652FD29ABB1A500A2E7FB /* TDStatisticsRecordCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TDStatisticsRecordCell.swift; sourceTree = "<group>"; };
 		6C8652FE29ABB1A500A2E7FB /* TDStatisticsRecordCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TDStatisticsRecordCell.xib; sourceTree = "<group>"; };
 		6C86530129ACF3E400A2E7FB /* TDStatisticsRecordListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TDStatisticsRecordListCell.swift; sourceTree = "<group>"; };
@@ -1397,6 +1411,22 @@
 		6CBB62F42AD83CD00045A4C9 /* MDAuoteInfoCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MDAuoteInfoCell.xib; sourceTree = "<group>"; };
 		6CBB62F72AD84E2D0045A4C9 /* MDAuoteKLinewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDAuoteKLinewCell.swift; sourceTree = "<group>"; };
 		6CBB62F82AD84E2D0045A4C9 /* MDAuoteKLinewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MDAuoteKLinewCell.xib; sourceTree = "<group>"; };
+		6CBB62FD2AD977AF0045A4C9 /* MDAuoteDepthCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDAuoteDepthCell.swift; sourceTree = "<group>"; };
+		6CBB62FE2AD977AF0045A4C9 /* MDAuoteDepthCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MDAuoteDepthCell.xib; sourceTree = "<group>"; };
+		6CBB63032AD982190045A4C9 /* MDAuoteDepthListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDAuoteDepthListCell.swift; sourceTree = "<group>"; };
+		6CBB63042AD982190045A4C9 /* MDAuoteDepthListCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MDAuoteDepthListCell.xib; sourceTree = "<group>"; };
+		6CBB630A2ADA78030045A4C9 /* MDFinanceCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDFinanceCell.swift; sourceTree = "<group>"; };
+		6CBB630B2ADA78030045A4C9 /* MDFinanceCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MDFinanceCell.xib; sourceTree = "<group>"; };
+		6CBB630E2ADA840E0045A4C9 /* MDFinanceListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDFinanceListCell.swift; sourceTree = "<group>"; };
+		6CBB630F2ADA840E0045A4C9 /* MDFinanceListCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MDFinanceListCell.xib; sourceTree = "<group>"; };
+		6CBB63122ADAE34D0045A4C9 /* BalloonMarker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BalloonMarker.swift; sourceTree = "<group>"; };
+		6CBB63142ADAEE880045A4C9 /* MDIndicatorCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDIndicatorCell.swift; sourceTree = "<group>"; };
+		6CBB63152ADAEE880045A4C9 /* MDIndicatorCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MDIndicatorCell.xib; sourceTree = "<group>"; };
+		6CBB63182ADBD4020045A4C9 /* BarBalloonMarker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BarBalloonMarker.swift; sourceTree = "<group>"; };
+		6CBB631A2ADC112F0045A4C9 /* HomeOptionsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeOptionsCell.swift; sourceTree = "<group>"; };
+		6CBB631B2ADC112F0045A4C9 /* HomeOptionsCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = HomeOptionsCell.xib; sourceTree = "<group>"; };
+		6CBB631E2ADC37280045A4C9 /* MDNewsListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDNewsListCell.swift; sourceTree = "<group>"; };
+		6CBB631F2ADC37280045A4C9 /* MDNewsListCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MDNewsListCell.xib; sourceTree = "<group>"; };
 		6CBDC8F22972F352003E068F /* ScriptMessageProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScriptMessageProxy.swift; sourceTree = "<group>"; };
 		6CBDC8F42972F443003E068F /* WKWebViewConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WKWebViewConfiguration.swift; sourceTree = "<group>"; };
 		6CBDC8F62972FB69003E068F /* BaseWebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseWebViewController.swift; sourceTree = "<group>"; };
@@ -2272,6 +2302,8 @@
 				6C6B7DA2296AF77500067FA3 /* HomeHeaderView.xib */,
 				6C6B7DA5296B06BB00067FA3 /* HomeInfoCell.swift */,
 				6C6B7DA6296B06BB00067FA3 /* HomeInfoCell.xib */,
+				6CBB631A2ADC112F0045A4C9 /* HomeOptionsCell.swift */,
+				6CBB631B2ADC112F0045A4C9 /* HomeOptionsCell.xib */,
 				6C7A1AE629F6D052004CFBE3 /* HomeMarketPopView.swift */,
 			);
 			path = V;
@@ -2684,7 +2716,6 @@
 		6C3717DC29AA52C7000DDD8B /* TalentDetails */ = {
 			isa = PBXGroup;
 			children = (
-				6C8652FB29AB496200A2E7FB /* BalloonMarker.swift */,
 				6C3717DD29AA52D8000DDD8B /* TalentDetailsView.swift */,
 				6C3717E329AA5B23000DDD8B /* TalentDetailsHeaderView.swift */,
 				6C3717E529AA5B39000DDD8B /* TalentDetailsHeaderView.xib */,
@@ -3298,6 +3329,10 @@
 				6CBB62F42AD83CD00045A4C9 /* MDAuoteInfoCell.xib */,
 				6CBB62F72AD84E2D0045A4C9 /* MDAuoteKLinewCell.swift */,
 				6CBB62F82AD84E2D0045A4C9 /* MDAuoteKLinewCell.xib */,
+				6CBB62FD2AD977AF0045A4C9 /* MDAuoteDepthCell.swift */,
+				6CBB62FE2AD977AF0045A4C9 /* MDAuoteDepthCell.xib */,
+				6CBB63032AD982190045A4C9 /* MDAuoteDepthListCell.swift */,
+				6CBB63042AD982190045A4C9 /* MDAuoteDepthListCell.xib */,
 			);
 			path = MDAuoteView;
 			sourceTree = "<group>";
@@ -3305,7 +3340,15 @@
 		6CBB62EE2AD83BDE0045A4C9 /* MDFinanceView */ = {
 			isa = PBXGroup;
 			children = (
+				6CBB63182ADBD4020045A4C9 /* BarBalloonMarker.swift */,
+				6CBB63122ADAE34D0045A4C9 /* BalloonMarker.swift */,
 				6CBB62D62AD828170045A4C9 /* MDFinanceView.swift */,
+				6CBB630A2ADA78030045A4C9 /* MDFinanceCell.swift */,
+				6CBB630B2ADA78030045A4C9 /* MDFinanceCell.xib */,
+				6CBB630E2ADA840E0045A4C9 /* MDFinanceListCell.swift */,
+				6CBB630F2ADA840E0045A4C9 /* MDFinanceListCell.xib */,
+				6CBB63142ADAEE880045A4C9 /* MDIndicatorCell.swift */,
+				6CBB63152ADAEE880045A4C9 /* MDIndicatorCell.xib */,
 			);
 			path = MDFinanceView;
 			sourceTree = "<group>";
@@ -3322,6 +3365,8 @@
 			isa = PBXGroup;
 			children = (
 				6CBB62DA2AD828550045A4C9 /* MDNewsView.swift */,
+				6CBB631E2ADC37280045A4C9 /* MDNewsListCell.swift */,
+				6CBB631F2ADC37280045A4C9 /* MDNewsListCell.xib */,
 			);
 			path = MDNewsView;
 			sourceTree = "<group>";
@@ -3740,6 +3785,7 @@
 				6C50AB692A0934EE00699557 /* AFiatDepositsVerifyViewController.xib in Resources */,
 				6C2FFCC3296182E3005B8180 /* FreezeAccountCell.xib in Resources */,
 				6CA7130C2956F2E30047F450 /* MineHeaderViewCell.xib in Resources */,
+				6CBB63172ADAEE880045A4C9 /* MDIndicatorCell.xib in Resources */,
 				6C4AFB0C29A1035E00508EA7 /* HoldAccountInfoCell.xib in Resources */,
 				6CD200B829E709A600F0966D /* ASavingsDetailsScreenPopView.xib in Resources */,
 				6CBB62D32AD820130045A4C9 /* MarketDetailNavView.xib in Resources */,
@@ -3823,11 +3869,13 @@
 				6C10F10029DB08D900B79491 /* updateAPP014.png in Resources */,
 				6C86531229B47ED000A2E7FB /* TDOrderListCell.xib in Resources */,
 				6CC37FFB299286700079FA5C /* AssetsSavingHeaderView.xib in Resources */,
+				6CBB63212ADC37280045A4C9 /* MDNewsListCell.xib in Resources */,
 				6C0C499C295DDD86000BFEEB /* ChangePasswordCell.xib in Resources */,
 				6CBB62F62AD83CD00045A4C9 /* MDAuoteInfoCell.xib in Resources */,
 				6C10F11B29E1C02700B79491 /* AFinanceRedemptionViewController.xib in Resources */,
 				6CC380032992B8A80079FA5C /* AssetsDealCell.xib in Resources */,
 				6C7A1AEB29F80797004CFBE3 /* CreditsViewController.xib in Resources */,
+				6CBB63062AD982190045A4C9 /* MDAuoteDepthListCell.xib in Resources */,
 				6C10F0E729DB08D900B79491 /* updateAPP090.png in Resources */,
 				6CA7133E29587BE10047F450 /* CountrySelectCell.xib in Resources */,
 				6CDC5B0C29CFE63E00E60730 /* FiatDepositsRecordCell.xib in Resources */,
@@ -3855,12 +3903,14 @@
 				6CD200AB29E6E4B500F0966D /* ASavingsDetailsViewController.xib in Resources */,
 				6C4AFB2D29A2744200508EA7 /* AssetsHistoryHeaderView.xib in Resources */,
 				6C10F0E129DB08D900B79491 /* updateAPP044.png in Resources */,
+				6CBB630D2ADA78030045A4C9 /* MDFinanceCell.xib in Resources */,
 				6C2EAD8429E31F8700E03AF8 /* ApplySharesViewController.xib in Resources */,
 				6C10F10B29E1638400B79491 /* FeedbackViewController.xib in Resources */,
 				6CD5EB7029D863580053325F /* GuideViewController.xib in Resources */,
 				6CC3B6472A192D6000D77D03 /* CopyingSetViewController.xib in Resources */,
 				6C35369B2982C8BF003BB632 /* DealTopCell.xib in Resources */,
 				6CDC5AFF29CE127900E60730 /* TransferHistoryListCell.xib in Resources */,
+				6CBB631D2ADC112F0045A4C9 /* HomeOptionsCell.xib in Resources */,
 				6C10F0EC29DB08D900B79491 /* updateAPP116.png in Resources */,
 				6C10F0FA29DB08D900B79491 /* updateAPP072.png in Resources */,
 				6C4AFB1C29A21AD500508EA7 /* PHistoryHeaderView.xib in Resources */,
@@ -3876,6 +3926,7 @@
 				6CC8023729953D2200C36373 /* ASelectCurrencyCell.xib in Resources */,
 				6C10F0DD29DB08D900B79491 /* updateAPP040.png in Resources */,
 				6C7A1AD229F2D5C0004CFBE3 /* AssetsDealSetDefaultPopView.xib in Resources */,
+				6CBB63112ADA840E0045A4C9 /* MDFinanceListCell.xib in Resources */,
 				6C4AFAD0299BBDD000508EA7 /* ATransferViewController.xib in Resources */,
 				6C10F0EE29DB08D900B79491 /* updateAPP062.png in Resources */,
 				6C4AFB1829A1414C00508EA7 /* HoldModificationPopView.xib in Resources */,
@@ -3915,6 +3966,7 @@
 				6CDC5AFB29CDFBFD00E60730 /* FlashHistoryRecordCell.xib in Resources */,
 				6C10F0D629DB08D900B79491 /* updateAPP042.png in Resources */,
 				6C00A9482432F1A500CE9ADB /* CodeScan.bundle in Resources */,
+				6CBB63002AD977AF0045A4C9 /* MDAuoteDepthCell.xib in Resources */,
 				6C10F0E529DB08D900B79491 /* updateAPP092.png in Resources */,
 				6CBB62FA2AD84E2D0045A4C9 /* MDAuoteKLinewCell.xib in Resources */,
 				6C10F0D929DB08D900B79491 /* updateAPP080.png in Resources */,
@@ -4106,6 +4158,7 @@
 				04CEE29E2ABBD80900FAA760 /* JDExchangeRecordCell.swift in Sources */,
 				04CEE2772AB5CA8600FAA760 /* MarketCompanyModel.swift in Sources */,
 				6CDC5AF629CCA18100E60730 /* AFiatDepositsPayWayCell.swift in Sources */,
+				6CBB63102ADA840E0045A4C9 /* MDFinanceListCell.swift in Sources */,
 				041D4EFA2AC2AB6C008ABDF7 /* JDAFiatExchangeViewController.swift in Sources */,
 				6C00A900242D918D00CE9ADB /* UITextField+CategoryClass.swift in Sources */,
 				6C0C4995295DDC91000BFEEB /* ChangePasswordViewModel.swift in Sources */,
@@ -4128,6 +4181,7 @@
 				6C4AFACA299AA16000508EA7 /* WithdrawalsRemarkPopView.swift in Sources */,
 				6C4AFB4129A8FC3A00508EA7 /* DealTalentViewController.swift in Sources */,
 				04C2831A2AD67E3400FC04AC /* JDMineInvitePosterViewController.swift in Sources */,
+				6CBB62FF2AD977AF0045A4C9 /* MDAuoteDepthCell.swift in Sources */,
 				04D38ECB2AB2AEE50047EF9C /* JDKLineFooterView.swift in Sources */,
 				6C8652F629AA6E9D00A2E7FB /* TDStatisticsProfitCell.swift in Sources */,
 				6C4AFB5029AA1F1100508EA7 /* MyCopyingViewController.swift in Sources */,
@@ -4187,6 +4241,7 @@
 				6C00A9B12434A18B00CE9ADB /* UIScrollView+Empty.swift in Sources */,
 				6C00A919242D918D00CE9ADB /* BaseViewController.swift in Sources */,
 				6C4AFB5329AA21CB00508EA7 /* MyCopyingView.swift in Sources */,
+				6CBB63132ADAE34E0045A4C9 /* BalloonMarker.swift in Sources */,
 				6C00A8F9242D918D00CE9ADB /* ESTabBar.swift in Sources */,
 				6CC37FE8298FB0750079FA5C /* AssetsProxyView.swift in Sources */,
 				04D38E962AA1CE8B0047EF9C /* MarketGeneralSituationViewController.swift in Sources */,
@@ -4204,6 +4259,7 @@
 				6C4AFAF2299FE37300508EA7 /* APaymentMethodCell.swift in Sources */,
 				04D38EA32AA804080047EF9C /* ShareholderInfoCell.swift in Sources */,
 				6C00A9892433313300CE9ADB /* HXImageClipViewController.swift in Sources */,
+				6CBB630C2ADA78030045A4C9 /* MDFinanceCell.swift in Sources */,
 				6C00A877242D8FEA00CE9ADB /* AppDelegate.swift in Sources */,
 				6CBB62DB2AD828550045A4C9 /* MDNewsView.swift in Sources */,
 				04CEE2B82ABD3ACA00FAA760 /* JDWorkOrderDetailViewController.swift in Sources */,
@@ -4216,7 +4272,6 @@
 				6CDC5B0229CF140500E60730 /* AHistoryDetailsViewController.swift in Sources */,
 				6C00A905242D918D00CE9ADB /* UITableView+CategoryClass.swift in Sources */,
 				04D38E922AA1C82F0047EF9C /* MarketAnnouncementViewController.swift in Sources */,
-				6C8652FC29AB496200A2E7FB /* BalloonMarker.swift in Sources */,
 				6C00A9952433313300CE9ADB /* HXImageToolView.swift in Sources */,
 				6CD5EB6429D5C6A40053325F /* FundsRecordCell.swift in Sources */,
 				6CDC5B1529D0814E00E60730 /* AssetsProxyHeaderView.swift in Sources */,
@@ -4261,8 +4316,10 @@
 				6CC37FCD298F79CF0079FA5C /* DealChangeOrderPopView.swift in Sources */,
 				041D4F1C2AD28DF6008ABDF7 /* JDHistoryDateSegmentView.swift in Sources */,
 				04CEE2B42ABD323200FAA760 /* InformationFlashViewController.swift in Sources */,
+				6CBB63202ADC37280045A4C9 /* MDNewsListCell.swift in Sources */,
 				6C00A9992433313300CE9ADB /* HXReuseable.swift in Sources */,
 				6C4AFACF299BBDD000508EA7 /* ATransferViewController.swift in Sources */,
+				6CBB631C2ADC112F0045A4C9 /* HomeOptionsCell.swift in Sources */,
 				04D38E702A9EE8A10047EF9C /* JXSegmentedDotCell.swift in Sources */,
 				04D38E742A9EE8A10047EF9C /* JXSegmentedTitleImageItemModel.swift in Sources */,
 				6CBDC8F32972F352003E068F /* ScriptMessageProxy.swift in Sources */,
@@ -4343,6 +4400,7 @@
 				04CEE29A2ABBCE7B00FAA760 /* JDDepositRecordsViewController.swift in Sources */,
 				04CEE2942ABAD46400FAA760 /* JDAFiatWithdrawViewController.swift in Sources */,
 				6C4AFAD3299D165E00508EA7 /* AFiatDepositsViewController.swift in Sources */,
+				6CBB63192ADBD4020045A4C9 /* BarBalloonMarker.swift in Sources */,
 				04D38E752A9EE8A10047EF9C /* JXSegmentedTitleImageDataSource.swift in Sources */,
 				6C031B162962B2560043BECF /* KMenuPopupMenuView.swift in Sources */,
 				6C00A916242D918D00CE9ADB /* Network.swift in Sources */,
@@ -4357,6 +4415,7 @@
 				6CA7131529572CBC0047F450 /* LoginViewController.swift in Sources */,
 				6C00A915242D918D00CE9ADB /* PublicMethod.swift in Sources */,
 				6CA7131A29572DD70047F450 /* LoginView.swift in Sources */,
+				6CBB63162ADAEE880045A4C9 /* MDIndicatorCell.swift in Sources */,
 				04CEE2AC2ABC3B6100FAA760 /* JDWorkOrderListViewController.swift in Sources */,
 				041D4EEE2AC155F1008ABDF7 /* JDDealViewController.swift in Sources */,
 				04B46A912AD7D3BC00421177 /* JDMineModifyGenderViewController.swift in Sources */,
@@ -4421,6 +4480,7 @@
 				04D38E662A9EE8A10047EF9C /* JXSegmentedIndicatorBaseView.swift in Sources */,
 				04D38E802A9EE8A10047EF9C /* JXSegmentedRTLLayout.swift in Sources */,
 				6C00A98F2433313300CE9ADB /* HXImageCell.swift in Sources */,
+				6CBB63052AD982190045A4C9 /* MDAuoteDepthListCell.swift in Sources */,
 				6C00A8FC242D918D00CE9ADB /* ExampleBasicContentView.swift in Sources */,
 				6CD54793297064BF00373723 /* OperationalSymbolSocketManager.swift in Sources */,
 				6C6B7DAA296B19C600067FA3 /* BaseListCurrencyHeaderView.swift in Sources */,

+ 85 - 41
Koala/Koala/FX/Macro/PublicMethod.swift

@@ -10,7 +10,7 @@ import Foundation
 import UIKit
 
 func MyString(_ format : String , _ arguments: CVarArg...) -> String {
-    return String.init(format: format, arguments) 
+    return String.init(format: format, arguments)
 }
 //处理数据
 public func handleDic(myData:Any) ->Any
@@ -402,7 +402,7 @@ func dateToString(stmap:String, formatter:String = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZ
     let timeInterval:TimeInterval = TimeInterval(timeStr)  //TimeInterval(timeStamp)
     let date = Date(timeIntervalSince1970: timeInterval)
     let dateformatter = DateFormatter()
- 
+    
     dateformatter.dateFormat = formatter//自定义日期格式
     dateformatter.timeZone = TimeZone(abbreviation: "UTC")
     return dateformatter.string(from: date)
@@ -430,7 +430,7 @@ func timeStrChangeToTimeInterval(time:String,fmatter:String = "yyyy-MM-dd'T'HH:m
 //精度限制
 //精度限制
 func precisionString(with number:String, precision: String , isRound: Bool = false) -> String {
-   
+    
     guard isPurnFloat(string: number) && isPurnFloat(string: precision) else {
         return number
     }
@@ -438,9 +438,9 @@ func precisionString(with number:String, precision: String , isRound: Bool = fal
     guard conerData(precision, .MyInt).0! >= 0 else {
         return number
     }
-//    Dlog("precision:"+precision)
-//    Dlog("str:"+number)
-   
+    //    Dlog("precision:"+precision)
+    //    Dlog("str:"+number)
+    
     
     let decNumber = NSDecimalNumber.init(string: number)
     //Dlog("decN:"+"\(decNumber)")
@@ -471,27 +471,27 @@ func precisionString(with number:String, precision: String , isRound: Bool = fal
     //Dlog("formatter:"+formatter.string(from: dNumber)!)
     return formatter.string(from: dNumber)!
     
-//    let decNumber:NSDecimalNumber = NSDecimalNumber.init(string: number)
-//    Dlog("decN:"+"\(decNumber)")
-//    var floatNumber = decNumber.doubleValue
-//    Dlog("double:"+"\(floatNumber)")
-//    floatNumber += 0.00000000099
-//    _ = CFAbsoluteTimeGetCurrent()
-//    let fact = pow(Double(10), Double(precision)!)
-//    var result: Double = 0.0
-//    if isRound {
-//        result = round(fact * floatNumber) / fact
-//    }else{
-//        if floatNumber > 0 {
-//            result = floor(fact * floatNumber) / fact
-//        }else{
-//            result = ceil(fact * floatNumber) / fact
-//        }
-//    }
-//    let proString = String.init(format: "%%.%@f", precision)
-//    let resultString = String.init(format: proString, result)
-//    _ = CFAbsoluteTimeGetCurrent()
-//    return resultString
+    //    let decNumber:NSDecimalNumber = NSDecimalNumber.init(string: number)
+    //    Dlog("decN:"+"\(decNumber)")
+    //    var floatNumber = decNumber.doubleValue
+    //    Dlog("double:"+"\(floatNumber)")
+    //    floatNumber += 0.00000000099
+    //    _ = CFAbsoluteTimeGetCurrent()
+    //    let fact = pow(Double(10), Double(precision)!)
+    //    var result: Double = 0.0
+    //    if isRound {
+    //        result = round(fact * floatNumber) / fact
+    //    }else{
+    //        if floatNumber > 0 {
+    //            result = floor(fact * floatNumber) / fact
+    //        }else{
+    //            result = ceil(fact * floatNumber) / fact
+    //        }
+    //    }
+    //    let proString = String.init(format: "%%.%@f", precision)
+    //    let resultString = String.init(format: proString, result)
+    //    _ = CFAbsoluteTimeGetCurrent()
+    //    return resultString
 }
 
 //获取字符串数据精度
@@ -656,7 +656,7 @@ func exchangeColorAndImage(increase:Float,imageUp:UIImage = UIImage(),imageDown:
     
 }
 
- func randomKey() throws -> String {
+func randomKey() throws -> String {
     var bytes = [Int8](repeating: 0, count: 32)
     let status = SecRandomCopyBytes(kSecRandomDefault, bytes.count, &bytes)
     if status == errSecSuccess {
@@ -686,7 +686,7 @@ func decimalNumber(A:String,B:String,type:OperationType,scale:String = "-1",mode
     
     let oneNum = NSDecimalNumber.init(string: A)
     let twoNum = NSDecimalNumber.init(string: B)
-
+    
     if type == .Add {
         return String(format: "%@", oneNum.adding(twoNum, withBehavior: hendler))
     }
@@ -710,10 +710,10 @@ func gettExchangeRateModel(title:String = SaveData.shared().getExchangeRate(),sy
     if arr.count == 0 {
         return ExchangeRateModel()
     }
-
+    
     for dict in arr {
         let dic:NSDictionary = dict as! NSDictionary
-       
+        
         if symbol.length > 0 {
             let symbolStr:String = dic["symbol"] as! String
             if symbol == symbolStr{
@@ -727,7 +727,7 @@ func gettExchangeRateModel(title:String = SaveData.shared().getExchangeRate(),sy
                 return model!
             }
         }
-       
+        
     }
     return ExchangeRateModel()
 }
@@ -870,7 +870,7 @@ func strToDate(str:String,dateFormat:String = "yyyy-MM-dd HH:mm")->String {
     df.dateFormat = dateFormat
     if let date = df.date(from: str) {
         let timeInterval:TimeInterval = date.timeIntervalSince1970
-      
+        
         return String(format: "%.0f", timeInterval)
     }
     return "0"
@@ -895,14 +895,14 @@ func getGetini(_ id:Int) -> GetiniModel{
 func getDefaultAccount() -> AccountInfoModel{
     if let list:[NSDictionary] = SaveData.shared().getAccountList() as? [NSDictionary]{
         for dic in list {
-           let model = AccountInfoModel.deserialize(from: dic)!
+            let model = AccountInfoModel.deserialize(from: dic)!
             model.defaultAccount = conerData(String(format: "%@",dic["default"] as! CVarArg), .MyInt).0!
             if model.defaultAccount == 1 {
                 return model
             }
         }
     }
-
+    
     return AccountInfoModel()
 }
 
@@ -910,7 +910,7 @@ func getSymbolList() -> [KSymbolModel]{
     if let list:[NSDictionary] = SaveData.shared().getSymbolList() as? [NSDictionary]{
         var arr = [KSymbolModel]()
         for dic in list {
-           let model = KSymbolModel.deserialize(from: dic)!
+            let model = KSymbolModel.deserialize(from: dic)!
             if model.visible == 1{
                 var ask = model.ask
                 if conerData(ask, .MyDouble).2! == 0{
@@ -922,11 +922,11 @@ func getSymbolList() -> [KSymbolModel]{
                 model.increase = String(format: "%.2f",increase)
                 arr.append(model)
             }
-           
+            
         }
         return arr
     }
-
+    
     return [KSymbolModel]()
 }
 
@@ -945,14 +945,14 @@ func getAssetsSavingsOrder(list:[WalletListModel]) -> [WalletListModel] {
             }
         }
     }
-   
+    
     return listData
 }
 
 func getAssetsDealOrder(list:[AccountInfoModel]) -> [AccountInfoModel] {
     let arr = ["3","1","2"]
     var listData = [AccountInfoModel]()
-  
+    
     for str in arr{
         for model in list{
             if model.type == str{
@@ -960,11 +960,55 @@ func getAssetsDealOrder(list:[AccountInfoModel]) -> [AccountInfoModel] {
             }
         }
     }
-   
+    
     return listData
 }
 
 
+//单位换算
+func conversionUnit(number:String,precision:String = "2",isRound:Bool = true ) -> String {
+    let num = conerData(number, .MyDouble).2!
+    if num >= 1000000000000{
+        return precisionString(with: String(num/1000000000000), precision: precision,isRound: isRound)+" T"
+    }
+    else if num >= 1000000000 {
+        return precisionString(with: String(num/1000000000), precision: precision,isRound: isRound)+" B"
+    }else if num >= 1000000 {
+        return precisionString(with: String(num/1000000), precision: precision,isRound: isRound)+" M"
+    }else if num >= 1000{
+        return precisionString(with: String(num/1000), precision: precision,isRound: isRound)+" K"
+    }else if num <= 1000000000000{
+        return precisionString(with: String(num/1000000000000), precision: precision,isRound: isRound)+" T"
+    }else if num <= -1000000000{
+        return precisionString(with: String(num/1000000000), precision: precision,isRound: isRound)+" B"
+    }else if num <= -1000000{
+        return precisionString(with: String(num/1000000), precision: precision,isRound: isRound)+" M"
+    }else if num <= -1000{
+        return precisionString(with: String(num/1000), precision: precision,isRound: isRound)+" K"
+    }else{
+        return precisionString(with: String(num), precision: precision,isRound: isRound)
+    }
+}
+
+
+func sharePopShow(url:String = "https://www.jiduzq.com"){
+    //准备分享内容,文本图片链接
+    let items:[Any] = [switchLanguage("极度"),_image("Base_Share&Base_Share"),
+                       URL(string: url) as Any]
+    //新建自定义的分享对象数组
+    
+    //根据分享内容和自定义的分享按钮调用分享视图
+    let actView:UIActivityViewController =
+    UIActivityViewController(activityItems: items, applicationActivities: nil)
+    //要排除的分享按钮,不显示在分享框里
+    //actView.excludedActivityTypes = [.mail,.copyToPasteboard,.print,.assignToContact,.saveToCameraRoll]
+    //显示分享视图
+    currentVc()?.navigationController?.present(actView, animated:true, completion:nil)
+}
+
+
+
+
 
 
 

+ 1 - 1
Koala/Koala/FX/NetClass/Network.swift

@@ -143,7 +143,7 @@ extension NetWork {
                     let json = JSON.init(response.data!)
                     Dlog("获取到的数据😇😇😇😇😇😇😇😇\(json)")
                    
-                    
+                
                     var errno = json["return_code"].intValue
                     let status = json["status"].intValue
                     let code = json["code"].intValue

+ 12 - 2
Koala/Koala/FX/NetClass/URLS.swift

@@ -24,7 +24,7 @@ import Foundation
 //let HELPCENTER = "https://vcecology.zendesk.com/hc/zh-cn/categories/360002869993-%E5%B8%AE%E5%8A%A9%E4%B8%AD%E5%BF%83"
 //
 
-let baseDomain = "https://api.jiduzq.com/"
+let baseDomain = "https://api.jdnx.com/"
 let basePF = "https://info.jiduzq.com/"
 let baseWSUrl = "wss://stream.jiduzq.com"
 let baseFilePath = "https://upload.jiduzq.com/"
@@ -211,8 +211,13 @@ let netUpdateSubscribe    = "Public/updateSubscribe"    //修改报价订阅 参
 
 let netForGetOptionProductListGroup = "Public/getOptionProductListGroup"//期权列表
 
-/* ********************* 极度 **********************/
+let netForGetOptionProductList = "Public/getOptionProductList"//期权列表
+
+let netForGetPriceDepth = "Public/getPriceDepth"//深度
+
+
 
+/* ********************* 极度 **********************/
 let jd_netForNewsList = basePF + "v1/news"
 let jd_netForNewsDetail = basePF + "v1/newsDetail"
 let jd_netForNoticeList = basePF + "v1/notice"
@@ -220,6 +225,11 @@ let jd_netForTradesMarketList = "Public/getTradesMarketList"    //JD 获取产
 let jd_netForCompanyInfo    = basePF + "v1/company"      //公司信息
 let jd_netForStructList     = basePF + "v1/struct"      //股东变动
 let jd_netForMajorList   = basePF + "v1/major"      //主要股东
+let jd_netForFinance   = basePF + "v1/finance"      //财务
+let jd_netForIndicator  = basePF + "v1/indicator"      //财务
+
 
 let jd_newForGetWorkOrderList = "getWorkOrderList"      //工单列表
 let jd_netForInsertWorkOrder = "insertWorkOrder"        //创建工单
+
+

+ 1 - 1
Koala/Koala/FX/OpretationalDataClass/OperationalNetworkData.swift

@@ -64,7 +64,7 @@ public class OperationalNetworkData: NSObject
             }
             
         }) { (code, result) in
-            ProgressHUD.showError(status: result as! String)
+           // ProgressHUD.showError(status: result as! String)
         }
         
     }

+ 162 - 0
Koala/Koala/Modular/Home/V/HomeOptionsCell.swift

@@ -0,0 +1,162 @@
+//
+//  HomeOptionsCell.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/15.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class HomeOptionsCell: BaseTableViewCell {
+    @IBOutlet weak var bgView: UIView!
+    
+    @IBOutlet weak var imgView: UIImageView!
+    @IBOutlet weak var titleLab: UILabel!
+    @IBOutlet weak var moreBtn: UIButton!
+    
+    @IBOutlet weak var lab1: UILabel!
+    @IBOutlet weak var lab2: UILabel!
+    @IBOutlet weak var lab3: UILabel!
+    @IBOutlet weak var lab4: UILabel!
+    
+    @IBOutlet weak var lineView: UIView!
+    @IBOutlet weak var tableView: UITableView!
+    
+    @IBOutlet weak var more1Btn: UIButton!
+    
+    var listData:[OptionsListModel] = [OptionsListModel]()
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+       
+        self.backgroundColor = .clear
+        
+        self.bgView.backgroundColor = ALLBackGroundColor
+        self.bgView.setViewLayerBorderColor(myColor: ViewBorderColor, borderWidth: 1, maskBounds: 4)
+        
+        self.titleLab.setTextFont(.PFSM, 16)
+        
+        self.moreBtn.setTextFont(.PFSR, 14)
+        
+        self.lab1.setTextFont(.PFSR, 12)
+        self.lab2.setTextFont(.PFSR, 12)
+        self.lab3.setTextFont(.PFSR, 12)
+        self.lab4.setTextFont(.PFSR, 12)
+        
+        self.more1Btn.setTextFont(.PFSR, 14)
+        self.moreBtn.addTarget(self, action: #selector(clickMoreBtnAction), for: .touchUpInside)
+        self.more1Btn.addTarget(self, action: #selector(clickMoreBtnAction), for: .touchUpInside)
+        
+        self.tableView.delegate = self
+        self.tableView.dataSource = self
+        tableView.separatorStyle = .singleLine
+        tableView.separatorInset = UIEdgeInsets(top: 0, left: 15, bottom: 0, right: 15)
+        tableView.separatorColor = ViewBorderColor
+        tableView.backgroundColor = .clear
+        tableView.tableFooterView = UIView()
+        tableView.tableHeaderView = UIView()
+        tableView.showsVerticalScrollIndicator = false
+        tableView.showsVerticalScrollIndicator = false
+        tableView.register(UINib.init(nibName: "MarketOptionsListCell", bundle: nil), forCellReuseIdentifier: "MarketOptionsListCell")
+       
+        
+        mySwitchLanguage()
+        mySwitchColor()
+    }
+    
+    override func mySwitchLanguage() {
+        self.titleLab.text = switchLanguage("个人期权")
+        self.moreBtn.setTitle(switchLanguage("更多 >"), for: .normal)
+        
+        self.lab1.text = switchLanguage("标的")
+        self.lab2.text = switchLanguage("费率(1M)")
+        self.lab3.text = switchLanguage("名义本金")
+        self.lab4.text = switchLanguage("期权费")
+        
+        self.more1Btn.setTitle(switchLanguage("更多报价 >>"), for: .normal)
+        
+        
+    }
+    
+    override func mySwitchColor() {
+        self.titleLab.textColor = TitleTextColor
+        self.moreBtn.setTitleColor(MidTextColor, for: .normal)
+        self.lab1.textColor = MidTextColor
+        self.lab2.textColor = MidTextColor
+        self.lab3.textColor = MidTextColor
+        self.lab4.textColor = MidTextColor
+        
+        self.more1Btn.setTitleColor(MainBackGroundColor, for: .normal)
+        
+        self.imgView.image = _image("Home_W_Hot&Home_W_Hot")
+        
+        self.lineView.backgroundColor = ViewBorderColor
+        
+    }
+
+    override func setSelected(_ selected: Bool, animated: Bool) {
+        super.setSelected(selected, animated: animated)
+
+        // Configure the view for the selected state
+    }
+    
+    func updateCellWith(list:[OptionsListModel]) -> Void {
+        self.listData = list
+        self.tableView.reloadData()
+    }
+    
+    @objc func clickMoreBtnAction(){
+        MarketIndex = 2
+        currentVc()?.tabBarController?.selectedIndex = TabbarMarketIndex
+    }
+    
+}
+
+//代理
+extension HomeOptionsCell: UITableViewDelegate,UITableViewDataSource{
+    func numberOfSections(in tableView: UITableView) -> Int {
+        return 1
+    }
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        return self.listData.count
+    }
+    
+    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+        let cell:MarketOptionsListCell = tableView.dequeueReusableCell(withIdentifier: "MarketOptionsListCell") as! MarketOptionsListCell
+        let model = self.listData[indexPath.row]
+        cell.updateHomeCellWith(model: model)
+        return cell
+    }
+    
+    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
+        return UIView()
+    }
+    
+    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
+        return UIView()
+    }
+    
+    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
+        return 60
+    }
+    
+    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 vc:MarketDetailViewController = MarketDetailViewController()
+        let model = self.listData[indexPath.row]
+        vc.symbolCode = model.code
+        vc.index = 4
+        currentVc()?.navigationController?.pushViewController(vc, animated: true)
+    }
+    
+}
+
+

+ 196 - 0
Koala/Koala/Modular/Home/V/HomeOptionsCell.xib

@@ -0,0 +1,196 @@
+<?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"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="329" id="KGk-i7-Jjw" customClass="HomeOptionsCell" customModule="Koala" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="429" height="329"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" ambiguous="YES" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
+                <rect key="frame" x="0.0" y="0.0" width="429" height="329"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="y6Y-Bs-egr">
+                        <rect key="frame" x="10" y="5" width="409" height="268"/>
+                        <subviews>
+                            <stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="U8M-mN-bcr">
+                                <rect key="frame" x="0.0" y="0.0" width="409" height="268"/>
+                                <subviews>
+                                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="EM4-6i-rgZ">
+                                        <rect key="frame" x="0.0" y="0.0" width="409" height="40"/>
+                                        <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="8TI-X1-ndH">
+                                                <rect key="frame" x="15.000000000000004" y="0.0" width="41.333333333333343" height="40"/>
+                                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                <nil key="textColor"/>
+                                                <nil key="highlightedColor"/>
+                                            </label>
+                                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8KF-Ke-Z7i">
+                                                <rect key="frame" x="364" y="0.0" width="30" height="40"/>
+                                                <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="8TI-X1-ndH" firstAttribute="top" secondItem="EM4-6i-rgZ" secondAttribute="top" id="Csm-WE-F06"/>
+                                            <constraint firstAttribute="height" constant="40" id="N4S-1l-tCQ"/>
+                                            <constraint firstAttribute="bottom" secondItem="8KF-Ke-Z7i" secondAttribute="bottom" id="N80-Im-YtA"/>
+                                            <constraint firstAttribute="trailing" secondItem="8KF-Ke-Z7i" secondAttribute="trailing" constant="15" id="gRf-hf-n5R"/>
+                                            <constraint firstItem="8TI-X1-ndH" firstAttribute="leading" secondItem="EM4-6i-rgZ" secondAttribute="leading" constant="15" id="lus-kR-czZ"/>
+                                            <constraint firstAttribute="bottom" secondItem="8TI-X1-ndH" secondAttribute="bottom" id="p1N-oI-8iK"/>
+                                            <constraint firstItem="8KF-Ke-Z7i" firstAttribute="top" secondItem="EM4-6i-rgZ" secondAttribute="top" id="ugl-Tc-ypK"/>
+                                        </constraints>
+                                    </view>
+                                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DLh-Il-BFu">
+                                        <rect key="frame" x="0.0" y="40" width="409" height="30"/>
+                                        <subviews>
+                                            <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="J6f-PN-eU5">
+                                                <rect key="frame" x="15" y="0.0" width="379" height="30"/>
+                                                <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="0Cm-f4-gQ9">
+                                                        <rect key="frame" x="0.0" y="0.0" width="139" height="30"/>
+                                                        <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="rav-Cu-2z8">
+                                                        <rect key="frame" x="139" y="0.0" width="80" height="30"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="width" constant="80" id="28h-tG-3OX"/>
+                                                        </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="jCg-CN-bPF">
+                                                        <rect key="frame" x="219" y="0.0" width="80" height="30"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="width" constant="80" id="PDq-rt-4Ap"/>
+                                                        </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="u8D-5v-2bR">
+                                                        <rect key="frame" x="299" y="0.0" width="80" height="30"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="width" constant="80" id="WML-W8-IdW"/>
+                                                        </constraints>
+                                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                        <nil key="textColor"/>
+                                                        <nil key="highlightedColor"/>
+                                                    </label>
+                                                </subviews>
+                                            </stackView>
+                                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Tpo-9y-1q7">
+                                                <rect key="frame" x="15" y="29" width="379" height="1"/>
+                                                <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="1" id="3om-O1-o3J"/>
+                                                </constraints>
+                                            </view>
+                                        </subviews>
+                                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                        <constraints>
+                                            <constraint firstAttribute="bottom" secondItem="J6f-PN-eU5" secondAttribute="bottom" id="FOi-2l-3eE"/>
+                                            <constraint firstAttribute="bottom" secondItem="Tpo-9y-1q7" secondAttribute="bottom" id="Zbx-50-cKg"/>
+                                            <constraint firstAttribute="trailing" secondItem="Tpo-9y-1q7" secondAttribute="trailing" constant="15" id="e36-3g-udJ"/>
+                                            <constraint firstItem="J6f-PN-eU5" firstAttribute="top" secondItem="DLh-Il-BFu" secondAttribute="top" id="eQB-aj-1CW"/>
+                                            <constraint firstAttribute="height" constant="30" id="iGS-lI-Jsn"/>
+                                            <constraint firstItem="Tpo-9y-1q7" firstAttribute="leading" secondItem="DLh-Il-BFu" secondAttribute="leading" constant="15" id="oO6-Xd-iMu"/>
+                                            <constraint firstItem="J6f-PN-eU5" firstAttribute="leading" secondItem="DLh-Il-BFu" secondAttribute="leading" constant="15" id="pNz-uE-dzz"/>
+                                            <constraint firstAttribute="trailing" secondItem="J6f-PN-eU5" secondAttribute="trailing" constant="15" id="pat-Ll-ilP"/>
+                                        </constraints>
+                                    </view>
+                                    <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="DBq-oa-PpC">
+                                        <rect key="frame" x="0.0" y="70" width="409" height="158"/>
+                                        <subviews>
+                                            <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="mxy-RH-Ojg">
+                                                <rect key="frame" x="0.0" y="0.0" width="409" height="180"/>
+                                                <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="180" id="9Jg-a6-M9a"/>
+                                                </constraints>
+                                            </tableView>
+                                        </subviews>
+                                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                        <constraints>
+                                            <constraint firstAttribute="trailing" secondItem="mxy-RH-Ojg" secondAttribute="trailing" id="2tL-Th-6J8"/>
+                                            <constraint firstAttribute="bottom" secondItem="mxy-RH-Ojg" secondAttribute="bottom" id="8Yi-lJ-bML"/>
+                                            <constraint firstItem="mxy-RH-Ojg" firstAttribute="top" secondItem="DBq-oa-PpC" secondAttribute="top" id="KYl-Dp-z2W"/>
+                                            <constraint firstItem="mxy-RH-Ojg" firstAttribute="leading" secondItem="DBq-oa-PpC" secondAttribute="leading" id="eES-Qp-AyH"/>
+                                        </constraints>
+                                    </view>
+                                    <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="zFb-3J-ZRx">
+                                        <rect key="frame" x="0.0" y="228" width="409" height="40"/>
+                                        <subviews>
+                                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Sab-fs-7op">
+                                                <rect key="frame" x="189.66666666666666" y="0.0" width="30" height="40"/>
+                                                <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="Sab-fs-7op" firstAttribute="centerY" secondItem="zFb-3J-ZRx" secondAttribute="centerY" id="1c5-Xp-nTW"/>
+                                            <constraint firstAttribute="height" constant="40" id="AN3-fr-Ve8"/>
+                                            <constraint firstItem="Sab-fs-7op" firstAttribute="top" secondItem="zFb-3J-ZRx" secondAttribute="top" id="pUf-3i-yNP"/>
+                                            <constraint firstItem="Sab-fs-7op" firstAttribute="centerX" secondItem="zFb-3J-ZRx" secondAttribute="centerX" id="uqK-Xl-kb5"/>
+                                        </constraints>
+                                    </view>
+                                </subviews>
+                            </stackView>
+                        </subviews>
+                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                        <constraints>
+                            <constraint firstAttribute="trailing" secondItem="U8M-mN-bcr" secondAttribute="trailing" id="BVv-hJ-qM3"/>
+                            <constraint firstItem="U8M-mN-bcr" firstAttribute="leading" secondItem="y6Y-Bs-egr" secondAttribute="leading" id="HAi-TF-0hr"/>
+                            <constraint firstItem="U8M-mN-bcr" firstAttribute="top" secondItem="y6Y-Bs-egr" secondAttribute="top" id="n55-CH-MG7"/>
+                            <constraint firstAttribute="bottom" secondItem="U8M-mN-bcr" secondAttribute="bottom" id="wzz-hv-Bmj"/>
+                        </constraints>
+                    </view>
+                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="M1O-cz-4Nq">
+                        <rect key="frame" x="379" y="0.0" width="40" height="40"/>
+                        <constraints>
+                            <constraint firstAttribute="height" constant="40" id="Ga2-uW-joA"/>
+                            <constraint firstAttribute="width" constant="40" id="gF9-iw-AcR"/>
+                        </constraints>
+                    </imageView>
+                </subviews>
+                <constraints>
+                    <constraint firstItem="M1O-cz-4Nq" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="BOg-fj-UHU"/>
+                    <constraint firstAttribute="trailing" secondItem="y6Y-Bs-egr" secondAttribute="trailing" constant="10" id="D9t-pw-OTL"/>
+                    <constraint firstItem="y6Y-Bs-egr" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="10" id="Eci-xe-fOs"/>
+                    <constraint firstItem="y6Y-Bs-egr" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="5" id="Iv7-cx-2aV"/>
+                    <constraint firstAttribute="bottom" secondItem="y6Y-Bs-egr" secondAttribute="bottom" constant="5" id="J7b-YK-ndV"/>
+                    <constraint firstAttribute="trailing" secondItem="M1O-cz-4Nq" secondAttribute="trailing" constant="10" id="vbi-Uj-8PN"/>
+                </constraints>
+            </tableViewCellContentView>
+            <connections>
+                <outlet property="bgView" destination="y6Y-Bs-egr" id="uy1-Bs-xse"/>
+                <outlet property="imgView" destination="M1O-cz-4Nq" id="ByR-aI-ug5"/>
+                <outlet property="lab1" destination="0Cm-f4-gQ9" id="Vj1-zC-wWj"/>
+                <outlet property="lab2" destination="rav-Cu-2z8" id="xsR-HB-i49"/>
+                <outlet property="lab3" destination="jCg-CN-bPF" id="Q3b-Y0-ovL"/>
+                <outlet property="lab4" destination="u8D-5v-2bR" id="uVg-bb-Ut0"/>
+                <outlet property="lineView" destination="Tpo-9y-1q7" id="wz0-0U-sPv"/>
+                <outlet property="more1Btn" destination="Sab-fs-7op" id="Kkg-le-fD1"/>
+                <outlet property="moreBtn" destination="8KF-Ke-Z7i" id="46j-eI-Ohw"/>
+                <outlet property="tableView" destination="mxy-RH-Ojg" id="gAh-ZR-CZi"/>
+                <outlet property="titleLab" destination="8TI-X1-ndH" id="Fvz-3C-k6c"/>
+            </connections>
+            <point key="canvasLocation" x="179.38931297709922" y="105.28169014084507"/>
+        </tableViewCell>
+    </objects>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 34 - 13
Koala/Koala/Modular/Home/V/HomeView.swift

@@ -48,7 +48,7 @@ class HomeView: BaseView {
         
         tableView.register(UINib.init(nibName: "HomeInfoCell", bundle: nil), forCellReuseIdentifier: "HomeInfoCell")
         
-        tableView.register(UINib.init(nibName: "BaseCurrencyListCell", bundle: nil), forCellReuseIdentifier: "BaseCurrencyListCell")
+        tableView.register(UINib.init(nibName: "HomeOptionsCell", bundle: nil), forCellReuseIdentifier: "HomeOptionsCell")
         
         tableView.register(InfomationCell.self, forCellReuseIdentifier: InfomationCell.description())
         tableView.register(JDHomeMenuCell.self, forCellReuseIdentifier: JDHomeMenuCell.description())
@@ -120,6 +120,12 @@ class HomeView: BaseView {
             self?.reloadTable()
         })
         
+        VM?.optionProductListAction.values.observeValues({[weak self] (success) in
+            self?.reloadTable()
+        })
+        
+      
+        
         VM?.signalPrice.observeValues({ [weak self] (isSocket) in
             self?.reloadTable()
         })
@@ -159,14 +165,19 @@ class HomeView: BaseView {
 //代理
 extension HomeView:UITableViewDelegate,UITableViewDataSource{
     func numberOfSections(in tableView: UITableView) -> Int {
-        return 3
+        return 4
     }
     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
         if section == 0 {
             return 1
         }else if section == 1{
             return 1//self.VM?.symbolList.count ?? 0
-        }else {
+        }
+        else if section == 2{
+            return 1
+        }
+        else {
+            //
             return self.VM?.newsList.count ?? 0
         }
     }
@@ -187,16 +198,22 @@ extension HomeView:UITableViewDelegate,UITableViewDataSource{
             
         }
         else if indexPath.section == 1{
-//            let cell:BaseCurrencyListCell = tableView.dequeueReusableCell(withIdentifier: "BaseCurrencyListCell") as! BaseCurrencyListCell
-//            let model:KSymbolModel = (self.VM?.symbolList[indexPath.row])!;
-//            cell.updateHomeCellWith(model: model)
-           
-//            return cell
+            //            let cell:BaseCurrencyListCell = tableView.dequeueReusableCell(withIdentifier: "BaseCurrencyListCell") as! BaseCurrencyListCell
+            //            let model:KSymbolModel = (self.VM?.symbolList[indexPath.row])!;
+            //            cell.updateHomeCellWith(model: model)
+            
+            //            return cell
             
             let cell = tableView.dequeueReusableCell(withIdentifier: JDHomeExponentCell.description()) as! JDHomeExponentCell
             cell.updateCellDataWith(list: self.VM!.symbolList)
             return cell
-        }else {
+        }
+        else if indexPath.section == 2{
+            let cell:HomeOptionsCell = tableView.dequeueReusableCell(withIdentifier: "HomeOptionsCell") as! HomeOptionsCell
+            cell.updateCellWith(list: self.VM!.optionProductList)
+            return cell
+        }
+        else {
             
 //            let cell:BaseCurrencyListCell = tableView.dequeueReusableCell(withIdentifier: "BaseCurrencyListCell") as! BaseCurrencyListCell
 //
@@ -217,13 +234,17 @@ extension HomeView:UITableViewDelegate,UITableViewDataSource{
         }
         else if indexPath.section == 1{
             return 330
-        }else {
+        }
+        else if indexPath.section == 2{
+            return 180 + 110
+        }
+        else {
             return 100
         }
     }
     func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
             
-            if section == 2{
+            if section == 3{
                    
                 let view  = UIView(frame: CGRect(x: 0, y: 0, width: SCREEN_WIDTH, height: 50))
                 view.backgroundColor = .white
@@ -255,7 +276,7 @@ extension HomeView:UITableViewDelegate,UITableViewDataSource{
     }
     
     func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        if section == 2{
+        if section == 3{
             return 50
         }
         return 0
@@ -275,7 +296,7 @@ extension HomeView:UITableViewDelegate,UITableViewDataSource{
             vc.viewModel.symbolModel = model!
             currentVc()?.navigationController?.pushViewController(vc, animated: true)
         }
-        else if indexPath.section == 2{
+        else if indexPath.section == 3{
             let model = self.VM!.newsList[indexPath.row]
             let vc = InformationDetailViewController()
             vc.id = model.id

+ 6 - 1
Koala/Koala/Modular/Home/V/JDHomeExponentCell.swift

@@ -80,13 +80,18 @@ extension JDHomeExponentCell : UICollectionViewDataSource{
         cell.updateCellDataWith(model: self.listData[indexPath.row])
         return cell
     }
+    
+   
  
 }
 
 extension JDHomeExponentCell : UICollectionViewDelegate{
     
     func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
-
+        let model = self.listData[indexPath.row]
+        let vc = MarketDetailViewController()
+        vc.symbolModel = model
+        currentVc()?.navigationController?.pushViewController(vc, animated: true)
     }
 }
 

+ 3 - 0
Koala/Koala/Modular/Home/VC/HomeViewController.swift

@@ -50,6 +50,8 @@ class HomeViewController: BaseViewController  {
             self.loadLiveChat()
         }
         
+        self.viewModel.netOptionProductList()
+        
     }
     
     override func viewDidLoad() {
@@ -67,6 +69,7 @@ class HomeViewController: BaseViewController  {
         self.viewModel.netSymbolList()
         self.viewModel.netPriceList()
         self.viewModel.netNewsList()
+        //self.viewModel.netOptionProductList()
                 
         let menu = SideMenuNavigationController(rootViewController: MineViewController())
         menu.isNavigationBarHidden = true //侧栏菜单不显示导航栏

+ 53 - 1
Koala/Koala/Modular/Home/VM/HomeViewModel.swift

@@ -41,6 +41,11 @@ class HomeViewModel: BaseViewModel {
         return arr
     }()
     
+    lazy var optionProductList:[OptionsListModel] = {
+        let arr: [OptionsListModel] = [OptionsListModel]()
+        return arr
+    }()
+    
     lazy var netParamList:[String] = {
         let arr:[String] = ["000001.SH","HK50","US30","DXY","XAUUSD","BTCUSD"];
         return arr
@@ -48,7 +53,7 @@ class HomeViewModel: BaseViewModel {
     
     let (signalSymbol, observeSymbol) = Signal<Bool, Never>.pipe()
     let (signalPrice, observePrice) = Signal<Bool, Never>.pipe()
-    //netForSymbolList
+    //netForGetOptionProductList
     var homeBannerAction: Action <(),(Bool),Never>!
     var homeNoticeAction: Action <(),(Bool),Never>!
     var symbolListAction: Action <(),(Bool),Never>!
@@ -56,6 +61,7 @@ class HomeViewModel: BaseViewModel {
     
     var newsListAction: Action <(),(Bool),Never>!
     
+    var optionProductListAction: Action <(),(Bool),Never>!
     
     override func initialize() {
         homeBannerAction = Action<(),(Bool),Never> {[weak self] _ in
@@ -83,6 +89,15 @@ class HomeViewModel: BaseViewModel {
                 self?.requestNewsList(observer: observer)
             }
         }
+        
+        optionProductListAction = Action<(),(Bool),Never> { [weak self] _ in
+            return SignalProducer<(Bool), Never>{ observer, _ in
+                
+                self?.requestOptionProductList(observer: observer)
+            }
+        }
+        
+        
     }
     
     override func webSocketdidReceive(nofi: NSNotification) {
@@ -267,6 +282,43 @@ extension HomeViewModel {
         
     }
     
+    func netOptionProductList(){
+        optionProductListAction.apply().start()
+    }
+    
+    func requestOptionProductList(observer :Signal<Bool, Never>.Observer) -> Void {
+
+        let param: [String : Any] = [
+            "pageNum" : "1",
+            "pageSize" :"3",
+            "recommend" :"1",
+            "standard" :"100",
+        ]
+        
+        NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForGetOptionProductList,parameters: param, success: {[weak self] (code, result) in
+            if let list:[NSDictionary] = result?["list"] as? [NSDictionary] {
+                self?.optionProductList.removeAll()
+                for dict in list{
+                    let model = OptionsListModel.deserialize(from: dict)!
+                    self?.optionProductList.append(model)
+                }
+               
+                observer.send(value: true)
+            }else{
+                observer.send(value: false)
+                ProgressHUD.showError(status:DataTypeErrorPrompt)
+            }
+            observer.sendCompleted()
+        }) { (code, result) in
+            ProgressHUD.showError(status: result as! String)
+            observer.send(value: false)
+            observer.sendCompleted()
+        }
+        
+    }
+    
+    
+    
     
     
 }

+ 151 - 0
Koala/Koala/Modular/Market/M/MarketModel.swift

@@ -91,5 +91,156 @@ class OptionsListModel: BaseModel {
 }
 
 
+class MarketDepthModel: BaseModel {
+    var asks:[AsksOrBidsModel] = [AsksOrBidsModel]()
+    var bids:[AsksOrBidsModel] = [AsksOrBidsModel]()
+}
+
+class AsksOrBidsModel: BaseModel {
+    var price:String = ""
+    var volume:String = ""
+}
+
+class MCompanyModel: BaseModel {
+    var cnComName:String = ""
+    var tcComName:String = ""
+    var industry:String = ""
+    var symbol:String = ""
+    var vol:String = ""
+    var enComName:String = ""
+    var cnName:String = ""
+    var chairman:String = ""
+    var foundDate:String = ""
+    var amount:String = ""
+    var floatShares:String = ""
+    var totalShares:String = ""
+}
+
+class MDFinanceModel: BaseModel {
+    var id:String = ""
+    var created_at:String = ""
+    var symbol:String = ""
+    var reportDate:String = ""
+    var reportType:String = ""
+    var coverMonths:String = ""
+    var currency:String = ""
+    var segmentType:String = ""
+    var operatingIncome:String = ""
+    var operatingIncomeYoY:String = ""
+    var incomeRatio:String = ""
+    var name:String = ""
+    var nameCN:String = ""
+    var operatingCost:String = ""
+    var operatingCostYoY:String = ""
+    var costRatio:String = ""
+    var operatingProfit:String = ""
+    var operatingProfitYoY:String = ""
+    var profitRatio:String = ""
+    var color:UIColor = .clear
+}
+
+class MDIndicatorModel: BaseModel {
+    var netCashFlowOperPS:String = ""
+    var currentRatioYoY:String = ""
+    var quickRatioYoY:String = ""
+    var shfcfPSYoY:String = ""
+    var netProfit:String = ""
+    var operatingProfit:String = ""
+    var netCashFromOperatingYoY:String = ""
+    var epsYoY:String = ""
+    var eps:String = ""
+    var netCashFromInvesting:String = ""
+    var returnOnTotalAssetsYoY:String = ""
+    var pe:String = ""
+    var OperIncomePSYoY:String = ""
+    var totalLiabilities:String = ""
+    var netCashFromInvestingYoY:String = ""
+    var operatingCashFlowPS:String = ""
+    var symbol:String = ""
+    var reportDate:String = ""
+    var ebitPSYoY:String = ""
+    var netProfitYoY:String = ""
+    var grossProfitMarginYoY:String = ""
+    var quickRatio:String = ""
+    var netIncomeRatio:String = ""
+    var salesPSYoY:String = ""
+    var BasicEPSYOY:String = ""
+    var netCashFlowPSYoY:String = ""
+    var currentRatio:String = ""
+    var BasicEPS:String = ""
+    var netAssetsPS:String = ""
+    var netCashFlowOperPSYoY:String = ""
+    var retainedEarningPS:String = ""
+    var capitalReservePS:String = ""
+    var operatingIncomeYoY:String = ""
+    var returnOnEquityYoY:String = ""
+    var returnOnEquity:String = ""
+    var cashFlowOperPS:String = ""
+    var returnOnTotalAssets:String = ""
+    var shfcfPS:String = ""
+    var retainedEarningPSYoY:String = ""
+    var peYoY:String = ""
+    var pbYoY:String = ""
+    var totalAssets:String = ""
+    var operatingNetCashFlowPSYoY:String = ""
+    var created_at:String = ""
+    var netCashFromFinancingYoY:String = ""
+    var netAssetsPsYoY:String = ""
+    var cashFlowOperPSYoY:String = ""
+    var capitalReservePSYoY:String = ""
+    var operatingCashFlowPSYoY:String = ""
+    var operatingProfitYoY:String = ""
+    var epsTTM:String = ""
+    var epsTTMYoY:String = ""
+    var pb:String = ""
+    var grossProfitMargin:String = ""
+    var salesPS:String = ""
+    var ebitPS:String = ""
+    var netCashFromFinancing:String = ""
+    var coverMonths:String = ""
+    var OperIncomePS:String = ""
+    var id:String = ""
+    var reportType:String = ""
+    var totalLiabilitiesYoY:String = ""
+    var debtAssetRatio:String = ""
+    var dilutedeps:String = ""
+    var netCashFromOperating:String = ""
+    var currency:String = ""
+    var operatingIncome:String = ""
+    var debtAssetRatioYoY:String = ""
+    var totalAssetsYoY:String = ""
+    var dilutedepsYoY:String = ""
+    var operatingNetCashFlowPS:String = ""
+    var netIncomeRatioYoY:String = ""
+    
+    
+    var value:String = ""
+    var valueYoY:String = ""
+    var unit:String = ""
+    var unitYoY:String = ""
+    
+}
+
+class MDIScreenListModel: BaseModel {
+    var name:String = ""
+    var type:String = ""
+    var isSelect:Bool = false
+}
+
+
+class MDNewsModel: BaseModel {
+    var id:String = ""
+    var created_at:String = ""
+    var origin:String = ""
+    var lang:String = ""
+    var title:String = ""
+    var time:String = ""
+    var img:String = ""
+    var brief:String = ""
+    var category:String = ""
+    var market:String = ""
+    var symbol:String = ""
+}
+
 
 

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

@@ -0,0 +1,221 @@
+//
+//  MDAuoteDepthCell.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/13.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MDAuoteDepthCell: BaseTableViewCell {
+    @IBOutlet weak var topBgView: UIView!
+    @IBOutlet weak var titleLab: UILabel!
+    @IBOutlet weak var numBtn: UIButton!
+    
+    @IBOutlet weak var leftView: UIView!
+    @IBOutlet weak var rightView: UIView!
+    @IBOutlet weak var leftWidthConstraint: NSLayoutConstraint!
+    
+    @IBOutlet weak var leftLab: UILabel!
+    @IBOutlet weak var rightLab: UILabel!
+    
+    @IBOutlet weak var leftTitleLab: UILabel!
+    @IBOutlet weak var rightTitleLab: UILabel!
+    
+    @IBOutlet weak var leftTableView: UITableView!
+    @IBOutlet weak var rightTableView: UITableView!
+    @IBOutlet weak var lineView: UIView!
+    
+    var depthModel:MarketDepthModel = MarketDepthModel()
+    var digits:Int = 0
+    
+    var buyNumWidth:CGFloat = 0.0
+    var sellNumWidth:CGFloat = 0.0
+    
+    var buyMaxNum:CGFloat = 0.0
+    var sellMaxNum:CGFloat = 0.0
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        self.backgroundColor = ALLBackGroundColor
+        self.topBgView.backgroundColor = ALLBackGroundColor
+        
+        self.titleLab.setTextFont(.PFSM, 14)
+        self.titleLab.textColor = TitleTextColor
+        self.titleLab.text = switchLanguage("买卖盘")
+        
+        self.numBtn.setTitle("0", for: .normal)
+        self.numBtn.setTitleColor(TitleTextColor, for: .normal)
+        self.numBtn.setTextFont(.PFSR, 12)
+        self.numBtn.setViewLayerBorderColor(myColor: ViewBorderColor, borderWidth: 1, maskBounds: 2)
+        
+        self.numBtn.contentEdgeInsets = UIEdgeInsets(top: 2, left: 2, bottom: 2, right: 2)
+        
+        self.leftTitleLab.text = switchLanguage("买盘")
+        self.leftTitleLab.setTextFont(.PFSM, 12)
+        self.leftTitleLab.textColor = TitleTextColor
+        
+        self.rightTitleLab.text = switchLanguage("卖盘")
+        self.rightTitleLab.setTextFont(.PFSM, 12)
+        self.rightTitleLab.textColor = TitleTextColor
+        
+        self.leftView.backgroundColor = exchangeColorAndImage(increase: 1).0
+        self.rightView.backgroundColor = exchangeColorAndImage(increase: -1).0
+        
+        self.leftLab.text = "100.00%"
+        self.leftLab.setTextFont(.PFSM, 12)
+        self.leftLab.textColor = WhiteTextColor
+        
+        self.rightLab.text = "0.00%"
+        self.rightLab.setTextFont(.PFSM, 12)
+        self.rightLab.textColor = WhiteTextColor
+        
+        self.updatePlan(plan: 1)
+        
+        self.lineView.backgroundColor = ViewBorderColor
+        
+        self.leftTableView.delegate = self
+        self.leftTableView.dataSource = self
+        leftTableView.separatorStyle = .none
+        leftTableView.backgroundColor = .clear
+        leftTableView.tableFooterView = UIView()
+        leftTableView.tableHeaderView = UIView()
+        leftTableView.showsVerticalScrollIndicator = false
+        leftTableView.showsVerticalScrollIndicator = false
+        leftTableView.register(UINib.init(nibName: "MDAuoteDepthListCell", bundle: nil), forCellReuseIdentifier: "MDAuoteDepthListCell")
+        
+        self.rightTableView.delegate = self
+        self.rightTableView.dataSource = self
+        rightTableView.separatorStyle = .none
+        rightTableView.backgroundColor = .clear
+        rightTableView.tableFooterView = UIView()
+        rightTableView.tableHeaderView = UIView()
+        rightTableView.showsVerticalScrollIndicator = false
+        rightTableView.showsVerticalScrollIndicator = false
+        rightTableView.register(UINib.init(nibName: "MDAuoteDepthListCell", bundle: nil), forCellReuseIdentifier: "MDAuoteDepthListCell")
+        
+    }
+
+    override func setSelected(_ selected: Bool, animated: Bool) {
+        super.setSelected(selected, animated: animated)
+
+        // Configure the view for the selected state
+    }
+    
+    func updatePlan(plan:CGFloat) -> Void {
+        self.leftWidthConstraint.constant = plan * (SCREEN_WIDTH - 30)
+    }
+    
+    func updateCellWith(model:MarketDepthModel,digits:Int) -> Void {
+        
+        self.depthModel = model
+        
+        var buyNum = 0.0
+        for m in model.bids {
+            let num = precisionString(with: m.volume, precision: "0")
+            buyNum += conerData(num,.MyCGFloat).4!
+            let w = calculateStrWidth(num, height: 20, font: _PFSM(12))
+            if w > self.buyNumWidth {
+                self.buyNumWidth = w
+            }
+            
+            if conerData(num,.MyCGFloat).4! > self.buyMaxNum {
+                self.buyMaxNum = conerData(num,.MyCGFloat).4!
+            }
+        }
+        
+        var sellNum = 0.0
+        for m in model.asks {
+            let num = precisionString(with: m.volume, precision: "0")
+            sellNum += conerData(num, .MyCGFloat).4!
+            let w = calculateStrWidth(num, height: 20, font: _PFSM(12))
+            if w > self.sellNumWidth {
+                self.sellNumWidth = w
+            }
+            
+            if conerData(num,.MyCGFloat).4! > self.buyMaxNum {
+                self.sellMaxNum = conerData(num,.MyCGFloat).4!
+            }
+        }
+        
+        if (buyNum + sellNum) > 0 {
+            self.updatePlan(plan: buyNum/(buyNum + sellNum))
+        }else{
+            self.updatePlan(plan:0)
+        }
+       
+        
+        self.leftLab.text = precisionString(with: "\(buyNum/(buyNum + sellNum))", precision: "2") + "%"
+        
+        self.rightLab.text = precisionString(with: "\(sellNum/(buyNum + sellNum))", precision: "2") + "%"
+        
+        let num = buyNum > sellNum ? buyNum : sellNum
+        self.numBtn.setTitle(precisionString(with:"\(num)", precision: "0"), for: .normal)
+        
+        self.leftTableView.reloadData()
+        self.rightTableView.reloadData()
+        
+    }
+    
+}
+
+//代理
+extension MDAuoteDepthCell: UITableViewDelegate,UITableViewDataSource{
+    
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        if self.leftTableView == tableView{
+            return self.depthModel.bids.count
+        }
+        return self.depthModel.asks.count
+    }
+    
+    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+        if self.leftTableView == tableView {
+            let cell:MDAuoteDepthListCell = tableView.dequeueReusableCell(withIdentifier: "MDAuoteDepthListCell") as! MDAuoteDepthListCell
+            let model = self.depthModel.bids[indexPath.row]
+            
+            let plan:CGFloat = conerData(model.volume, .MyCGFloat).4!/self.buyMaxNum
+            
+            cell.updateBuyCellWith(model: model, digits: self.digits, plan:plan, width: self.buyNumWidth, num: indexPath.row+1)
+            
+            return cell
+        }else{
+            let cell:MDAuoteDepthListCell = tableView.dequeueReusableCell(withIdentifier: "MDAuoteDepthListCell") as! MDAuoteDepthListCell
+            let model = self.depthModel.bids[indexPath.row]
+            
+            let plan:CGFloat = conerData(model.volume, .MyCGFloat).4!/self.buyMaxNum
+            
+            cell.updateSellCellWith(model: model, digits: self.digits, plan:plan, width: self.buyNumWidth, num: indexPath.row+1)
+            
+            return cell
+        }
+        
+    }
+    
+    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
+        return UIView()
+    }
+    
+    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
+        return UIView()
+    }
+    
+    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
+        return 20
+    }
+    
+    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) {
+        
+    }
+    
+}
+

+ 182 - 0
Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteDepthCell.xib

@@ -0,0 +1,182 @@
+<?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"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="229" id="KGk-i7-Jjw" customClass="MDAuoteDepthCell" customModule="Koala" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="439" height="229"/>
+            <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="439" height="229"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="vWi-xT-YeY">
+                        <rect key="frame" x="0.0" y="0.0" width="439" height="229"/>
+                        <subviews>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="97m-tN-0JT">
+                                <rect key="frame" x="0.0" y="0.0" width="439" height="100"/>
+                                <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="eK2-mq-qNc">
+                                        <rect key="frame" x="15.000000000000004" y="14.999999999999998" width="41.333333333333343" height="20.333333333333329"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                        <nil key="textColor"/>
+                                        <nil key="highlightedColor"/>
+                                    </label>
+                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="sCq-p1-r3W">
+                                        <rect key="frame" x="394" y="8.3333333333333357" width="30" height="34"/>
+                                        <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="1zn-0C-7cU">
+                                        <rect key="frame" x="15.000000000000004" y="49.666666666666664" width="41.333333333333343" height="20.333333333333336"/>
+                                        <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="1T7-4c-odo">
+                                        <rect key="frame" x="382.66666666666669" y="49.666666666666664" width="41.333333333333314" height="20.333333333333336"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                        <nil key="textColor"/>
+                                        <nil key="highlightedColor"/>
+                                    </label>
+                                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aPt-pp-Jrn">
+                                        <rect key="frame" x="15" y="75" width="409" height="20"/>
+                                        <subviews>
+                                            <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9cQ-vL-ntJ">
+                                                <rect key="frame" x="0.0" y="0.0" width="409" height="20"/>
+                                                <subviews>
+                                                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="m7X-fF-0E4">
+                                                        <rect key="frame" x="0.0" y="0.0" width="100" height="20"/>
+                                                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="width" constant="100" id="qb3-f4-eFS"/>
+                                                        </constraints>
+                                                    </view>
+                                                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="WyJ-lG-5us">
+                                                        <rect key="frame" x="100" y="0.0" width="309" height="20"/>
+                                                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                                    </view>
+                                                </subviews>
+                                            </stackView>
+                                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="DR4-Pn-pZH">
+                                                <rect key="frame" x="5" y="0.0" width="41.333333333333336" height="20"/>
+                                                <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="nwc-gg-Ttj">
+                                                <rect key="frame" x="362.66666666666669" y="0.0" width="41.333333333333314" height="20"/>
+                                                <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="bottom" secondItem="nwc-gg-Ttj" secondAttribute="bottom" id="0dn-9l-Fud"/>
+                                            <constraint firstAttribute="trailing" secondItem="nwc-gg-Ttj" secondAttribute="trailing" constant="5" id="4tw-gV-joD"/>
+                                            <constraint firstItem="DR4-Pn-pZH" firstAttribute="top" secondItem="aPt-pp-Jrn" secondAttribute="top" id="AWr-br-dvi"/>
+                                            <constraint firstItem="DR4-Pn-pZH" firstAttribute="leading" secondItem="aPt-pp-Jrn" secondAttribute="leading" constant="5" id="CAx-Py-xFM"/>
+                                            <constraint firstItem="nwc-gg-Ttj" firstAttribute="top" secondItem="aPt-pp-Jrn" secondAttribute="top" id="IXq-8K-ayC"/>
+                                            <constraint firstAttribute="bottom" secondItem="9cQ-vL-ntJ" secondAttribute="bottom" id="LpL-3C-gFW"/>
+                                            <constraint firstAttribute="bottom" secondItem="DR4-Pn-pZH" secondAttribute="bottom" id="bgA-rI-mV7"/>
+                                            <constraint firstAttribute="trailing" secondItem="9cQ-vL-ntJ" secondAttribute="trailing" id="bip-DS-2GX"/>
+                                            <constraint firstItem="9cQ-vL-ntJ" firstAttribute="top" secondItem="aPt-pp-Jrn" secondAttribute="top" id="cPa-ui-ivk"/>
+                                            <constraint firstItem="9cQ-vL-ntJ" firstAttribute="leading" secondItem="aPt-pp-Jrn" secondAttribute="leading" id="jSN-Wl-vIT"/>
+                                            <constraint firstAttribute="height" constant="20" id="sUL-n3-8ym"/>
+                                        </constraints>
+                                    </view>
+                                </subviews>
+                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                <constraints>
+                                    <constraint firstItem="1zn-0C-7cU" firstAttribute="leading" secondItem="aPt-pp-Jrn" secondAttribute="leading" id="11J-aS-uze"/>
+                                    <constraint firstItem="sCq-p1-r3W" firstAttribute="centerY" secondItem="eK2-mq-qNc" secondAttribute="centerY" id="5wm-zM-nBr"/>
+                                    <constraint firstItem="aPt-pp-Jrn" firstAttribute="top" secondItem="1zn-0C-7cU" secondAttribute="bottom" constant="5" id="BRh-Vz-w4a"/>
+                                    <constraint firstItem="aPt-pp-Jrn" firstAttribute="leading" secondItem="97m-tN-0JT" secondAttribute="leading" constant="15" id="DE4-EM-ZWn"/>
+                                    <constraint firstAttribute="bottom" secondItem="aPt-pp-Jrn" secondAttribute="bottom" constant="5" id="Gad-cg-vQ5"/>
+                                    <constraint firstItem="aPt-pp-Jrn" firstAttribute="top" secondItem="1T7-4c-odo" secondAttribute="bottom" constant="5" id="Grf-op-NNZ"/>
+                                    <constraint firstItem="eK2-mq-qNc" firstAttribute="top" secondItem="97m-tN-0JT" secondAttribute="top" constant="15" id="RJN-vP-WHN"/>
+                                    <constraint firstAttribute="trailing" secondItem="aPt-pp-Jrn" secondAttribute="trailing" constant="15" id="TC8-z8-qjP"/>
+                                    <constraint firstItem="eK2-mq-qNc" firstAttribute="leading" secondItem="97m-tN-0JT" secondAttribute="leading" constant="15" id="Vmk-v6-AYr"/>
+                                    <constraint firstAttribute="bottom" secondItem="aPt-pp-Jrn" secondAttribute="bottom" constant="5" id="btI-9k-gaC"/>
+                                    <constraint firstAttribute="trailing" secondItem="sCq-p1-r3W" secondAttribute="trailing" constant="15" id="ij5-nt-8sl"/>
+                                    <constraint firstAttribute="height" constant="100" id="qY6-Td-3bC"/>
+                                    <constraint firstItem="1T7-4c-odo" firstAttribute="trailing" secondItem="aPt-pp-Jrn" secondAttribute="trailing" id="vUs-vY-XcJ"/>
+                                </constraints>
+                            </view>
+                            <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="yfI-Vy-nyJ">
+                                <rect key="frame" x="0.0" y="100" width="439" height="129"/>
+                                <subviews>
+                                    <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="Daf-rz-p6j">
+                                        <rect key="frame" x="0.0" y="0.0" width="217" height="129"/>
+                                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                                    </tableView>
+                                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Lak-Ia-9jQ">
+                                        <rect key="frame" x="217" y="0.0" width="5" height="129"/>
+                                        <subviews>
+                                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="avr-Ft-KX2">
+                                                <rect key="frame" x="2" y="10" width="1" height="109"/>
+                                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="width" constant="1" id="8M5-wK-HM3"/>
+                                                </constraints>
+                                            </view>
+                                        </subviews>
+                                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                        <constraints>
+                                            <constraint firstAttribute="width" constant="5" id="0o4-Se-i10"/>
+                                            <constraint firstItem="avr-Ft-KX2" firstAttribute="top" secondItem="Lak-Ia-9jQ" secondAttribute="top" constant="10" id="2Tr-fH-Gc7"/>
+                                            <constraint firstItem="avr-Ft-KX2" firstAttribute="centerX" secondItem="Lak-Ia-9jQ" secondAttribute="centerX" id="8Db-OS-fNq"/>
+                                            <constraint firstItem="avr-Ft-KX2" firstAttribute="centerY" secondItem="Lak-Ia-9jQ" secondAttribute="centerY" id="AXc-xl-ejU"/>
+                                            <constraint firstAttribute="bottom" secondItem="avr-Ft-KX2" secondAttribute="bottom" constant="10" id="GCa-d4-Cc1"/>
+                                        </constraints>
+                                    </view>
+                                    <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="BU0-qH-jzA">
+                                        <rect key="frame" x="222" y="0.0" width="217" height="129"/>
+                                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                                    </tableView>
+                                </subviews>
+                                <constraints>
+                                    <constraint firstItem="BU0-qH-jzA" firstAttribute="width" secondItem="Daf-rz-p6j" secondAttribute="width" id="4hY-3W-Lzp"/>
+                                </constraints>
+                            </stackView>
+                        </subviews>
+                    </stackView>
+                </subviews>
+                <constraints>
+                    <constraint firstItem="vWi-xT-YeY" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="Epp-Ap-qzp"/>
+                    <constraint firstAttribute="trailing" secondItem="vWi-xT-YeY" secondAttribute="trailing" id="bxy-Aa-kAS"/>
+                    <constraint firstItem="vWi-xT-YeY" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="crs-po-KNU"/>
+                    <constraint firstAttribute="bottom" secondItem="vWi-xT-YeY" secondAttribute="bottom" id="yWZ-XG-eg1"/>
+                </constraints>
+            </tableViewCellContentView>
+            <connections>
+                <outlet property="leftLab" destination="DR4-Pn-pZH" id="Xq9-A2-dV9"/>
+                <outlet property="leftTableView" destination="Daf-rz-p6j" id="Rp4-zW-ihW"/>
+                <outlet property="leftTitleLab" destination="1zn-0C-7cU" id="hJ3-Xy-FRR"/>
+                <outlet property="leftView" destination="m7X-fF-0E4" id="BGT-Kf-bp3"/>
+                <outlet property="leftWidthConstraint" destination="qb3-f4-eFS" id="I7a-1z-fXD"/>
+                <outlet property="lineView" destination="avr-Ft-KX2" id="u54-ew-G5Q"/>
+                <outlet property="numBtn" destination="sCq-p1-r3W" id="96P-R6-tvn"/>
+                <outlet property="rightLab" destination="nwc-gg-Ttj" id="829-IZ-qu2"/>
+                <outlet property="rightTableView" destination="BU0-qH-jzA" id="vbm-uW-ZB6"/>
+                <outlet property="rightTitleLab" destination="1T7-4c-odo" id="y5C-lZ-tEl"/>
+                <outlet property="rightView" destination="WyJ-lG-5us" id="a99-gs-LzW"/>
+                <outlet property="titleLab" destination="eK2-mq-qNc" id="GRL-M3-MHo"/>
+                <outlet property="topBgView" destination="97m-tN-0JT" id="1Vf-rr-Aje"/>
+            </connections>
+            <point key="canvasLocation" x="180.91603053435114" y="80.633802816901408"/>
+        </tableViewCell>
+    </objects>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

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

@@ -0,0 +1,80 @@
+//
+//  MDAuoteDepthListCell.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/13.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MDAuoteDepthListCell: BaseTableViewCell {
+    @IBOutlet weak var numBtn: UIButton!
+    @IBOutlet weak var planView: UIView!
+    @IBOutlet weak var planBgView: UIView!
+    @IBOutlet weak var planWidthConstraint: NSLayoutConstraint!
+    
+    @IBOutlet weak var priceLab: UILabel!
+    @IBOutlet weak var numLab: UILabel!
+    
+    @IBOutlet weak var numWidthConstraint: NSLayoutConstraint!
+    
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        
+        self.backgroundColor = ALLBackGroundColor
+        
+        self.numBtn.setTextFont(.PFSR, 10)
+        self.numBtn.setTitleColor(WhiteTextColor, for: .normal)
+        self.numBtn.setViewLayerBorderColor(myColor: .clear, borderWidth: 0, maskBounds: 2)
+        
+        self.priceLab.setTextFont(.PFSM, 12)
+        
+        self.numLab.setTextFont(.PFSM, 12)
+        
+        // Initialization code
+    }
+
+    override func setSelected(_ selected: Bool, animated: Bool) {
+        super.setSelected(selected, animated: animated)
+
+        // Configure the view for the selected state
+    }
+    
+    func updatePlan(plan:CGFloat) -> Void {
+        self.planWidthConstraint.constant = self.planBgView.frame.size.width * plan
+    }
+    
+    func updateBuyCellWith(model:AsksOrBidsModel,digits:Int,plan:CGFloat,width:CGFloat,num:Int) -> Void {
+        self.numBtn.setTitle("\(num)", for: .normal)
+        self.priceLab.text = precisionString(with: model.price, precision: "\(digits)")
+        
+        self.numLab.text = precisionString(with: model.volume, precision: "0")
+        self.numWidthConstraint.constant = width
+        
+        self.updatePlan(plan: plan)
+        
+        self.planView.backgroundColor = exchangeColorAndImage(increase: 1).0
+        self.numBtn.backgroundColor = exchangeColorAndImage(increase: 1).0
+        self.priceLab.textColor = exchangeColorAndImage(increase: 1).0
+        
+    }
+    
+    func updateSellCellWith(model:AsksOrBidsModel,digits:Int,plan:CGFloat,width:CGFloat,num:Int) -> Void {
+        
+        self.numBtn.setTitle("\(num)", for: .normal)
+        self.priceLab.text = precisionString(with: model.price, precision: "\(digits)")
+        
+        self.numLab.text = precisionString(with: model.volume, precision: "0")
+        self.numWidthConstraint.constant = width
+        
+        self.updatePlan(plan: plan)
+        
+        self.planView.backgroundColor = exchangeColorAndImage(increase: -1).0
+        self.numBtn.backgroundColor = exchangeColorAndImage(increase: -1).0
+        self.priceLab.textColor = exchangeColorAndImage(increase: -1).0
+        
+    }
+    
+}

+ 88 - 0
Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteDepthListCell.xib

@@ -0,0 +1,88 @@
+<?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="57" id="KGk-i7-Jjw" customClass="MDAuoteDepthListCell" customModule="Koala" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="427" height="57"/>
+            <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="427" height="57"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fo8-x6-DN0">
+                        <rect key="frame" x="0.0" y="21" width="15" height="15"/>
+                        <constraints>
+                            <constraint firstAttribute="height" constant="15" id="W25-AU-S98"/>
+                            <constraint firstAttribute="width" constant="15" id="YY9-5q-fru"/>
+                        </constraints>
+                        <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                    </button>
+                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="QfZ-qj-FSN">
+                        <rect key="frame" x="66.333333333333343" y="23.666666666666668" width="305.66666666666663" height="10.000000000000004"/>
+                        <subviews>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2lw-Fs-dxa">
+                                <rect key="frame" x="0.0" y="0.0" width="100" height="10"/>
+                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="100" id="8d6-KX-dqn"/>
+                                </constraints>
+                            </view>
+                        </subviews>
+                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                        <constraints>
+                            <constraint firstAttribute="bottom" secondItem="2lw-Fs-dxa" secondAttribute="bottom" id="3nC-p5-ZvK"/>
+                            <constraint firstItem="2lw-Fs-dxa" firstAttribute="leading" secondItem="QfZ-qj-FSN" secondAttribute="leading" id="Iwy-sY-XXu"/>
+                            <constraint firstItem="2lw-Fs-dxa" firstAttribute="top" secondItem="QfZ-qj-FSN" secondAttribute="top" id="Ro9-lh-4ag"/>
+                            <constraint firstAttribute="height" constant="10" id="Yy0-hb-VtT"/>
+                        </constraints>
+                    </view>
+                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="d39-yE-fcD">
+                        <rect key="frame" x="377" y="18" width="50" height="21"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="50" id="bYe-pW-xXT"/>
+                        </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="Jur-eC-MpO">
+                        <rect key="frame" x="20.000000000000004" y="18" width="41.333333333333343" height="21"/>
+                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                        <nil key="textColor"/>
+                        <nil key="highlightedColor"/>
+                    </label>
+                </subviews>
+                <constraints>
+                    <constraint firstItem="d39-yE-fcD" firstAttribute="leading" secondItem="QfZ-qj-FSN" secondAttribute="trailing" constant="5" id="9hl-s8-yCi"/>
+                    <constraint firstItem="Jur-eC-MpO" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="FSu-wv-Yl1"/>
+                    <constraint firstItem="Jur-eC-MpO" firstAttribute="leading" secondItem="fo8-x6-DN0" secondAttribute="trailing" constant="5" id="O7p-em-raQ"/>
+                    <constraint firstItem="d39-yE-fcD" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="PNf-On-7IL"/>
+                    <constraint firstItem="fo8-x6-DN0" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="TZK-Ye-7i7"/>
+                    <constraint firstItem="QfZ-qj-FSN" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="Zll-Ib-y0j"/>
+                    <constraint firstAttribute="trailing" secondItem="d39-yE-fcD" secondAttribute="trailing" id="ahk-MP-pNZ"/>
+                    <constraint firstItem="fo8-x6-DN0" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="mow-Um-oez"/>
+                    <constraint firstItem="QfZ-qj-FSN" firstAttribute="leading" secondItem="Jur-eC-MpO" secondAttribute="trailing" constant="5" id="wj5-Ab-nBz"/>
+                </constraints>
+            </tableViewCellContentView>
+            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
+            <connections>
+                <outlet property="numBtn" destination="fo8-x6-DN0" id="uj8-Kh-kfD"/>
+                <outlet property="numLab" destination="d39-yE-fcD" id="kz5-zq-cjn"/>
+                <outlet property="numWidthConstraint" destination="bYe-pW-xXT" id="zFU-WM-bOq"/>
+                <outlet property="planBgView" destination="QfZ-qj-FSN" id="s1O-8P-KdL"/>
+                <outlet property="planView" destination="2lw-Fs-dxa" id="E7v-fy-3jR"/>
+                <outlet property="planWidthConstraint" destination="8d6-KX-dqn" id="1uX-0B-vXH"/>
+                <outlet property="priceLab" destination="Jur-eC-MpO" id="rN8-6D-ynO"/>
+            </connections>
+            <point key="canvasLocation" x="185" y="21"/>
+        </tableViewCell>
+    </objects>
+</document>

+ 38 - 6
Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteInfoCell.swift

@@ -66,9 +66,12 @@ class MDAuoteInfoCell: BaseTableViewCell {
         
         self.mark1Btn.setTextFont(.PFSR, 12)
         self.mark1Btn.contentEdgeInsets = UIEdgeInsets(top: 0, left: 2, bottom: 0, right: 2)
+        self.mark1Btn.setTitle(switchLanguage("融"), for: .normal)
+        
         
         self.mark2Btn.setTextFont(.PFSR, 12)
         self.mark2Btn.contentEdgeInsets = UIEdgeInsets(top: 0, left: 2, bottom: 0, right: 2)
+        self.mark2Btn.setTitle(switchLanguage("存股生息"), for: .normal)
         
         self.setTitleLayer(lab: self.title1Lab, text: switchLanguage("开盘"))
         self.setValueLayer(lab: self.value1Lab, text: "--")
@@ -105,22 +108,51 @@ class MDAuoteInfoCell: BaseTableViewCell {
     
     func updateCellWith(model:KSymbolModel) -> Void {
         self.updatePriceWith(model: model)
-        
+    
         self.numberLab.text = model.symbol
         
         self.value1Lab.text = precisionString(with: model.open, precision: model.digits)
         
         self.value2Lab.text = precisionString(with: model.high, precision: model.digits)
         
-        self.value3Lab.text = "--"
-        
-        self.value4Lab.text = "--"
-        
+      
         self.value5Lab.text = precisionString(with: model.open, precision: model.digits)
         
         self.value6Lab.text = precisionString(with: model.low, precision: model.digits)
         
-        self.value7Lab.text = "--"
+    
+        self.mark1Btn.backgroundColor = _color("#fef7d4&#fef7d4")
+        self.mark1Btn.setTitleColor(_color("#c0a245&#c0a245"), for: .normal)
+        self.mark1Btn.setViewLayerBorderColor(myColor: _color("#c0a245&#c0a245"), borderWidth: 1, maskBounds: 2)
+        
+        self.mark2Btn.backgroundColor = _color("#fcece4&#fcece4")
+        self.mark2Btn.setTitleColor(_color("#ee7f4e&#ee7f4e"), for: .normal)
+        self.mark2Btn.setViewLayerBorderColor(myColor: _color("#ee7f4e&#ee7f4e"), borderWidth: 1, maskBounds: 2)
+        
+    }
+    
+    func updateCompany(symbolModel:KSymbolModel,model:MCompanyModel) -> Void {
+        
+        if model.totalShares.length > 0 {
+            self.value3Lab.text = conversionUnit(number: model.totalShares)
+            let v = conerData(model.totalShares, .MyDouble).2! * conerData(symbolModel.newPrice, .MyDouble).2!
+            self.value4Lab.text = conversionUnit(number: "\(v)")
+        }else{
+            self.value3Lab.text = "--"
+            self.value4Lab.text = "--"
+        }
+        
+        if model.floatShares.length > 0 {
+            self.value7Lab.text = conversionUnit(number: model.floatShares)
+        }else{
+            self.value7Lab.text = "--"
+        }
+        
+       
+    
+        
+        
+       
         
     }
     

+ 49 - 5
Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteView.swift

@@ -29,7 +29,7 @@ class MDAuoteView: BaseView {
         
         tableView.register(UINib.init(nibName: "MDAuoteKLinewCell", bundle: nil), forCellReuseIdentifier: "MDAuoteKLinewCell")
         
-        tableView.register(UINib.init(nibName: "AssetsTotalRecordCell", bundle: nil), forCellReuseIdentifier: "AssetsTotalRecordCell")
+        tableView.register(UINib.init(nibName: "MDAuoteDepthCell", bundle: nil), forCellReuseIdentifier: "MDAuoteDepthCell")
         
         if #available(iOS 11, *){
             tableView.contentInsetAdjustmentBehavior = .never
@@ -132,6 +132,46 @@ class MDAuoteView: BaseView {
     
 
     override func blindModel() {
+        VM?.getPriceListAction.values.observeValues({[weak self] (success) in
+            guard let self = self else { return }
+            if success {
+                self.reloadTable()
+            }
+        })
+        
+        VM?.companyInfoAction.values.observeValues({[weak self] (success) in
+            guard let self = self else { return }
+            if success {
+                self.reloadTable()
+            }
+        })
+        
+        
+        VM?.getPriceDepthAction.values.observeValues({[weak self] (success) in
+            guard let self = self else { return }
+            if success {
+                self.reloadTable()
+            }
+        })
+
+        VM?.signalPrice.observeValues({ [weak self] (isSocket) in
+            guard let self = self else { return }
+            if isSocket {
+                self.updateSocketCellData()
+            }
+        })
+    }
+    
+    func updateSocketCellData() -> Void {
+        if let cell:MDAuoteInfoCell = self.tableView.cellForRow(at: IndexPath.init(row: 0, section: 0)) as? MDAuoteInfoCell{
+            cell.updateCellWith(model: self.VM!.symbolModel)
+            cell.updateCompany(symbolModel: self.VM!.symbolModel, model: self.VM!.companyModel)
+        }
+        
+        if let cell:MDAuoteKLinewCell = self.tableView.cellForRow(at: IndexPath.init(row: 0, section: 1)) as? MDAuoteKLinewCell{
+            cell.updateCellWithModel(list: self.VM!.priceList,symbol: self.VM!.symbolModel, isSocket: true)
+        }
+    
         
     }
     
@@ -147,7 +187,7 @@ class MDAuoteView: BaseView {
 //代理
 extension MDAuoteView:UITableViewDelegate,UITableViewDataSource{
     func numberOfSections(in tableView: UITableView) -> Int {
-        return 2
+        return 3
     }
     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
         return 1
@@ -157,6 +197,7 @@ extension MDAuoteView:UITableViewDelegate,UITableViewDataSource{
         if indexPath.section == 0 {
             let cell:MDAuoteInfoCell = tableView.dequeueReusableCell(withIdentifier: "MDAuoteInfoCell") as! MDAuoteInfoCell
             cell.updateCellWith(model: self.VM!.symbolModel)
+            cell.updateCompany(symbolModel: self.VM!.symbolModel, model: self.VM!.companyModel)
             return cell
         }
         else if indexPath.section == 1 {
@@ -176,8 +217,10 @@ extension MDAuoteView:UITableViewDelegate,UITableViewDataSource{
             return cell
         }
         
-        let cell:MDAuoteInfoCell = tableView.dequeueReusableCell(withIdentifier: "MDAuoteInfoCell") as! MDAuoteInfoCell
-       
+        let cell:MDAuoteDepthCell = tableView.dequeueReusableCell(withIdentifier: "MDAuoteDepthCell") as! MDAuoteDepthCell
+        let digits = conerData(self.VM?.symbolModel.digits as Any, .MyInt).0!
+        cell.updateCellWith(model: self.VM!.depthModel, digits: digits)
+        
         return cell
     }
     
@@ -189,7 +232,8 @@ extension MDAuoteView:UITableViewDelegate,UITableViewDataSource{
             let viceArr = KLineViceTarget.getDefaultKLineTarget()
             return CGFloat(300+KLineViceTarget.getDefaultKLineTarget().count*110)
         }
-        return 60
+        let num = self.VM!.depthModel.bids.count >  self.VM!.depthModel.asks.count ?  self.VM!.depthModel.bids.count : self.VM!.depthModel.asks.count
+        return CGFloat((20 * num) + 100)
     }
     
     func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {

+ 2 - 1
Koala/Koala/Modular/Deal/V/TalentDetails/BalloonMarker.swift → Koala/Koala/Modular/Market/V/MarketDetailView/MDFinanceView/BalloonMarker.swift

@@ -29,7 +29,7 @@ class BalloonMarker: MarkerImage {
         
         _paragraphStyle = NSParagraphStyle.default.mutableCopy()
             as? NSMutableParagraphStyle
-        _paragraphStyle?.alignment = .left
+        _paragraphStyle?.alignment = .center
         super.init()
     }
     
@@ -185,6 +185,7 @@ class BalloonMarker: MarkerImage {
     open func setLabel(_ newLabel: String)
     {
         label = newLabel
+        
         _drawAttributes.removeAll()
         _drawAttributes[.font] = self.font
         _drawAttributes[.paragraphStyle] = _paragraphStyle

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

@@ -0,0 +1,216 @@
+//
+//  BarBalloonMarker.swift
+//  FishPro
+//
+//  Created by 刘千军 on 2021/6/22.
+//  Copyright © 2021 刘千军. All rights reserved.
+//
+
+import UIKit
+import Charts
+class BarBalloonMarker: MarkerImage {
+    open var color: UIColor
+    open var arrowSize = CGSize(width: 10, height: 5)
+    open var font: UIFont
+    open var textColor: UIColor
+    open var borderColor: UIColor
+    open var insets: UIEdgeInsets
+    open var minimumSize = CGSize()
+    
+    fileprivate var label: String?
+    fileprivate var _labelSize: CGSize = CGSize()
+    fileprivate var _paragraphStyle: NSMutableParagraphStyle?
+    fileprivate var _drawAttributes = [NSAttributedString.Key : AnyObject]()
+    public init(color: UIColor, font: UIFont, textColor: UIColor,borderColor:UIColor, insets: UIEdgeInsets)
+    {
+        self.color = color
+        self.font = font
+        self.textColor = textColor
+        self.insets = insets
+        self.borderColor = borderColor
+        _paragraphStyle = NSParagraphStyle.default.mutableCopy()
+            as? NSMutableParagraphStyle
+        _paragraphStyle?.alignment = .center
+        super.init()
+    }
+    
+    open override func offsetForDrawing(atPoint point: CGPoint) -> CGPoint
+    {
+        var offset = self.offset
+        var size = self.size
+        
+        if size.width == 0.0 && image != nil
+        {
+            size.width = image!.size.width
+        }
+        if size.height == 0.0 && image != nil
+        {
+            size.height = image!.size.height
+        }
+        
+        let width = size.width
+        let height = size.height
+        let padding: CGFloat = 8.0
+        
+        var origin = point
+        origin.x -= width / 2
+        origin.y -= height
+        
+        if origin.x + offset.x < 0.0
+        {
+            offset.x = -origin.x + padding
+        }
+        else if let chart = chartView,
+            origin.x + width + offset.x > chart.bounds.size.width
+        {
+            offset.x = chart.bounds.size.width - origin.x - width - padding
+        }
+        
+        if origin.y + offset.y < 0
+        {
+            offset.y = height + padding;
+        }
+        else if let chart = chartView,
+            origin.y + height + offset.y > chart.bounds.size.height
+        {
+            offset.y = chart.bounds.size.height - origin.y - height - padding
+        }
+        
+        return offset
+    }
+    
+    open override func draw(context: CGContext, point: CGPoint)
+    {
+        guard let label = label else { return }
+        
+        let offset = self.offsetForDrawing(atPoint: point)
+        let size = self.size
+        
+        var rect = CGRect(
+            origin: CGPoint(
+                x: point.x + offset.x,
+                y: point.y + offset.y),
+            size: size)
+        rect.origin.x -= size.width / 2.0
+        rect.origin.y -= size.height
+        
+        context.saveGState()
+        
+        context.setLineWidth(1)
+        context.setStrokeColor(borderColor.cgColor)
+        self.drawBg(context: context, point: point, rect: rect,offset: offset)
+        context.strokePath()
+        
+        context.setFillColor(color.cgColor)
+        self.drawBg(context: context, point: point, rect: rect,offset: offset)
+        context.fillPath()
+        
+       
+       
+        
+        if offset.y > 0 {
+            rect.origin.y += self.insets.top + arrowSize.height
+        } else {
+            rect.origin.y += self.insets.top
+        }
+        
+        rect.size.height -= self.insets.top + self.insets.bottom
+        
+        UIGraphicsPushContext(context)
+        
+        label.draw(in: rect, withAttributes: _drawAttributes)
+        
+        UIGraphicsPopContext()
+        
+        context.restoreGState()
+    }
+    
+    func drawBg(context: CGContext, point: CGPoint,rect:CGRect,offset:CGPoint) -> Void {
+        if offset.y > 0
+        {
+            context.beginPath()
+            context.move(to: CGPoint(
+                x: rect.origin.x,
+                y: rect.origin.y + arrowSize.height))
+            context.addLine(to: CGPoint(
+                x: rect.origin.x + (rect.size.width - arrowSize.width) / 2.0,
+                y: rect.origin.y + arrowSize.height))
+            //arrow vertex
+            context.addLine(to: CGPoint(
+                x: point.x,
+                y: point.y))
+            context.addLine(to: CGPoint(
+                x: rect.origin.x + (rect.size.width + arrowSize.width) / 2.0,
+                y: rect.origin.y + arrowSize.height/2))
+            context.addLine(to: CGPoint(
+                x: rect.origin.x + rect.size.width,
+                y: rect.origin.y + arrowSize.height/2))
+            context.addLine(to: CGPoint(
+                x: rect.origin.x + rect.size.width,
+                y: rect.origin.y + rect.size.height))
+            context.addLine(to: CGPoint(
+                x: rect.origin.x,
+                y: rect.origin.y + rect.size.height))
+            context.addLine(to: CGPoint(
+                x: rect.origin.x,
+                y: rect.origin.y + arrowSize.height))
+            
+        }
+        else
+        {
+            context.beginPath()
+            context.move(to: CGPoint(
+                x: rect.origin.x,
+                y: rect.origin.y))
+            context.addLine(to: CGPoint(
+                x: rect.origin.x + rect.size.width,
+                y: rect.origin.y))
+            context.addLine(to: CGPoint(
+                x: rect.origin.x + rect.size.width,
+                y: rect.origin.y + rect.size.height - arrowSize.height))
+            context.addLine(to: CGPoint(
+                x: rect.origin.x + (rect.size.width + arrowSize.width) / 2.0,
+                y: rect.origin.y + rect.size.height - arrowSize.height))
+            //arrow vertex
+            context.addLine(to: CGPoint(
+                x: point.x,
+                y: point.y))
+            context.addLine(to: CGPoint(
+                x: rect.origin.x + (rect.size.width - arrowSize.width) / 2.0,
+                y: rect.origin.y + rect.size.height - arrowSize.height))
+            context.addLine(to: CGPoint(
+                x: rect.origin.x,
+                y: rect.origin.y + rect.size.height - arrowSize.height))
+            context.addLine(to: CGPoint(
+                x: rect.origin.x,
+                y: rect.origin.y))
+        }
+    }
+    
+    /**
+     open override func refreshContent(entry: ChartDataEntry, highlight: Highlight)
+     {
+     setLabel(String(entry.y))
+     }
+     **/
+    
+    open func setLabel(_ newLabel: String)
+    {
+        label = newLabel
+        
+         
+        _drawAttributes.removeAll()
+        _drawAttributes[.font] = self.font
+        _drawAttributes[.paragraphStyle] = _paragraphStyle
+        _drawAttributes[.foregroundColor] = self.textColor
+
+        _labelSize = label?.size(withAttributes: _drawAttributes) ?? CGSize.zero
+        
+        var size = CGSize()
+        size.width = _labelSize.width + self.insets.left + self.insets.right
+        size.height = _labelSize.height + self.insets.top + self.insets.bottom
+        size.width = max(minimumSize.width, size.width)
+        size.height = max(minimumSize.height, size.height)
+        self.size = size
+    }
+}

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

@@ -0,0 +1,279 @@
+//
+//  MDFinanceCell.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/14.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+import Charts
+class MDFinanceCell: BaseTableViewCell {
+    @IBOutlet weak var titleLab: UILabel!
+    @IBOutlet weak var unitBtn: UIButton!
+    @IBOutlet weak var stackView: UIStackView!
+    @IBOutlet weak var leftBtn: UIButton!
+    @IBOutlet weak var rightBtn: UIButton!
+    @IBOutlet weak var pieBgView: UIView!
+    @IBOutlet weak var bottomBgView: UIView!
+    @IBOutlet weak var collectionView: UICollectionView!
+    
+    var listData:[MDFinanceModel] = [MDFinanceModel]()
+    
+    var completeBlock:((_ index: NSInteger) -> ())?
+    
+    lazy var pieChartView: PieChartView = {
+        let pieChartView: PieChartView = PieChartView()
+        pieChartView.delegate = self
+        pieChartView.backgroundColor = .clear
+        return pieChartView
+    }()
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        self.backgroundColor = ALLBackGroundColor
+        
+        self.titleLab.text = switchLanguage("主营构成")
+        self.titleLab.setTextFont(.PFSM, 16)
+        self.titleLab.textColor = TitleTextColor
+        
+        self.unitBtn.setTitle(switchLanguage("币种"+":"+SaveData.shared().getExchangeRate()), for: .normal)
+        self.unitBtn.setTextFont(.PFSR, 14)
+        self.unitBtn.setTitleColor(MidTextColor, for: .normal)
+        
+        self.stackView.setViewLayerBorderColor(myColor: .clear, borderWidth: 0, maskBounds: 4)
+        self.stackView.layer.masksToBounds = true
+        
+        self.leftBtn.setTitle(switchLanguage("业务"), for: .normal)
+        self.leftBtn.setTextFont(.PFSR, 14)
+        self.leftBtn.addTarget(self, action: #selector(clickLeftBtnAction), for: .touchUpInside)
+        
+        self.rightBtn.setTitle(switchLanguage("地区"), for: .normal)
+        self.rightBtn.setTextFont(.PFSR, 14)
+        self.rightBtn.addTarget(self, action: #selector(clickRightBtnAction), for: .touchUpInside)
+        
+        self.updateSelectAction(index: 0)
+        
+        let layout = UICollectionViewFlowLayout.init()
+        layout.scrollDirection = UICollectionView.ScrollDirection.vertical
+        layout.minimumInteritemSpacing = 5
+        layout.minimumLineSpacing = 5
+        collectionView.setCollectionViewLayout(layout, animated: true)
+        collectionView.delegate = self
+        collectionView.dataSource = self
+        collectionView.showsVerticalScrollIndicator = false
+        collectionView.showsHorizontalScrollIndicator = false
+        collectionView.backgroundColor = UIColor.clear
+        
+        collectionView.register(UINib.init(nibName: "MDFinanceListCell", bundle: nil), forCellWithReuseIdentifier: "MDFinanceListCell")
+        
+        self.pieBgView.addSubview(self.pieChartView)
+        self.pieChartView.snp.makeConstraints { make in
+            make.edges.equalToSuperview()
+        }
+        
+        self.setPieChartViewBaseStyle()
+    }
+    
+    
+    override func setSelected(_ selected: Bool, animated: Bool) {
+        super.setSelected(selected, animated: animated)
+        
+        // Configure the view for the selected state
+    }
+    
+    func setPieChartViewBaseStyle() -> Void {
+        //基本样式
+        pieChartView.setExtraOffsets(left: 30, top: 10, right: 30, bottom: 10)//饼状图距离边缘的间隙
+        pieChartView.usePercentValuesEnabled = false//是否根据所提供的数据, 将显示数据转换为百分比格式
+        pieChartView.dragDecelerationEnabled = false//拖拽饼状图后是否有惯性效果
+        pieChartView.drawSlicesUnderHoleEnabled = false//是否显示区块文本
+        pieChartView.noDataText = switchLanguage("暂无收益")
+        pieChartView.noDataFont = _PFSSM(14)
+        pieChartView.noDataTextColor = TitleTextColor
+        
+        //空(实)心饼状图样式
+        pieChartView.drawHoleEnabled = true//饼状图是否是空心 true为空心 false为实心
+        //饼状图中间描述
+        if pieChartView.isDrawHoleEnabled == true {
+            
+        }
+        else{}
+        
+        pieChartView.legend.enabled = false
+      
+    }
+    
+    
+    
+    
+    func updateCellWith(list:[MDFinanceModel],type:Int) -> Void {
+        self.listData = list
+        self.updateSelectAction(index: type)
+        self.updataDataWith()
+        self.collectionView.reloadData()
+    }
+    
+    
+    
+    
+    
+}
+
+extension MDFinanceCell{
+    @objc func clickLeftBtnAction(){
+        self.updateSelectAction(index: 0)
+        self.completeBlock?(0)
+    }
+    @objc func clickRightBtnAction(){
+        self.updateSelectAction(index: 1)
+        self.completeBlock?(1)
+    }
+    func updateSelectAction(index:Int) -> Void{
+      
+        if index == 0{
+            self.leftBtn.backgroundColor = MainBackGroundColor
+            self.leftBtn.setTitleColor(WhiteTextColor, for: .normal)
+            self.rightBtn.backgroundColor = MidBackGroundColor
+            self.rightBtn.setTitleColor(TitleTextColor, for: .normal)
+        }else{
+            self.leftBtn.backgroundColor = MidBackGroundColor
+            self.leftBtn.setTitleColor(TitleTextColor, for: .normal)
+            self.rightBtn.backgroundColor = MainBackGroundColor
+            self.rightBtn.setTitleColor(WhiteTextColor, for: .normal)
+        }
+    }
+}
+
+extension MDFinanceCell : 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:MDFinanceListCell = collectionView.dequeueReusableCell(withReuseIdentifier: "MDFinanceListCell", for: indexPath) as! MDFinanceListCell
+        
+        let model:MDFinanceModel = self.listData[indexPath.row];
+        cell.updateCellWith(model: model)
+        
+        return cell
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
+        return CGSize(width: (SCREEN_WIDTH-36)/2, height:134)
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+        
+        
+    }
+    
+}
+
+extension MDFinanceCell: ChartViewDelegate{
+    
+    func updataDataWith(){
+        var colors:[UIColor] = ChartColorTemplates.liberty()
+           + ChartColorTemplates.material()
+           + ChartColorTemplates.vordiplom()
+           + ChartColorTemplates.colorful()
+           + ChartColorTemplates.pastel()
+            + ChartColorTemplates.joyful()
+        
+         
+        var yVals: NSMutableArray  = NSMutableArray.init()
+        for (i,model) in self.listData.enumerated() {
+            let val = precisionString(with: model.incomeRatio, precision: "2", isRound: true)
+            let entry:PieChartDataEntry  = PieChartDataEntry.init(value: Double(val)!, label: model.name + "\n" + val + "%")
+            yVals.add(entry)
+            if colors.count > i{
+                model.color = colors[i]
+            }else{
+                model.color = RandomColor
+                colors.append(model.color)
+            }
+        }
+        
+        //创建PieChartDataSet对象
+        let set1: PieChartDataSet = PieChartDataSet.init(entries: yVals as? [ChartDataEntry], label: "饼状图")
+        set1.drawIconsEnabled = false //是否在饼状图上面显示图片
+        set1.sliceSpace = 2 //相邻区块之间的间距
+        set1.selectionShift = 8//选中区块时, 放大的半径
+        set1.drawValuesEnabled = false //是否在饼状图上面显示数值
+        set1.highlightEnabled = true //点击选饼状图是否有高亮效果,(单击空白处取消选中)
+        set1.valueColors = [.clear]//设置柱形图颜色(是一个循环,例如:你设置5个颜色,你设置8个柱形,后三个对应的颜色是该设置中的前三个,依次类推)
+        set1.colors = colors
+        
+        
+        set1.xValuePosition = PieChartDataSet.ValuePosition.insideSlice//名称位置
+        //PieChartDataSet.ValuePosition.insideSlice 数据显示在饼图内部  PieChartDataSet.ValuePosition.outsideSlice外部
+        
+        //外部条件下有折线
+        set1.yValuePosition = PieChartDataSet.ValuePosition.insideSlice//数据位置
+        //数据与区块之间的用于指示的折线样式
+        set1.valueLinePart1OffsetPercentage =  1 //折线中第一段起始位置相对于区块的偏移量, 数值越大, 折线距离区块越远
+        set1.valueLinePart1Length = 0//折线中第一段长度占比
+        set1.valueLinePart2Length = 0//折线中第二段长度最大占比
+        set1.valueLineWidth = 0//折线的粗细
+        
+        //        set1.yValuePosition = .outsideSlice //这个折线外部展示
+        set1.drawValuesEnabled = false
+        set1.xValuePosition = .insideSlice
+        set1.useValueColorForLine = false
+        
+        let dataSets: NSMutableArray  = NSMutableArray.init()
+        dataSets.add(set1)
+        //创建BarChartData对象, 此对象就是barChartView需要最终数据对象
+        let data:  PieChartData = PieChartData.init(dataSets: dataSets as? [IChartDataSet])
+        let formatter: NumberFormatter = NumberFormatter.init()
+        //formatter.numberStyle = NumberFormatter.Style.currency//自定义数据显示格式  小数点形式(可以尝试不同看效果)
+        formatter.numberStyle = NumberFormatter.Style.none //自定义数据显示格式  小数点形式(可以尝试不同看效果)
+        formatter.maximumFractionDigits = 0
+        formatter.multiplier = 1
+        let forma :DefaultValueFormatter = DefaultValueFormatter.init(formatter: formatter)
+        data.setValueFormatter(forma)
+        data.setValueFont(UIFont.systemFont(ofSize: 10))
+        pieChartView.data = data
+        pieChartView.animate(xAxisDuration: 1, easingOption: ChartEasingOption.easeOutExpo)
+        
+    }
+    
+    
+    
+    //1.点击选中
+    func chartValueSelected(_ chartView: ChartViewBase, entry: ChartDataEntry, highlight: Highlight) {
+        
+        self.showBalloonMarkerView(pieChartView: chartView as! PieChartView, entry: entry as! PieChartDataEntry)
+    }
+    //2.没有选中
+    func chartValueNothingSelected(_ chartView: ChartViewBase) {
+        
+    }
+    //3.捏合放大或缩小
+    func chartScaled(_ chartView: ChartViewBase, scaleX: CGFloat, scaleY: CGFloat) {
+        
+    }
+    //4.拖拽图表
+    func chartTranslated(_ chartView: ChartViewBase, dX: CGFloat, dY: CGFloat) {
+        
+    }
+    
+    
+    func showBalloonMarkerView(pieChartView: PieChartView,entry: PieChartDataEntry){
+      
+        let marker = BalloonMarker(color:exchangeColorAndImage(increase: 1).0,
+                                   font: _PFSR(12),
+                                   textColor: WhiteTextColor,
+                                   insets: UIEdgeInsets(top: 5, left: 5, bottom: 15, right: 5))
+        marker.chartView = pieChartView
+        marker.minimumSize = CGSize(width: 50, height: 30)
+      
+        
+        marker.setLabel(String(format: "%@",entry.label ?? ""))
+        pieChartView.marker = marker
+    }
+    
+}
+
+

+ 149 - 0
Koala/Koala/Modular/Market/V/MarketDetailView/MDFinanceView/MDFinanceCell.xib

@@ -0,0 +1,149 @@
+<?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"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="533" id="KGk-i7-Jjw" customClass="MDFinanceCell" customModule="Koala" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="352" height="533"/>
+            <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="352" height="533"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="Snh-of-xXu">
+                        <rect key="frame" x="0.0" y="0.0" width="352" height="523"/>
+                        <subviews>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dRr-B5-Fi5">
+                                <rect key="frame" x="0.0" y="0.0" width="352" height="40"/>
+                                <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="WFy-Ct-Wd9">
+                                        <rect key="frame" x="15.000000000000004" y="19.666666666666671" width="41.333333333333343" height="20.333333333333329"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                        <nil key="textColor"/>
+                                        <nil key="highlightedColor"/>
+                                    </label>
+                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Bee-Nw-w2Q">
+                                        <rect key="frame" x="307" y="13" width="30" height="34"/>
+                                        <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="WFy-Ct-Wd9" secondAttribute="bottom" id="KPF-wd-qub"/>
+                                    <constraint firstAttribute="trailing" secondItem="Bee-Nw-w2Q" secondAttribute="trailing" constant="15" id="OQP-Dr-5lH"/>
+                                    <constraint firstAttribute="height" constant="40" id="Z20-Kn-HGb"/>
+                                    <constraint firstItem="WFy-Ct-Wd9" firstAttribute="leading" secondItem="dRr-B5-Fi5" secondAttribute="leading" constant="15" id="ZDS-Io-lSS"/>
+                                    <constraint firstItem="Bee-Nw-w2Q" firstAttribute="centerY" secondItem="WFy-Ct-Wd9" secondAttribute="centerY" id="sIX-To-R6b"/>
+                                </constraints>
+                            </view>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="yEP-T7-sKg">
+                                <rect key="frame" x="0.0" y="40" width="352" height="300"/>
+                                <subviews>
+                                    <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="hZk-zL-ocJ">
+                                        <rect key="frame" x="0.0" y="0.0" width="352" height="300"/>
+                                        <subviews>
+                                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Uem-Hy-wXU">
+                                                <rect key="frame" x="0.0" y="0.0" width="352" height="40"/>
+                                                <subviews>
+                                                    <stackView opaque="NO" contentMode="scaleToFill" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="vhl-7U-zVC">
+                                                        <rect key="frame" x="15" y="10" width="120" height="30"/>
+                                                        <subviews>
+                                                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="SwX-FM-rkb">
+                                                                <rect key="frame" x="0.0" y="0.0" width="57.666666666666664" height="30"/>
+                                                                <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="1hB-Bd-qEK">
+                                                                <rect key="frame" x="62.666666666666671" y="0.0" width="57.333333333333329" height="30"/>
+                                                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                                            </button>
+                                                        </subviews>
+                                                        <constraints>
+                                                            <constraint firstItem="1hB-Bd-qEK" firstAttribute="width" secondItem="SwX-FM-rkb" secondAttribute="width" id="Mdg-RI-e28"/>
+                                                            <constraint firstAttribute="width" constant="120" id="e4H-Zq-PeY"/>
+                                                        </constraints>
+                                                    </stackView>
+                                                </subviews>
+                                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                                <constraints>
+                                                    <constraint firstItem="vhl-7U-zVC" firstAttribute="top" secondItem="Uem-Hy-wXU" secondAttribute="top" constant="10" id="Eak-9T-f97"/>
+                                                    <constraint firstItem="vhl-7U-zVC" firstAttribute="leading" secondItem="Uem-Hy-wXU" secondAttribute="leading" constant="15" id="Ios-2g-7hi"/>
+                                                    <constraint firstAttribute="height" constant="40" id="VzQ-zk-Pba"/>
+                                                    <constraint firstAttribute="bottom" secondItem="vhl-7U-zVC" secondAttribute="bottom" id="lZe-c6-90z"/>
+                                                </constraints>
+                                            </view>
+                                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="VcI-Zv-MMj">
+                                                <rect key="frame" x="0.0" y="40" width="352" height="260"/>
+                                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                            </view>
+                                        </subviews>
+                                    </stackView>
+                                </subviews>
+                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                <constraints>
+                                    <constraint firstAttribute="bottom" secondItem="hZk-zL-ocJ" secondAttribute="bottom" id="6Is-VA-96a"/>
+                                    <constraint firstItem="hZk-zL-ocJ" firstAttribute="top" secondItem="yEP-T7-sKg" secondAttribute="top" id="CIx-w1-lUv"/>
+                                    <constraint firstItem="hZk-zL-ocJ" firstAttribute="leading" secondItem="yEP-T7-sKg" secondAttribute="leading" id="OVQ-dL-rjA"/>
+                                    <constraint firstAttribute="trailing" secondItem="hZk-zL-ocJ" secondAttribute="trailing" id="hPg-A2-2bQ"/>
+                                    <constraint firstAttribute="height" constant="300" id="rfa-4p-yOm"/>
+                                </constraints>
+                            </view>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="KHf-Sh-Rff">
+                                <rect key="frame" x="0.0" y="340" width="352" height="183"/>
+                                <subviews>
+                                    <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" userInteractionEnabled="NO" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="9hH-sR-aDN">
+                                        <rect key="frame" x="15" y="0.0" width="322" height="183"/>
+                                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                                        <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="3CA-gr-arp">
+                                            <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>
+                                </subviews>
+                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                <constraints>
+                                    <constraint firstAttribute="trailing" secondItem="9hH-sR-aDN" secondAttribute="trailing" constant="15" id="5C9-k4-nSY"/>
+                                    <constraint firstItem="9hH-sR-aDN" firstAttribute="top" secondItem="KHf-Sh-Rff" secondAttribute="top" id="7Li-Zy-miu"/>
+                                    <constraint firstAttribute="bottom" secondItem="9hH-sR-aDN" secondAttribute="bottom" id="Jiw-5I-jZz"/>
+                                    <constraint firstItem="9hH-sR-aDN" firstAttribute="leading" secondItem="KHf-Sh-Rff" secondAttribute="leading" constant="15" id="uLX-Vf-D5G"/>
+                                </constraints>
+                            </view>
+                        </subviews>
+                    </stackView>
+                </subviews>
+                <constraints>
+                    <constraint firstAttribute="trailing" secondItem="Snh-of-xXu" secondAttribute="trailing" id="5jH-rz-JjY"/>
+                    <constraint firstAttribute="bottom" secondItem="Snh-of-xXu" secondAttribute="bottom" constant="10" id="kTH-gK-GL3"/>
+                    <constraint firstItem="Snh-of-xXu" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="pUo-fH-Ia0"/>
+                    <constraint firstItem="Snh-of-xXu" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="vkB-wU-v6Y"/>
+                </constraints>
+            </tableViewCellContentView>
+            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
+            <connections>
+                <outlet property="bottomBgView" destination="KHf-Sh-Rff" id="REl-2s-Cdv"/>
+                <outlet property="collectionView" destination="9hH-sR-aDN" id="P5G-Pi-Otc"/>
+                <outlet property="leftBtn" destination="SwX-FM-rkb" id="V7a-ho-Eqq"/>
+                <outlet property="pieBgView" destination="VcI-Zv-MMj" id="cTY-pu-G44"/>
+                <outlet property="rightBtn" destination="1hB-Bd-qEK" id="90e-7f-hkz"/>
+                <outlet property="stackView" destination="vhl-7U-zVC" id="Lbw-zo-ZSe"/>
+                <outlet property="titleLab" destination="WFy-Ct-Wd9" id="vRx-ng-bgf"/>
+                <outlet property="unitBtn" destination="Bee-Nw-w2Q" id="R2C-Vb-vPw"/>
+            </connections>
+            <point key="canvasLocation" x="58.015267175572518" y="191.90140845070422"/>
+        </tableViewCell>
+    </objects>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

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

@@ -0,0 +1,58 @@
+//
+//  MDFinanceListCell.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/14.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MDFinanceListCell: UICollectionViewCell {
+    @IBOutlet weak var bgView: UIView!
+    @IBOutlet weak var dotView: UIView!
+    @IBOutlet weak var nameLab: UILabel!
+    
+    @IBOutlet weak var incomeTitleLab: UILabel!
+    @IBOutlet weak var incomeLab: UILabel!
+    
+    @IBOutlet weak var rateTitleLab: UILabel!
+    @IBOutlet weak var rateLab: UILabel!
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        self.backgroundColor = .clear
+        
+        self.bgView.backgroundColor = _color("#FAFCFF&#FAFCFF")
+        self.bgView.setViewLayerBorderColor(myColor: .clear, borderWidth: 0, maskBounds: 8)
+        
+        self.dotView.setViewLayerBorderColor(myColor: .clear, borderWidth: 0, maskBounds: 5)
+        
+        self.nameLab.setTextFont(.PFSR, 12)
+        self.nameLab.textColor = LightTextColor
+        
+       
+        self.incomeLab.setTextFont(.PFSM, 18)
+        self.incomeLab.textColor = TitleTextColor
+        
+        self.incomeTitleLab.setTextFont(.PFSR, 12)
+        self.incomeTitleLab.textColor = LightTextColor
+        self.incomeTitleLab.text = switchLanguage("营业收入")
+        
+        self.rateLab.setTextFont(.PFSM, 18)
+        self.rateLab.textColor = TitleTextColor
+        
+        self.rateTitleLab.setTextFont(.PFSR, 12)
+        self.rateTitleLab.textColor = LightTextColor
+        self.rateTitleLab.text = switchLanguage("收入占比")
+        
+    }
+    
+    func updateCellWith(model:MDFinanceModel) -> Void {
+        self.dotView.backgroundColor = model.color
+        self.nameLab.text = model.name
+        self.incomeLab.text = conversionUnit(number: model.operatingIncome)
+        self.rateLab.text = precisionString(with: model.incomeRatio, precision: "2")  + "%"
+    }
+
+}

+ 120 - 0
Koala/Koala/Modular/Market/V/MarketDetailView/MDFinanceView/MDFinanceListCell.xib

@@ -0,0 +1,120 @@
+<?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"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="MDFinanceListCell" customModule="Koala" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="179" height="210"/>
+            <autoresizingMask key="autoresizingMask"/>
+            <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
+                <rect key="frame" x="0.0" y="0.0" width="179" height="210"/>
+                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                <subviews>
+                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9bH-fc-3JU">
+                        <rect key="frame" x="0.0" y="0.0" width="179" height="210"/>
+                        <subviews>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ro3-oO-1TY">
+                                <rect key="frame" x="15" y="15.333333333333336" width="10" height="10"/>
+                                <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="10" id="GhG-K5-d2d"/>
+                                    <constraint firstAttribute="width" constant="10" id="exs-gE-kJw"/>
+                                </constraints>
+                            </view>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dln-ax-jQG">
+                                <rect key="frame" x="30.000000000000004" y="9.9999999999999982" width="41.333333333333343" height="20.333333333333329"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="2" translatesAutoresizingMaskIntoConstraints="NO" id="KYn-WA-G71">
+                                <rect key="frame" x="15" y="45.333333333333336" width="149" height="35.000000000000007"/>
+                                <subviews>
+                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="OAW-mW-uM6">
+                                        <rect key="frame" x="0.0" y="0.0" width="149" height="20.333333333333332"/>
+                                        <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" ambiguous="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NGD-gY-7L6">
+                                        <rect key="frame" x="0.0" y="22.333333333333336" width="149" height="12.666666666666664"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                        <nil key="textColor"/>
+                                        <nil key="highlightedColor"/>
+                                    </label>
+                                </subviews>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="35" id="1NB-IM-Yfc"/>
+                                </constraints>
+                            </stackView>
+                            <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="2" translatesAutoresizingMaskIntoConstraints="NO" id="pGi-kg-Amb">
+                                <rect key="frame" x="15" y="95.333333333333329" width="150" height="34.999999999999986"/>
+                                <subviews>
+                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xBV-Dr-eWT">
+                                        <rect key="frame" x="0.0" y="0.0" width="150" height="20.333333333333332"/>
+                                        <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" ambiguous="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Fgn-qX-k2T">
+                                        <rect key="frame" x="0.0" y="22.333333333333343" width="150" height="12.666666666666664"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                        <nil key="textColor"/>
+                                        <nil key="highlightedColor"/>
+                                    </label>
+                                </subviews>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="35" id="Ghm-Yz-sdF"/>
+                                </constraints>
+                            </stackView>
+                        </subviews>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                        <constraints>
+                            <constraint firstItem="KYn-WA-G71" firstAttribute="leading" secondItem="9bH-fc-3JU" secondAttribute="leading" constant="15" id="0Q0-4E-RR3"/>
+                            <constraint firstAttribute="trailing" secondItem="pGi-kg-Amb" secondAttribute="trailing" constant="14" id="OXW-cL-xYh"/>
+                            <constraint firstItem="dln-ax-jQG" firstAttribute="leading" secondItem="Ro3-oO-1TY" secondAttribute="trailing" constant="5" id="Oao-PG-e9F"/>
+                            <constraint firstItem="pGi-kg-Amb" firstAttribute="top" secondItem="KYn-WA-G71" secondAttribute="bottom" constant="15" id="XLS-hQ-zic"/>
+                            <constraint firstItem="Ro3-oO-1TY" firstAttribute="centerY" secondItem="dln-ax-jQG" secondAttribute="centerY" id="dlP-na-bvi"/>
+                            <constraint firstAttribute="trailing" secondItem="KYn-WA-G71" secondAttribute="trailing" constant="15" id="k2y-Zp-EGv"/>
+                            <constraint firstItem="Ro3-oO-1TY" firstAttribute="leading" secondItem="9bH-fc-3JU" secondAttribute="leading" constant="15" id="l3U-S7-MPy"/>
+                            <constraint firstItem="dln-ax-jQG" firstAttribute="top" secondItem="9bH-fc-3JU" secondAttribute="top" constant="10" id="tXA-J2-GXX"/>
+                            <constraint firstItem="pGi-kg-Amb" firstAttribute="leading" secondItem="9bH-fc-3JU" secondAttribute="leading" constant="15" id="vjg-Sc-OMU"/>
+                            <constraint firstItem="KYn-WA-G71" firstAttribute="top" secondItem="dln-ax-jQG" secondAttribute="bottom" constant="15" id="vyQ-RM-weF"/>
+                        </constraints>
+                    </view>
+                </subviews>
+            </view>
+            <viewLayoutGuide key="safeArea" id="ZTg-uK-7eu"/>
+            <constraints>
+                <constraint firstItem="9bH-fc-3JU" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="1a2-qm-TGw"/>
+                <constraint firstItem="9bH-fc-3JU" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="PsI-XX-lsP"/>
+                <constraint firstAttribute="trailing" secondItem="9bH-fc-3JU" secondAttribute="trailing" id="afF-0E-CfB"/>
+                <constraint firstAttribute="bottom" secondItem="9bH-fc-3JU" secondAttribute="bottom" id="x3N-rR-Jpc"/>
+            </constraints>
+            <size key="customSize" width="179" height="210"/>
+            <connections>
+                <outlet property="bgView" destination="9bH-fc-3JU" id="Oug-MY-hYh"/>
+                <outlet property="dotView" destination="Ro3-oO-1TY" id="M4r-2s-IFA"/>
+                <outlet property="incomeLab" destination="OAW-mW-uM6" id="2Gc-mm-Vgu"/>
+                <outlet property="incomeTitleLab" destination="NGD-gY-7L6" id="SPd-b2-RaL"/>
+                <outlet property="nameLab" destination="dln-ax-jQG" id="KVw-Ke-c5h"/>
+                <outlet property="rateLab" destination="xBV-Dr-eWT" id="NaO-2w-0Zc"/>
+                <outlet property="rateTitleLab" destination="Fgn-qX-k2T" id="dKq-AA-Sk6"/>
+            </connections>
+            <point key="canvasLocation" x="31.297709923664122" y="76.056338028169023"/>
+        </collectionViewCell>
+    </objects>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 167 - 6
Koala/Koala/Modular/Market/V/MarketDetailView/MDFinanceView/MDFinanceView.swift

@@ -10,12 +10,173 @@ 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
+    var VM: MDFinanceViewModel?
+    
+    lazy var tableView: BaseTableView = { [weak self] in
+        let tableView = BaseTableView.init(frame: .zero, style: .grouped)
+        tableView.separatorStyle = .none
+        tableView.separatorColor = ViewBorderColor
+        tableView.separatorInset = UIEdgeInsets.init(top: 0, left: 0, bottom: 0, right: 0)
+        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: "MDFinanceCell", bundle: nil), forCellReuseIdentifier: "MDFinanceCell")
+        
+        tableView.register(UINib.init(nibName: "MDIndicatorCell", bundle: nil), forCellReuseIdentifier: "MDIndicatorCell")
+        
+      
+        if #available(iOS 11, *){
+            tableView.contentInsetAdjustmentBehavior = .never
+        }
+        return tableView
+        }()
+    
+
+   
+    
+    override func subView() {
+        self.addSubview(tableView)
+
+        mySwitchLanguage()
+        mySwitchSkin()
+        
+    }
+    
+    override func layoutSubviews() {
+        super.layoutSubviews()
+        tableView.snp.makeConstraints { make in
+            make.top.right.bottom.left.equalToSuperview()
+        }
+        
+       
+       
+    }
+    
+    override func setViewModel(viewmodel: AnyObject) {
+        guard viewmodel is MDFinanceViewModel else {
+            return
+        }
+        self.VM = viewmodel as? MDFinanceViewModel
+        super.setViewModel(viewmodel: viewmodel)
+       
+    }
+    
+    override func mySwitchLanguage() {
+        //self.footerView.mySwitchLanguage()
+       
+    }
+    
+    override func mySwitchSkin() {
+        self.tableView.backgroundColor = .clear
+        self.backgroundColor = ALLBackGroundColor
+       
+    }
+    
+
+    override func blindModel() {
+        VM?.financeAction.values.observeValues({[weak self] (success) in
+            guard let self = self else { return }
+            if success {
+                self.reloadTable()
+            }
+        })
+        
+        VM?.indicatorAction.values.observeValues({[weak self] (success) in
+            guard let self = self else { return }
+            if success {
+                self.reloadTable()
+            }
+        })
+        
+        VM?.signalFinance.observeValues({ [weak self] (isSocket) in
+            self?.reloadTable()
+        })
+        
+    }
+    
+   
+    func reloadTable() {
+        DispatchQueue.main.async {
+//            self.tableView.mj_header!.endRefreshing()
+            self.tableView.reloadData()
+        }
     }
-    */
 
 }
+
+//代理
+extension MDFinanceView:UITableViewDelegate,UITableViewDataSource{
+    func numberOfSections(in tableView: UITableView) -> Int {
+        return 2
+    }
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        return 1
+    }
+    
+    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+        if indexPath.section == 0 {
+            let cell:MDFinanceCell = tableView.dequeueReusableCell(withIdentifier: "MDFinanceCell") as! MDFinanceCell
+            cell.updateCellWith(list: self.VM!.screenFinanceList,type: self.VM!.financeType)
+            cell.completeBlock = {[weak self] index in
+                self?.VM?.financeType = index
+                
+            }
+            return cell
+        }
+       
+        let cell:MDIndicatorCell = tableView.dequeueReusableCell(withIdentifier: "MDIndicatorCell") as! MDIndicatorCell
+       
+        cell.updateCellWith(list: self.VM!.indicatorList, screenList: self.VM!.iScreenList)
+        
+        return cell
+    }
+    
+    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
+        if indexPath.section == 0{
+            var count = self.VM!.screenFinanceList.count/2
+            if self.VM!.screenFinanceList.count%2 > 0 {
+                count += 1
+            }
+          
+            if (count > 0){
+                return CGFloat(350 + count * 134 + (count-1)*5)
+            }
+            return 350
+        }
+    
+        return 350
+    }
+    
+    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
+        return UIView()
+    }
+    
+    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
+        let footer:UIView = UIView()
+        footer.backgroundColor = ViewBorderColor
+        return footer
+    }
+    
+    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
+        return 0.01
+    }
+    
+    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
+        if section == 0{
+            return 5
+        }
+        return 0.01
+    }
+    
+    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
+      
+    }
+    
+}
+

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

@@ -0,0 +1,471 @@
+//
+//  MDIndicatorCell.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/14.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+import Charts
+
+class MDIndicatorCell: BaseTableViewCell {
+    @IBOutlet weak var titleBtn: UIButton!
+    @IBOutlet weak var collectionView: UICollectionView!
+    
+    @IBOutlet weak var unitBtn: UIButton!
+    @IBOutlet weak var screenBtn: UIButton!
+    @IBOutlet weak var klineBgView: UIView!
+    
+    lazy var barChartView: BarChartView   = {
+        let barChartView: BarChartView = BarChartView()
+        barChartView.delegate = self
+        barChartView.backgroundColor = .clear
+        return barChartView
+    }()
+    
+    lazy var screenList:[MDIndicatorModel] = {
+        let arr:[MDIndicatorModel] = [MDIndicatorModel]()
+        return arr
+    }()
+    
+    var screenTypeList:[MDIScreenListModel] = [MDIScreenListModel]()
+    
+    var listData:[MDIndicatorModel] = [MDIndicatorModel]()
+    
+    var reportType:String = ""
+
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        
+        self.backgroundColor = ALLBackGroundColor
+        
+        self.titleBtn.setTextFont(.PFSM, 18)
+        self.titleBtn.setTitleColor(TitleTextColor, for: .normal)
+        self.titleBtn.setTitle(switchLanguage("财务关键指标"), for: .normal)
+        self.titleBtn.setImage(_image("Market_about&Market_about"), for: .normal)
+        self.titleBtn.layoutButtonEdgeInsetStyle(type: .right, space: 2)
+        
+        let layout = UICollectionViewFlowLayout.init()
+        layout.scrollDirection = UICollectionView.ScrollDirection.vertical
+        layout.minimumInteritemSpacing = 3
+        layout.minimumLineSpacing = 3
+        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: MDIndicatorListCell.self)
+        
+        
+        self.unitBtn.setTitle(switchLanguage("币种"+":"+SaveData.shared().getExchangeRate()), for: .normal)
+        self.unitBtn.setTextFont(.PFSR, 14)
+        self.unitBtn.setTitleColor(MidTextColor, for: .normal)
+        
+        self.screenBtn.setTitleColor(MidTextColor, for: .normal)
+        self.screenBtn.setTitle(switchLanguage("累计季报"), for: .normal)
+        self.screenBtn.setViewLayerBorderColor(myColor: ViewBorderColor, borderWidth: 1, maskBounds: 15)
+        self.screenBtn.setTextFont(.PFSR, 14)
+        self.screenBtn.setImage(Base_Down_Arrows_Image, for: .normal)
+        self.screenBtn.layoutButtonEdgeInsetStyle(type: .right, space: 2)
+        self.screenBtn.contentEdgeInsets = UIEdgeInsets(top: 0, left: 15, bottom: 0, right: 15)
+        
+        self.screenBtn.addTarget(self, action: #selector(clickScreenBtnAction), for: .touchUpInside)
+        
+        
+        self.klineBgView.addSubview(barChartView)
+        barChartView.snp.makeConstraints { make in
+            make.top.bottom.equalToSuperview()
+            make.left.equalTo(15)
+            make.right.equalTo(-15)
+        }
+        
+        setBarChartViewBaseStyle()
+        setBarChartViewXY()
+        // Initialization code
+    }
+
+    override func setSelected(_ selected: Bool, animated: Bool) {
+        super.setSelected(selected, animated: animated)
+
+        // Configure the view for the selected state
+    }
+    
+    func updateCellWith(list:[MDIndicatorModel],screenList:[MDIScreenListModel]) -> Void {
+        self.listData = list
+        self.screenTypeList = screenList
+        self.screenDataBy()
+        self.collectionView.reloadData()
+        
+    }
+    
+}
+
+extension MDIndicatorCell{
+    @objc func clickScreenBtnAction(){
+        let pop = KMenuPopupMenuView()
+        var list:[(UIImage,String,Bool)] = [(UIImage,String,Bool)]()
+        list = [
+            (UIImage(),switchLanguage("年报"),true),
+            (UIImage(),switchLanguage("累计季报"),true)
+        ]
+        
+        pop.showRelyPopupView(view: self.screenBtn, source: list,sStr: "",leftB: 50) {[weak self] index in
+            if index >= 0 {
+                if index == 0 {
+                    self?.screenBtn.setTitle(switchLanguage("年报"), for: .normal)
+                    self?.reportType = "FY"
+                }
+                else if index == 1{
+                    self?.screenBtn.setTitle(switchLanguage("累计季报"), for: .normal)
+                    self?.reportType = ""
+                }
+                
+                self?.screenBtn.setImage(Base_Down_Arrows_Image, for: .normal)
+                self?.screenBtn.layoutButtonEdgeInsetStyle(type: .right, space: 2)
+                self?.screenDataBy()
+            }
+        }
+        
+    }
+    
+    func screenDataBy() -> Void {
+        self.screenList.removeAll()
+        for model in self.listData{
+            if self.reportType.length > 0{
+                if  model.reportType == self.reportType{
+                    self.screenList.append(model)
+                }
+            }else{
+                if  model.reportType != "FY"{
+                    self.screenList.append(model)
+                }
+            }
+        }
+        
+        var typeModel = MDIScreenListModel()
+        
+        for model in self.screenTypeList{
+            if model.isSelect {
+                typeModel = model
+                break
+            }
+        }
+        
+        for model in screenList {
+            if typeModel.type == "eps"{
+                model.value = precisionString(with: model.eps, precision: "2")
+                model.unit = ""
+                model.valueYoY = precisionString(with: model.epsYoY, precision: "2")
+                model.unitYoY = "%"
+            }
+            else if typeModel.type == "netAssetsPS"{
+                model.value = precisionString(with: model.netAssetsPS, precision: "2")
+                model.unit = ""
+                model.valueYoY = precisionString(with: model.netAssetsPsYoY, precision: "2")
+                model.unitYoY = "%"
+            }
+            else if typeModel.type == "currentRatio"{
+                model.value = precisionString(with: model.currentRatio, precision: "2")
+                model.unit = "%"
+                model.valueYoY = precisionString(with: model.currentRatioYoY, precision: "2")
+                model.unitYoY = "%"
+            }
+            else if typeModel.type == "quickRatio"{
+                model.value = precisionString(with: model.quickRatio, precision: "2")
+                model.unit = "%"
+                model.valueYoY = precisionString(with: model.quickRatioYoY, precision: "2")
+                model.unitYoY = "%"
+            }
+            else if typeModel.type == "returnOnEquity"{
+                model.value = precisionString(with: model.returnOnEquity, precision: "2")
+                model.unit = "%"
+                model.valueYoY = precisionString(with: model.returnOnEquityYoY, precision: "2")
+                model.unitYoY = "%"
+            }
+            else if typeModel.type == "returnOnTotalAssets"{
+                model.value = precisionString(with: model.returnOnTotalAssets, precision: "2")
+                model.unit = "%"
+                model.valueYoY = precisionString(with: model.returnOnTotalAssetsYoY, precision: "2")
+                model.unitYoY = "%"
+            }
+            else if typeModel.type == "grossProfitMargin"{
+                model.value = precisionString(with: model.grossProfitMargin, precision: "2")
+                model.unit = "%"
+                model.valueYoY = precisionString(with: model.grossProfitMarginYoY, precision: "2")
+                model.unitYoY = "%"
+            }
+            else if typeModel.type == "netIncomeRatio"{
+                model.value = precisionString(with: model.netIncomeRatio, precision: "2")
+                model.unit = "%"
+                model.valueYoY = precisionString(with: model.netIncomeRatioYoY, precision: "2")
+                model.unitYoY = "%"
+            }
+        }
+        
+        self.updataData(list: screenList)
+    }
+    
+   
+    
+    
+}
+
+extension MDIndicatorCell{
+    func setBarChartViewBaseStyle(){
+        //基本样式
+        barChartView.noDataText = "暂无数据"//没有数据时的显示
+        barChartView.drawValueAboveBarEnabled = false//数值显示是否在条柱上面
+        barChartView.drawBarShadowEnabled = false//是否绘制阴影背景
+        
+        //交互设置
+//        barChartView.scaleXEnabled = false//取消X轴缩放
+        barChartView.scaleYEnabled = true//
+        barChartView.doubleTapToZoomEnabled = false//
+        barChartView.dragEnabled = true //启用拖拽图表
+        barChartView.dragDecelerationEnabled = true //拖拽后是否有惯性效果
+        barChartView.dragDecelerationFrictionCoef = 0.9 //拖拽后惯性效果的摩擦系数(0~1),数值越小,惯性越不明显
+        barChartView.legend.enabled = false
+        barChartView.minOffset = 20
+    }
+    
+    func setBarChartViewXY(){
+        //1.X轴样式设置
+        let xAxis: XAxis = barChartView.xAxis
+        xAxis.valueFormatter = self //重写代理方法  设置x轴数据
+        xAxis.axisLineWidth = 0.5 //设置X轴线宽
+        xAxis.labelPosition = XAxis.LabelPosition.bottom //X轴
+        xAxis.drawGridLinesEnabled = false//不绘制网格
+        xAxis.drawAxisLineEnabled = false
+        xAxis.labelFont = _PFSR(12)
+        xAxis.labelCount = 2
+        xAxis.labelTextColor = NavViewTextColor
+        xAxis.avoidFirstLastClippingEnabled = true//不截取
+        xAxis.forceLabelsEnabled = true
+        xAxis.labelTextColor = NavViewTextColor
+
+    
+        //2.Y轴左样式设置(对应界面显示的--->0 到 100)
+        let leftAxis: YAxis = barChartView.leftAxis
+        
+        leftAxis.forceLabelsEnabled = false //不强制绘制制定数量的label
+        leftAxis.labelCount = 8
+        leftAxis.inverted = false   //是否将Y轴进行上下翻转
+        leftAxis.axisLineWidth = 0.5   //Y轴线宽
+        leftAxis.axisLineColor = .clear  //Y轴颜色
+        leftAxis.labelPosition = YAxis.LabelPosition.outsideChart//坐标数值的位置
+        leftAxis.labelTextColor = NavViewTextColor//坐标数值字体颜色
+        leftAxis.labelFont = _PFSR(12)//y轴字体大小
+        leftAxis.drawGridLinesEnabled = true //是否绘制网格线(默认为true)
+        leftAxis.gridColor = _color("#D2D2D2&#D2D2D2")
+        leftAxis.gridLineWidth = 0.5
+        leftAxis.spaceTop = 0.15//最大值到顶部的范围比
+        leftAxis.drawZeroLineEnabled = true
+        leftAxis.zeroLineColor = _color("#D2D2D2&#D2D2D2")
+        leftAxis.zeroLineWidth = 0.5
+        leftAxis.drawLabelsEnabled = false
+       // leftAxis.enabled = false //不绘制右边轴线
+        
+        //3.Y轴右样式设置
+        barChartView.rightAxis.enabled = false //不绘制右边轴线
+    }
+    
+    func updataData(list:[MDIndicatorModel]){
+    
+         //对应Y轴上面需要显示的数据
+        let yVals: NSMutableArray  = NSMutableArray.init()
+        for i in 0..<list.count {
+            let model = list[list.count-1-i]
+            let y = conerData(model.value, .MyDouble).2!
+            let entry:BarChartDataEntry  = BarChartDataEntry.init(x:  Double(i), y: Double(y))
+            yVals.add(entry)
+           
+        }
+    
+        
+         //创建BarChartDataSet对象,其中包含有Y轴数据信息,以及可以设置柱形样式
+        let set1: BarChartDataSet = BarChartDataSet.init(entries: yVals as? [ChartDataEntry], label: "bar")
+        set1.drawValuesEnabled = false //是否在柱形图上面显示数值
+        set1.highlightEnabled = true //点击选中柱形图是否有高亮效果,(单击空白处取消选中)
+        set1.colors = [_color("#FADF62&#FADF62")]
+        
+        
+        //对应Y轴上面需要显示的数据
+       let yVals2: NSMutableArray  = NSMutableArray.init()
+       for i in 0..<list.count {
+           let model = list[list.count-1-i]
+           let y = conerData(model.valueYoY, .MyDouble).2!
+           let entry:BarChartDataEntry  = BarChartDataEntry.init(x:  Double(i), y: Double(y))
+           yVals2.add(entry)
+          
+       }
+   
+       
+        //创建BarChartDataSet对象,其中包含有Y轴数据信息,以及可以设置柱形样式
+       let set2: BarChartDataSet = BarChartDataSet.init(entries: yVals2 as? [ChartDataEntry], label: "bar2")
+       set2.drawValuesEnabled = false //是否在柱形图上面显示数值
+       set2.highlightEnabled = true //点击选中柱形图是否有高亮效果,(单击空白处取消选中)
+       set2.colors = [_color("#FF6F30&#FF6F30")]
+       
+        
+        //创建BarChartData对象, 此对象就是barChartView需要最终数据对象
+        let data:  BarChartData = BarChartData.init(dataSets: [set1, set2] as? [IChartDataSet])
+        data.barWidth = 0.7  //默认是0.85  (介于0-1之间)
+        data.groupBars(fromX: Double(0), groupSpace: 0.31, barSpace: 0.03)
+        let formatter: NumberFormatter = NumberFormatter.init()
+        formatter.numberStyle = NumberFormatter.Style.currency//自定义数据显示格式  小数点形式(可以尝试不同看效果)
+        let forma :DefaultValueFormatter = DefaultValueFormatter.init(formatter: formatter)
+        data.setValueFormatter(forma)
+        barChartView.data = data
+        
+        barChartView.animate(yAxisDuration: 1)
+    
+    }
+    
+}
+
+extension MDIndicatorCell{
+    func showBalloonMarkerView(chartView: BarChartView,entry: ChartDataEntry,highlight: Highlight){
+       
+        let marker = BarBalloonMarker(color:MidBackGroundColor,
+                                   font: _PFSR(12),
+                                   textColor: TitleTextColor,borderColor:ViewBorderColor,
+                                   insets: UIEdgeInsets(top: 5, left: 5, bottom: 10, right: 5))
+        marker.chartView = chartView
+        marker.minimumSize = CGSize(width: 50, height: 30)
+        guard self.screenList.count > 0 else {
+            return
+        }
+        let i = self.screenList.count - 1 - Int(highlight.x)
+        let model = self.screenList[i]
+        
+        let title = model.reportDate + "/" + model.reportType
+        let value = model.value + model.unit
+        let value1 = model.valueYoY + model.unitYoY
+        marker.setLabel(String(format: "%@\n%@\n%@",title,value,value1))
+        chartView.marker = marker
+    }
+    
+}
+
+extension MDIndicatorCell :ChartViewDelegate,IAxisValueFormatter {
+    func stringForValue(_ value: Double, axis: AxisBase?) -> String {
+        if axis == barChartView.leftAxis ||  axis == barChartView.rightAxis{
+            return String(Int(value))
+        }
+        if axis == barChartView.xAxis || axis == barChartView.xAxis {
+            let index = Int(value)
+            guard self.screenList.count > 0 else {
+                return ""
+            }
+            let i = self.screenList.count - 1 - index
+            let model = self.screenList[i]
+            
+            return model.reportDate
+        }
+        return ""
+    }
+    //1.点击选中
+    func chartValueSelected(_ chartView: ChartViewBase, entry: ChartDataEntry, highlight: Highlight) {
+        showBalloonMarkerView(chartView: self.barChartView, entry: entry,highlight: highlight)
+    }
+    //2.没有选中
+    func chartValueNothingSelected(_ chartView: ChartViewBase) {
+         
+    }
+    //3.捏合放大或缩小
+    func chartScaled(_ chartView: ChartViewBase, scaleX: CGFloat, scaleY: CGFloat) {
+       
+    }
+    //4.拖拽图表
+    func chartTranslated(_ chartView: ChartViewBase, dX: CGFloat, dY: CGFloat) {
+       
+    }
+}
+
+
+
+
+
+extension MDIndicatorCell : UICollectionViewDelegateFlowLayout, UICollectionViewDelegate, UICollectionViewDataSource{
+    
+    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        return self.screenTypeList.count
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        let cell = collectionView.base_dequeueReusableCell(indexPath: indexPath) as MDIndicatorListCell
+        
+        cell.updateCellDataWith(model: self.screenTypeList[indexPath.row])
+        return cell
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
+        return CGSize(width: (SCREEN_WIDTH-30-12-1)/4, height:30)
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+        
+        for (i,model) in self.screenTypeList.enumerated(){
+            if i == indexPath.row{
+                model.isSelect = true
+            }else{
+                model.isSelect = false
+            }
+        }
+        self.screenDataBy()
+        self.collectionView.reloadData()
+        
+    }
+    
+}
+
+
+
+class MDIndicatorListCell: UICollectionViewCell {
+    lazy var titleLab:UILabel = {
+        let lab:UILabel = UILabel.init()
+        lab.setTextFont(.PFSR, 12)
+        lab.textColor = WhiteTextColor
+        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:MDIScreenListModel) -> Void {
+        
+        self.titleLab.text = model.name
+        if model.isSelect {
+            self.titleLab.textColor = WhiteTextColor
+            self.contentView.backgroundColor = MainBackGroundColor
+        }else{
+            self.titleLab.textColor = TitleTextColor
+            self.contentView.backgroundColor = MidBackGroundColor
+        }
+    }
+    
+}
+
+
+

+ 117 - 0
Koala/Koala/Modular/Market/V/MarketDetailView/MDFinanceView/MDIndicatorCell.xib

@@ -0,0 +1,117 @@
+<?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"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="210" id="KGk-i7-Jjw" customClass="MDIndicatorCell" customModule="Koala" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="370" height="210"/>
+            <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="370" height="210"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="Ryp-LY-czv">
+                        <rect key="frame" x="0.0" y="0.0" width="370" height="210"/>
+                        <subviews>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="j2d-Yp-TqP">
+                                <rect key="frame" x="0.0" y="0.0" width="370" height="40"/>
+                                <subviews>
+                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9tk-Yv-5Dt">
+                                        <rect key="frame" x="15" y="1" width="54" height="34"/>
+                                        <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="bottom" secondItem="9tk-Yv-5Dt" secondAttribute="bottom" constant="5" id="B65-Re-0cw"/>
+                                    <constraint firstAttribute="height" constant="40" id="Cya-MS-4OI"/>
+                                    <constraint firstItem="9tk-Yv-5Dt" firstAttribute="leading" secondItem="j2d-Yp-TqP" secondAttribute="leading" constant="15" id="DOP-KW-lOD"/>
+                                </constraints>
+                            </view>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="w64-uh-6ZQ">
+                                <rect key="frame" x="0.0" y="40" width="370" height="73"/>
+                                <subviews>
+                                    <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="1m6-yS-yyq">
+                                        <rect key="frame" x="15" y="5" width="340" height="63"/>
+                                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                                        <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="iUJ-kl-fpY">
+                                            <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>
+                                </subviews>
+                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                <constraints>
+                                    <constraint firstAttribute="bottom" secondItem="1m6-yS-yyq" secondAttribute="bottom" constant="5" id="2ni-Ao-heO"/>
+                                    <constraint firstItem="1m6-yS-yyq" firstAttribute="top" secondItem="w64-uh-6ZQ" secondAttribute="top" constant="5" id="6kQ-1U-x1D"/>
+                                    <constraint firstAttribute="height" constant="73" id="WwG-iP-ya6"/>
+                                    <constraint firstItem="1m6-yS-yyq" firstAttribute="leading" secondItem="w64-uh-6ZQ" secondAttribute="leading" constant="15" id="iZd-fm-sSM"/>
+                                    <constraint firstAttribute="trailing" secondItem="1m6-yS-yyq" secondAttribute="trailing" constant="15" id="uWm-ab-lbV"/>
+                                </constraints>
+                            </view>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2GE-fS-JR5">
+                                <rect key="frame" x="0.0" y="113" width="370" height="40"/>
+                                <subviews>
+                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="nYu-97-ikg">
+                                        <rect key="frame" x="15" y="3" width="30" height="34"/>
+                                        <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="UzE-cl-6Fu">
+                                        <rect key="frame" x="325" y="5" width="30" height="30"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="30" id="2X9-2s-mJK"/>
+                                        </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="nYu-97-ikg" firstAttribute="leading" secondItem="2GE-fS-JR5" secondAttribute="leading" constant="15" id="0Gg-mq-aX6"/>
+                                    <constraint firstItem="nYu-97-ikg" firstAttribute="centerY" secondItem="2GE-fS-JR5" secondAttribute="centerY" id="IGI-Y3-bEh"/>
+                                    <constraint firstItem="UzE-cl-6Fu" firstAttribute="centerY" secondItem="2GE-fS-JR5" secondAttribute="centerY" id="LNI-My-1ti"/>
+                                    <constraint firstAttribute="trailing" secondItem="UzE-cl-6Fu" secondAttribute="trailing" constant="15" id="YTh-fB-Uju"/>
+                                    <constraint firstAttribute="height" constant="40" id="b63-70-TNO"/>
+                                </constraints>
+                            </view>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PYt-4M-KdC">
+                                <rect key="frame" x="0.0" y="153" width="370" height="57"/>
+                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            </view>
+                        </subviews>
+                    </stackView>
+                </subviews>
+                <constraints>
+                    <constraint firstAttribute="trailing" secondItem="Ryp-LY-czv" secondAttribute="trailing" id="8ZC-TH-Xeg"/>
+                    <constraint firstAttribute="bottom" secondItem="Ryp-LY-czv" secondAttribute="bottom" id="JpX-94-bTX"/>
+                    <constraint firstItem="Ryp-LY-czv" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="Tks-kS-JZm"/>
+                    <constraint firstItem="Ryp-LY-czv" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="jCb-jH-gfh"/>
+                </constraints>
+            </tableViewCellContentView>
+            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
+            <connections>
+                <outlet property="collectionView" destination="1m6-yS-yyq" id="Vcy-zm-FbX"/>
+                <outlet property="klineBgView" destination="PYt-4M-KdC" id="WRf-V0-ung"/>
+                <outlet property="screenBtn" destination="UzE-cl-6Fu" id="lUM-n4-YhM"/>
+                <outlet property="titleBtn" destination="9tk-Yv-5Dt" id="mZd-Bi-eme"/>
+                <outlet property="unitBtn" destination="nYu-97-ikg" id="xcS-Xp-VTg"/>
+            </connections>
+            <point key="canvasLocation" x="158.77862595419847" y="130.98591549295776"/>
+        </tableViewCell>
+    </objects>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

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

@@ -0,0 +1,43 @@
+//
+//  MDNewsListCell.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/15.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MDNewsListCell: BaseTableViewCell {
+    @IBOutlet weak var titleLab: UILabel!
+    @IBOutlet weak var timerLab: UILabel!
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        
+        self.backgroundColor = .clear
+        
+        self.titleLab.setTextFont(.PFSR, 14)
+        self.titleLab.textColor = TitleTextColor
+        
+        self.timerLab.setTextFont(.PFSR, 12)
+        self.timerLab.textColor = MidTextColor
+        // Initialization code
+    }
+
+    override func setSelected(_ selected: Bool, animated: Bool) {
+        super.setSelected(selected, animated: animated)
+
+        // Configure the view for the selected state
+    }
+    
+    func updateCellWith(model:MDNewsModel) -> Void {
+        self.titleLab.text = model.title
+        if model.time.length > 0 {
+            self.timerLab.text = model.time
+        }else{
+            self.timerLab.text = model.created_at
+        }
+    }
+    
+}

+ 49 - 0
Koala/Koala/Modular/Market/V/MarketDetailView/MDNewsView/MDNewsListCell.xib

@@ -0,0 +1,49 @@
+<?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="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="173" id="KGk-i7-Jjw" customClass="MDNewsListCell" customModule="Koala" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="421" height="173"/>
+            <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="421" height="173"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="252" text="LabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabel" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UOZ-0R-bnK">
+                        <rect key="frame" x="15" y="14.999999999999996" width="391" height="40.666666666666657"/>
+                        <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="gn8-oL-riM">
+                        <rect key="frame" x="15" y="65.666666666666686" width="391" height="92.333333333333314"/>
+                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                        <nil key="textColor"/>
+                        <nil key="highlightedColor"/>
+                    </label>
+                </subviews>
+                <constraints>
+                    <constraint firstItem="UOZ-0R-bnK" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="15" id="FIW-BM-IS7"/>
+                    <constraint firstItem="gn8-oL-riM" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="MYm-00-gX7"/>
+                    <constraint firstAttribute="bottom" secondItem="gn8-oL-riM" secondAttribute="bottom" constant="15" id="PiF-Yh-1EE"/>
+                    <constraint firstAttribute="trailing" secondItem="UOZ-0R-bnK" secondAttribute="trailing" constant="15" id="RO6-nb-xD0"/>
+                    <constraint firstItem="gn8-oL-riM" firstAttribute="top" secondItem="UOZ-0R-bnK" secondAttribute="bottom" constant="10" id="cm9-OW-rNt"/>
+                    <constraint firstItem="UOZ-0R-bnK" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="hGs-ES-M7Y"/>
+                    <constraint firstAttribute="trailing" secondItem="gn8-oL-riM" secondAttribute="trailing" constant="15" id="hXF-bL-dQ6"/>
+                </constraints>
+            </tableViewCellContentView>
+            <connections>
+                <outlet property="timerLab" destination="gn8-oL-riM" id="Xyi-vq-QRL"/>
+                <outlet property="titleLab" destination="UOZ-0R-bnK" id="SJA-Vz-UQ6"/>
+            </connections>
+            <point key="canvasLocation" x="176" y="67"/>
+        </tableViewCell>
+    </objects>
+</document>

+ 141 - 7
Koala/Koala/Modular/Market/V/MarketDetailView/MDNewsView/MDNewsView.swift

@@ -7,15 +7,149 @@
 //
 
 import UIKit
-
+import MJRefresh
 class MDNewsView: BaseView {
+    var VM: MDNewsViewModel?
+    
+    lazy var tableView: BaseTableView = { [weak self] in
+        let tableView = BaseTableView.init(frame: .zero, style: .grouped)
+        tableView.separatorStyle = .singleLine
+        tableView.separatorColor = ViewBorderColor
+        tableView.separatorInset = UIEdgeInsets.init(top: 0, left: 0, bottom: 0, right: 0)
+        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: "MDNewsListCell", bundle: nil), forCellReuseIdentifier: "MDNewsListCell")
+        
+        
+        if #available(iOS 11, *){
+            tableView.contentInsetAdjustmentBehavior = .never
+        }
+        
+        
+        tableView.ly_emptyView = self!.showEmptyView()
+        
+        tableView.mj_header = MJRefreshHeader(refreshingBlock: { [weak self] in
+            self?.VM?.netNewsList(isUp: false)
+           
+        })
+        
+        tableView.mj_footer = MJRefreshAutoFooter.init(refreshingBlock: { [weak self] in
+            self?.VM?.netNewsList(isUp: true)
+            
+        })
+        
+        return tableView
+        }()
+    
+    override func subView() {
+        self.addSubview(tableView)
+       
+        mySwitchLanguage()
+        mySwitchSkin()
+        
+    }
+    
+    override func layoutSubviews() {
+        super.layoutSubviews()
+        tableView.snp.makeConstraints { make in
+            make.edges.equalToSuperview()
+        }
+       
+    }
+    
+    override func setViewModel(viewmodel: AnyObject) {
+        guard viewmodel is MDNewsViewModel else {
+            return
+        }
+        self.VM = viewmodel as? MDNewsViewModel
+        super.setViewModel(viewmodel: viewmodel)
+       
+    }
+    
+    override func mySwitchLanguage() {
+        //self.footerView.mySwitchLanguage()
+       
+    }
+    
+    override func mySwitchSkin() {
+        self.tableView.backgroundColor = .clear
+        self.backgroundColor = ALLBackGroundColor
+       
+    }
+    
 
-    /*
-    // Only override draw() if you perform custom drawing.
-    // An empty implementation adversely affects performance during animation.
-    override func draw(_ rect: CGRect) {
-        // Drawing code
+    override func blindModel() {
+        VM?.newsListAction.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()
+                }
+            }
+        })
     }
-    */
+    
+    
 
 }
+
+//代理
+extension MDNewsView:UITableViewDelegate,UITableViewDataSource{
+    func numberOfSections(in tableView: UITableView) -> Int {
+        return 1
+    }
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        return self.VM?.newsList.count ?? 0
+    }
+    
+    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+        let cell:MDNewsListCell = tableView.dequeueReusableCell(withIdentifier: "MDNewsListCell") as! MDNewsListCell
+        
+        guard let model = self.VM?.newsList[indexPath.row] else {
+            return cell
+            
+        }
+        cell.updateCellWith(model: model)
+        return cell
+    }
+    
+    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
+       return -1
+    }
+    
+    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.01
+    }
+    
+    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
+        return 0.01
+    }
+    
+    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
+        let model = self.VM!.newsList[indexPath.row]
+        let vc = InformationDetailViewController()
+        vc.id = model.id
+        currentVc()?.navigationController?.pushViewController(vc, animated: true)
+    }
+    
+}
+
+

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

@@ -62,6 +62,10 @@ class MarketListCell: BaseTableViewCell {
         if model.market == "HK"{
             self.markBtn.backgroundColor = _color("#EDF6FF&#EDF6FF")
             self.markBtn.setTitleColor(_color("#1989FF&#1989FF"), for: .normal)
+        }
+        else if model.market == "CFD"{
+            self.markBtn.backgroundColor = _color("#1989FF&#1989FF")
+            self.markBtn.setTitleColor(WhiteTextColor, for: .normal)
         }else{
             self.markBtn.backgroundColor = _color("#FFF1F1&#FFF1F1")
             self.markBtn.setTitleColor(_color("#EA4A45&#EA4A45"), for: .normal)

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

@@ -96,4 +96,34 @@ class MarketOptionsListCell: BaseTableViewCell {
         self.changeLab.textColor = exchangeColorAndImage(increase: conerData(model.increase as Any, .MyFloat).1!).0
     }
     
+    func updateHomeCellWith(model:OptionsListModel) -> Void {
+        self.mySwitchColor()
+        self.nameLab.text = model.title
+        self.markBtn.setTitle(model.market, for: .normal)
+        self.numberLab.text = model.code
+        
+        if model.symbolData.market == "HK"{
+            self.markBtn.backgroundColor = _color("#EDF6FF&#EDF6FF")
+            self.markBtn.setTitleColor(_color("#1989FF&#1989FF"), for: .normal)
+        }
+        else if model.market == "CFD"{
+            self.markBtn.backgroundColor = _color("#1989FF&#1989FF")
+            self.markBtn.setTitleColor(WhiteTextColor, for: .normal)
+        }
+        else{
+            self.markBtn.backgroundColor = _color("#FFF1F1&#FFF1F1")
+            self.markBtn.setTitleColor(_color("#EA4A45&#EA4A45"), for: .normal)
+        }
+        
+        self.changeLab.text = model.price_1m + "%"
+        self.changeLab.textColor = exchangeColorAndImage(increase: conerData( model.price_1m, .MyFloat).1!).0
+        
+        self.meanLab.text = model.standard + switchLanguage("万")
+        self.meanLab.textColor = TitleTextColor
+        
+        self.virtualLab.text = model.price_1m + switchLanguage("万")
+        self.virtualLab.textColor = TitleTextColor
+        
+    }
+    
 }

+ 36 - 12
Koala/Koala/Modular/Market/V/MarketView/MarketView.swift

@@ -18,6 +18,8 @@ class MarketView: BaseView {
         v.segmentedControl.indexChangeBlock = {[weak self](index) in
             if index == 0 && !OperationalUserInfoData.getLogin(){
                 v.segmentedControl.selectedSegmentIndex = UInt(self!.VM!.topIndex)
+                currentVc()!.navigationController?.pushViewController(LoginViewController(), animated: true)
+                return
             }else{
                 if index == 0 {
                     self?.recommendView.isHidden = self!.VM!.collectionSymbolList.count > 0
@@ -36,14 +38,7 @@ class MarketView: BaseView {
                 }
                 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)
-                }
+                self?.updateHeaderView(index: Int(index))
             }
         }
         return v
@@ -366,6 +361,17 @@ class MarketView: BaseView {
         }
     }
     
+    func updateHeaderView(index:Int) -> Void {
+        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)
+        }
+    }
+    
     
     
 }
@@ -431,11 +437,29 @@ extension MarketView:UITableViewDelegate,UITableViewDataSource{
     
     
     func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
-        let model = self.VM?.screenSymbolList[indexPath.row]
+        if indexPath.section == 0 {
+            let model = self.VM?.screenSymbolList[indexPath.row]
 
-        let vc = MarketDetailViewController()
-        vc.symbolModel = model!
-        currentVc()?.navigationController?.pushViewController(vc, animated: true)
+            let vc = MarketDetailViewController()
+            vc.symbolModel = model!
+            currentVc()?.navigationController?.pushViewController(vc, animated: true)
+        }
+        else if indexPath.section == 0{
+            let model = self.VM?.screenSymbolList[indexPath.row]
+
+            let vc = MarketDetailViewController()
+            vc.symbolModel = model!
+            currentVc()?.navigationController?.pushViewController(vc, animated: true)
+        }
+        else{
+            let model = self.VM?.optionList[indexPath.row]
+
+            let vc = MarketDetailViewController()
+            vc.symbolModel = model!.symbolData
+            vc.index = 4
+            currentVc()?.navigationController?.pushViewController(vc, animated: true)
+        }
+       
         
         
     }

+ 104 - 6
Koala/Koala/Modular/Market/VC/MarketDetailViewController.swift

@@ -10,7 +10,13 @@ import UIKit
 
 class MarketDetailViewController: BaseViewController {
     
+    var symbolCode:String = ""
     var symbolModel:KSymbolModel = KSymbolModel()
+    var index:Int = 0 {
+        didSet{
+            updateContentOffset()
+        }
+    }
     
     var auoteViewModel:MDAuoteViewModel = MDAuoteViewModel()
     var financeViewModel:MDFinanceViewModel = MDFinanceViewModel()
@@ -124,8 +130,7 @@ class MarketDetailViewController: BaseViewController {
         segmentedControl.segmentEdgeInset = UIEdgeInsets.init(top: 0, left: 10, bottom: 0, right: 10)
         segmentedControl.indexChangeBlock = {[weak self](index) in
             guard let self = self else{return}
-            self.scrollView.setContentOffset(CGPoint(x:SCREEN_WIDTH*CGFloat(index), y:0), animated: true)
-            self.reloadTable(index: Int(index))
+            self.index = Int(index)
             
         }
         segmentedControl.sectionTitles = [switchLanguage("报价"),switchLanguage("财务"),switchLanguage("简况"),switchLanguage("新闻"),switchLanguage("公告"),switchLanguage("个股期股")]
@@ -144,7 +149,7 @@ class MarketDetailViewController: BaseViewController {
         let view:MarketDetailNavView = MarketDetailNavView.init(frame: CGRect(x: 0, y: 0, width: SCREEN_WIDTH, height: TopHeight))
         
         view.shareBlock = {
-            
+           sharePopShow()
         }
         view.collectionBlock = {[weak self] in
             if self!.symbolModel.isCollection {
@@ -173,12 +178,39 @@ class MarketDetailViewController: BaseViewController {
         self.view.addSubview(menuBtn)
         self.view.addSubview(scrollView)
         
+        if self.symbolModel.symbol.length > 0 {
+            self.netAction()
+        }else{
+            self.netSymbolDetail()
+        }
+        
+        NotificationCenter.default.addObserver(self, selector: #selector(webSocketdidReceive), name: NSNotification.Name(rawValue:CurrentSocketReceiveTextNotiName), object: nil)
+        
+        // Do any additional setup after loading the view.
+    }
+    
+    func netAction() -> Void {
+        
+        if self.symbolModel.market == "CFD"{
+            self.segmentedControl.sectionTitles = [switchLanguage("报价")]
+        }else{
+            segmentedControl.sectionTitles = [switchLanguage("报价"),switchLanguage("财务"),switchLanguage("简况"),switchLanguage("新闻"),switchLanguage("公告"),switchLanguage("个股期股")]
+        }
+        
         self.navView.updateDataWith(model: self.symbolModel)
         
         self.auoteViewModel.symbolModel = self.symbolModel
         self.reloadTable(index: 0)
         
-        // Do any additional setup after loading the view.
+        self.financeViewModel.symbolModel = self.symbolModel
+        
+        self.newsViewModel.symbolModel = self.symbolModel
+    }
+    
+    func updateContentOffset() -> Void {
+        self.segmentedControl.selectedSegmentIndex = UInt(index)
+        self.scrollView.setContentOffset(CGPoint(x:SCREEN_WIDTH*CGFloat(index), y:0), animated: true)
+        self.reloadTable(index: Int(index))
     }
     
     override func updateViewConstraints() {
@@ -198,25 +230,66 @@ class MarketDetailViewController: BaseViewController {
     func reloadTable(index:Int) -> Void {
         if index == 0 {
             self.auoteView.VM?.netGetPriceList()
+            self.auoteView.VM?.netGetPriceDept()
+            self.auoteView.VM?.netCompanyInfo()
             self.auoteView.reloadTable()
         }
         else if index == 1 {
+            self.financeView.VM?.netFinance()
+            self.financeView.VM?.netIndicator()
             
         }
         else if index == 2 {
            
         }
         else if index == 3{
-            
+            self.newsView.VM?.netNewsList(isUp: false)
         }
     }
     
-
+    deinit {
+        NotificationCenter.default.removeObserver(self)
+    }
    
 
 }
 
 extension MarketDetailViewController{
+    
+    func netSymbolDetail() -> Void {
+       
+        let param:[String:Any] = [
+            "symbol":getJSONStringFromArray(array: [self.symbolCode])
+        ]
+        ProgressHUD.showLoading()
+
+        NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForHomeSymbolList,parameters: param, success: {[weak self] (code, result) in
+            ProgressHUD.hideHud()
+            if let list:[NSDictionary] = result?["list"] as? [NSDictionary] {
+                for dic in list {
+                    let model = KSymbolModel.deserialize(from: dic)
+                    var ask = model!.ask
+                    if conerData(ask, .MyDouble).2! == 0{
+                        ask = model!.open
+                    }
+                    model?.newPrice = precisionString(with: ask, precision: model!.digits)
+                    let np = decimalNumber(A: model!.newPrice, B: model!.open, type: .Subtract, scale:model!.digits)
+                    let increase = (conerData(np, .MyDouble).2!/conerData(model!.open, .MyDouble).2!)*100
+                    model?.increase = String(format: "%.2f",increase)
+                    self?.symbolModel = model!
+                    self?.netAction()
+                }
+              
+            }else{
+                
+                ProgressHUD.showError(status:DataTypeErrorPrompt)
+            }
+           
+        }) { (code, result) in
+            ProgressHUD.showError(status: result as! String)
+        }
+    }
+    
     func netInsertProductUser() -> Void {
         ProgressHUD.showLoading()
         let parame:[String:Any] = ["symbol":self.symbolModel.symbol]
@@ -242,6 +315,31 @@ extension MarketDetailViewController{
     }
     
     
+    @objc func webSocketdidReceive(nofi: NSNotification) {
+        if let dict:NSDictionary = nofi.object as? NSDictionary {
+            guard let type = dict["type"] as? Int else {
+                return
+            }
+            if type == 0 {
+                if let currentSocket = dict.object(forKey: "currentSocket") as? NSDictionary {
+                    guard let symbol = currentSocket["symbol"] as? String else{
+                        return
+                    }
+                    
+                    if self.symbolModel.symbol == symbol {
+                        self.symbolModel.newPrice = String(format:"%@",currentSocket["ask"] as! CVarArg)
+                        let np = conerData(self.symbolModel.newPrice, .MyDouble).1! - conerData(self.symbolModel.open, .MyDouble).1!
+                        let increase = (conerData("\(np)", .MyDouble).2!/conerData(self.symbolModel.open, .MyDouble).2!)*100
+                        self.symbolModel.increase = String(format: "%.2f",increase)
+                        
+                        self.navView.updateDataWith(model: self.symbolModel)
+                    }
+                }
+                
+            }
+        }
+    }
+
     
 }
 

+ 5 - 3
Koala/Koala/Modular/Market/VC/MarketViewController.swift

@@ -30,12 +30,15 @@ class MarketViewController: BaseViewController {
         if self.marketView.navView.segmentedControl.selectedSegmentIndex == 0 && !OperationalUserInfoData.getLogin(){
             self.marketView.navView.segmentedControl.selectedSegmentIndex = 1
             self.marketView.headerView.segmentedControl.selectedSegmentIndex = 0
+            self.viewModel.topIndex = 1
             self.viewModel.index = 0
         }
         
         if MarketIndex >= 0 {
             self.marketView.navView.segmentedControl.selectedSegmentIndex = UInt(MarketIndex)
-            self.viewModel.index = MarketIndex
+            self.marketView.updateHeaderView(index: MarketIndex)
+            self.viewModel.topIndex = MarketIndex
+            self.viewModel.optionsIndex = 0
             MarketIndex = -1
         }
         
@@ -44,8 +47,7 @@ class MarketViewController: BaseViewController {
         if OperationalUserInfoData.getLogin(){
             self.viewModel.netUserList()
         }
-        
-        self.viewModel.netUserList()
+    
         OperationalSymbolSocketManager.shared().checkSymbolLinkStatus()
         OperationalNetworkData.gettExchangeRateComplete { rateModel in
             

+ 75 - 1
Koala/Koala/Modular/Market/VM/MDAuoteViewModel.swift

@@ -23,10 +23,15 @@ class MDAuoteViewModel: BaseViewModel {
         return arr
     }()
     
+    var depthModel:MarketDepthModel = MarketDepthModel()
     
-    let (signalPrice, observePrice) = Signal<Bool, Never>.pipe()
+    var companyModel:MCompanyModel = MCompanyModel()
     
+    let (signalPrice, observePrice) = Signal<Bool, Never>.pipe()
+    //jd_netForCompanyInfo
     var getPriceListAction: Action <(),(Bool),Never>!
+    var getPriceDepthAction: Action <(),(Bool),Never>!
+    var companyInfoAction: Action <(),(Bool),Never>!
     
     override func initialize() {
         getPriceListAction = Action<(),(Bool),Never> {[weak self] _ in
@@ -35,6 +40,18 @@ class MDAuoteViewModel: BaseViewModel {
             }
         }
         
+        getPriceDepthAction = Action<(),(Bool),Never> {[weak self] _ in
+            return SignalProducer<(Bool),Never>{ observer, _ in
+                self?.requestGetPriceDepth(observer: observer)
+            }
+        }
+        
+        companyInfoAction = Action<(),(Bool),Never> {[weak self] _ in
+            return SignalProducer<(Bool),Never>{ observer, _ in
+                self?.requestCompanyInfo(observer: observer)
+            }
+        }
+        
     }
     
     override func webSocketdidReceive(nofi: NSNotification) {
@@ -85,6 +102,63 @@ extension MDAuoteViewModel {
         }
     }
     
+    
+    func netGetPriceDept() -> Void {
+        getPriceDepthAction.apply().start()
+    }
+    
+  
+    func requestGetPriceDepth(observer: Signal< Bool, Never>.Observer) -> Void {
+        let param = [
+            "symbol":self.symbolModel.symbol,
+        ]
+        ProgressHUD.showLoading()
+        NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForGetPriceDepth,parameters:param , success: { (code, result) in
+            ProgressHUD.hideHud()
+            if let dic:NSDictionary = result as? NSDictionary {
+                self.depthModel = MarketDepthModel.deserialize(from: dic)!
+                observer.send(value: true)
+            }else{
+                observer.send(value: false)
+                ProgressHUD.showError(status:DataTypeErrorPrompt)
+            }
+            observer.sendCompleted()
+        }) { (code, result) in
+            ProgressHUD.showError(status: result as! String)
+            observer.send(value: false)
+            observer.sendCompleted()
+        }
+    }
+    
+    func netCompanyInfo() -> Void {
+        companyInfoAction.apply().start()
+    }
+    
+  
+    func requestCompanyInfo(observer: Signal< Bool, Never>.Observer) -> Void {
+        let param = [
+            "symbol":self.symbolModel.symbol,
+        ]
+        ProgressHUD.showLoading()
+        NetWork.NetWorkInstance.requestData(requestType: .Get, URLString: jd_netForCompanyInfo,parameters:param , success: { (code, result) in
+            ProgressHUD.hideHud()
+            if let dic:NSDictionary = result as? NSDictionary {
+                self.companyModel = MCompanyModel.deserialize(from: dic)!
+                observer.send(value: true)
+            }else{
+                observer.send(value: false)
+                ProgressHUD.showError(status:DataTypeErrorPrompt)
+            }
+            observer.sendCompleted()
+        }) { (code, result) in
+            ProgressHUD.showError(status: result as! String)
+            observer.send(value: false)
+            observer.sendCompleted()
+        }
+    }
+    
+    
+    
    
 }
 

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

@@ -7,7 +7,202 @@
 //
 
 import UIKit
+import ReactiveCocoa
+import ReactiveSwift
 
 class MDFinanceViewModel: BaseViewModel {
+    var symbolModel:KSymbolModel = KSymbolModel()
+    
+    lazy var financeList:[MDFinanceModel] = {
+        let arr:[MDFinanceModel] = [MDFinanceModel]()
+        return arr
+    }()
+    
+    lazy var screenFinanceList:[MDFinanceModel] = {
+        let arr:[MDFinanceModel] = [MDFinanceModel]()
+        return arr
+    }()
+    
+    lazy var indicatorList:[MDIndicatorModel] = {
+        let arr:[MDIndicatorModel] = [MDIndicatorModel]()
+        return arr
+    }()
+    
+    lazy var iScreenList:[MDIScreenListModel] = {
+        let arr:[MDIScreenListModel] = [MDIScreenListModel]()
+        return arr
+    }()
+    
+    
+    var financeType:Int = 0 {
+        didSet{
+            self.screenFinanceListAction()
+        }
+    }
+    
+    let (signalFinance, observeFinance) = Signal<Bool, Never>.pipe()
+    //jd_netForIndicator
+    var financeAction: Action <(),(Bool),Never>!
+    var indicatorAction: Action <(),(Bool),Never>!
+    
+    override func initialize() {
+        financeAction = Action<(),(Bool),Never> {[weak self] _ in
+            return SignalProducer<(Bool),Never>{ observer, _ in
+                self?.requestFinance(observer: observer)
+            }
+        }
+        
+        indicatorAction = Action<(),(Bool),Never> {[weak self] _ in
+            return SignalProducer<(Bool),Never>{ observer, _ in
+                self?.requestIndicator(observer: observer)
+            }
+        }
+        
+        self.getindIcatorScreenList()
+    }
+    
+   
+}
+
+extension MDFinanceViewModel {
+    //获取财务数据
+    func netFinance() {
+        financeAction.apply().start()
+    }
+    //获取财务数据
+    func requestFinance(observer: Signal< Bool, Never>.Observer) -> Void {
+        
+        let param = [
+            "symbol":self.symbolModel.symbol,
+        ]
+        ProgressHUD.showLoading()
+        NetWork.NetWorkInstance.requestData(requestType: .Get, URLString: jd_netForFinance,parameters:param , success: { (code, result) in
+            ProgressHUD.hideHud()
+            if let list:[NSDictionary] = result as? [NSDictionary] {
+                self.financeList.removeAll()
+                for dic in list {
+                    let model = MDFinanceModel.deserialize(from: dic)!
+                    self.financeList.append(model)
+                }
+                self.screenFinanceListAction()
+                observer.send(value: true)
+            }else{
+                observer.send(value: false)
+                ProgressHUD.showError(status:DataTypeErrorPrompt)
+            }
+            observer.sendCompleted()
+        }) { (code, result) in
+            ProgressHUD.showError(status: result as! String)
+            observer.send(value: false)
+            observer.sendCompleted()
+        }
+    }
+    
+    //获取财务数据
+    func netIndicator() {
+        indicatorAction.apply().start()
+    }
+    //获取财务数据
+    func requestIndicator(observer: Signal< Bool, Never>.Observer) -> Void {
+        
+        let param = [
+            "symbol":self.symbolModel.symbol,
+        ]
+        ProgressHUD.showLoading()
+        NetWork.NetWorkInstance.requestData(requestType: .Get, URLString: jd_netForIndicator,parameters:param , success: { (code, result) in
+            ProgressHUD.hideHud()
+            if let list:[NSDictionary] = result as? [NSDictionary] {
+                self.indicatorList.removeAll()
+                for dic in list {
+                    let model = MDIndicatorModel.deserialize(from: dic)!
+                    self.indicatorList.append(model)
+                }
+                observer.send(value: true)
+            }else{
+                observer.send(value: false)
+                ProgressHUD.showError(status:DataTypeErrorPrompt)
+            }
+            observer.sendCompleted()
+        }) { (code, result) in
+            ProgressHUD.showError(status: result as! String)
+            observer.send(value: false)
+            observer.sendCompleted()
+        }
+    }
+    
+    
+}
 
+extension MDFinanceViewModel {
+    func screenFinanceListAction() -> Void {
+        self.screenFinanceList.removeAll()
+        for model in self.financeList{
+            if self.financeType == 0 {
+                if model.segmentType == "行业" || model.segmentType == "B"{
+                    self.screenFinanceList.append(model)
+                }
+               
+            }else{
+                if model.segmentType == "地区" || model.segmentType == "G"{
+                    self.screenFinanceList.append(model)
+                }
+            }
+        }
+        
+        self.observeFinance.send(value: true)
+    }
+    
+    
+    func getindIcatorScreenList() -> Void{
+        let list = [
+            [
+                "type":"eps",
+                "name":switchLanguage("每股收益"),
+                "isSelect":true
+            ],
+            [
+                "type":"netAssetsPS",
+                "name":switchLanguage("每股净资产"),
+                "isSelect":false
+            ],
+            [
+                "type":"currentRatio",
+                "name":switchLanguage("流动比率"),
+                "isSelect":false
+            ],
+            [
+                "type":"quickRatio",
+                "name":switchLanguage("速动比率"),
+                "isSelect":false
+            ],
+            [
+                "type":"returnOnEquity",
+                "name":switchLanguage("净资产收益率"),
+                "isSelect":false
+            ],
+            [
+                "type":"returnOnTotalAssets",
+                "name":switchLanguage("总资产收益率"),
+                "isSelect":false
+            ],
+            [
+                "type":"grossProfitMargin",
+                "name":switchLanguage("毛利率"),
+                "isSelect":false
+            ],
+            [
+                "type":"netIncomeRatio",
+                "name":switchLanguage("净利率"),
+                "isSelect":false
+            ],
+            
+        ]
+        
+        self.iScreenList.removeAll()
+        for dict in list {
+            let model = MDIScreenListModel.deserialize(from: dict)!
+            self.iScreenList.append(model)
+        }
+      
+    }
 }

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

@@ -7,7 +7,74 @@
 //
 
 import UIKit
+import ReactiveCocoa
+import ReactiveSwift
 
 class MDNewsViewModel: BaseViewModel {
+    var symbolModel:KSymbolModel = KSymbolModel()
+  
+    lazy var newsList:[MDNewsModel] = {
+        let arr:[MDNewsModel] = [MDNewsModel]()
+        return arr
+    }()
+    var pageNum:Int = 1
+    //jd_netForNewsList
+    var newsListAction: Action <(Bool),(Bool),Never>!
+    
+    override func initialize() {
+        newsListAction = Action<(Bool),(Bool),Never> {[weak self] isUp in
+            return SignalProducer<(Bool),Never>{ observer, _ in
+                self?.requestNewsList(observer: observer,isUp:isUp)
+            }
+        }
+        
+    }
+}
 
+extension MDNewsViewModel{
+    //新闻
+    func netNewsList(isUp:Bool) {
+        newsListAction.apply(isUp).start()
+    }
+    //新闻
+    func requestNewsList(observer: Signal< Bool, Never>.Observer,isUp:Bool) -> Void {
+        var market:String = "A股"
+        if self.symbolModel.market == "US" {
+            market = "美股"
+        }else if self.symbolModel.market == "HK"{
+            market = "港股"
+        }
+        let param = [
+            "title":self.symbolModel.title,
+            "market":market,
+            "pageNum" :self.pageNum,
+            "pageSize":"10"
+        ] as [String : Any]
+        ProgressHUD.showLoading()
+        NetWork.NetWorkInstance.requestData(requestType: .Get, URLString: jd_netForNewsList,parameters:param , success: {[weak self] (code, result) in
+            ProgressHUD.hideHud()
+            if let list:[NSDictionary] = result?["list"] as? [NSDictionary] {
+                if !isUp {
+                    self?.newsList.removeAll()
+                }
+                self?.pageNum += 1
+                for dic in list {
+                    let model = MDNewsModel.deserialize(from: dic)!
+                    self?.newsList.append(model)
+                }
+                let isNoData:Bool = (list.count < 10) ? true : false
+                observer.send(value:isNoData)
+            }else{
+                observer.send(value: false)
+                ProgressHUD.showError(status:DataTypeErrorPrompt)
+            }
+            observer.sendCompleted()
+        }) { (code, result) in
+            ProgressHUD.showError(status: result as! String)
+            observer.send(value: false)
+            observer.sendCompleted()
+        }
+    }
+    
+    
 }

+ 22 - 0
Koala/Koala/Other/Assets.xcassets/Base/Base_Share.imageset/Contents.json

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

BIN
Koala/Koala/Other/Assets.xcassets/Base/Base_Share.imageset/极度iPhoneApp_60pt@2x.png


BIN
Koala/Koala/Other/Assets.xcassets/Base/Base_Share.imageset/极度iPhoneApp_60pt@3x.png


+ 21 - 0
Koala/Koala/Other/Assets.xcassets/Home/Home_W_Hot.imageset/Contents.json

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

BIN
Koala/Koala/Other/Assets.xcassets/Home/Home_W_Hot.imageset/hot.png