Procházet zdrojové kódy

切换账号- add UI 90%

openlockPPP před 1 rokem
rodič
revize
0676496347

+ 24 - 0
JiaPeiManage.xcodeproj/project.pbxproj

@@ -22,6 +22,10 @@
 		903628D02A41AF3100F0AA6C /* MeTraineeDetails02HeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 903628CF2A41AF3100F0AA6C /* MeTraineeDetails02HeaderView.xib */; };
 		903628D22A41AFA400F0AA6C /* MeTraineeDetails02Cell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 903628D12A41AFA400F0AA6C /* MeTraineeDetails02Cell.swift */; };
 		903628D42A41AFD700F0AA6C /* MeTraineeDetails02Cell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 903628D32A41AFD700F0AA6C /* MeTraineeDetails02Cell.xib */; };
+		903B4E672A735FA600FD7320 /* SwitchAccountViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 903B4E662A735FA600FD7320 /* SwitchAccountViewController.swift */; };
+		903B4E6A2A73A49D00FD7320 /* SwitchAccountCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 903B4E692A73A49D00FD7320 /* SwitchAccountCell.swift */; };
+		903B4E6C2A73A4B000FD7320 /* SwitchAccountCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 903B4E6B2A73A4B000FD7320 /* SwitchAccountCell.xib */; };
+		903B4E6E2A73C5D800FD7320 /* NYAccountManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 903B4E6D2A73C5D800FD7320 /* NYAccountManager.swift */; };
 		903C04AA2A651B1200935764 /* NYIDFA.swift in Sources */ = {isa = PBXBuildFile; fileRef = 903C04A92A651B1200935764 /* NYIDFA.swift */; };
 		903C04AC2A651DBC00935764 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 903C04AB2A651DBC00935764 /* AdSupport.framework */; };
 		9043AD9B2A542267005F6F81 /* StatisticsOfficialPageHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9043AD9A2A542267005F6F81 /* StatisticsOfficialPageHeaderView.swift */; };
@@ -196,6 +200,10 @@
 		903628CF2A41AF3100F0AA6C /* MeTraineeDetails02HeaderView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MeTraineeDetails02HeaderView.xib; sourceTree = "<group>"; };
 		903628D12A41AFA400F0AA6C /* MeTraineeDetails02Cell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeTraineeDetails02Cell.swift; sourceTree = "<group>"; };
 		903628D32A41AFD700F0AA6C /* MeTraineeDetails02Cell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MeTraineeDetails02Cell.xib; sourceTree = "<group>"; };
+		903B4E662A735FA600FD7320 /* SwitchAccountViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwitchAccountViewController.swift; sourceTree = "<group>"; };
+		903B4E692A73A49D00FD7320 /* SwitchAccountCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwitchAccountCell.swift; sourceTree = "<group>"; };
+		903B4E6B2A73A4B000FD7320 /* SwitchAccountCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SwitchAccountCell.xib; sourceTree = "<group>"; };
+		903B4E6D2A73C5D800FD7320 /* NYAccountManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYAccountManager.swift; sourceTree = "<group>"; };
 		903C04A92A651B1200935764 /* NYIDFA.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYIDFA.swift; sourceTree = "<group>"; };
 		903C04AB2A651DBC00935764 /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; };
 		9043AD9A2A542267005F6F81 /* StatisticsOfficialPageHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatisticsOfficialPageHeaderView.swift; sourceTree = "<group>"; };
@@ -398,6 +406,15 @@
 			path = MeTraineeDetails;
 			sourceTree = "<group>";
 		};
+		903B4E682A73A46000FD7320 /* Views */ = {
+			isa = PBXGroup;
+			children = (
+				903B4E692A73A49D00FD7320 /* SwitchAccountCell.swift */,
+				903B4E6B2A73A4B000FD7320 /* SwitchAccountCell.xib */,
+			);
+			path = Views;
+			sourceTree = "<group>";
+		};
 		9043AD9E2A554BF9005F6F81 /* 二维码 */ = {
 			isa = PBXGroup;
 			children = (
@@ -452,6 +469,7 @@
 				9076C5DB2A386B2F00E5E33F /* MineViewController.xib */,
 				909DA5CE2A3AC23B0034501F /* UpdatePasswordViewController.swift */,
 				909DA5D02A3AC2460034501F /* UpdatePasswordViewController.xib */,
+				903B4E662A735FA600FD7320 /* SwitchAccountViewController.swift */,
 			);
 			path = Controllers;
 			sourceTree = "<group>";
@@ -958,6 +976,7 @@
 				90CE52D52A36E6000033BD06 /* LocalManager.swift */,
 				909DA5C02A3999B30034501F /* NYTips.swift */,
 				903C04A92A651B1200935764 /* NYIDFA.swift */,
+				903B4E6D2A73C5D800FD7320 /* NYAccountManager.swift */,
 			);
 			path = Utils;
 			sourceTree = "<group>";
