openlockPPP 1 سال پیش
والد
کامیت
6fffc633f1

+ 1 - 1
JiaPeiManage/Sources/Modulars/Login/Controllers/LoginViewController.xib

@@ -217,7 +217,7 @@
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="VtF-yH-Ucb">
                     <rect key="frame" x="67.666666666666686" y="720" width="240" height="18"/>
                     <subviews>
-                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="e49-95-2qF" customClass="QMUIButton">
+                        <button opaque="NO" contentMode="scaleToFill" selected="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="e49-95-2qF" customClass="QMUIButton">
                             <rect key="frame" x="0.0" y="1" width="60" height="16"/>
                             <constraints>
                                 <constraint firstAttribute="width" constant="60" id="diK-6K-3bA"/>

+ 2 - 5
JiaPeiManage/Sources/Modulars/Mine/Controllers/SwitchAccountViewController.swift

@@ -69,7 +69,7 @@ final class SwitchAccountViewController: BaseTableViewController {
     //绑定-rx
     func biandView(){
         
-        tableView.delegate = self
+        tableView.delegate = self.switchAccountViewModel
         tableView.separatorStyle = .none //去除分割线
         tableView.register(UINib(nibName: "SwitchAccountCell", bundle: nil), forCellReuseIdentifier: cellIdentifier)
         tableView.rowHeight = 96.f
@@ -115,7 +115,4 @@ final class SwitchAccountViewController: BaseTableViewController {
     
 }
 
-//事件
-extension SwitchAccountViewController:UITableViewDelegate {
-    
-}
+

+ 11 - 1
JiaPeiManage/Sources/Modulars/Mine/ViewModel/SwitchAccountViewModel.swift

@@ -29,7 +29,6 @@ class SwitchAccountViewModel: NSObject {
     
     override init() {
         super.init()
-//        searchCoachInfoList()
     }
     
     //获取用户并刷新
@@ -81,6 +80,7 @@ class SwitchAccountViewModel: NSObject {
                 LocalManager.userInfo.isLogin = true //设置已经登录
                 print("登录成功:%@", userinfo)
                 NYTips.showMsg(txt: "切换成功")
+                //self.navigationController?.popViewController(animated: true)
             }, onError: { error in
                 NYTips.hide()
                 NYTips.showErr(txt: (error as! RequestError).errorDescription)
@@ -95,6 +95,12 @@ class SwitchAccountViewModel: NSObject {
         
         let alertController = QMUIAlertController(title: "提示", message: "确认删除这个用户信息?", preferredStyle: .alert)
         let action2 = QMUIAlertAction(title: "删除", style: .default) { [unowned self] vc, action in
+            let account = self.rows[row]
+            if account.idcard == LocalManager.userInfo.idcard {
+                //清除登录信息
+                LocalManager.userInfo.userAccount = ""
+                LocalManager.userInfo.password = ""
+            }
             NYAccountManager.shared.deleteAccount(at: row)
             self.getAccountsRead()
         }
@@ -111,3 +117,7 @@ class SwitchAccountViewModel: NSObject {
     
 }
 
+//事件
+extension SwitchAccountViewModel:UITableViewDelegate {
+    
+}

+ 2 - 2
JiaPeiManage/Sources/Modulars/Mine/Views/SwitchAccountCell.xib

@@ -26,8 +26,8 @@
                                         <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"/>
+                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                    <state key="normal" image="btn_del_red"/>
                                     <connections>
                                         <action selector="buttonActionDeldo:" destination="iN0-l3-epB" eventType="touchUpInside" id="gx7-PI-NBi"/>
                                     </connections>