刘千军 vor 11 Monaten
Ursprung
Commit
39a50075d8
33 geänderte Dateien mit 1492 neuen und 30 gelöschten Zeilen
  1. 52 0
      Koala/Koala.xcodeproj/project.pbxproj
  2. 2 0
      Koala/Koala/FX/NetClass/URLS.swift
  3. 1 0
      Koala/Koala/Modular/Home/V/HomeView.swift
  4. 5 23
      Koala/Koala/Modular/Home/VC/HomeViewController.swift
  5. 7 0
      Koala/Koala/Modular/Market/M/MarketModel.swift
  6. 3 3
      Koala/Koala/Modular/Market/V/MarketDetailView/MarketDetailNavView.swift
  7. 57 0
      Koala/Koala/Modular/Market/V/MarketSearch/MSHListCell.swift
  8. 69 0
      Koala/Koala/Modular/Market/V/MarketSearch/MSHListCell.xib
  9. 99 0
      Koala/Koala/Modular/Market/V/MarketSearch/MSHotCell.swift
  10. 62 0
      Koala/Koala/Modular/Market/V/MarketSearch/MSHotCell.xib
  11. 110 0
      Koala/Koala/Modular/Market/V/MarketSearch/MSHotListCell.swift
  12. 101 0
      Koala/Koala/Modular/Market/V/MarketSearch/MSHotListCell.xib
  13. 71 0
      Koala/Koala/Modular/Market/V/MarketSearch/MSearchListCell.swift
  14. 65 0
      Koala/Koala/Modular/Market/V/MarketSearch/MSearchListCell.xib
  15. 258 0
      Koala/Koala/Modular/Market/V/MarketSearch/MarketSearchView.swift
  16. 16 1
      Koala/Koala/Modular/Market/V/MarketView/MarketNavView.swift
  17. 10 0
      Koala/Koala/Modular/Market/V/MarketView/MarketView.swift
  18. 62 0
      Koala/Koala/Modular/Market/VC/MarketSearchViewController.swift
  19. 376 0
      Koala/Koala/Modular/Market/VM/MarketSearchViewModel.swift
  20. 2 2
      Koala/Koala/Modular/Public/V/Base/BaseSearchView.swift
  21. BIN
      Koala/Koala/Other/Assets.xcassets/Market/Market_W_CN.imageset/CN.png
  22. 21 0
      Koala/Koala/Other/Assets.xcassets/Market/Market_W_CN.imageset/Contents.json
  23. 21 0
      Koala/Koala/Other/Assets.xcassets/Market/Market_W_HK.imageset/Contents.json
  24. BIN
      Koala/Koala/Other/Assets.xcassets/Market/Market_W_HK.imageset/HK.png
  25. 21 0
      Koala/Koala/Other/Assets.xcassets/Market/Market_W_US.imageset/Contents.json
  26. BIN
      Koala/Koala/Other/Assets.xcassets/Market/Market_W_US.imageset/US.png
  27. 1 0
      Koala/Koala/Other/Assets.xcassets/Market/Market_collection.imageset/Contents.json
  28. 0 0
      Koala/Koala/Other/Assets.xcassets/Market/Market_collection.imageset/路径备份 4.png
  29. BIN
      Koala/Koala/Other/Assets.xcassets/Market/Market_collection.imageset/路径备份 4@2x.png
  30. BIN
      Koala/Koala/Other/Assets.xcassets/Market/Market_collection.imageset/路径备份 4@3x.png
  31. 0 1
      Koala/Koala/Other/Assets.xcassets/Market/Market_unCollection.imageset/Contents.json
  32. BIN
      Koala/Koala/Other/Assets.xcassets/Market/Market_unCollection.imageset/路径备份 4@2x.png
  33. BIN
      Koala/Koala/Other/Assets.xcassets/Market/Market_unCollection.imageset/路径备份 4@3x.png

+ 52 - 0
Koala/Koala.xcodeproj/project.pbxproj

@@ -634,6 +634,17 @@
 		6CBB631D2ADC112F0045A4C9 /* HomeOptionsCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6CBB631B2ADC112F0045A4C9 /* HomeOptionsCell.xib */; };
 		6CBB63202ADC37280045A4C9 /* MDNewsListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB631E2ADC37280045A4C9 /* MDNewsListCell.swift */; };
 		6CBB63212ADC37280045A4C9 /* MDNewsListCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6CBB631F2ADC37280045A4C9 /* MDNewsListCell.xib */; };
+		6CBB63242ADD5F380045A4C9 /* MarketSearchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB63232ADD5F370045A4C9 /* MarketSearchViewController.swift */; };
+		6CBB63282ADD5F530045A4C9 /* MarketSearchViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB63272ADD5F530045A4C9 /* MarketSearchViewModel.swift */; };
+		6CBB632B2ADD5F700045A4C9 /* MarketSearchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB632A2ADD5F700045A4C9 /* MarketSearchView.swift */; };
+		6CBB63322ADD75750045A4C9 /* MSHotCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB63302ADD75750045A4C9 /* MSHotCell.swift */; };
+		6CBB63332ADD75750045A4C9 /* MSHotCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6CBB63312ADD75750045A4C9 /* MSHotCell.xib */; };
+		6CBB63362ADD77AE0045A4C9 /* MSHotListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB63342ADD77AE0045A4C9 /* MSHotListCell.swift */; };
+		6CBB63372ADD77AE0045A4C9 /* MSHotListCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6CBB63352ADD77AE0045A4C9 /* MSHotListCell.xib */; };
+		6CBB633A2ADD7BD70045A4C9 /* MSHListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB63382ADD7BD70045A4C9 /* MSHListCell.swift */; };
+		6CBB633B2ADD7BD70045A4C9 /* MSHListCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6CBB63392ADD7BD70045A4C9 /* MSHListCell.xib */; };
+		6CBB633E2ADD9A1D0045A4C9 /* MSearchListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBB633C2ADD9A1D0045A4C9 /* MSearchListCell.swift */; };
+		6CBB633F2ADD9A1D0045A4C9 /* MSearchListCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6CBB633D2ADD9A1D0045A4C9 /* MSearchListCell.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 */; };
@@ -1443,6 +1454,17 @@
 		6CBB631B2ADC112F0045A4C9 /* HomeOptionsCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = HomeOptionsCell.xib; sourceTree = "<group>"; };
 		6CBB631E2ADC37280045A4C9 /* MDNewsListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDNewsListCell.swift; sourceTree = "<group>"; };
 		6CBB631F2ADC37280045A4C9 /* MDNewsListCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MDNewsListCell.xib; sourceTree = "<group>"; };
+		6CBB63232ADD5F370045A4C9 /* MarketSearchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketSearchViewController.swift; sourceTree = "<group>"; };
+		6CBB63272ADD5F530045A4C9 /* MarketSearchViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketSearchViewModel.swift; sourceTree = "<group>"; };
+		6CBB632A2ADD5F700045A4C9 /* MarketSearchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketSearchView.swift; sourceTree = "<group>"; };
+		6CBB63302ADD75750045A4C9 /* MSHotCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MSHotCell.swift; sourceTree = "<group>"; };
+		6CBB63312ADD75750045A4C9 /* MSHotCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MSHotCell.xib; sourceTree = "<group>"; };
+		6CBB63342ADD77AE0045A4C9 /* MSHotListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MSHotListCell.swift; sourceTree = "<group>"; };
+		6CBB63352ADD77AE0045A4C9 /* MSHotListCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MSHotListCell.xib; sourceTree = "<group>"; };
+		6CBB63382ADD7BD70045A4C9 /* MSHListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MSHListCell.swift; sourceTree = "<group>"; };
+		6CBB63392ADD7BD70045A4C9 /* MSHListCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MSHListCell.xib; sourceTree = "<group>"; };
+		6CBB633C2ADD9A1D0045A4C9 /* MSearchListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MSearchListCell.swift; sourceTree = "<group>"; };
+		6CBB633D2ADD9A1D0045A4C9 /* MSearchListCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MSearchListCell.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>"; };
@@ -2946,6 +2968,7 @@
 				6CBB62E62AD829440045A4C9 /* MDNewsViewModel.swift */,
 				6CBB62E82AD829500045A4C9 /* MDAnnouncementViewModel.swift */,
 				6CBB62EA2AD8295C0045A4C9 /* MDOptionsViewModel.swift */,
+				6CBB63272ADD5F530045A4C9 /* MarketSearchViewModel.swift */,
 			);
 			path = VM;
 			sourceTree = "<group>";
