17 Commit-ok e7f93b1588 ... a5569edccb

Szerző SHA1 Üzenet Dátum
  Vincent Hu a5569edccb 优化新闻页面UI 1 hete
  culturetown 9d0802180b Merge branch '推广版' of https://git.jdnx.me/tomy/JD_iOS into 推广版 1 hete
  culturetown 5cec09e4d8 在交易界面和市场详情界面增加获取用户数据,并更新本地数据。 1 hete
  lintong 1f192ed2cc 拖动时刷新优化 1 hete
  Vincent Hu e7f93b1588 优化新闻页面UI 1 hete
  lintong 493b86ed0b 修复账户详情现价显示 1 hete
  lintong 4ee3ff6dbb Merge branch '推广版' of http://156.254.127.134:3000/tomy/JD_iOS into 推广版 1 hete
  lintong 8e9e34f6e0 修复交易画面持仓列表现价 1 hete
  culturetown a2a52a10c5 存款功能确认提交做连续点击请求处理。 2 hete
  culturetown 34fc79680b 外部转账功能限制确认连续点击请求。 2 hete
  culturetown d76478b4a4 Merge branch '推广版' of https://git.jdnx.me/tomy/JD_iOS into 推广版 2 hete
  culturetown 32c57ac89c 取款功能限制下一步连续点击请求。 2 hete
  lintong b4f3f66a4d Merge branch '推广版' of http://156.254.127.134:3000/tomy/JD_iOS into 推广版 2 hete
  lintong 7fd7a714a9 enable = 0状态更新 2 hete
  culturetown df1766264b 驳回原因取值调整为comment 2 hete
  culturetown 942ec64fe3 Merge branch '推广版' of https://git.jdnx.me/tomy/JD_iOS into 推广版 2 hete
  culturetown 4d7e93e35c 根据status状态调整审核结果弹窗内容样式 2 hete

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

@@ -190,9 +190,9 @@
             filePath = "Koala/Modular/JDAssets/VC/JDAFiatTransferViewController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "204"
-            endingLineNumber = "204"
-            landmarkName = "netInsertTransfer()"
+            startingLineNumber = "206"
+            endingLineNumber = "206"
+            landmarkName = "tableView(_:cellForRowAt:)"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>

+ 14 - 7
Koala/Koala/Modular/Deal/V/Deal/DealListCell.swift

