Browse Source

交易账户数据对接

culturetown 11 months ago
parent
commit
98c48f3e83

BIN
.DS_Store


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

@@ -44,6 +44,11 @@
 		04282A422ADD10DC00CB4260 /* JDForgotPasswordView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04282A412ADD10DC00CB4260 /* JDForgotPasswordView.swift */; };
 		04282A442ADD137500CB4260 /* JDForgotPasswordCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04282A432ADD137500CB4260 /* JDForgotPasswordCell.swift */; };
 		04282A472ADD3D1900CB4260 /* JDTradeMainMenuCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04282A462ADD3D1900CB4260 /* JDTradeMainMenuCell.swift */; };
+		0452C27D2AE226E700B63048 /* JXPagingMainTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0452C2762AE226E700B63048 /* JXPagingMainTableView.swift */; };
+		0452C27E2AE226E700B63048 /* JXPagingSmoothView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0452C2772AE226E700B63048 /* JXPagingSmoothView.swift */; };
+		0452C27F2AE226E700B63048 /* JXPagingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0452C2782AE226E700B63048 /* JXPagingView.swift */; };
+		0452C2802AE226E700B63048 /* JXPagingListRefreshView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0452C2792AE226E700B63048 /* JXPagingListRefreshView.swift */; };
+		0452C2812AE226E700B63048 /* JXPagingListContainerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0452C27A2AE226E700B63048 /* JXPagingListContainerView.swift */; };
 		04B46A8D2AD7BEA700421177 /* JDMineModifyNickNameViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B46A8C2AD7BEA700421177 /* JDMineModifyNickNameViewController.swift */; };
 		04B46A8F2AD7C67400421177 /* JDMineQrcodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B46A8E2AD7C67400421177 /* JDMineQrcodeViewController.swift */; };
 		04B46A912AD7D3BC00421177 /* JDMineModifyGenderViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B46A902AD7D3BC00421177 /* JDMineModifyGenderViewController.swift */; };
