浏览代码

修改密码 完成

openlockPPP 1 年之前
父节点
当前提交
36c342f162

+ 15 - 0
JiaPeiManage/Sources/Models/UserInfoModel.swift

@@ -285,3 +285,18 @@ struct UserInfo :ImmutableMappable{
         
     }
 }
+
+struct UpdateDataModel : ImmutableMappable{
+
+    var code : Int?
+    var data : AnyObject?
+    var msg : String?
+
+    init(map: Map) throws {
+        code = try map.value("code")
+        data = try map.value("data")
+        msg = try map.value("msg")
+
+    }
+
+}

+ 6 - 5
JiaPeiManage/Sources/Modulars/Mine/Controllers/MineViewController.swift

@@ -36,7 +36,7 @@ final class MineViewController: BaseViewController {
         super.viewDidLoad()
         setupUI()
         
-        self.cocahService.coachInfoRequest(id:String("\(LocalManager.userInfo.id)"), city: "3501")
+        self.cocahService.coachInfoRequest(id:String("\(LocalManager.userInfo.id)"), city: LocalManager.userInfo.city!)
             .subscribe(onSuccess: { userinfo in
                 LocalManager.userInfo = userinfo
                 self.biandView()
@@ -49,6 +49,10 @@ final class MineViewController: BaseViewController {
     // MARK: 私有方法
     func setupUI(){
         self.view.backgroundColor = .db_theme
+        //跳修改密码
+        update_password_button.rx.tap.subscribe ({ _  in
+            NYSwRouter.push(NYSwPushType.mine_uppassword.path)
+        }).disposed(by: disposeBag)
     }
     //绑定-rx
     func biandView(){
@@ -66,10 +70,7 @@ final class MineViewController: BaseViewController {
         self.schoolname_label.text = LocalManager.userInfo.schoolName
         //驾校地址
         self.school_address_label.text = LocalManager.userInfo.address
-        //跳修改密码
-        update_password_button.rx.tap.subscribe ({ _  in
-            NYSwRouter.push(NYSwPushType.mine_uppassword.path)
-        }).disposed(by: disposeBag)
+
     }
     
 }

+ 1 - 1
JiaPeiManage/Sources/Modulars/Mine/Controllers/MineViewController.xib

@@ -15,7 +15,7 @@
                 <outlet property="phone_label" destination="Rgf-bc-AwE" id="l0s-Ze-PAc"/>
                 <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="update_password_button" destination="BM3-xf-AcJ" id="Wkh-DD-JDc"/>
+                <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"/>
                 <outlet property="user_sex_imageview" destination="9Kk-gv-HeL" id="Y1N-KT-8fl"/>

+ 105 - 4
JiaPeiManage/Sources/Modulars/Mine/Controllers/UpdatePasswordViewController.swift

@@ -13,23 +13,124 @@ import RxCocoa
 final class UpdatePasswordViewController: BaseViewController {
     
     // MARK: 服务属性
-    
+    private let loginService: LoginServiceType = LoginService(networking: LoginNetworking())
     
     // MARK: UI属性
-   
+    @IBOutlet weak var old_password_textfield: QMUITextField!
+    @IBOutlet weak var one_password_textfield: QMUITextField!
+    @IBOutlet weak var two_password_textfield: QMUITextField!
+    
+    @IBOutlet weak var old_pwdshow_button: QMUIButton!
+    @IBOutlet weak var one_pwdshow_button: QMUIButton!
+    @IBOutlet weak var two_pwdshow_button: QMUIButton!
+    
+    @IBOutlet weak var confirm_button: UIButton!
+    
     override func viewDidLoad() {
         super.viewDidLoad()
         setupUI()
-       
+        biandView()
     }
     
     // MARK: 私有方法
     func setupUI(){
         self.view.backgroundColor = .db_theme
+        self.old_password_textfield.placeholderColor = .db_place
+        self.one_password_textfield.placeholderColor = .db_place
+        self.two_password_textfield.placeholderColor = .db_place
+
     }
     //绑定-rx
     func biandView(){
-       
+        
+        //显示密码
+        old_pwdshow_button.rx.tap.subscribe ({ [unowned self] (_)  in
+            self.old_pwdshow_button.isSelected = !self.old_pwdshow_button.isSelected;
+            self.old_password_textfield.isSecureTextEntry = !self.old_pwdshow_button.isSelected
+        }).disposed(by: disposeBag)
+        one_pwdshow_button.rx.tap.subscribe ({ [unowned self] (_)  in
+            self.one_pwdshow_button.isSelected = !self.one_pwdshow_button.isSelected;
+            self.one_password_textfield.isSecureTextEntry = !self.one_pwdshow_button.isSelected
+        }).disposed(by: disposeBag)
+        two_pwdshow_button.rx.tap.subscribe ({ [unowned self] (_)  in
+            self.two_pwdshow_button.isSelected = !self.two_pwdshow_button.isSelected;
+            self.two_password_textfield.isSecureTextEntry = !self.two_pwdshow_button.isSelected
+        }).disposed(by: disposeBag)
+        
+        //判断密码的输入是否可用
+        let old_passwordValid = old_password_textfield.rx.text.orEmpty.map{ value in
+            return value.count >= 6
+        }
+        let one_passwordValid = one_password_textfield.rx.text.orEmpty.map{ value in
+            return value.count >= 6
+        }
+        let two_passwordValid = two_password_textfield.rx.text.orEmpty.map{ value in
+            return value.count >= 6
+        }
+        
+        //确定按钮的可用与否
+        let confirmObserver = Observable.combineLatest(old_passwordValid,one_passwordValid,two_passwordValid){(old,one,two) in
+            old && one && two
+        }
+        //绑定按钮
+        confirmObserver.bind(to: confirm_button.rx.isEnabled).disposed(by: disposeBag)
+        confirmObserver.subscribe(onNext: { [unowned self] valid in
+            self.confirm_button.alpha = valid ? 1 : 0.5
+        }).disposed(by: disposeBag)
+        
+        confirm_button.rx.tap
+                    .asObservable()
+                    .withLatestFrom(confirmObserver)
+                    .do(onNext: {
+                        [unowned self]_ in
+                        self.confirm_button.isEnabled = false
+                        self.view.endEditing(true)
+                    })
+                    .subscribe(onNext: {[unowned self]isLogin in
+                        
+                        self.confirm_button.isEnabled = true
+                        let user_name = LocalManager.userInfo.userAccount
+                        let old_pwd = old_password_textfield.text
+                        let one_pwd = one_password_textfield.text
+                        let two_pwd = two_password_textfield.text
+                        if old_pwd != LocalManager.userInfo.password {
+                            NYTips.showMsg(txt: "原密码不正确!")
+                            return
+                        }
+                        if one_pwd != two_pwd {
+                            NYTips.showMsg(txt: "两次密码不相同")
+                            return
+                        }
+                        NYTips.show()
+                        self.loginService.updateRequest(user_name: user_name!, user_password: old_pwd!, new_password: two_pwd!, city: LocalManager.userInfo.city!)
+                            .subscribe(onSuccess: { updateDataModel in
+                                NYTips.hide()
+                                if updateDataModel.data as! Int == 1{
+                                    LocalManager.userInfo.password = two_pwd
+                                    LocalManager.userInfo.isLogin = true //设置已经登录
+                                    print("修改成功:%@", updateDataModel)
+                                    self.navigationController?.popViewController(animated: true)
+                                }else {
+                                    NYTips.showErr(txt: updateDataModel.msg!)
+                                }
+                            }, onError: { error in
+                                NYTips.hide()
+                                NYTips.showErr(txt: error.localizedDescription)
+                                print("%@",error)
+                            })
+                            .disposed(by: disposeBag)
+                        
+                    })
+                    .disposed(by: disposeBag)
+        
+        //添加手势
+        let tapBackground = UITapGestureRecognizer()
+        tapBackground.rx.event
+        .subscribe(onNext: { [weak self] _ in
+            self?.view.endEditing(true)
+        })
+        .disposed(by: disposeBag)
+        view.addGestureRecognizer(tapBackground)
     }
     
 }

+ 219 - 7
JiaPeiManage/Sources/Modulars/Mine/Controllers/UpdatePasswordViewController.xib

@@ -1,31 +1,243 @@
 <?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="retina6_12" orientation="portrait" appearance="light"/>
+    <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="System colors in document resources" minToolsVersion="11.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="UpdatePasswordViewController" customModule="JiaPeiManage" customModuleProvider="target">
             <connections>
+                <outlet property="confirm_button" destination="zvD-Ux-XOx" id="YKb-yY-sI3"/>
+                <outlet property="old_password_textfield" destination="rV6-hn-VK3" id="PfL-x4-Vco"/>
+                <outlet property="old_pwdshow_button" destination="Ko0-y8-PQF" id="8Ga-I3-bPM"/>
+                <outlet property="one_password_textfield" destination="0r9-mx-DVE" id="k3l-Eb-TdD"/>
+                <outlet property="one_pwdshow_button" destination="a5c-vZ-hZw" id="W3U-cQ-XHv"/>
+                <outlet property="two_password_textfield" destination="YK2-XW-cPi" id="bJl-0b-5QM"/>
+                <outlet property="two_pwdshow_button" destination="9Kh-7U-jHb" id="elg-VU-41A"/>
                 <outlet property="view" destination="iN0-l3-epB" id="ISs-ER-yC4"/>
             </connections>
         </placeholder>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
         <view contentMode="scaleToFill" id="iN0-l3-epB">
-            <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
+            <rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="cwz-5h-tTQ" userLabel="View-nav">
+                    <rect key="frame" x="0.0" y="0.0" width="375" height="64"/>
+                    <subviews>
+                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DMN-uA-YHr">
+                            <rect key="frame" x="0.0" y="20" width="44" height="44"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="44" id="dly-pb-XYs"/>
+                                <constraint firstAttribute="height" constant="44" id="ilR-W0-UAQ"/>
+                            </constraints>
+                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            <state key="normal" image="back-white"/>
+                            <connections>
+                                <action selector="actionBackdo:" destination="-1" eventType="touchUpInside" id="7Ny-MQ-ydR"/>
+                            </connections>
+                        </button>
+                    </subviews>
+                    <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    <constraints>
+                        <constraint firstItem="DMN-uA-YHr" firstAttribute="leading" secondItem="cwz-5h-tTQ" secondAttribute="leading" id="5Mh-sb-Vdg"/>
+                        <constraint firstAttribute="bottom" secondItem="DMN-uA-YHr" secondAttribute="bottom" id="F0p-Ut-PNw"/>
+                        <constraint firstAttribute="height" constant="64" id="bUh-GZ-5BM"/>
+                    </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="tIa-u7-nB9">
+                    <rect key="frame" x="26" y="88" width="120" height="35"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="35" id="wwj-e4-XLx"/>
+                        <constraint firstAttribute="width" constant="120" id="x75-c4-XJT"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="boldSystem" pointSize="26"/>
+                    <color key="textColor" red="0.83137254900000002" green="0.86666666670000003" blue="0.90196078430000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4u8-Ic-H2X" userLabel="View-input">
+                    <rect key="frame" x="42" y="173" width="291" height="45"/>
+                    <subviews>
+                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="login_pwd" translatesAutoresizingMaskIntoConstraints="NO" id="7j9-PZ-Uwv">
+                            <rect key="frame" x="25" y="9.6666666666666572" width="22" height="26"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="22" id="PJG-VJ-99b"/>
+                                <constraint firstAttribute="height" constant="26" id="sA9-0U-euq"/>
+                            </constraints>
+                        </imageView>
+                        <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入旧密码" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="rV6-hn-VK3" customClass="QMUITextField">
+                            <rect key="frame" x="62" y="0.0" width="166" height="45"/>
+                            <color key="textColor" red="0.83137254900000002" green="0.86666666670000003" blue="0.90196078430000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                            <textInputTraits key="textInputTraits" secureTextEntry="YES"/>
+                        </textField>
+                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ko0-y8-PQF" customClass="QMUIButton">
+                            <rect key="frame" x="243" y="0.0" width="22" height="45"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="22" id="EOd-rp-pCV"/>
+                            </constraints>
+                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            <state key="normal" image="login_hide"/>
+                            <state key="selected" image="login_show"/>
+                        </button>
+                    </subviews>
+                    <color key="backgroundColor" red="0.14901960780000001" green="0.28235294119999998" blue="0.41960784309999999" alpha="1" colorSpace="calibratedRGB"/>
+                    <constraints>
+                        <constraint firstAttribute="bottom" secondItem="rV6-hn-VK3" secondAttribute="bottom" id="52j-cM-0he"/>
+                        <constraint firstItem="Ko0-y8-PQF" firstAttribute="top" secondItem="4u8-Ic-H2X" secondAttribute="top" id="7qI-79-GFS"/>
+                        <constraint firstItem="7j9-PZ-Uwv" firstAttribute="leading" secondItem="4u8-Ic-H2X" secondAttribute="leading" constant="25" id="E2I-E5-xXK"/>
+                        <constraint firstAttribute="trailing" secondItem="Ko0-y8-PQF" secondAttribute="trailing" constant="26" id="Ldi-0s-6BS"/>
+                        <constraint firstItem="rV6-hn-VK3" firstAttribute="leading" secondItem="7j9-PZ-Uwv" secondAttribute="trailing" constant="15" id="RB5-YT-Kv1"/>
+                        <constraint firstItem="Ko0-y8-PQF" firstAttribute="leading" secondItem="rV6-hn-VK3" secondAttribute="trailing" constant="15" id="TjH-2R-cyu"/>
+                        <constraint firstAttribute="height" constant="45" id="XRL-Vd-fIV"/>
+                        <constraint firstItem="rV6-hn-VK3" firstAttribute="top" secondItem="4u8-Ic-H2X" secondAttribute="top" id="YQG-To-3Ne"/>
+                        <constraint firstAttribute="bottom" secondItem="Ko0-y8-PQF" secondAttribute="bottom" id="gat-2L-bmi"/>
+                        <constraint firstItem="7j9-PZ-Uwv" firstAttribute="centerY" secondItem="4u8-Ic-H2X" secondAttribute="centerY" id="oBG-4e-UDc"/>
+                    </constraints>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                            <real key="value" value="5"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
+                </view>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aWB-OC-GAl" userLabel="View-input">
+                    <rect key="frame" x="42" y="238" width="291" height="45"/>
+                    <subviews>
+                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="login_pwd" translatesAutoresizingMaskIntoConstraints="NO" id="6It-gs-b8c">
+                            <rect key="frame" x="25" y="9.6666666666666572" width="22" height="26"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="22" id="Vlq-20-dAA"/>
+                                <constraint firstAttribute="height" constant="26" id="aeH-SR-mbB"/>
+                            </constraints>
+                        </imageView>
+                        <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入新密码" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="0r9-mx-DVE" customClass="QMUITextField">
+                            <rect key="frame" x="62" y="0.0" width="166" height="45"/>
+                            <color key="textColor" red="0.83137254900000002" green="0.86666666670000003" blue="0.90196078430000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                            <textInputTraits key="textInputTraits"/>
+                        </textField>
+                        <button opaque="NO" contentMode="scaleToFill" selected="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="a5c-vZ-hZw" customClass="QMUIButton">
+                            <rect key="frame" x="243" y="0.0" width="22" height="45"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="22" id="ija-Zi-KVq"/>
+                            </constraints>
+                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            <state key="normal" image="login_hide"/>
+                            <state key="selected" image="login_show"/>
+                        </button>
+                    </subviews>
+                    <color key="backgroundColor" red="0.14901960780000001" green="0.28235294119999998" blue="0.41960784309999999" alpha="1" colorSpace="calibratedRGB"/>
+                    <constraints>
+                        <constraint firstAttribute="trailing" secondItem="a5c-vZ-hZw" secondAttribute="trailing" constant="26" id="2xN-Ik-5pw"/>
+                        <constraint firstItem="0r9-mx-DVE" firstAttribute="top" secondItem="aWB-OC-GAl" secondAttribute="top" id="2y5-hK-ksy"/>
+                        <constraint firstItem="0r9-mx-DVE" firstAttribute="leading" secondItem="6It-gs-b8c" secondAttribute="trailing" constant="15" id="EIs-8e-hIQ"/>
+                        <constraint firstItem="a5c-vZ-hZw" firstAttribute="leading" secondItem="0r9-mx-DVE" secondAttribute="trailing" constant="15" id="NJZ-MJ-Iu8"/>
+                        <constraint firstAttribute="bottom" secondItem="a5c-vZ-hZw" secondAttribute="bottom" id="OFx-di-1jz"/>
+                        <constraint firstItem="6It-gs-b8c" firstAttribute="leading" secondItem="aWB-OC-GAl" secondAttribute="leading" constant="25" id="XeO-S3-fb9"/>
+                        <constraint firstAttribute="bottom" secondItem="0r9-mx-DVE" secondAttribute="bottom" id="YPv-FO-mqD"/>
+                        <constraint firstItem="a5c-vZ-hZw" firstAttribute="top" secondItem="aWB-OC-GAl" secondAttribute="top" id="a5p-Hj-Pe0"/>
+                        <constraint firstAttribute="height" constant="45" id="f9d-12-aFQ"/>
+                        <constraint firstItem="6It-gs-b8c" firstAttribute="centerY" secondItem="aWB-OC-GAl" secondAttribute="centerY" id="qrd-AJ-Rl3"/>
+                    </constraints>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                            <real key="value" value="5"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
+                </view>
+                <button opaque="NO" clipsSubviews="YES" alpha="0.5" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="zvD-Ux-XOx">
+                    <rect key="frame" x="42" y="428" width="291" height="45"/>
+                    <color key="backgroundColor" red="0.20784313730000001" green="0.74901960779999999" blue="0.36862745099999999" alpha="1" colorSpace="calibratedRGB"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="45" id="23S-pm-0nR"/>
+                    </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>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gub-Vs-nhl" userLabel="View-input">
+                    <rect key="frame" x="42" y="303" width="291" height="45"/>
+                    <subviews>
+                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="login_pwd" translatesAutoresizingMaskIntoConstraints="NO" id="Hxc-MN-hB9">
+                            <rect key="frame" x="25" y="9.6666666666666856" width="22" height="26"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="26" id="EG0-IP-82r"/>
+                                <constraint firstAttribute="width" constant="22" id="sxo-jC-bjG"/>
+                            </constraints>
+                        </imageView>
+                        <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请再次输入新密码" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="YK2-XW-cPi" customClass="QMUITextField">
+                            <rect key="frame" x="62" y="0.0" width="166" height="45"/>
+                            <color key="textColor" red="0.83137254900000002" green="0.86666666670000003" blue="0.90196078430000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                            <textInputTraits key="textInputTraits"/>
+                        </textField>
+                        <button opaque="NO" contentMode="scaleToFill" selected="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9Kh-7U-jHb" customClass="QMUIButton">
+                            <rect key="frame" x="243" y="0.0" width="22" height="45"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="22" id="j2f-Z3-9fu"/>
+                            </constraints>
+                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            <state key="normal" image="login_hide"/>
+                            <state key="selected" image="login_show"/>
+                        </button>
+                    </subviews>
+                    <color key="backgroundColor" red="0.14901960780000001" green="0.28235294119999998" blue="0.41960784309999999" alpha="1" colorSpace="calibratedRGB"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="45" id="CfA-T2-aoV"/>
+                        <constraint firstItem="YK2-XW-cPi" firstAttribute="leading" secondItem="Hxc-MN-hB9" secondAttribute="trailing" constant="15" id="DtB-e6-14h"/>
+                        <constraint firstItem="Hxc-MN-hB9" firstAttribute="centerY" secondItem="gub-Vs-nhl" secondAttribute="centerY" id="GLs-Sh-XDd"/>
+                        <constraint firstItem="YK2-XW-cPi" firstAttribute="top" secondItem="gub-Vs-nhl" secondAttribute="top" id="WKA-Mm-mBG"/>
+                        <constraint firstAttribute="trailing" secondItem="9Kh-7U-jHb" secondAttribute="trailing" constant="26" id="WdG-FZ-4nf"/>
+                        <constraint firstItem="Hxc-MN-hB9" firstAttribute="leading" secondItem="gub-Vs-nhl" secondAttribute="leading" constant="25" id="XxC-TP-JZC"/>
+                        <constraint firstAttribute="bottom" secondItem="9Kh-7U-jHb" secondAttribute="bottom" id="dnQ-Vk-5HD"/>
+                        <constraint firstItem="9Kh-7U-jHb" firstAttribute="top" secondItem="gub-Vs-nhl" secondAttribute="top" id="hDV-Bi-duO"/>
+                        <constraint firstItem="9Kh-7U-jHb" firstAttribute="leading" secondItem="YK2-XW-cPi" secondAttribute="trailing" constant="15" id="hc2-zX-DEx"/>
+                        <constraint firstAttribute="bottom" secondItem="YK2-XW-cPi" secondAttribute="bottom" id="iO9-TQ-71A"/>
+                    </constraints>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                            <real key="value" value="5"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
+                </view>
+            </subviews>
             <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
-            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+            <color key="backgroundColor" red="0.043137254899999998" green="0.16862745100000001" blue="0.30196078430000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+            <constraints>
+                <constraint firstItem="cwz-5h-tTQ" firstAttribute="trailing" secondItem="vUN-kp-3ea" secondAttribute="trailing" id="2XG-Hz-9z9"/>
+                <constraint firstItem="cwz-5h-tTQ" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="CFE-rC-Os6"/>
+                <constraint firstItem="gub-Vs-nhl" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="42" id="EQh-e9-jI7"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="gub-Vs-nhl" secondAttribute="trailing" constant="42" id="Jc6-mI-Acb"/>
+                <constraint firstItem="4u8-Ic-H2X" firstAttribute="top" secondItem="tIa-u7-nB9" secondAttribute="bottom" constant="50" id="O2i-Vy-a8x"/>
+                <constraint firstItem="tIa-u7-nB9" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="26" id="QPB-AG-flB"/>
+                <constraint firstItem="zvD-Ux-XOx" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="42" id="R9G-0x-qMV"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="4u8-Ic-H2X" secondAttribute="trailing" constant="42" id="U2e-dg-j87"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="zvD-Ux-XOx" secondAttribute="trailing" constant="42" id="cBR-Gl-cD6"/>
+                <constraint firstItem="aWB-OC-GAl" firstAttribute="top" secondItem="4u8-Ic-H2X" secondAttribute="bottom" constant="20" id="cQX-sH-ChK"/>
+                <constraint firstItem="zvD-Ux-XOx" firstAttribute="top" secondItem="gub-Vs-nhl" secondAttribute="bottom" constant="80" id="cZI-cm-591"/>
+                <constraint firstItem="aWB-OC-GAl" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="42" id="fcn-Ms-R0v"/>
+                <constraint firstItem="4u8-Ic-H2X" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="42" id="hVg-Kj-XKE"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="aWB-OC-GAl" secondAttribute="trailing" constant="42" id="ius-Xa-af5"/>
+                <constraint firstItem="cwz-5h-tTQ" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="sKS-pS-fB1"/>
+                <constraint firstItem="tIa-u7-nB9" firstAttribute="top" secondItem="cwz-5h-tTQ" secondAttribute="bottom" constant="24" id="v37-on-sjA"/>
+                <constraint firstItem="gub-Vs-nhl" firstAttribute="top" secondItem="aWB-OC-GAl" secondAttribute="bottom" constant="20" id="y0b-5F-pfw"/>
+            </constraints>
             <point key="canvasLocation" x="56" y="-11"/>
         </view>
     </objects>
     <resources>
-        <systemColor name="systemBackgroundColor">
-            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-        </systemColor>
+        <image name="back-white" width="9.3333330154418945" height="17"/>
+        <image name="login_hide" width="22" height="11.333333015441895"/>
+        <image name="login_pwd" width="21.666666030883789" height="26"/>
+        <image name="login_show" width="22.333333969116211" height="13.666666984558105"/>
     </resources>
 </document>

+ 5 - 1
JiaPeiManage/Sources/Modulars/学员/Controllers/MeTraineeDetails/MeTraineeDetails03Controller.swift

@@ -119,6 +119,10 @@ extension MeTraineeDetails03Controller:UITableViewDataSource {
     }
     
     func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
+        if(rows.count>0){
+            let info = rows.first! as StuLogFacInfoModel
+            header03_view.usertemplate_imageview.sd_setImage(with: info.sourceimg?.urlValue)
+        }
         return header03_view
     }
     
@@ -132,7 +136,7 @@ extension MeTraineeDetails03Controller:UITableViewDataSource {
         cell.backgroundColor = ((indexPath.row%2) != 0) ? UIColor("#113357") : UIColor("#0B2B4D")
         let info = rows[indexPath.row] as StuLogFacInfoModel
         cell.stutime_label.text = info.crdate
-        cell.user_imageview.sd_setImage(with: info.sourceimg?.urlValue)
+        cell.user_imageview.sd_setImage(with: info.img?.urlValue)
         cell.similar_label.text = info.similar
         cell.phone_label.text = info.sim
         return cell

+ 3 - 3
JiaPeiManage/Sources/Services/LoginService.swift

@@ -13,7 +13,7 @@ protocol LoginServiceType {
 
     func loginRequest(user_name: String, user_password: String, city:String) -> Single<UserInfo>
     
-    func updateRequest(user_name: String, user_password: String,new_password: String, city:String) -> Single<UserInfo>
+    func updateRequest(user_name: String, user_password: String,new_password: String, city:String) -> Single<UpdateDataModel>
     
     func dictRequest(dictType:String) -> Single<[CityItem]>
     
@@ -35,9 +35,9 @@ final class LoginService: LoginServiceType {
     }
     
     //修改密码
-    func updateRequest(user_name: String, user_password: String, new_password: String, city: String) -> RxSwift.Single<UserInfo> {
+    func updateRequest(user_name: String, user_password: String, new_password: String, city: String) -> RxSwift.Single<UpdateDataModel> {
         let api = LoginAPI.updateUser(user_name: user_name, user_password: user_password, new_password: new_password, city: city)
-        return networking.request(api).map(UserInfo.self)
+        return networking.request(api).map(UpdateDataModel.self, isModel: true)
     }
     
     //获取地区字典