@@ -992,6 +1011,7 @@
 		90CE52E52A36E7D00033BD06 /* Mine */ = {
 			isa = PBXGroup;
 			children = (
+				903B4E682A73A46000FD7320 /* Views */,
 				9076C5D52A38694000E5E33F /* Controllers */,
 			);
 			path = Mine;
@@ -1112,6 +1132,7 @@
 				909DA5D12A3AC2460034501F /* UpdatePasswordViewController.xib in Resources */,
 				9043AD9D2A5422BE005F6F81 /* StatisticsOfficialPageHeaderView.xib in Resources */,
 				90CE52222A36C0720033BD06 /* Assets.xcassets in Resources */,
+				903B4E6C2A73A4B000FD7320 /* SwitchAccountCell.xib in Resources */,
 				900C73152A4D220000532B3D /* StatisticsSelectDateView.xib in Resources */,
 				90971E942A4AB18D00267B7F /* StatisticsPageHeaderView.xib in Resources */,
 				9076C5DC2A386B2F00E5E33F /* MineViewController.xib in Resources */,
@@ -1248,6 +1269,7 @@
 				90CE52812A36E5460033BD06 /* BilibiliCollectionViewLayout.swift in Sources */,
 				90CE52AE2A36E59A0033BD06 /* UIScrollView+ScrollToBottom.swift in Sources */,
 				90CE52AF2A36E59A0033BD06 /* UIColor+NY.swift in Sources */,
+				903B4E6A2A73A49D00FD7320 /* SwitchAccountCell.swift in Sources */,
 				90CE52B12A36E59A0033BD06 /* VTContentView+Gesture.swift in Sources */,
 				90CE52722A36E5460033BD06 /* LWPlayer.swift in Sources */,
 				909DA5C52A3AA1E60034501F /* MeTraineeNavBar.swift in Sources */,
@@ -1284,6 +1306,7 @@
 				90CE52D02A36E5EC0033BD06 /* PullToRefresh+Rx.swift in Sources */,
 				90CE52382A36E4720033BD06 /* MainNavigationController.swift in Sources */,
 				908FEEA72A42E19E00BEB81C /* MeTraineeDetails03HeaderView.swift in Sources */,
+				903B4E672A735FA600FD7320 /* SwitchAccountViewController.swift in Sources */,
 				90CE52832A36E5460033BD06 /* SearchBarView.swift in Sources */,
 				9076C5DA2A386B2300E5E33F /* MineViewController.swift in Sources */,
 				903628CA2A417BA800F0AA6C /* MeTraineeDetails01HeaderView.swift in Sources */,
@@ -1305,6 +1328,7 @@
 				909DA5D32A3ADFD80034501F /* MeTraineeSubjectCell.swift in Sources */,
 				90CE52BD2A36E5B70033BD06 /* NetEnvironment.swift in Sources */,
 				90971E692A493BCB00267B7F /* MeTabBarController.swift in Sources */,
+				903B4E6E2A73C5D800FD7320 /* NYAccountManager.swift in Sources */,
 				90A8CD482A5EACB500C02402 /* MeTraineeSubjectViewModel.swift in Sources */,
 				90CE52BB2A36E5B70033BD06 /* LoadingPlugin.swift in Sources */,
 				90CE52F42A36EDCF0033BD06 /* NYArticleNavBar.swift in Sources */,

+ 23 - 0
JiaPeiManage/Assets.xcassets/Modules/Common/btn_del_red.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "filename" : "删除.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "删除@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "删除@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

binární
JiaPeiManage/Assets.xcassets/Modules/Common/btn_del_red.imageset/删除.png


binární
JiaPeiManage/Assets.xcassets/Modules/Common/btn_del_red.imageset/删除@2x.png


binární
JiaPeiManage/Assets.xcassets/Modules/Common/btn_del_red.imageset/删除@3x.png


+ 3 - 3
JiaPeiManage/Sources/Models/UserInfoModel.swift

@@ -269,16 +269,16 @@ struct UserInfo :ImmutableMappable{
         id = try map.value("id")
         coachNum = try map.value("coachNum") ?? ""
         recordDate = try map.value("recordDate") ?? ""
-        schoolId = try map.value("schoolId")
+        schoolId = try map.value("schoolId") ?? 0
         schoolName = try map.value("schoolName") ?? ""
         name = try map.value("name") ?? ""
-        sex = try map.value("sex")
+        sex = try map.value("sex") ?? ""
         idcard = try map.value("idcard") ?? ""
         mobile = try map.value("mobile") ?? ""
         address = try map.value("address") ?? ""
         photo = try map.value("photo") ?? 0
         fingerPrint = try map.value("fingerPrint") ?? ""
-        drilicence = try map.value("drilicence")
+        drilicence = try map.value("drilicence") ?? 0
         expireTime = try map.value("expireTime") ?? ""
         fstdrilicDate = try map.value("fstdrilicDate") ?? ""
         occupationNo = try map.value("occupationNo") ?? ""

+ 8 - 0
JiaPeiManage/Sources/Modulars/Mine/Controllers/MineViewController.swift

@@ -33,6 +33,8 @@ final class MineViewController: BaseViewController {
     @IBOutlet weak var schoolname_label: UILabel!
     //驾校地址
     @IBOutlet weak var school_address_label: UILabel!
+    //切换身份
+    @IBOutlet weak var switch_button: UIButton!
     //退出登录
     @IBOutlet weak var quit_button: UIButton!
     //教练身份
@@ -61,11 +63,17 @@ final class MineViewController: BaseViewController {
         update_password_button.rx.tap.subscribe ({  [unowned self] (_) in
             NYSwRouter.push(NYSwPushType.mine_uppassword.path)
         }).disposed(by: disposeBag)
+        //退出
         quit_button.rx.tap.subscribe ({  [unowned self] (_) in
             LocalManager.userInfo.isLogin = false //设置已经登录
             print("退出登录成功")
             self.actionBackdo(quit_button)
         }).disposed(by: disposeBag)
+        //切换身份
+        switch_button.rx.tap.subscribe ({  [unowned self] (_) in
+            NYSwRouter.push(NYSwPushType.mine_switchaccount.path)
+        }).disposed(by: disposeBag)
+        
     }
     //绑定-rx
     func biandView(){

+ 20 - 0
JiaPeiManage/Sources/Modulars/Mine/Controllers/MineViewController.xib

@@ -18,6 +18,7 @@
                 <outlet property="quit_button" destination="1Zd-UI-9fQ" id="F6H-2Z-BKz"/>
                 <outlet property="school_address_label" destination="fJC-Qf-3Nv" id="C7z-R9-ERM"/>
                 <outlet property="schoolname_label" destination="h6R-dN-eLm" id="Si0-F8-vLI"/>
+                <outlet property="switch_button" destination="LC7-q3-Z4X" id="KEB-Ol-9Kk"/>
                 <outlet property="update_password_button" destination="BM3-xf-AcJ" id="zkl-E6-hkN"/>
                 <outlet property="user_icon_imageview" destination="3wG-uo-AO3" id="XUw-Ei-afC"/>
                 <outlet property="user_name_label" destination="km9-Iu-GaJ" id="PYp-mh-Ugs"/>
@@ -341,6 +342,22 @@
                                         <constraint firstAttribute="trailing" secondItem="fJC-Qf-3Nv" secondAttribute="trailing" constant="15" id="k6R-Se-Qw2"/>
                                     </constraints>
                                 </view>
+                                <button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="LC7-q3-Z4X">
+                                    <rect key="frame" x="43" y="472" width="289" height="34"/>
+                                    <color key="backgroundColor" red="0.20784313730000001" green="0.74901960779999999" blue="0.36862745099999999" alpha="1" colorSpace="calibratedRGB"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="34" id="3Fs-Ho-y3f"/>
+                                    </constraints>
+                                    <state key="normal" title="切换身份"/>
+                                    <userDefinedRuntimeAttributes>
+                                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                            <real key="value" value="5"/>
+                                        </userDefinedRuntimeAttribute>
+                                        <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
+                                            <real key="value" value="0.0"/>
+                                        </userDefinedRuntimeAttribute>
+                                    </userDefinedRuntimeAttributes>
+                                </button>
                             </subviews>
                             <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                             <constraints>
@@ -357,8 +374,11 @@
                                 <constraint firstAttribute="trailing" secondItem="r8b-Dg-5b7" secondAttribute="trailing" id="V2V-cj-fZ4"/>
                                 <constraint firstItem="pSR-n7-hdU" firstAttribute="leading" secondItem="qwc-OV-SUa" secondAttribute="leading" id="Y22-eb-Jrx"/>
                                 <constraint firstAttribute="height" constant="600" id="a2p-nD-RN8"/>
+                                <constraint firstItem="LC7-q3-Z4X" firstAttribute="leading" secondItem="qwc-OV-SUa" secondAttribute="leading" constant="43" id="aXU-QF-UrZ"/>
                                 <constraint firstAttribute="trailing" secondItem="pSR-n7-hdU" secondAttribute="trailing" id="eFH-0v-Ar8"/>
                                 <constraint firstItem="XYn-ij-vdD" firstAttribute="top" secondItem="pSR-n7-hdU" secondAttribute="bottom" id="kQT-cU-z3z"/>
+                                <constraint firstAttribute="trailing" secondItem="LC7-q3-Z4X" secondAttribute="trailing" constant="43" id="qAf-3a-Gqk"/>
+                                <constraint firstItem="1Zd-UI-9fQ" firstAttribute="top" secondItem="LC7-q3-Z4X" secondAttribute="bottom" constant="20" id="wwb-UL-htQ"/>
                                 <constraint firstItem="xO6-Xp-G2S" firstAttribute="top" secondItem="r8b-Dg-5b7" secondAttribute="bottom" constant="-5" id="zWp-aw-iYB"/>
                                 <constraint firstItem="XYn-ij-vdD" firstAttribute="leading" secondItem="qwc-OV-SUa" secondAttribute="leading" id="zle-9z-qX0"/>
                                 <constraint firstAttribute="trailing" secondItem="1Zd-UI-9fQ" secondAttribute="trailing" constant="43" id="zrg-WR-qBL"/>

+ 111 - 0
JiaPeiManage/Sources/Modulars/Mine/Controllers/SwitchAccountViewController.swift

@@ -0,0 +1,111 @@
+//
+//  SwitchAccountViewController.swift
+//  JiaPeiManage
+//
+//  Created by Ning.ge on 2023/7/28.
+//
+
+import UIKit
+import RxSwift
+import RxCocoa
+
+
+final class SwitchAccountViewController: BaseTableViewController {
+    
+    let cellIdentifier:String = "_SwitchAccountCellID"
+    // MARK: 服务属性
+    private let cocahService: CoachServiceType = CoachService(networking: CoachNetworking())
+    
+    // MARK: UI let
+    let statusBar = UIView().then {
+        $0.backgroundColor = UIColor.db_theme
+    }
+    
+    let navBar = MeTraineeNavBar.loadFromNib().then {
+        $0.search_layout_right.constant = 15.f
+    }
+    
+    //edit
+    
+    var edit:Bool = false
+
+    
+    override func setupConstraints() {
+        
+        statusBar.snp.makeConstraints { (make) in
+            make.left.right.top.equalToSuperview()
+            make.height.equalTo(Metric.statusBarHeight)
+        }
+        
+        navBar.snp.remakeConstraints { (make) in
+            make.left.right.equalToSuperview()
+            make.height.equalTo(Metric.navBarHeight)
+            make.top.equalTo(statusBar.snp.bottom)
+        }
+        
+        self.tableView.snp.remakeConstraints { make in
+            make.top.equalTo(navBar.snp.bottom)
+            make.left.right.bottom.equalTo(self.view)
+        }
+        self.loadViewIfNeeded()
+    }
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        setupUI()
+        biandView()
+    }
+    
+    // MARK: 私有方法
+    func setupUI(){
+        self.view.addSubview(navBar)
+        self.view.addSubview(statusBar)
+        self.navBar.title_label.text = "个人中心"
+        self.view.backgroundColor = .db_theme
+        self.navBar.back_button.addTarget(self, action: #selector(actionBackdo), for: .touchUpInside)
+        self.navBar.search_button.setImage(nil, for: .normal)
+        self.navBar.search_button.setTitle("编辑", for: .normal)
+        self.navBar.search_button.titleLabel?.font = NYFont.SysFont.sys_14
+        self.navBar.search_button.rx.tap.subscribe ({ [unowned self] (_)  in
+            self.edit = !self.edit
+            
+            self.tableView.reloadData()
+        }).disposed(by: disposeBag)
+        //self.navBar.search_button.addTarget(self, action: #selector(jumpSearchdo), for: .touchUpInside)
+    }
+    //绑定-rx
+    func biandView(){
+        tableView.dataSource = self
+        tableView.delegate = self
+        tableView.separatorStyle = .none //去除分割线
+        tableView.register(UINib(nibName: "SwitchAccountCell", bundle: nil), forCellReuseIdentifier: cellIdentifier)
+        tableView.rowHeight = 96.f
+        tableView.alwaysBounceVertical = false
+        tableView.bounces = false
+        self.isEmptyDisplay = true
+        self.hideLoadAnimation()
+    }
+    
+    
+}
+
+
+//数据源
+extension SwitchAccountViewController:UITableViewDataSource {
+
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        return 5
+    }
+
+    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+        let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier, for: indexPath) as! SwitchAccountCell
+        cell.sacontentView.backgroundColor = ((indexPath.row%2) != 0) ? UIColor("#113357") : UIColor("#0B2B4D")
+        cell.setIsEdit(edit: edit)
+//        cell.setRowInfo(rowInfo: self.meTraineeSearchViewModel.rows[indexPath.row])
+        return cell
+    }
+}
+
+//事件
+extension SwitchAccountViewController:UITableViewDelegate {
+}

+ 47 - 0
JiaPeiManage/Sources/Modulars/Mine/Views/SwitchAccountCell.swift

@@ -0,0 +1,47 @@
+//
+//  SwitchAccountCell.swift
+//  JiaPeiManage
+//
+//  Created by Ning.ge on 2023/7/28.
+//
+
+import UIKit
+import RxSwift
+
+final class SwitchAccountCell: UITableViewCell,NibLoadable {
+    
+    // MARK: UI
+    @IBOutlet weak var sacontentView: UIView!
+    //delbtn
+    @IBOutlet weak var del_button: UIButton!
+    @IBOutlet weak var del_view: UIView!
+    @IBOutlet weak var del_layout_w: NSLayoutConstraint!
+    //用户头像
+    @IBOutlet weak var user_imageview: UIImageView!
+    //用户名
+    @IBOutlet weak var username_label: UILabel!
+    //身份证
+    @IBOutlet weak var idcart_label: UILabel!
+    //地址
+    @IBOutlet weak var adderss_label: UILabel!
+    
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        self.backgroundColor = .db_theme
+        self.contentView.backgroundColor = .db_theme
+        self.selectionStyle = .none
+        
+    }
+    
+    func setIsEdit(edit:Bool){
+        if edit {
+            del_view.isHidden = false
+            del_layout_w.constant = 40.f
+        }else {
+            del_view.isHidden = true
+            del_layout_w.constant = 0.f
+        }
+    }
+}
+