@@ -2953,6 +2976,7 @@
 		6C584E24295C607400CE1D2C /* V */ = {
 			isa = PBXGroup;
 			children = (
+				6CBB63292ADD5F5F0045A4C9 /* MarketSearch */,
 				6CBB62CF2AD81EE70045A4C9 /* MarketView */,
 				6CBB62CE2AD81ED10045A4C9 /* MarketDetailView */,
 			);
@@ -2964,6 +2988,7 @@
 			children = (
 				6C584E26295C60C000CE1D2C /* MarketViewController.swift */,
 				6CBB62CC2AD81EC80045A4C9 /* MarketDetailViewController.swift */,
+				6CBB63232ADD5F370045A4C9 /* MarketSearchViewController.swift */,
 			);
 			path = VC;
 			sourceTree = "<group>";
@@ -3411,6 +3436,22 @@
 			path = MDOptionsView;
 			sourceTree = "<group>";
 		};
+		6CBB63292ADD5F5F0045A4C9 /* MarketSearch */ = {
+			isa = PBXGroup;
+			children = (
+				6CBB632A2ADD5F700045A4C9 /* MarketSearchView.swift */,
+				6CBB63302ADD75750045A4C9 /* MSHotCell.swift */,
+				6CBB63312ADD75750045A4C9 /* MSHotCell.xib */,
+				6CBB63342ADD77AE0045A4C9 /* MSHotListCell.swift */,
+				6CBB63352ADD77AE0045A4C9 /* MSHotListCell.xib */,
+				6CBB63382ADD7BD70045A4C9 /* MSHListCell.swift */,
+				6CBB63392ADD7BD70045A4C9 /* MSHListCell.xib */,
+				6CBB633C2ADD9A1D0045A4C9 /* MSearchListCell.swift */,
+				6CBB633D2ADD9A1D0045A4C9 /* MSearchListCell.xib */,
+			);
+			path = MarketSearch;
+			sourceTree = "<group>";
+		};
 		6CBDC8EB2972EDC7003E068F /* WebView */ = {
 			isa = PBXGroup;
 			children = (
@@ -3788,6 +3829,7 @@
 				6C4AFACC299AA17D00508EA7 /* WithdrawalsRemarkPopView.xib in Resources */,
 				6C0C49A7295F287C000BFEEB /* BindAccountCell.xib in Resources */,
 				6C3717E629AA5B39000DDD8B /* TalentDetailsHeaderView.xib in Resources */,
+				6CBB63332ADD75750045A4C9 /* MSHotCell.xib in Resources */,
 				6C7A1AF229F80B71004CFBE3 /* CreditsHeaderView.xib in Resources */,
 				6C10F10329DB08D900B79491 /* updateAPP012.png in Resources */,
 				6C10F0D329DB08D900B79491 /* updateAPP024.png in Resources */,
@@ -3880,6 +3922,7 @@
 				6CC37FEC298FDE2E0079FA5C /* AssetsTotalCell.xib in Resources */,
 				6CC380072993D4E10079FA5C /* AssetsDealListCell.xib in Resources */,
 				6C10F0CC29DB08D900B79491 /* updateAPP034.png in Resources */,
+				6CBB633F2ADD9A1D0045A4C9 /* MSearchListCell.xib in Resources */,
 				6C10F11729E1ADD900B79491 /* AssetsProxyDetailsViewController.xib in Resources */,
 				6CC37FBF298962B40079FA5C /* DealHintCell.xib in Resources */,
 				6C00A99A2433313300CE9ADB /* HXImagePickerController.bundle in Resources */,
@@ -3911,6 +3954,7 @@
 				6CC802282994067600C36373 /* AssetsProxyInfoCell.xib in Resources */,
 				6C10F11329E19A9400B79491 /* AssetsProxyTransferViewController.xib in Resources */,
 				6CA713072956ECD50047F450 /* MineHeaderView.xib in Resources */,
+				6CBB633B2ADD7BD70045A4C9 /* MSHListCell.xib in Resources */,
 				6C50AB5A2A03E4FA00699557 /* DealSimplenessCell.xib in Resources */,
 				6C50AB652A08097D00699557 /* RevokeWithdrawCashPopView.xib in Resources */,
 				6C4AFB4E29A9253E00508EA7 /* DealTalentCell.xib in Resources */,
@@ -3960,6 +4004,7 @@
 				6C10F0D229DB08D900B79491 /* updateAPP032.png in Resources */,
 				6C7A1ADE29F3E9EF004CFBE3 /* APaymentMethodCodeCell.xib in Resources */,
 				6C3717D929AA4961000DDD8B /* MCHeaderView.xib in Resources */,
+				6CBB63372ADD77AE0045A4C9 /* MSHotListCell.xib in Resources */,
 				6C584E4B295CA3DB00CE1D2C /* ModifyNicknameViewController.xib in Resources */,
 				6C10F0D129DB08D900B79491 /* updateAPP026.png in Resources */,
 				6C10F0D429DB08D900B79491 /* updateAPP030.png in Resources */,
@@ -4155,6 +4200,7 @@
 				6C4AFB0029A0FF9B00508EA7 /* HoldView.swift in Sources */,
 				6C2FFCBA29618239005B8180 /* FreezeAccountViewController.swift in Sources */,
 				6CBB62D92AD828440045A4C9 /* MDProfileView.swift in Sources */,
+				6CBB633A2ADD7BD70045A4C9 /* MSHListCell.swift in Sources */,
 				6C00A9A324346C4600CE9ADB /* KWebsocket.swift in Sources */,
 				6C10F11A29E1C02700B79491 /* AFinanceRedemptionViewController.swift in Sources */,
 				6C7F446C29556B6000DC6771 /* BaseAlertView.swift in Sources */,
@@ -4209,6 +4255,7 @@
 				6CBB62FF2AD977AF0045A4C9 /* MDAuoteDepthCell.swift in Sources */,
 				04D38ECB2AB2AEE50047EF9C /* JDKLineFooterView.swift in Sources */,
 				6C8652F629AA6E9D00A2E7FB /* TDStatisticsProfitCell.swift in Sources */,
+				6CBB63282ADD5F530045A4C9 /* MarketSearchViewModel.swift in Sources */,
 				6C4AFB5029AA1F1100508EA7 /* MyCopyingViewController.swift in Sources */,
 				6C4AFB0629A0FFE900508EA7 /* PositionHistoryView.swift in Sources */,
 				6C7F44682955680600DC6771 /* HomeView.swift in Sources */,
@@ -4231,6 +4278,7 @@
 				6C00A908242D918D00CE9ADB /* OpretationalLanguage.swift in Sources */,
 				04D38EB02AAB07B10047EF9C /* MarketListHeaderView.swift in Sources */,
 				04D38E7F2A9EE8A10047EF9C /* JXSegmentedListContainerView.swift in Sources */,
+				6CBB632B2ADD5F700045A4C9 /* MarketSearchView.swift in Sources */,
 				6C2FFCC72961A780005B8180 /* KTradingPasswordsPopView.swift in Sources */,
 				041D4F192AD2894E008ABDF7 /* JDTradeAccountHistoryOrderViewController.swift in Sources */,
 				6C35369129815FD7003BB632 /* DealViewModel.swift in Sources */,
@@ -4272,6 +4320,7 @@
 				04282A402ADD08C400CB4260 /* JDCodeInputView.swift in Sources */,
 				04D38E962AA1CE8B0047EF9C /* MarketGeneralSituationViewController.swift in Sources */,
 				6C0C49AA295F48F1000BFEEB /* BaseVerifyPopupView.swift in Sources */,
+				6CBB63242ADD5F380045A4C9 /* MarketSearchViewController.swift in Sources */,
 				6C031DA3296315930043BECF /* PageFlowView.swift in Sources */,
 				04D38E832A9EE8A10047EF9C /* JXSegmentedTitleAttributeDataSource.swift in Sources */,
 				6CC8023629953D2200C36373 /* ASelectCurrencyCell.swift in Sources */,
@@ -4322,6 +4371,7 @@
 				04D38E872A9EEA750047EF9C /* InfomationListViewController.swift in Sources */,
 				6CC37FFE299294D50079FA5C /* AssetsSavingsListCell.swift in Sources */,
 				6C3536842980091F003BB632 /* CTDealHeaderView.swift in Sources */,
+				6CBB63362ADD77AE0045A4C9 /* MSHotListCell.swift in Sources */,
 				04D38E242A9DE1E50047EF9C /* InfomationNavView.swift in Sources */,
 				6C4AFB1229A1372B00508EA7 /* HoldClosePositionPopView.swift in Sources */,
 				6C00A906242D918D00CE9ADB /* BaseTableViewCellProtocal.swift in Sources */,
@@ -4407,6 +4457,7 @@
 				04282A422ADD10DC00CB4260 /* JDForgotPasswordView.swift in Sources */,
 				6CC37FE2298FB0410079FA5C /* AssetsFinanceViewModel.swift in Sources */,
 				6CBDC90E297AE04C003E068F /* CTKLineUpsDownsCell.swift in Sources */,
+				6CBB63322ADD75750045A4C9 /* MSHotCell.swift in Sources */,
 				6C00A98B2433313300CE9ADB /* HXImagePickerController.swift in Sources */,
 				6C00A98A2433313300CE9ADB /* HXAlbumListViewController.swift in Sources */,
 				04C4CB1A2AD51420004CA35E /* JDMineVipCell.swift in Sources */,
@@ -4461,6 +4512,7 @@
 				04D38EC12AB054070047EF9C /* JDKLineUpsDownsCell.swift in Sources */,
 				6C00A9422431EF5900CE9ADB /* ShowBigImgView.swift in Sources */,
 				6C0C499B295DDD86000BFEEB /* ChangePasswordCell.swift in Sources */,
+				6CBB633E2ADD9A1D0045A4C9 /* MSearchListCell.swift in Sources */,
 				04D38E7A2A9EE8A10047EF9C /* JXSegmentedTitleGradientCell.swift in Sources */,
 				6C50AB682A0934EE00699557 /* AFiatDepositsVerifyViewController.swift in Sources */,
 				6CC37FDE298FB01D0079FA5C /* AssetsDealView.swift in Sources */,

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

@@ -215,6 +215,8 @@ let netForGetOptionProductList = "Public/getOptionProductList"//期权列表
 
 let netForGetPriceDepth = "Public/getPriceDepth"//深度
 
+let netForGetProductHotList = "Public/getProductHotList"//热门交易对
+
 
 
 /* ********************* 极度 **********************/

+ 1 - 0
Koala/Koala/Modular/Home/V/HomeView.swift

@@ -26,6 +26,7 @@ class HomeView: BaseView {
             currentVc()?.navigationController?.pushViewController(webVC, animated: true)
             
         }
+        
         return view
     }()
     

+ 5 - 23
Koala/Koala/Modular/Home/VC/HomeViewController.swift

@@ -19,7 +19,7 @@ class HomeViewController: BaseViewController  {
     lazy var navView:HomeNavView = {
         let view:HomeNavView = HomeNavView.init(frame: CGRect(x: 0, y: 0, width: SCREEN_WIDTH, height: TopHeight))
         view.textField.delegate = self
-        view.textField.addTarget(self, action:  #selector(inputChange(_:)), for: .editingChanged)
+      
         return view
     }()
     
@@ -163,30 +163,12 @@ class HomeViewController: BaseViewController  {
 }
 
 extension HomeViewController:UITextFieldDelegate {
-    @objc func inputChange(_ textField:UITextField) -> Void {
-        let text = textField.text ?? ""
-        if self.popView != nil {
-            self.popView?.screenText = text
-            self.popView?.screenSymbolListAction()
-        }
-    }
-    
+   
     func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
-        if self.popView == nil {
-            self.popView = HomeMarketPopView()
-            self.popView?.showRelyPopupView(superview:self.view ,view: self.navView, list: []) { model in
-                self.popView = nil
-                self.view.endEditing(true)
-                if model.symbol.length > 0{
-                    let vc = CTKLineViewController()
-                    vc.viewModel.symbolModel = model
-                    currentVc()?.navigationController?.pushViewController(vc, animated: true)
-                }
-            }
-        }
-        return true
+        self.navigationController?.pushViewController( MarketSearchViewController(), animated: true)
+        return false
     }
-    
+   
 }
 
 extension HomeViewController {

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

@@ -242,5 +242,12 @@ class MDNewsModel: BaseModel {
     var symbol:String = ""
 }
 
+class ProductHotListModel: BaseModel {
+    var symbol:String = ""
+    var market:String = ""
+    var num:Int = 0
+    var productBean:KSymbolModel = KSymbolModel()
+}
+
 
 

+ 3 - 3
Koala/Koala/Modular/Market/V/MarketDetailView/MarketDetailNavView.swift

@@ -81,7 +81,7 @@ class MarketDetailNavView: BaseView {
         
         self.shareBtn.setImage(_image("Market_share&Market_share"), for: .normal)
         
-        self.collectionBtn.setImage(_image("Market_collection&Market_collection"), for: .normal)
+        self.collectionBtn.setImage(_image("Market_unCollection&Market_unCollection"), for: .normal)
         
         
         
@@ -119,9 +119,9 @@ class MarketDetailNavView: BaseView {
     
     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)
+        }else{
+            self.collectionBtn.setImage(_image("Market_unCollection&Market_unCollection"), for: .normal)
         }
     }
     

+ 57 - 0
Koala/Koala/Modular/Market/V/MarketSearch/MSHListCell.swift

@@ -0,0 +1,57 @@
+//
+//  MSHListCell.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/16.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MSHListCell: BaseTableViewCell {
+    @IBOutlet weak var numLab: UILabel!
+    @IBOutlet weak var nameLab: UILabel!
+    @IBOutlet weak var codeLab: UILabel!
+    @IBOutlet weak var changeLab: UILabel!
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        
+        self.backgroundColor = .clear
+        
+        self.numLab.setTextFont(.PFSM, 14)
+        self.nameLab.setTextFont(.PFSR, 12)
+        self.nameLab.textColor = TitleTextColor
+        self.codeLab.setTextFont(.PFSR, 12)
+        self.codeLab.textColor = MidTextColor
+        
+        self.changeLab.setTextFont(.PFSR, 14)
+        // Initialization code
+    }
+
+    override func setSelected(_ selected: Bool, animated: Bool) {
+        super.setSelected(selected, animated: animated)
+
+        // Configure the view for the selected state
+    }
+    
+    func updateCellWith(model:ProductHotListModel) -> Void {
+        self.numLab.text = "\(model.num)"
+        if model.num < 4 {
+            self.numLab.textColor = MainBackGroundColor
+        }else{
+            self.numLab.textColor = TitleTextColor
+        }
+        
+        self.nameLab.text = model.productBean.title
+        self.codeLab.text = model.productBean.symbol
+        
+        self.updateChange(model: model.productBean)
+    }
+    
+    func updateChange(model:KSymbolModel) -> Void {
+        self.changeLab.text = model.increase + "%"
+        
+        self.changeLab.textColor = exchangeColorAndImage(increase: conerData(model.increase, .MyFloat).1!).0
+    }
+}

