Browse Source

add 添加预报名

openlockPPP 1 year ago
parent
commit
9bcb88d1f9

+ 2 - 2
JiaPeiManage.xcodeproj/project.pbxproj

@@ -1475,7 +1475,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_STYLE = Automatic;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1202023071901;
+				CURRENT_PROJECT_VERSION = 1202023071902;
 				DEVELOPMENT_TEAM = K7T6CU5SW5;
 				DEVELOPMENT_TEAM = K7T6CU5SW5;
 				GENERATE_INFOPLIST_FILE = YES;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = JiaPeiManage/Info.plist;
 				INFOPLIST_FILE = JiaPeiManage/Info.plist;
@@ -1515,7 +1515,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_STYLE = Automatic;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1202023071901;
+				CURRENT_PROJECT_VERSION = 1202023071902;
 				DEVELOPMENT_TEAM = K7T6CU5SW5;
 				DEVELOPMENT_TEAM = K7T6CU5SW5;
 				GENERATE_INFOPLIST_FILE = YES;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = JiaPeiManage/Info.plist;
 				INFOPLIST_FILE = JiaPeiManage/Info.plist;

+ 23 - 0
JiaPeiManage/Assets.xcassets/Modules/Stu/stu_make.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
JiaPeiManage/Assets.xcassets/Modules/Stu/stu_make.imageset/预.png


BIN
JiaPeiManage/Assets.xcassets/Modules/Stu/stu_make.imageset/预@2x.png


BIN
JiaPeiManage/Assets.xcassets/Modules/Stu/stu_make.imageset/预@3x.png


+ 2 - 1
JiaPeiManage/Sources/Models/TraineeDataModel.swift

@@ -27,6 +27,7 @@ struct RowInfo : ImmutableMappable{
     var trainTwoExamStatus : String?
     var trainTwoExamStatus : String?
     var trainTwoExamTime : String?
     var trainTwoExamTime : String?
     var trainType : String?
     var trainType : String?
+    var bmType : String?
 
 
     init(map: Map) throws {
     init(map: Map) throws {
         applydate = try map.value("applydate")
         applydate = try map.value("applydate")
@@ -47,7 +48,7 @@ struct RowInfo : ImmutableMappable{
         trainTwoExamStatus = try map.value("trainTwoExamStatus") ?? ""
         trainTwoExamStatus = try map.value("trainTwoExamStatus") ?? ""
         trainTwoExamTime = try map.value("trainTwoExamTime") ?? ""
         trainTwoExamTime = try map.value("trainTwoExamTime") ?? ""
         trainType = try map.value("trainType")
         trainType = try map.value("trainType")
-        
+        bmType = try map.value("bmType") ?? ""
     }
     }
 
 
 }
 }

+ 28 - 19
JiaPeiManage/Sources/Modulars/学员/Controllers/MeTraineeSearchPageViewController.swift