@@ -143,7 +143,6 @@ class DealListCell: BaseTableViewCell {
 
         cancelStatusLabel.showAnimatedGradientSkeleton(usingGradient: gradient, transition: .crossDissolve(0.25))
         holdView.layoutIfNeeded()
-        print("骨架图:Cell显示")
     }
     
     func hidenAnimated() {
@@ -174,7 +173,6 @@ class DealListCell: BaseTableViewCell {
 //        profitLabel.hideSkeleton()
 //        cancelStatusLabel.hideSkeleton()
 //        guadanjiageLabel.hideSkeleton()
-        print("骨架图:隐藏")
     }
 
     
@@ -358,20 +356,29 @@ class DealListCell: BaseTableViewCell {
         self.shoushuLabel.attributedText = self.setAttributesForLots(title: switchLanguage("手数"), text: precisionString(with: model.volume, precision: "2"))
         
         var price = model.close_price
-        let prd = BaseProductList.shareInstance.productList[model.productBean.symbol]
-        if prd != nil && model.productBean.inTrading() {
-            let bid = prd!.bid
-            let ask = prd!.ask
+        if let prd = BaseProductList.shareInstance.productList[model.productBean.symbol] {
+            let bid = prd.bid
+            let ask = prd.ask
             price = bid
             if model.cmd == 1 || model.cmd == 3 || model.cmd == 5 {
                 price = ask
             }
         }
+//        let prd = self.productList![model.productBean.symbol]
+//        if prd != nil && model.productBean.inTrading() {
+//            let bid = prd!.bid
+//            let ask = prd!.ask
+//            price = bid
+//            if model.cmd == 1 || model.cmd == 3 || model.cmd == 5 {
+//                price = ask
+//            }
+//        }
         
         var xianjiaColor = color(242, 64, 64, 1)
-        if Double(price ?? "0") ?? 0 < Double(model.open_price ?? "0") ?? 0 {
+        if model.cmd == 1 || model.cmd == 3 || model.cmd == 5 {
             xianjiaColor = color(83, 185, 73, 1)
         }
+        self.xianjiaLabel.textColor = xianjiaColor
         
         if model.productBean.digits.length > 0 {
             self.xianjiaLabel.text = precisionString(with: price ?? "0", precision: model.productBean.digits, isRound: true)

+ 7 - 8
Koala/Koala/Modular/Deal/V/Deal/DealView.swift

@@ -973,7 +973,9 @@ class DealView: BaseView {
         
         self.VM?.getDealProductActionBlock = { [weak self] in
             guard let self = self else { return }
+            self.tabHeaderView.VM = self.VM
             self.tableView.reloadData()
+            
         }
         
         var issignalSymbol = true
@@ -1212,30 +1214,27 @@ extension DealView {
 extension DealView {
     func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
         self.isScrolling = true
-        print("===>>>滚动开始")
     }
 
     func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
         let scrollToScrollStop = scrollView.isTracking == false && scrollView.isDragging == false && scrollView.isDecelerating == false
         if scrollToScrollStop {
             self.scrollViewDidEndScroll()
-            print("V===DidEnd滑动停止===\(scrollToScrollStop)")
         }
     }
     
     func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
         if !decelerate {
-            let scrollToScrollStop = scrollView.isTracking == false && scrollView.isDragging == false && scrollView.isDecelerating == false
-            if scrollToScrollStop {
-                self.scrollViewDidEndScroll()
-                print("===>>>EndDragging滑动停止===\(scrollToScrollStop)")
-            }
+            self.scrollViewDidEndScroll()
         }
     }
+    
+    func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>) {
+        self.scrollViewDidEndScroll()
+    }
 
     func scrollViewDidEndScroll() {
         self.isScrolling = false
-        print("===>>>滚动停止")
     }
 }
 

+ 38 - 54
Koala/Koala/Modular/Deal/VM/DealViewModel.swift

@@ -1442,57 +1442,18 @@ extension DealViewModel {
                     }
                     PriceCalibrator.shareCalibrator.updateLastPriceTime()
                     print("symbol的值:\(symbol)")
-                    var isReload = false
-                    if self.selectIndex == 0 {
-                        if let positionModel = self.positionListDict[symbol] {
-                            positionModel.isUpdate = true
-                            positionModel.SymbolModel.ask = String(format: "%@", currentSocket["ask"] as! CVarArg)
-                            positionModel.SymbolModel.bid = String(format: "%@", currentSocket["bid"] as! CVarArg)
-                            
-//                            let ask = Double(positionModel.SymbolModel.ask) ?? 0.0
-//                            let bid = Double(positionModel.SymbolModel.bid) ?? 0.0
-//                            positionModel.close_price = positionModel.SymbolModel.close
-                            let promd = BaseProductList.shareInstance.productList[symbol]
-                            
-                            let promdc = self.productList[symbol]
-                            promd?.ask = String(format: "%@", currentSocket["ask"] as! CVarArg)
-                            promd?.bid = String(format: "%@", currentSocket["bid"] as! CVarArg)
-                            promdc?.ask = String(format: "%@", currentSocket["ask"] as! CVarArg)
-                            promdc?.bid = String(format: "%@", currentSocket["bid"] as! CVarArg)
-                            isReload = true
-                        }
-                    } else if self.selectIndex == 1 {
-                        if let positionModel = self.entrustListDict[symbol] {
-                            positionModel.SymbolModel.ask = String(format: "%@", currentSocket["ask"] as! CVarArg)
-                            positionModel.SymbolModel.bid = String(format: "%@", currentSocket["bid"] as! CVarArg)
-                            let promd = BaseProductList.shareInstance.productList[symbol]
-                            
-                            let promdc = self.productList[symbol]
-                            promd?.ask = String(format: "%@", currentSocket["ask"] as! CVarArg)
-                            promd?.bid = String(format: "%@", currentSocket["bid"] as! CVarArg)
-                            promdc?.ask = String(format: "%@", currentSocket["ask"] as! CVarArg)
-                            promdc?.bid = String(format: "%@", currentSocket["bid"] as! CVarArg)
-                            isReload = true
-                        }
-                    }
                     
                     let model = self.selectSymbolModel
                     if model.symbol == symbol {
-                        isReload = false
                         model.newPrice = "\(currentSocket["ask"] ?? "0")"
                         let np = conerData(model.newPrice, .MyDouble).2! - conerData(model.open, .MyDouble).2!
                         model.increase = "\(np / conerData(model.open, .MyDouble).2! * 100)"
-                        model.ask = "\(currentSocket["bid"] ?? "0")"
-                        model.bid = "\(currentSocket["ask"] ?? "0")"
+                        let bid = "\(currentSocket["bid"] ?? "0")"
+                        let ask = "\(currentSocket["ask"] ?? "0")"
                         
-                        let curPrice = ((Double(model.ask) ?? 0) + (Double(model.bid) ?? 0)) / 2
+                        let curPrice = ((Double(ask) ?? 0) + (Double(bid) ?? 0)) / 2
                         self.price = "\(curPrice)"
                         
-                        if self.productList[symbol] != nil {
-                            self.productList[symbol]!.ask = "\(currentSocket["ask"] ?? "0")"
-                            self.productList[symbol]!.bid = "\(currentSocket["bid"] ?? "0")"
-                        }
-                        
                         self.observeSymbol.send(value: true)
                         
                         guard let _ = currentSocket["time"] as? Int64 else {
@@ -1503,7 +1464,6 @@ extension DealViewModel {
                     
                         var period = KLinePeriod.minuteFor(kPeriod: KLinePeriod.getDefaultKLinePeriod())
                         period = period * 60
-                        isReload = true
                         if let firstModel = self.priceList.first {
                             let firstTime = conerData(firstModel.datetime as Any, .MyCLong).3! + period
                             
@@ -1535,18 +1495,9 @@ extension DealViewModel {
                             model.low = newPrice
                             self.priceList.insert(model, at: 0)
                         }
-                        if isReload {
-                            self.signalPriceBlock?()
-                            //                        self.observePrice.send(value: true)
-                            //                        if(self.refreshBlock != nil){
-                            //                            self.refreshBlock!()
-                            //                        }
-                        }
+                        self.signalPriceBlock?()
                     } else {
-                        if isReload {
-                            self.signalPositionBlock?()
-                            //                        self.observePosition.send(value: true)
-                        }
+                        self.signalPositionBlock?()
                     }
                 } else if currentType == "depth" {
                     guard let symbol = currentSocket["symbol"] as? String else {
@@ -1561,6 +1512,39 @@ extension DealViewModel {
                             self.getPriceDepthActionBlock?()
                         }
                     }
+                    
+                    if let marketDepthModel = MarketDepthModel.deserialize(from: currentSocket) {
+                        if self.selectIndex == 0 {
+                            if let positionModel = self.positionListDict[symbol] {
+                                positionModel.isUpdate = true
+                                positionModel.SymbolModel.ask = marketDepthModel.asks[0].price
+                                positionModel.SymbolModel.bid = marketDepthModel.bids[0].price
+                                
+                                let promd = BaseProductList.shareInstance.productList[symbol]
+                                let promdc = self.productList[symbol]
+                                
+                                promd?.ask = marketDepthModel.asks[0].price
+                                promd?.bid = marketDepthModel.bids[0].price
+                                promdc?.ask = marketDepthModel.asks[0].price
+                                promdc?.bid = marketDepthModel.bids[0].price
+                            }
+                        } else if self.selectIndex == 1 {
+                            if let positionModel = self.entrustListDict[symbol] {
+                                positionModel.SymbolModel.ask = marketDepthModel.asks[0].price
+                                positionModel.SymbolModel.bid = marketDepthModel.bids[0].price
+                                let promd = BaseProductList.shareInstance.productList[symbol]
+                                
+                                let promdc = self.productList[symbol]
+                                promd?.ask = marketDepthModel.asks[0].price
+                                promd?.bid = marketDepthModel.bids[0].price
+                                promdc?.ask = marketDepthModel.asks[0].price
+                                promdc?.bid = marketDepthModel.bids[0].price
+                            }
+                        }
+                        
+                        self.signalPositionBlock?()
+                    }
+                    
                 }
             } else if type == 1 {
                 guard let currentSocket = dict.object(forKey: "currentSocket") as? NSDictionary else { return }

+ 8 - 1
Koala/Koala/Modular/JDAssets/V/JDFuncLimitPopView.swift

@@ -185,7 +185,14 @@ class JDFuncLimitPopView: BaseAlertView {
                         model?.handleList = handleList
                     }
                     
-                    self.popView(model: model ?? JDWorkOrderModel())
+                    
+                    if model?.status == "5" {
+                        
+                        self.createNewWorkOrder()
+                    }else {
+
+                        self.popView(model: model ?? JDWorkOrderModel())
+                    }
                 }else {
                     self.createNewWorkOrder()
                 }

+ 46 - 1
Koala/Koala/Modular/JDAssets/V/JDFuncLimitResultPopView.swift

@@ -248,6 +248,51 @@ extension JDFuncLimitResultPopView {
         iconIv.image = _image("jd_func_limit&jd_func_limit")
         titleLabel.text = switchLanguage("功能受限")
         
+        
+        if model.status == "3" {
+            
+            type = 1
+            
+            let formatString = switchLanguage("您的账号存在异常,暂时无法使用该功能,您已提交编号为%@的验证资料申请解除账号限制,相关信息正在审核中,请耐心等待,谢谢!")
+            
+            detailLabel.text = String(format: formatString, model.ordernum ?? "")
+            self.detailButton.setTitle(switchLanguage("知道了"), for: .normal)
+            
+        } else if model.status == "6" {
+           
+            if model.handleList?.count ?? 0 > 0 {
+                type = 2
+                
+                let dict = model.handleList?[0]
+                let reason = dict?["comment"] as? String
+                
+                let formatString = switchLanguage("您的账号存在异常,暂时无法使用该功能,您已提交编号为%@的验证资料,因“%@”的原因未能通过审核,请通过以下链接重新提交资料,谢谢!")
+                
+                detailLabel.text = String(format: formatString, model.ordernum ?? "", reason ?? "")
+                self.detailButton.setTitle(switchLanguage("重新提交资料"), for: .normal)
+            }else {
+                type = 2
+                
+//                let dict = model.handleList?[0]
+                let reason = ""//dict?["content"] as? String
+                
+                let formatString = switchLanguage("您的账号存在异常,暂时无法使用该功能,您已提交编号为%@的验证资料,因“%@”的原因未能通过审核,请通过以下链接重新提交资料,谢谢!")
+                
+                detailLabel.text = String(format: formatString, model.ordernum ?? "", reason ?? "")
+                self.detailButton.setTitle(switchLanguage("重新提交资料"), for: .normal)
+            }
+       
+        }else {
+            
+            type = 1
+            
+            let formatString = switchLanguage("您的账号存在异常,暂时无法使用该功能,您已提交编号为%@的验证资料申请解除账号限制,相关信息正在审核中,请耐心等待,谢谢!")
+            
+            detailLabel.text = String(format: formatString, model.ordernum ?? "")
+            self.detailButton.setTitle(switchLanguage("知道了"), for: .normal)
+        }
+        
+        /*
         if model.handleList?.count ?? 0 > 0 {
             type = 2
             
@@ -266,7 +311,7 @@ extension JDFuncLimitResultPopView {
             detailLabel.text = String(format: formatString, model.ordernum ?? "")
             self.detailButton.setTitle(switchLanguage("知道了"), for: .normal)
         }
-        
+        */
         
 
         

+ 5 - 0
Koala/Koala/Modular/JDAssets/VC/JDAFiatDepositsViewController.swift

@@ -293,9 +293,13 @@ extension JDAFiatDepositsViewController {
 
         print(param)
         
+        self.submitButton.isEnabled = false
         ProgressHUD.showMessage(status: switchLanguage("正在请求"))
         NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForInsertCashInto, parameters: param, success: { _, result in
             if let dict: NSDictionary = result as? NSDictionary {
+                
+                self.submitButton.isEnabled = true
+                
                 let model = JDDepositResultModel.deserialize(from: dict)!
                 
                 if self.selectCashChannelModel?.type == "3" {
@@ -334,6 +338,7 @@ extension JDAFiatDepositsViewController {
             }
         }) { _, result in
             ProgressHUD.showError(status: result as! String)
+            self.submitButton.isEnabled = true
         }
     }
 }

+ 2 - 0
Koala/Koala/Modular/JDAssets/VC/JDAFiatTransferViewController.swift

@@ -161,6 +161,7 @@ extension JDAFiatTransferViewController {
             param.add(["account": self.areaCode + self.account])
         }
        
+        self.submitBtn.isEnabled = false
         ProgressHUD.showMessage(status: switchLanguage("正在请求"))
         NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForUserExchange, parameters: param, success: { _, _ in
             ProgressHUD.showSuccess(status: switchLanguage("提交成功"))
@@ -170,6 +171,7 @@ extension JDAFiatTransferViewController {
             }
         }) { _, result in
             ProgressHUD.showError(status: result as! String)
+            self.submitBtn.isEnabled = true
         }
     }
 }

+ 4 - 0
Koala/Koala/Modular/JDAssets/VC/JDAFiatWithdrawViewController.swift

@@ -208,6 +208,9 @@ extension JDAFiatWithdrawViewController {
         //            param.add(["account":self.accountInfoModel.account as Any])
         //        }
         
+        
+        self.submitBtn.isEnabled = false
+        
         ProgressHUD.showMessage(status: switchLanguage("正在请求"))
         NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForInsertCashOut, parameters: param, success: { _, _ in
             ProgressHUD.showSuccess(status: switchLanguage("提交成功"))
@@ -217,6 +220,7 @@ extension JDAFiatWithdrawViewController {
             }
         }) { _, result in
             ProgressHUD.showError(status: result as! String)
+            self.submitBtn.isEnabled = true
         }
     }
     

+ 18 - 21
Koala/Koala/Modular/JDTrade/VC/JDNewTradeAccountDetailViewController.swift

@@ -246,13 +246,15 @@ class JDNewTradeAccountDetailViewController: BaseViewController {
                 guard let cell = tableView.cellForRow(at: indexPath) as? DealListCell else { continue }
                 guard indexPath.row < (viewModel.positionList.count) else {return}
                 cell.updatePositionCellWith(model: self.viewModel.positionList[indexPath.row])
+                cell.layoutIfNeeded()
             }
         }
