Bladeren bron

no message

刘千军 11 maanden geleden
bovenliggende
commit
197a84cda6
21 gewijzigde bestanden met toevoegingen van 2416 en 237 verwijderingen
  1. 176 12
      Koala/Koala.xcodeproj/project.pbxproj
  2. 1 1
      Koala/Koala/FX/Base/BaseView.swift
  3. 14 1
      Koala/Koala/FX/Macro/ColorOrImage.swift
  4. 2 2
      Koala/Koala/FX/Macro/PublicMethod.swift
  5. 15 7
      Koala/Koala/FX/NetClass/Network.swift
  6. 1 0
      Koala/Koala/FX/NetClass/URLS.swift
  7. 55 0
      Koala/Koala/Modular/Market/M/MarketModel.swift
  8. 146 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteInfoCell.swift
  9. 345 8
      Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteInfoCell.xib
  10. 178 2
      Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteKLinewCell.swift
  11. 41 6
      Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteKLinewCell.xib
  12. 203 0
      Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteView.swift
  13. 132 6
      Koala/Koala/Modular/Market/V/MarketDetailView/MarketDetailNavView.swift
  14. 139 8
      Koala/Koala/Modular/Market/V/MarketDetailView/MarketDetailNavView.xib
  15. 5 6
      Koala/Koala/Modular/Market/V/MarketView/MarketView.swift
  16. 247 8
      Koala/Koala/Modular/Market/VC/MarketDetailViewController.swift
  17. 13 6
      Koala/Koala/Modular/Market/VC/MarketViewController.swift
  18. 162 0
      Koala/Koala/Modular/Market/VM/MDAuoteViewModel.swift
  19. 539 163
      Koala/Koala/Modular/Market/VM/MarketViewModel.swift
  20. 1 1
      Koala/Koala/Modular/MarketDetail/C/MarketMainDetailViewController.swift
  21. 1 0
      Koala/Koala/Modular/Public/Model/PublicModel.swift

+ 176 - 12
Koala/Koala.xcodeproj/project.pbxproj

@@ -118,7 +118,6 @@
 		04D38E872A9EEA750047EF9C /* InfomationListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D38E862A9EEA750047EF9C /* InfomationListViewController.swift */; };
 		04D38E892A9F1DB30047EF9C /* InfomationCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D38E882A9F1DB30047EF9C /* InfomationCell.swift */; };
 		04D38E8E2AA1C0C80047EF9C /* MarketMainDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D38E8D2AA1C0C80047EF9C /* MarketMainDetailViewController.swift */; };
-		04D38E902AA1C4460047EF9C /* MarketDetailNavView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D38E8F2AA1C4460047EF9C /* MarketDetailNavView.swift */; };
 		04D38E922AA1C82F0047EF9C /* MarketAnnouncementViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D38E912AA1C82F0047EF9C /* MarketAnnouncementViewController.swift */; };
 		04D38E942AA1CB060047EF9C /* AnnouncementCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D38E932AA1CB060047EF9C /* AnnouncementCell.swift */; };
 		04D38E962AA1CE8B0047EF9C /* MarketGeneralSituationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D38E952AA1CE8B0047EF9C /* MarketGeneralSituationViewController.swift */; };
@@ -131,7 +130,6 @@
 		04D38EA82AA8553E0047EF9C /* FinancesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D38EA72AA8553E0047EF9C /* FinancesView.swift */; };
 		04D38EAA2AA98EEF0047EF9C /* MarketNewsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D38EA92AA98EEF0047EF9C /* MarketNewsViewController.swift */; };
 		04D38EAC2AAAE9B10047EF9C /* MarketNavView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D38EAB2AAAE9B10047EF9C /* MarketNavView.swift */; };
-		04D38EAE2AAAF6E90047EF9C /* MarketListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D38EAD2AAAF6E90047EF9C /* MarketListCell.swift */; };
 		04D38EB02AAB07B10047EF9C /* MarketListHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D38EAF2AAB07B10047EF9C /* MarketListHeaderView.swift */; };
 		04D38EB22AAB19E80047EF9C /* JDHomeMenuCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D38EB12AAB19E80047EF9C /* JDHomeMenuCell.swift */; };
 		04D38EB42AAC164A0047EF9C /* JDHomeExponentCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D38EB32AAC164A0047EF9C /* JDHomeExponentCell.swift */; };
@@ -570,6 +568,33 @@
 		6CA9FF33295DCED70097ABA6 /* SecuritySettingsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CA9FF32295DCED70097ABA6 /* SecuritySettingsViewModel.swift */; };
 		6CA9FF36295DCEF20097ABA6 /* SecuritySettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CA9FF35295DCEF20097ABA6 /* SecuritySettingsView.swift */; };
 		6CBB62B82AD2F6540045A4C9 /* JDChartLineView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB62B52AD2F6540045A4C9 /* JDChartLineView.swift */; };
+		6CBB62BB2AD427F00045A4C9 /* MarketListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB62B92AD427F00045A4C9 /* MarketListCell.swift */; };
+		6CBB62BC2AD427F00045A4C9 /* MarketListCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6CBB62BA2AD427F00045A4C9 /* MarketListCell.xib */; };
+		6CBB62BE2AD4451D0045A4C9 /* MarketRecommendView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB62BD2AD4451D0045A4C9 /* MarketRecommendView.swift */; };
+		6CBB62C02AD445320045A4C9 /* MarketRecommendView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6CBB62BF2AD445320045A4C9 /* MarketRecommendView.xib */; };
+		6CBB62C32AD588260045A4C9 /* MarketHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB62C22AD588260045A4C9 /* MarketHeaderView.swift */; };
+		6CBB62C72AD588380045A4C9 /* MarketHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6CBB62C62AD588380045A4C9 /* MarketHeaderView.xib */; };
+		6CBB62CA2AD6EFD80045A4C9 /* MarketOptionsListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB62C82AD6EFD80045A4C9 /* MarketOptionsListCell.swift */; };
+		6CBB62CB2AD6EFD80045A4C9 /* MarketOptionsListCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6CBB62C92AD6EFD80045A4C9 /* MarketOptionsListCell.xib */; };
+		6CBB62CD2AD81EC80045A4C9 /* MarketDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB62CC2AD81EC80045A4C9 /* MarketDetailViewController.swift */; };
+		6CBB62D12AD81F550045A4C9 /* MarketDetailNavView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB62D02AD81F550045A4C9 /* MarketDetailNavView.swift */; };
+		6CBB62D32AD820130045A4C9 /* MarketDetailNavView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6CBB62D22AD820130045A4C9 /* MarketDetailNavView.xib */; };
+		6CBB62D52AD827F20045A4C9 /* MDAuoteView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB62D42AD827F20045A4C9 /* MDAuoteView.swift */; };
+		6CBB62D72AD828170045A4C9 /* MDFinanceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB62D62AD828170045A4C9 /* MDFinanceView.swift */; };
+		6CBB62D92AD828440045A4C9 /* MDProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB62D82AD828440045A4C9 /* MDProfileView.swift */; };
+		6CBB62DB2AD828550045A4C9 /* MDNewsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB62DA2AD828550045A4C9 /* MDNewsView.swift */; };
+		6CBB62DD2AD828990045A4C9 /* MDAnnouncementView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB62DC2AD828990045A4C9 /* MDAnnouncementView.swift */; };
+		6CBB62DF2AD828C20045A4C9 /* MDOptionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB62DE2AD828C20045A4C9 /* MDOptionsView.swift */; };
+		6CBB62E12AD829170045A4C9 /* MDAuoteViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB62E02AD829170045A4C9 /* MDAuoteViewModel.swift */; };
+		6CBB62E32AD829290045A4C9 /* MDFinanceViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB62E22AD829290045A4C9 /* MDFinanceViewModel.swift */; };
+		6CBB62E52AD829360045A4C9 /* MDProfileViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB62E42AD829360045A4C9 /* MDProfileViewModel.swift */; };
+		6CBB62E72AD829440045A4C9 /* MDNewsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB62E62AD829440045A4C9 /* MDNewsViewModel.swift */; };
+		6CBB62E92AD829500045A4C9 /* MDAnnouncementViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB62E82AD829500045A4C9 /* MDAnnouncementViewModel.swift */; };
+		6CBB62EB2AD8295C0045A4C9 /* MDOptionsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB62EA2AD8295C0045A4C9 /* MDOptionsViewModel.swift */; };
+		6CBB62F52AD83CD00045A4C9 /* MDAuoteInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB62F32AD83CD00045A4C9 /* MDAuoteInfoCell.swift */; };
+		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 */; };
 		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 */; };