+ 118 - 0
JiaPeiManage/Sources/Modulars/Mine/Views/SwitchAccountCell.xib

@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina5_9" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="SwitchAccountCell" customModule="JiaPeiManage" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="375" height="96"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gMB-LS-Eqg" userLabel="View-content">
+                    <rect key="frame" x="15" y="0.0" width="345" height="96"/>
+                    <subviews>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ZcM-ct-8bB" userLabel="View-del">
+                            <rect key="frame" x="0.0" y="0.0" width="40" height="96"/>
+                            <subviews>
+                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="HZ4-x8-MbV">
+                                    <rect key="frame" x="15" y="29" width="25" height="25"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="25" id="7aq-hK-OFG"/>
+                                        <constraint firstAttribute="height" constant="25" id="q8W-Jr-VAG"/>
+                                    </constraints>
+                                    <state key="normal" title="Button"/>
+                                    <buttonConfiguration key="configuration" style="plain" image="btn_del_red"/>
+                                </button>
+                            </subviews>
+                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="40" id="2x5-EC-ECP"/>
+                                <constraint firstItem="HZ4-x8-MbV" firstAttribute="leading" secondItem="ZcM-ct-8bB" secondAttribute="leading" constant="15" id="Mbw-II-Msg"/>
+                                <constraint firstItem="HZ4-x8-MbV" firstAttribute="top" secondItem="ZcM-ct-8bB" secondAttribute="top" constant="29" id="UJg-2I-IMb"/>
+                            </constraints>
+                        </view>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="庄后旺" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="orw-9F-5t5">
+                            <rect key="frame" x="110" y="15" width="220" height="20"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="20" id="QO4-lz-jyd"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                            <color key="textColor" red="0.83137254901960778" green="0.8666666666666667" blue="0.90196078431372551" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="350230100000000" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rn2-DA-qeC">
+                            <rect key="frame" x="110" y="35" width="220" height="20"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="20" id="fR6-a7-TUE"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                            <color key="textColor" red="0.83137254900000002" green="0.86666666670000003" blue="0.90196078430000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="mine-coach-male" translatesAutoresizingMaskIntoConstraints="NO" id="zc3-75-pkU">
+                            <rect key="frame" x="55" y="15" width="40" height="40"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="40" id="SIN-yr-a5x"/>
+                                <constraint firstAttribute="height" constant="40" id="jBc-0J-4ER"/>
+                            </constraints>
+                        </imageView>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="addaddaddaddaddadd限公司addaddad9999" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VzU-VX-Ktx">
+                            <rect key="frame" x="110" y="55" width="220" height="36"/>
+                            <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                            <color key="textColor" red="0.83137254900000002" green="0.86666666670000003" blue="0.90196078430000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                    </subviews>
+                    <color key="backgroundColor" red="0.066666666666666666" green="0.20000000000000001" blue="0.3411764705882353" alpha="1" colorSpace="calibratedRGB"/>
+                    <constraints>
+                        <constraint firstAttribute="trailing" secondItem="rn2-DA-qeC" secondAttribute="trailing" constant="15" id="1Ps-cD-Qg3"/>
+                        <constraint firstItem="orw-9F-5t5" firstAttribute="top" secondItem="gMB-LS-Eqg" secondAttribute="top" constant="15" id="3VN-qW-rIc"/>
+                        <constraint firstAttribute="bottom" secondItem="ZcM-ct-8bB" secondAttribute="bottom" id="5Xf-wn-Ric"/>
+                        <constraint firstItem="VzU-VX-Ktx" firstAttribute="top" secondItem="rn2-DA-qeC" secondAttribute="bottom" id="5so-Y5-Fue"/>
+                        <constraint firstItem="orw-9F-5t5" firstAttribute="leading" secondItem="zc3-75-pkU" secondAttribute="trailing" constant="15" id="Bjs-0L-PUD"/>
+                        <constraint firstAttribute="bottom" secondItem="VzU-VX-Ktx" secondAttribute="bottom" constant="5" id="KRl-fW-1qp"/>
+                        <constraint firstItem="ZcM-ct-8bB" firstAttribute="leading" secondItem="gMB-LS-Eqg" secondAttribute="leading" id="Ohu-zf-9CM"/>
+                        <constraint firstItem="rn2-DA-qeC" firstAttribute="leading" secondItem="zc3-75-pkU" secondAttribute="trailing" constant="15" id="Wvl-a0-MI6"/>
+                        <constraint firstAttribute="trailing" secondItem="orw-9F-5t5" secondAttribute="trailing" constant="15" id="a0s-SY-yuE"/>
+                        <constraint firstItem="ZcM-ct-8bB" firstAttribute="top" secondItem="gMB-LS-Eqg" secondAttribute="top" id="eLh-Qp-kc8"/>
+                        <constraint firstItem="zc3-75-pkU" firstAttribute="top" secondItem="gMB-LS-Eqg" secondAttribute="top" constant="15" id="qRg-8B-DaK"/>
+                        <constraint firstAttribute="trailing" secondItem="VzU-VX-Ktx" secondAttribute="trailing" constant="15" id="t48-dS-QEU"/>
+                        <constraint firstItem="rn2-DA-qeC" firstAttribute="top" secondItem="orw-9F-5t5" secondAttribute="bottom" id="tlv-z6-IOb"/>
+                        <constraint firstItem="zc3-75-pkU" firstAttribute="leading" secondItem="ZcM-ct-8bB" secondAttribute="trailing" constant="15" id="wsN-cN-I2c"/>
+                        <constraint firstItem="VzU-VX-Ktx" firstAttribute="leading" secondItem="ZcM-ct-8bB" secondAttribute="trailing" constant="70" id="x6V-hh-Iwk"/>
+                    </constraints>
+                </view>
+            </subviews>
+            <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
+            <color key="backgroundColor" red="0.023529411764705882" green="0.12549019607843137" blue="0.22745098039215686" alpha="1" colorSpace="calibratedRGB"/>
+            <constraints>
+                <constraint firstAttribute="bottom" secondItem="gMB-LS-Eqg" secondAttribute="bottom" id="3ty-Xy-Fg7"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="gMB-LS-Eqg" secondAttribute="trailing" constant="15" id="7QV-wo-6Ay"/>
+                <constraint firstItem="gMB-LS-Eqg" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="Kqj-XP-6tZ"/>
+                <constraint firstItem="gMB-LS-Eqg" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="15" id="eCw-Qy-tKK"/>
+            </constraints>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <connections>
+                <outlet property="adderss_label" destination="VzU-VX-Ktx" id="yy9-kX-j6n"/>
+                <outlet property="del_button" destination="HZ4-x8-MbV" id="Bfx-ea-sUV"/>
+                <outlet property="del_layout_w" destination="2x5-EC-ECP" id="aaQ-et-lPX"/>
+                <outlet property="del_view" destination="ZcM-ct-8bB" id="2cL-M8-eLl"/>
+                <outlet property="idcart_label" destination="rn2-DA-qeC" id="54d-WR-ifT"/>
+                <outlet property="sacontentView" destination="gMB-LS-Eqg" id="Rgz-Jh-Owo"/>
+                <outlet property="user_imageview" destination="zc3-75-pkU" id="DEq-ts-HhP"/>
+                <outlet property="username_label" destination="orw-9F-5t5" id="nf9-um-DaW"/>
+            </connections>
+            <point key="canvasLocation" x="50.399999999999999" y="-11.083743842364532"/>
+        </view>
+    </objects>
+    <resources>
+        <image name="btn_del_red" width="25" height="25"/>
+        <image name="mine-coach-male" width="66" height="64"/>
+    </resources>
+</document>