-        else if sectionView.segmentedControl.selectedSegmentIndex == 0 {
+        else if sectionView.segmentedControl.selectedSegmentIndex == 1 {
             for indexPath in visibleRows {
                 guard let cell = tableView.cellForRow(at: indexPath) as? DealListCell else { continue }
                 guard indexPath.row < (viewModel.entrustList.count) else {return}
                 cell.updateEntrustCellWith(model: self.viewModel.entrustList[indexPath.row])
+                cell.layoutIfNeeded()
             }
         }
     }
@@ -428,9 +430,7 @@ class JDNewTradeAccountDetailViewController: BaseViewController {
             if !self.isScrolling.value {
                 self.skeletonCount = 0
                 self.tableView.hideSkeleton()
-                print("骨架图:隐藏")
                 self.tableView.reloadData()
-                print("刷新列表")
             }
             /// ===>推广版本修改
             var isCu = self.isCurrencyOptions
@@ -546,7 +546,6 @@ extension JDNewTradeAccountDetailViewController: UITableViewDelegate, SkeletonTa
         let cell: DealListCell = tableView.dequeueReusableCell(withIdentifier: "DealListCell") as! DealListCell
         skeletonCount = 0
         cell.hidenAnimated()
-        print("骨架图:隐藏")
         if self.sectionView.segmentedControl.selectedSegmentIndex == 2 {
             cell.cellType = .Hold // 持仓
             guard indexPath.row < self.viewModel.closeOrderList.count else{
@@ -1177,18 +1176,17 @@ extension JDNewTradeAccountDetailViewController {
                                   guard let self else {return false}
                                   return !self.isScrolling.value
                               })
-                              .startWithValues { [weak self] indexPath in
+                              .startWithValues { [weak self] indexPaths in
                                   guard let self = self,
-                                        self.sectionView.segmentedControl.selectedSegmentIndex == 0,
-                                        indexPath.row < self.viewModel.positionList.count else {return}
-                                  
-                                  guard self.tableView.indexPathsForVisibleRows?.contains(indexPath) == true else {return}
-                                  guard let cell = self.tableView.cellForRow(at: indexPath) as? DealListCell else {return}
-                                  if self.skeletonCount > 0 {
-                                      self.skeletonCount = 0
-                                      self.tableView.hideSkeleton()
-                                  }
-                                  cell.updatePositionCellWith(model: self.viewModel.positionList[indexPath.row])
+                                        self.sectionView.segmentedControl.selectedSegmentIndex == 0 else {return}
+                                 
+//                                  if self.skeletonCount > 0 {
+//                                      self.skeletonCount = 0
+//                                      self.tableView.hideSkeleton()
+//                                  }
+//                                  
+//                                  self.tableView.reloadRows(at: indexPaths, with: .none)
+                                  self.updateVisibleRows()
                               }
         
         
@@ -1199,18 +1197,17 @@ extension JDNewTradeAccountDetailViewController {
                                   guard let self else {return false}
                                   return !self.isScrolling.value
                               })
-                              .startWithValues { [weak self] indexPath in
+                              .startWithValues { [weak self] indexPaths in
                                   guard let self = self,
-                                        self.sectionView.segmentedControl.selectedSegmentIndex == 1,
-                                        indexPath.row < self.viewModel.entrustList.count else {return}
+                                        self.sectionView.segmentedControl.selectedSegmentIndex == 1
+                                        else {return}
                                   
-                                  guard self.tableView.indexPathsForVisibleRows?.contains(indexPath) == true else {return}
-                                  guard let cell = self.tableView.cellForRow(at: indexPath) as? DealListCell else {return}
                                   if self.skeletonCount > 0 {
                                       self.skeletonCount = 0
                                       self.tableView.hideSkeleton()
                                   }
-                                  cell.updateEntrustCellWith(model: self.viewModel.entrustList[indexPath.row])
+                                  
+                                  self.tableView.reloadRows(at: indexPaths, with: .none)
                               }
        
     }

+ 25 - 0
Koala/Koala/Modular/JDTrade/VC/JDTradeViewController.swift

@@ -50,6 +50,7 @@ class JDTradeViewController: BaseViewController {
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
         self.netMessageStatus()
+        self.netForGetAccouontInfo()
         self.fetchAllAccountData()
         self.tableView.reloadData()
     }
@@ -221,6 +222,30 @@ class JDTradeViewController: BaseViewController {
 }
 
 extension JDTradeViewController {
+    
+    func netForGetAccouontInfo() {
+        guard OperationalUserInfoData.getLogin() else {
+            return
+        }
+        /// 获取用户信息
+        NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForUser_Info, parameters: nil, success: { _, result in
+            if let dic: NSDictionary = result as? NSDictionary {
+                let token = OperationalUserInfoData.getToken()
+                let dict = NSMutableDictionary(dictionary: dic)
+                dict.setValue(token, forKey: "token")
+                OperationalUserInfoData.setUserInfoData(data: dict)
+                
+                
+            } else {
+                ProgressHUD.showError(status: DataTypeErrorPrompt)
+            }
+            
+
+        }) { _, result in
+            ProgressHUD.showError(status: result as! String)
+        }
+    }
+    
     func netMessageStatus() {
         guard OperationalUserInfoData.getLogin() else {
             self.navView.chatButton.messageUnreadView.isHidden = true

+ 76 - 5
Koala/Koala/Modular/JDTrade/VM/JDNewTradeAccountDetailViewModel.swift

@@ -72,9 +72,9 @@ class JDNewTradeAccountDetailViewModel {
     var lastUpdate: TimeInterval = Date().timeIntervalSince1970
     
     // 持仓列表待更新的列表项
-    let holdUpdatedIndexPath = MutableProperty<IndexPath?>(nil)
+    let holdUpdatedIndexPath = MutableProperty<Array<IndexPath>?>(nil)
     // 挂单列表待更新的列表项
-    let hangUpdatedIndexPath = MutableProperty<IndexPath?>(nil)
+    let hangUpdatedIndexPath = MutableProperty<Array<IndexPath>?>(nil)
     
 
     init(accountModel: JDTradeAccountModel) {
@@ -410,7 +410,14 @@ extension JDNewTradeAccountDetailViewModel {
             guard let currentSocket = dict.object(forKey: "currentSocket") as? NSDictionary else {return}
             guard let symbol = currentSocket["symbol"] as? String else {return}
             if type == 0 {
-                updatePrice(symbol: currentSocket)
+                guard let currentSocket = dict.object(forKey: "currentSocket") as? NSDictionary else { return }
+                guard let currentType = currentSocket["type"] as? String else { return }
+                
+                if(currentType == "depth"){
+                    updateDepth(symbol: currentSocket)
+                }else if(currentType == "price"){
+                    updatePrice(symbol: currentSocket)
+                }
             }
             else if type == 1 {
                 let isUpdateHold =  positionList.contains {$0.symbol == symbol}
@@ -421,6 +428,50 @@ extension JDNewTradeAccountDetailViewModel {
             }
         }
     }
+    
+    func updateDepth(symbol: NSDictionary){
+        guard let symbol_str = symbol["symbol"] as? String else {
+            return
+        }
+        if symbol_str.count == 0 {
+            return
+        }
+        
+        if let marketDepthModel = MarketDepthModel.deserialize(from: symbol) {
+            
+            guard let model = self.productList[symbol_str] else {
+                return
+            }
+            
+            model.ask = marketDepthModel.asks[0].price
+            model.bid = marketDepthModel.bids[0].price
+            BaseProductList.shareInstance.updateProductInfo(model: model)
+            if self.current_select_index == 0 {
+                let indices = self.positionList.enumerated().compactMap { (index, item) -> Int? in
+                    if(item.symbol == symbol_str){
+                        item.productBean.ask = model.ask
+                        item.productBean.bid = model.bid
+                        item.SymbolModel.ask = model.ask
+                        item.SymbolModel.bid = model.bid
+                        return index
+                    }
+                    return nil
+                }
+                // 将索引集合转换为 IndexPath 集合
+                let indexPaths = indices.map { IndexPath(row: $0, section: 0) }
+                
+                self.holdUpdatedIndexPath.value = indexPaths
+            }else if(self.current_select_index == 1){
+                let indices = self.entrustList.enumerated().compactMap { (index, item) -> Int? in
+                    return item.symbol == symbol_str ? index : nil
+                }
+                // 将索引集合转换为 IndexPath 集合
+                let indexPaths = indices.map { IndexPath(row: $0, section: 0) }
+                
+                self.hangUpdatedIndexPath.value = indexPaths
+            }
+        }
+    }
 
     func updatePrice(symbol: NSDictionary) {
         guard let symbol_str = symbol["symbol"] as? String else {
@@ -461,11 +512,31 @@ extension JDNewTradeAccountDetailViewModel {
             positionModel.productBean.ask = model.ask
             positionModel.productBean.bid = model.bid
             
-            self.holdUpdatedIndexPath.value = IndexPath.init(row: row, section: 0)
+            let indices = self.positionList.enumerated().compactMap { (index, item) -> Int? in
+                if(item.symbol == symbol_str){
+                    item.productBean.ask = model.ask
+                    item.productBean.bid = model.bid
+                    item.SymbolModel.ask = model.ask
+                    item.SymbolModel.bid = model.bid
+                    return index
+                }
+                return nil
+            }
+            // 将索引集合转换为 IndexPath 集合
+            let indexPaths = indices.map { IndexPath(row: $0, section: 0) }
+            
+            self.holdUpdatedIndexPath.value = indexPaths
         }
         else if self.current_select_index == 1 {
             guard let row = self.entrustList.firstIndex(where: {$0.symbol == symbol_str}) else {return}
-            self.hangUpdatedIndexPath.value = IndexPath.init(row: row, section: 0)
+            
+            let indices = self.entrustList.enumerated().compactMap { (index, item) -> Int? in
+                return item.symbol == symbol_str ? index : nil
+            }
+            // 将索引集合转换为 IndexPath 集合
+            let indexPaths = indices.map { IndexPath(row: $0, section: 0) }
+            
+            self.hangUpdatedIndexPath.value = indexPaths
         }
         
     }

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

@@ -103,7 +103,7 @@ class MarketMainDetailViewController: BaseViewController {
     override func viewDidLoad() {
         super.viewDidLoad()
         SocketInfoModel.share.dataSource.removeAll()
-        
+        self.netForGetAccouontInfo()
         self.view.addSubview(self.navView)
         self.setup()
         self.view.addSubview(self.menuBtn)
@@ -408,6 +408,31 @@ class MarketMainDetailViewController: BaseViewController {
 }
 
 extension MarketMainDetailViewController {
+    
+    
+    func netForGetAccouontInfo() {
+        guard OperationalUserInfoData.getLogin() else {
+            return
+        }
+        /// 获取用户信息
+        NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: netForUser_Info, parameters: nil, success: { _, result in
+            if let dic: NSDictionary = result as? NSDictionary {
+                let token = OperationalUserInfoData.getToken()
+                let dict = NSMutableDictionary(dictionary: dic)
+                dict.setValue(token, forKey: "token")
+                OperationalUserInfoData.setUserInfoData(data: dict)
+                
+                
+            } else {
+                ProgressHUD.showError(status: DataTypeErrorPrompt)
+            }
+            
+
+        }) { _, result in
+            ProgressHUD.showError(status: result as! String)
+        }
+    }
+    
     func netSymbolDetail() {
         let param: [String: Any] = [
             "symbol": getJSONStringFromArray(array: [self.symbolCode]),