@@ -855,7 +880,6 @@
 		04D38E862A9EEA750047EF9C /* InfomationListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfomationListViewController.swift; sourceTree = "<group>"; };
 		04D38E882A9F1DB30047EF9C /* InfomationCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfomationCell.swift; sourceTree = "<group>"; };
 		04D38E8D2AA1C0C80047EF9C /* MarketMainDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketMainDetailViewController.swift; sourceTree = "<group>"; };
-		04D38E8F2AA1C4460047EF9C /* MarketDetailNavView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketDetailNavView.swift; sourceTree = "<group>"; };
 		04D38E912AA1C82F0047EF9C /* MarketAnnouncementViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketAnnouncementViewController.swift; sourceTree = "<group>"; };
 		04D38E932AA1CB060047EF9C /* AnnouncementCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnnouncementCell.swift; sourceTree = "<group>"; };
 		04D38E952AA1CE8B0047EF9C /* MarketGeneralSituationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketGeneralSituationViewController.swift; sourceTree = "<group>"; };
@@ -868,7 +892,6 @@
 		04D38EA72AA8553E0047EF9C /* FinancesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FinancesView.swift; sourceTree = "<group>"; };
 		04D38EA92AA98EEF0047EF9C /* MarketNewsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketNewsViewController.swift; sourceTree = "<group>"; };
 		04D38EAB2AAAE9B10047EF9C /* MarketNavView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketNavView.swift; sourceTree = "<group>"; };
-		04D38EAD2AAAF6E90047EF9C /* MarketListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketListCell.swift; sourceTree = "<group>"; };
 		04D38EAF2AAB07B10047EF9C /* MarketListHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketListHeaderView.swift; sourceTree = "<group>"; };
 		04D38EB12AAB19E80047EF9C /* JDHomeMenuCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JDHomeMenuCell.swift; sourceTree = "<group>"; };
 		04D38EB32AAC164A0047EF9C /* JDHomeExponentCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JDHomeExponentCell.swift; sourceTree = "<group>"; };
@@ -1315,6 +1338,33 @@
 		6CA9FF32295DCED70097ABA6 /* SecuritySettingsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecuritySettingsViewModel.swift; sourceTree = "<group>"; };
 		6CA9FF35295DCEF20097ABA6 /* SecuritySettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecuritySettingsView.swift; sourceTree = "<group>"; };
 		6CBB62B52AD2F6540045A4C9 /* JDChartLineView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JDChartLineView.swift; sourceTree = "<group>"; };
+		6CBB62B92AD427F00045A4C9 /* MarketListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketListCell.swift; sourceTree = "<group>"; };
+		6CBB62BA2AD427F00045A4C9 /* MarketListCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MarketListCell.xib; sourceTree = "<group>"; };
+		6CBB62BD2AD4451D0045A4C9 /* MarketRecommendView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketRecommendView.swift; sourceTree = "<group>"; };
+		6CBB62BF2AD445320045A4C9 /* MarketRecommendView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MarketRecommendView.xib; sourceTree = "<group>"; };
+		6CBB62C22AD588260045A4C9 /* MarketHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketHeaderView.swift; sourceTree = "<group>"; };
+		6CBB62C62AD588380045A4C9 /* MarketHeaderView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MarketHeaderView.xib; sourceTree = "<group>"; };
+		6CBB62C82AD6EFD80045A4C9 /* MarketOptionsListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketOptionsListCell.swift; sourceTree = "<group>"; };
+		6CBB62C92AD6EFD80045A4C9 /* MarketOptionsListCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MarketOptionsListCell.xib; sourceTree = "<group>"; };
+		6CBB62CC2AD81EC80045A4C9 /* MarketDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketDetailViewController.swift; sourceTree = "<group>"; };
+		6CBB62D02AD81F550045A4C9 /* MarketDetailNavView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketDetailNavView.swift; sourceTree = "<group>"; };
+		6CBB62D22AD820130045A4C9 /* MarketDetailNavView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MarketDetailNavView.xib; sourceTree = "<group>"; };
+		6CBB62D42AD827F20045A4C9 /* MDAuoteView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDAuoteView.swift; sourceTree = "<group>"; };
+		6CBB62D62AD828170045A4C9 /* MDFinanceView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDFinanceView.swift; sourceTree = "<group>"; };
+		6CBB62D82AD828440045A4C9 /* MDProfileView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDProfileView.swift; sourceTree = "<group>"; };
+		6CBB62DA2AD828550045A4C9 /* MDNewsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDNewsView.swift; sourceTree = "<group>"; };
+		6CBB62DC2AD828990045A4C9 /* MDAnnouncementView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDAnnouncementView.swift; sourceTree = "<group>"; };
+		6CBB62DE2AD828C20045A4C9 /* MDOptionsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDOptionsView.swift; sourceTree = "<group>"; };
+		6CBB62E02AD829170045A4C9 /* MDAuoteViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDAuoteViewModel.swift; sourceTree = "<group>"; };
+		6CBB62E22AD829290045A4C9 /* MDFinanceViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDFinanceViewModel.swift; sourceTree = "<group>"; };
+		6CBB62E42AD829360045A4C9 /* MDProfileViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDProfileViewModel.swift; sourceTree = "<group>"; };
+		6CBB62E62AD829440045A4C9 /* MDNewsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDNewsViewModel.swift; sourceTree = "<group>"; };
+		6CBB62E82AD829500045A4C9 /* MDAnnouncementViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDAnnouncementViewModel.swift; sourceTree = "<group>"; };
+		6CBB62EA2AD8295C0045A4C9 /* MDOptionsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDOptionsViewModel.swift; sourceTree = "<group>"; };
+		6CBB62F32AD83CD00045A4C9 /* MDAuoteInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDAuoteInfoCell.swift; sourceTree = "<group>"; };
+		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>"; };
 		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>"; };
@@ -1749,7 +1799,6 @@
 		04D38E8C2AA1C0B50047EF9C /* V */ = {
 			isa = PBXGroup;
 			children = (
-				04D38E8F2AA1C4460047EF9C /* MarketDetailNavView.swift */,
 				04D38E932AA1CB060047EF9C /* AnnouncementCell.swift */,
 				04D38EA02AA704140047EF9C /* GeneralSituationHeaderView.swift */,
 				04D38EA22AA804080047EF9C /* ShareholderInfoCell.swift */,
@@ -2795,6 +2844,12 @@
 			isa = PBXGroup;
 			children = (
 				6CBDC8FA2973059F003E068F /* MarketViewModel.swift */,
+				6CBB62E02AD829170045A4C9 /* MDAuoteViewModel.swift */,
+				6CBB62E22AD829290045A4C9 /* MDFinanceViewModel.swift */,
+				6CBB62E42AD829360045A4C9 /* MDProfileViewModel.swift */,
+				6CBB62E62AD829440045A4C9 /* MDNewsViewModel.swift */,
+				6CBB62E82AD829500045A4C9 /* MDAnnouncementViewModel.swift */,
+				6CBB62EA2AD8295C0045A4C9 /* MDOptionsViewModel.swift */,
 			);
 			path = VM;
 			sourceTree = "<group>";
@@ -2802,11 +2857,8 @@
 		6C584E24295C607400CE1D2C /* V */ = {
 			isa = PBXGroup;
 			children = (
-				6CBDC8F82973058E003E068F /* MarketView.swift */,
-				6C35369629817804003BB632 /* MarketPopView.swift */,
-				04D38EAB2AAAE9B10047EF9C /* MarketNavView.swift */,
-				04D38EAD2AAAF6E90047EF9C /* MarketListCell.swift */,
-				04D38EAF2AAB07B10047EF9C /* MarketListHeaderView.swift */,
+				6CBB62CF2AD81EE70045A4C9 /* MarketView */,
+				6CBB62CE2AD81ED10045A4C9 /* MarketDetailView */,
 			);
 			path = V;
 			sourceTree = "<group>";
@@ -2815,6 +2867,7 @@
 			isa = PBXGroup;
 			children = (
 				6C584E26295C60C000CE1D2C /* MarketViewController.swift */,
+				6CBB62CC2AD81EC80045A4C9 /* MarketDetailViewController.swift */,
 			);
 			path = VC;
 			sourceTree = "<group>";
@@ -3155,6 +3208,92 @@
 			path = SecuritySettings;
 			sourceTree = "<group>";
 		};
+		6CBB62CE2AD81ED10045A4C9 /* MarketDetailView */ = {
+			isa = PBXGroup;
+			children = (
+				6CBB62D02AD81F550045A4C9 /* MarketDetailNavView.swift */,
+				6CBB62D22AD820130045A4C9 /* MarketDetailNavView.xib */,
+				6CBB62ED2AD83BCA0045A4C9 /* MDAuoteView */,
+				6CBB62EE2AD83BDE0045A4C9 /* MDFinanceView */,
+				6CBB62EF2AD83BF00045A4C9 /* MDProfileView */,
+				6CBB62F02AD83C000045A4C9 /* MDNewsView */,
+				6CBB62F12AD83C0D0045A4C9 /* MDAnnouncementView */,
+				6CBB62F22AD83C190045A4C9 /* MDOptionsView */,
+			);
+			path = MarketDetailView;
+			sourceTree = "<group>";
+		};
+		6CBB62CF2AD81EE70045A4C9 /* MarketView */ = {
+			isa = PBXGroup;
+			children = (
+				6CBDC8F82973058E003E068F /* MarketView.swift */,
+				6CBB62B92AD427F00045A4C9 /* MarketListCell.swift */,
+				6CBB62BA2AD427F00045A4C9 /* MarketListCell.xib */,
+				6CBB62C82AD6EFD80045A4C9 /* MarketOptionsListCell.swift */,
+				6CBB62C92AD6EFD80045A4C9 /* MarketOptionsListCell.xib */,
+				6C35369629817804003BB632 /* MarketPopView.swift */,
+				04D38EAB2AAAE9B10047EF9C /* MarketNavView.swift */,
+				6CBB62C22AD588260045A4C9 /* MarketHeaderView.swift */,
+				6CBB62C62AD588380045A4C9 /* MarketHeaderView.xib */,
+				04D38EAF2AAB07B10047EF9C /* MarketListHeaderView.swift */,
+				6CBB62BD2AD4451D0045A4C9 /* MarketRecommendView.swift */,
+				6CBB62BF2AD445320045A4C9 /* MarketRecommendView.xib */,
+			);
+			path = MarketView;
+			sourceTree = "<group>";
+		};
+		6CBB62ED2AD83BCA0045A4C9 /* MDAuoteView */ = {
+			isa = PBXGroup;
+			children = (
+				6CBB62D42AD827F20045A4C9 /* MDAuoteView.swift */,
+				6CBB62F32AD83CD00045A4C9 /* MDAuoteInfoCell.swift */,
+				6CBB62F42AD83CD00045A4C9 /* MDAuoteInfoCell.xib */,
+				6CBB62F72AD84E2D0045A4C9 /* MDAuoteKLinewCell.swift */,
+				6CBB62F82AD84E2D0045A4C9 /* MDAuoteKLinewCell.xib */,
+			);
+			path = MDAuoteView;
+			sourceTree = "<group>";
+		};
+		6CBB62EE2AD83BDE0045A4C9 /* MDFinanceView */ = {
+			isa = PBXGroup;
+			children = (
+				6CBB62D62AD828170045A4C9 /* MDFinanceView.swift */,
+			);
+			path = MDFinanceView;
+			sourceTree = "<group>";
+		};
+		6CBB62EF2AD83BF00045A4C9 /* MDProfileView */ = {
+			isa = PBXGroup;
+			children = (
+				6CBB62D82AD828440045A4C9 /* MDProfileView.swift */,
+			);
+			path = MDProfileView;
+			sourceTree = "<group>";
+		};
+		6CBB62F02AD83C000045A4C9 /* MDNewsView */ = {
+			isa = PBXGroup;
+			children = (
+				6CBB62DA2AD828550045A4C9 /* MDNewsView.swift */,
+			);
+			path = MDNewsView;
+			sourceTree = "<group>";
+		};
+		6CBB62F12AD83C0D0045A4C9 /* MDAnnouncementView */ = {
+			isa = PBXGroup;
+			children = (
+				6CBB62DC2AD828990045A4C9 /* MDAnnouncementView.swift */,
+			);
+			path = MDAnnouncementView;
+			sourceTree = "<group>";
+		};
+		6CBB62F22AD83C190045A4C9 /* MDOptionsView */ = {
+			isa = PBXGroup;
+			children = (
+				6CBB62DE2AD828C20045A4C9 /* MDOptionsView.swift */,
+			);
+			path = MDOptionsView;
+			sourceTree = "<group>";
+		};
 		6CBDC8EB2972EDC7003E068F /* WebView */ = {
 			isa = PBXGroup;
 			children = (
@@ -3555,6 +3694,7 @@
 				6CA7130C2956F2E30047F450 /* MineHeaderViewCell.xib in Resources */,
 				6C4AFB0C29A1035E00508EA7 /* HoldAccountInfoCell.xib in Resources */,
 				6CD200B829E709A600F0966D /* ASavingsDetailsScreenPopView.xib in Resources */,
+				6CBB62D32AD820130045A4C9 /* MarketDetailNavView.xib in Resources */,
 				6C10F10429DB08D900B79491 /* updateAPP006.png in Resources */,
 				6CA713562959F8F30047F450 /* ForgotPasswordCell.xib in Resources */,
 				6C4AFAD9299D1FD100508EA7 /* AFiatDepositsCell.xib in Resources */,
@@ -3569,6 +3709,7 @@
 				6C00A883242D8FEB00CE9ADB /* LaunchScreen.storyboard in Resources */,
 				6C2FFCD42961C423005B8180 /* RealNameCell.xib in Resources */,
 				6C10F10529DB08D900B79491 /* updateAPP038.png in Resources */,
+				6CBB62C02AD445320045A4C9 /* MarketRecommendView.xib in Resources */,
 				6C10F0EA29DB08D900B79491 /* updateAPP088.png in Resources */,
 				6CDC5B0329CF140500E60730 /* AHistoryDetailsViewController.xib in Resources */,
 				6C0C4990295DD2F8000BFEEB /* SecuritySettingsCell.xib in Resources */,
@@ -3588,6 +3729,7 @@
 				6C86531A29B4E0E500A2E7FB /* TalentReportViewController.xib in Resources */,
 				6C35368629800931003BB632 /* CTDealHeaderView.xib in Resources */,
 				6C10F10629DB08D900B79491 /* updateAPP010.png in Resources */,
+				6CBB62C72AD588380045A4C9 /* MarketHeaderView.xib in Resources */,
 				6C2FFCA529607AB7005B8180 /* TradingPasswordsCell.xib in Resources */,
 				6C3717D529AA3D59000DDD8B /* MyCopyingHeaderView.xib in Resources */,
 				6C2EAD8029E3110800E03AF8 /* AInvestNowViewController.xib in Resources */,
@@ -3611,6 +3753,7 @@
 				6C4AFAEA299E870400508EA7 /* AFiatWithdrawalsListCell.xib in Resources */,
 				6CC37FC3298971030079FA5C /* DealHintListCell.xib in Resources */,
 				6C031B202962C4DA0043BECF /* RealNameFileCell.xib in Resources */,
+				6CBB62BC2AD427F00045A4C9 /* MarketListCell.xib in Resources */,
 				6CD5EB8129D9DE870053325F /* CommunityHeaderView.xib in Resources */,
 				6C10F0E229DB08D900B79491 /* updateAPP078.png in Resources */,
 				6C8652F729AA6E9D00A2E7FB /* TDStatisticsProfitCell.xib in Resources */,
@@ -3628,10 +3771,12 @@
 				6C7A1AF629F82BCC004CFBE3 /* CreditsListCell.xib in Resources */,
 				6C86530829AFAC5400A2E7FB /* TDProfitInfoCell.xib in Resources */,
 				6C2FFC9A295F5ACC005B8180 /* LoginCell.xib in Resources */,
+				6CBB62CB2AD6EFD80045A4C9 /* MarketOptionsListCell.xib in Resources */,
 				6C10F10029DB08D900B79491 /* updateAPP014.png in Resources */,
 				6C86531229B47ED000A2E7FB /* TDOrderListCell.xib in Resources */,
 				6CC37FFB299286700079FA5C /* AssetsSavingHeaderView.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 */,
@@ -3723,6 +3868,7 @@
 				6C10F0D629DB08D900B79491 /* updateAPP042.png in Resources */,
 				6C00A9482432F1A500CE9ADB /* CodeScan.bundle in Resources */,
 				6C10F0E529DB08D900B79491 /* updateAPP092.png in Resources */,
+				6CBB62FA2AD84E2D0045A4C9 /* MDAuoteKLinewCell.xib in Resources */,
 				6C10F0D929DB08D900B79491 /* updateAPP080.png in Resources */,
 				6C10F0F029DB08D900B79491 /* updateAPP074.png in Resources */,
 				6C10F0E829DB08D900B79491 /* updateAPP052.png in Resources */,
@@ -3851,6 +3997,7 @@
 				6CBDC91A297AE49A003E068F /* KLineHeaderView.swift in Sources */,
 				04CEE27C2AB6052500FAA760 /* JDNewsModel.swift in Sources */,
 				6C00A920242D918D00CE9ADB /* BaseView.swift in Sources */,
+				6CBB62DF2AD828C20045A4C9 /* MDOptionsView.swift in Sources */,
 				6C4AFB0829A0FFFE00508EA7 /* PositionHistoryViewModel.swift in Sources */,
 				6C584E46295C7BB800CE1D2C /* BaseTabBarController.swift in Sources */,
 				6C00A9552432F43600CE9ADB /* LBXScanView.swift in Sources */,
@@ -3879,6 +4026,7 @@
 				6C2FFCAA29608447005B8180 /* AsunBasicAttributes.swift in Sources */,
 				6C4AFB0029A0FF9B00508EA7 /* HoldView.swift in Sources */,
 				6C2FFCBA29618239005B8180 /* FreezeAccountViewController.swift in Sources */,
+				6CBB62D92AD828440045A4C9 /* MDProfileView.swift in Sources */,
 				6C00A9A324346C4600CE9ADB /* KWebsocket.swift in Sources */,
 				6C10F11A29E1C02700B79491 /* AFinanceRedemptionViewController.swift in Sources */,
 				6C7F446C29556B6000DC6771 /* BaseAlertView.swift in Sources */,
@@ -3892,8 +4040,10 @@
 				6C00A9AE2434A18B00CE9ADB /* HDEmptyView.swift in Sources */,
 				6C031DA5296315930043BECF /* FSPageControl.swift in Sources */,
 				6C00A911242D918D00CE9ADB /* PublicEnum.swift in Sources */,
+				6CBB62D12AD81F550045A4C9 /* MarketDetailNavView.swift in Sources */,
 				6C2FFCB529617471005B8180 /* KSelectBottonPopView.swift in Sources */,
 				6C031B1C2962C4C70043BECF /* RealNameFileView.swift in Sources */,
+				6CBB62E12AD829170045A4C9 /* MDAuoteViewModel.swift in Sources */,
 				04D38E5C2A9EE8A10047EF9C /* JXSegmentedTitleOrImageDataSource.swift in Sources */,
 				041D4F222AD2CAEA008ABDF7 /* JDMineJoinUsViewController.swift in Sources */,
 				04CEE2A42ABC257900FAA760 /* JDMessageListViewController.swift in Sources */,
@@ -3938,7 +4088,6 @@
 				6C2FFCA129607A2A005B8180 /* TradingPasswordsView.swift in Sources */,
 				6C7A1AF929FC1445004CFBE3 /* PHistoryFooterView.swift in Sources */,
 				6C00A9962433313300CE9ADB /* HXAlbumCell.swift in Sources */,
-				04D38EAE2AAAF6E90047EF9C /* MarketListCell.swift in Sources */,
 				6C00A9912433313300CE9ADB /* HXSelectButton.swift in Sources */,
 				6CA71345295889770047F450 /* RegisterView.swift in Sources */,
 				6C2FFCB8296174AB005B8180 /* BasePureCodeCell.swift in Sources */,
@@ -4002,6 +4151,7 @@
 				04D38EA32AA804080047EF9C /* ShareholderInfoCell.swift in Sources */,
 				6C00A9892433313300CE9ADB /* HXImageClipViewController.swift in Sources */,
 				6C00A877242D8FEA00CE9ADB /* AppDelegate.swift in Sources */,
+				6CBB62DB2AD828550045A4C9 /* MDNewsView.swift in Sources */,
 				04CEE2B82ABD3ACA00FAA760 /* JDWorkOrderDetailViewController.swift in Sources */,
 				6CA713552959F8F30047F450 /* ForgotPasswordCell.swift in Sources */,
 				6C00A8F5242D918D00CE9ADB /* ESTabBarController.swift in Sources */,
@@ -4017,12 +4167,14 @@
 				6CD5EB6429D5C6A40053325F /* FundsRecordCell.swift in Sources */,
 				6CDC5B1529D0814E00E60730 /* AssetsProxyHeaderView.swift in Sources */,
 				6CC8024329968A2300C36373 /* AWithdrawalsViewController.swift in Sources */,
+				6CBB62EB2AD8295C0045A4C9 /* MDOptionsViewModel.swift in Sources */,
 				041D4EE42ABEBA0C008ABDF7 /* JDAFiatAccountListPopView.swift in Sources */,
 				6CA71342295889260047F450 /* RegisterViewModel.swift in Sources */,
 				6C4AFAED299FE01600508EA7 /* APaymentMethodViewController.swift in Sources */,
 				6CC37FBE298962B40079FA5C /* DealHintCell.swift in Sources */,
 				6CC37FF9299286520079FA5C /* AssetsSavingHeaderView.swift in Sources */,
 				6C7A1AD029F2D5B0004CFBE3 /* AssetsDealSetDefaultPopView.swift in Sources */,
+				6CBB62C32AD588260045A4C9 /* MarketHeaderView.swift in Sources */,
 				6C4AFB3529A7B5D700508EA7 /* MessageView.swift in Sources */,
 				6C00A903242D918D00CE9ADB /* UIView+CategoryClass.swift in Sources */,
 				04D38E5D2A9EE8A10047EF9C /* JXSegmentedTitleOrImageCell.swift in Sources */,
@@ -4046,7 +4198,6 @@
 				041D4F052AC42D62008ABDF7 /* JDSelectCell.swift in Sources */,
 				6CA7134D2959F6900047F450 /* ForgotPasswordViewController.swift in Sources */,
 				6CDC5AFE29CE127900E60730 /* TransferHistoryListCell.swift in Sources */,
-				04D38E902AA1C4460047EF9C /* MarketDetailNavView.swift in Sources */,
 				6C86531529B492DA00A2E7FB /* TDUserListCell.swift in Sources */,
 				6C86530729AFAC5400A2E7FB /* TDProfitInfoCell.swift in Sources */,
 				6CA712FF2956E51C0047F450 /* MineViewModel.swift in Sources */,
@@ -4059,6 +4210,7 @@
 				04D38E702A9EE8A10047EF9C /* JXSegmentedDotCell.swift in Sources */,
 				04D38E742A9EE8A10047EF9C /* JXSegmentedTitleImageItemModel.swift in Sources */,
 				6CBDC8F32972F352003E068F /* ScriptMessageProxy.swift in Sources */,
+				6CBB62E32AD829290045A4C9 /* MDFinanceViewModel.swift in Sources */,
 				6C4AFB4429A8FC6100508EA7 /* DealTalentView.swift in Sources */,
 				6C2FFCD02961C3B5005B8180 /* RealNameView.swift in Sources */,
 				6C2FFCCD2961C39E005B8180 /* RealNameViewModel.swift in Sources */,
@@ -4071,6 +4223,7 @@
 				6CC802272994067600C36373 /* AssetsProxyInfoCell.swift in Sources */,
 				6C00A8FA242D918D00CE9ADB /* ESTabBarItemContainer.swift in Sources */,
 				04D38EB22AAB19E80047EF9C /* JDHomeMenuCell.swift in Sources */,
+				6CBB62D72AD828170045A4C9 /* MDFinanceView.swift in Sources */,
 				6C7F446A29556B2600DC6771 /* BaseViewModel.swift in Sources */,
 				04CEE2722AB4311F00FAA760 /* JDTradeAccountModel.swift in Sources */,
 				6CA7133D29587BE10047F450 /* CountrySelectCell.swift in Sources */,
@@ -4078,6 +4231,7 @@
 				041D4F1E2AD2B0FC008ABDF7 /* JDMineHeaderView.swift in Sources */,
 				6C00A8F8242D918D00CE9ADB /* ESTabBarItemBadgeView.swift in Sources */,
 				6C2FFCBF29618271005B8180 /* FreezeAccountView.swift in Sources */,
+				6CBB62DD2AD828990045A4C9 /* MDAnnouncementView.swift in Sources */,
 				6CBDC91E297AE49A003E068F /* KLinePeriod.swift in Sources */,
 				6C00A918242D918D00CE9ADB /* PhotoManager.swift in Sources */,
 				04D38EA12AA704140047EF9C /* GeneralSituationHeaderView.swift in Sources */,
@@ -4103,6 +4257,7 @@
 				6C35368F29815FB7003BB632 /* DealView.swift in Sources */,
 				6C4AFB0229A0FFB300508EA7 /* HoldViewModel.swift in Sources */,
 				6C00A9942433313300CE9ADB /* HXImageNavigationView.swift in Sources */,
+				6CBB62D52AD827F20045A4C9 /* MDAuoteView.swift in Sources */,
 				6CBDC908297AD8C5003E068F /* CTKLineFooterView.swift in Sources */,
 				6C7A1ACC29F2C495004CFBE3 /* AssetsDealSetAmountPopView.swift in Sources */,
 				6CC37FC9298EC19C0079FA5C /* DealClosedPopView.swift in Sources */,
@@ -4191,6 +4346,7 @@
 				04CEE2902AB9736900FAA760 /* JDAFiatDepositsViewController.swift in Sources */,
 				6CBDC91D297AE49A003E068F /* KLineBaseView.swift in Sources */,
 				6C00A9B22434A18B00CE9ADB /* HDEmptyBaseView.swift in Sources */,
+				6CBB62F92AD84E2D0045A4C9 /* MDAuoteKLinewCell.swift in Sources */,
 				6C584E40295C687A00CE1D2C /* UIStackView+CategoryClass.swift in Sources */,
 				6C00A907242D918D00CE9ADB /* UIViewControllerProtocal.swift in Sources */,
 				6C00A8FD242D918D00CE9ADB /* String+CategoryClass.swift in Sources */,
@@ -4238,6 +4394,7 @@
 				04CEE2B62ABD351000FAA760 /* InformationFlashCell.swift in Sources */,
 				6C00A95A2432F43600CE9ADB /* LBXScanWrapper.swift in Sources */,
 				04D38EC52AB15BF80047EF9C /* JDKLineTradingSessionCell.swift in Sources */,
+				6CBB62E52AD829360045A4C9 /* MDProfileViewModel.swift in Sources */,
 				6C584E4A295CA3DA00CE1D2C /* ModifyNicknameViewController.swift in Sources */,
 				04CEE2A62ABC275800FAA760 /* JDMessageView.swift in Sources */,
 				6CC380062993D4E10079FA5C /* AssetsDealListCell.swift in Sources */,
@@ -4256,8 +4413,12 @@
 				6C4AFB5529AA21E700508EA7 /* MyCopyingViewModel.swift in Sources */,
 				6C7A1AE129F5780F004CFBE3 /* PositionHistoryDatePopView.swift in Sources */,
 				6CC37FC2298971030079FA5C /* DealHintListCell.swift in Sources */,
+				6CBB62BE2AD4451D0045A4C9 /* MarketRecommendView.swift in Sources */,
 				6C00A9A02434314F00CE9ADB /* UpdatePopupView.swift in Sources */,
+				6CBB62F52AD83CD00045A4C9 /* MDAuoteInfoCell.swift in Sources */,
 				04CEE2962ABAE9CC00FAA760 /* JDAFiatWithdrawalsCell.swift in Sources */,
+				6CBB62CD2AD81EC80045A4C9 /* MarketDetailViewController.swift in Sources */,
+				6CBB62CA2AD6EFD80045A4C9 /* MarketOptionsListCell.swift in Sources */,
 				04D38E612A9EE8A10047EF9C /* JXSegmentedCollectionView.swift in Sources */,
 				6CDC5B0629CF164500E60730 /* AHistoryDetaisHeaderView.swift in Sources */,
 				04D38EC72AB29A0A0047EF9C /* JDKLineBuySellRateView.swift in Sources */,
@@ -4267,6 +4428,7 @@
 				6C10F10A29E1638400B79491 /* FeedbackViewController.swift in Sources */,
 				041D4F092AC4367E008ABDF7 /* JDAccountTypeCheckCell.swift in Sources */,
 				6C4AFB0B29A1035E00508EA7 /* HoldAccountInfoCell.swift in Sources */,
+				6CBB62E72AD829440045A4C9 /* MDNewsViewModel.swift in Sources */,
 				6C031B222963136B0043BECF /* HomeHeaderView.swift in Sources */,
 				6C00A8B5242D916100CE9ADB /* UserInfoDataModel.swift in Sources */,
 				04D38E6F2A9EE8A10047EF9C /* JXSegmentedComponetGradientView.swift in Sources */,
@@ -4309,12 +4471,14 @@
 				6C3536892980156C003BB632 /* CTTradesListCell.swift in Sources */,
 				6CC37FEB298FDE2E0079FA5C /* AssetsTotalCell.swift in Sources */,
 				041D4EE82ABFE4D6008ABDF7 /* JDRecipientCurrencyListViewController.swift in Sources */,
+				6CBB62BB2AD427F00045A4C9 /* MarketListCell.swift in Sources */,
 				04D38E622A9EE8A10047EF9C /* JXSegmentedView.swift in Sources */,
 				04CEE2AA2ABC38C800FAA760 /* JDWorkOrderManagerViewController.swift in Sources */,
 				04D38E9A2AA5D3970047EF9C /* JDMineViewController.swift in Sources */,
 				04D38E652A9EE8A10047EF9C /* JXSegmentedIndicatorTriangleView.swift in Sources */,
 				04CEE2B22ABD27BC00FAA760 /* JDTextView.swift in Sources */,
 				04D38EA82AA8553E0047EF9C /* FinancesView.swift in Sources */,
+				6CBB62E92AD829500045A4C9 /* MDAnnouncementViewModel.swift in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

+ 1 - 1
Koala/Koala/FX/Base/BaseView.swift

@@ -7,7 +7,7 @@
 //
 
 import UIKit
-
+import MJRefresh
 class BaseView: UIView {
     
     public func setViewModel(viewmodel: AnyObject) {

+ 14 - 1
Koala/Koala/FX/Macro/ColorOrImage.swift

@@ -61,7 +61,7 @@ var InputBackGroundColor : UIColor {
 
 var TitleTextColor : UIColor {
     get{
-        return  _color("#030407&#030407")//
+        return  _color("#333333&#333333")//
     }
 }
 
@@ -89,6 +89,19 @@ var MidTextColor : UIColor {
     }
 }
 
+
+var GrayTextColor : UIColor {
+    get{
+        return  _color("#4A4A4A&#4A4A4A")//
+    }
+}
+
+var LightTextColor : UIColor {
+    get{
+        return  _color("#BEBEBE&#BEBEBE")//
+    }
+}
+
 var Popup_Back_Color : UIColor {
     get{
         return  _color("#FFFFFF&#FFFFFF")//背景色

+ 2 - 2
Koala/Koala/FX/Macro/PublicMethod.swift

@@ -918,8 +918,8 @@ func getSymbolList() -> [KSymbolModel]{
                 }
                 model.newPrice = precisionString(with: ask, precision: model.digits)
                 let np = decimalNumber(A: model.newPrice, B: model.open, type: .Subtract, scale:model.digits)
-                model.increase = decimalNumber(A: np, B: model.open, type: .Divid)
-                model.increase = decimalNumber(A: model.increase, B: "100", type: .Multiply)
+                let increase = (conerData(np, .MyDouble).2!/conerData(model.open, .MyDouble).2!)*100
+                model.increase = String(format: "%.2f",increase)
                 arr.append(model)
             }
            

+ 15 - 7
Koala/Koala/FX/NetClass/Network.swift

@@ -150,6 +150,12 @@ extension NetWork {
       
                     Dlog(json)
                     
+                    var data = json["data"]
+                    
+                    if json["pageInfo"].type != Type.null{
+                        data = json["pageInfo"]
+                    }
+                    
                     if errno == 4000 || status == 4000 || code == 4000 {
                         //登录失效
                         self.login()
@@ -164,7 +170,7 @@ extension NetWork {
                         }
                         
                         var dict:[String: Any] = [String:Any]()
-                        if json["data"].dictionaryObject != nil{
+                        if data.dictionaryObject != nil{
                             guard let dic = json["data"].dictionaryObject else {
                                 failured(errno,"转字典失败" as AnyObject)
                                 return
@@ -179,25 +185,27 @@ extension NetWork {
                         return
                     }
                     
-                    if json["data"].dictionaryObject != nil{
-                        guard let dict = json["data"].dictionaryObject else {
+                    if data.dictionaryObject != nil{
+                        guard let dict = data.dictionaryObject else {
                             failured(errno,"转字典失败" as AnyObject)
                             return
                         }
                         success(errno,handleDic(myData: dict) as AnyObject)
-                    }else if json["data"].arrayObject != nil{
-                        guard let arr = json["data"].arrayObject else {
+                    }else if data.arrayObject != nil{
+                        guard let arr = data.arrayObject else {
                             failured(errno,"转数组失败" as AnyObject)
                             return
                         }
                         success(errno,handleDic(myData: arr) as AnyObject)
                     }else{
-                        if ((json["data"].object as? NSNull) == nil){
-                            success(errno,handleDic(myData: json["data"].object) as AnyObject)
+                        if ((data.object as? NSNull) == nil){
+                            success(errno,handleDic(myData: data.object) as AnyObject)
                         }else{
                             success(errno,"" as AnyObject)
                         }
                     }
+                    
+                   
                     //缓存数据
                     //  self.cacheResponseObject(responseObject:array as AnyObject,
                     //                                             request: response.request!,

+ 1 - 0
Koala/Koala/FX/NetClass/URLS.swift

@@ -209,6 +209,7 @@ let netOpenSubscribe = "Public/openSubscribe"       //开启订阅,没有token
 
 let netUpdateSubscribe    = "Public/updateSubscribe"    //修改报价订阅 参数 symbols  = ["BTCUSD","EURUSD"]
 
+let netForGetOptionProductListGroup = "Public/getOptionProductListGroup"//期权列表
 
 /* ********************* 极度 **********************/
 

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

@@ -38,3 +38,58 @@ class ProductGroupLangListModel: BaseModel {
     var title: String = ""
     var language: String = "0"
 }
+
+class OptionsTimerModel: BaseModel {
+    var timer: String = ""
+    var title: String = ""
+    var isSelect: Bool = false
+}
+
+class OptionsMarketModel: BaseModel {
+    var market:String = ""
+    var title: String = ""
+}
+
+class OptionsListModel: BaseModel {
+    var id:Int = 0
+    var type:Int = 0
+    var update_datetime_3m:Int = 0
+    var update_datetime_6m:Int = 0
+    var update_datetime_12m:Int = 0
+    var update_datetime_1m:Int = 0
+    var update_datetime_2m:Int = 0
+    var update_datetime_15d:Int = 0
+    var price_12m:String = ""
+    var standard:String = ""
+    var title:String = ""
+    var price_1m:String = ""
+    var price_15d:String = ""
+    var price_2m:String = ""
+    var price_6m:String = ""
+    var code:String = ""
+    var price_3m:String = ""
+    var bak02:String = ""
+    var visible:Int = 0
+    var bak01:String = ""
+    var market:String = ""
+    var count_15d:Int = 0
+    var count_1m:Int = 0
+    var count_2m:Int = 0
+    var price_6m_list:String = ""
+    var price_1m_list:String = ""
+    var price_3m_list:String = ""
+    var count_6m:Int = 0
+    var standard_list:String = ""
+    var recommend:Int = 0
+    var count_12m:Int = 0
+    var count_3m:Int = 0
+    var price_2m_list:String = ""
+    var insert_datetime:String = ""
+    
+    var symbolData:KSymbolModel = KSymbolModel()
+
+}
+
+
+
+

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

@@ -10,9 +10,90 @@ import UIKit
 
 class MDAuoteInfoCell: BaseTableViewCell {
 
+    @IBOutlet weak var bgView: UIView!
+    
+    @IBOutlet weak var priceLab: UILabel!
+    @IBOutlet weak var numberLab: UILabel!
+    @IBOutlet weak var changeLab: UILabel!
+    @IBOutlet weak var mark1Btn: UIButton!
+    @IBOutlet weak var mark2Btn: UIButton!
+    @IBOutlet weak var stateLab: UILabel!
+    
+    @IBOutlet weak var title1Lab: UILabel!
+    @IBOutlet weak var value1Lab: UILabel!
+    
+    @IBOutlet weak var title2Lab: UILabel!
+    @IBOutlet weak var value2Lab: UILabel!
+    
+    @IBOutlet weak var title3Lab: UILabel!
+    @IBOutlet weak var value3Lab: UILabel!
+    
+    @IBOutlet weak var title4Lab: UILabel!
+    @IBOutlet weak var value4Lab: UILabel!
+    
+    @IBOutlet weak var title5Lab: UILabel!
+    @IBOutlet weak var value5Lab: UILabel!
+    
+    @IBOutlet weak var title6Lab: UILabel!
+    @IBOutlet weak var value6Lab: UILabel!
+    
+    @IBOutlet weak var title7Lab: UILabel!
+    @IBOutlet weak var value7Lab: UILabel!
+    
+    @IBOutlet weak var title8Lab: UILabel!
+    @IBOutlet weak var value8Lab: UILabel!
+    
     override func awakeFromNib() {
         super.awakeFromNib()
         // Initialization code
+        self.bgView.backgroundColor = ALLBackGroundColor
+        
+        self.priceLab.setTextFont(.PFSM, 28)
+        self.priceLab.textColor = MidTextColor
+        self.priceLab.text = "0.00"
+        
+        self.numberLab.setTextFont(.PFSM, 13)
+        self.numberLab.textColor = TitleTextColor
+        self.numberLab.text = ""
+        
+        self.stateLab.setTextFont(.PFSR, 13)
+        self.stateLab.textColor = TitleTextColor
+        self.stateLab.text = switchLanguage("已休盘")
+        
+        self.changeLab.setTextFont(.PFSR, 13)
+        self.changeLab.textColor = MidTextColor
+        self.changeLab.text = "0.00(0.00%)"
+        
+        self.mark1Btn.setTextFont(.PFSR, 12)
+        self.mark1Btn.contentEdgeInsets = UIEdgeInsets(top: 0, left: 2, bottom: 0, right: 2)
+        
+        self.mark2Btn.setTextFont(.PFSR, 12)
+        self.mark2Btn.contentEdgeInsets = UIEdgeInsets(top: 0, left: 2, bottom: 0, right: 2)
+        
+        self.setTitleLayer(lab: self.title1Lab, text: switchLanguage("开盘"))
+        self.setValueLayer(lab: self.value1Lab, text: "--")
+        
+        self.setTitleLayer(lab: self.title2Lab, text: switchLanguage("最高"))
+        self.setValueLayer(lab: self.value2Lab, text: "--")
+        
+        self.setTitleLayer(lab: self.title3Lab, text: switchLanguage("总股本"))
+        self.setValueLayer(lab: self.value3Lab, text: "--")
+        
+        self.setTitleLayer(lab: self.title4Lab, text: switchLanguage("市值"))
+        self.setValueLayer(lab: self.value4Lab, text: "--")
+        
+        self.setTitleLayer(lab: self.title5Lab, text: switchLanguage("昨收"))
+        self.setValueLayer(lab: self.value5Lab, text: "--")
+        
+        self.setTitleLayer(lab: self.title6Lab, text: switchLanguage("最低"))
+        self.setValueLayer(lab: self.value6Lab, text: "--")
+        
+        self.setTitleLayer(lab: self.title7Lab, text: switchLanguage("流通股本"))
+        self.setValueLayer(lab: self.value7Lab, text: "--")
+        
+        self.setTitleLayer(lab: self.title8Lab, text:"")
+        self.setValueLayer(lab: self.value8Lab, text: "")
+        
     }
 
     override func setSelected(_ selected: Bool, animated: Bool) {
@@ -21,4 +102,69 @@ class MDAuoteInfoCell: BaseTableViewCell {
         // Configure the view for the selected state
     }
     
+    
+    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 = "--"
+        
+    }
+    
+    func updatePriceWith(model:KSymbolModel) -> Void {
+        
+        let difference:Double = conerData(model.newPrice, .MyDouble).2! - conerData(model.open, .MyDouble).2!
+        var differenceStr = "0.00"
+        if difference > 0 {
+            differenceStr = String(format: "+%.2f", difference)
+        }else{
+            differenceStr = String(format: "%.2f", difference)
+        }
+        
+        let increase = conerData(model.increase as Any, .MyFloat).1!
+        var increaseStr = "0.00%"
+        if increase > 0 {
+            increaseStr = "+" + precisionString(with: model.increase, precision: "2")  + "%"
+        }else{
+            increaseStr = precisionString(with: model.increase, precision: "2")  + "%"
+        }
+        
+        self.priceLab.textColor = exchangeColorAndImage(increase: increase).0
+        self.priceLab.text = String(format: "%@", model.newPrice)
+        
+        
+        self.changeLab.textColor = exchangeColorAndImage(increase: increase).0
+        self.changeLab.text = String(format: "%@(%@)",differenceStr,increaseStr)
+    }
+    
+    
+}
+
+extension MDAuoteInfoCell {
+    
+    func setTitleLayer(lab:UILabel,text:String) -> Void {
+        lab.setTextFont(.PFSR, 10)
+        lab.textColor = MidTextColor
+        lab.text = text
+    }
+    
+    func setValueLayer(lab:UILabel,text:String) -> Void {
+        lab.setTextFont(.PFSM, 10)
+        lab.textColor = TitleTextColor
+        lab.text = text
+    }
+    
 }

+ 345 - 8
Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteInfoCell.xib

@@ -1,21 +1,358 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13142" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<?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>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/>
-        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <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="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="MDAuoteInfoCell" customModuleProvider="target">
-            <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
+        <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="193" id="KGk-i7-Jjw" customClass="MDAuoteInfoCell" customModule="Koala" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="406" height="193"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
             <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
-                <rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
+                <rect key="frame" x="0.0" y="0.0" width="406" height="193"/>
                 <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Wiw-fI-LxM">
+                        <rect key="frame" x="0.0" y="0.0" width="406" height="193"/>
+                        <subviews>
+                            <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="dsh-Ds-ifS">
+                                <rect key="frame" x="0.0" y="0.0" width="406" height="193"/>
+                                <subviews>
+                                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aWu-Gn-orV">
+                                        <rect key="frame" x="0.0" y="0.0" width="406" height="66.666666666666671"/>
+                                        <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="CHU-fJ-dcM">
+                                                <rect key="frame" x="15.000000000000004" y="20" width="41.333333333333343" height="1.6666666666666679"/>
+                                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                <nil key="textColor"/>
+                                                <nil key="highlightedColor"/>
+                                            </label>
+                                            <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Tvl-9p-yTX">
+                                                <rect key="frame" x="15" y="41.666666666666664" width="376" height="15"/>
+                                                <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="ggq-Qr-ifq">
+                                                        <rect key="frame" x="0.0" y="0.0" width="125.33333333333333" height="15"/>
+                                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                        <nil key="textColor"/>
+                                                        <nil key="highlightedColor"/>
+                                                    </label>
+                                                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4Ay-Dd-0K7">
+                                                        <rect key="frame" x="125.33333333333334" y="0.0" width="125.33333333333334" height="15"/>
+                                                        <subviews>
+                                                            <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Tqj-Os-Zy4">
+                                                                <rect key="frame" x="21.333333333333314" y="-2.6666666666666643" width="82.666666666666671" height="20.333333333333332"/>
+                                                                <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="laq-rA-uTg">
+                                                                        <rect key="frame" x="0.0" y="0.0" width="41.333333333333336" 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" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="idZ-G6-DOn">
+                                                                        <rect key="frame" x="41.333333333333343" y="0.0" width="41.333333333333343" height="20.333333333333332"/>
+                                                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                                        <nil key="textColor"/>
+                                                                        <nil key="highlightedColor"/>
+                                                                    </label>
+                                                                </subviews>
+                                                            </stackView>
+                                                        </subviews>
+                                                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                                        <constraints>
+                                                            <constraint firstItem="Tqj-Os-Zy4" firstAttribute="centerY" secondItem="4Ay-Dd-0K7" secondAttribute="centerY" id="Y4f-fd-5Up"/>
+                                                            <constraint firstItem="Tqj-Os-Zy4" firstAttribute="centerX" secondItem="4Ay-Dd-0K7" secondAttribute="centerX" id="eLq-pf-5CT"/>
+                                                        </constraints>
+                                                    </view>
+                                                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="AGm-En-xac">
+                                                        <rect key="frame" x="250.66666666666671" y="0.0" width="125.33333333333334" height="15"/>
+                                                        <subviews>
+                                                            <stackView opaque="NO" contentMode="scaleToFill" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="VYM-ne-UJV">
+                                                                <rect key="frame" x="60.333333333333314" y="0.0" width="65" height="15"/>
+                                                                <subviews>
+                                                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ku6-J2-BI5">
+                                                                        <rect key="frame" x="0.0" y="0.0" width="30" height="15"/>
+                                                                        <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="eUM-L3-Wum">
+                                                                        <rect key="frame" x="35" y="0.0" width="30" height="15"/>
+                                                                        <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                                                    </button>
+                                                                </subviews>
+                                                            </stackView>
+                                                        </subviews>
+                                                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="trailing" secondItem="VYM-ne-UJV" secondAttribute="trailing" id="46s-Fs-rR6"/>
+                                                            <constraint firstAttribute="bottom" secondItem="VYM-ne-UJV" secondAttribute="bottom" id="5ho-ms-zMy"/>
+                                                            <constraint firstItem="VYM-ne-UJV" firstAttribute="top" secondItem="AGm-En-xac" secondAttribute="top" id="kxN-wc-1s4"/>
+                                                        </constraints>
+                                                    </view>
+                                                </subviews>
+                                                <constraints>
+                                                    <constraint firstItem="AGm-En-xac" firstAttribute="width" secondItem="ggq-Qr-ifq" secondAttribute="width" id="0Mz-1U-JBK"/>
+                                                    <constraint firstItem="4Ay-Dd-0K7" firstAttribute="width" secondItem="ggq-Qr-ifq" secondAttribute="width" id="uIw-qw-Qjk"/>
+                                                    <constraint firstAttribute="height" constant="15" id="wKr-6H-eLX"/>
+                                                </constraints>
+                                            </stackView>
+                                        </subviews>
+                                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                        <constraints>
+                                            <constraint firstItem="Tvl-9p-yTX" firstAttribute="top" secondItem="CHU-fJ-dcM" secondAttribute="bottom" constant="20" id="6Sq-d0-vf0"/>
+                                            <constraint firstItem="Tvl-9p-yTX" firstAttribute="leading" secondItem="aWu-Gn-orV" secondAttribute="leading" constant="15" id="BzM-6d-7s9"/>
+                                            <constraint firstItem="CHU-fJ-dcM" firstAttribute="top" secondItem="aWu-Gn-orV" secondAttribute="top" constant="20" id="GwN-99-Sul"/>
+                                            <constraint firstAttribute="bottom" secondItem="Tvl-9p-yTX" secondAttribute="bottom" constant="10" id="Wai-PD-mmy"/>
+                                            <constraint firstAttribute="trailing" secondItem="Tvl-9p-yTX" secondAttribute="trailing" constant="15" id="cqq-sK-gBu"/>
+                                            <constraint firstItem="CHU-fJ-dcM" firstAttribute="leading" secondItem="aWu-Gn-orV" secondAttribute="leading" constant="15" id="quD-42-Af2"/>
+                                        </constraints>
+                                    </view>
+                                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="lYc-qe-ZEE">
+                                        <rect key="frame" x="0.0" y="66.666666666666686" width="406" height="126.33333333333331"/>
+                                        <subviews>
+                                            <stackView opaque="NO" contentMode="scaleToFill" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="rHl-kY-Ucq">
+                                                <rect key="frame" x="15" y="10" width="376" height="96.333333333333329"/>
+                                                <subviews>
+                                                    <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="wPZ-nh-ZDl">
+                                                        <rect key="frame" x="0.0" y="0.0" width="178" height="96.333333333333329"/>
+                                                        <subviews>
+                                                            <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ybm-1L-lDG">
+                                                                <rect key="frame" x="0.0" y="0.0" width="178" height="20.333333333333332"/>
+                                                                <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="F7P-DP-0aa">
+                                                                        <rect key="frame" x="0.0" y="0.0" width="89" 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" text="Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="k1b-x0-KnD">
+                                                                        <rect key="frame" x="89" y="0.0" width="89" height="20.333333333333332"/>
+                                                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                                        <nil key="textColor"/>
+                                                                        <nil key="highlightedColor"/>
+                                                                    </label>
+                                                                </subviews>
+                                                                <constraints>
+                                                                    <constraint firstItem="k1b-x0-KnD" firstAttribute="width" secondItem="F7P-DP-0aa" secondAttribute="width" id="czY-ux-B1l"/>
+                                                                </constraints>
+                                                            </stackView>
+                                                            <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wDg-jF-u8R">
+                                                                <rect key="frame" x="0.0" y="25.333333333333329" width="178" height="20.333333333333329"/>
+                                                                <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="aGE-C2-QLB">
+                                                                        <rect key="frame" x="0.0" y="0.0" width="89" 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" text="Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hFF-eb-afk">
+                                                                        <rect key="frame" x="89" y="0.0" width="89" height="20.333333333333332"/>
+                                                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                                        <nil key="textColor"/>
+                                                                        <nil key="highlightedColor"/>
+                                                                    </label>
+                                                                </subviews>
+                                                                <constraints>
+                                                                    <constraint firstItem="hFF-eb-afk" firstAttribute="width" secondItem="aGE-C2-QLB" secondAttribute="width" id="Qdh-MO-M9v"/>
+                                                                </constraints>
+                                                            </stackView>
+                                                            <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="1Jk-Z1-ke0">
+                                                                <rect key="frame" x="0.0" y="50.666666666666657" width="178" height="20.333333333333329"/>
+                                                                <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="bFL-xV-Fm4">
+                                                                        <rect key="frame" x="0.0" y="0.0" width="89" 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" text="Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="OGI-wy-Csg">
+                                                                        <rect key="frame" x="89" y="0.0" width="89" height="20.333333333333332"/>
+                                                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                                        <nil key="textColor"/>
+                                                                        <nil key="highlightedColor"/>
+                                                                    </label>
+                                                                </subviews>
+                                                                <constraints>
+                                                                    <constraint firstItem="OGI-wy-Csg" firstAttribute="width" secondItem="bFL-xV-Fm4" secondAttribute="width" id="EjB-V5-XSM"/>
+                                                                </constraints>
+                                                            </stackView>
+                                                            <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dKt-yC-crM">
+                                                                <rect key="frame" x="0.0" y="75.999999999999986" width="178" height="20.333333333333329"/>
+                                                                <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="qfS-1P-c6E">
+                                                                        <rect key="frame" x="0.0" y="0.0" width="89" 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" text="Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wNw-Lb-9UM">
+                                                                        <rect key="frame" x="89" y="0.0" width="89" height="20.333333333333332"/>
+                                                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                                        <nil key="textColor"/>
+                                                                        <nil key="highlightedColor"/>
+                                                                    </label>
+                                                                </subviews>
+                                                                <constraints>
+                                                                    <constraint firstItem="wNw-Lb-9UM" firstAttribute="width" secondItem="qfS-1P-c6E" secondAttribute="width" id="weX-Jf-sja"/>
+                                                                </constraints>
+                                                            </stackView>
+                                                        </subviews>
+                                                        <constraints>
+                                                            <constraint firstItem="wDg-jF-u8R" firstAttribute="height" secondItem="Ybm-1L-lDG" secondAttribute="height" id="P7g-cy-qDo"/>
+                                                            <constraint firstItem="dKt-yC-crM" firstAttribute="height" secondItem="Ybm-1L-lDG" secondAttribute="height" id="ajW-4l-DhA"/>
+                                                            <constraint firstItem="1Jk-Z1-ke0" firstAttribute="height" secondItem="Ybm-1L-lDG" secondAttribute="height" id="nUT-EG-RIF"/>
+                                                        </constraints>
+                                                    </stackView>
+                                                    <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="LLC-bc-L41">
+                                                        <rect key="frame" x="198" y="0.0" width="178" height="96.333333333333329"/>
+                                                        <subviews>
+                                                            <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="iLc-1q-iFE">
+                                                                <rect key="frame" x="0.0" y="0.0" width="178" height="20.333333333333332"/>
+                                                                <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="2lo-cd-unU">
+                                                                        <rect key="frame" x="0.0" y="0.0" width="89" 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" text="Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Khm-Ii-PHq">
+                                                                        <rect key="frame" x="89" y="0.0" width="89" height="20.333333333333332"/>
+                                                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                                        <nil key="textColor"/>
+                                                                        <nil key="highlightedColor"/>
+                                                                    </label>
+                                                                </subviews>
+                                                                <constraints>
+                                                                    <constraint firstItem="Khm-Ii-PHq" firstAttribute="width" secondItem="2lo-cd-unU" secondAttribute="width" id="u1W-78-JYV"/>
+                                                                </constraints>
+                                                            </stackView>
+                                                            <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4ID-yf-oAC">
+                                                                <rect key="frame" x="0.0" y="25.333333333333329" width="178" height="20.333333333333329"/>
+                                                                <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="pMr-2z-4aO">
+                                                                        <rect key="frame" x="0.0" y="0.0" width="89" 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" text="Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tBo-Ec-x4V">
+                                                                        <rect key="frame" x="89" y="0.0" width="89" height="20.333333333333332"/>
+                                                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                                        <nil key="textColor"/>
+                                                                        <nil key="highlightedColor"/>
+                                                                    </label>
+                                                                </subviews>
+                                                                <constraints>
+                                                                    <constraint firstItem="tBo-Ec-x4V" firstAttribute="width" secondItem="pMr-2z-4aO" secondAttribute="width" id="lSn-CV-7MW"/>
+                                                                </constraints>
+                                                            </stackView>
+                                                            <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LP8-uT-nHW">
+                                                                <rect key="frame" x="0.0" y="50.666666666666657" width="178" height="20.333333333333329"/>
+                                                                <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="yuN-sv-B6d">
+                                                                        <rect key="frame" x="0.0" y="0.0" width="89" 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" text="Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jRC-xh-Jdd">
+                                                                        <rect key="frame" x="89" y="0.0" width="89" height="20.333333333333332"/>
+                                                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                                        <nil key="textColor"/>
+                                                                        <nil key="highlightedColor"/>
+                                                                    </label>
+                                                                </subviews>
+                                                                <constraints>
+                                                                    <constraint firstItem="jRC-xh-Jdd" firstAttribute="width" secondItem="yuN-sv-B6d" secondAttribute="width" id="d7a-C1-Gj3"/>
+                                                                </constraints>
+                                                            </stackView>
+                                                            <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rhg-xc-Las">
+                                                                <rect key="frame" x="0.0" y="75.999999999999986" width="178" height="20.333333333333329"/>
+                                                                <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="75x-M0-etj">
+                                                                        <rect key="frame" x="0.0" y="0.0" width="89" 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" text="Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Cbf-Ca-Ltm">
+                                                                        <rect key="frame" x="89" y="0.0" width="89" height="20.333333333333332"/>
+                                                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                                        <nil key="textColor"/>
+                                                                        <nil key="highlightedColor"/>
+                                                                    </label>
+                                                                </subviews>
+                                                                <constraints>
+                                                                    <constraint firstItem="Cbf-Ca-Ltm" firstAttribute="width" secondItem="75x-M0-etj" secondAttribute="width" id="t7C-eF-KP0"/>
+                                                                </constraints>
+                                                            </stackView>
+                                                        </subviews>
+                                                    </stackView>
+                                                </subviews>
+                                                <constraints>
+                                                    <constraint firstItem="iLc-1q-iFE" firstAttribute="height" secondItem="Ybm-1L-lDG" secondAttribute="height" id="NWZ-to-ggY"/>
+                                                    <constraint firstItem="rhg-xc-Las" firstAttribute="height" secondItem="Ybm-1L-lDG" secondAttribute="height" id="jN9-zs-wDQ"/>
+                                                    <constraint firstItem="LLC-bc-L41" firstAttribute="width" secondItem="wPZ-nh-ZDl" secondAttribute="width" id="oU3-Xd-CKs"/>
+                                                    <constraint firstItem="4ID-yf-oAC" firstAttribute="height" secondItem="Ybm-1L-lDG" secondAttribute="height" id="pzh-Ee-rku"/>
+                                                    <constraint firstItem="LP8-uT-nHW" firstAttribute="height" secondItem="Ybm-1L-lDG" secondAttribute="height" id="wfF-jk-nT3"/>
+                                                </constraints>
+                                            </stackView>
+                                        </subviews>
+                                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                        <constraints>
+                                            <constraint firstAttribute="bottom" secondItem="rHl-kY-Ucq" secondAttribute="bottom" constant="20" id="4oL-mO-H8w"/>
+                                            <constraint firstItem="rHl-kY-Ucq" firstAttribute="leading" secondItem="lYc-qe-ZEE" secondAttribute="leading" constant="15" id="V7V-4x-mIj"/>
+                                            <constraint firstItem="rHl-kY-Ucq" firstAttribute="top" secondItem="lYc-qe-ZEE" secondAttribute="top" constant="10" id="Zty-hq-mac"/>
+                                            <constraint firstAttribute="trailing" secondItem="rHl-kY-Ucq" secondAttribute="trailing" constant="15" id="b0O-lS-N4r"/>
+                                        </constraints>
+                                    </view>
+                                </subviews>
+                            </stackView>
+                        </subviews>
+                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                        <constraints>
+                            <constraint firstAttribute="bottom" secondItem="dsh-Ds-ifS" secondAttribute="bottom" id="24D-Zc-vlo"/>
+                            <constraint firstItem="dsh-Ds-ifS" firstAttribute="top" secondItem="Wiw-fI-LxM" secondAttribute="top" id="b8r-70-OfX"/>
+                            <constraint firstAttribute="trailing" secondItem="dsh-Ds-ifS" secondAttribute="trailing" id="p9M-df-dMT"/>
+                            <constraint firstItem="dsh-Ds-ifS" firstAttribute="leading" secondItem="Wiw-fI-LxM" secondAttribute="leading" id="wym-yJ-eK9"/>
+                        </constraints>
+                    </view>
+                </subviews>
+                <constraints>
+                    <constraint firstItem="Wiw-fI-LxM" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="21J-9x-vPk"/>
+                    <constraint firstAttribute="bottom" secondItem="Wiw-fI-LxM" secondAttribute="bottom" id="LN6-No-ED4"/>
+                    <constraint firstAttribute="trailing" secondItem="Wiw-fI-LxM" secondAttribute="trailing" id="g4n-sy-Yqy"/>
+                    <constraint firstItem="Wiw-fI-LxM" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="jPV-SP-4w8"/>
+                </constraints>
             </tableViewCellContentView>
-            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
+            <connections>
+                <outlet property="bgView" destination="Wiw-fI-LxM" id="99q-Vd-x2x"/>
+                <outlet property="changeLab" destination="idZ-G6-DOn" id="lTj-2V-Op2"/>
+                <outlet property="mark1Btn" destination="Ku6-J2-BI5" id="dKK-h8-wsa"/>
+                <outlet property="mark2Btn" destination="eUM-L3-Wum" id="fad-jW-KpE"/>
+                <outlet property="numberLab" destination="ggq-Qr-ifq" id="h4e-7u-mic"/>
+                <outlet property="priceLab" destination="CHU-fJ-dcM" id="hbe-LP-lHp"/>
+                <outlet property="stateLab" destination="laq-rA-uTg" id="kEZ-UV-LEQ"/>
+                <outlet property="title1Lab" destination="F7P-DP-0aa" id="hA1-wE-fYE"/>
+                <outlet property="title2Lab" destination="aGE-C2-QLB" id="0kZ-24-Npg"/>
+                <outlet property="title3Lab" destination="bFL-xV-Fm4" id="krk-xV-RLF"/>
+                <outlet property="title4Lab" destination="qfS-1P-c6E" id="24Y-KR-DNy"/>
+                <outlet property="title5Lab" destination="2lo-cd-unU" id="Gno-lH-DkZ"/>
+                <outlet property="title6Lab" destination="pMr-2z-4aO" id="A5Z-A9-fSU"/>
+                <outlet property="title7Lab" destination="yuN-sv-B6d" id="Zqe-aF-zeo"/>
+                <outlet property="title8Lab" destination="75x-M0-etj" id="jFS-3e-L4A"/>
+                <outlet property="value1Lab" destination="k1b-x0-KnD" id="sGi-Ja-DQO"/>
+                <outlet property="value2Lab" destination="hFF-eb-afk" id="U5L-jP-ghI"/>
+                <outlet property="value3Lab" destination="OGI-wy-Csg" id="KI8-Wn-CpF"/>
+                <outlet property="value4Lab" destination="wNw-Lb-9UM" id="ORR-Hq-Kcp"/>
+                <outlet property="value5Lab" destination="Khm-Ii-PHq" id="xNp-ax-npK"/>
+                <outlet property="value6Lab" destination="tBo-Ec-x4V" id="sdj-lD-QtL"/>
+                <outlet property="value7Lab" destination="jRC-xh-Jdd" id="WLQ-ii-4gd"/>
+                <outlet property="value8Lab" destination="Cbf-Ca-Ltm" id="ycT-Gi-Bv5"/>
+            </connections>
+            <point key="canvasLocation" x="167.93893129770993" y="89.788732394366207"/>
         </tableViewCell>
     </objects>
 </document>

+ 178 - 2
Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteKLinewCell.swift

@@ -7,18 +7,194 @@
 //
 
 import UIKit
+import ReactiveSwift
+import ReactiveCocoa
 
 class MDAuoteKLinewCell: BaseTableViewCell {
+    @IBOutlet weak var topView: UIView!
+    @IBOutlet weak var centerView: UIView!
 
+    let (signal, observer) = Signal<String,Never>.pipe()
+    lazy var data:[(String,String)] = {
+        let arr:[(String,String)] = [(String,String)]()
+        return arr
+    }()
+    
+    /// k线周期
+    private lazy var kPeriod:KLinePeriod = {
+        let kPeriod = KLinePeriod.getDefaultKLinePeriod()
+        return kPeriod
+    }()
+    
+    //k线图
+    private lazy var kLineView:KLineView = {
+        let kLineView = KLineView()
+        kLineView.delegate = self
+        return kLineView
+    }()
+    
+    // k线数据源
+    private lazy var dataSource:[KLineModel] = {
+        let dataSource = [KLineModel]()
+        return dataSource
+    }()
+    
+    lazy var kLHeaderView:KLineHeaderView = {
+        let kLHeaderView:KLineHeaderView = KLineHeaderView()
+        kLHeaderView.signalKLineHeader.observeResult({[weak self] (result) in
+            let type = try! result.get()
+            self?.observer.send(value: type)
+        })
+        return kLHeaderView
+    }()
     override func awakeFromNib() {
         super.awakeFromNib()
+        self.backgroundColor = ALLBackGroundColor
+        self.topView.backgroundColor = ALLBackGroundColor
+        
+        self.centerView.backgroundColor = ALLBackGroundColor
+        
+        self.topView.addSubview(kLHeaderView)
+        self.centerView.addSubview(kLineView)
+        
+        self.kLHeaderView.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+        self.kLineView.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+        
+        
         // Initialization code
     }
-
+    
     override func setSelected(_ selected: Bool, animated: Bool) {
         super.setSelected(selected, animated: animated)
-
+        
         // Configure the view for the selected state
     }
     
 }
+extension MDAuoteKLinewCell {
+    func updateCellWithModel(list:[KSymbolKlineData],symbol:KSymbolModel,isSocket:Bool){
+        let pModel = SymbolPrecisionModel()
+        pModel.pricePrecision = symbol.digits
+        pModel.numberPrecision = symbol.digits
+        kLineView.setSymbolPrecision(model: pModel)
+        if isSocket {
+            let cModel = list.first!
+            if dataSource.count == 0{
+                dataSource.append(self.kLineModel(cModel: cModel))
+            }else{
+                let kModel:KLineModel = dataSource.last!
+                if kModel.timestamp == cModel.datetime{
+                    dataSource[dataSource.count-1] = self.kLineModel(cModel: cModel)
+                }else{
+                    dataSource.append(self.kLineModel(cModel: cModel))
+                }
+            }
+            UtilAlgorithm.calculationResults(models: dataSource)
+        }else{
+            //self.kLHeaderView.timeBtn.setTitle(KLinePeriod.titleFor(kPeriod:KLinePeriod.getDefaultKLinePeriod()), for: .normal)
+            //               self.kLHeaderView.timeBtn.setImage(CT_Kline_Arrow_Image, for: .normal)
+            //               self.kLHeaderView.timeBtn.layoutButtonEdgeInsetStyle(type: .right, space: 5)
+            self.kLHeaderView.updateMoreTimer()
+            self.kLHeaderView.collectionView.reloadData()
+            self.kLHeaderView.targetBtn.setImage(CT_Kline_Arrow_Image, for: .normal)
+            dataSource = [KLineModel]()
+            for model in list{
+                guard model.datetime.length >  0 else{
+                    return
+                }
+                dataSource.append(self.kLineModel(cModel:model))
+            }
+
+            UtilAlgorithm.calculationResults(models: dataSource)
+//            if KLineMainTarget.getDefaultKLineTarget() == KLineMainTarget.targetNONE {
+//                kLineView.setKIndexTop(index: .NONE)
+//            }else
+            if KLineMainTarget.getDefaultKLineTarget() == KLineMainTarget.targetBOLL {
+                kLineView.setKIndexTop(index: .BOLL)
+            }else if KLineMainTarget.getDefaultKLineTarget() == KLineMainTarget.targetMA {
+                kLineView.setKIndexTop(index: .SMA)
+            }
+
+            kLineView.setKIndexCenter(index: .VOL)
+            let viceArr = KLineViceTarget.getDefaultKLineTarget()
+//            if viceArr.contains(.targetNONE) {
+//                kLineView.setHighly(topHeight:250, centerHeight: 120, bottomHeight:0)
+//            }else{
+            kLineView.setHighly(topHeight:250, centerHeight: 0, bottomHeight:Double(viceArr.count*100))
+//            }
+
+            var indexBottoms:[KIndexBottom] = [KIndexBottom]()
+            for vice in viceArr {
+                if vice == .targetMACD {
+                    indexBottoms.append(.MACD)
+                }else if vice == .targetKDJ {
+                    indexBottoms.append(.KDJ)
+                }else if vice == .targetRSI {
+                    indexBottoms.append(.RSI)
+                }else if vice == .targetWR {
+                    indexBottoms.append(.WR)
+                }
+//                else if vice == .targetNONE{
+//                    indexBottoms.append(.NONE)
+//                }
+            }
+
+            kLineView.setKIndexBottom(indexs: indexBottoms)
+
+
+//            if KLineViceTarget.getDefaultKLineTarget() == KLineViceTarget.targetNONE {
+//                kLineView.setKIndexBottom(index: .NONE)
+//                kLineView.setHighly(topHeight: 1.85, centerHeight: 1.15, bottomHeight: 0)
+//            }else if  KLineViceTarget.getDefaultKLineTarget() == KLineViceTarget.targetKDJ {
+//                kLineView.setKIndexBottom(index: .KDJ)
+//            }else if  KLineViceTarget.getDefaultKLineTarget() == KLineViceTarget.targetMACD {
+//                kLineView.setKIndexBottom(index: .MACD)
+//            }else if  KLineViceTarget.getDefaultKLineTarget() == KLineViceTarget.targetRSI {
+//                kLineView.setKIndexBottom(index: .RSI)
+//            }else if  KLineViceTarget.getDefaultKLineTarget() == KLineViceTarget.targetWR {
+//                kLineView.setKIndexBottom(index: .WR)
+//            }
+        }
+
+        self.kLineView.reloadData(isSocket: isSocket)
+
+
+
+    }
+
+    func kLineModel(cModel:KSymbolKlineData) -> KLineModel {
+        let time:String = cModel.datetime
+        let open:Double = conerData(cModel.open as Any, .MyDouble).2!
+        let high:Double = conerData(cModel.high as Any, .MyDouble).2!
+        let low:Double = conerData(cModel.low as Any, .MyDouble).2!
+        let close:Double = conerData(cModel.close as Any,.MyDouble).2!
+        let openClose = decimalNumber(A: cModel.close, B: cModel.open, type: .Subtract)
+        let inc = decimalNumber(A: openClose, B: cModel.open, type: .Divid)
+        let increase:String = precisionString(with: decimalNumber(A: inc, B: "100", type: .Multiply), precision: "2") + "%"
+
+        return KLineModel(timestamp:time , open:open , high: high, low: low, close: close, increase:increase)
+    }
+
+}
+
+extension MDAuoteKLinewCell : KLineViewDataSource {
+
+    func kLineViewForType(_ kLineView: KLineView) -> KType {
+        return .kLine
+    }
+    func kLineViewForData(_ kLineView: KLineView) -> [KLineModel] {
+        return dataSource
+    }
+}
+
+extension CTKLineChartsCell{
+
+//    func updateCelldata(vm:CTProViewModel) -> Void {
+//        _ = vm.marketModel
+//    }
+}
+

+ 41 - 6
Koala/Koala/Modular/Market/V/MarketDetailView/MDAuoteView/MDAuoteKLinewCell.xib

@@ -1,21 +1,56 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13142" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<?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>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/>
+        <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="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="MDAuoteKLinewCell" customModuleProvider="target">
-            <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
+        <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="183" id="KGk-i7-Jjw" customClass="MDAuoteKLinewCell" customModule="Koala" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="439" height="183"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
             <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
-                <rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
+                <rect key="frame" x="0.0" y="0.0" width="439" height="183"/>
                 <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="WUe-r1-l1X">
+                        <rect key="frame" x="0.0" y="0.0" width="439" height="40"/>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                        <constraints>
+                            <constraint firstAttribute="height" constant="40" id="Jdr-M4-Vf6"/>
+                        </constraints>
+                    </view>
+                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="sUB-Xr-McZ">
+                        <rect key="frame" x="0.0" y="41" width="439" height="142"/>
+                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    </view>
+                </subviews>
+                <constraints>
+                    <constraint firstAttribute="trailing" secondItem="WUe-r1-l1X" secondAttribute="trailing" id="1mE-vo-xFF"/>
+                    <constraint firstItem="sUB-Xr-McZ" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="MT6-RO-tCI"/>
+                    <constraint firstItem="sUB-Xr-McZ" firstAttribute="top" secondItem="WUe-r1-l1X" secondAttribute="bottom" constant="1" id="MsZ-ZD-dcL"/>
+                    <constraint firstAttribute="bottom" secondItem="sUB-Xr-McZ" secondAttribute="bottom" id="gh2-Mc-6He"/>
+                    <constraint firstAttribute="trailing" secondItem="sUB-Xr-McZ" secondAttribute="trailing" id="h1Z-IQ-KvD"/>
+                    <constraint firstItem="WUe-r1-l1X" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="u2k-2L-E4h"/>
+                    <constraint firstItem="WUe-r1-l1X" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="zzL-Bm-3VK"/>
+                </constraints>
             </tableViewCellContentView>
             <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
+            <connections>
+                <outlet property="centerView" destination="sUB-Xr-McZ" id="pBe-8n-M3j"/>
+                <outlet property="topView" destination="WUe-r1-l1X" id="myk-06-uG4"/>
+            </connections>
+            <point key="canvasLocation" x="170" y="64"/>
         </tableViewCell>
     </objects>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
 </document>

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

@@ -9,7 +9,210 @@
 import UIKit
 
 class MDAuoteView: BaseView {
+    var VM: MDAuoteViewModel?
+    
+    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: "MDAuoteInfoCell", bundle: nil), forCellReuseIdentifier: "MDAuoteInfoCell")
+        
+        tableView.register(UINib.init(nibName: "MDAuoteKLinewCell", bundle: nil), forCellReuseIdentifier: "MDAuoteKLinewCell")
+        
+        tableView.register(UINib.init(nibName: "AssetsTotalRecordCell", bundle: nil), forCellReuseIdentifier: "AssetsTotalRecordCell")
+        
+        if #available(iOS 11, *){
+            tableView.contentInsetAdjustmentBehavior = .never
+        }
+        return tableView
+        }()
+    
 
+    lazy var bottomView:UIView = {
+        let view:UIView = UIView()
+        view.backgroundColor = ALLBackGroundColor
+        
+        let lineView:UIView = UIView()
+        lineView.backgroundColor = ViewBorderColor
+        view.addSubview(lineView)
+        
+        let leftBtn:UIButton = UIButton.init(type: .custom)
+        leftBtn.setTitle(switchLanguage("买入"), for: .normal)
+        leftBtn.setTextFont(.PFSR, 14)
+        leftBtn.setViewLayerBorderColor(myColor: .clear, borderWidth: 0, maskBounds:20)
+        leftBtn.setTitleColor(WhiteTextColor, for: .normal)
+        leftBtn.backgroundColor = exchangeColorAndImage(increase: 1).0
+        view.addSubview(leftBtn)
+        
+        let rightBtn:UIButton = UIButton.init(type: .custom)
+        rightBtn.setTitle(switchLanguage("卖出"), for: .normal)
+        rightBtn.setTextFont(.PFSR, 14)
+        rightBtn.setViewLayerBorderColor(myColor: .clear, borderWidth: 0, maskBounds:20)
+        rightBtn.setTitleColor(WhiteTextColor, for: .normal)
+        rightBtn.backgroundColor = exchangeColorAndImage(increase: -1).0
+        view.addSubview(rightBtn)
+        
+        lineView.snp.makeConstraints { make in
+            make.top.left.right.equalToSuperview()
+            make.height.equalTo(1)
+        }
+        
+        leftBtn.snp.makeConstraints { make in
+            make.left.equalTo(15)
+            make.top.equalTo(10)
+            make.height.equalTo(40)
+        }
+        
+        rightBtn.snp.makeConstraints { make in
+            make.left.equalTo(leftBtn.snp.right).offset(15)
+            make.right.equalTo(-15)
+            make.top.equalTo(10)
+            make.height.equalTo(40)
+            make.width.equalTo(leftBtn.snp.width)
+        }
+        
+        return view
+    }()
     
+    override func subView() {
+        self.addSubview(tableView)
+        self.addSubview(bottomView)
+
+        mySwitchLanguage()
+        mySwitchSkin()
+        
+    }
+    
+    override func layoutSubviews() {
+        super.layoutSubviews()
+        tableView.snp.makeConstraints { make in
+            make.top.right.left.equalToSuperview()
+        }
+        
+        bottomView.snp.makeConstraints { make in
+            make.left.right.bottom.equalToSuperview()
+            make.top.equalTo(self.tableView.snp.bottom)
+            make.height.equalTo(KBottomMargin+60)
+            
+        }
+        
+       
+       
+    }
+    
+    override func setViewModel(viewmodel: AnyObject) {
+        guard viewmodel is MDAuoteViewModel else {
+            return
+        }
+        self.VM = viewmodel as? MDAuoteViewModel
+        super.setViewModel(viewmodel: viewmodel)
+       
+    }
+    
+    override func mySwitchLanguage() {
+        //self.footerView.mySwitchLanguage()
+       
+    }
+    
+    override func mySwitchSkin() {
+        self.tableView.backgroundColor = .clear
+        self.backgroundColor = ALLBackGroundColor
+       
+    }
+    
+
+    override func blindModel() {
+        
+    }
+    
+    func reloadTable() {
+        DispatchQueue.main.async {
+//            self.tableView.mj_header!.endRefreshing()
+            self.tableView.reloadData()
+        }
+    }
 
 }
