2 Commits 840d75fd91 ... e2830b014d

Author SHA1 Message Date
  culturetown e2830b014d Merge branch '推广版' of https://git.jdnx.me/tomy/JD_iOS into 推广版 2 weeks ago
  culturetown 23be2496e1 身份证类型选择优化 2 weeks ago

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

@@ -116,6 +116,7 @@
 		0452E22F2B146C5C00F3C2E1 /* MDOptionsPrincipalNoQuoteCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0452E22E2B146C5C00F3C2E1 /* MDOptionsPrincipalNoQuoteCell.swift */; };
 		0452E2312B14700700F3C2E1 /* MDOptionsContactsNoQuoteCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0452E2302B14700700F3C2E1 /* MDOptionsContactsNoQuoteCell.swift */; };
 		0452E2332B147C2B00F3C2E1 /* MDOptionsOrderNoQuoteCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0452E2322B147C2B00F3C2E1 /* MDOptionsOrderNoQuoteCell.swift */; };
+		045BE0ED2C86D2DC00F92EF4 /* JDSelectIdentityTypePopView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045BE0EC2C86D2DC00F92EF4 /* JDSelectIdentityTypePopView.swift */; };
 		045E7DD32B57EEC6008987BA /* JDMessageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045E7DD22B57EEC6008987BA /* JDMessageCell.swift */; };
 		045E7DD82B592C95008987BA /* JDLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045E7DD72B592C95008987BA /* JDLoginViewController.swift */; };
 		045E7DDA2B5A674D008987BA /* JDLoginNewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045E7DD92B5A674D008987BA /* JDLoginNewCell.swift */; };
@@ -1302,6 +1303,7 @@
 		0452E22E2B146C5C00F3C2E1 /* MDOptionsPrincipalNoQuoteCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDOptionsPrincipalNoQuoteCell.swift; sourceTree = "<group>"; };
 		0452E2302B14700700F3C2E1 /* MDOptionsContactsNoQuoteCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDOptionsContactsNoQuoteCell.swift; sourceTree = "<group>"; };
 		0452E2322B147C2B00F3C2E1 /* MDOptionsOrderNoQuoteCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MDOptionsOrderNoQuoteCell.swift; sourceTree = "<group>"; };
+		045BE0EC2C86D2DC00F92EF4 /* JDSelectIdentityTypePopView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JDSelectIdentityTypePopView.swift; sourceTree = "<group>"; };
 		045E7DD22B57EEC6008987BA /* JDMessageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JDMessageCell.swift; sourceTree = "<group>"; };
 		045E7DD72B592C95008987BA /* JDLoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JDLoginViewController.swift; sourceTree = "<group>"; };
 		045E7DD92B5A674D008987BA /* JDLoginNewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JDLoginNewCell.swift; sourceTree = "<group>"; };
@@ -4049,6 +4051,7 @@
 				04BBF5DF2C479B32003137FE /* JDRealNameFileNewCell.swift */,
 				6C031B1D2962C4DA0043BECF /* RealNameFileCell.swift */,
 				6C031B1E2962C4DA0043BECF /* RealNameFileCell.xib */,
+				045BE0EC2C86D2DC00F92EF4 /* JDSelectIdentityTypePopView.swift */,
 			);
 			path = RealName;
 			sourceTree = "<group>";
@@ -5928,6 +5931,7 @@
 				04BAACF52ADE944A00454882 /* JDCashRecordModel.swift in Sources */,
 				65609AE42B9CA32D00085687 /* HorizontalLabelsView.swift in Sources */,
 				65011A2E2B3FF1250046FB03 /* DealTableSectionView.swift in Sources */,
+				045BE0ED2C86D2DC00F92EF4 /* JDSelectIdentityTypePopView.swift in Sources */,
 				04BE17DB2B0C897C006B8FB2 /* SPIndicatorView.swift in Sources */,
 				049416712B887C9D00903BF5 /* JDDepositNewRecordCell.swift in Sources */,
 				6CDC5B0229CF140500E60730 /* AHistoryDetailsViewController.swift in Sources */,

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

@@ -526,8 +526,8 @@
             filePath = "Koala/Modular/Mine/V/RealName/JDRealNameCell.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "602"
