Kaynağa Gözat

持币A修改,平仓的alert操作等。

culturetown 11 ay önce
ebeveyn
işleme
d91a41e68d
18 değiştirilmiş dosya ile 967 ekleme ve 13 silme
  1. 10 2
      Koala/Koala.xcodeproj/project.pbxproj
  2. BIN
      Koala/Koala.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate
  3. 172 0
      Koala/Koala/Modular/JDTrade/V/JDClosePositionAlertView.swift
  4. 317 0
      Koala/Koala/Modular/JDTrade/V/JDPositionModifyAlertView.swift
  5. 336 11
      Koala/Koala/Modular/JDTrade/V/JDTradeHoldAlertView.swift
  6. 44 0
      Koala/Koala/Modular/JDTrade/VC/JDTradeAccountHoldViewController.swift
  7. 22 0
      Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_jy.imageset/Contents.json
  8. BIN
      Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_jy.imageset/股票-首页备份 2@2x.png
  9. BIN
      Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_jy.imageset/股票-首页备份 2@3x.png
  10. 22 0
      Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_pc.imageset/Contents.json
  11. BIN
      Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_pc.imageset/股票-首页@2x.png
  12. BIN
      Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_pc.imageset/股票-首页@3x.png
  13. 22 0
      Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_tb.imageset/Contents.json
  14. BIN
      Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_tb.imageset/股票-首页备份 3@2x.png
  15. BIN
      Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_tb.imageset/股票-首页备份 3@3x.png
  16. 22 0
      Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_xg.imageset/Contents.json
  17. BIN
      Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_xg.imageset/股票-首页备份@2x.png
  18. BIN
      Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_xg.imageset/股票-首页备份@3x.png

+ 10 - 2
Koala/Koala.xcodeproj/project.pbxproj

@@ -178,6 +178,8 @@
 		04D38EC92AB29F370047EF9C /* JDKLineBuySellListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D38EC82AB29F370047EF9C /* JDKLineBuySellListCell.swift */; };
 		04D38ECB2AB2AEE50047EF9C /* JDKLineFooterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D38ECA2AB2AEE50047EF9C /* JDKLineFooterView.swift */; };
 		04DFBC5D2AE6052B00DCDAC9 /* JDTradeHoldAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04DFBC5C2AE6052B00DCDAC9 /* JDTradeHoldAlertView.swift */; };
+		04DFBC642AE655D100DCDAC9 /* JDClosePositionAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04DFBC632AE655D100DCDAC9 /* JDClosePositionAlertView.swift */; };
+		04DFBC662AE6742600DCDAC9 /* JDPositionModifyAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04DFBC652AE6742600DCDAC9 /* JDPositionModifyAlertView.swift */; };
 		07A5371E1CD0AE4D76CE3EBC /* Pods_Koala.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FFAC9892D9177FDC3F65E17A /* Pods_Koala.framework */; };
 		19B417AE60F7F1F33018BE88 /* Pods_KoalaUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8A9084706CDFB6F5F3946999 /* Pods_KoalaUITests.framework */; };
 		6C00A877242D8FEA00CE9ADB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C00A876242D8FEA00CE9ADB /* AppDelegate.swift */; };
@@ -1034,6 +1036,8 @@
 		04D38EC82AB29F370047EF9C /* JDKLineBuySellListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JDKLineBuySellListCell.swift; sourceTree = "<group>"; };
 		04D38ECA2AB2AEE50047EF9C /* JDKLineFooterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JDKLineFooterView.swift; sourceTree = "<group>"; };
 		04DFBC5C2AE6052B00DCDAC9 /* JDTradeHoldAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JDTradeHoldAlertView.swift; sourceTree = "<group>"; };
+		04DFBC632AE655D100DCDAC9 /* JDClosePositionAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JDClosePositionAlertView.swift; sourceTree = "<group>"; };
+		04DFBC652AE6742600DCDAC9 /* JDPositionModifyAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JDPositionModifyAlertView.swift; sourceTree = "<group>"; };
 		423FA80C24E31DB21F96D68B /* Pods-KoalaTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-KoalaTests.release.xcconfig"; path = "Target Support Files/Pods-KoalaTests/Pods-KoalaTests.release.xcconfig"; sourceTree = "<group>"; };
 		679DC283B50509B42172D70F /* Pods-Koala.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Koala.debug.xcconfig"; path = "Target Support Files/Pods-Koala/Pods-Koala.debug.xcconfig"; sourceTree = "<group>"; };
 		6C00A873242D8FEA00CE9ADB /* Koala.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Koala.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -2107,6 +2111,8 @@
 				041D4F1B2AD28DF6008ABDF7 /* JDHistoryDateSegmentView.swift */,
 				04282A462ADD3D1900CB4260 /* JDTradeMainMenuCell.swift */,
 				04DFBC5C2AE6052B00DCDAC9 /* JDTradeHoldAlertView.swift */,
+				04DFBC632AE655D100DCDAC9 /* JDClosePositionAlertView.swift */,
+				04DFBC652AE6742600DCDAC9 /* JDPositionModifyAlertView.swift */,
 			);
 			path = V;
 			sourceTree = "<group>";