+ 69 - 0
Koala/Koala/Modular/Market/V/MarketSearch/MSHListCell.xib

@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="79" id="KGk-i7-Jjw" customClass="MSHListCell" customModule="Koala" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="429" height="79"/>
+            <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="429" height="79"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="kiA-OO-C4J">
+                        <rect key="frame" x="61.333333333333329" y="19.333333333333332" width="41.333333333333329" height="40.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="IJy-YC-fuZ">
+                                <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="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="b15-mi-djL">
+                                <rect key="frame" x="0.0" y="20.333333333333336" width="41.333333333333336" height="20.333333333333336"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                        </subviews>
+                    </stackView>
+                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3LF-9r-g5Q">
+                        <rect key="frame" x="10" y="19.333333333333336" width="41.333333333333336" height="20.333333333333336"/>
+                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                        <nil key="textColor"/>
+                        <nil key="highlightedColor"/>
+                    </label>
+                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zdB-hi-CsO">
+                        <rect key="frame" x="377.66666666666669" y="29.333333333333336" width="41.333333333333314" height="20.333333333333336"/>
+                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                        <nil key="textColor"/>
+                        <nil key="highlightedColor"/>
+                    </label>
+                </subviews>
+                <constraints>
+                    <constraint firstItem="zdB-hi-CsO" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="3S8-bt-iIj"/>
+                    <constraint firstItem="kiA-OO-C4J" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="J3h-83-sUH"/>
+                    <constraint firstItem="3LF-9r-g5Q" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="10" id="NtP-sR-sFn"/>
+                    <constraint firstItem="kiA-OO-C4J" firstAttribute="leading" secondItem="3LF-9r-g5Q" secondAttribute="trailing" constant="10" id="S0F-Aq-IyA"/>
+                    <constraint firstAttribute="trailing" secondItem="zdB-hi-CsO" secondAttribute="trailing" constant="10" id="eca-YG-vPA"/>
+                    <constraint firstItem="IJy-YC-fuZ" firstAttribute="centerY" secondItem="3LF-9r-g5Q" secondAttribute="centerY" id="qp9-xn-gKF"/>
+                </constraints>
+            </tableViewCellContentView>
+            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
+            <connections>
+                <outlet property="changeLab" destination="zdB-hi-CsO" id="atK-Wx-plH"/>
+                <outlet property="codeLab" destination="b15-mi-djL" id="UAM-WX-cjo"/>
+                <outlet property="nameLab" destination="IJy-YC-fuZ" id="tWG-Jq-cHU"/>
+                <outlet property="numLab" destination="3LF-9r-g5Q" id="can-oQ-Vu6"/>
+            </connections>
+            <point key="canvasLocation" x="196" y="24"/>
+        </tableViewCell>
+    </objects>
+</document>