+
+//代理
+extension MDAuoteView: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:MDAuoteInfoCell = tableView.dequeueReusableCell(withIdentifier: "MDAuoteInfoCell") as! MDAuoteInfoCell
+            cell.updateCellWith(model: self.VM!.symbolModel)
+            return cell
+        }
+        else if indexPath.section == 1 {
+            let cell:MDAuoteKLinewCell = tableView.dequeueReusableCell(withIdentifier: "MDAuoteKLinewCell") as! MDAuoteKLinewCell
+            cell.updateCellWithModel(list: self.VM!.priceList,symbol: self.VM!.symbolModel, isSocket: false)
+            cell.signal.observeResult { [weak self] (result) in
+                let type = try! result.get()
+                if type == "MainClose" || type == "ViceClose" || type == "Main" || type == "Vice" {
+                    self?.reloadTable()
+                }else if type == "Full"{
+                    
+                }else{
+                    self?.VM?.period = type
+                    //self?.VM?.netGetKline()
+                }
+            }
+            return cell
+        }
+        
+        let cell:MDAuoteInfoCell = tableView.dequeueReusableCell(withIdentifier: "MDAuoteInfoCell") as! MDAuoteInfoCell
+       
+        return cell
+    }
+    
+    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
+        if indexPath.section == 0{
+            return 190
+        }
+        else if indexPath.section == 1{
+            let viceArr = KLineViceTarget.getDefaultKLineTarget()
+            return CGFloat(300+KLineViceTarget.getDefaultKLineTarget().count*110)
+        }
+        return 60
+    }
+    
+    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 {
+        return 5
+    }
+    
+    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
+      
+    }
+    
+}
+

