Browse Source

代码优化

culturetown 1 tuần trước cách đây
mục cha
commit
ee1cce5cd8

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

@@ -231,22 +231,6 @@
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            uuid = "087DAC91-F107-4EBD-BD88-E506A833675F"
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "Koala/Modular/JDMine/VC/JDMineViewController.swift"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "160"
-            endingLineNumber = "160"
-            landmarkName = "tableView(_:cellForRowAt:)"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
             uuid = "0720976D-8872-479F-BFAD-39B93157162E"
             shouldBeEnabled = "No"
             ignoreCount = "0"

+ 12 - 12
Koala/Koala/Modular/JDMine/VC/JDMineUserInfoViewController.swift

@@ -94,9 +94,9 @@ extension JDMineUserInfoViewController: UITableViewDataSource {
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
         if indexPath.row == 0 {
             let cell = tableView.dequeueReusableCell(withIdentifier: JDMineUserInfoAvatarCell.description()) as! JDMineUserInfoAvatarCell
-                
+            
             cell.titleLb.text = self.titleAry[indexPath.row]
-          
+            
             cell.avatarIv.snp.updateConstraints { make in
                 make.size.equalTo(CGSize(width: 30, height: 30))
             }
@@ -106,25 +106,25 @@ extension JDMineUserInfoViewController: UITableViewDataSource {
             } else {
                 cell.avatarIv.image = Base_Avtor_Image
             }
-
+            
             cell.accessoryType = .disclosureIndicator
             
             return cell
         } else if indexPath.row == 2 {
             let cell = tableView.dequeueReusableCell(withIdentifier: JDMineUserInfoCell.description()) as! JDMineUserInfoCell
-                
+            
             cell.titleLb.text = self.titleAry[indexPath.row]
-          
+            
             cell.valueLb.text = OperationalUserInfoData.getUserInfoDataModel().uid
- 
+            
             cell.accessoryView = UIImageView(image: _image("jdmine_userinfo_copy&jdmine_userinfo_copy"))
             
             return cell
         } else if indexPath.row == 3 {
             let cell = tableView.dequeueReusableCell(withIdentifier: JDMineUserInfoAvatarCell.description()) as! JDMineUserInfoAvatarCell
-                
+            
             cell.titleLb.text = self.titleAry[indexPath.row]
-          
+            
             cell.avatarIv.image = _image("jdmine_userinfo_qr&jdmine_userinfo_qr")
             cell.avatarIv.snp.updateConstraints { make in
                 make.size.equalTo(CGSize(width: 15, height: 15))
@@ -134,9 +134,9 @@ extension JDMineUserInfoViewController: UITableViewDataSource {
             return cell
         } else if indexPath.row == 6 {
             let cell = tableView.dequeueReusableCell(withIdentifier: JDMineUserInfoAvatarCell.description()) as! JDMineUserInfoAvatarCell
-                
+            
             cell.titleLb.text = self.titleAry[indexPath.row]
-          
+            
             cell.avatarIv.backgroundColor = MainBackGroundColor
             cell.avatarIv.snp.updateConstraints { make in
                 make.size.equalTo(CGSize(width: 64, height: 34))
@@ -154,9 +154,9 @@ extension JDMineUserInfoViewController: UITableViewDataSource {
         }
         
         let cell = tableView.dequeueReusableCell(withIdentifier: JDMineUserInfoCell.description()) as! JDMineUserInfoCell
-            
+        
         cell.titleLb.text = self.titleAry[indexPath.row]
-      
+        
         if indexPath.row == 1 {
             cell.valueLb.text = OperationalUserInfoData.getUserInfoDataModel().im_name
         } else if indexPath.row == 4 {

+ 56 - 97
Koala/Koala/Modular/JDMine/VC/JDMineViewController.swift

@@ -11,7 +11,7 @@ import UIKit
 class JDMineViewController: BaseViewController {
     lazy var headerView: JDMineHeaderView = {
         let v = JDMineHeaderView(frame: CGRectMake(0, 0, SCREEN_WIDTH, 100))
-
+        
         return v
     }()
     
@@ -51,7 +51,7 @@ class JDMineViewController: BaseViewController {
         super.viewWillAppear(animated)
         
         netForGetAccouontInfo()
-    
+        
         tableView.reloadData()
     }
     
@@ -65,24 +65,16 @@ class JDMineViewController: BaseViewController {
             make.height.equalTo(NavigationViewHeight+StatusBarHeight)
         }
         
-//        self.myNavigationBar.title_Label.text = switchLanguage("我的")
-//        self.myNavigationBar.right_SuperView.isHidden = false
-//        self.myNavigationBar.right_Button.setImage(_image("Infomation_chat&Infomation_chat"), for: .normal)
-//        self.myNavigationBar.right_Button.addTarget(self, action: #selector(clickRightBtnAction), for: .touchUpInside)
-
         view.addSubview(tableView)
         tableView.snp.makeConstraints { make in
             make.left.right.bottom.equalTo(self.view)
-//            make.top.equalTo(self.myNavigationBar.snp.bottom)
             make.top.equalTo(navView.snp.bottom)
-//            make.top.equalTo(self.view.snp.top).offset(-StatusBarHeight)
+            
         }
     }
     
     @objc func clickRightBtnAction() {
-//        let vc = JDMessageViewController()
-//
-//        self.navigationController?.pushViewController(vc, animated: true)
+        
         let vc = JDSystemNotificationViewController()
         vc.myNavigationBar.title_Label.text = switchLanguage("个人消息")
         vc.viewModel.category = ""
@@ -126,13 +118,7 @@ extension JDMineViewController: UITableViewDataSource {
     
     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
         if section == 0 {
-//            let on = SaveData.shared().getCryptoOnOff()
-//
-//            if on {
-//                return 1
-//            } else {
-                return 0
-//            }
+            return 0
         } else if section == 1 {
             return 1
         } else {
@@ -154,9 +140,8 @@ extension JDMineViewController: UITableViewDataSource {
                 guard OperationalUserInfoData.getLogin() else {
                     return UITableViewCell()
                 }
-                    
+                
                 let cell = tableView.dequeueReusableCell(withIdentifier: JDMineNewInviteCell.description()) as! JDMineNewInviteCell
-//                cell.codeLb.text = OperationalUserInfoData.getUserInfoDataModel().code
                 cell.setCode()
                 
                 return cell
@@ -168,16 +153,11 @@ extension JDMineViewController: UITableViewDataSource {
             cell.subTitleLb.text = subTitleAry[indexPath.section][indexPath.row]
             cell.iconIv.image = UIImage(named: iconAry[indexPath.section][indexPath.row])
             
-//            if indexPath.row == 0 && indexPath.section == 2{
-//                cell.youliIcon.isHidden = false
-//
-//            }else {
             cell.youliIcon.isHidden = true
-
-//            }
+            
             
             if indexPath.section == 2 {
-                if /* indexPath.row == 2 || */ indexPath.row == 0 {
+                if indexPath.row == 0 {
                     if OperationalUserInfoData.getLogin() {
                         cell.line.isHidden = true
                     } else {
@@ -224,7 +204,7 @@ extension JDMineViewController: UITableViewDataSource {
 
 extension JDMineViewController: UITableViewDelegate {
     func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
-        if section == 0 /* || section == 1 */ {
+        if section == 0 {
             return UIView()
         } else if section == 2 {
             let v = UIView(frame: CGRectMake(0, 0, SCREEN_WIDTH, 9))
@@ -234,9 +214,9 @@ extension JDMineViewController: UITableViewDelegate {
         
         return UIView()
     }
-
+    
     func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        if section == 0 /* || section == 1 */ {
+        if section == 0 {
             return 0.00001
         } else if section == 2 {
             return 6
@@ -271,9 +251,9 @@ extension JDMineViewController: UITableViewDelegate {
                 currentVc()?.navigationController?.pushViewController(JDLoginViewController(), animated: true)
                 return
             }
-
+            
             if indexPath.row == 0 {
-                // let vc = JDMineVIPViewController()
+                
                 let vc = JDMineNewVipViewController()
                 
                 currentVc()?.navigationController?.pushViewController(vc, animated: true)
@@ -286,69 +266,54 @@ extension JDMineViewController: UITableViewDelegate {
                 currentVc()?.navigationController?.pushViewController(JDLoginViewController(), animated: true)
                 return
             }
-
+            
             if indexPath.row == 0 {
                 let vc = BaseWebViewController()
                 vc.needHiddenWebNav = false
                 
                 switch GlobalSingle.sharedInstance.currentLan {
-                    case .EnglishLanguage:
-                        vc.url = JoinENUrl+OperationalUserInfoData.getUserInfoDataModel().uid+"?flag=app"
-                    case .TraditionalLanguage:
-                        vc.url = JoinTWUrl+OperationalUserInfoData.getUserInfoDataModel().uid+"?flag=app"
-                    case .ChineseLanguage:
-                        vc.url = JoinUrl+OperationalUserInfoData.getUserInfoDataModel().uid+"?flag=app"
-                    default:
-                        vc.url = JoinENUrl+OperationalUserInfoData.getUserInfoDataModel().uid+"?flag=app"
+                case .EnglishLanguage:
+                    vc.url = JoinENUrl+OperationalUserInfoData.getUserInfoDataModel().uid+"?flag=app"
+                case .TraditionalLanguage:
+                    vc.url = JoinTWUrl+OperationalUserInfoData.getUserInfoDataModel().uid+"?flag=app"
+                case .ChineseLanguage:
+                    vc.url = JoinUrl+OperationalUserInfoData.getUserInfoDataModel().uid+"?flag=app"
+                default:
+                    vc.url = JoinENUrl+OperationalUserInfoData.getUserInfoDataModel().uid+"?flag=app"
                 }
                 
                 vc.myNavigationBar.title_Label.text = switchLanguage("合伙人计划")
                 currentVc()?.navigationController?.pushViewController(vc, animated: true)
             } else if indexPath.row == 1 {
-//                let vc = JDMineJoinUsViewController()
-//
-//                currentVc()?.navigationController?.pushViewController(vc, animated: true)
-                
-//                let vc = JDMineInviteViewController()
-//
-//                currentVc()?.navigationController?.pushViewController(vc, animated: true)
-                
                 return
             } else if indexPath.row == 2 {
                 let vc = JDMineCouponManagerViewController()
                 currentVc()?.navigationController?.pushViewController(vc, animated: true)
             } else if indexPath.row == 3 {
                 let vc = BaseWebViewController()
-
+                
                 var url = ACTIVITYCENTER+"?tab=1"
                 
                 switch GlobalSingle.sharedInstance.currentLan {
-                    case .EnglishLanguage:
-                        url = ACTIVITYCENTER+"?tab=1&language=en"
-                    case .TraditionalLanguage:
-                        url = ACTIVITYCENTER+"?tab=1&language=zh-TW"
-                    case .ChineseLanguage:
-                        url = ACTIVITYCENTER+"?tab=1&language=zh-CN"
-                    default:
-                        url = ACTIVITYCENTER+"?tab=1&language=en"
+                case .EnglishLanguage:
+                    url = ACTIVITYCENTER+"?tab=1&language=en"
+                case .TraditionalLanguage:
+                    url = ACTIVITYCENTER+"?tab=1&language=zh-TW"
+                case .ChineseLanguage:
+                    url = ACTIVITYCENTER+"?tab=1&language=zh-CN"
+                default:
+                    url = ACTIVITYCENTER+"?tab=1&language=en"
                 }
-         
+                
                 vc.url = url
                 vc.myNavigationBar.title_Label.text = switchLanguage("活动中心")
                 
-//                vc.myNavigationBar.right_SuperView.isHidden = false
-//                vc.myNavigationBar.right_Button.setTitle(switchLanguage("往期")+"  ", for: .normal)
-//                vc.myNavigationBar.right_Button.setTitleColor(_color("#0F6EFF&#0F6EFF"), for: .normal)
-//                vc.myNavigationBar.right_Button.setTextFont(.PFSM, 15)
-//                vc.myNavigationBar.right_Button.addTarget(self, action: #selector(activityBtnAction), for: .touchUpInside)
-                
                 let navBtn: UIButton = {
                     let v = UIButton(type: .custom)
                     v.setTitle(switchLanguage("往期活动"), for: .normal)
-                
+                    
                     v.setTextFont(.PFSM, 15)
                     v.setTitleColor(.black, for: .normal)
-                    // v.layoutButtonEdgeInsetStyle(type: .left, space: 2)
                     v.addTarget(self, action: #selector(activityBtnAction), for: .touchUpInside)
                     return v
                 }()
@@ -360,27 +325,25 @@ extension JDMineViewController: UITableViewDelegate {
                 }
                 currentVc()?.navigationController?.pushViewController(vc, animated: true)
                 
-//                let vc = JDMineActiveViewController()
-//                currentVc()?.navigationController?.pushViewController(vc, animated: true)
             }
             
         } else if indexPath.section == 3 {
             if indexPath.row == 0 {
                 let vc = BaseWebViewController()
-
+                
                 var url = HELPCENTER
                 
                 switch GlobalSingle.sharedInstance.currentLan {
-                    case .EnglishLanguage:
-                        url = HELPCENTER+"/?language=en"
-                    case .TraditionalLanguage:
-                        url = HELPCENTER+"/?language=zh-TW"
-                    case .ChineseLanguage:
-                        url = HELPCENTER+"/?language=zh-CN"
-                    default:
-                        url = HELPCENTER
+                case .EnglishLanguage:
+                    url = HELPCENTER+"/?language=en"
+                case .TraditionalLanguage:
+                    url = HELPCENTER+"/?language=zh-TW"
+                case .ChineseLanguage:
+                    url = HELPCENTER+"/?language=zh-CN"
+                default:
+                    url = HELPCENTER
                 }
-         
+                
                 vc.url = url
                 
                 vc.myNavigationBar.title_Label.text = switchLanguage("帮助中心")
@@ -391,11 +354,8 @@ extension JDMineViewController: UITableViewDelegate {
                     return
                 }
                 
-//                let vc = JDMineServiceViewController()
-//                currentVc()?.navigationController?.pushViewController(vc, animated: true)
-                
                 let vc = BaseWebViewController()
-
+                
                 vc.needHiddenWebNav = false
                 vc.url = getCustomerUrl()
                 vc.myNavigationBar.title_Label.text = switchLanguage("在线客服")
@@ -450,21 +410,20 @@ extension JDMineViewController: UITableViewDelegate {
     
     @objc func activityBtnAction() {
         let vc = BaseWebViewController()
-
-        // vc.url = "https://news.jdnx.com/activity.html?tab=2"
+        
         var url = ACTIVITYCENTER+"?tab=2"
-       
+        
         switch GlobalSingle.sharedInstance.currentLan {
-            case .EnglishLanguage:
-                url = ACTIVITYCENTER+"?tab=2&language=en"
-            case .TraditionalLanguage:
-                url = ACTIVITYCENTER+"?tab=2&language=zh-TW"
-            case .ChineseLanguage:
-                url = ACTIVITYCENTER+"?tab=2&language=zh-CN"
-            default:
-                url = ACTIVITYCENTER+"?tab=2"
+        case .EnglishLanguage:
+            url = ACTIVITYCENTER+"?tab=2&language=en"
+        case .TraditionalLanguage:
+            url = ACTIVITYCENTER+"?tab=2&language=zh-TW"
+        case .ChineseLanguage:
+            url = ACTIVITYCENTER+"?tab=2&language=zh-CN"
+        default:
+            url = ACTIVITYCENTER+"?tab=2"
         }
-
+        
         vc.url = url
         vc.myNavigationBar.title_Label.text = switchLanguage("往期活动")
         
@@ -485,7 +444,7 @@ extension JDMineViewController: UITableViewDelegate {
         ]
         
         NetWork.NetWorkInstance.requestData(requestType: .Post, URLString: jd_netForUpdateUserLanguage, parameters: param) { _, _ in
-
+            
         } failured: { _, _ in
         }
     }