@@ -873,6 +878,11 @@
 		04282A412ADD10DC00CB4260 /* JDForgotPasswordView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JDForgotPasswordView.swift; sourceTree = "<group>"; };
 		04282A432ADD137500CB4260 /* JDForgotPasswordCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JDForgotPasswordCell.swift; sourceTree = "<group>"; };
 		04282A462ADD3D1900CB4260 /* JDTradeMainMenuCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JDTradeMainMenuCell.swift; sourceTree = "<group>"; };
+		0452C2762AE226E700B63048 /* JXPagingMainTableView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JXPagingMainTableView.swift; sourceTree = "<group>"; };
+		0452C2772AE226E700B63048 /* JXPagingSmoothView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JXPagingSmoothView.swift; sourceTree = "<group>"; };
+		0452C2782AE226E700B63048 /* JXPagingView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JXPagingView.swift; sourceTree = "<group>"; };
+		0452C2792AE226E700B63048 /* JXPagingListRefreshView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JXPagingListRefreshView.swift; sourceTree = "<group>"; };
+		0452C27A2AE226E700B63048 /* JXPagingListContainerView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JXPagingListContainerView.swift; sourceTree = "<group>"; };
 		04B46A8C2AD7BEA700421177 /* JDMineModifyNickNameViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JDMineModifyNickNameViewController.swift; sourceTree = "<group>"; };
 		04B46A8E2AD7C67400421177 /* JDMineQrcodeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JDMineQrcodeViewController.swift; sourceTree = "<group>"; };
 		04B46A902AD7D3BC00421177 /* JDMineModifyGenderViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JDMineModifyGenderViewController.swift; sourceTree = "<group>"; };
@@ -1674,6 +1684,18 @@
 			path = M;
 			sourceTree = "<group>";
 		};
+		0452C2752AE226E700B63048 /* JXPagingView */ = {
+			isa = PBXGroup;
+			children = (
+				0452C2762AE226E700B63048 /* JXPagingMainTableView.swift */,
+				0452C2772AE226E700B63048 /* JXPagingSmoothView.swift */,
+				0452C2782AE226E700B63048 /* JXPagingView.swift */,
+				0452C2792AE226E700B63048 /* JXPagingListRefreshView.swift */,
+				0452C27A2AE226E700B63048 /* JXPagingListContainerView.swift */,
+			);
+			path = JXPagingView;
+			sourceTree = "<group>";
+		};
 		04CEE26E2AB4310400FAA760 /* M */ = {
 			isa = PBXGroup;
 			children = (
@@ -1783,6 +1805,7 @@
 		04D38E252A9EE8A10047EF9C /* JXSegmentedView */ = {
 			isa = PBXGroup;
 			children = (
+				0452C2752AE226E700B63048 /* JXPagingView */,
 				04D38E262A9EE8A10047EF9C /* TitleOrImage */,
 				04D38E2A2A9EE8A10047EF9C /* Core */,
 				04D38E302A9EE8A10047EF9C /* Indicator */,
@@ -4215,6 +4238,7 @@
 				6C00A99D24334E3D00CE9ADB /* SaveData.swift in Sources */,
 				6CD5EB7629D9BBDB0053325F /* LanguageSelectPopView.swift in Sources */,
 				6C4AFAC22998E90B00508EA7 /* WithdrawalsAddressPopView.swift in Sources */,
+				0452C2812AE226E700B63048 /* JXPagingListContainerView.swift in Sources */,
 				6C4AFAC7299A7A3500508EA7 /* AddAddressViewController.swift in Sources */,
 				6C00A910242D918D00CE9ADB /* FiledMacro.swift in Sources */,
 				6CC37FE4298FB0500079FA5C /* AssetsFinanceView.swift in Sources */,
@@ -4397,6 +4421,7 @@
 				6CBB630C2ADA78030045A4C9 /* MDFinanceCell.swift in Sources */,
 				6C00A877242D8FEA00CE9ADB /* AppDelegate.swift in Sources */,
 				6CBB62DB2AD828550045A4C9 /* MDNewsView.swift in Sources */,
+				0452C27D2AE226E700B63048 /* JXPagingMainTableView.swift in Sources */,
 				04CEE2B82ABD3ACA00FAA760 /* JDWorkOrderDetailViewController.swift in Sources */,
 				6CA713552959F8F30047F450 /* ForgotPasswordCell.swift in Sources */,
 				6C00A8F5242D918D00CE9ADB /* ESTabBarController.swift in Sources */,
@@ -4424,7 +4449,9 @@
 				6CC37FF9299286520079FA5C /* AssetsSavingHeaderView.swift in Sources */,
 				6C7A1AD029F2D5B0004CFBE3 /* AssetsDealSetDefaultPopView.swift in Sources */,
 				6CBB62C32AD588260045A4C9 /* MarketHeaderView.swift in Sources */,
+				0452C27E2AE226E700B63048 /* JXPagingSmoothView.swift in Sources */,
 				6C4AFB3529A7B5D700508EA7 /* MessageView.swift in Sources */,
+				0452C27F2AE226E700B63048 /* JXPagingView.swift in Sources */,
 				6C00A903242D918D00CE9ADB /* UIView+CategoryClass.swift in Sources */,
 				04D38E5D2A9EE8A10047EF9C /* JXSegmentedTitleOrImageCell.swift in Sources */,
 				6C00A909242D918D00CE9ADB /* OperationalNetworkData.swift in Sources */,
@@ -4558,6 +4585,7 @@
 				6C00A9572432F43600CE9ADB /* LBXScanLineAnimation.swift in Sources */,
 				6CA7131529572CBC0047F450 /* LoginViewController.swift in Sources */,
 				6C00A915242D918D00CE9ADB /* PublicMethod.swift in Sources */,
+				0452C2802AE226E700B63048 /* JXPagingListRefreshView.swift in Sources */,
 				6CA7131A29572DD70047F450 /* LoginView.swift in Sources */,
 				6CBB63162ADAEE880045A4C9 /* MDIndicatorCell.swift in Sources */,
 				04CEE2AC2ABC3B6100FAA760 /* JDWorkOrderListViewController.swift in Sources */,

+ 1 - 1
Koala/Koala.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -7,7 +7,7 @@
 		<key>Koala.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>16</integer>
+			<integer>17</integer>
 		</dict>
 	</dict>
 </dict>

BIN
Koala/Koala.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate


+ 26 - 26
Koala/Koala.xcworkspace/xcuserdata/mac.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -112,7 +112,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "378"
             endingLineNumber = "378"
-            landmarkName = "resetProductGroup()"
+            landmarkName = "requestSymbolList(observer:isUp:)"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -144,8 +144,8 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "220"
             endingLineNumber = "220"
-            landmarkName = "requestSymbolList(observer:)"
-            landmarkType = "7">
+            landmarkName = "MarketViewModel"
+            landmarkType = "21">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -160,7 +160,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "200"
             endingLineNumber = "200"
-            landmarkName = "requestSymbolList(observer:)"
+            landmarkName = "initialize()"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -288,7 +288,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "341"
             endingLineNumber = "341"
-            landmarkName = "requestUpdateSubscribeAction(observer:)"
+            landmarkName = "requestCollectionSymbolList(observer:)"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -304,7 +304,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "340"
             endingLineNumber = "340"
-            landmarkName = "requestUpdateSubscribeAction(observer:)"
+            landmarkName = "requestCollectionSymbolList(observer:)"
             landmarkType = "7">
             <Locations>
                <Location
@@ -352,7 +352,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "477"
             endingLineNumber = "477"
-            landmarkName = "screenSymbolListAction()"
+            landmarkName = "requestDeleteProductUser(observer:symbol:)"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -368,7 +368,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "322"
             endingLineNumber = "322"
-            landmarkName = "netUpdateSubscribes()"
+            landmarkName = "requestUserList(observer:)"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -384,7 +384,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "396"
             endingLineNumber = "396"
-            landmarkName = "screenSymbolListAction()"
+            landmarkName = "requestSymbolList(observer:isUp:)"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -496,8 +496,8 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "120"
             endingLineNumber = "120"
-            landmarkName = "webSocketdidReceive(nofi:)"
-            landmarkType = "7">
+            landmarkName = "increaseSort"
+            landmarkType = "24">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -727,48 +727,48 @@
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            uuid = "334645D6-45C7-4FA8-88AC-E650C2E607DF"
+            uuid = "36113AAA-2DF6-4D20-9DA3-2B4C638A820B"
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "Koala/Modular/JDTrade/V/JDTradeDealListCell.swift"
+            filePath = "Koala/Modular/JDMine/VC/JDMineViewController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "149"
-            endingLineNumber = "149"
-            landmarkName = "setupCellByPositionModel(model:)"
+            startingLineNumber = "125"
+            endingLineNumber = "125"
+            landmarkName = "netForGetAccouontInfo()"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            uuid = "36113AAA-2DF6-4D20-9DA3-2B4C638A820B"
+            uuid = "01297C5D-C3D5-4B8B-A254-958BCEFB3B27"
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "Koala/Modular/JDMine/VC/JDMineViewController.swift"
+            filePath = "Koala/Modular/JDMine/VC/JDDepositRecordsViewController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "125"
-            endingLineNumber = "125"
-            landmarkName = "netForGetAccouontInfo()"
+            startingLineNumber = "237"
+            endingLineNumber = "237"
+            landmarkName = "netWithdrawRecordList()"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            uuid = "01297C5D-C3D5-4B8B-A254-958BCEFB3B27"
+            uuid = "DA107451-1C77-493F-B053-2314AED50F83"
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "Koala/Modular/JDMine/VC/JDDepositRecordsViewController.swift"
+            filePath = "Koala/Modular/JDTrade/VC/JDTradeAccountHoldViewController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "237"
-            endingLineNumber = "237"
-            landmarkName = "netWithdrawRecordList()"
+            startingLineNumber = "126"
+            endingLineNumber = "126"
+            landmarkName = "requestHoldSymbolList()"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>

BIN
Koala/Koala/FX/OtherClass/.DS_Store


+ 1 - 1
Koala/Koala/Modular/JDTrade/V/JDTradeAccountCell.swift

@@ -73,7 +73,7 @@ class JDTradeAccountCell: UITableViewCell {
         v.textColor = UIColor.pg_color(withHexString: "878787")
         v.font = .systemFont(ofSize: 12)
         v.textAlignment = .right
-        v.text = "+0.89%"
+        v.text = "+0.00%"
         return v
     }()
     

+ 1 - 1
Koala/Koala/Modular/JDTrade/V/JDTradeAccountInfoHeaderView.swift

@@ -377,7 +377,7 @@ extension JDTradeAccountInfoHeaderView {
             assetTipLb.text = "资产净值(USD)"
         }
         
-        assetLb.text = model.balance
+        assetLb.text = precisionString(with: model.balance, precision: "2")
         jyLb.text = precisionString(with: model.balance, precision: "2")
         djLb.text = precisionString(with: model.margin, precision: "2")
         kyLb.text = precisionString(with: model.margin_free, precision: "2")

+ 50 - 2
Koala/Koala/Modular/JDTrade/V/JDTradeDealListCell.swift

@@ -27,7 +27,7 @@ class JDTradeDealListCell: BaseTableViewCell {
         v.textColor = _color("#333333&#333333")
         v.setTextFont(.PFSR, 14)
 
-        v.text = "1"
+        v.text = ""
         return v
     }()
     
@@ -57,7 +57,7 @@ class JDTradeDealListCell: BaseTableViewCell {
         
         v.textColor = _color("#AEAEAE&#AEAEAE")
         v.setTextFont(.PFSR, 12)
-        v.text = "100"
+        v.text = ""
         return v
     }()
     
@@ -80,6 +80,11 @@ class JDTradeDealListCell: BaseTableViewCell {
         return v
     }()
     
+    lazy var lineView : UIView = {
+        let v = UIView()
+        v.backgroundColor = _color("#EDEDED&#EDEDED")
+        return v
+    }()
     
     
     
@@ -131,6 +136,14 @@ class JDTradeDealListCell: BaseTableViewCell {
             make.right.equalTo(contentView.snp.right).offset(-17)
         }
         
+        contentView.addSubview(lineView)
+        lineView.snp.makeConstraints { make in
+            make.left.equalTo(contentView.snp.left).offset(17)
+            make.right.equalTo(contentView.snp.right).offset(-17)
+            make.bottom.equalTo(contentView.snp.bottom)
+            make.height.equalTo(1)
+        }
+        
     }
     
     required init?(coder aDecoder: NSCoder) {
@@ -147,6 +160,9 @@ extension JDTradeDealListCell {
         nameLb.text = model.title
         codeLb.text = model.symbol
         
+        unitLb.text = "1"
+        countLb.text = model.volume
+        
         nowPriceLb.text = precisionString(with: model.close_price, precision: "2")
         buyPriceLb.text = precisionString(with: model.open_price, precision: "2")
         
@@ -154,5 +170,37 @@ extension JDTradeDealListCell {
         
     }
     
+    func setupCellByHistoryModel(model : JDPositionModel) ->Void{
+        
+        
+        nameLb.text = model.title
+        codeLb.text = model.symbol
+        
+        unitLb.text = model.volume
+        buyPriceLb.text = precisionString(with: model.close_price, precision: "2")
+        nowPriceLb.text = precisionString(with: model.open_price, precision: "2")
+        
+        updownLb.text = precisionString(with: model.profit, precision: "2")
+        
+    }
+    
+    
+    
+    func setupCellByEntrustModel(model : JDPositionModel) ->Void{
+        
+        
+        nameLb.text = model.title
+        codeLb.text = model.symbol
+        
+        unitLb.text = precisionString(with: model.close_price, precision: "2")
+        countLb.text = model.volume
+        
+        nowPriceLb.text = precisionString(with: model.open_price, precision: "2")
+//        buyPriceLb.text = precisionString(with: model.open_price, precision: "2")
+        
+        updownLb.text = switchLanguage("低价买入")// precisionString(with: model.profit, precision: "2")
+        
+    }
+    
     
 }

+ 1 - 1
Koala/Koala/Modular/JDTrade/VC/JDDealViewController.swift

@@ -148,7 +148,7 @@ extension JDDealViewController: JXSegmentedListContainerViewDataSource {
         
 //        return  MatchFantasyViewController(matchId: self.matchId)
         
-        return JDTradeAccountHoldViewController()
+        return JDTradeAccountHoldViewController() as! JXSegmentedListContainerViewListDelegate
     }
 }
 

+ 193 - 63
Koala/Koala/Modular/JDTrade/VC/JDTradeAccountDetailViewController.swift

@@ -13,12 +13,39 @@ class JDTradeAccountDetailViewController: BaseViewController {
     
     var accountModel : JDTradeAccountModel = JDTradeAccountModel()
     
+    
+    var JXTableHeaderViewHeight: Int = 400
+    var JXheightForHeaderInSection: Int = 50
+    
     override func viewDidLoad() {
         super.viewDidLoad()
         self.myNavigationBar.isHidden = true
         self.setup()
     }
     
+    lazy var holdVC : JDTradeAccountHoldViewController = {
+        let vc = JDTradeAccountHoldViewController()
+        vc.accountModel = self.accountModel
+        return vc
+        
+    }()
+    
+    lazy var positionVC : JDTradeAccountPositionViewController = {
+        
+        let vc = JDTradeAccountPositionViewController()
+        vc.accountModel = self.accountModel
+        
+        return vc
+    }()
+    
+    lazy var historyVC : JDTradeAccountHistoryOrderViewController = {
+        
+        let vc = JDTradeAccountHistoryOrderViewController()
+        vc.accountModel = self.accountModel
+        return vc
+    }()
+    
+    
     
 
    lazy var accountHeaderView: JDTradeAccountInfoHeaderView = {
@@ -28,29 +55,24 @@ class JDTradeAccountDetailViewController: BaseViewController {
         return v
     }()
     
+    var pagingView: JXPagingView!
     
     var segmentedDataSource: JXSegmentedBaseDataSource?
-    let segmentedView = JXSegmentedView()
+    let segmentedView = JXSegmentedView(frame: CGRectMake(0, 0, 200, 50)) //JXSegmentedView()
     
     
-    let titles = ["持仓","挂单","历史订单"]
-    
-    lazy var listContainerView: JXSegmentedListContainerView! = {
-        return JXSegmentedListContainerView(dataSource: self)
-    }()
+    let titles = [switchLanguage("持仓"),switchLanguage("挂单"),switchLanguage("历史订单")]
     
     fileprivate func setup(){
-        
-    
-        
+
         view.addSubview(accountHeaderView)
         
         
-        listContainerView.frame = CGRect(x: 0, y: 450, width: view.bounds.size.width, height: view.bounds.size.height - 50 - 450 )
+//        listContainerView.frame = CGRect(x: 0, y: 450, width: view.bounds.size.width, height: view.bounds.size.height - 50 - 450 )
         
         let dataSource = JXSegmentedTitleDataSource()
         dataSource.isTitleColorGradientEnabled = true
-        dataSource.titleNormalColor = UIColor.pg_color(withHexString: "333333") //UIColor.init(hexString: "333333") ?? .black
+        dataSource.titleNormalColor = _color("#333333&#333333") //UIColor.init(hexString: "333333") ?? .black
         dataSource.titleSelectedColor = .black//UIColor.pg_color(withHexString: "FF6F30") // UIColor.init(hexString: "DC3C23") ?? .black
         dataSource.titleNormalFont = UIFont.systemFont(ofSize: 16)
         dataSource.titleSelectedFont = UIFont.boldSystemFont(ofSize: 18)
@@ -58,86 +80,194 @@ class JDTradeAccountDetailViewController: BaseViewController {
         dataSource.titles = titles
         segmentedDataSource = dataSource
         
-        //配置指示器
-//        let indicator = JXSegmentedIndicatorLineView()
-//        indicator.indicatorWidth = JXSegmentedViewAutomaticDimension
-//
-//        indicator.indicatorColor = UIColor.pg_color(withHexString: "FF6F30") //UIColor.init(hexString: "DC3C23") ?? .black
-//        segmentedView.indicators = [indicator]
-        
         segmentedView.dataSource = self.segmentedDataSource
         
-        segmentedView.delegate = self
         segmentedView.backgroundColor  = .white //UIColor.init(hexString: "E5E5E5")
         
-        view.addSubview(segmentedView)
-        segmentedView.snp.makeConstraints { make in
-            make.left.equalTo(self.view)
-            make.width.equalTo(200)
-            make.top.equalTo(self.accountHeaderView.snp.bottom)
-            make.height.equalTo(50)
+        
+        pagingView = JXPagingView(delegate: self)
+        self.view.addSubview(pagingView)
+        pagingView.snp.makeConstraints { make in
+            make.edges.equalTo(self.view)
         }
         
-        segmentedView.listContainer = listContainerView
-        listContainerView.scrollView.isScrollEnabled = true
-        view.addSubview(listContainerView)
+        segmentedView.listContainer = pagingView.listContainerView
+        
+//        view.addSubview(segmentedView)
+//        segmentedView.snp.makeConstraints { make in
+//            make.left.equalTo(self.view)
+//            make.width.equalTo(200)
+//            make.top.equalTo(self.accountHeaderView.snp.bottom)
+//            make.height.equalTo(50)
+//        }
+        
+//        segmentedView.listContainer = listContainerView
+//        listContainerView.scrollView.isScrollEnabled = true
+//        view.addSubview(listContainerView)
+//        
+//        segmentedView.reloadData()
         
-        segmentedView.reloadData()
+        self.requestEntrustList()
         
     }
     
 }
 
-
-extension JDTradeAccountDetailViewController: JXSegmentedViewDelegate {
-    public func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
-        if let dotDataSource = segmentedDataSource as? JXSegmentedDotDataSource {
-            //先更新数据源的数据
-            dotDataSource.dotStates[index] = false
-            //再调用reloadItem(at: index)
-            segmentedView.reloadItem(at: index)
-        }
+extension JDTradeAccountDetailViewController {
+    
+    
+    func requestEntrustList() ->Void {
+        
         
-        self.navigationController?.interactivePopGestureRecognizer?.isEnabled = (segmentedView.selectedIndex == 0)
+        let param = [
+            "account": self.accountModel.account ?? "" ,
+            "server" : self.accountModel.server ?? ""
+            
+        ] as [String : Any]
+        
+        
+        NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForGetPositionList,parameters: param,success: { (code, result) in
+            
+            ProgressHUD.hideHud()
+            
+            if let dict: NSDictionary = result as? NSDictionary {
+                
+                if let list: [NSDictionary] = dict["list"] as? [NSDictionary]{
+                    
+                    var totalYk : CGFloat = 0.0
+                    var totalSz : CGFloat = 0.0
+                    
+                    for dic in list {
+                        
+                        let model = JDPositionModel.deserialize(from: dic)!
+          
+                        let ykDecNumber: NSDecimalNumber = NSDecimalNumber.init(string: model.profit)
+                        let ykNumber = ykDecNumber.doubleValue
+                        
+                        totalYk += ykNumber
+                        
+                        
+                        let szDecNumber: NSDecimalNumber = NSDecimalNumber.init(string: model.close_price)
+                        let szNumber = szDecNumber.doubleValue
+                                      
+                        totalSz += szNumber
+                        
+                        
+                    }
+                    
+                    self.accountHeaderView.ykLb.text = precisionString(with: "\(totalYk)", precision: "2")
+                    self.accountHeaderView.szLb.text = precisionString(with: "\(totalSz)", precision: "2")
+                }
+            
+            }
+            
+        }) { (code, result) in
+            ProgressHUD.showError(status: result as! String)
+        }
         
     }
+    
+    
+    
+    
 }
 
-
-extension JDTradeAccountDetailViewController: JXSegmentedListContainerViewDataSource {
-    public func numberOfLists(in listContainerView: JXSegmentedListContainerView) -> Int {
-        if let titleDataSource = segmentedView.dataSource as? JXSegmentedBaseDataSource {
-            return titleDataSource.dataSource.count
-        }
-        return 0 //titles.count
+extension JDTradeAccountDetailViewController : JXPagingViewDelegate {
+    func tableHeaderViewHeight(in pagingView: JXPagingView) -> Int {
+        return JXTableHeaderViewHeight
     }
     
-    public func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
+    func tableHeaderView(in pagingView: JXPagingView) -> UIView {
+        return self.accountHeaderView
+        
+    }
+    
+    func heightForPinSectionHeader(in pagingView: JXPagingView) -> Int {
+        return JXheightForHeaderInSection
+    }
+    
+    func viewForPinSectionHeader(in pagingView: JXPagingView) -> UIView {
+        let v = UIView(frame: CGRectMake(0, 0, SCREEN_WIDTH, 50))
+        v.addSubview(segmentedView)
+        
+        return v
+    }
+    
+    func numberOfLists(in pagingView: JXPagingView) -> Int {
+        return titles.count
+    }
+    
+    func pagingView(_ pagingView: JXPagingView, initListAtIndex index: Int) -> JXPagingViewListViewDelegate {
         
         if index == 0 {
-            
-            let vc = JDTradeAccountHoldViewController()
-            vc.accountModel = self.accountModel
-            return vc
-            
+            return holdVC
         } else if index == 1 {
-            
-            let vc = JDTradeAccountPositionViewController()
-            vc.accountModel = self.accountModel
-            return vc
-            
+            return positionVC
         }else {
-                
-            let vc = JDTradeAccountHistoryOrderViewController()
-            vc.accountModel = self.accountModel
-            
-            return vc
-    
+            return historyVC
         }
+        
+    }
     
+    func pagingView(_ pagingView: JXPagingView, mainTableViewDidScroll scrollView: UIScrollView) {
+        
     }
+
 }
 
+
+extension JXPagingListContainerView : JXSegmentedViewListContainer{}
+
+//
+//extension JDTradeAccountDetailViewController: JXSegmentedViewDelegate {
+//    public func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
+//        if let dotDataSource = segmentedDataSource as? JXSegmentedDotDataSource {
+//            //先更新数据源的数据
+//            dotDataSource.dotStates[index] = false
+//            //再调用reloadItem(at: index)
+//            segmentedView.reloadItem(at: index)
+//        }
+//
+//        self.navigationController?.interactivePopGestureRecognizer?.isEnabled = (segmentedView.selectedIndex == 0)
+//
+//    }
+//}
+
+
+//extension JDTradeAccountDetailViewController: JXSegmentedListContainerViewDataSource {
+//    public func numberOfLists(in listContainerView: JXSegmentedListContainerView) -> Int {
+//        if let titleDataSource = segmentedView.dataSource as? JXSegmentedBaseDataSource {
+//            return titleDataSource.dataSource.count
+//        }
+//        return 0 //titles.count
+//    }
+//
+//    public func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
+//
+//        if index == 0 {
+//
+//            let vc = JDTradeAccountHoldViewController()
+//            vc.accountModel = self.accountModel
+//            return vc
+//
+//        } else if index == 1 {
+//
+//            let vc = JDTradeAccountPositionViewController()
+//            vc.accountModel = self.accountModel
+//            return vc
+//
+//        }else {
+//
+//            let vc = JDTradeAccountHistoryOrderViewController()
+//            vc.accountModel = self.accountModel
+//
+//            return vc
+//
+//        }
+//
+//    }
+//}
+
 extension JDTradeAccountDetailViewController: JXSegmentedListContainerViewListDelegate {
     func listView() -> UIView {
         return view

+ 105 - 51
Koala/Koala/Modular/JDTrade/VC/JDTradeAccountHistoryOrderViewController.swift

@@ -18,12 +18,12 @@ class JDTradeAccountHistoryOrderViewController: BaseViewController {
     
     var startDate:String = dateToString(stmap: decimalNumber(A:currentTimeStamp(), B: "86400", type: .Subtract) , formatter: "yyyy-MM-dd"){
         didSet{
-//            self.netGetCloseOrderList()
+            //            self.netGetCloseOrderList()
         }
     }
     var endDate:String = dateToString(stmap: currentTimeStamp(), formatter: "yyyy-MM-dd"){
         didSet{
-//            self.netGetCloseOrderList()
+            //            self.netGetCloseOrderList()
         }
     }
     
@@ -32,13 +32,57 @@ class JDTradeAccountHistoryOrderViewController: BaseViewController {
         return arr
     }()
     
+    var totalLrStr : String = "0"
+    
+    var scrollCallback:((UIScrollView) ->Void)?
+    
+    
+    lazy var dateView : JDHistoryDateSegmentView = {
+        let dateView:JDHistoryDateSegmentView = JDHistoryDateSegmentView.init(frame: CGRect(x: 0, y: 0, width: SCREEN_WIDTH, height: 40))
+        dateView.segmentedControl.indexChangeBlock = {[weak self](index) in
+            guard let self = self else{return}
+            if index == 0 {
+                self.startDate = dateToString(stmap: decimalNumber(A:currentTimeStamp(), B: "86400", type: .Subtract) , formatter: "yyyy-MM-dd")
+                self.endDate = ""
+            }
+            else if index == 1{
+                self.startDate = dateToString(stmap: decimalNumber(A:currentTimeStamp(), B: "604800", type: .Subtract) , formatter: "yyyy-MM-dd")
+                self.endDate = ""
+            }
+            else if index == 2{
+                self.startDate = dateToString(stmap: decimalNumber(A:currentTimeStamp(), B: "2592000", type: .Subtract) , formatter: "yyyy-MM-dd")
+                self.endDate = ""
+            }else if index == 3{
+                let pop = PositionHistoryDatePopView()
+                if self.dateStr.0.length == 0 {
+                    self.dateStr.0 = dateToString(stmap:currentTimeStamp(),formatter: "yyyy-MM-dd")
+                    self.dateStr.1 = dateToString(stmap:currentTimeStamp(),formatter: "yyyy-MM-dd")
+                }
+                pop.showPopupView(date: self.dateStr) { dateStr in
+                    self.dateStr = dateStr
+                    self.endDate = dateStr.1
+                    self.startDate = dateStr.0
+                    self.netGetCloseOrderList()
+                }
+            }
+            
+            self.netGetCloseOrderList()
+            
+        }
+        
+        return dateView
+    }()
+    
+    
+    
+    
     lazy var tableView : UITableView = {
         
         let v = UITableView(frame: .zero, style: .plain)
         v.delegate = self
         v.dataSource = self
-        v.separatorStyle = .singleLine
-//        v.register(UINib.init(nibName: "DealListCell", bundle: nil), forCellReuseIdentifier: "DealListCell")
+        v.separatorStyle = .none
+        //        v.register(UINib.init(nibName: "DealListCell", bundle: nil), forCellReuseIdentifier: "DealListCell")
         
         v.register(JDTradeDealListCell.self, forCellReuseIdentifier: JDTradeDealListCell.description())
         return v
@@ -95,7 +139,7 @@ extension JDTradeAccountHistoryOrderViewController {
         
         
         NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForGetCloseOrderList,parameters: param,success: { (code, result) in
-        
+            
             ProgressHUD.hideHud()
             
             if let dict: NSDictionary = result as? NSDictionary {
@@ -112,6 +156,26 @@ extension JDTradeAccountHistoryOrderViewController {
                     }
                 }
                 
+                
+                var totalLr : CGFloat = 0.0
+                
+                if self.orderList.count > 0 {
+                
+                    for model in self.orderList {
+                    
+                        let ykDecNumber: NSDecimalNumber = NSDecimalNumber.init(string: model.profit)
+                        
+                        let ykNumber = ykDecNumber.doubleValue
+                        
+                        totalLr += ykNumber
+                        
+                    }
+                    
+                    self.totalLrStr = "\(totalLr)"
+                    
+                }
+                
+                
                 self.tableView.reloadData()
             }
         }) { (code, result) in
@@ -133,43 +197,14 @@ extension JDTradeAccountHistoryOrderViewController: UITableViewDelegate,UITableV
     func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
         
         let headerView = UIView(frame: CGRect(x: 0, y: 0, width: SCREEN_WIDTH, height: 70))
+        headerView.backgroundColor = .white
         
-        let dateView:JDHistoryDateSegmentView = JDHistoryDateSegmentView.init(frame: CGRect(x: 0, y: 0, width: SCREEN_WIDTH, height: 40))
-        dateView.segmentedControl.indexChangeBlock = {[weak self](index) in
-            guard let self = self else{return}
-            if index == 0 {
-                self.startDate = dateToString(stmap: decimalNumber(A:currentTimeStamp(), B: "86400", type: .Subtract) , formatter: "yyyy-MM-dd")
-                
-                
-            }
-            else if index == 1{
-                self.startDate = dateToString(stmap: decimalNumber(A:currentTimeStamp(), B: "604800", type: .Subtract) , formatter: "yyyy-MM-dd")
-            }
-            else if index == 2{
-                self.startDate = dateToString(stmap: decimalNumber(A:currentTimeStamp(), B: "2592000", type: .Subtract) , formatter: "yyyy-MM-dd")
-            }else if index == 3{
-                let pop = PositionHistoryDatePopView()
-                if self.dateStr.0.length == 0 {
-                    self.dateStr.0 = dateToString(stmap:currentTimeStamp(),formatter: "yyyy-MM-dd")
-                    self.dateStr.1 = dateToString(stmap:currentTimeStamp(),formatter: "yyyy-MM-dd")
-                }
-                pop.showPopupView(date: self.dateStr) { dateStr in
-                    self.dateStr = dateStr
-                    self.endDate = dateStr.1
-                    self.startDate = dateStr.0
-                   
-                }
-            }
-            
-            self.netGetCloseOrderList()
-            
-        }
         headerView.addSubview(dateView)
         
         
         let view = UIView(frame: CGRect(x: 0, y: 40, width: SCREEN_WIDTH, height: 40))
         headerView.addSubview(view)
-       
+        
         let codeLb = UILabel()
         codeLb.font = .systemFont(ofSize: 12)
         codeLb.textColor = UIColor.pg_color(withHexString: "AEAEAE")
@@ -180,13 +215,13 @@ extension JDTradeAccountHistoryOrderViewController: UITableViewDelegate,UITableV
             make.centerY.equalTo(view)
             make.left.equalTo(view.snp.left).offset(18)
         }
-            
+        
         
         let countLb = UILabel()
         countLb.font = .systemFont(ofSize: 12)
         countLb.textColor = UIColor.pg_color(withHexString: "AEAEAE")
         countLb.text = "单位"
-    
+        
         view.addSubview(countLb)
         countLb.snp.makeConstraints { make in
             make.centerY.equalTo(view)
@@ -197,26 +232,26 @@ extension JDTradeAccountHistoryOrderViewController: UITableViewDelegate,UITableV
         priceLb.font = .systemFont(ofSize: 12)
         priceLb.textColor = UIColor.pg_color(withHexString: "AEAEAE")
         priceLb.text = "开仓/平仓"
-    
+        
         view.addSubview(priceLb)
         priceLb.snp.makeConstraints { make in
             make.centerY.equalTo(view)
             make.left.equalTo(view.snp.centerX).offset(20)
         }
-
+        
         let holdLb = UILabel()
         holdLb.font = .systemFont(ofSize: 12)
         holdLb.textColor = UIColor.pg_color(withHexString: "AEAEAE")
         holdLb.text = "盈亏"
-    
+        
         view.addSubview(holdLb)
         holdLb.snp.makeConstraints { make in
             make.centerY.equalTo(view)
             make.right.equalTo(view.snp.right).offset(-17)
         }
-
         
-         return headerView
+        
+        return headerView
     }
     
     func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
@@ -226,7 +261,7 @@ extension JDTradeAccountHistoryOrderViewController: UITableViewDelegate,UITableV
     func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
         
         let v = UIView(frame: CGRectMake(0, 0, SCREEN_WIDTH, 54 + 80))
-        
+        v.backgroundColor = .white
         let lrView = UIView()
         v.addSubview(lrView)
         lrView.snp.makeConstraints { make in
@@ -251,6 +286,8 @@ extension JDTradeAccountHistoryOrderViewController: UITableViewDelegate,UITableV
             make.right.equalTo(lrView.snp.right).offset(-17)
         }
         
+        totalLrLb.text = totalLrStr
+        
         let lineView = UIView()
         
         lineView.backgroundColor = _color("#F0F0F0&#F0F0F0")
@@ -269,7 +306,7 @@ extension JDTradeAccountHistoryOrderViewController: UITableViewDelegate,UITableV
             make.height.equalTo(40)
         }
         
-       
+        
         
         let jyLb = UILabel()
         jyLb.setTextFont(.PFSR, 15)
@@ -281,7 +318,7 @@ extension JDTradeAccountHistoryOrderViewController: UITableViewDelegate,UITableV
             make.centerY.equalTo(jyView)
             make.left.equalTo(jyView.snp.left).offset(17)
         }
-       
+        
         jyView.addSubview(totalJyLb)
         totalJyLb.snp.makeConstraints { make in
             make.centerY.equalTo(jyView)
@@ -310,19 +347,36 @@ extension JDTradeAccountHistoryOrderViewController: UITableViewDelegate,UITableV
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
         
         let cell = tableView.dequeueReusableCell(withIdentifier: JDTradeDealListCell.description()) as! JDTradeDealListCell
-        cell.setupCellByPositionModel(model: self.orderList[indexPath.row])
+        cell.setupCellByHistoryModel(model: self.orderList[indexPath.row])
         return cell
     }
     
     func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-        return 62
+        return 70
     }
- 
+    
 }
 
-extension JDTradeAccountHistoryOrderViewController: JXSegmentedListContainerViewListDelegate {
+extension JDTradeAccountHistoryOrderViewController : JXPagingViewListViewDelegate{
     func listView() -> UIView {
-        return view
+        return self.view
+    }
+    
+    func listScrollView() -> UIScrollView {
+        return self.tableView
+    }
+    
+    func listViewDidScrollCallback(callback: @escaping (UIScrollView) -> ()) {
+        
+        self.scrollCallback = callback
+        
     }
 }
 
+//
+//extension JDTradeAccountHistoryOrderViewController: JXSegmentedListContainerViewListDelegate {
+//    func listView() -> UIView {
+//        return view
+//    }
+//}
+

+ 122 - 32
Koala/Koala/Modular/JDTrade/VC/JDTradeAccountHoldViewController.swift

@@ -14,6 +14,8 @@ class JDTradeAccountHoldViewController: BaseViewController {
     
     var accountModel : JDTradeAccountModel?
     
+    var scrollCallback:((UIScrollView) ->Void)?
+    
     lazy var positionList:[JDPositionModel] = {
         let arr:[JDPositionModel] = [JDPositionModel]()
         return arr
@@ -24,7 +26,7 @@ class JDTradeAccountHoldViewController: BaseViewController {
         let v = UITableView(frame: .zero, style: .plain)
         v.delegate = self
         v.dataSource = self
-        v.separatorStyle = .singleLine
+        v.separatorStyle = .none
         
         v.register(JDTradeDealListCell.self, forCellReuseIdentifier: JDTradeDealListCell.description())
         v.ly_emptyView = emptyView
@@ -89,6 +91,9 @@ extension JDTradeAccountHoldViewController {
                         self.positionList.append(model)
                         
                     }
+                    
+                    self.requestHoldSymbolList()
+                    self.requestUpdateSubscribeAction()
                 }
                 
                 self.tableView.reloadData()
@@ -101,6 +106,85 @@ extension JDTradeAccountHoldViewController {
     }
     
     
+    func requestHoldSymbolList(){
+        
+        var symbolAry : [String] = [String]()
+        
+        if self.positionList.count > 0 {
+            
+            for model in self.positionList {
+                
+                symbolAry.append(model.symbol)
+                
+            }
+        
+            let param : [String: Any] = [
+                "symbol" : getJSONStringFromArray(array: symbolAry as NSArray)
+            ]
+            
+            NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForHomeSymbolList, parameters: param) { code , result in
+                
+                if let list:[NSDictionary] = result?["list"] as? [NSDictionary] {
+                 
+                    for dic in list {
+                        let model = KSymbolModel.deserialize(from: dic)
+                        
+                        for positionModel in self.positionList {
+                            
+                            if model?.symbol == positionModel.symbol {
+                                
+                                positionModel.title = model?.title
+                            }
+                        }
+                        
+                    }
+
+                    self.tableView.reloadData()
+                    
+                }else{
+              
+                    ProgressHUD.showError(status:DataTypeErrorPrompt)
+                }
+                
+                
+            } failured: { code, result in
+                
+                ProgressHUD.showError(status: result as! String)
+            }
+
+        }
+        
+    }
+    
+    func requestUpdateSubscribeAction() -> Void  {
+        
+        var symbols : [String] = []
+        for model in self.positionList {
+            
+            symbols.append(model.symbol)
+            
+        }
+    
+        let param : [String: Any] = [
+            "symbol" : getJSONStringFromArray(array: symbols as NSArray)
+        ]
+        
+        
+       
+        print("symbols : \(param)")
+        NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netUpdateSubscribe, parameters: param) { (code, result) in
+        
+            
+        } failured: {  (code, result) in
+          
+            ProgressHUD.showError(status: result as! String)
+  
+        }
+
+        
+    }
+    
+    
 }
 
 
@@ -113,12 +197,12 @@ extension JDTradeAccountHoldViewController: UITableViewDelegate,UITableViewDataS
     func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
         
         let view = UIView(frame: CGRect(x: 0, y: 0, width: SCREEN_WIDTH, height: 40))
-        
+        view.backgroundColor = .white
         
         let codeLb = UILabel()
-        codeLb.font = .systemFont(ofSize: 12)
-        codeLb.textColor = UIColor.pg_color(withHexString: "AEAEAE")
-        codeLb.text = "名称代码"
+        codeLb.setTextFont(.PFSR, 12)
+        codeLb.textColor = _color("#AEAEAE&#AEAEAE")
+        codeLb.text = switchLanguage("名称代码")
         
         view.addSubview(codeLb)
         codeLb.snp.makeConstraints { make in
@@ -128,9 +212,9 @@ extension JDTradeAccountHoldViewController: UITableViewDelegate,UITableViewDataS
         
         
         let countLb = UILabel()
-        countLb.font = .systemFont(ofSize: 12)
-        countLb.textColor = UIColor.pg_color(withHexString: "AEAEAE")
-        countLb.text = "单位/数量"
+        countLb.setTextFont(.PFSR, 12)
+        countLb.textColor = _color("#AEAEAE&#AEAEAE")
+        countLb.text = switchLanguage("单位/数量")
         
         view.addSubview(countLb)
         countLb.snp.makeConstraints { make in
@@ -139,9 +223,9 @@ extension JDTradeAccountHoldViewController: UITableViewDelegate,UITableViewDataS
         }
         
         let priceLb = UILabel()
-        priceLb.font = .systemFont(ofSize: 12)
-        priceLb.textColor = UIColor.pg_color(withHexString: "AEAEAE")
-        priceLb.text = "现价/成本"
+        priceLb.setTextFont(.PFSR, 12)
+        priceLb.textColor = _color("#AEAEAE&#AEAEAE")
+        priceLb.text = switchLanguage("现价/成本")
         
         view.addSubview(priceLb)
         priceLb.snp.makeConstraints { make in
@@ -150,9 +234,9 @@ extension JDTradeAccountHoldViewController: UITableViewDelegate,UITableViewDataS
         }
         
         let holdLb = UILabel()
-        holdLb.font = .systemFont(ofSize: 12)
-        holdLb.textColor = UIColor.pg_color(withHexString: "AEAEAE")
-        holdLb.text = "持仓盈亏"
+        holdLb.setTextFont(.PFSR, 12)
+        holdLb.textColor = _color("#AEAEAE&#AEAEAE")
+        holdLb.text = switchLanguage("持仓盈亏")
         
         view.addSubview(holdLb)
         holdLb.snp.makeConstraints { make in
@@ -171,10 +255,11 @@ extension JDTradeAccountHoldViewController: UITableViewDelegate,UITableViewDataS
     func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
         
         let v = UIView(frame: CGRectMake(0, 0, SCREEN_WIDTH, 54))
+        v.backgroundColor = .white
         let tipLb = UILabel()
-        tipLb.font = .systemFont(ofSize: 12)
-        tipLb.textColor = UIColor.pg_color(withHexString: "B1B9C1")
-        tipLb.text = "证券交易服务由极度证券提供"
+        tipLb.setTextFont(.PFSR, 12)
+        tipLb.textColor = _color("#B1B9C1&#B1B9C1")
+        tipLb.text = switchLanguage("证券交易服务由极度证券提供")
         tipLb.textAlignment = .center
         v.addSubview(tipLb)
         tipLb.snp.makeConstraints { make in
@@ -189,18 +274,6 @@ extension JDTradeAccountHoldViewController: UITableViewDelegate,UITableViewDataS
     }
     
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        //        let cell:DealListCell = tableView.dequeueReusableCell(withIdentifier: "DealListCell") as! DealListCell
-        //        if self.headerView.segmentedControl.selectedSegmentIndex == 0 {
-        //            let model = self.VM?.positionList[indexPath.row]
-        //            cell.updatePositionCellWith(model: model!)
-        //        }
-        //        else if self.headerView.segmentedControl.selectedSegmentIndex == 1{
-        //            let model = self.VM?.entrustList[indexPath.row]
-        //            cell.updateEntrustCellWith(model: model!)
-        //        }else{
-        //            let model = self.VM?.closeOrderList[indexPath.row]
-        //            cell.updateCloseOrderCellWith(model: model!)
-        //        }
         
         let cell = tableView.dequeueReusableCell(withIdentifier: JDTradeDealListCell.description()) as! JDTradeDealListCell
         cell.setupCellByPositionModel(model: self.positionList[indexPath.row])
@@ -208,13 +281,30 @@ extension JDTradeAccountHoldViewController: UITableViewDelegate,UITableViewDataS
     }
     
     func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-        return 62
+        return 70
     }
     
 }
 
-extension JDTradeAccountHoldViewController: JXSegmentedListContainerViewListDelegate {
+
+extension JDTradeAccountHoldViewController : JXPagingViewListViewDelegate{
     func listView() -> UIView {
-        return view
+        return self.view
+    }
+    
+    func listScrollView() -> UIScrollView {
+        return self.tableView
+    }
+    
+    func listViewDidScrollCallback(callback: @escaping (UIScrollView) -> ()) {
+        
+        self.scrollCallback = callback
+        
     }
 }
+
+//extension JDTradeAccountHoldViewController: JXSegmentedListContainerViewListDelegate {
+//    func listView() -> UIView {
+//        return view
+//    }
+//}

+ 5 - 5
Koala/Koala/Modular/JDTrade/VC/JDTradeAccountMainViewController.swift

@@ -13,7 +13,7 @@ class JDTradeAccountMainViewController: BaseViewController {
     
     override func viewDidLoad() {
         super.viewDidLoad()
-        self.myNavigationBar.title_Label.text = "交易账户"
+        self.myNavigationBar.title_Label.text = switchLanguage("交易账户")
         
         self.setup()
     }
@@ -24,7 +24,7 @@ class JDTradeAccountMainViewController: BaseViewController {
     var accountList :  [JDTradeAccountModel] = [JDTradeAccountModel]()
     var selectIndex : Int = 0
     
-    let titles = ["港股","美股","A股通沪市","A股通深市" , "综合"]
+    let titles = [switchLanguage("港股"),switchLanguage("美股"),switchLanguage("A股通沪市"),switchLanguage("A股通深市") ,switchLanguage("综合")]
     
     lazy var listContainerView: JXSegmentedListContainerView! = {
         return JXSegmentedListContainerView(dataSource: self)
@@ -36,8 +36,8 @@ class JDTradeAccountMainViewController: BaseViewController {
         
         let dataSource = JXSegmentedTitleDataSource()
         dataSource.isTitleColorGradientEnabled = true
-        dataSource.titleNormalColor = UIColor.pg_color(withHexString: "333333") //UIColor.init(hexString: "333333") ?? .black
-        dataSource.titleSelectedColor = UIColor.pg_color(withHexString: "FF6F30") // UIColor.init(hexString: "DC3C23") ?? .black
+        dataSource.titleNormalColor = _color("#333333&#333333") //UIColor.init(hexString: "333333") ?? .black
+        dataSource.titleSelectedColor = MainBackGroundColor // UIColor.init(hexString: "DC3C23") ?? .black
         dataSource.titleNormalFont = UIFont.systemFont(ofSize: 16)
         dataSource.titleSelectedFont = UIFont.boldSystemFont(ofSize: 18)
         
@@ -48,7 +48,7 @@ class JDTradeAccountMainViewController: BaseViewController {
         let indicator = JXSegmentedIndicatorLineView()
         indicator.indicatorWidth = JXSegmentedViewAutomaticDimension
         
-        indicator.indicatorColor = UIColor.pg_color(withHexString: "FF6F30") //UIColor.init(hexString: "DC3C23") ?? .black
+        indicator.indicatorColor = MainBackGroundColor //UIColor.init(hexString: "DC3C23") ?? .black
         segmentedView.indicators = [indicator]
         
         segmentedView.dataSource = self.segmentedDataSource

+ 94 - 32
Koala/Koala/Modular/JDTrade/VC/JDTradeAccountPositionViewController.swift

@@ -14,6 +14,8 @@ class JDTradeAccountPositionViewController: BaseViewController {
     
     var accountModel : JDTradeAccountModel?
     
+    var scrollCallback:((UIScrollView) ->Void)?
+    
     lazy var positionList:[JDPositionModel] = {
         let arr:[JDPositionModel] = [JDPositionModel]()
         return arr
@@ -24,7 +26,7 @@ class JDTradeAccountPositionViewController: BaseViewController {
         let v = UITableView(frame: .zero, style: .plain)
         v.delegate = self
         v.dataSource = self
-        v.separatorStyle = .singleLine
+        v.separatorStyle = .none
         
         v.register(JDTradeDealListCell.self, forCellReuseIdentifier: JDTradeDealListCell.description())
         v.ly_emptyView = emptyView
@@ -90,6 +92,8 @@ extension JDTradeAccountPositionViewController {
                         self.positionList.append(model)
                         
                     }
+                    
+                    self.requestHoldSymbolList()
                 }
                 
                 self.tableView.reloadData()
@@ -101,6 +105,56 @@ extension JDTradeAccountPositionViewController {
         
     }
     
+    func requestHoldSymbolList(){
+        
+        var symbolAry : [String] = [String]()
+        
+        if self.positionList.count > 0 {
+            
+            for model in self.positionList {
+                
+                symbolAry.append(model.symbol)
+                
+            }
+        
+            let param : [String: Any] = [
+                "symbol" : getJSONStringFromArray(array: symbolAry as NSArray)
+            ]
+            
+            NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForHomeSymbolList, parameters: param) { code , result in
+                
+                if let list:[NSDictionary] = result?["list"] as? [NSDictionary] {
+                 
+                    for dic in list {
+                        let model = KSymbolModel.deserialize(from: dic)
+                        
+                        for positionModel in self.positionList {
+                            
+                            if model?.symbol == positionModel.symbol {
+                                
+                                positionModel.title = model?.title
+                            }
+                        }
+                        
+                    }
+
+                    self.tableView.reloadData()
+                    
+                }else{
+              
+                    ProgressHUD.showError(status:DataTypeErrorPrompt)
+                }
+                
+                
+            } failured: { code, result in
+                
+                ProgressHUD.showError(status: result as! String)
+            }
+
+        }
+        
+    }
+    
     
 }
 
@@ -114,12 +168,12 @@ extension JDTradeAccountPositionViewController: UITableViewDelegate,UITableViewD
     func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
         
         let view = UIView(frame: CGRect(x: 0, y: 0, width: SCREEN_WIDTH, height: 40))
-        
+        view.backgroundColor = .white
        
         let codeLb = UILabel()
-        codeLb.font = .systemFont(ofSize: 12)
-        codeLb.textColor = UIColor.pg_color(withHexString: "AEAEAE")
-        codeLb.text = "名称代码"
+        codeLb.setTextFont(.PFSR, 12)
+        codeLb.textColor = _color("#AEAEAE&#AEAEAE")
+        codeLb.text = switchLanguage("名称代码")
         
         view.addSubview(codeLb)
         codeLb.snp.makeConstraints { make in
@@ -129,9 +183,9 @@ extension JDTradeAccountPositionViewController: UITableViewDelegate,UITableViewD
             
         
         let countLb = UILabel()
-        countLb.font = .systemFont(ofSize: 12)
-        countLb.textColor = UIColor.pg_color(withHexString: "AEAEAE")
-        countLb.text = "现价/数量"
+        countLb.setTextFont(.PFSR, 12)
+        countLb.textColor = _color("#AEAEAE&#AEAEAE")
+        countLb.text = switchLanguage("现价/数量")
     
         view.addSubview(countLb)
         countLb.snp.makeConstraints { make in
@@ -140,9 +194,9 @@ extension JDTradeAccountPositionViewController: UITableViewDelegate,UITableViewD
         }
         
         let priceLb = UILabel()
-        priceLb.font = .systemFont(ofSize: 12)
-        priceLb.textColor = UIColor.pg_color(withHexString: "AEAEAE")
-        priceLb.text = "价格"
+        priceLb.setTextFont(.PFSR, 12)
+        priceLb.textColor = _color("#AEAEAE&#AEAEAE")
+        priceLb.text = switchLanguage("价格")
     
         view.addSubview(priceLb)
         priceLb.snp.makeConstraints { make in
@@ -151,9 +205,9 @@ extension JDTradeAccountPositionViewController: UITableViewDelegate,UITableViewD
         }
 
         let holdLb = UILabel()
-        holdLb.font = .systemFont(ofSize: 12)
-        holdLb.textColor = UIColor.pg_color(withHexString: "AEAEAE")
-        holdLb.text = "方向"
+        holdLb.setTextFont(.PFSR, 12)
+        holdLb.textColor = _color("#AEAEAE&#AEAEAE")
+        holdLb.text = switchLanguage("方向")
     
         view.addSubview(holdLb)
         holdLb.snp.makeConstraints { make in
@@ -172,10 +226,11 @@ extension JDTradeAccountPositionViewController: UITableViewDelegate,UITableViewD
     func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
         
         let v = UIView(frame: CGRectMake(0, 0, SCREEN_WIDTH, 54))
+        v.backgroundColor = .white
         let tipLb = UILabel()
-        tipLb.font = .systemFont(ofSize: 12)
-        tipLb.textColor = UIColor.pg_color(withHexString: "B1B9C1")
-        tipLb.text = "证券交易服务由极度证券提供"
+        tipLb.setTextFont(.PFSR, 12)
+        tipLb.textColor = _color("#B1B9C1&#B1B9C1")
+        tipLb.text = switchLanguage("证券交易服务由极度证券提供")
         tipLb.textAlignment = .center
         v.addSubview(tipLb)
         tipLb.snp.makeConstraints { make in
@@ -190,26 +245,16 @@ extension JDTradeAccountPositionViewController: UITableViewDelegate,UITableViewD
     }
     
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-//        let cell:DealListCell = tableView.dequeueReusableCell(withIdentifier: "DealListCell") as! DealListCell
-//        if self.headerView.segmentedControl.selectedSegmentIndex == 0 {
-//            let model = self.VM?.positionList[indexPath.row]
-//            cell.updatePositionCellWith(model: model!)
-//        }
-//        else if self.headerView.segmentedControl.selectedSegmentIndex == 1{
-//            let model = self.VM?.entrustList[indexPath.row]
-//            cell.updateEntrustCellWith(model: model!)
-//        }else{
-//            let model = self.VM?.closeOrderList[indexPath.row]
-//            cell.updateCloseOrderCellWith(model: model!)
-//        }
         
         let cell = tableView.dequeueReusableCell(withIdentifier: JDTradeDealListCell.description()) as! JDTradeDealListCell
+        cell.setupCellByEntrustModel(model: self.positionList[indexPath.row])
+        
         
         return cell
     }
     
     func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-        return 62
+        return 70
     }
     
     
@@ -217,8 +262,25 @@ extension JDTradeAccountPositionViewController: UITableViewDelegate,UITableViewD
     
 }
 
-extension JDTradeAccountPositionViewController: JXSegmentedListContainerViewListDelegate {
+extension JDTradeAccountPositionViewController : JXPagingViewListViewDelegate{
     func listView() -> UIView {
-        return view
+        return self.view
+    }
+    
+    func listScrollView() -> UIScrollView {
+        return self.tableView
+    }
+    
+    func listViewDidScrollCallback(callback: @escaping (UIScrollView) -> ()) {
+        
+        self.scrollCallback = callback
+        
     }
 }
+
+
+//extension JDTradeAccountPositionViewController: JXSegmentedListContainerViewListDelegate {
+//    func listView() -> UIView {
+//        return view
+//    }
+//}

+ 11 - 1
Koala/Koala/Modular/JDTrade/VC/JDTradeViewController.swift

@@ -18,6 +18,14 @@ class JDTradeViewController: BaseViewController {
         return arr
     }()
     
+    
+    override func viewWillAppear(_ animated: Bool) {
+        super.viewWillAppear(animated)
+        
+        self.requestAccountList()
+        self.netForGetCashInfo()
+    }
+    
     override func viewDidLoad() {
         super.viewDidLoad()
         setup()
@@ -171,7 +179,9 @@ extension JDTradeViewController : UITableViewDataSource{
 //            let model:KSymbolModel = (self.VM?.screenSymbolList[indexPath.row])!;
             
             let model : JDTradeAccountModel = self.accountList[indexPath.row]
-
+            cell.todayTipLb.isHidden = false
+            cell.todayProfitLb.isHidden = false
+            cell.todayRateLb.isHidden = false
             cell.updateHomeCellWith(model: model)
             
             return cell

+ 25 - 25
Koala/Pods/Pods.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -7,127 +7,127 @@
 		<key>Alamofire.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>4</integer>
+			<integer>21</integer>
 		</dict>
 		<key>CryptoSwift.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>18</integer>
+			<integer>26</integer>
 		</dict>
 		<key>FMDB.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>12</integer>
+			<integer>19</integer>
 		</dict>
 		<key>GzipSwift.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>19</integer>
+			<integer>14</integer>
 		</dict>
 		<key>HandyJSON.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>25</integer>
+			<integer>11</integer>
 		</dict>
 		<key>IQKeyboardManagerSwift.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>9</integer>
+			<integer>12</integer>
 		</dict>
 		<key>Kingfisher.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>14</integer>
+			<integer>22</integer>
 		</dict>
 		<key>LLCycleScrollView.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>13</integer>
+			<integer>10</integer>
 		</dict>
 		<key>LiveChat.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>5</integer>
+			<integer>25</integer>
 		</dict>
 		<key>MJExtension.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>2</integer>
+			<integer>4</integer>
 		</dict>
 		<key>MJRefresh.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>21</integer>
+			<integer>23</integer>
 		</dict>
 		<key>PGDatePicker.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>15</integer>
+			<integer>8</integer>
 		</dict>
 		<key>PGPickerView.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>8</integer>
+			<integer>9</integer>
 		</dict>
 		<key>Pods-Koala.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>22</integer>
+			<integer>2</integer>
 		</dict>
 		<key>Pods-KoalaTests.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>27</integer>
+			<integer>5</integer>
 		</dict>
 		<key>Pods-KoalaUITests.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>17</integer>
+			<integer>27</integer>
 		</dict>
 		<key>ReactiveCocoa.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>11</integer>
+			<integer>20</integer>
 		</dict>
 		<key>ReactiveSwift.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>7</integer>
+			<integer>15</integer>
 		</dict>
 		<key>SVProgressHUD.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>3</integer>
+			<integer>24</integer>
 		</dict>
 		<key>SideMenu.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>6</integer>
+			<integer>7</integer>
 		</dict>
 		<key>SnapKit.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>24</integer>
+			<integer>6</integer>
 		</dict>
 		<key>Starscream.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>23</integer>
+			<integer>13</integer>
 		</dict>
 		<key>SwiftSVG.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>10</integer>
+			<integer>18</integer>
 		</dict>
 		<key>SwiftyJSON.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>26</integer>
+			<integer>3</integer>
 		</dict>
 		<key>lottie-ios.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>20</integer>
+			<integer>16</integer>
 		</dict>
 	</dict>
 </dict>