+ 132 - 6
Koala/Koala/Modular/Market/V/MarketDetailView/MarketDetailNavView.swift

@@ -10,12 +10,138 @@ import UIKit
 
 class MarketDetailNavView: BaseView {
 
-    /*
-    // Only override draw() if you perform custom drawing.
-    // An empty implementation adversely affects performance during animation.
-    override func draw(_ rect: CGRect) {
-        // Drawing code
+    @IBOutlet weak var bgView: UIView!
+    @IBOutlet weak var backBtn: UIButton!
+    @IBOutlet weak var titleLab: UILabel!
+    @IBOutlet weak var stateBgView: UIView!
+    @IBOutlet weak var stateBtn: UIButton!
+    @IBOutlet weak var priceLab: UILabel!
+    @IBOutlet weak var shareBtn: UIButton!
+    @IBOutlet weak var collectionBtn: UIButton!
+    
+    var collectionBlock:(() -> ())?
+    var shareBlock:(() -> ())?
+    
+    var navView: UIView!
+    
+    func loadFromNib() -> UIView {
+        return Bundle.main.loadNibNamed("MarketDetailNavView", owner: self, options: nil)?.first as! UIView
     }
-    */
 
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        navView = loadFromNib()
+        addSubview(navView)
+        navView.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+        
+        self.backBtn.addTarget(self, action: #selector(clickBackBtnAction), for: .touchUpInside)
+        
+        self.shareBtn.addTarget(self, action: #selector(clickShareBtnAction), for: .touchUpInside)
+        
+        self.collectionBtn.addTarget(self, action: #selector(clickCollectionBtnAction), for: .touchUpInside)
+        
+        self.titleLab.setTextFont(.PFSM, 18)
+        
+        self.priceLab.setTextFont(.PFSR, 12)
+        
+        self.stateBtn.setTextFont(.PFSR, 12)
+        
+        self.stateBtn.contentEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 5)
+        
+        self.stateBtn.setViewLayerBorderColor(myColor: .clear, borderWidth: 0, maskBounds: 4)
+        
+        self.stateBtn.layer.masksToBounds = true
+        
+        
+        mySwitchLanguage()
+        mySwitchSkin()
+       
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+    }
+    
+    override func mySwitchLanguage() {
+        self.stateBtn.setTitle(switchLanguage("已休盘"), for: .normal)
+        
+    }
+    
+    override func mySwitchSkin() {
+        self.navView.backgroundColor = ALLBackGroundColor
+        self.stateBgView.backgroundColor = MidBackGroundColor
+        
+        self.backBtn .setImage(NavViewBlackImage, for: .normal)
+        
+        self.titleLab.textColor = TitleTextColor
+        self.stateBtn.setTitleColor(MidTextColor, for: .normal)
+        self.stateBtn.backgroundColor = MidBackGroundColor
+        
+        self.shareBtn.setImage(_image("Market_share&Market_share"), for: .normal)
+        
+        self.collectionBtn.setImage(_image("Market_collection&Market_collection"), for: .normal)
+        
+        
+        
+    }
+    
+    func updateDataWith(model:KSymbolModel) -> Void {
+        self.titleLab.text = model.title
+        self.updatePriceWith(model: model)
+        
+        self.updateCollection(isCollection: model.isCollection)
+    }
+
+    func updatePriceWith(model:KSymbolModel) -> Void {
+        
+        let difference:Double = conerData(model.newPrice, .MyDouble).2! - conerData(model.open, .MyDouble).2!
+        var differenceStr = "0.00"
+        if difference > 0 {
+            differenceStr = String(format: "+%.2f", difference)
+        }else{
+            differenceStr = String(format: "%.2f", difference)
+        }
+        
+        let increase = conerData(model.increase as Any, .MyFloat).1!
+        var increaseStr = "0.00%"
+        if increase > 0 {
+            increaseStr = "+" + precisionString(with: model.increase, precision: "2")  + "%"
+        }else{
+            increaseStr = precisionString(with: model.increase, precision: "2")  + "%"
+        }
+        
+        self.priceLab.textColor = exchangeColorAndImage(increase: increase).0
+        self.priceLab.text = String(format: "%@ %@ %@", model.newPrice,differenceStr,increaseStr)
+    }
+    
+    
+    func updateCollection(isCollection:Bool) -> Void {
+        if isCollection {
+            self.collectionBtn.setImage(_image("Market_unCollection&Market_unCollection"), for: .normal)
+        }else{
+            self.collectionBtn.setImage(_image("Market_collection&Market_collection"), for: .normal)
+        }
+    }
+    
+    
+    
+}
+
+extension MarketDetailNavView{
+    
+    @objc func clickBackBtnAction(){
+        currentVc()?.navigationController?.popViewController(animated: true)
+    }
+    
+    @objc func clickShareBtnAction(){
+        self.shareBlock?()
+    }
+    
+    @objc func clickCollectionBtnAction(){
+        self.collectionBlock?()
+    }
+    
+    
 }

+ 139 - 8
Koala/Koala/Modular/Market/V/MarketDetailView/MarketDetailNavView.xib

@@ -1,18 +1,149 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13142" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<?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>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/>
-        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <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="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MarketDetailNavView" customModule="Koala" customModuleProvider="target">
+            <connections>
+                <outlet property="backBtn" destination="Ot1-Eh-u3p" id="dhk-cp-KAI"/>
+                <outlet property="bgView" destination="BcV-Ki-hIW" id="ABy-Wj-u7s"/>
+                <outlet property="collectionBtn" destination="iGr-8s-w8Z" id="qut-cS-I2H"/>
+                <outlet property="priceLab" destination="unw-4h-oaa" id="gG6-Dv-Bo7"/>
+                <outlet property="shareBtn" destination="CXz-o6-eGU" id="0gI-UA-RJj"/>
+                <outlet property="stateBgView" destination="Icq-dQ-ZRf" id="ASD-ab-ypU"/>
+                <outlet property="stateBtn" destination="KMH-mY-wuv" id="kg2-To-gXr"/>
+                <outlet property="titleLab" destination="0rp-10-f9d" id="fOe-cA-oiZ"/>
+            </connections>
+        </placeholder>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
         <view contentMode="scaleToFill" id="iN0-l3-epB">
-            <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+            <rect key="frame" x="0.0" y="0.0" width="402" height="116"/>
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-            <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
-            <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
+            <subviews>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="BcV-Ki-hIW">
+                    <rect key="frame" x="0.0" y="72" width="402" height="44"/>
+                    <subviews>
+                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ot1-Eh-u3p">
+                            <rect key="frame" x="0.0" y="0.0" width="44" height="44"/>
+                            <constraints>
+                                <constraint firstAttribute="width" secondItem="Ot1-Eh-u3p" secondAttribute="height" multiplier="1:1" id="6Rf-f3-aB3"/>
+                            </constraints>
+                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                        </button>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4XX-Iz-XNd">
+                            <rect key="frame" x="180.33333333333334" y="2" width="41.333333333333343" height="40.333333333333336"/>
+                            <subviews>
+                                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="OT2-Rc-AbI">
+                                    <rect key="frame" x="0.0" y="0.0" width="41.333333333333336" height="20"/>
+                                    <subviews>
+                                        <stackView opaque="NO" contentMode="scaleToFill" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="BL0-Uh-Iwd">
+                                            <rect key="frame" x="-122.33333333333334" y="0.0" width="286.33333333333331" height="20"/>
+                                            <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="0rp-10-f9d">
+                                                    <rect key="frame" x="0.0" y="0.0" width="41.333333333333336" height="20"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Icq-dQ-ZRf">
+                                                    <rect key="frame" x="46.333333333333314" y="0.0" width="240" height="20"/>
+                                                    <subviews>
+                                                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="KMH-mY-wuv">
+                                                            <rect key="frame" x="0.0" y="2.3333333333333286" width="240" height="15"/>
+                                                            <constraints>
+                                                                <constraint firstAttribute="height" constant="15" id="ibt-Sc-rLU"/>
+                                                            </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="KMH-mY-wuv" firstAttribute="centerY" secondItem="Icq-dQ-ZRf" secondAttribute="centerY" id="OqR-th-abD"/>
+                                                        <constraint firstAttribute="trailing" secondItem="KMH-mY-wuv" secondAttribute="trailing" id="ijd-hL-dZK"/>
+                                                        <constraint firstItem="KMH-mY-wuv" firstAttribute="leading" secondItem="Icq-dQ-ZRf" secondAttribute="leading" id="xnR-5r-9GQ"/>
+                                                    </constraints>
+                                                </view>
+                                            </subviews>
+                                        </stackView>
+                                    </subviews>
+                                    <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                    <constraints>
+                                        <constraint firstItem="BL0-Uh-Iwd" firstAttribute="centerX" secondItem="OT2-Rc-AbI" secondAttribute="centerX" id="BvD-nT-F65"/>
+                                        <constraint firstItem="BL0-Uh-Iwd" firstAttribute="top" secondItem="OT2-Rc-AbI" secondAttribute="top" id="EoS-Yg-BY7"/>
+                                        <constraint firstItem="BL0-Uh-Iwd" firstAttribute="centerY" secondItem="OT2-Rc-AbI" secondAttribute="centerY" id="g4E-dJ-ajQ"/>
+                                        <constraint firstAttribute="height" constant="20" id="l1z-fi-qaA"/>
+                                    </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="unw-4h-oaa">
+                                    <rect key="frame" x="0.0" y="20" width="41.333333333333336" height="20.333333333333329"/>
+                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                    <nil key="textColor"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                            </subviews>
+                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            <constraints>
+                                <constraint firstItem="unw-4h-oaa" firstAttribute="leading" secondItem="4XX-Iz-XNd" secondAttribute="leading" id="1vg-XP-GRh"/>
+                                <constraint firstAttribute="trailing" secondItem="unw-4h-oaa" secondAttribute="trailing" id="LZ9-oZ-CIa"/>
+                                <constraint firstItem="OT2-Rc-AbI" firstAttribute="leading" secondItem="4XX-Iz-XNd" secondAttribute="leading" id="UwH-c1-ENd"/>
+                                <constraint firstItem="unw-4h-oaa" firstAttribute="top" secondItem="OT2-Rc-AbI" secondAttribute="bottom" id="bj1-pk-k3q"/>
+                                <constraint firstAttribute="trailing" secondItem="OT2-Rc-AbI" secondAttribute="trailing" id="i9n-Lt-eRM"/>
+                                <constraint firstItem="OT2-Rc-AbI" firstAttribute="top" secondItem="4XX-Iz-XNd" secondAttribute="top" id="mJm-am-faI"/>
+                                <constraint firstAttribute="bottom" secondItem="unw-4h-oaa" secondAttribute="bottom" id="tMs-2o-XIk"/>
+                            </constraints>
+                        </view>
+                        <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="e7h-lG-Gh9">
+                            <rect key="frame" x="314" y="0.0" width="88" height="44"/>
+                            <subviews>
+                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="CXz-o6-eGU">
+                                    <rect key="frame" x="0.0" y="0.0" width="44" height="44"/>
+                                    <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="iGr-8s-w8Z">
+                                    <rect key="frame" x="44" y="0.0" width="44" height="44"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" secondItem="iGr-8s-w8Z" secondAttribute="height" multiplier="1:1" id="HGy-M8-Xg1"/>
+                                    </constraints>
+                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                </button>
+                            </subviews>
+                            <constraints>
+                                <constraint firstItem="iGr-8s-w8Z" firstAttribute="width" secondItem="CXz-o6-eGU" secondAttribute="width" id="GFd-Dq-vyC"/>
+                            </constraints>
+                        </stackView>
+                    </subviews>
+                    <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="44" id="DED-XL-jbP"/>
+                        <constraint firstItem="e7h-lG-Gh9" firstAttribute="top" secondItem="BcV-Ki-hIW" secondAttribute="top" id="KOY-xb-LNc"/>
+                        <constraint firstItem="Ot1-Eh-u3p" firstAttribute="top" secondItem="BcV-Ki-hIW" secondAttribute="top" id="Kj1-Tg-RBp"/>
+                        <constraint firstAttribute="bottom" secondItem="Ot1-Eh-u3p" secondAttribute="bottom" id="SIo-rQ-2wV"/>
+                        <constraint firstItem="4XX-Iz-XNd" firstAttribute="centerX" secondItem="BcV-Ki-hIW" secondAttribute="centerX" id="TKd-B2-p6X"/>
+                        <constraint firstAttribute="trailing" secondItem="e7h-lG-Gh9" secondAttribute="trailing" id="ZNC-1B-a9A"/>
+                        <constraint firstItem="Ot1-Eh-u3p" firstAttribute="leading" secondItem="BcV-Ki-hIW" secondAttribute="leading" id="a2l-ai-5Ad"/>
+                        <constraint firstItem="4XX-Iz-XNd" firstAttribute="centerY" secondItem="BcV-Ki-hIW" secondAttribute="centerY" id="a5V-nt-YHh"/>
+                        <constraint firstAttribute="bottom" secondItem="e7h-lG-Gh9" secondAttribute="bottom" id="gyu-Jh-6Qz"/>
+                    </constraints>
+                </view>
+            </subviews>
+            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+            <constraints>
+                <constraint firstItem="BcV-Ki-hIW" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="4CB-CJ-NG0"/>
+                <constraint firstAttribute="trailing" secondItem="BcV-Ki-hIW" secondAttribute="trailing" id="7Qb-Db-ZqT"/>
+                <constraint firstAttribute="bottom" secondItem="BcV-Ki-hIW" secondAttribute="bottom" id="8S1-xi-DOM"/>
+            </constraints>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <point key="canvasLocation" x="-6.1068702290076331" y="281.69014084507046"/>
         </view>
     </objects>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
 </document>

+ 5 - 6
Koala/Koala/Modular/Market/V/MarketView/MarketView.swift

@@ -432,13 +432,12 @@ extension MarketView:UITableViewDelegate,UITableViewDataSource{
     
     func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
         let model = self.VM?.screenSymbolList[indexPath.row]
-//        let vc = CTKLineViewController()
-//        vc.viewModel.symbolModel = model!
-//        currentVc()?.navigationController?.pushViewController(vc, animated: true)
-       
-        let vc = MarketMainDetailViewController()
-        vc.viewModel.symbolModel = model!
+
+        let vc = MarketDetailViewController()
+        vc.symbolModel = model!
         currentVc()?.navigationController?.pushViewController(vc, animated: true)
+        
+        
     }
     
 }

