|
@@ -27,8 +27,11 @@ class DealView: BaseView {
|
|
|
view.clickProBlock = {[weak self] btn in
|
|
|
self?.VM?.isSimpleness = !self!.VM!.isSimpleness
|
|
|
self?.navView.updateProBtn(isPro: self!.VM!.isSimpleness)
|
|
|
- self?.VM?.isShowKline = true
|
|
|
- self?.reloadTable()
|
|
|
+ if self!.VM!.isSimpleness {
|
|
|
+ self?.VM?.netGetSimPriceList()
|
|
|
+ }else{
|
|
|
+ self?.VM?.netGetPriceList()
|
|
|
+ }
|
|
|
}
|
|
|
return view
|
|
|
}()
|
|
@@ -45,7 +48,7 @@ class DealView: BaseView {
|
|
|
}
|
|
|
|
|
|
pop.showPopupView(source: self.VM!.accountList) {index in
|
|
|
- if index > 0{
|
|
|
+ if index >= 0{
|
|
|
self.VM!.accountInfoModel = self.VM!.accountList[index]
|
|
|
self.topView.updateViewDataWith(model: self.VM!.accountInfoModel)
|
|
|
self.reloadTable()
|
|
@@ -264,7 +267,6 @@ class DealView: BaseView {
|
|
|
VM?.getPriceListAction.values.observeValues({[weak self] (success) in
|
|
|
guard let self = self else { return }
|
|
|
if success {
|
|
|
- self.VM?.isUpdateKline = true
|
|
|
self.reloadTable()
|
|
|
}
|
|
|
})
|
|
@@ -715,7 +717,115 @@ extension DealView:UITableViewDelegate,UITableViewDataSource{
|
|
|
}
|
|
|
|
|
|
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
|
|
-
|
|
|
+
|
|
|
+ if self.VM!.isChangeServer(){
|
|
|
+ if indexPath.section < 1 {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if indexPath.section < 2{
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ let accountModel:JDTradeAccountModel = JDTradeAccountModel.deserialize(from: self.VM?.accountInfoModel.toJSON())!
|
|
|
+
|
|
|
+ if self.sectionView.segmentedControl.selectedSegmentIndex == 0{
|
|
|
+ let m = self.VM!.positionList[indexPath.row]
|
|
|
+ let model:JDPositionModel = JDPositionModel.deserialize(from:m.toJSON())!
|
|
|
+ let pop = JDTradeHoldAlertView()
|
|
|
+ pop.showPopupView(model: model, type: 0 ) { index in
|
|
|
+ if index == 1 {
|
|
|
+ let closePop = JDClosePositionAlertView()
|
|
|
+ closePop.showPopupView(model: model, accountModel: accountModel,deleteType: 0) { index in
|
|
|
+ self.VM?.netOpenPosition()
|
|
|
+ }
|
|
|
+
|
|
|
+ }else if index == 2{
|
|
|
+
|
|
|
+ let modifyPop = JDPositionModifyAlertView()
|
|
|
+ modifyPop.showPopupView(model: model,accountModel: accountModel,modifyType: 0) { index in
|
|
|
+ self.VM?.netOpenPosition()
|
|
|
+ }
|
|
|
+
|
|
|
+ }else if index == 3 {
|
|
|
+ if self.VM!.isChangeServer(){
|
|
|
+ self.VM?.server = accountModel.server
|
|
|
+ }
|
|
|
+ self.VM?.updateSymbols(symbol: model.symbol)
|
|
|
+ pop.dismissAlert()
|
|
|
+
|
|
|
+ }else{
|
|
|
+ let vc = MarketDetailViewController()
|
|
|
+ vc.symbolModel = m.SymbolModel
|
|
|
+ currentVc()?.navigationController?.pushViewController(vc, animated: true)
|
|
|
+ pop.dismissAlert()
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if self.sectionView.segmentedControl.selectedSegmentIndex == 1{
|
|
|
+ let m = self.VM!.entrustList[indexPath.row]
|
|
|
+ let model:JDPositionModel = JDPositionModel.deserialize(from:m.toJSON())!
|
|
|
+ let pop = JDTradeHoldAlertView()
|
|
|
+ pop.showPopupView(model: model, type: 1 ) { index in
|
|
|
+ if index == 1 {
|
|
|
+ let closePop = JDClosePositionAlertView()
|
|
|
+ closePop.showPopupView(model: model, accountModel: accountModel,deleteType: 0) { index in
|
|
|
+ self.VM?.netGetEntrustList()
|
|
|
+ }
|
|
|
+
|
|
|
+ }else if index == 2{
|
|
|
+ if self.VM!.isChangeServer(){
|
|
|
+ self.VM?.server = accountModel.server
|
|
|
+ }
|
|
|
+ self.VM?.updateSymbols(symbol: model.symbol)
|
|
|
+ pop.dismissAlert()
|
|
|
+
|
|
|
+ }else if index == 3 {
|
|
|
+ let vc = MarketDetailViewController()
|
|
|
+ vc.symbolModel = m.SymbolModel
|
|
|
+ currentVc()?.navigationController?.pushViewController(vc, animated: true)
|
|
|
+ pop.dismissAlert()
|
|
|
+
|
|
|
+ }else{
|
|
|
+
|
|
|
+ let closePop = JDClosePositionAlertView()
|
|
|
+
|
|
|
+ closePop.showPopupView(model: model,accountModel: accountModel,deleteType: 1) { index in
|
|
|
+ self.VM?.netGetEntrustList()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }else {
|
|
|
+ let m = self.VM!.closeOrderList[indexPath.row]
|
|
|
+ let model:JDPositionModel = JDPositionModel.deserialize(from:m.toJSON())!
|
|
|
+ let pop = JDTradeHoldAlertView()
|
|
|
+ pop.showPopupView(model: model, type: 2 ) { index in
|
|
|
+
|
|
|
+ if index == 1{
|
|
|
+ if self.VM!.isChangeServer(){
|
|
|
+ self.VM?.server = accountModel.server
|
|
|
+ }
|
|
|
+ self.VM?.updateSymbols(symbol: model.symbol)
|
|
|
+ pop.dismissAlert()
|
|
|
+
|
|
|
+ }else if index == 2{
|
|
|
+ let vc = MarketDetailViewController()
|
|
|
+
|
|
|
+ let symbolModel = KSymbolModel()
|
|
|
+ vc.symbolModel = m.SymbolModel
|
|
|
+ currentVc()?.navigationController?.pushViewController(vc, animated: true)
|
|
|
+ pop.dismissAlert()
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|