+ 99 - 0
Koala/Koala/Modular/Market/V/MarketSearch/MSHotCell.swift

@@ -0,0 +1,99 @@
+//
+//  MSHotCell.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/16.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MSHotCell: BaseTableViewCell {
+    @IBOutlet weak var collectionView: UICollectionView!
+    @IBOutlet weak var bottomBgView: UIView!
+    
+    var pageDotImage: UIImage = _image("Home_banner_unactived&Home_banner_unactived")
+        .imageWithTintColor(color: MidTextColor)
+    var currentPageDotImage: UIImage = _image("Home_banner_actived&Home_banner_actived").imageWithTintColor(color: MainBackGroundColor)
+    
+    lazy var pageView:FSPageControl = {
+        let view:FSPageControl = FSPageControl.init(frame: CGRect.init(x: 0, y:15, width: SCREEN_WIDTH, height: 10))
+        view.contentHorizontalAlignment = .center
+        view.contentInsets = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
+        view.hidesForSinglePage = true
+        view.itemSpacing = 20
+        return view
+    }()
+    
+    var listData:[[ProductHotListModel]] = [[ProductHotListModel]]()
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+       
+        self.backgroundColor = ALLBackGroundColor
+        self.bottomBgView.addSubview(self.pageView)
+        self.bottomBgView.backgroundColor = MidBackGroundColor
+        
+        let layout = UICollectionViewFlowLayout.init()
+        layout.scrollDirection = UICollectionView.ScrollDirection.horizontal
+        layout.minimumInteritemSpacing = 0
+        layout.minimumLineSpacing = 0
+        collectionView.setCollectionViewLayout(layout, animated: true)
+        collectionView.delegate = self
+        collectionView.dataSource = self
+        collectionView.showsVerticalScrollIndicator = false
+        collectionView.showsHorizontalScrollIndicator = false
+        collectionView.backgroundColor = UIColor.clear
+        collectionView.isPagingEnabled = true
+        
+        collectionView.register(UINib.init(nibName: "MSHotListCell", bundle: nil), forCellWithReuseIdentifier: "MSHotListCell")
+        // Initialization code
+    }
+
+    override func setSelected(_ selected: Bool, animated: Bool) {
+        super.setSelected(selected, animated: animated)
+
+        // Configure the view for the selected state
+    }
+    
+    func updateCellWith(list:[[ProductHotListModel]]) -> Void {
+        self.listData = list
+        
+        pageView.numberOfPages = self.listData.count
+        pageView.setImage(pageDotImage, for: .normal)
+        pageView.setImage(currentPageDotImage, for: .selected)
+   
+        self.collectionView.reloadData()
+    }
+    
+}
+
+extension MSHotCell : UICollectionViewDelegateFlowLayout, UICollectionViewDelegate, UICollectionViewDataSource{
+    
+    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        return self.listData.count
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        let cell:MSHotListCell = collectionView.dequeueReusableCell(withReuseIdentifier: "MSHotListCell", for: indexPath) as! MSHotListCell
+        
+        cell.updateCellWith(list: self.listData[indexPath.row])
+        return cell
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
+        return CGSize(width: SCREEN_WIDTH, height:40+40*5)
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+       
+       
+        
+    }
+    
+    func scrollViewDidScroll(_ scrollView: UIScrollView) {
+        let index:Int = Int(scrollView.contentOffset.x/SCREEN_WIDTH)
+        self.pageView.currentPage = index
+    }
+
+}

+ 62 - 0
Koala/Koala/Modular/Market/V/MarketSearch/MSHotCell.xib

@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="192" id="KGk-i7-Jjw" customClass="MSHotCell" customModule="Koala" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="485" height="192"/>
+            <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="485" height="192"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="2bF-ON-mfZ">
+                        <rect key="frame" x="0.0" y="0.0" width="485" height="192"/>
+                        <subviews>
+                            <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="c95-OI-zDl">
+                                <rect key="frame" x="0.0" y="0.0" width="485" height="152"/>
+                                <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                                <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="vNO-VX-pdc">
+                                    <size key="itemSize" width="128" height="128"/>
+                                    <size key="headerReferenceSize" width="0.0" height="0.0"/>
+                                    <size key="footerReferenceSize" width="0.0" height="0.0"/>
+                                    <inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
+                                </collectionViewFlowLayout>
+                            </collectionView>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Owc-PO-ULy">
+                                <rect key="frame" x="0.0" y="152" width="485" height="40"/>
+                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="40" id="NTz-R8-Ndy"/>
+                                </constraints>
+                            </view>
+                        </subviews>
+                    </stackView>
+                </subviews>
+                <constraints>
+                    <constraint firstAttribute="bottom" secondItem="2bF-ON-mfZ" secondAttribute="bottom" id="5zP-Py-hb3"/>
+                    <constraint firstAttribute="trailing" secondItem="2bF-ON-mfZ" secondAttribute="trailing" id="T7P-TA-S1F"/>
+                    <constraint firstItem="2bF-ON-mfZ" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="fox-61-b3K"/>
+                    <constraint firstItem="2bF-ON-mfZ" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="gT1-1u-ISh"/>
+                </constraints>
+            </tableViewCellContentView>
+            <connections>
+                <outlet property="bottomBgView" destination="Owc-PO-ULy" id="9ag-xF-rIe"/>
+                <outlet property="collectionView" destination="c95-OI-zDl" id="xle-7c-7I9"/>
+            </connections>
+            <point key="canvasLocation" x="158" y="54"/>
+        </tableViewCell>
+    </objects>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 110 - 0
Koala/Koala/Modular/Market/V/MarketSearch/MSHotListCell.swift

@@ -0,0 +1,110 @@
+//
+//  MSHotListCell.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/16.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MSHotListCell: UICollectionViewCell {
+    @IBOutlet weak var bgView: UIView!
+    @IBOutlet weak var imgView: UIImageView!
+    @IBOutlet weak var titleLab: UILabel!
+    @IBOutlet weak var tableView: UITableView!
+    @IBOutlet weak var lineView: UIView!
+    
+    var listData:[ProductHotListModel] = [ProductHotListModel]()
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        self.backgroundColor = .clear
+        self.bgView.backgroundColor = ALLBackGroundColor
+        
+        self.imgView.setViewLayerBorderColor(myColor: .clear, borderWidth: 0, maskBounds: 10)
+        self.imgView.layer.masksToBounds = true
+        
+        self.titleLab.textColor = TitleTextColor
+        self.titleLab.setTextFont(.PFSM, 14)
+        
+        self.lineView.backgroundColor = ViewBorderColor
+        
+        self.tableView.delegate = self
+        self.tableView.dataSource = self
+        tableView.separatorStyle = .singleLine
+        tableView.separatorColor = ViewBorderColor
+        tableView.separatorInset = UIEdgeInsets(top: 0, left: 10, bottom: 0, right: 10)
+        tableView.backgroundColor = ALLBackGroundColor
+        tableView.tableFooterView = UIView()
+        tableView.tableHeaderView = UIView()
+        tableView.showsVerticalScrollIndicator = false
+        tableView.showsVerticalScrollIndicator = false
+        tableView.register(UINib.init(nibName: "MSHListCell", bundle: nil), forCellReuseIdentifier: "MSHListCell")
+    }
+    
+    
+    func updateCellWith(list:[ProductHotListModel]) -> Void {
+        self.listData = list
+        let model = list.first
+        if model?.market == "US"{
+            self.imgView.image = _image("Market_W_US&Market_W_US")
+            self.titleLab.text = switchLanguage("美股热度榜")
+        }else if model?.market == "HK"{
+            self.imgView.image = _image("Market_W_HK&Market_W_HK")
+            self.titleLab.text = switchLanguage("港股热度榜")
+        }
+        else{
+            self.imgView.image = _image("Market_W_HK&Market_W_HK")
+            self.titleLab.text = switchLanguage("A股热度榜")
+        }
+        
+        self.tableView.reloadData()
+    }
+    
+
+}
+
+//代理
+extension MSHotListCell: UITableViewDelegate,UITableViewDataSource{
+    
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        return self.listData.count
+    }
+    
+    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+        let cell:MSHListCell = tableView.dequeueReusableCell(withIdentifier: "MSHListCell") as! MSHListCell
+        let model = self.listData[indexPath.row]
+        cell.updateCellWith(model: model)
+        return cell
+    }
+    
+    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
+        return UIView()
+    }
+    
+    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
+        return UIView()
+    }
+    
+    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
+        return 40
+    }
+    
+    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
+        return 0
+    }
+    
+    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
+        return  0
+    }
+    
+    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
+        let model = self.listData[indexPath.row]
+        let vc = MarketDetailViewController()
+        vc.symbolModel = model.productBean
+        currentVc()?.navigationController?.pushViewController(vc, animated: true)
+    }
+    
+}
+