@@ -4601,6 +4607,7 @@
 				041D4F1E2AD2B0FC008ABDF7 /* JDMineHeaderView.swift in Sources */,
 				6C00A8F8242D918D00CE9ADB /* ESTabBarItemBadgeView.swift in Sources */,
 				6C2FFCBF29618271005B8180 /* FreezeAccountView.swift in Sources */,
+				04DFBC642AE655D100DCDAC9 /* JDClosePositionAlertView.swift in Sources */,
 				6CBB62DD2AD828990045A4C9 /* MDAnnouncementView.swift in Sources */,
 				6CBDC91E297AE49A003E068F /* KLinePeriod.swift in Sources */,
 				6C00A918242D918D00CE9ADB /* PhotoManager.swift in Sources */,
@@ -4643,6 +4650,7 @@
 				04C4CB1A2AD51420004CA35E /* JDMineVipCell.swift in Sources */,
 				6C00A901242D918D00CE9ADB /* UILable+CategoryClass.swift in Sources */,
 				6C10F08D29DB087700B79491 /* UpdateView.swift in Sources */,
+				04DFBC662AE6742600DCDAC9 /* JDPositionModifyAlertView.swift in Sources */,
 				04C283142AD5371300FC04AC /* JDMineInviteCell.swift in Sources */,
 				6C00A8FF242D918D00CE9ADB /* UINavigation+categoryClass.swift in Sources */,
 				6CA71322295807740047F450 /* BaseInputView.swift in Sources */,
@@ -5075,7 +5083,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 1.0.3;
+				MARKETING_VERSION = 1.0.4;
 				PRODUCT_BUNDLE_IDENTIFIER = com.jiduclient.app;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@@ -5108,7 +5116,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 1.0.3;
+				MARKETING_VERSION = 1.0.4;
 				PRODUCT_BUNDLE_IDENTIFIER = com.jiduclient.app;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";

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


+ 172 - 0
Koala/Koala/Modular/JDTrade/V/JDClosePositionAlertView.swift

@@ -0,0 +1,172 @@
+//
+//  JDClosePositionAlertView.swift
+//  Koala
+//
+//  Created by mac on 2023/10/23.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import Foundation
+import UIKit
+class JDClosePositionAlertView: BaseAlertView {
+
+    
+    lazy var bgView : UIView = {
+        let v = UIView()
+        v.backgroundColor = .white
+        return v
+    }()
+    
+    lazy var titleLb : UILabel = {
+        let v = UILabel()
+        v.textColor = _color("#333333&#333333")
+        v.setTextFont(.PFSM, 18)
+        v.text = switchLanguage("市价平仓")
+        return v
+    }()
+    
+    lazy var detailLb : UILabel = {
+        let v = UILabel()
+        v.textColor = _color("#AEAEAE&#AEAEAE")
+        v.setTextFont(.PFSR, 12)
+        v.text = "ID:2041 sell stop 1.00 601398.SH 于 4.78"
+        return v
+    }()
+    
+    
+    lazy var resetBtn : UIButton = {
+        let v = UIButton(type: .custom)
+        v.setTitle(switchLanguage("取消"), for: .normal)
+        v.setTitleColor(_color("#4F4F4F&#4F4F4F"), for: .normal)
+        v.setTextFont(.PFSM, 16)
+        v.backgroundColor = _color("#F4F8F9&#F4F8F9")
+        v.layer.masksToBounds = true
+        v.layer.cornerRadius = 6
+        return v
+    }()
+    
+    lazy var confirmBtn : UIButton = {
+        let v = UIButton(type: .custom)
+        v.setTitle(switchLanguage("确定"), for: .normal)
+        v.setTitleColor(_color("#FEFFFF&#FEFFFF"), for: .normal)
+        v.setTextFont(.PFSM, 16)
+        v.backgroundColor = MainBackGroundColor
+        v.layer.masksToBounds = true
+        v.layer.cornerRadius = 6
+        return v
+    }()
+    
+    
+    
+    var itemModel : JDPositionModel?
+  
+    
+    lazy var topCloseBtn : UIButton = {
+        
+        let v = UIButton(type: .custom)
+        v.backgroundColor = .clear
+        v.addTarget(self, action: #selector(clickCloseBtnAction), for: .touchUpInside)
+        return v
+    }()
+    
+    var completeBlock: ((_ index:NSInteger)->())?
+    
+
+    
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+
+        self.addSubview(bgView)
+        bgView.snp.makeConstraints { make in
+            make.top.left.right.equalTo(self)
+            make.height.equalTo(200)
+        }
+        
+        bgView.addSubview(titleLb)
+        
+        titleLb.snp.makeConstraints { make in
+            make.left.equalTo(bgView.snp.left).offset(17)
+            make.top.equalTo(bgView.snp.top).offset(StatusBarHeight+10)
+        }
+        
+        
+        bgView.addSubview(detailLb)
+        detailLb.snp.makeConstraints { make in
+            make.left.equalTo(titleLb.snp.left)
+            make.top.equalTo(titleLb.snp.bottom).offset(10)
+        }
+        bgView.addSubview(resetBtn)
+        
+        
+        resetBtn.snp.makeConstraints { make in
+            make.left.equalTo(bgView.snp.left).offset(17)
+            make.right.equalTo(bgView.snp.centerX).offset(-6)
+            make.bottom.equalTo(bgView.snp.bottom).offset(-17)
+            make.height.equalTo(41)
+        }
+        
+        
+        bgView.addSubview(confirmBtn)
+        confirmBtn.snp.makeConstraints { make in
+            make.left.equalTo(bgView.snp.centerX).offset(6)
+            make.right.equalTo(bgView.snp.right).offset(-17)
+            make.height.equalTo(41)
+            make.centerY.equalTo(resetBtn)
+        }
+        
+        
+        self.addSubview(topCloseBtn)
+        topCloseBtn.snp.makeConstraints { make in
+            make.left.bottom.right.equalTo(self)
+            make.top.equalTo(bgView.snp.bottom)
+        }
+
+        
+//        self.closeBtn.addTarget(self, action: #selector(clickCloseBtnAction), for: .touchUpInside)
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+    }
+    
+    override func dismissAlert() -> Void {
+        super.dismissAlert()
+        UIView.animate(withDuration: 0.3, animations: {
+            self.frame = CGRect(x: 0, y: -SCREEN_HEIGHT, width: SCREEN_WIDTH, height: SCREEN_HEIGHT)
+        }) { (complete) in
+            self.bgView.removeFromSuperview()
+            if self.superview != nil {
+                self.removeFromSuperview()
+            }
+        }
+        
+    }
+    
+    @objc func clickCloseBtnAction(){
+        dismissAlert()
+    }
+   
+}
+
+extension JDClosePositionAlertView{
+    func showPopupView(model: JDPositionModel, complete:@escaping (_ index: NSInteger)->()) -> Void {
+     
+        
+        completeBlock = complete
+        self.itemModel = model
+      
+        self.backgroundColor = Popup_Bg_Back_Color
+        
+        let app = UIApplication.shared.delegate as? AppDelegate
+        let window = app?.window
+        window?.addSubview(self)
+        
+        self.frame = CGRect(x: 0, y: -SCREEN_HEIGHT, width: SCREEN_WIDTH, height: SCREEN_HEIGHT)
+       
+       
+        UIView.animate(withDuration: 0.3) {
+            self.frame = CGRect(x: 0, y: 0, width: SCREEN_WIDTH, height: SCREEN_HEIGHT)
+        }
+    }
+    
+}