@@ -81,36 +81,35 @@ final class MeTraineeSearchPageViewController: BaseTableViewController {
         tableView.es.addInfiniteScrolling { [unowned self] in
         tableView.es.addInfiniteScrolling { [unowned self] in
             self.meTraineeSearchViewModel.getLoadMore(vc: self)
             self.meTraineeSearchViewModel.getLoadMore(vc: self)
         }
         }
-        self.isEmptyDisplay = false
+        self.isEmptyDisplay = true
 
 
     }
     }
     
     
     //绑定-rx
     //绑定-rx
     func biandView(){
     func biandView(){
         
         
-        search_textfield.rx.text.orEmpty
-//            .filter { !$0.isEmpty } // Filter out empty strings
-            .subscribe(onNext: { [unowned self] searchText in
-                // Handle the updated search text here
-                print("Search text changed: \(searchText)")
-//                self.searchCoachInfoList()
-                self.meTraineeSearchViewModel.searchCoachInfoList(vc: self)
-            })
-            .disposed(by: disposeBag)
+//        search_textfield.rx.text
+//                    .debounce(.milliseconds(300), scheduler: MainScheduler.instance) // 添加节流防抖,减少频繁查询
+//                    .distinctUntilChanged() // 确保只有文本内容发生变化时才触发查询
+//                    .subscribe(onNext: { [unowned self] query in
+//                        guard let query = query else { return }
+//                        // 在这里处理查询操作,比如发送网络请求或对本地数据进行过滤
+//                        self.meTraineeSearchViewModel.searchCoachInfoList(vc: self)
+//                        print("Query: \(query)")
+//                        // 每当输入文本发生变化,都会在这里触发查询
+//                    })
+//                    .disposed(by: disposeBag)
         
         
-        //RX 绑定
-//        self.meTraineeSearchViewModel.items
-//            .bind(to: tableView.rx.items(cellIdentifier: cellIdentifier,cellType:MeTraineeSubjectCell.self)) { (row, model, cell) in
-//                cell.index_button.setTitle("\(row+1)", for: .normal)
-//                cell.setRowInfo(rowInfo:model as! RowInfo)
-//            }
-//            .disposed(by: disposeBag)
-
+        search_textfield.rx.controlEvent(.editingDidEndOnExit)
+                    .subscribe(onNext: { [weak self] in
+                        self?.handleSearch()
+                    })
+                    .disposed(by: disposeBag)
         // tableView点击事件
         // tableView点击事件
         tableView.rx.itemSelected.subscribe(onNext: { [weak self]indexPath in
         tableView.rx.itemSelected.subscribe(onNext: { [weak self]indexPath in
             print("点击\(indexPath)行")
             print("点击\(indexPath)行")
             let rowInfo:RowInfo = (self!.meTraineeSearchViewModel.traineeDataModel?.rows![indexPath.row])!
             let rowInfo:RowInfo = (self!.meTraineeSearchViewModel.traineeDataModel?.rows![indexPath.row])!
-            if rowInfo != nil {
+            if rowInfo != nil && rowInfo.bmType == "2"  {
                 let context: Int = rowInfo.id!
                 let context: Int = rowInfo.id!
                 NYSwRouter.push(NYSwPushType.trainee_info,context: context)
                 NYSwRouter.push(NYSwPushType.trainee_info,context: context)
             }
             }
@@ -118,6 +117,16 @@ final class MeTraineeSearchPageViewController: BaseTableViewController {
         }).disposed(by: disposeBag)
         }).disposed(by: disposeBag)
 
 
     }
     }
+    //处理搜索
+    func handleSearch() {
+            // 在这里处理搜索事件
+            if let query = search_textfield.text, !query.isEmpty {
+                print("Search query: \(query)")
+                // 在这里执行搜索操作,比如发送网络请求或对本地数据进行过滤
+                self.meTraineeSearchViewModel.searchCoachInfoList(vc: self)
+                search_textfield.resignFirstResponder() // 隐藏键盘
+            }
+    }
     
     
 }
 }
 
 

+ 1 - 1
JiaPeiManage/Sources/Modulars/学员/Controllers/MeTraineeSearchPageViewController.xib

@@ -73,7 +73,7 @@
                                     </constraints>
                                     </constraints>
                                     <color key="textColor" red="0.83137254901960778" green="0.8666666666666667" blue="0.90196078431372551" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                     <color key="textColor" red="0.83137254901960778" green="0.8666666666666667" blue="0.90196078431372551" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                     <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                     <fontDescription key="fontDescription" type="system" pointSize="14"/>
-                                    <textInputTraits key="textInputTraits"/>
+                                    <textInputTraits key="textInputTraits" returnKeyType="search"/>
                                 </textField>
                                 </textField>
                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Kuy-oy-vcr">
                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Kuy-oy-vcr">
                                     <rect key="frame" x="303" y="0.0" width="30" height="30"/>
                                     <rect key="frame" x="303" y="0.0" width="30" height="30"/>

+ 1 - 1
JiaPeiManage/Sources/Modulars/学员/Controllers/MeTraineeSubjectPageViewController.swift