+ 101 - 0
Koala/Koala/Modular/Market/V/MarketSearch/MSHotListCell.xib

@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="MSHotListCell" customModule="Koala" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="336" height="260"/>
+            <autoresizingMask key="autoresizingMask"/>
+            <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
+                <rect key="frame" x="0.0" y="0.0" width="336" height="260"/>
+                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                <subviews>
+                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="TXZ-37-Oml">
+                        <rect key="frame" x="5" y="0.0" width="326" height="260"/>
+                        <subviews>
+                            <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="erG-Xk-ALS">
+                                <rect key="frame" x="0.0" y="0.0" width="326" height="260"/>
+                                <subviews>
+                                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="P7h-BL-FIw">
+                                        <rect key="frame" x="0.0" y="0.0" width="326" height="40"/>
+                                        <subviews>
+                                            <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="WeS-a4-Oba">
+                                                <rect key="frame" x="10" y="10" width="20" height="20"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="20" id="1na-pU-TL8"/>
+                                                    <constraint firstAttribute="width" constant="20" id="8Kc-Ef-Lbd"/>
+                                                </constraints>
+                                            </imageView>
+                                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="s3R-kt-zlq">
+                                                <rect key="frame" x="35" y="9.9999999999999982" width="41.333333333333343" height="20.333333333333329"/>
+                                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                <nil key="textColor"/>
+                                                <nil key="highlightedColor"/>
+                                            </label>
+                                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="WfV-9C-Xyx">
+                                                <rect key="frame" x="10" y="39" width="306" height="1"/>
+                                                <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="1" id="hed-hn-JAr"/>
+                                                </constraints>
+                                            </view>
+                                        </subviews>
+                                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                        <constraints>
+                                            <constraint firstAttribute="trailing" secondItem="WfV-9C-Xyx" secondAttribute="trailing" constant="10" id="FxO-af-DL3"/>
+                                            <constraint firstAttribute="height" constant="40" id="OrP-vh-Att"/>
+                                            <constraint firstItem="s3R-kt-zlq" firstAttribute="centerY" secondItem="P7h-BL-FIw" secondAttribute="centerY" id="POz-Q1-3A3"/>
+                                            <constraint firstItem="WeS-a4-Oba" firstAttribute="centerY" secondItem="P7h-BL-FIw" secondAttribute="centerY" id="QXg-Od-HmM"/>
+                                            <constraint firstItem="WeS-a4-Oba" firstAttribute="leading" secondItem="P7h-BL-FIw" secondAttribute="leading" constant="10" id="TdY-6f-w0g"/>
+                                            <constraint firstAttribute="bottom" secondItem="WfV-9C-Xyx" secondAttribute="bottom" id="XAA-k1-fWG"/>
+                                            <constraint firstItem="WfV-9C-Xyx" firstAttribute="leading" secondItem="P7h-BL-FIw" secondAttribute="leading" constant="10" id="YzL-V5-3s9"/>
+                                            <constraint firstItem="s3R-kt-zlq" firstAttribute="leading" secondItem="WeS-a4-Oba" secondAttribute="trailing" constant="5" id="gVe-sj-XZG"/>
+                                        </constraints>
+                                    </view>
+                                    <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="mkA-gJ-NEU">
+                                        <rect key="frame" x="0.0" y="40" width="326" height="220"/>
+                                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                                    </tableView>
+                                </subviews>
+                            </stackView>
+                        </subviews>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                        <constraints>
+                            <constraint firstItem="erG-Xk-ALS" firstAttribute="top" secondItem="TXZ-37-Oml" secondAttribute="top" id="CTw-g6-TkL"/>
+                            <constraint firstAttribute="trailing" secondItem="erG-Xk-ALS" secondAttribute="trailing" id="E6g-FP-GQw"/>
+                            <constraint firstAttribute="bottom" secondItem="erG-Xk-ALS" secondAttribute="bottom" id="PsD-jN-oFw"/>
+                            <constraint firstItem="erG-Xk-ALS" firstAttribute="leading" secondItem="TXZ-37-Oml" secondAttribute="leading" id="ZsC-Kq-3fq"/>
+                        </constraints>
+                    </view>
+                </subviews>
+            </view>
+            <constraints>
+                <constraint firstAttribute="trailing" secondItem="TXZ-37-Oml" secondAttribute="trailing" constant="5" id="M9R-eY-CRi"/>
+                <constraint firstItem="TXZ-37-Oml" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="5" id="lSX-SQ-Jnj"/>
+                <constraint firstAttribute="bottom" secondItem="TXZ-37-Oml" secondAttribute="bottom" id="ofk-KZ-JNi"/>
+                <constraint firstItem="TXZ-37-Oml" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="yrp-0Y-Yl5"/>
+            </constraints>
+            <size key="customSize" width="336" height="260"/>
+            <connections>
+                <outlet property="bgView" destination="TXZ-37-Oml" id="MdP-8G-fQB"/>
+                <outlet property="imgView" destination="WeS-a4-Oba" id="9nx-yV-yrz"/>
+                <outlet property="lineView" destination="WfV-9C-Xyx" id="0Je-T7-Uh1"/>
+                <outlet property="tableView" destination="mkA-gJ-NEU" id="SQ1-EO-N8e"/>
+                <outlet property="titleLab" destination="s3R-kt-zlq" id="rbD-Fo-RTl"/>
+            </connections>
+            <point key="canvasLocation" x="254.96183206106869" y="98.591549295774655"/>
+        </collectionViewCell>
+    </objects>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 71 - 0
Koala/Koala/Modular/Market/V/MarketSearch/MSearchListCell.swift

@@ -0,0 +1,71 @@
+//
+//  MSearchListCell.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/17.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MSearchListCell: BaseTableViewCell {
+    @IBOutlet weak var marketBtn: UIButton!
+    @IBOutlet weak var nameLab: UILabel!
+    @IBOutlet weak var codeLab: UILabel!
+    @IBOutlet weak var collectBtn: UIButton!
+    
+    var collectBlock: ((_ index:Int) -> ())?
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        self.backgroundColor = ALLBackGroundColor
+        
+        self.marketBtn.setTextFont(.PFSR, 12)
+        self.marketBtn.contentEdgeInsets = UIEdgeInsets(top: 0, left: 4, bottom: 0, right: 4)
+        self.marketBtn .setViewLayerBorderColor(myColor: .clear, borderWidth: 0, maskBounds: 2)
+        
+        self.nameLab.textColor = TitleTextColor
+        self.nameLab.setTextFont(.PFSM, 18)
+        
+        self.codeLab.textColor = MidTextColor
+        self.codeLab.setTextFont(.PFSR, 12)
+        
+        self.collectBtn.addTarget(self, action: #selector(clickCollectBtnAction(_ :)), for: .touchUpInside)
+        
+        
+    }
+
+    override func setSelected(_ selected: Bool, animated: Bool) {
+        super.setSelected(selected, animated: animated)
+
+        // Configure the view for the selected state
+    }
+    
+    @objc func clickCollectBtnAction(_ sender:UIButton){
+        self.collectBlock?(sender.tag - 10000)
+    }
+    
+    func updateCellWith(model:KSymbolModel,index:Int) -> Void {
+        self.collectBtn.tag = 10000+index
+        self.nameLab.text = model.title
+        self.marketBtn.setTitle(model.market, for: .normal)
+        self.codeLab.text = model.symbol
+        if model.market == "HK"{
+            self.marketBtn.backgroundColor = _color("#EDF6FF&#EDF6FF")
+            self.marketBtn.setTitleColor(_color("#1989FF&#1989FF"), for: .normal)
+        }
+        else if model.market == "CFD"{
+            self.marketBtn.backgroundColor = _color("#1989FF&#1989FF")
+            self.marketBtn.setTitleColor(WhiteTextColor, for: .normal)
+        }else{
+            self.marketBtn.backgroundColor = _color("#FFF1F1&#FFF1F1")
+            self.marketBtn.setTitleColor(_color("#EA4A45&#EA4A45"), for: .normal)
+        }
+        
+        if model.isCollection {
+            self.collectBtn.setImage(_image("Market_collection&Market_collection"), for: .normal)
+        }else{
+            self.collectBtn.setImage(_image("Market_unCollection&Market_unCollection"), for: .normal)
+        }
+    }
+    
+}

+ 65 - 0
Koala/Koala/Modular/Market/V/MarketSearch/MSearchListCell.xib