+ 317 - 0
Koala/Koala/Modular/JDTrade/V/JDPositionModifyAlertView.swift

@@ -0,0 +1,317 @@
+//
+//  JDPositionModifyAlertView.swift
+//  Koala
+//
+//  Created by mac on 2023/10/23.
+//  Copyright © 2023 刘千军. All rights reserved.
+//
+
+import Foundation
+import UIKit
+class JDPositionModifyAlertView: BaseAlertView {
+
+    
+    lazy var bgView : UIView = {
+        let v = UIView()
+        v.backgroundColor = .white
+        return v
+    }()
+    
+    lazy var titleLb : UILabel = {
+        let v = UILabel()
+        v.textColor = _color("#333333&#333333")
+        v.setTextFont(.PFSM, 18)
+        v.text = switchLanguage("修改持仓订单")
+        return v
+    }()
+    
+    lazy var detailLb : UILabel = {
+        let v = UILabel()
+        v.textColor = _color("#AEAEAE&#AEAEAE")
+        v.setTextFont(.PFSR, 12)
+        v.text = "ID:2041 sell stop 1.00 601398.SH 于 4.78"
+        return v
+    }()
+    
+    var type:Int = 0 //0 持仓, 1 挂单
+    var loss:String = ""
+    var price:String = ""
+    
+    
+    lazy var stopLossInputView : DealInputView = {
+        let v = DealInputView()
+        v.setTextPlaceholder(text: "0.00")
+        v.setTitleText(text: switchLanguage("止损价"))
+        
+//        v.textField.addTarget(self, action:  #selector(inputChange(_:)), for: .editingChanged)
+        v.clickMinusBlock = {[weak self] in
+//            self?.recoverInputViewBorderColor()
+            guard conerData(self?.loss as Any, .MyDouble).2! > 0 else{
+                return
+            }
+            self?.stopLossInputView.bgView.updateLayerBorderColor(color: BlueViewColor)
+            var num:String = self?.loss ?? "0"
+            self?.loss = decimalNumber(A: num, B: "0.01", type: .Subtract)
+            if conerData(self?.loss as Any, .MyDouble).2! <= 0 {
+                self?.loss = ""
+                self?.stopLossInputView.bgView.updateLayerBorderColor(color: ViewBorderColor)
+            }
+            self?.stopLossInputView.textField.text = self?.loss
+        }
+        
+        v.clickAddBlock = {[weak self] in
+//            self?.recoverInputViewBorderColor()
+            self?.stopLossInputView.bgView.updateLayerBorderColor(color: BlueViewColor)
+            var num:String = self?.loss ?? "0"
+            if num.length == 0 {
+                num = "0"
+            }
+            self?.loss = decimalNumber(A: num, B: "0.01", type: .Add)
+            self?.stopLossInputView.textField.text = self?.loss
+        }
+        
+        return v
+    }()
+    
+    lazy var stopGainInputView : DealInputView = {
+        let v = DealInputView()
+        v.setTextPlaceholder(text: "0.00")
+        v.setTitleText(text: switchLanguage("止盈价"))
+        
+//        v.textField.delegate = self
+//        v.textField.addTarget(self, action:  #selector(inputChange(_:)), for: .editingChanged)
+        v.clickMinusBlock = {[weak self] in
+//            self?.recoverInputViewBorderColor()
+            guard conerData(self?.price ?? "0", .MyDouble).2! > 0 else{
+                return
+            }
+            var num:String = self?.price ?? "0"
+            self?.stopGainInputView.bgView.updateLayerBorderColor(color: BlueViewColor)
+            self?.price = decimalNumber(A: num, B: "0.01", type: .Subtract)
+            if conerData(self?.price ?? "0", .MyDouble).2! <= 0 {
+                self?.price  = ""
+                self?.stopGainInputView.bgView.updateLayerBorderColor(color: ViewBorderColor)
+            }
+            self?.stopGainInputView.textField.text = self?.price
+        }
+        
+        v.clickAddBlock = {[weak self] in
+//            self?.recoverInputViewBorderColor()
+            self?.stopGainInputView.bgView.updateLayerBorderColor(color: BlueViewColor)
+            var num:String = self?.price ?? "0"
+            if num.length == 0 {
+                num = "0"
+            }
+            self?.price = decimalNumber(A: num, B: "0.01", type: .Add)
+            self?.stopGainInputView.textField.text = self?.price
+        }
+        return v
+    }()
+    
+    
+    lazy var resetBtn : UIButton = {
+        let v = UIButton(type: .custom)
+        v.setTitle(switchLanguage("取消"), for: .normal)
+        v.setTitleColor(_color("#4F4F4F&#4F4F4F"), for: .normal)
+        v.setTextFont(.PFSM, 16)
+        v.backgroundColor = _color("#F4F8F9&#F4F8F9")
+        v.layer.masksToBounds = true
+        v.layer.cornerRadius = 6
+        return v
+    }()
+    
+    lazy var confirmBtn : UIButton = {
+        let v = UIButton(type: .custom)
+        v.setTitle(switchLanguage("确定"), for: .normal)
+        v.setTitleColor(_color("#FEFFFF&#FEFFFF"), for: .normal)
+        v.setTextFont(.PFSM, 16)
+        v.backgroundColor = MainBackGroundColor
+        v.layer.masksToBounds = true
+        v.layer.cornerRadius = 6
+        return v
+    }()
+    
+    
+    
+    var itemModel : JDPositionModel?
+  
+    
+    lazy var topCloseBtn : UIButton = {
+        
+        let v = UIButton(type: .custom)
+        v.backgroundColor = .clear
+        v.addTarget(self, action: #selector(clickCloseBtnAction), for: .touchUpInside)
+        return v
+    }()
+    
+    var completeBlock: ((_ index:NSInteger)->())?
+    
+
+    
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+
+        self.addSubview(bgView)
+        bgView.snp.makeConstraints { make in
+            make.top.left.right.equalTo(self)
+            make.height.equalTo(360)
+        }
+        
+        bgView.addSubview(titleLb)
+        
+        titleLb.snp.makeConstraints { make in
+            make.left.equalTo(bgView.snp.left).offset(17)
+            make.top.equalTo(bgView.snp.top).offset(StatusBarHeight+10)
+        }
+        
+        
+        bgView.addSubview(detailLb)
+        detailLb.snp.makeConstraints { make in
+            make.left.equalTo(titleLb.snp.left)
+            make.top.equalTo(titleLb.snp.bottom).offset(10)
+        }
+        
+        bgView.addSubview(stopLossInputView)
+        stopLossInputView.snp.makeConstraints { make in
+            make.left.equalTo(titleLb.snp.left)
+            make.top.equalTo(detailLb.snp.bottom)
+            make.right.equalTo(bgView.snp.right).offset(-17)
+            make.height.equalTo(80)
+        }
+        
+        
+        bgView.addSubview(stopGainInputView)
+        
+        stopGainInputView.snp.makeConstraints { make in
+            make.top.equalTo(stopLossInputView.snp.bottom)
+            make.left.right.height.equalTo(stopLossInputView)
+        }
+        
+        bgView.addSubview(resetBtn)
+        
+        
+        resetBtn.snp.makeConstraints { make in
+            make.left.equalTo(bgView.snp.left).offset(17)
+            make.right.equalTo(bgView.snp.centerX).offset(-6)
+            make.bottom.equalTo(bgView.snp.bottom).offset(-17)
+            make.height.equalTo(41)
+        }
+        
+        
+        bgView.addSubview(confirmBtn)
+        confirmBtn.snp.makeConstraints { make in
+            make.left.equalTo(bgView.snp.centerX).offset(6)
+            make.right.equalTo(bgView.snp.right).offset(-17)
+            make.height.equalTo(41)
+            make.centerY.equalTo(resetBtn)
+        }
+        
+        
+        self.addSubview(topCloseBtn)
+        topCloseBtn.snp.makeConstraints { make in
+            make.left.bottom.right.equalTo(self)
+            make.top.equalTo(bgView.snp.bottom)
+        }
+
+        
+//        self.closeBtn.addTarget(self, action: #selector(clickCloseBtnAction), for: .touchUpInside)
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+    }
+    
+    override func dismissAlert() -> Void {
+        super.dismissAlert()
+        UIView.animate(withDuration: 0.3, animations: {
+            self.frame = CGRect(x: 0, y: -SCREEN_HEIGHT, width: SCREEN_WIDTH, height: SCREEN_HEIGHT)
+        }) { (complete) in
+            self.bgView.removeFromSuperview()
+            if self.superview != nil {
+                self.removeFromSuperview()
+            }
+        }
+        
+    }
+    
+    @objc func clickCloseBtnAction(){
+        dismissAlert()
+    }
+   
+}
+
+extension JDPositionModifyAlertView{
+    func showPopupView(model: JDPositionModel, complete:@escaping (_ index: NSInteger)->()) -> Void {
+     
+        
+        completeBlock = complete
+        self.itemModel = model
+      
+        self.backgroundColor = Popup_Bg_Back_Color
+        
+        let app = UIApplication.shared.delegate as? AppDelegate
+        let window = app?.window
+        window?.addSubview(self)
+        
+        self.frame = CGRect(x: 0, y: -SCREEN_HEIGHT, width: SCREEN_WIDTH, height: SCREEN_HEIGHT)
+       
+       
+        UIView.animate(withDuration: 0.3) {
+            self.frame = CGRect(x: 0, y: 0, width: SCREEN_WIDTH, height: SCREEN_HEIGHT)
+        }
+    }
+    
+}
+
+
+
+class JDPositionSetPriceInputView: UIView {
+    
+    lazy var titleLb : UILabel = {
+        let v = UILabel()
+        v.textColor = _color("#AEAEAE&#AEAEAE")
+        v.setTextFont(.PFSR, 14)
+        v.text = "止损价"
+        return v
+    }()
+    
+    
+    lazy var bgView : UIView = {
+        let v = UIView()
+        v.backgroundColor = .white
+        v.layer.masksToBounds = true
+        v.layer.cornerRadius = 3
+        v.layer.borderWidth = 1
+        v.layer.borderColor = _color("#EDEDED&#EDEDED").cgColor
+        return v
+    }()
+    
+    
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        self.addSubview(titleLb)
+        titleLb.snp.makeConstraints { make in
+            make.top.equalTo(self.snp.top).offset(8)
+            make.left.equalTo(self.snp.left)
+        }
+        
+        
+        
+        self.addSubview(bgView)
+        bgView.snp.makeConstraints { make in
+            make.top.equalTo(titleLb.snp.bottom).offset(4)
+            make.left.right.equalTo(self)
+            make.height.equalTo(40)
+        }
+        
+    }
+    
+    required init?(coder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    
+    
+    
+    
+}