+ 247 - 8
Koala/Koala/Modular/Market/VC/MarketDetailViewController.swift

@@ -9,22 +9,261 @@
 import UIKit
 
 class MarketDetailViewController: BaseViewController {
-
+    
+    var symbolModel:KSymbolModel = KSymbolModel()
+    
+    var auoteViewModel:MDAuoteViewModel = MDAuoteViewModel()
+    var financeViewModel:MDFinanceViewModel = MDFinanceViewModel()
+    var profileViewModel:MDProfileViewModel = MDProfileViewModel()
+    var newsViewModel:MDNewsViewModel = MDNewsViewModel()
+    var announcementViewModel:MDAnnouncementViewModel = MDAnnouncementViewModel()
+    var optionsViewModel:MDOptionsViewModel = MDOptionsViewModel()
+    
+    
+    lazy var auoteView: MDAuoteView = {
+        let view = MDAuoteView.init(type: .ViewModel(ViewModel: self.auoteViewModel))
+        return view
+    }()
+    
+    lazy var financeView:MDFinanceView = {
+        let view = MDFinanceView.init(type: .ViewModel(ViewModel: self.financeViewModel))
+        return view
+    }()
+    
+    lazy var profileView: MDProfileView = {
+        let view = MDProfileView.init(type: .ViewModel(ViewModel: self.profileViewModel))
+        return view
+    }()
+    
+    lazy var newsView: MDNewsView = {
+        let view = MDNewsView.init(type: .ViewModel(ViewModel: self.newsViewModel))
+        return view
+    }()
+    
+    lazy var announcementView: MDAnnouncementView = {
+        let view = MDAnnouncementView.init(type: .ViewModel(ViewModel: self.announcementViewModel))
+        return view
+    }()
+    
+    lazy var optionsView: MDOptionsView = {
+        let view = MDOptionsView.init(type: .ViewModel(ViewModel: self.optionsViewModel))
+        return view
+    }()
+    
+    lazy var scrollView: UIScrollView = {
+        let scrollView = UIScrollView()
+        scrollView.contentSize = CGSize(width: SCREEN_WIDTH * 6, height: SCREEN_HEIGHT-44)
+        scrollView.isPagingEnabled = true
+        scrollView.delegate = self
+        scrollView.showsVerticalScrollIndicator = false
+        scrollView.showsHorizontalScrollIndicator = false
+        scrollView.isScrollEnabled = false
+        scrollView.addSubview(auoteView)
+        scrollView.addSubview(financeView)
+        scrollView.addSubview(profileView)
+        scrollView.addSubview(newsView)
+        scrollView.addSubview(announcementView)
+        scrollView.addSubview(optionsView)
+        
+        
+        auoteView.snp.makeConstraints { make in
+            make.left.top.equalToSuperview()
+            make.height.equalTo(SCREEN_HEIGHT-TopHeight-44)
+            make.width.equalTo(SCREEN_WIDTH)
+        }
+        
+        financeView.snp.makeConstraints { make in
+            make.left.equalTo(auoteView.snp.right)
+            make.top.equalToSuperview()
+            make.height.equalTo(SCREEN_HEIGHT-TopHeight-44)
+            make.width.equalTo(SCREEN_WIDTH)
+        }
+        
+        profileView.snp.makeConstraints { make in
+            make.left.equalTo(financeView.snp.right)
+            make.top.equalToSuperview()
+            make.height.equalTo(SCREEN_HEIGHT-TopHeight-44)
+            make.width.equalTo(SCREEN_WIDTH)
+        }
+        
+        newsView.snp.makeConstraints { make in
+            make.left.equalTo(profileView.snp.right)
+            make.top.equalToSuperview()
+            make.height.equalTo(SCREEN_HEIGHT-TopHeight-44)
+            make.width.equalTo(SCREEN_WIDTH)
+        }
+        
+        announcementView.snp.makeConstraints { make in
+            make.left.equalTo(newsView.snp.right)
+            make.right.top.equalToSuperview()
+            make.height.equalTo(SCREEN_HEIGHT-TopHeight-44)
+            make.width.equalTo(SCREEN_WIDTH)
+        }
+        
+        optionsView.snp.makeConstraints { make in
+            make.left.equalTo(announcementView.snp.right)
+            make.right.top.equalToSuperview()
+            make.height.equalTo(SCREEN_HEIGHT-TopHeight-44)
+            make.width.equalTo(SCREEN_WIDTH)
+        }
+        
+        return scrollView
+    }()
+    
+    lazy var segmentedControl:HMSegmentedControl = {
+        let segmentedControl:HMSegmentedControl = HMSegmentedControl.init(frame: CGRect(x:10, y: TopHeight+4, width: SCREEN_WIDTH-54, height:36))
+        segmentedControl.selectedSegmentIndex = 0
+        segmentedControl.backgroundColor = .clear
+        segmentedControl.titleTextAttributes = [NSAttributedString.Key.foregroundColor : MidTextColor,NSAttributedString.Key.font:_PFSR(16)]
+        segmentedControl.selectedTitleTextAttributes = [NSAttributedString.Key.foregroundColor : MainBackGroundColor,NSAttributedString.Key.font:_PFSM(18)]
+        segmentedControl.selectionIndicatorColor = MainBackGroundColor
+        segmentedControl.selectionIndicatorHeight = 2
+        segmentedControl.segmentWidthStyle = .dynamic
+        segmentedControl.selectionStyle = .textWidthStripe
+        segmentedControl.selectionIndicatorLocation = .down
+        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))
+            
+        }
+        segmentedControl.sectionTitles = [switchLanguage("报价"),switchLanguage("财务"),switchLanguage("简况"),switchLanguage("新闻"),switchLanguage("公告"),switchLanguage("个股期股")]
+        return segmentedControl
+    }()
+    
+    lazy var menuBtn:UIButton = {
+        let btn:UIButton = UIButton.init(type: .custom)
+        btn.frame = CGRect(x: SCREEN_WIDTH-44, y: TopHeight, width: 44, height: 44)
+        btn.setImage(_image("market_menu&market_menu"), for: .normal)
+        return btn
+    }()
+    
+    
+    lazy var navView:MarketDetailNavView = {
+        let view:MarketDetailNavView = MarketDetailNavView.init(frame: CGRect(x: 0, y: 0, width: SCREEN_WIDTH, height: TopHeight))
+        
+        view.shareBlock = {
+            
+        }
+        view.collectionBlock = {[weak self] in
+            if self!.symbolModel.isCollection {
+                self?.netDeleteProductUser()
+            }else{
+                self?.netInsertProductUser()
+            }
+            
+        }
+        return view
+        
+    }()
+    
+    override func viewWillAppear(_ animated: Bool) {
+        super.viewWillAppear(animated)
+        self.myNavigationBar.isHidden = true
+        OperationalSymbolSocketManager.shared().checkSymbolLinkStatus()
+       
+    }
+    
     override func viewDidLoad() {
         super.viewDidLoad()
 
+        self.view.addSubview(navView)
+        self.view.addSubview(segmentedControl)
+        self.view.addSubview(menuBtn)
+        self.view.addSubview(scrollView)
+        
+        self.navView.updateDataWith(model: self.symbolModel)
+        
+        self.auoteViewModel.symbolModel = self.symbolModel
+        self.reloadTable(index: 0)
+        
         // Do any additional setup after loading the view.
     }
     