+ 58 - 24
JiaPeiManage/Sources/Modulars/学员/ViewModel/MeTraineeSearchViewModel.swift

@@ -51,19 +51,38 @@ class MeTraineeSearchViewModel: NSObject {
         
         //非绑定的学员 并且 是开启预报名地区
         if appCoachId == "" && LocalManager.userInfo.cityPower == "1"{
-            self.cocahService.allStudentInfoListRequest(city: LocalManager.userInfo.city!, coachId:coachId, field: keyword, pageNum: page, pageSize: pageSize, schoolId: schoolId).subscribe(onSuccess: { [unowned self] traineeDataModel in
-                self.rows.removeAll()
-                self.traineeDataModel = traineeDataModel
-                self.rows += traineeDataModel.rows!
-                print("coachInfoListRequest成功")
-                vc.isEmptyDisplay = true
-                vc.hideLoadAnimation()
-                vc.stopRefresh()
-                vc.tableView.reloadData()
-            }, onError: { error in
-                vc.stopRefresh()
-            })
-            .disposed(by: vc.disposeBag)
+            
+            if schoolId>0 {//在校
+                self.cocahService.yallSchoolStudentInfoListRequest(city: LocalManager.userInfo.city!, coachId:coachId, field: keyword, pageNum: page, pageSize: pageSize, schoolId: schoolId).subscribe(onSuccess: { [unowned self] traineeDataModel in
+                    self.rows.removeAll()
+                    self.traineeDataModel = traineeDataModel
+                    self.rows += traineeDataModel.rows!
+                    print("coachInfoListRequest成功")
+                    vc.isEmptyDisplay = true
+                    vc.hideLoadAnimation()
+                    vc.stopRefresh()
+                    vc.tableView.reloadData()
+                }, onError: { error in
+                    vc.stopRefresh()
+                })
+                .disposed(by: vc.disposeBag)
+            }else{//我的
+                self.cocahService.yallStudentInfoListRequest(city: LocalManager.userInfo.city!, coachId:coachId, field: keyword, pageNum: page, pageSize: pageSize, schoolId: schoolId).subscribe(onSuccess: { [unowned self] traineeDataModel in
+                    self.rows.removeAll()
+                    self.traineeDataModel = traineeDataModel
+                    self.rows += traineeDataModel.rows!
+                    print("coachInfoListRequest成功")
+                    vc.isEmptyDisplay = true
+                    vc.hideLoadAnimation()
+                    vc.stopRefresh()
+                    vc.tableView.reloadData()
+                }, onError: { error in
+                    vc.stopRefresh()
+                })
+                .disposed(by: vc.disposeBag)
+            }
+            
+            
         }else{//绑定的学员+remark=1+ 走原始api
             let coachIdStr = (appCoachId == "" ? coachId: "")
             self.cocahService.coachInfoListRequest(city: LocalManager.userInfo.city!, appCoachId: appCoachId, coachId: coachIdStr, field: keyword, pageNum: page, pageSize: pageSize, schoolId: schoolId, state: state)
@@ -100,17 +119,32 @@ class MeTraineeSearchViewModel: NSObject {
 
         //非绑定的学员 并且 是开启预报名地区
         if appCoachId == "" && LocalManager.userInfo.cityPower == "1"{
-            self.cocahService.allStudentInfoListRequest(city: LocalManager.userInfo.city!, coachId:coachId, field: keyword, pageNum: page, pageSize: pageSize, schoolId: schoolId).subscribe(onSuccess: { [unowned self] traineeDataModel in
-                self.traineeDataModel = traineeDataModel
-                if(traineeDataModel.rows!.count>0){
-                    self.rows += traineeDataModel.rows!
-                }
-                vc.tableView.reloadData()
-                vc.stopLoad()
-            }, onError: { error in
-                vc.stopRefresh()
-            })
-            .disposed(by: vc.disposeBag)
+            if schoolId>0 {//在校
+                self.cocahService.yallSchoolStudentInfoListRequest(city: LocalManager.userInfo.city!, coachId:coachId, field: keyword, pageNum: page, pageSize: pageSize, schoolId: schoolId).subscribe(onSuccess: { [unowned self] traineeDataModel in
+                    self.traineeDataModel = traineeDataModel
+                    if(traineeDataModel.rows!.count>0){
+                        self.rows += traineeDataModel.rows!
+                    }
+                    vc.tableView.reloadData()
+                    vc.stopLoad()
+                }, onError: { error in
+                    vc.stopRefresh()
+                })
+                .disposed(by: vc.disposeBag)
+            }else{//我的
+                self.cocahService.yallStudentInfoListRequest(city: LocalManager.userInfo.city!, coachId:coachId, field: keyword, pageNum: page, pageSize: pageSize, schoolId: schoolId).subscribe(onSuccess: { [unowned self] traineeDataModel in
+                    self.traineeDataModel = traineeDataModel
+                    if(traineeDataModel.rows!.count>0){
+                        self.rows += traineeDataModel.rows!
+                    }
+                    vc.tableView.reloadData()
+                    vc.stopLoad()
+                }, onError: { error in
+                    vc.stopRefresh()
+                })
+                .disposed(by: vc.disposeBag)
+            }
+            
         }else{//绑定的学员+remark=1+ 走原始api
             self.cocahService.coachInfoListRequest(city: LocalManager.userInfo.city!, appCoachId: appCoachId, coachId: "", field: keyword, pageNum: page, pageSize: pageSize, schoolId: schoolId, state: state)
                 .subscribe(onSuccess: { [unowned self] traineeDataModel in

+ 2 - 0
JiaPeiManage/Sources/Modulars/学员/Views/MeTraineeNavBar.swift

@@ -16,6 +16,8 @@ final class MeTraineeNavBar: UIView,NibLoadable {
     
     @IBOutlet weak var title_label: UILabel!
     
+    @IBOutlet weak var search_layout_right: NSLayoutConstraint!
+    
     override func awakeFromNib() {
         super.awakeFromNib()
         

+ 1 - 0
JiaPeiManage/Sources/Modulars/学员/Views/MeTraineeNavBar.xib

@@ -57,6 +57,7 @@
             <connections>
                 <outlet property="back_button" destination="TuQ-3p-qxM" id="1GW-pm-8qm"/>
                 <outlet property="search_button" destination="S9t-pm-aGk" id="XXf-ZV-enb"/>
+                <outlet property="search_layout_right" destination="UjN-5C-kns" id="wKO-TY-BoY"/>
                 <outlet property="title_label" destination="elb-1k-lgc" id="Nte-Z6-13n"/>
             </connections>
             <point key="canvasLocation" x="89.312977099236633" y="138.73239436619718"/>

+ 24 - 2
JiaPeiManage/Sources/Services/CoachAPI.swift

@@ -18,6 +18,10 @@ enum CoachAPI {
     case coachInfoList(city:String,appCoachId:String ,coachId:String ,field:String ,pageNum:Int ,pageSize:Int ,schoolId:Int ,state:String )
     //获取教练的学员-针对搜索专用-全局
     case allStudentInfoList(city:String,coachId:String ,field:String ,pageNum:Int ,pageSize:Int ,schoolId:Int)
+    //预报名-我的学员-搜索
+    case yallStudentInfoList(city:String,coachId:String ,field:String ,pageNum:Int ,pageSize:Int ,schoolId:Int)
+    //预报名-在校学员-搜索
+    case yallSchoolStudentInfoList(city:String,coachId:String ,field:String ,pageNum:Int ,pageSize:Int ,schoolId:Int)
     //获取教练预报名的学员
     case coachTempList(city:String,appCoachId:String ,coachId:String ,field:String ,pageNum:Int ,pageSize:Int ,schoolId:Int ,state:String )
     //通过id获取学员详细
@@ -36,7 +40,7 @@ extension CoachAPI: TargetType {
         switch self {
         case .coachInfo,.coachQrInfo,.coachInfoList,.coachTempList,.studentInfoById,
                 .stuScoreByOutId,.stuTmsSignListByStuId,.stuTmsLogFaceListByStuId,
-                .allStudentInfoList:
+                .allStudentInfoList,.yallStudentInfoList,.yallSchoolStudentInfoList:
             return URL(string: HttpRequest.api.path)!
         }
     }
@@ -52,6 +56,10 @@ extension CoachAPI: TargetType {
             return "/jsjp-admin/open-api/tms/coachInfo/list"
         case .allStudentInfoList(_, _, _, _, _, _):
             return "/jsjp-admin/open-api/tms/coachInfo/allStudentInfoList"
+        case .yallStudentInfoList(_, _, _, _, _, _):
+            return "/jsjp-admin/open-api/tms/coachInfo/allStudentInfoList"
+        case .yallSchoolStudentInfoList(_, _, _, _, _, _):
+            return "/jsjp-admin/open-api/tms/coachInfo/allSchoolStudentInfoList"
         case .coachTempList(_,_,_,_,_,_,_,_):
             return "/jsjp-admin/open-api/tms/coachInfo/studenTempList"
         case .studentInfoById(_,_):
@@ -85,7 +93,7 @@ extension CoachAPI: TargetType {
         switch self {
         case .coachInfo(_,_),.coachQrInfo(_,_),.coachInfoList(_,_,_,_,_,_,_,_),.coachTempList(_,_,_,_,_,_,_,_),.studentInfoById(_,_)
             ,.stuScoreByOutId(_,_,_),.stuTmsSignListByStuId(_,_,_,_),.stuTmsLogFaceListByStuId(_,_,_,_),
-                .allStudentInfoList(_, _, _, _, _, _):
+                .allStudentInfoList(_, _, _, _, _, _),.yallStudentInfoList(_, _, _, _, _, _),.yallSchoolStudentInfoList(_, _, _, _, _, _):
             if let parameters = parameters {
                 return .requestParameters(parameters: parameters, encoding: URLEncoding.default)
             }
@@ -131,6 +139,20 @@ extension CoachAPI: TargetType {
                     "pageNum": pageNum,
                     "pageSize": pageSize,
                     "schoolId": schoolId==0 ?"":"\(schoolId)"]
+        case let .yallStudentInfoList(city, coachId, field, pageNum, pageSize, schoolId):
+            return ["city": city,
+                    "coachId": coachId,
+                    "field": field,
+                    "pageNum": pageNum,
+                    "pageSize": pageSize,
+                    "schoolId": schoolId==0 ?"":"\(schoolId)"]
+        case let .yallSchoolStudentInfoList(city, coachId, field, pageNum, pageSize, schoolId):
+            return ["city": city,
+                    "coachId": coachId,
+                    "field": field,
+                    "pageNum": pageNum,
+                    "pageSize": pageSize,
+                    "schoolId": schoolId==0 ?"":"\(schoolId)"]
         case let .studentInfoById(city,id):
             return ["city": city,
                     "id": id,]

+ 14 - 0
JiaPeiManage/Sources/Services/CoachService.swift

@@ -18,6 +18,10 @@ protocol CoachServiceType {
     func coachInfoListRequest(city:String,appCoachId:String ,coachId:String ,field:String ,pageNum:Int ,pageSize:Int ,schoolId:Int ,state:String) -> Single<TraineeDataModel>
     //获取全局学员信息list
     func allStudentInfoListRequest(city:String,coachId:String,field:String ,pageNum:Int ,pageSize:Int ,schoolId:Int ) -> Single<TraineeDataModel>
+    //预报名-我的学员-搜索
+    func yallStudentInfoListRequest(city:String,coachId:String,field:String ,pageNum:Int ,pageSize:Int ,schoolId:Int ) -> Single<TraineeDataModel>
+    //预报名-在校学员-搜索
+    func yallSchoolStudentInfoListRequest(city:String,coachId:String,field:String ,pageNum:Int ,pageSize:Int ,schoolId:Int ) -> Single<TraineeDataModel>
     //获取我的预报名学员信息list
     func coachTempListRequest(city:String,appCoachId:String ,coachId:String ,field:String ,pageNum:Int ,pageSize:Int ,schoolId:Int ,state:String) -> Single<TraineeDataModel>
     //通过id获取学员详细
@@ -33,6 +37,7 @@ protocol CoachServiceType {
 
 final class CoachService: CoachServiceType {
 
+    
     private let networking : CoachNetworking
     
     init(networking: CoachNetworking) {
@@ -58,6 +63,15 @@ final class CoachService: CoachServiceType {
         let api = CoachAPI.allStudentInfoList(city: city, coachId: coachId , field: field, pageNum: pageNum, pageSize: pageSize, schoolId: schoolId)
         return networking.request(api).map(TraineeDataModel.self,isModel: true)
     }
+    func yallStudentInfoListRequest(city: String, coachId: String, field: String, pageNum: Int, pageSize: Int, schoolId: Int) -> RxSwift.Single<TraineeDataModel> {
+        let api = CoachAPI.yallStudentInfoList(city: city, coachId: coachId , field: field, pageNum: pageNum, pageSize: pageSize, schoolId: schoolId)
+        return networking.request(api).map(TraineeDataModel.self,isModel: true)
+    }
+    
+    func yallSchoolStudentInfoListRequest(city: String, coachId: String, field: String, pageNum: Int, pageSize: Int, schoolId: Int) -> RxSwift.Single<TraineeDataModel> {
+        let api = CoachAPI.yallSchoolStudentInfoList(city: city, coachId: coachId , field: field, pageNum: pageNum, pageSize: pageSize, schoolId: schoolId)
+        return networking.request(api).map(TraineeDataModel.self,isModel: true)
+    }
     
     func coachTempListRequest(city: String, appCoachId: String, coachId: String, field: String, pageNum: Int, pageSize: Int, schoolId: Int, state: String) -> RxSwift.Single<TraineeDataModel> {
         let api = CoachAPI.coachTempList(city: city, appCoachId: appCoachId, coachId: coachId, field: field, pageNum: pageNum, pageSize: pageSize, schoolId: schoolId, state: state)

+ 63 - 0
JiaPeiManage/Sources/Utils/NYAccountManager.swift

@@ -0,0 +1,63 @@
+//
+//  NYAccountManager.swift
+//  JiaPeiManage
+//
+//  Created by Ning.ge on 2023/7/28.
+//
+
+import Foundation
+
+struct Account {
+    let username: String
+    let password: String
+}
+
+class NYAccountManager {
+    private var accounts: [Account] = []
+    private let maxAccountCount = 5
+    
+    func addAccount(username: String, password: String) {
+        let account = Account(username: username, password: password)
+        if accounts.count < maxAccountCount {
+            accounts.append(account)
+        } else {
+            accounts.removeFirst()
+            accounts.append(account)
+        }
+        saveAccounts()
+    }
+    
+    func deleteAccount(at index: Int) {
+        guard index >= 0 && index < accounts.count else {
+            return
+        }
+        accounts.remove(at: index)
+        saveAccounts()
+    }
+    
+    func getAccounts() -> [Account] {
+        return accounts
+    }
+    
+    private func saveAccounts() {
+        // Convert the accounts array to a JSON representation and save it to UserDefaults or any other persistent storage of your choice
+        let jsonEncoder = JSONEncoder()
+//        if let data = try? jsonEncoder.encode(accounts) {
+//            UserDefaults.standard.set(data, forKey: "savedAccounts")
+//        }
+    }
+    
+    private func loadAccounts() {
+        // Load the accounts from UserDefaults or any other persistent storage
+//        if let data = UserDefaults.standard.data(forKey: "savedAccounts") {
+//            let jsonDecoder = JSONDecoder()
+//            if let savedAccounts = try? jsonDecoder.decode([Account].self, from: data) {
+//                accounts = savedAccounts
+//            }
+//        }
+    }
+    
+    init() {
+        loadAccounts()
+    }
+}

+ 3 - 0
JiaPeiManage/Sources/Utils/NYSwRouter.swift

@@ -16,6 +16,7 @@ enum NYSwPushType {
     case trainee_list_biand
     case mine_center
     case mine_uppassword
+    case mine_switchaccount
     case trainee_list_school
     case trainee_statistics
     case trainee_statistics_official
@@ -49,6 +50,8 @@ extension NYSwPushType {
             return "JiaPeiManage://mine/center"
         case .mine_uppassword:
             return "JiaPeiManage://mine/updatepassword"
+        case .mine_switchaccount:
+            return "JiaPeiManage://mine/switchaccount"
         case .trainee_statistics:
             return "JiaPeiManage://me/trainee/statistics"
         case .trainee_statistics_official:

+ 6 - 1
JiaPeiManage/Sources/Utils/URLNavigationMap.swift

@@ -103,7 +103,12 @@ final class URLNavigationMap {
             coachAppdownloadPageController.type = (context as! Int)==1 ? .ios : .android
             return coachAppdownloadPageController
         }
-        
+        navigator.register(NYSwPushType.mine_switchaccount.path) { (url, values, context) -> UIViewController? in
+
+            let switchAccountViewController = SwitchAccountViewController()
+            
+            return switchAccountViewController
+        }
         
         //open api
         navigator.register("http://<path:_>",self.webViewControllerFactory)