@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="98" id="KGk-i7-Jjw" customClass="MSearchListCell" customModule="Koala" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="365" height="98"/>
+            <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="365" height="98"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZAD-nd-4bH">
+                        <rect key="frame" x="5" y="22" width="30" height="34"/>
+                        <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                    </button>
+                    <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="36i-gQ-xef">
+                        <rect key="frame" x="40" y="28.666666666666668" width="41.333333333333343" height="40.666666666666657"/>
+                        <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="JJp-B3-flU">
+                                <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="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KAK-ew-gHp">
+                                <rect key="frame" x="0.0" y="20.333333333333336" width="41.333333333333336" height="20.333333333333336"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                        </subviews>
+                    </stackView>
+                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="aEp-Vm-4zZ">
+                        <rect key="frame" x="320" y="0.0" width="30" height="98"/>
+                        <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                    </button>
+                </subviews>
+                <constraints>
+                    <constraint firstItem="JJp-B3-flU" firstAttribute="centerY" secondItem="ZAD-nd-4bH" secondAttribute="centerY" id="8L9-T9-s1v"/>
+                    <constraint firstItem="aEp-Vm-4zZ" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="QAq-eB-ogD"/>
+                    <constraint firstAttribute="trailing" secondItem="aEp-Vm-4zZ" secondAttribute="trailing" constant="15" id="Rpl-Qf-VDc"/>
+                    <constraint firstItem="ZAD-nd-4bH" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="5" id="SM0-Jd-bFc"/>
+                    <constraint firstItem="aEp-Vm-4zZ" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="Yoj-kl-3dt"/>
+                    <constraint firstAttribute="bottom" secondItem="aEp-Vm-4zZ" secondAttribute="bottom" id="eDi-B9-FU6"/>
+                    <constraint firstItem="36i-gQ-xef" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="sr6-Cz-ijh"/>
+                    <constraint firstItem="36i-gQ-xef" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="40" id="xNk-v6-6JJ"/>
+                </constraints>
+            </tableViewCellContentView>
+            <connections>
+                <outlet property="codeLab" destination="KAK-ew-gHp" id="RLS-6w-e4O"/>
+                <outlet property="collectBtn" destination="aEp-Vm-4zZ" id="ULA-Yg-mqb"/>
+                <outlet property="marketBtn" destination="ZAD-nd-4bH" id="Nob-is-86j"/>
+                <outlet property="nameLab" destination="JJp-B3-flU" id="PhH-sM-Qrh"/>
+            </connections>
+            <point key="canvasLocation" x="121" y="39"/>
+        </tableViewCell>
+    </objects>
+</document>

+ 258 - 0
Koala/Koala/Modular/Market/V/MarketSearch/MarketSearchView.swift

@@ -0,0 +1,258 @@
+//
+//  MarketSearchView.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/16.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+import MJRefresh
+class MarketSearchView: BaseView {
+    var VM: MarketSearchViewModel?
+    
+    lazy var searchView:BaseSearchView = {
+        let view:BaseSearchView = BaseSearchView()
+        view.setTextPlaceholder(text: switchLanguage("检索"))
+        view.setCancelText(text: switchLanguage("取消"))
+        view.textField.setTextFont(.PFSM, 18)
+        view.textFieldBlock = {[weak self] text in
+            if text.length > 0 {
+                self?.VM?.screenText = text
+                self?.VM?.isSearch = true
+            }else{
+                self?.VM?.isSearch = false
+                self?.reloadTable()
+            }
+            
+        }
+        view.cancelBlock = {
+            currentVc()?.navigationController?.popViewController(animated: true)
+        }
+        return view
+    }()
+    
+    lazy var navView:UIView = {
+        let view:UIView = UIView()
+        view.backgroundColor = ALLBackGroundColor
+        view.addSubview(searchView)
+        
+        searchView.snp.makeConstraints { make in
+            make.top.equalTo(StatusBarHeight+5)
+            make.left.equalTo(15)
+            make.right.equalTo(-15)
+            make.height.equalTo(34)
+        }
+        
+        return view
+    }()
+    
+    lazy var tableView: BaseTableView = { [weak self] in
+        let tableView = BaseTableView.init(frame: .zero, style: .plain)
+        tableView.separatorStyle = .singleLine
+        tableView.separatorColor = ViewBorderColor
+        tableView.separatorInset = UIEdgeInsets(top: 0, left: 40, bottom: 0, right: 15)
+        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: "MSHotCell", bundle: nil), forCellReuseIdentifier: "MSHotCell")
+        
+        tableView.register(UINib.init(nibName: "MSearchListCell", bundle: nil), forCellReuseIdentifier: "MSearchListCell")
+        
+        if #available(iOS 11, *){
+            tableView.contentInsetAdjustmentBehavior = .never
+        }
+        
+        tableView.ly_emptyView = self!.showEmptyView()
+        
+        tableView.mj_header = MJRefreshHeader(refreshingBlock: { [weak self] in
+            if self!.VM!.isSearch {
+                self?.VM?.netSymbolList(isUp: false)
+            }else{
+                self?.tableView.mj_header!.endRefreshing()
+                self?.tableView.mj_footer!.endRefreshing()
+            }
+            
+        })
+        tableView.mj_footer = MJRefreshAutoFooter.init(refreshingBlock: { [weak self] in
+            if self!.VM!.isSearch {
+                self?.VM?.netSymbolList(isUp: true)
+            }else{
+                self?.tableView.mj_header!.endRefreshing()
+                self?.tableView.mj_footer!.endRefreshing()
+            }
+        })
+        
+        return tableView
+    }()
+    
+    override func subView() {
+        self.backgroundColor = .white //ALLBackGroundColor
+        self.addSubview(navView)
+        self.addSubview(tableView)
+        
+        
+        mySwitchLanguage()
+        mySwitchSkin()
+    }
+    
+    override func layoutSubviews() {
+        super.layoutSubviews()
+        
+        self.navView.snp.makeConstraints { make in
+            make.top.left.right.equalTo(self)
+            make.height.equalTo(TopHeight)
+        }
+        
+        
+        tableView.snp.makeConstraints { make in
+            make.bottom.right.left.equalToSuperview()
+            make.top.equalTo(self.navView.snp.bottom)
+        }
+    }
+    
+    override func setViewModel(viewmodel: AnyObject) {
+        guard viewmodel is MarketSearchViewModel else {
+            return
+        }
+        self.VM = viewmodel as? MarketSearchViewModel
+        super.setViewModel(viewmodel: viewmodel)
+       
+    }
+    
+    override func mySwitchLanguage() {
+      
+        self.searchView.mySwitchLanguage()
+        
+    }
+    
+    override func mySwitchSkin() {
+        self.tableView.backgroundColor = .clear
+        self.backgroundColor = MidBackGroundColor
+        
+        self.navView.backgroundColor = ALLBackGroundColor
+        self.searchView.textField.backgroundColor = InputBackGroundColor
+        self.searchView.mySwitchSkin()
+        self.searchView.cancelBtn.setTextFont(.PFSM, 16)
+        self.searchView.cancelBtn.setTitleColor(TitleTextColor, for: .normal)
+        
+        self.tableView.separatorColor = ViewBorderColor
+        self.tableView.separatorInset = UIEdgeInsets(top: 20, left: 0, bottom: 0, right: 20)
+    
+        
+      
+    }
+    
+
+    override func blindModel() {
+        VM?.productHotListAction.values.observeValues({[weak self] (success) in
+            guard let self = self else { return }
+            if success {
+                self.reloadTable()
+            }
+        })
+        
+        VM?.symbolListAction.values.observeValues({[weak self] (success) in
+            guard let self = self else{return}
+            DispatchQueue.main.async {
+                self.tableView.reloadData()
+                self.tableView.mj_header!.endRefreshing()
+                self.tableView.mj_footer!.endRefreshing()
+                if success {
+                    self.tableView.mj_footer!.endRefreshingWithNoMoreData()
+                }
+            }
+        })
+        
+    }
+    
+    func reloadTable() {
+        DispatchQueue.main.async {
+//            self.tableView.mj_header!.endRefreshing()
+            self.tableView.reloadData()
+        }
+    }
+    
+
+}
+
+//代理
+extension MarketSearchView:UITableViewDelegate,UITableViewDataSource{
+   
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        if self.VM!.isSearch{
+            return self.VM?.symbolList.count ?? 0
+        }
+        return 1
+    }
+    
+    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+        if (self.VM!.isSearch){
+            
+            let cell:MSearchListCell = tableView.dequeueReusableCell(withIdentifier: "MSearchListCell") as! MSearchListCell
+            cell.updateCellWith(model: self.VM!.symbolList[indexPath.row],index: indexPath.row)
+            cell.collectBlock = {[weak self] index in
+                let model = self?.VM?.symbolList[index]
+                if model!.isCollection {
+                    self?.VM?.netDeleteProductUser(symbol: model!.symbol)
+                }else{
+                    self?.VM?.netInsertProductUser(symbol: model!.symbol)
+                }
+                
+            }
+            return cell
+            
+        }else{
+            let cell:MSHotCell = tableView.dequeueReusableCell(withIdentifier: "MSHotCell") as! MSHotCell
+          
+            cell.updateCellWith(list: self.VM!.productHotList)
+            return cell
+        }
+       
+       
+    }
+    
+    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
+        if self.VM!.isSearch{
+            return 60
+        }
+        return 40+40+5*40
+    }
+    
+    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
+        return UIView()
+    }
+    
+    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
+        return UIView()
+    }
+    
+    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
+        return 0
+    }
+    
+    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
+        return 0
+    }
+    
+    
+    
+    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
+     
+        if self.VM!.isSearch {
+            let model = self.VM?.symbolList[indexPath.row]
+            let vc = MarketDetailViewController()
+            vc.symbolModel = model!
+            currentVc()?.navigationController?.pushViewController(vc, animated: true)
+        }
+       
+        
+    }
+    
+}
+