@@ -61,7 +61,7 @@ final class MeTraineeSubjectPageViewController: BaseTableViewController {
         tableView.rx.itemSelected.subscribe(onNext: { [weak self]indexPath in
         tableView.rx.itemSelected.subscribe(onNext: { [weak self]indexPath in
             print("点击\(indexPath)行")
             print("点击\(indexPath)行")
             let rowInfo:RowInfo = (self!.meTraineeSubjectViewModel.traineeDataModel?.rows![indexPath.row])!
             let rowInfo:RowInfo = (self!.meTraineeSubjectViewModel.traineeDataModel?.rows![indexPath.row])!
-            if rowInfo != nil {
+            if rowInfo != nil && rowInfo.bmType == "2"  {
                 let context: Int = rowInfo.id!
                 let context: Int = rowInfo.id!
                 NYSwRouter.push(NYSwPushType.trainee_info,context: context)
                 NYSwRouter.push(NYSwPushType.trainee_info,context: context)
             }
             }

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

@@ -42,7 +42,7 @@ class MeTraineeSearchViewModel: NSObject {
         var keyword:String = vc.search_textfield.text!.trimmingCharacters(in: .whitespacesAndNewlines)
         var keyword:String = vc.search_textfield.text!.trimmingCharacters(in: .whitespacesAndNewlines)
         if keyword == "" {
         if keyword == "" {
             self.traineeDataModel?.total = 0
             self.traineeDataModel?.total = 0
-            self.traineeDataModel?.rows?.removeAll()
+            self.rows.removeAll()
             vc.isEmptyDisplay = true
             vc.isEmptyDisplay = true
             vc.hideLoadAnimation()
             vc.hideLoadAnimation()
             vc.stopRefresh()
             vc.stopRefresh()

+ 7 - 3
JiaPeiManage/Sources/Modulars/学员/Views/MeTraineeSubjectCell.swift

@@ -38,6 +38,9 @@ final class MeTraineeSubjectCell: UITableViewCell,NibLoadable {
     @IBOutlet weak var k3_label: UILabel!
     @IBOutlet weak var k3_label: UILabel!
     @IBOutlet weak var k4_imageview: UIImageView!
     @IBOutlet weak var k4_imageview: UIImageView!
     @IBOutlet weak var k4_label: UILabel!
     @IBOutlet weak var k4_label: UILabel!
+    //预报名
+    @IBOutlet weak var stumake_imageview: UIImageView!
+
     //备注
     //备注
     @IBOutlet weak var remark_label: UILabel!
     @IBOutlet weak var remark_label: UILabel!
     
     
@@ -51,13 +54,13 @@ final class MeTraineeSubjectCell: UITableViewCell,NibLoadable {
     
     
     func setRowInfo(rowInfo:RowInfo){
     func setRowInfo(rowInfo:RowInfo){
         //用户头像
         //用户头像
-        self.user_imageview.sd_setImage(with: rowInfo.photoPath?.urlValue, placeholderImage: rowInfo.sex == "1" ? NYImage.Home.usermale:NYImage.Home.userfemale)
+        self.user_imageview.sd_setImage(with: rowInfo.photoPath?.urlValue, placeholderImage: rowInfo.sex == "2" ? NYImage.Home.userfemale:NYImage.Home.usermale)
         //报名时间
         //报名时间
         let applydateStr = rowInfo.applydate?.prefix(10)
         let applydateStr = rowInfo.applydate?.prefix(10)
         self.jointime_label.text = "报名时间:" +  applydateStr!
         self.jointime_label.text = "报名时间:" +  applydateStr!
         //用户名
         //用户名
         self.username_label.text = rowInfo.name
         self.username_label.text = rowInfo.name
-        self.sex_imageview.image = rowInfo.sex == "1" ? NYImage.Home.sexmale:NYImage.Home.sexfemale
+        self.sex_imageview.image = rowInfo.sex == "2" ? NYImage.Home.sexfemale:NYImage.Home.sexmale
         //身份证
         //身份证
         self.idcart_label.text = rowInfo.idcard
         self.idcart_label.text = rowInfo.idcard
         //电话
         //电话
@@ -95,7 +98,8 @@ final class MeTraineeSubjectCell: UITableViewCell,NibLoadable {
         self.k4_label.text = k4Txt
         self.k4_label.text = k4Txt
         //备注
         //备注
         self.remark_label.text = "备注:" + ((rowInfo.remark==nil||rowInfo.remark=="") ? "无":rowInfo.remark!)
         self.remark_label.text = "备注:" + ((rowInfo.remark==nil||rowInfo.remark=="") ? "无":rowInfo.remark!)
-        
+        //预
+        self.stumake_imageview.isHidden = rowInfo.bmType == "1" ? false:true
     }
     }
     
     
 }
 }

+ 14 - 3
JiaPeiManage/Sources/Modulars/学员/Views/MeTraineeSubjectCell.xib

@@ -68,8 +68,8 @@
                             <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                             <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                             <state key="normal" image="call_phone"/>
                             <state key="normal" image="call_phone"/>
                         </button>
                         </button>
-                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="李泽楷" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="e6H-nJ-vBG">
-                            <rect key="frame" x="101.99999999999999" y="48" width="58.333333333333329" height="22"/>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="李泽楷ABCDEF" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="e6H-nJ-vBG">
+                            <rect key="frame" x="101.99999999999999" y="48" width="133.66666666666663" height="22"/>
                             <constraints>
                             <constraints>
                                 <constraint firstAttribute="height" constant="22" id="8AK-RC-b3J"/>
                                 <constraint firstAttribute="height" constant="22" id="8AK-RC-b3J"/>
                                 <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="45" id="zso-Fa-FYT"/>
                                 <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="45" id="zso-Fa-FYT"/>
@@ -219,12 +219,19 @@
                             </state>
                             </state>
                         </button>
                         </button>
                         <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="user-male" translatesAutoresizingMaskIntoConstraints="NO" id="mpO-WT-68B">
                         <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="user-male" translatesAutoresizingMaskIntoConstraints="NO" id="mpO-WT-68B">
-                            <rect key="frame" x="165.33333333333334" y="50" width="18" height="18"/>
+                            <rect key="frame" x="240.66666666666666" y="50" width="17.999999999999972" height="18"/>
                             <constraints>
                             <constraints>
                                 <constraint firstAttribute="height" constant="18" id="0Pu-ur-IZS"/>
                                 <constraint firstAttribute="height" constant="18" id="0Pu-ur-IZS"/>
                                 <constraint firstAttribute="width" constant="18" id="Q75-r1-dZ2"/>
                                 <constraint firstAttribute="width" constant="18" id="Q75-r1-dZ2"/>
                             </constraints>
                             </constraints>
                         </imageView>
                         </imageView>
+                        <imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="stu_make" translatesAutoresizingMaskIntoConstraints="NO" id="lzM-34-FGn">
+                            <rect key="frame" x="302" y="102" width="28" height="28"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="28" id="3cs-y6-Zvk"/>
+                                <constraint firstAttribute="width" constant="28" id="iKT-cK-lwj"/>
+                            </constraints>
+                        </imageView>
                     </subviews>
                     </subviews>
                     <color key="backgroundColor" red="0.043137254901960784" green="0.16862745098039217" blue="0.30196078431372547" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                     <color key="backgroundColor" red="0.043137254901960784" green="0.16862745098039217" blue="0.30196078431372547" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                     <constraints>
                     <constraints>
@@ -244,7 +251,9 @@
                         <constraint firstAttribute="trailing" secondItem="8Kf-rl-yaG" secondAttribute="trailing" constant="15" id="MzX-Fd-o9N"/>
                         <constraint firstAttribute="trailing" secondItem="8Kf-rl-yaG" secondAttribute="trailing" constant="15" id="MzX-Fd-o9N"/>
                         <constraint firstAttribute="trailing" secondItem="qmu-Cp-oqw" secondAttribute="trailing" constant="37" id="OX4-4k-QpT"/>
                         <constraint firstAttribute="trailing" secondItem="qmu-Cp-oqw" secondAttribute="trailing" constant="37" id="OX4-4k-QpT"/>
                         <constraint firstItem="e6H-nJ-vBG" firstAttribute="leading" secondItem="adu-yu-H5N" secondAttribute="trailing" constant="13" id="PQD-lj-5DS"/>
                         <constraint firstItem="e6H-nJ-vBG" firstAttribute="leading" secondItem="adu-yu-H5N" secondAttribute="trailing" constant="13" id="PQD-lj-5DS"/>
+                        <constraint firstAttribute="trailing" secondItem="lzM-34-FGn" secondAttribute="trailing" constant="15" id="YDC-6a-Jlf"/>
                         <constraint firstItem="qmu-Cp-oqw" firstAttribute="leading" secondItem="8GC-L9-kgq" secondAttribute="leading" constant="37" id="Yux-iA-66b"/>
                         <constraint firstItem="qmu-Cp-oqw" firstAttribute="leading" secondItem="8GC-L9-kgq" secondAttribute="leading" constant="37" id="Yux-iA-66b"/>
+                        <constraint firstItem="lzM-34-FGn" firstAttribute="top" secondItem="26Z-Ih-zAP" secondAttribute="bottom" constant="22" id="akb-5J-9Wz"/>
                         <constraint firstItem="mpO-WT-68B" firstAttribute="centerY" secondItem="e6H-nJ-vBG" secondAttribute="centerY" id="chv-OK-TbM"/>
                         <constraint firstItem="mpO-WT-68B" firstAttribute="centerY" secondItem="e6H-nJ-vBG" secondAttribute="centerY" id="chv-OK-TbM"/>
                         <constraint firstItem="26Z-Ih-zAP" firstAttribute="leading" secondItem="BFL-4s-fhV" secondAttribute="trailing" constant="8" id="d6y-Xo-ziI"/>
                         <constraint firstItem="26Z-Ih-zAP" firstAttribute="leading" secondItem="BFL-4s-fhV" secondAttribute="trailing" constant="8" id="d6y-Xo-ziI"/>
                         <constraint firstItem="CcQ-HC-rwy" firstAttribute="top" secondItem="8GC-L9-kgq" secondAttribute="top" constant="10" id="eDC-gm-sMc"/>
                         <constraint firstItem="CcQ-HC-rwy" firstAttribute="top" secondItem="8GC-L9-kgq" secondAttribute="top" constant="10" id="eDC-gm-sMc"/>
@@ -289,6 +298,7 @@
                 <outlet property="remark_label" destination="qmu-Cp-oqw" id="4gi-NM-y3I"/>
                 <outlet property="remark_label" destination="qmu-Cp-oqw" id="4gi-NM-y3I"/>
                 <outlet property="sex_imageview" destination="mpO-WT-68B" id="8CU-V4-1DY"/>
                 <outlet property="sex_imageview" destination="mpO-WT-68B" id="8CU-V4-1DY"/>
                 <outlet property="state_button" destination="35n-mh-gYb" id="9ap-PT-w1d"/>
                 <outlet property="state_button" destination="35n-mh-gYb" id="9ap-PT-w1d"/>
+                <outlet property="stumake_imageview" destination="lzM-34-FGn" id="eW5-zz-zts"/>
                 <outlet property="user_imageview" destination="adu-yu-H5N" id="jZj-NF-ANi"/>
                 <outlet property="user_imageview" destination="adu-yu-H5N" id="jZj-NF-ANi"/>
                 <outlet property="username_label" destination="e6H-nJ-vBG" id="Te5-Et-SkA"/>
                 <outlet property="username_label" destination="e6H-nJ-vBG" id="Te5-Et-SkA"/>
             </connections>
             </connections>
@@ -303,6 +313,7 @@
         <image name="call_phone" width="36" height="36"/>
         <image name="call_phone" width="36" height="36"/>
         <image name="default-user-male" width="74" height="102"/>
         <image name="default-user-male" width="74" height="102"/>
         <image name="send_msg" width="36" height="36"/>
         <image name="send_msg" width="36" height="36"/>
+        <image name="stu_make" width="28" height="28"/>
         <image name="user-male" width="18" height="18"/>
         <image name="user-male" width="18" height="18"/>
     </resources>
     </resources>
 </document>
 </document>