+    override func updateViewConstraints() {
+        super.updateViewConstraints()
+        self.scrollView.snp.makeConstraints { make in
+            make.left.bottom.right.equalToSuperview()
+            make.top.equalTo(TopHeight+44)
+        }
+    }
+    
+    
+    override func blindModel() {
+        
+        
+    }
+    
+    func reloadTable(index:Int) -> Void {
+        if index == 0 {
+            self.auoteView.VM?.netGetPriceList()
+            self.auoteView.reloadTable()
+        }
+        else if index == 1 {
+            
+        }
+        else if index == 2 {
+           
+        }
+        else if index == 3{
+            
+        }
+    }
+    
+
+   
 
-    /*
-    // MARK: - Navigation
+}
 
-    // In a storyboard-based application, you will often want to do a little preparation before navigation
-    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
-        // Get the new view controller using segue.destination.
-        // Pass the selected object to the new view controller.
+extension MarketDetailViewController{
+    func netInsertProductUser() -> Void {
+        ProgressHUD.showLoading()
+        let parame:[String:Any] = ["symbol":self.symbolModel.symbol]
+        NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForInsertProductUser ,parameters: parame, success: { (code, result) in
+            ProgressHUD.showSuccess(status: switchLanguage("收藏成功"))
+            self.symbolModel.isCollection = true
+            self.navView.updateCollection(isCollection: true)
+        }) { (code, result) in
+            ProgressHUD.showError(status: result as! String)
+        }
+    }
+    
+    func netDeleteProductUser() -> Void {
+        let parame:[String:Any] = ["symbol":self.symbolModel.symbol]
+        NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForDeleteProductUser,parameters: parame, success: { (code, result) in
+            ProgressHUD.showSuccess(status: switchLanguage("取消成功"))
+            self.symbolModel.isCollection = false
+            self.navView.updateCollection(isCollection: false)
+        }) { (code, result) in
+            ProgressHUD.showError(status: result as! String)
+          
+        }
     }
-    */
+    
+    
+    
+}
 