+ 16 - 1
Koala/Koala/Modular/Market/V/MarketView/MarketNavView.swift

@@ -12,6 +12,10 @@ import UIKit
 class MarketNavView: BaseView
 {
     
+    var searchBlock: (() -> ())?
+    
+    var chatBlock: (() -> ())?
+    
     lazy var segmentedControl:HMSegmentedControl = {
         let segmentedControl:HMSegmentedControl = HMSegmentedControl.init(frame: CGRect(x: 10, y:StatusBarHeight, width:SCREEN_WIDTH-98, height: 44))
     
@@ -53,7 +57,9 @@ class MarketNavView: BaseView
        
         self.addSubview(chatBtn)
         
-      
+        searchBtn.addTarget(self, action: #selector(clickSearchBtnAction), for: .touchUpInside)
+        
+        chatBtn.addTarget(self, action: #selector(clickChatBtnnAction), for: .touchUpInside)
         
         chatBtn.snp.makeConstraints { make in
             make.right.equalTo(self.snp.right)
@@ -84,4 +90,13 @@ class MarketNavView: BaseView
         self.segmentedControl.sectionTitles = [switchLanguage("自选"),switchLanguage("市场"),switchLanguage("个股期权")]
     }
     
+    @objc func clickSearchBtnAction(){
+        self.searchBlock?()
+    }
+    
+    @objc func clickChatBtnnAction(){
+        self.chatBlock?()
+    }
+    
+    
 }

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

@@ -41,6 +41,16 @@ class MarketView: BaseView {
                 self?.updateHeaderView(index: Int(index))
             }
         }
+        
+        v.searchBlock = {
+            currentVc()?.navigationController?.pushViewController( MarketSearchViewController(), animated: true)
+        }
+        
+        v.chatBlock = {
+            
+        }
+        
+       
         return v
     }()
     

+ 62 - 0
Koala/Koala/Modular/Market/VC/MarketSearchViewController.swift

@@ -0,0 +1,62 @@
+//
+//  MarketSearchViewController.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/16.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+
+class MarketSearchViewController: BaseViewController {
+    var viewModel = MarketSearchViewModel.init()
+    lazy var searchView: MarketSearchView = {
+        let view = MarketSearchView.init(type: .ViewModel(ViewModel: self.viewModel))
+        return view
+    }()
+    
+    override func viewWillDisappear(_ animated: Bool) {
+        super.viewWillDisappear(animated)
+        self.myNavigationBar.isHidden = true
+       
+    }
+    
+    
+    override func viewWillAppear(_ animated: Bool) {
+        super.viewWillAppear(animated)
+        self.myNavigationBar.isHidden = true
+        
+    }
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        self.viewModel.netUserList()
+        self.viewModel.netProductHotList()
+       
+        // Do any additional setup after loading the view.
+    }
+    
+    override func mySwitchLanguage() {
+        //PublicBetaFloatingView.shared.switchLanguage()
+    }
+    
+    override func mySwitchSkin() {
+        self.view.backgroundColor = ALLBackGroundColor
+        
+    }
+    
+    override func subView() {
+        self.view.addSubview(searchView)
+    }
+    
+    override func updateViewConstraints() {
+        super.updateViewConstraints()
+        searchView.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+    }
+    
+    
+    override func blindModel() {
+      
+    }
+}

+ 376 - 0
Koala/Koala/Modular/Market/VM/MarketSearchViewModel.swift