+ 336 - 11
Koala/Koala/Modular/JDTrade/V/JDTradeHoldAlertView.swift

@@ -16,6 +16,8 @@ class JDTradeHoldAlertView: BaseAlertView {
         
         return v
     }()
+    
+    var itemModel : JDPositionModel?
   
     
     lazy var topCloseBtn : UIButton = {
@@ -26,6 +28,11 @@ class JDTradeHoldAlertView: BaseAlertView {
         return v
     }()
     
+    var titleAry = ["",switchLanguage("平仓") , switchLanguage("修改") , switchLanguage("交易"),switchLanguage("图标")]
+    
+    
+    
+    var iconAry = ["","jd_trade_alert_pc", "jd_trade_alert_xg", "jd_trade_alert_jy","jd_trade_alert_tb"]
     
     
     lazy var tableView : UITableView = {
@@ -33,17 +40,17 @@ class JDTradeHoldAlertView: BaseAlertView {
         tableView.delegate = self
         tableView.dataSource = self
         tableView.separatorStyle = .none
-        tableView.backgroundColor = .white
+        tableView.backgroundColor = _color("#F3F4F6&#F3F4F6")
         tableView.tableFooterView = UIView()
         tableView.tableHeaderView = UIView()
         tableView.showsVerticalScrollIndicator = false
         tableView.showsVerticalScrollIndicator = false
-        tableView.estimatedRowHeight = 60
+        tableView.estimatedRowHeight = 160
         tableView.layer.masksToBounds = true
         tableView.layer.cornerRadius = 10
 
-        tableView.register(JDAFiatAccountBalanceCell.self, forCellReuseIdentifier: JDAFiatAccountBalanceCell.description())
-        
+        tableView.register(JDTradeAlertInfoCell.self, forCellReuseIdentifier: JDTradeAlertInfoCell.description())
+        tableView.register(JDTradeAlertCell.self, forCellReuseIdentifier: JDTradeAlertCell.description())
         return tableView
         
     }()
@@ -67,7 +74,7 @@ class JDTradeHoldAlertView: BaseAlertView {
         self.addSubview(tableView)
         tableView.snp.makeConstraints { make in
             make.left.right.equalTo(self)
-            make.bottom.equalTo(self.snp.top).offset(6)
+            make.bottom.equalTo(self.snp.bottom)
             make.top.equalTo(self.snp.centerY).offset(-6)
         }
 //        self.closeBtn.addTarget(self, action: #selector(clickCloseBtnAction), for: .touchUpInside)
@@ -97,10 +104,11 @@ class JDTradeHoldAlertView: BaseAlertView {
 }
 
 extension JDTradeHoldAlertView{
-    func showPopupView(source:[JDTradeAccountModel], complete:@escaping (_ index: NSInteger)->()) -> Void {
+    func showPopupView(model: JDPositionModel, complete:@escaping (_ index: NSInteger)->()) -> Void {
      
+        
         completeBlock = complete
-        self.sourceArray = source
+        self.itemModel = model
       
         self.backgroundColor = Popup_Bg_Back_Color
         
@@ -121,19 +129,32 @@ extension JDTradeHoldAlertView{
 extension JDTradeHoldAlertView:UITableViewDelegate,UITableViewDataSource{
     
     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return self.sourceArray.count
+        return self.titleAry.count
     }
     
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
         
-        let cell = tableView.dequeueReusableCell(withIdentifier: JDAFiatAccountBalanceCell.description()) as! JDAFiatAccountBalanceCell
-        cell.setupBalanceCellByAccount(model: self.sourceArray[indexPath.row])
+        if indexPath.row == 0 {
+       
+            let cell = tableView.dequeueReusableCell(withIdentifier: JDTradeAlertInfoCell.description()) as! JDTradeAlertInfoCell
+            return cell
+            
+        }
+        
+        let cell = tableView.dequeueReusableCell(withIdentifier: JDTradeAlertCell.description()) as! JDTradeAlertCell
+        cell.iconIv.image = UIImage(named: iconAry[indexPath.row])
+        cell.titleLb.text = titleAry[indexPath.row]
         
         return cell
         
     }
     
     func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
+        
+        if indexPath.row == 0 {
+            return 180
+        }
+        
         return -1
     }
     
@@ -149,6 +170,310 @@ extension JDTradeHoldAlertView:UITableViewDelegate,UITableViewDataSource{
     
     func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
         self.completeBlock?(indexPath.row)
-        dismissAlert()
+//        dismissAlert()
     }
 }
+
+
+class JDTradeAlertInfoCell: BaseTableViewCell {
+    
+    lazy var bgView : UIView = {
+        let v = UIView()
+        v.backgroundColor = .white
+        v.layer.masksToBounds = true
+        v.layer.cornerRadius = 6.4
+        return v
+    }()
+    
+    lazy var leftLineView : UIView = {
+        let v = UIView()
+        v.backgroundColor = MainBackGroundColor
+//        v.layer.masksToBounds = true
+//        v.layer.cornerRadius = 6.4
+        return v
+    }()
+    
+    
+    
+    lazy var idLb : UILabel = {
+        let v = UILabel()
+        v.textColor = _color("#949494&#949494")
+        v.setTextFont(.PFSR, 14)
+        v.text = "#201542158"
+        return v
+    }()
+    
+    lazy var buyInLb : UILabel = {
+        let v = UILabel()
+        v.textColor = _color("#AEAEAE&#AEAEAE")
+        v.setTextFont(.PFSR, 14)
+        v.text = "买入 1.0"
+        return v
+    }()
+    
+    lazy var upLb : UILabel = {
+        let v = UILabel()
+        v.textColor = _color("#F24040&#F24040")
+        v.setTextFont(.PFSR, 16)
+        v.text = "+3995.50"
+        
+        return v
+    }()
+    
+    lazy var nameLb : UILabel = {
+        let v = UILabel()
+        v.textColor = _color("#333333&#333333")
+        v.setTextFont(.PFSM, 18)
+        v.text = "特斯拉"
+        
+        return v
+    }()
+    
+    lazy var symbolLb : UILabel = {
+        let v = UILabel()
+        v.textColor = _color("#AEAEAE&#AEAEAE")
+        v.setTextFont(.PFSR, 12)
+        v.text = "TSLA"
+        return v
+    }()
+    
+    lazy var timeLb : UILabel = {
+        let v = UILabel()
+        v.textColor = _color("#AEAEAE&#AEAEAE")
+        v.setTextFont(.PFSR, 12)
+        v.text = "2023.08.22 13:04:45"
+        return v
+    }()
+    
+    lazy var szLb : UILabel = {
+        let v = UILabel()
+        v.textColor = _color("#AEAEAE&#AEAEAE")
+        v.setTextFont(.PFSR, 14)
+        v.text = "市值:135000.55"
+        return v
+    }()
+    
+    
+    lazy var upDownLb : UILabel = {
+        let v = UILabel()
+        v.textColor = _color("#AEAEAE&#AEAEAE")
+        v.setTextFont(.PFSR, 12)
+        v.text = "135.55-> 138.99"
+        return v
+    }()
+    
+    
+    lazy var stopLossLb : UILabel = {
+        let v = UILabel()
+        v.textColor = _color("#AEAEAE&#AEAEAE")
+        v.setTextFont(.PFSR, 12)
+        v.text = "止损: --"
+        return v
+    }()
+    
+    lazy var stopGainLb : UILabel = {
+        let v = UILabel()
+        v.textColor = _color("#AEAEAE&#AEAEAE")
+        v.setTextFont(.PFSR, 12)
+        v.text = "止盈: --"
+        return v
+    }()
+    
+    lazy var lxLb : UILabel = {
+        let v = UILabel()
+        v.textColor = _color("#AEAEAE&#AEAEAE")
+        v.setTextFont(.PFSR, 12)
+        v.text = "利息: 25.00"
+        return v
+    }()
+    
+    lazy var feeLb : UILabel = {
+        let v = UILabel()
+        v.textColor = _color("#AEAEAE&#AEAEAE")
+        v.setTextFont(.PFSR, 12)
+        v.text = "手续费: 25.00"
+        return v
+    }()
+    
+    
+    
+    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
+        super.init(style: style, reuseIdentifier: reuseIdentifier)
+        
+        contentView.backgroundColor = .clear
+        self.backgroundColor = .clear
+        contentView.addSubview(bgView)
+        bgView.snp.makeConstraints { make in
+            make.left.equalTo(contentView.snp.left).offset(17)
+            make.right.equalTo(contentView.snp.right).offset(-17)
+            make.top.equalTo(contentView.snp.top).offset(17)
+            make.bottom.equalTo(contentView.snp.bottom).offset(-2)
+        }
+        bgView.addSubview(leftLineView)
+        leftLineView.snp.makeConstraints { make in
+            make.left.top.bottom.equalTo(bgView)
+            make.width.equalTo(6)
+        }
+        
+        bgView.addSubview(idLb)
+        idLb.snp.makeConstraints { make in
+            make.top.equalTo(bgView.snp.top).offset(18)
+            make.left.equalTo(leftLineView.snp.right).offset(7)
+        }
+        
+        bgView.addSubview(buyInLb)
+        buyInLb.snp.makeConstraints { make in
+            make.centerY.equalTo(idLb)
+            make.left.equalTo(idLb.snp.right).offset(18)
+        }
+        
+        bgView.addSubview(upLb)
+        upLb.snp.makeConstraints { make in
+            make.centerY.equalTo(idLb)
+            make.right.equalTo(bgView.snp.right).offset(-15)
+        }
+        
+        bgView.addSubview(nameLb)
+        nameLb.snp.makeConstraints { make in
+            make.left.equalTo(idLb.snp.left)
+            make.top.equalTo(idLb.snp.bottom).offset(12)
+        }
+        
+        bgView.addSubview(szLb)
+        szLb.snp.makeConstraints { make in
+            make.centerY.equalTo(nameLb)
+            make.right.equalTo(bgView.snp.right).offset(-15)
+        }
+        bgView.addSubview(symbolLb)
+        symbolLb.snp.makeConstraints { make in
+            make.left.equalTo(idLb.snp.left)
+            make.top.equalTo(nameLb.snp.bottom).offset(8)
+        }
+        bgView.addSubview(upDownLb)
+        upDownLb.snp.makeConstraints { make in
+            make.centerY.equalTo(symbolLb)
+            make.right.equalTo(szLb.snp.right)
+        }
+        
+        bgView.addSubview(timeLb)
+        timeLb.snp.makeConstraints { make in
+            make.left.equalTo(idLb.snp.left)
+            make.top.equalTo(timeLb.snp.bottom).offset(8)
+        }
+        
+        bgView.addSubview(stopLossLb)
+        stopLossLb.snp.makeConstraints { make in
+            make.left.equalTo(idLb.snp.left)
+            make.top.equalTo(timeLb.snp.bottom).offset(11)
+            
+            
+        }
+        
+        bgView.addSubview(stopGainLb)
+        stopGainLb.snp.makeConstraints { make in
+            make.left.equalTo(stopLossLb.snp.left)
+            make.top.equalTo(stopLossLb.snp.bottom).offset(8)
+            make.bottom.equalTo(bgView.snp.bottom).offset(-16)
+        }
+        bgView.addSubview(lxLb)
+        lxLb.snp.makeConstraints { make in
+            make.centerY.equalTo(stopLossLb.snp.centerY)
+            make.right.equalTo(szLb.snp.right)
+        }
+        
+        bgView.addSubview(feeLb)
+        feeLb.snp.makeConstraints { make in
+            make.centerY.equalTo(stopGainLb)
+            make.right.equalTo(lxLb.snp.right)
+            
+        }
+        
+        
+        
+        
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    
+    
+    
+}
+
+class JDTradeAlertCell : BaseTableViewCell {
+    
+    lazy var bgView : UIView = {
+        let v = UIView()
+        v.backgroundColor = .white
+        v.layer.masksToBounds = true
+        v.layer.cornerRadius = 6.4
+        v.layer.borderColor = _color("#E7E7E7&#E7E7E7").cgColor
+        v.layer.borderWidth = 0.8
+        return v
+    }()
+    
+    lazy var iconIv : UIImageView = {
+        let v = UIImageView()
+        
+        return v
+    }()
+    
+    lazy var titleLb : UILabel = {
+        let v = UILabel()
+        v.textColor = _color("#333333&#333333")
+        v.setTextFont(.PFSR, 16)
+        return v
+    }()
+    
+    lazy var arrowIv : UIImageView = {
+        let v = UIImageView()
+        v.image = _image("Base_W_RightArrows&Base_W_RightArrows")
+        return v
+    }()
+    
+    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
+        super.init(style: style, reuseIdentifier: reuseIdentifier)
+        
+        contentView.backgroundColor = .clear
+        self.backgroundColor = .clear
+        contentView.addSubview(bgView)
+        bgView.snp.makeConstraints { make in
+            make.left.equalTo(contentView.snp.left).offset(17)
+            make.right.equalTo(contentView.snp.right).offset(-17)
+            make.top.equalTo(contentView.snp.top).offset(2)
+            make.bottom.equalTo(contentView.snp.bottom).offset(-2)
+        }
+        bgView.addSubview(iconIv)
+        
+        iconIv.snp.makeConstraints { make in
+//            make.centerY.equalTo(bgView)
+            
+            make.top.equalTo(bgView.snp.top).offset(10)
+            make.bottom.equalTo(bgView.snp.bottom).offset(-10)
+            make.left.equalTo(bgView.snp.left).offset(12)
+            make.size.equalTo(CGSize(width: 24, height: 24))
+        }
+        
+        bgView.addSubview(titleLb)
+        titleLb.snp.makeConstraints { make in
+            make.left.equalTo(iconIv.snp.right).offset(8)
+            make.centerY.equalTo(iconIv)
+        }
+        
+        bgView.addSubview(arrowIv)
+        arrowIv.snp.makeConstraints { make in
+            make.centerY.equalTo(iconIv)
+            make.right.equalTo(bgView.snp.right).offset(-11)
+            make.size.equalTo(CGSize(width: 5, height: 10))
+        }
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    
+    
+}

+ 44 - 0
Koala/Koala/Modular/JDTrade/VC/JDTradeAccountHoldViewController.swift

@@ -283,6 +283,50 @@ extension JDTradeAccountHoldViewController: UITableViewDelegate,UITableViewDataS
     func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
         return 70
     }
+ 
+    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
+        tableView.deselectRow(at: indexPath, animated: true)
+        
+        let pop = JDTradeHoldAlertView()
+        
+        
+        let model = self.positionList[indexPath.row]
+        pop.showPopupView(model: model ) { index in
+            
+            if index == 1 {
+                let closePop = JDClosePositionAlertView()
+                
+                closePop.showPopupView(model: model) { index in
+                    
+                }
+                
+            }else if index == 2{
+                
+//                let modifyPop = HoldModificationPopView()
+//                modifyPop.showPopupView(accountModel: AccountInfoModel(), model: model) { index in
+//
+//                }
+                
+                let modifyPop = JDPositionModifyAlertView()
+
+                modifyPop.showPopupView(model: model) { index in
+
+
+
+                }
+                
+            }
+            
+        }
+        
+//        pop.showPopupView { index in
+//
+//            let vc = RealNameViewController()
+//            currentVc()?.navigationController?.pushViewController(vc, animated: true)
+//
+//        }
+        
+    }
     
 }
 

+ 22 - 0
Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_jy.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "股票-首页备份 2@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "股票-首页备份 2@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_jy.imageset/股票-首页备份 2@2x.png


BIN
Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_jy.imageset/股票-首页备份 2@3x.png


+ 22 - 0
Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_pc.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "股票-首页@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "股票-首页@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_pc.imageset/股票-首页@2x.png


BIN
Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_pc.imageset/股票-首页@3x.png


+ 22 - 0
Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_tb.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "股票-首页备份 3@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "股票-首页备份 3@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_tb.imageset/股票-首页备份 3@2x.png


BIN
Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_tb.imageset/股票-首页备份 3@3x.png


+ 22 - 0
Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_xg.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "股票-首页备份@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "股票-首页备份@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_xg.imageset/股票-首页备份@2x.png


BIN
Koala/Koala/Other/Assets.xcassets/JDTrade/jd_trade_alert_xg.imageset/股票-首页备份@3x.png