+extension MarketDetailViewController:UIScrollViewDelegate {
+    
+    func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
+        let pageWidth = scrollView.frame.size.width
+        let page = scrollView.contentOffset.x / pageWidth
+        self.segmentedControl.setSelectedSegmentIndex(UInt(page), animated: true)
+        self.reloadTable(index: Int(page))
+        if page == 0 {
+           
+        }else if page == 1{
+          
+        }
+        else if page == 2{
+           
+        }
+        else if page == 3 {
+           
+        }
+    }
+    
 }
+

+ 13 - 6
Koala/Koala/Modular/Market/VC/MarketViewController.swift

@@ -26,17 +26,25 @@ class MarketViewController: BaseViewController {
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
         self.myNavigationBar.isHidden = true
-        if self.marketView.segmentedControl.selectedSegmentIndex == 0 && !OperationalUserInfoData.getLogin(){
-            self.marketView.segmentedControl.selectedSegmentIndex = 1
-            self.viewModel.index = 1
+        
+        if self.marketView.navView.segmentedControl.selectedSegmentIndex == 0 && !OperationalUserInfoData.getLogin(){
+            self.marketView.navView.segmentedControl.selectedSegmentIndex = 1
+            self.marketView.headerView.segmentedControl.selectedSegmentIndex = 0
+            self.viewModel.index = 0
         }
         
         if MarketIndex >= 0 {
-            self.marketView.segmentedControl.selectedSegmentIndex = UInt(MarketIndex)
+            self.marketView.navView.segmentedControl.selectedSegmentIndex = UInt(MarketIndex)
             self.viewModel.index = MarketIndex
             MarketIndex = -1
         }
         
+        self.viewModel.netRecommendSymbolList()
+        
+        if OperationalUserInfoData.getLogin(){
+            self.viewModel.netUserList()
+        }
+        
         self.viewModel.netUserList()
         OperationalSymbolSocketManager.shared().checkSymbolLinkStatus()
         OperationalNetworkData.gettExchangeRateComplete { rateModel in
@@ -47,9 +55,8 @@ class MarketViewController: BaseViewController {
     override func viewDidLoad() {
         super.viewDidLoad()
         self.myNavigationBar.isHidden = true
-        
         self.viewModel.netGroupList()
-        self.viewModel.netSymbolList()
+        self.viewModel.netSymbolList(isUp: false)
         
     }
     

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

@@ -7,7 +7,169 @@
 //
 
 import UIKit
+import ReactiveCocoa
+import ReactiveSwift
 
 class MDAuoteViewModel: BaseViewModel {
+    var symbolModel:KSymbolModel = KSymbolModel()
+    var period:String = KLinePeriod.minuteNetStrFor(index: KLinePeriod.indexFor(kPeriod:KLinePeriod.getDefaultKLinePeriod())){//K线时间
+        didSet{
+            self.netGetPriceList()
+        }
+    }
 
+    lazy var priceList:[KSymbolKlineData] = {
+        let arr:[KSymbolKlineData] = [KSymbolKlineData]()
+        return arr
+    }()
+    
+    
+    let (signalPrice, observePrice) = Signal<Bool, Never>.pipe()
+    
+    var getPriceListAction: Action <(),(Bool),Never>!
+    
+    override func initialize() {
+        getPriceListAction = Action<(),(Bool),Never> {[weak self] _ in
+            return SignalProducer<(Bool),Never>{ observer, _ in
+                self?.requestGetPriceList(observer: observer)
+            }
+        }
+        
+    }
+    
+    override func webSocketdidReceive(nofi: NSNotification) {
+        self.webSocketdidReceiveDataTreating(nofi: nofi)
+    }
 }
+
+extension MDAuoteViewModel {
+    //获取行情数据
+    func netGetPriceList() {
+        getPriceListAction.apply().start()
+    }
+    //获取行情数据
+    func requestGetPriceList(observer: Signal< Bool, Never>.Observer) -> Void {
+        
+        let endDate:String = currentTimeStamp()
+        let p = conerData(period, .MyCLong).3!
+        let startDate:String = String(format:"%ld",conerData(currentTimeStamp(), .MyCLong).3! - 200*p*60)
+      
+        let param = [
+            "symbol":self.symbolModel.symbol,
+            "type":period,
+//            "startTime":startDate+"000",
+            "count" : "100",
+            "endTime":endDate+"000"
+        ]
+        ProgressHUD.showLoading()
+        NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForGetPriceList,parameters:param , success: { (code, result) in
+            ProgressHUD.hideHud()
+            if let list:[NSDictionary] = result as? [NSDictionary] {
+                self.priceList.removeAll()
+                KLinePeriod.setDefaultKLinePeriod(KLinePeriod.kPeriodFor(index: KLinePeriod.indexForNetPeriods(period: self.period))!)
+                for dic in list {
+                    let model = KSymbolKlineData.deserialize(from: dic)!
+                    model.datetime = decimalNumber(A: model.datetime, B: "1000", type: .Divid)
+                    self.priceList.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 MDAuoteViewModel{
+    //socket数据处理
+    @objc func webSocketdidReceiveDataTreating(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 {
+                    var isReload = false
+                    guard let symbol = currentSocket["symbol"] as? String else{
+                        return
+                    }
+                    if symbol == self.symbolModel.symbol {
+                        guard let _ = currentSocket["time"] as? Int64 else{
+                            return
+                        }
+                        var datetime = conerData("\(currentSocket["time"] ?? 0)", .MyCLong).3!
+                        
+                        datetime = datetime / 1000
+                        var period = KLinePeriod.minuteFor(kPeriod: KLinePeriod.getDefaultKLinePeriod())
+                        period = period * 60
+                    
+                        let newPrice = String(format:"%@",currentSocket["ask"] as! CVarArg)
+                        let model:KSymbolKlineData = KSymbolKlineData()
+                        
+                        isReload = true
+                        if let firstModel = self.priceList.first {
+                            
+                            let firstTime = conerData(firstModel.datetime as Any, .MyCLong).3! + period
+                            
+                            if firstTime >= datetime {
+                                firstModel.close = newPrice
+                                if conerData(firstModel.low, .MyDouble).2! >  conerData(newPrice, .MyDouble).2!{
+                                    firstModel.low = newPrice
+                                }
+                                if conerData(firstModel.high, .MyDouble).2! < conerData(newPrice, .MyDouble).2!{
+                                    firstModel.high = newPrice
+                                }
+                            }else{
+                               
+                                model.datetime = "\(datetime + period)"
+                                model.open = newPrice
+                                model.close = newPrice
+                                model.high = newPrice
+                                model.low = newPrice
+                            
+                                self.priceList.insert(model, at: 0)
+                            }
+                        }else{
+                            model.datetime = "\(datetime)"
+                            model.open = newPrice
+                            model.close = newPrice
+                            model.high = newPrice
+                            model.low = newPrice
+                           
+                            self.priceList.insert(model, at: 0)
+                        }
+                        
+                    }
+                    
+                    if isReload {
+                        if let firstModel = self.priceList.first {
+                            if conerData(firstModel.low, .MyDouble).2! <  conerData(self.symbolModel.low, .MyDouble).2!{
+                                self.symbolModel.low = firstModel.low
+                            }
+                            if conerData(firstModel.high, .MyDouble).2! > conerData(self.symbolModel.high, .MyDouble).2!{
+                                self.symbolModel.high = firstModel.high
+                            }
+                            self.symbolModel.newPrice = firstModel.close
+                            
+                            let np = conerData(self.symbolModel.newPrice, .MyDouble).2! + conerData( self.symbolModel.open, .MyDouble).2!
+                            self.symbolModel.increase = "\(np/conerData(self.symbolModel.open, .MyDouble).2! * 100)"
+                        }
+                        self.observePrice.send(value: true)
+                    }
+                    
+                }
+            }
+            
+        }
+    }
+    
+}
+

+ 539 - 163
Koala/Koala/Modular/Market/VM/MarketViewModel.swift

@@ -10,6 +10,11 @@ import UIKit
 import ReactiveCocoa
 import ReactiveSwift
 class MarketViewModel: BaseViewModel {
+    lazy var netParamList:[String] = {
+        let arr:[String] = ["09988.SZ","00700.SZ","00388.SZ","002230.SZ","AAPL.US","TSLA.US","NVDA.US","600519.SH","300750.SZ","002594.SZ","300059.SZ"];
+        return arr
+    }()
+    
     lazy var productGroupList:[MarketProductGroupModel] = {//交易对
         let arr:[MarketProductGroupModel] = [MarketProductGroupModel]()
         return arr
@@ -20,17 +25,36 @@ class MarketViewModel: BaseViewModel {
         return arr
     }()
     
+    lazy var collectionSymbolList:[KSymbolModel] = {//收藏
+        let arr:[KSymbolModel] = [KSymbolModel]()
+        return arr
+    }()
     
     lazy var symbolList:[KSymbolModel] = {//交易对
         let arr:[KSymbolModel] = [KSymbolModel]()
         return arr
     }()
     
+    lazy var recommendList:[KSymbolModel] = {//交易对
+        let arr:[KSymbolModel] = [KSymbolModel]()
+        return arr
+    }()
+    
     lazy var screenSymbolList:[KSymbolModel] = {//交易对
         let arr:[KSymbolModel] = [KSymbolModel]()
         return arr
     }()
     
+    lazy var optionList:[OptionsListModel] = {//期权
+        let arr:[OptionsListModel] = [OptionsListModel]()
+        return arr
+    }()
+    
+    lazy var screenOptionList:[OptionsListModel] = {//期权
+        let arr:[OptionsListModel] = [OptionsListModel]()
+        return arr
+    }()
+    
     var screenText:String = ""{
         didSet{
             self.screenSymbolListAction()
@@ -40,18 +64,49 @@ class MarketViewModel: BaseViewModel {
     var marketText : String = ""{
         
         didSet {
+            self.netSymbolList(isUp: false)
+        }
+        
+    }
+    
+    var optionMarket : String = ""{
+        
+        didSet {
+            self.netOptionProductListGroup(isUp: false)
+        }
+        
+    }
+    
+    var topIndex = 1{
+        didSet{
             
-//            netSymbolList
+        }
+    }
+    
+    var index:Int = 0{
+        didSet{
+            if index == -2 {
+                self.netUserList()
+            }
+            else if index >= 0{
+                self.marketText = getCode()
+            }else{
+                self.screenSymbolListAction()
+            }
             
-            self.netSymbolList()
-//            self.screenSymbolListAction()
         }
-        
     }
     
-    var index:Int = 1{
+    var optionsIndex = 0{
         didSet{
-            self.screenSymbolListAction()
+            let model = self.getOptionsMarketList()[optionsIndex]
+            self.optionMarket = model.market
+        }
+    }
+    
+    var optionsTimerIndex = 0{
+        didSet{
+            self.screenOptionListAction()
         }
     }
     
@@ -67,18 +122,53 @@ class MarketViewModel: BaseViewModel {
         }
     }
     
+
+    var optionsIncreaseSort:Int = 0{//0 后台 , 1 increase 升序,2 increase 降序
+        didSet{
+            self.screenOptionListAction()
+        }
+    }
+    
+    var optionsMeanSort:Int = 0{//0 后台 , 1 Mean 升序,2 Mean 降序
+        didSet{
+            self.screenOptionListAction()
+        }
+    }
+    
+    var optionsVirtualSort:Int = 0{//0 后台 , 1 Virtual 升序,2 Virtual 降序
+        didSet{
+            self.screenOptionListAction()
+        }
+    }
+    
+    var pageNum:Int = 1
+    
+    var optionPageNum:Int = 1
+    
+    
+    
     let (signalScreen, observeScreen) = Signal<Bool, Never>.pipe()
     let (signalSymbol, observeSymbol) = Signal<Bool, Never>.pipe()
     //netForInsertProductUser
-    //netForDeleteProductUser
+    //netForGetOptionProductListGroup
+    
+    var recommendSymbolListAction: Action <(),(Bool),Never>!
     var groupListAction: Action <(),(Bool),Never>!
     var userListAction: Action <(),(Bool),Never>!
-    var symbolListAction: Action <(),(Bool),Never>!
+    var symbolListAction: Action <(Bool),(Bool),Never>!
     var updateScribeAction: Action <(),(Bool),Never>!
     var insertProductUserAction: Action <(String),(Bool),Never>!
     var deleteProductUserAction: Action <(String),(Bool),Never>!
     
+    var optionProductListGroupAction: Action <(Bool),(Bool),Never>!
+    
     override func initialize() {
+        recommendSymbolListAction = Action<(),(Bool),Never> {[weak self] _ in
+            return SignalProducer<(Bool),Never>{ observer, _ in
+                self?.requestRecommendSymbolList(observer: observer)
+            }
+        }
+        
         groupListAction = Action<(),(Bool),Never> {[weak self] _ in
             return SignalProducer<(Bool),Never>{ observer, _ in
                 self?.requestGroupList(observer: observer)
@@ -91,9 +181,9 @@ class MarketViewModel: BaseViewModel {
             }
         }
         
-        symbolListAction = Action<(),(Bool),Never> {[weak self] _ in
+        symbolListAction = Action<(Bool),(Bool),Never> {[weak self] isUp in
             return SignalProducer<(Bool),Never>{ observer, _ in
-                self?.requestSymbolList(observer: observer)
+                self?.requestSymbolList(observer: observer,isUp:isUp)
             }
         }
         
@@ -114,6 +204,12 @@ class MarketViewModel: BaseViewModel {
                 self?.requestDeleteProductUser(observer: observer,symbol:symbol)
             }
         }
+        
+        optionProductListGroupAction = Action<(Bool),(Bool),Never> {[weak self] isUp in
+            return SignalProducer<(Bool),Never>{ observer, _ in
+                self?.requestOptionProductListGroup(observer: observer,isUp:isUp)
+            }
+        }
     }
     
     override func webSocketdidReceive(nofi: NSNotification) {
@@ -123,6 +219,47 @@ class MarketViewModel: BaseViewModel {
 
 extension MarketViewModel {
     
+    //获取推荐交易对
+    func netRecommendSymbolList() {
+        recommendSymbolListAction.apply().start()
+    }
+    //
+    func requestRecommendSymbolList(observer: Signal< Bool, Never>.Observer) -> Void {
+       
+        let parame:[String:Any] = [
+            "symbol":getJSONStringFromArray(array: self.netParamList as NSArray)
+        ]
+        NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForHomeSymbolList,parameters: parame, success: { (code, result) in
+            if let list:[NSDictionary] = result?["list"] as? [NSDictionary] {
+                self.recommendList.removeAll()
+                for dic in list {
+                    let model = KSymbolModel.deserialize(from: dic)
+                    model?.isSelect = true
+                    if model!.visible == 1{
+                        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.recommendList.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()
+        }
+    }
+    
     //获取产品分组列表
     func netGroupList() {
         groupListAction.apply().start()
@@ -155,26 +292,65 @@ extension MarketViewModel {
     func netUserList() {
         if OperationalUserInfoData.getLogin(){
             userListAction.apply().start()
-        }else{
-            self.collectionList.removeAll()
-            for model in self.symbolList {
-                model.isCollection = false
-            }
-            self.screenSymbolListAction()
         }
     }
 
     func requestUserList(observer: Signal< Bool, Never>.Observer) -> Void {
-       
+        ProgressHUD.showLoading()
         NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForProductUserList, success: { (code, result) in
-            
+            ProgressHUD.hideHud()
             if let list:[NSDictionary] = result?["list"] as? [NSDictionary] {
                 self.collectionList.removeAll()
                 for dic in list {
                     self.collectionList.append((dic["symbol"] as? String) ?? "")
                 }
-                self.updateSymbolListCollection()
-                self.screenSymbolListAction()
+                if list.count > 0 {
+                    self.requestCollectionSymbolList(observer: observer)
+                }else{
+                    observer.send(value: true)
+                    observer.sendCompleted()
+                }
+               
+            }else{
+                observer.send(value: false)
+                observer.sendCompleted()
+                ProgressHUD.showError(status:DataTypeErrorPrompt)
+            }
+           
+        }) { (code, result) in
+            ProgressHUD.showError(status: result as! String)
+            observer.send(value: false)
+            observer.sendCompleted()
+        }
+    }
+    
+    func requestCollectionSymbolList(observer: Signal< Bool, Never>.Observer) -> Void {
+        var list:[String] = [String]()
+        for symbol in self.collectionList{
+            list.append(symbol)
+        }
+        let parame:[String:Any] = [
+            "symbol":getJSONStringFromArray(array: list as NSArray)
+        ]
+        NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForHomeSymbolList,parameters: parame, success: {[weak self] (code, result) in
+            if let list:[NSDictionary] = result?["list"] as? [NSDictionary] {
+                self?.collectionSymbolList.removeAll()
+                for dic in list {
+                    let model = KSymbolModel.deserialize(from: dic)
+                    model?.isSelect = true
+                    if model!.visible == 1{
+                        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?.collectionSymbolList.append(model!)
+                    }
+                }
+                self?.screenSymbolListAction()
                 observer.send(value: true)
             }else{
                 observer.send(value: false)
@@ -188,71 +364,63 @@ extension MarketViewModel {
         }
     }
     
+    
     //获取交易对
-    func netSymbolList() {
-        symbolListAction.apply().start()
+    func netSymbolList(isUp:Bool) {
+        symbolListAction.apply(isUp).start()
     }
     //
-    func requestSymbolList(observer: Signal< Bool, Never>.Observer) -> Void {
-        //读取缓存
-        //        if getSymbolList().count > 0 {
-//            self.symbolList = getSymbolList()
-//            self.screenSymbolListAction()
-//            self.updateSymbolListCollection()
-//            observer.send(value: true)
-//            observer.sendCompleted()
-//            return
-//        }
-        ProgressHUD.showMessage(status:"")
-        
+    func requestSymbolList(observer: Signal< Bool, Never>.Observer,isUp:Bool) -> Void {
+        if !isUp{
+            self.pageNum = 1
+        }
         let param : [String : Any] = [
             
-            "pageNum" : "1",
+            "pageNum" : self.pageNum,
             "pageSize" : "30",
             "market" : self.marketText
         ]
-        
-        NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForHomeSymbolList, parameters: param, success: { (code, result) in
+        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] {
-                self.symbolList.removeAll()
-                SaveData.shared().updateSymbolList(list: list as NSArray)
-                self.symbolList = getSymbolList()
-                self.screenSymbolListAction()
-                self.updateSymbolListCollection()
-                self.netUpdateSubscribes()
-                observer.send(value: true)
-                }else{
-                    observer.send(value: false)
-                    ProgressHUD.showError(status:DataTypeErrorPrompt)
+                if !isUp {
+                    self?.symbolList.removeAll()
                 }
-                    observer.sendCompleted()
-            }) { (code, result) in
-                ProgressHUD.showError(status: result as! String)
+                self?.pageNum += 1
+                for dic in list {
+                    let model = KSymbolModel.deserialize(from: dic)!
+                    if model.visible == 1{
+                        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?.symbolList.append(model)
+                    }
+                }
+                self?.screenSymbolListAction()
+                self?.updateSymbolListCollection()
+                self?.netUpdateSubscribes()
+                
+                let isNoData:Bool = (list.count < 30) ? true : false
+                observer.send(value:isNoData)
+                
+            }else{
                 observer.send(value: false)
-                observer.sendCompleted()
+                ProgressHUD.showError(status:DataTypeErrorPrompt)
             }
+            observer.sendCompleted()
+        }) { (code, result) in
+            ProgressHUD.showError(status: result as! String)
+            observer.send(value: false)
+            observer.sendCompleted()
+        }
         
-//        NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForHomeSymbolList, success: { (code, result) in
-//            ProgressHUD.hideHud()
-//            if let list:[NSDictionary] = result?["list"] as? [NSDictionary] {
-//                self.symbolList.removeAll()
-//                SaveData.shared().updateSymbolList(list: list as NSArray)
-//                self.symbolList = getSymbolList()
-//                self.screenSymbolListAction()
-//                self.updateSymbolListCollection()
-//                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()
-//        }
     }
     
     //添加收藏
@@ -266,7 +434,7 @@ extension MarketViewModel {
     }
     
     func requestInsertProductUser(observer: Signal< Bool, Never>.Observer,symbol:String) -> Void {
-       
+        ProgressHUD.showLoading()
         let parame:[String:Any] = ["symbol":symbol]
         NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForInsertProductUser ,parameters: parame, success: { (code, result) in
             ProgressHUD.showSuccess(status: switchLanguage("收藏成功"))
@@ -326,11 +494,17 @@ extension MarketViewModel {
     func requestUpdateSubscribeAction(observer: Signal< Bool, Never>.Observer) -> Void  {
         
         var symbols : [String] = []
-        
-        for model in self.screenSymbolList{
-            symbols.append(model.symbol)
+        if self.topIndex == 2 {
+            for model in self.screenOptionList{
+                symbols.append(model.code)
+            }
+        }else{
+            for model in self.screenSymbolList{
+                symbols.append(model.symbol)
+            }
         }
         
+        
         let param = [
          
             "symbols": symbols
@@ -338,14 +512,12 @@ extension MarketViewModel {
         
         print("symbols : \(param)")
         NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netUpdateSubscribe, parameters: param) { (code, result) in
-            print(code,result ?? "")
-            
+           
             observer.send(value: true)
             observer.sendCompleted()
             
         } failured: {  (code, result) in
-            print(code,result ?? "")
-            
+          
             ProgressHUD.showError(status: result as! String)
             observer.send(value: false)
             observer.sendCompleted()
@@ -354,6 +526,105 @@ extension MarketViewModel {
         
     }
     
+    //获取期权列表
+    func netOptionProductListGroup(isUp:Bool) {
+        optionProductListGroupAction.apply(isUp).start()
+    }
+    //
+    func requestOptionProductListGroup(observer: Signal< Bool, Never>.Observer,isUp:Bool) -> Void {
+        if !isUp{
+            self.optionPageNum = 1
+        }
+        let param : [String : Any] = [
+            "pageNum" : self.optionPageNum,
+            "pageSize" : "30",
+            "market" : self.optionMarket
+        ]
+        ProgressHUD.showLoading()
+        NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForGetOptionProductListGroup, parameters: param, success: {[weak self](code, result) in
+            
+            ProgressHUD.hideHud()
+            if let list:[NSDictionary] = result?["list"] as? [NSDictionary] {
+                if !isUp {
+                    self?.optionList.removeAll()
+                }
+                self?.optionPageNum += 1
+                for dic in list {
+                    let model = OptionsListModel.deserialize(from: dic)!
+                    self?.optionList.append(model)
+                }
+                
+               
+                if self!.optionList.count > 0 {
+                    let isNoData:Bool = (list.count < 30) ? true : false
+                    self?.requestOptionProductListGroupSymbol(observer: observer,isNoData: isNoData)
+                }else{
+                    observer.send(value:true)
+                    observer.sendCompleted()
+                }
+                
+            }else{
+                observer.send(value: false)
+                observer.sendCompleted()
+                ProgressHUD.showError(status:DataTypeErrorPrompt)
+            }
+           
+        }) { (code, result) in
+            ProgressHUD.showError(status: result as! String)
+            observer.send(value: false)
+            observer.sendCompleted()
+        }
+        
+    }
+    
+   
+    func requestOptionProductListGroupSymbol(observer: Signal< Bool, Never>.Observer,isNoData:Bool) -> Void {
+        var list:[String] = [String]()
+        for model in self.optionList{
+            list.append(model.code)
+        }
+        let param:[String:Any] = [
+            "symbol":getJSONStringFromArray(array: list as NSArray)
+        ]
+        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)
+                    
+                    for oModel in self!.optionList{
+                        if oModel.code == model!.symbol{
+                            oModel.symbolData = model!
+                            break
+                        }
+                    }
+                }
+                
+                self?.screenOptionListAction()
+                self?.netUpdateSubscribes()
+                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()
+        }
+    }
+    
+    
 }
 
 extension MarketViewModel {
@@ -370,87 +641,33 @@ extension MarketViewModel {
     }
     
     func resetProductGroup() -> Void {
-        let collectModel = MarketProductGroupModel()
-        collectModel.id = "-2"
-        collectModel.title = switchLanguage("自选")
-        collectModel.code = "ZX"
-        self.productGroupList.insert(collectModel, at: 0)
-        
-//        let hotModel = MarketProductGroupModel()
-//        hotModel.id = "-1"
-//        hotModel.title = switchLanguage("热门")
-//        self.productGroupList.insert(hotModel, at: 1)
-//
+     
         let allModel = MarketProductGroupModel()
         allModel.id = "0"
         allModel.title = switchLanguage("全部")
-        allModel.code = "ALL"
-//        self.productGroupList.append(allModel)
-        self.productGroupList.insert(allModel, at: 1)
+        allModel.code = ""
+        self.productGroupList.insert(allModel, at: 0)
         self.screenSymbolListAction()
     }
     
     func screenSymbolListAction() -> Void {
         self.screenSymbolList.removeAll()
-        var groupList:[KSymbolModel] = [KSymbolModel]()
-        let group = self.getGroup()
-        let code = self.getCode()
-        if group == "-2" {
-            for model in self.symbolList {
-                for symbol in self.collectionList{
-                    if model.symbol == symbol{
-                        groupList.append(model)
-                        break
-                    }
-                }
-            }
-           
-        }
-        else if group == "-1"{
-            for model in self.symbolList {
-                if model.hot == 1 {
-                    groupList.append(model)
-                }
-            }
-        }
-        else if group == "0"{
-            groupList = self.symbolList
-        }else{
-            for model in self.symbolList {
-//                if group == model.groupid{
-//                    groupList.append(model)
-//                }
-
-                if code == model.market {
-                    groupList.append(model)
-                }
-//
-            }
-            
-            self.marketText = code
-            
-            
+        
+        if (index == -2){
+            self.screenSymbolList = self.collectionSymbolList
         }
-       
-        var textList:[KSymbolModel] = [KSymbolModel]()
-        if screenText.length == 0 {
-            textList = groupList
-        }else{
-            for model in groupList{
-                if model.title.uppercased().contains(screenText.uppercased()){
-                    textList.append(model)
-                }
-            }
+        else if (index >= 0){
+            self.screenSymbolList = self.symbolList
         }
         
         if symbolSort > 0 {
             if symbolSort == 1 {
-                textList.sort(by: {
+                self.screenSymbolList.sort(by: {
                     return $0.symbol > $1.symbol
                 })
             }
             else if symbolSort == 2{
-                textList.sort(by: {
+                self.screenSymbolList.sort(by: {
                     return $0.symbol < $1.symbol
                 })
             }
@@ -460,25 +677,48 @@ extension MarketViewModel {
         
         if increaseSort > 0 {
             if increaseSort == 1{
-               textList.sort { (model1, model2) -> Bool in
+                self.screenSymbolList.sort { (model1, model2) -> Bool in
                    return conerData(model1.increase as Any, .MyDouble).2! > conerData(model2.increase as Any, .MyDouble).2!
                }
            }
            else if increaseSort == 2 {
-               textList.sort { (model1, model2) -> Bool in
+               self.screenSymbolList.sort { (model1, model2) -> Bool in
                    return conerData(model1.increase as Any, .MyDouble).2! < conerData(model2.increase as Any, .MyDouble).2!
                }
            }
         }
         
+       
+        self.observeScreen.send(value: true)
+    }
+    
+    
+    func screenOptionListAction() -> Void {
+        self.screenOptionList.removeAll()
+            
+        for model in self.optionList{
+            self.screenOptionList.append(model)
+        }
         
-        self.screenSymbolList = textList
-        
-      
+        if optionsIncreaseSort > 0 {
+            if optionsIncreaseSort == 1{
+                self.screenOptionList.sort { (model1, model2) -> Bool in
+                   return conerData(model1.symbolData.increase as Any, .MyDouble).2! > conerData(model2.symbolData.increase as Any, .MyDouble).2!
+               }
+           }
+           else if optionsIncreaseSort == 2 {
+               self.screenOptionList.sort { (model1, model2) -> Bool in
+                   return conerData(model1.symbolData.increase as Any, .MyDouble).2! < conerData(model2.symbolData.increase as Any, .MyDouble).2!
+               }
+           }
+        }
         
+       
         self.observeScreen.send(value: true)
     }
     
+    
+    
     func getGroup() -> String {
         guard self.productGroupList.count > self.index else {
             return "0"
@@ -492,14 +732,94 @@ extension MarketViewModel {
         
         guard self.productGroupList.count > self.index else {
             
-            return "ZX"
+            return ""
             
         }
         
         let model  = self.productGroupList[self.index]
         return model.code
         
+    }
+
+    func getOptionsMarketTitleList() -> [String] {
+        var list:[String] = [String]()
+        for model in self.getOptionsMarketList(){
+            list.append(model.title)
+        }
+        return list
+    }
+    
+    func getOptionsMarketList() -> [OptionsMarketModel] {
+        let list = [
+            [
+                "market":"CN",
+                "title":switchLanguage("沪深"),
+            ],
+            [
+                "market":"US",
+                "title":switchLanguage("美股"),
+            ],
+            [
+                "market":"HK",
+                "title":switchLanguage("港股"),
+            ],
+        ]
         
+        var arr:[OptionsMarketModel] = [OptionsMarketModel]()
+        for dict in list {
+            let model = OptionsMarketModel.deserialize(from: dict)!
+            arr.append(model)
+        }
+        
+        return arr
+    }
+    
+    func getOptionsTimer() -> String {
+        let model = getOptionsTimerList()[self.optionsTimerIndex]
+        return model.timer
+    }
+    
+    func getOptionsTimerList() -> [OptionsTimerModel] {
+        let list = [
+            [
+                "timer":"price_1m_list",
+                "title":"1M",
+                "isSelect":true
+            ],
+            [
+                "timer":"price_2m_list",
+                "title":"2M",
+                "isSelect":false
+            ],
+            [
+                "timer":"price_3m_list",
+                "title":"3M",
+                "isSelect":false
+            ],
+            [
+                "timer":"price_4m_list",
+                "title":"4M",
+                "isSelect":false
+            ],
+            [
+                "timer":"price_5m_list",
+                "title":"5M",
+                "isSelect":false
+            ],
+            [
+                "timer":"price_6m_list",
+                "title":"6M",
+                "isSelect":false
+            ],
+        ]
+        
+        var arr:[OptionsTimerModel] = [OptionsTimerModel]()
+        for dict in list {
+            let model = OptionsTimerModel.deserialize(from: dict)!
+            arr.append(model)
+        }
+        
+        return arr
     }
     
     
@@ -515,26 +835,82 @@ extension MarketViewModel{
             if type == 0 {
                 if let currentSocket = dict.object(forKey: "currentSocket") as? NSDictionary {
                     var isReload = false
-                    for model in symbolList{
-                        guard let symbol = currentSocket["symbol"] as? String else{
-                            return
+                    
+                    guard let symbol = currentSocket["symbol"] as? String else{
+                        return
+                    }
+                    if self.topIndex == 0 {
+                        for model in collectionSymbolList{
+                           
+                            if model.symbol == symbol {
+                                model.newPrice = String(format:"%@",currentSocket["ask"] as! CVarArg)
+                                let np = conerData(model.newPrice, .MyDouble).1! - conerData(model.open, .MyDouble).1!
+                                let increase = (conerData("\(np)", .MyDouble).2!/conerData(model.open, .MyDouble).2!)*100
+                                model.increase = String(format: "%.2f",increase)
+                                for m in self.screenSymbolList{
+                                    if m.symbol == symbol{
+                                        m.newPrice = model.newPrice
+                                        m.increase = model.increase
+                                        isReload = true
+                                        break
+                                    }
+                                }
+                                break
+                            }
                         }
-                        if model.symbol == symbol {
-                            model.newPrice = String(format:"%@",currentSocket["ask"] as! CVarArg)
-                            let np = decimalNumber(A: model.newPrice, B: model.open, type: .Subtract, scale:model.digits)
-                            model.increase = decimalNumber(A: np, B: model.open, type: .Divid)
-                            model.increase = decimalNumber(A: model.increase, B: "100", type: .Multiply)
-                            for m in self.screenSymbolList{
-                                if m.symbol == symbol{
-                                    m.newPrice = model.newPrice
-                                    m.increase = model.increase
-                                    isReload = true
-                                    break
+                        
+                        for model in recommendList{
+                           
+                            if model.symbol == symbol {
+                                model.newPrice = String(format:"%@",currentSocket["ask"] as! CVarArg)
+                                let np = conerData(model.newPrice, .MyDouble).1! - conerData(model.open, .MyDouble).1!
+                                let increase = (conerData("\(np)", .MyDouble).2!/conerData(model.open, .MyDouble).2!)*100
+                                model.increase = String(format: "%.2f",increase)
+                                break
+                            }
+                        }
+                    }
+                    else if self.topIndex == 1{
+                        for model in symbolList{
+                            if model.symbol == symbol {
+                                model.newPrice = String(format:"%@",currentSocket["ask"] as! CVarArg)
+                                let np = conerData(model.newPrice, .MyDouble).1! - conerData(model.open, .MyDouble).1!
+                                let increase = (conerData("\(np)", .MyDouble).2!/conerData(model.open, .MyDouble).2!)*100
+                                model.increase = String(format: "%.2f",increase)
+                                for m in self.screenSymbolList{
+                                    if m.symbol == symbol{
+                                        m.newPrice = model.newPrice
+                                        m.increase = model.increase
+                                        isReload = true
+                                        break
+                                    }
                                 }
+                                break
+                            }
+                        }
+                    }
+                   
+                    else{
+                        for model in optionList{
+                            if model.symbolData.symbol == symbol {
+                                model.symbolData.newPrice = String(format:"%@",currentSocket["ask"] as! CVarArg)
+                                let np = conerData(model.symbolData.newPrice, .MyDouble).1! - conerData(model.symbolData.open, .MyDouble).1!
+                                let increase = (conerData("\(np)", .MyDouble).2!/conerData(model.symbolData.open, .MyDouble).2!)*100
+                                model.symbolData.increase = String(format: "%.2f",increase)
+                                for m in self.screenOptionList{
+                                    if m.symbolData.symbol == symbol{
+                                        m.symbolData.newPrice = model.symbolData.newPrice
+                                        m.symbolData.increase = model.symbolData.increase
+                                        isReload = true
+                                        break
+                                    }
+                                }
+                                break
                             }
-                            break
                         }
+                        
                     }
+                   
                     if isReload {
                         self.observeSymbol.send(value: true)
                     }

+ 1 - 1
Koala/Koala/Modular/MarketDetail/C/MarketMainDetailViewController.swift

@@ -44,7 +44,7 @@ class MarketMainDetailViewController: BaseViewController {
             make.top.left.right.equalTo(self.view)
             make.height.equalTo(NavigationViewHeight+StatusBarHeight)
         }
-        navView.titleLb.text = viewModel.symbolModel.title
+        //navView.titleLb.text = viewModel.symbolModel.title
         
         
         listContainerView.frame = CGRect(x: 0, y: NavigationViewHeight + StatusBarHeight + 50, width: view.bounds.size.width, height: view.bounds.size.height - 50 - NavigationViewHeight - StatusBarHeight )

+ 1 - 0
Koala/Koala/Modular/Public/Model/PublicModel.swift

@@ -86,6 +86,7 @@ class KSymbolModel: BaseModel {
     var newPrice:String = "0"
     var timeList:[KSymbolTimeModel] = [KSymbolTimeModel]()
     var isCollection:Bool = false
+    var isSelect:Bool = false
     
     var data:[KSymbolKlineData] = [KSymbolKlineData]()