diff --git a/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate b/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate index be09418..7f8ea23 100644 Binary files a/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate and b/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramViewController.swift index 53ddbad..716a416 100644 --- a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramViewController.swift +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramViewController.swift @@ -55,21 +55,21 @@ class ProgramViewController: UIViewController,UITableViewDelegate,UITableViewDat override func viewWillAppear(_ animated: Bool) { -// let array = AccountManager.shared.getChildClassInfo() - if AccountManager.shared.rawUserInfo!.contentData()["studentClass"].arrayValue.count == 0 { - self.view.addSubview(self.empty) - self.tableView.isHidden = true - }else{ - self.empty.removeFromSuperview() - self.tableView.isHidden = false - } -// if array.isEmpty { + let array = AccountManager.shared.getChildClassInfo() +// if AccountManager.shared.rawUserInfo!.contentData()["studentClass"].arrayValue.count == 0 { // self.view.addSubview(self.empty) // self.tableView.isHidden = true // }else{ // self.empty.removeFromSuperview() // self.tableView.isHidden = false // } + if array.isEmpty { + self.view.addSubview(self.empty) + self.tableView.isHidden = true + }else{ + self.empty.removeFromSuperview() + self.tableView.isHidden = false + } } diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/BaseCityChooseSchoolViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/BaseCityChooseSchoolViewController.swift index 1235508..4632351 100644 --- a/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/BaseCityChooseSchoolViewController.swift +++ b/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/BaseCityChooseSchoolViewController.swift @@ -99,23 +99,28 @@ class BaseCityChooseSchoolViewController: UIViewController,UISearchBarDelegate { return } + //非合作学校 if school!.isNew == 1{ let vc = Story.instantiateViewControllerWithIdentifier("BindingViewControllerVC", storyName: "UserCenter") as! BindingViewController vc.from = .select vc.school = school! self.navigationController?.pushViewController(vc, animated: true) - }else{ - if AccountManager.shared.isNew() == 1{ + //合作学校 + }else if school?.isNew == 0{ + //判断该校该家长是否有孩子 + let localNew = AccountManager.shared.isNew() + //添加邀请码显示孩子 + if localNew == 1 { + let vc = Story.instantiateViewControllerWithIdentifier("InvitationCodeVerificationViewControllerVC", storyName: "UserCenter") as! InvitationCodeVerificationViewController + vc.school = school! + self.navigationController?.pushViewController(vc, animated: true) + //家长有孩子信息 直接显示 + }else if localNew == 0 { let vc = Story.instantiateViewControllerWithIdentifier("BindingViewControllerVC", storyName: "UserCenter") as! BindingViewController vc.from = .unReserved vc.school = school! self.navigationController?.pushViewController(vc, animated: true) - return } - let vc = Story.instantiateViewControllerWithIdentifier("InvitationCodeVerificationViewControllerVC", storyName: "UserCenter") as! InvitationCodeVerificationViewController - vc.school = school! - self.navigationController?.pushViewController(vc, animated: true) - } } diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/BindlingSuccessViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/BindlingSuccessViewController.swift index ec6a556..a2c87b4 100644 --- a/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/BindlingSuccessViewController.swift +++ b/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/BindlingSuccessViewController.swift @@ -12,7 +12,6 @@ class BindlingSuccessViewController: UIViewController ,UIWebViewDelegate,UIScrol var webView:UIWebView! var header:UIView! var webBrowserView:UIView! - var urlStr:String="http://60.190.202.57:8101/RecommendOrder.aspx?userid=" var bindlingType:Int = 1 var bindlingSuccData = String() @@ -29,10 +28,10 @@ class BindlingSuccessViewController: UIViewController ,UIWebViewDelegate,UIScrol webView.delegate = self; webView.backgroundColor = UIColor.clear self.view.addSubview(webView) - - let request = URLRequest(url: URL(string: urlStr)!) + let url = HOSTWAP+"/RecommendOrder.aspx?userid="+AccountManager.shared.userid + let request = URLRequest(url: URL(string: url)!) webView.loadRequest(request) - + SVProgressHUD.show() if bindlingType == 0{ header = UIView() header.frame = CGRect(x: 10, y: 0, width: getScreenWidth()-20, height: 80) @@ -61,6 +60,8 @@ class BindlingSuccessViewController: UIViewController ,UIWebViewDelegate,UIScrol if let data = JSON.fromString(bindlingSuccData)?["data"].dictionary{ label.text = "生成孩子\"汇作业\"账号为:\(data["account"]?.stringValue ?? ""),\n初始密码为:\(data["passwprd"]?.stringValue ?? ""),\n孩子可以下载\"汇作业\"app进行使用,\n" } + }else{ + label.text = "孩子绑定成功" } label.numberOfLines = 0 label.textColor = UIColor.darkGray @@ -89,7 +90,7 @@ class BindlingSuccessViewController: UIViewController ,UIWebViewDelegate,UIScrol backView.frame.size = CGSize(width: btn.frame.width+label2.frame.width+10, height: 30) backView.center = CGPoint(x: header.center.x-10, y: label.frame.maxY+10) header.frame.size.height = backView.frame.maxY + 10 -// header.addSubview(backView) + header.addSubview(backView) } webBrowserView = webView.scrollView.subviews[0] @@ -103,6 +104,17 @@ class BindlingSuccessViewController: UIViewController ,UIWebViewDelegate,UIScrol webView.scrollView.addObserver(self, forKeyPath: "contentSize", options: NSKeyValueObservingOptions.new, context: nil) // Do any additional setup after loading the view. + + let rightBtn = UIBarButtonItem.init(title: "关闭", style: UIBarButtonItemStyle.done, target: self, action: #selector(backButtonAction)) + self.navigationItem.rightBarButtonItem = rightBtn + } + + @objc func backButtonAction(){ + self.navigationController?.popToRootViewController(animated: true) + } + + func webViewDidFinishLoad(_ webView: UIWebView) { + SVProgressHUD.dismiss() } @objc func pushToAppStore(){ diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/UserCenter.storyboard b/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/UserCenter.storyboard index fc2f5bc..ea3cb70 100644 --- a/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/UserCenter.storyboard +++ b/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/UserCenter.storyboard @@ -227,10 +227,10 @@ -