-            endingLineNumber = "602"
+            startingLineNumber = "619"
+            endingLineNumber = "619"
             landmarkName = "clickSubmitBtnAction()"
             landmarkType = "7">
          </BreakpointContent>

+ 27 - 9
Koala/Koala/Modular/JDAssets/V/JDIdentityProofInputCell.swift

@@ -157,6 +157,8 @@ class JDIdentityProofInputCell: BaseTableViewCell {
     required init?(coder aDecoder: NSCoder) {
         fatalError("init(coder:) has not been implemented")
     }
+    
+    var selectTypeIndex: Int = -1
 }
 
 
@@ -251,24 +253,40 @@ extension JDIdentityProofInputCell {
     func showSelectTypePopView() {
         self.typeInputView.bgView.removeErrorView()
         self.typeInputView.downArrowsOpenAction()
-        let pop = KMenuPopupMenuView()
+//        let pop = KMenuPopupMenuView()
+        
+        let pop = JDSelectIdentityTypePopView(containerViewHeight: 220)
+        
         var list = [(UIImage, String, Bool)]()
         list = [
             (UIImage(), self.funcLimitVM!.getTypeStr(index: 0).1, true),
             (UIImage(), self.funcLimitVM!.getTypeStr(index: 1).1, true),
             (UIImage(), self.funcLimitVM!.getTypeStr(index: 2).1, true)
         ]
-        
-        pop.showRelyPopupView(view: self.typeInputView.textField, source: list) { [weak self] index in
+  
+        pop.showPopupView(source: list, index: selectTypeIndex) { index, title in
             if index >= 0 {
-                self?.funcLimitVM?.type = (self?.funcLimitVM!.getTypeStr(index: index).0)!
-                self?.funcLimitVM?.typeStr = (self?.funcLimitVM!.getTypeStr(index: index).1)!
-
-                self?.typeInputView.textField.text = self?.funcLimitVM?.typeStr
+                self.funcLimitVM?.type = (self.funcLimitVM!.getTypeStr(index: index).0)
+                self.funcLimitVM?.typeStr = (self.funcLimitVM!.getTypeStr(index: index).1)
+                
+                self.typeInputView.textField.text = self.funcLimitVM?.typeStr
+                
+                self.selectTypeIndex = index
             }
-           
-            self?.typeInputView.downArrowsCloseAction()
+            
+            self.typeInputView.downArrowsCloseAction()
         }
+        
+//        pop.showRelyPopupView(view: self.typeInputView.textField, source: list) { [weak self] index in
+//            if index >= 0 {
+//                self?.funcLimitVM?.type = (self?.funcLimitVM!.getTypeStr(index: index).0)!
+//                self?.funcLimitVM?.typeStr = (self?.funcLimitVM!.getTypeStr(index: index).1)!
+//
+//                self?.typeInputView.textField.text = self?.funcLimitVM?.typeStr
+//            }
+//           
+//            self?.typeInputView.downArrowsCloseAction()
+//        }
     }
     
 }

+ 25 - 8
Koala/Koala/Modular/Mine/V/RealName/JDRealNameCell.swift

@@ -413,6 +413,8 @@ class JDRealNameCell: BaseTableViewCell {
     required init?(coder aDecoder: NSCoder) {
         fatalError("init(coder:) has not been implemented")
     }
+    
+    var selectTypeIndex: Int = -1
 }
 
 extension JDRealNameCell: UITextFieldDelegate {
@@ -514,7 +516,8 @@ extension JDRealNameCell {
     func showSelectTypePopView() {
         self.typeInputView.bgView.removeErrorView()
         self.typeInputView.downArrowsOpenAction()
-        let pop = KMenuPopupMenuView()
+//        let pop = KMenuPopupMenuView()
+        let pop = JDSelectIdentityTypePopView(containerViewHeight: 220)
         var list = [(UIImage, String, Bool)]()
         list = [
             (UIImage(), self.realNameVM!.getTypeStr(index: 0).1, true),
@@ -522,16 +525,30 @@ extension JDRealNameCell {
             (UIImage(), self.realNameVM!.getTypeStr(index: 2).1, true)
         ]
         
-        pop.showRelyPopupView(view: self.typeInputView.textField, source: list) { [weak self] index in
+        
+        pop.showPopupView(source: list, index: selectTypeIndex) { index, title in
             if index >= 0 {
-                self?.realNameVM?.type = (self?.realNameVM!.getTypeStr(index: index).0)!
-                self?.realNameVM?.typeStr = (self?.realNameVM!.getTypeStr(index: index).1)!
-
-                self?.typeInputView.textField.text = self?.realNameVM?.typeStr
+                self.realNameVM?.type = (self.realNameVM!.getTypeStr(index: index).0)
+                self.realNameVM?.typeStr = (self.realNameVM!.getTypeStr(index: index).1)
+            
+                self.typeInputView.textField.text = self.realNameVM?.typeStr
+                
+                self.selectTypeIndex = index
             }
-           
-            self?.typeInputView.downArrowsCloseAction()
+            
+            self.typeInputView.downArrowsCloseAction()
         }
+        
+//        pop.showRelyPopupView(view: self.typeInputView.textField, source: list) { [weak self] index in
+//            if index >= 0 {
+//                self?.realNameVM?.type = (self?.realNameVM!.getTypeStr(index: index).0)!
+//                self?.realNameVM?.typeStr = (self?.realNameVM!.getTypeStr(index: index).1)!
+//
+//                self?.typeInputView.textField.text = self?.realNameVM?.typeStr
+//            }
+//           
+//            self?.typeInputView.downArrowsCloseAction()
+//        }
     }
 }
 

+ 79 - 0
Koala/Koala/Modular/Mine/V/RealName/JDSelectIdentityTypePopView.swift

@@ -0,0 +1,79 @@
+//
+//  JDSelectIdentityTypePopView.swift
+//  Koala
+//
+//  Created by mac on 2024/9/3.
+//  Copyright © 2024 Koala. All rights reserved.
+//
+
+
+import UIKit
+
+class JDSelectIdentityTypePopView: JDBaseTableAlertView {
+    var sourceArray: [(UIImage, String, Bool)] = .init()
+    var selectTitle: String = switchLanguage("身份证")
+
+    var myCompletion: ((_ index: Int, _ title: String) -> Void)?
+
+    override init(containerViewHeight: CGFloat) {
+        super.init(containerViewHeight: containerViewHeight)
+        
+        tableView.rowHeight = 60
+        tableView.register(JDFinancialStatusCell.self, forCellReuseIdentifier: JDFinancialStatusCell.description())
+    }
+
+    @objc func confirmBtnAction() {
+        if let block = myCompletion {
+            block(selectedIndex, selectTitle)
+        }
+        dismissAlert()
+    }
+}
+
+extension JDSelectIdentityTypePopView {
+    func showPopupView(source: [(UIImage, String, Bool)], index: Int, completion: @escaping (_ index: Int, _ title: String) -> Void) {
+        sourceArray = source
+        myCompletion = completion
+        
+        super.showPopupView(selectIndex: index, completion: convertCompletion(completion: completion))
+    }
+    
+    func convertCompletion(completion: @escaping (_ index: Int, _ title: String) -> Void) -> (_ index: Int) -> Void {
+        return { index in
+            completion(index, "")
+        }
+    }
+}
+
+extension JDSelectIdentityTypePopView {
+    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        return sourceArray.count
+    }
+    
+    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+        let cell = tableView.dequeueReusableCell(withIdentifier: JDFinancialStatusCell.description()) as! JDFinancialStatusCell
+        
+        cell.statusLb.text = sourceArray[indexPath.row].1
+
+        if selectedIndex == indexPath.row {
+            cell.bgView.backgroundColor = .white
+            cell.bgView.layer.borderColor = _color("#858585&#858585").cgColor
+            cell.iconIv.isHidden = false
+        } else {
+            cell.bgView.backgroundColor = .white
+            cell.bgView.layer.borderColor = _color("#FFFFFF&#FFFFFF").cgColor
+            cell.iconIv.isHidden = true
+        }
+        
+        return cell
+    }
+    
+    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
+        selectedIndex = indexPath.row
+        selectTitle = sourceArray[indexPath.row].1
+        
+        self.tableView.reloadData()
+        
+        confirmBtnAction()
+    }
+}