@@ -0,0 +1,376 @@
+//
+//  MarketSearchViewModel.swift
+//  Koala
+//
+//  Created by 刘千军 on 2023/10/16.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import UIKit
+import ReactiveCocoa
+import ReactiveSwift
+
+class MarketSearchViewModel: BaseViewModel {
+
+    lazy var collectionList:[String] = {
+        let arr:[String] = [String]()
+        return arr
+    }()
+    
+    lazy var cnProductHotList:[ProductHotListModel] = {
+        let arr:[ProductHotListModel] = [ProductHotListModel]()
+        return arr
+    }()
+    
+    lazy var hkProductHotList:[ProductHotListModel] = {
+        let arr:[ProductHotListModel] = [ProductHotListModel]()
+        return arr
+    }()
+    
+    lazy var usProductHotList:[ProductHotListModel] = {
+        let arr:[ProductHotListModel] = [ProductHotListModel]()
+        return arr
+    }()
+    
+    lazy var symbolList:[KSymbolModel] = {//交易对
+        let arr:[KSymbolModel] = [KSymbolModel]()
+        return arr
+    }()
+
+    
+    var productHotList:[[ProductHotListModel]] = [[ProductHotListModel]]()
+    
+    
+    
+    var isSearch:Bool = false {
+        didSet{
+            
+        }
+    }
+    
+    var screenText:String = ""{
+        didSet{
+            self.netSymbolList(isUp: false)
+        }
+    }
+    
+    var pageNum = 1
+    
+    //netForHomeSymbolList
+    var userListAction: Action <(),(Bool),Never>!
+    
+    var productHotListAction: Action <(),(Bool),Never>!
+    var symbolListAction: Action <(Bool),(Bool),Never>!
+    var insertProductUserAction: Action <(String),(Bool),Never>!
+    var deleteProductUserAction: Action <(String),(Bool),Never>!
+    
+    
+    override func initialize() {
+        userListAction = Action<(),(Bool),Never> {[weak self] _ in
+            return SignalProducer<(Bool),Never>{ observer, _ in
+                self?.requestUserList(observer: observer)
+            }
+        }
+        
+        productHotListAction = Action<(),(Bool),Never> {[weak self] _ in
+            return SignalProducer<(Bool),Never>{ observer, _ in
+                self?.requestProductHotList(observer: observer)
+            }
+        }
+        
+        symbolListAction = Action<(Bool),(Bool),Never> {[weak self] isUp in
+            return SignalProducer<(Bool),Never>{ observer, _ in
+                self?.requestSymbolList(observer: observer,isUp:isUp)
+            }
+        }
+        
+        insertProductUserAction = Action<(String),(Bool),Never> {[weak self] symbol in
+            return SignalProducer<(Bool),Never>{ observer, _ in
+                self?.requestInsertProductUser(observer: observer,symbol:symbol)
+            }
+        }
+        
+        deleteProductUserAction = Action<(String),(Bool),Never> {[weak self] symbol in
+            return SignalProducer<(Bool),Never>{ observer, _ in
+                self?.requestDeleteProductUser(observer: observer,symbol:symbol)
+            }
+        }
+    }
+    
+    override func webSocketdidReceive(nofi: NSNotification) {
+       // self.webSocketdidReceiveDataTreating(nofi: nofi)
+    }
+}
+
+extension MarketSearchViewModel {
+    //获取自选产品列表
+    func netUserList() {
+        if OperationalUserInfoData.getLogin(){
+            userListAction.apply().start()
+        }
+    }
+
+    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) ?? "")
+                }
+                
+                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 netProductHotList() {
+        productHotListAction.apply().start()
+    }
+    
+    func requestProductHotList(observer: Signal<(Bool),Never>.Observer) -> Void {
+        let queue = DispatchQueue.init(label: "ProductHotList")
+        let group = DispatchGroup()
+        
+        queue.async(group: group, execute: {
+            group.enter()
+            let param:[String:Any] = [
+                "market":"CN",
+                "pageNum":"1",
+                "pageSize":"5"
+            ]
+            NetWork.NetWorkInstance.requestData(requestType:.Post, URLString:netForGetProductHotList,parameters:param, success: {[weak self] (errno,result) in
+                if let list:[NSDictionary] = result?["list"] as? [NSDictionary] {
+                    self?.cnProductHotList.removeAll()
+                    for dict in list{
+                        let model = ProductHotListModel.deserialize(from: dict)!
+                        var ask = model.productBean.ask
+                        if conerData(ask, .MyDouble).2! == 0{
+                            ask = model.productBean.open
+                        }
+                        model.productBean.newPrice = precisionString(with: ask, precision: model.productBean.digits)
+                        let np = decimalNumber(A: model.productBean.newPrice, B: model.productBean.open, type: .Subtract, scale:model.productBean.digits)
+                        let increase = (conerData(np, .MyDouble).2!/conerData(model.productBean.open, .MyDouble).2!)*100
+                        model.productBean.increase = String(format: "%.2f",increase)
+                        self?.cnProductHotList.append(model)
+                    }
+                }else{
+                    ProgressHUD.showError(status:DataTypeErrorPrompt)
+                }
+                
+                group.leave()
+            }) { (errno,result) in
+                ProgressHUD.showError(status: result as! String)
+                group.leave()
+            }
+        })
+        
+        queue.async(group: group, execute: {
+            group.enter()
+            let param:[String:Any] = [
+                "market":"HK",
+                "pageNum":"1",
+                "pageSize":"5"
+            ]
+            NetWork.NetWorkInstance.requestData(requestType:.Post, URLString:netForGetProductHotList,parameters:param, success: {[weak self] (errno,result) in
+                if let list:[NSDictionary] = result?["list"] as? [NSDictionary] {
+                    self?.hkProductHotList.removeAll()
+                    for dict in list{
+                        let model = ProductHotListModel.deserialize(from: dict)!
+                        var ask = model.productBean.ask
+                        if conerData(ask, .MyDouble).2! == 0{
+                            ask = model.productBean.open
+                        }
+                        model.productBean.newPrice = precisionString(with: ask, precision: model.productBean.digits)
+                        let np = decimalNumber(A: model.productBean.newPrice, B: model.productBean.open, type: .Subtract, scale:model.productBean.digits)
+                        let increase = (conerData(np, .MyDouble).2!/conerData(model.productBean.open, .MyDouble).2!)*100
+                        model.productBean.increase = String(format: "%.2f",increase)
+                        self?.hkProductHotList.append(model)
+                    }
+                }else{
+                    ProgressHUD.showError(status:DataTypeErrorPrompt)
+                }
+                
+                group.leave()
+            }) { (errno,result) in
+                ProgressHUD.showError(status: result as! String)
+                group.leave()
+            }
+        })
+        
+        queue.async(group: group, execute: {
+            group.enter()
+            let param:[String:Any] = [
+                "market":"US",
+                "pageNum":"1",
+                "pageSize":"5"
+            ]
+            NetWork.NetWorkInstance.requestData(requestType:.Post, URLString:netForGetProductHotList,parameters:param, success: {[weak self] (errno,result) in
+                if let list:[NSDictionary] = result?["list"] as? [NSDictionary] {
+                    self?.usProductHotList.removeAll()
+                    for dict in list{
+                        let model = ProductHotListModel.deserialize(from: dict)!
+                        var ask = model.productBean.ask
+                        if conerData(ask, .MyDouble).2! == 0{
+                            ask = model.productBean.open
+                        }
+                        model.productBean.newPrice = precisionString(with: ask, precision: model.productBean.digits)
+                        let np = decimalNumber(A: model.productBean.newPrice, B: model.productBean.open, type: .Subtract, scale:model.productBean.digits)
+                        let increase = (conerData(np, .MyDouble).2!/conerData(model.productBean.open, .MyDouble).2!)*100
+                        model.productBean.increase = String(format: "%.2f",increase)
+                        self?.usProductHotList.append(model)
+                    }
+                }else{
+                    ProgressHUD.showError(status:DataTypeErrorPrompt)
+                }
+                
+                group.leave()
+            }) { (errno,result) in
+                ProgressHUD.showError(status: result as! String)
+                group.leave()
+            }
+        })
+        
+        group.notify(queue: queue){
+            ProgressHUD.hideHud()
+            self.productHotList = [self.usProductHotList,self.hkProductHotList,self.cnProductHotList]
+            observer.send(value: true)
+            observer.sendCompleted()
+        }
+    }
+    
+    //获取交易对
+    func netSymbolList(isUp:Bool) {
+        symbolListAction.apply(isUp).start()
+    }
+    //
+    func requestSymbolList(observer: Signal< Bool, Never>.Observer,isUp:Bool) -> Void {
+        if !isUp{
+            self.pageNum = 1
+        }
+        let param : [String : Any] = [
+            
+            "pageNum" : self.pageNum,
+            "pageSize" : "20",
+            "symbol_title" : self.screenText
+        ]
+        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] {
+                if !isUp {
+                    self?.symbolList.removeAll()
+                }
+                self?.pageNum += 1
+                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 str in self!.collectionList {
+                        if str == model.symbol{
+                            model.isSelect = true
+                        }
+                    }
+                    
+                    self?.symbolList.append(model)
+                    
+                }
+               
+                let isNoData:Bool = (list.count < 20) ? true : false
+                observer.send(value:isNoData)
+                
+            }else{
+                observer.send(value: false)
+                ProgressHUD.showError(status:DataTypeErrorPrompt)
+            }
+            observer.sendCompleted()
+        }) { (code, result) in
+            ProgressHUD.showError(status: result as! String)
+            observer.send(value: false)
+            observer.sendCompleted()
+        }
+        
+    }
+    
+    //添加收藏
+    func netInsertProductUser(symbol:String) {
+        if OperationalUserInfoData.getLogin(){
+            insertProductUserAction.apply(symbol).start()
+        }else{
+            currentVc()!.navigationController?.pushViewController(LoginViewController(), animated: true)
+        }
+        
+    }
+    
+    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("收藏成功"))
+            self.collectionList.append(symbol)
+            for model in self.symbolList{
+                if model.symbol == symbol{
+                    model.isCollection = true
+                }
+            }
+            observer.send(value: true)
+            observer.sendCompleted()
+        }) { (code, result) in
+            ProgressHUD.showError(status: result as! String)
+            observer.send(value: false)
+            observer.sendCompleted()
+        }
+    }
+    
+    //取消收藏
+    func netDeleteProductUser(symbol:String) {
+        if OperationalUserInfoData.getLogin(){
+            deleteProductUserAction.apply(symbol).start()
+        }else{
+            currentVc()!.navigationController?.pushViewController(LoginViewController(), animated: true)
+        }
+        
+    }
+    
+    func requestDeleteProductUser(observer: Signal< Bool, Never>.Observer,symbol:String) -> Void {
+        let parame:[String:Any] = ["symbol":symbol]
+        NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForDeleteProductUser,parameters: parame, success: { (code, result) in
+            ProgressHUD.showSuccess(status: switchLanguage("取消成功"))
+            let index = self.collectionList.firstIndex(of: symbol)
+            self.collectionList.remove(at:index!)
+            for model in self.symbolList{
+                if model.symbol == symbol{
+                    model.isCollection = false
+                }
+            }
+           
+            observer.send(value: true)
+            observer.sendCompleted()
+        }) { (code, result) in
+            ProgressHUD.showError(status: result as! String)
+            observer.send(value: false)
+            observer.sendCompleted()
+        }
+    }
+    
+    
+}

+ 2 - 2
Koala/Koala/Modular/Public/V/Base/BaseSearchView.swift

@@ -51,11 +51,11 @@ class BaseSearchView: BaseView {
         }
 
         textField.setViewLayerBorderColor(myColor: .clear, borderWidth: 0, maskBounds: 4)
-        let leftView:UIView = UIView.init(frame: CGRect(x: 0, y: 0, width: 30, height: 30))
+        let leftView:UIView = UIView.init(frame: CGRect(x: 0, y: 0, width: 40, height: 40))
         leftView.addSubview(leftBtn)
         leftBtn.snp.makeConstraints { make in
             make.edges.equalToSuperview()
-            make.width.equalTo(30)
+            make.width.equalTo(40)
         }
         textField.leftView = leftView
         textField.leftViewMode = .always

BIN
Koala/Koala/Other/Assets.xcassets/Market/Market_W_CN.imageset/CN.png


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

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

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

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

BIN
Koala/Koala/Other/Assets.xcassets/Market/Market_W_HK.imageset/HK.png


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

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

BIN
Koala/Koala/Other/Assets.xcassets/Market/Market_W_US.imageset/US.png


+ 1 - 0
Koala/Koala/Other/Assets.xcassets/Market/Market_collection.imageset/Contents.json

@@ -1,6 +1,7 @@
 {
   "images" : [
     {
+      "filename" : "路径备份 4.png",
       "idiom" : "universal",
       "scale" : "1x"
     },

+ 0 - 0
Koala/Koala/Other/Assets.xcassets/Market/Market_unCollection.imageset/路径备份 4.png → Koala/Koala/Other/Assets.xcassets/Market/Market_collection.imageset/路径备份 4.png


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


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


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

@@ -1,7 +1,6 @@
 {
   "images" : [
     {
-      "filename" : "路径备份 4.png",
       "idiom" : "universal",
       "scale" : "1x"
     },

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


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