From a313df9cdd5e7928b0ec432a07359aee5aa6334a Mon Sep 17 00:00:00 2001
From: Cao yang <caoyang@CaodeMacBook-Pro.local>
Date: Fri, 11 May 2018 17:45:14 +0800
Subject: [PATCH] bug修改  视频云 接入

---
 ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate       | Bin 382631 -> 0 bytes
 ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist | 28 ----------------------------
 ParentAssistant/ParentAssistant/AppDelegate.swift                                                               | 17 +----------------
 ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramViewController.swift                    | 18 +++++++++++++-----
 ParentAssistant/ParentAssistant/Classes/controllers/Grow/Report/ReportViewController.swift                      | 42 ++++++++++++++++++++++++------------------
 ParentAssistant/ParentAssistant/Classes/controllers/Information/Controller/InformationViewController.swift      | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------
 ParentAssistant/ParentAssistant/Classes/controllers/main/JSViewController.swift                                 | 22 +++++++++++++++-------
 ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/Login/LoginViewController.swift               | 23 ++++++++++++++++++++++-
 ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyChildrenViewController.swift                |  7 ++++---
 ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyViewController.swift                        | 13 +++++++++----
 ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/BindingViewController.swift                   |  1 +
 ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/BindlingSuccessViewController.swift           | 14 ++++++++++++--
 ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/UserCenter.storyboard                         |  8 ++++----
 ParentAssistant/ParentAssistant/Classes/util/HTTPServer.swift                                                   |  6 ++++--
 ParentAssistant/ParentAssistant/Classes/util/Macro.swift                                                        | 23 ++++++++++++++++++-----
 ParentAssistant/ParentAssistant/Classes/util/utils.swift                                                        |  4 ++--
 ParentAssistant/ParentAssistant/Supporting Files/Base.lproj/Main.storyboard                                     |  8 ++++----
 ParentAssistant/ParentAssistant/Supporting Files/Info.plist                                                     |  8 +++++---
 18 files changed, 197 insertions(+), 132 deletions(-)

diff --git a/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate b/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate
index a2cf021..be09418 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.xcworkspace/xcuserdata/caoyang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
index 74754fe..ed9a9b4 100644
--- a/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+++ b/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
@@ -2,32 +2,4 @@
 <Bucket
    type = "0"
    version = "2.0">
-   <Breakpoints>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            scope = "0"
-            stopOnStyle = "0">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "ParentAssistant/Classes/util/NIM/YXMessageManager.swift"
-            timestampString = "546257540.733687"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "124"
-            endingLineNumber = "124"
-            landmarkName = "onReceive(_:)"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-   </Breakpoints>
 </Bucket>
diff --git a/ParentAssistant/ParentAssistant/AppDelegate.swift b/ParentAssistant/ParentAssistant/AppDelegate.swift
index 1213858..698ea86 100644
--- a/ParentAssistant/ParentAssistant/AppDelegate.swift
+++ b/ParentAssistant/ParentAssistant/AppDelegate.swift
@@ -55,22 +55,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
     }
     //设置云信的appkey
     func setUpYXIM(){
-        var appkey = ""
-        var cername = ""
-        #if DEBUG
-            appkey = "330158c080acdf4dc1092d6a74576c2c"
-            cername = "parentdevelop"
-        #else
-            appkey = "a1ff0bc08fa0d6f95b480d131e55584b"
-            cername = "hxyproductpush"
-        #endif
-//        if Debug.isFormal{
-//            appkey = "a1ff0bc08fa0d6f95b480d131e55584b"
-//            cername = "hxyproductpush"
-//        }else{
-//            appkey = "330158c080acdf4dc1092d6a74576c2c"
-//            cername = "parentdevelop"
-//        }
+
         let option = NIMSDKOption(appKey: appkey)
         option.apnsCername = cername
         NIMSDK.shared().register(with: option)
diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramViewController.swift
index 1a5bde4..53ddbad 100644
--- a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramViewController.swift
+++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramViewController.swift
@@ -55,14 +55,21 @@ class ProgramViewController: UIViewController,UITableViewDelegate,UITableViewDat
     
     override func viewWillAppear(_ animated: Bool) {
         
-        let array = AccountManager.shared.getChildClassInfo()
-        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
+//        }
     }
     
     
@@ -126,9 +133,10 @@ class ProgramViewController: UIViewController,UITableViewDelegate,UITableViewDat
             vc.title = "补卡"
             self.navigationController?.pushViewController(vc, animated: true)
         case 2:
-            let vc = ProgramVacateViewController()
-            vc.title = "请假"
-            self.navigationController?.pushViewController(vc, animated: true)
+            appDelegate.window?.makeToast("敬请期待!")
+//            let vc = ProgramVacateViewController()
+//            vc.title = "请假"
+//            self.navigationController?.pushViewController(vc, animated: true)
         default:
             break
         }
diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Report/ReportViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Report/ReportViewController.swift
index d5e30e6..cb07f74 100644
--- a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Report/ReportViewController.swift
+++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Report/ReportViewController.swift
@@ -34,25 +34,14 @@ class ReportViewController: UIViewController,UITableViewDelegate,UITableViewData
     override func viewDidLoad() {
         super.viewDidLoad()
         
-        setupDateView()
-        
-        self.view.addSubview(self.reportTable)
-        reportTable.snp.makeConstraints { (maker) in
-            maker.width.equalToSuperview()
-            maker.bottom.equalToSuperview()
-            maker.top.equalTo(60)
-            maker.centerX.equalToSuperview()
+//        setupDateView()
+        ///功能暂未开放
+        let label = UILabel.init()
+        self.view.addSubview(label)
+        label.text = "敬请期待"
+        label.snp.makeConstraints { (maker) in
+            maker.center.equalToSuperview()
         }
-        
-        calendar = CalendarView.init(frame: CGRect.init(x: 0, y: 0, width: screenWidth, height: 245))
-        self.view.addSubview(calendar)
-        calendar.snp.makeConstraints { (maker) in
-            maker.width.equalToSuperview()
-            maker.height.equalTo(245)
-            maker.centerX.equalToSuperview()
-            maker.top.equalTo(headView)
-        }
-        calendar.isHidden = true
     }
     override func viewDidLayoutSubviews() {
         DebugLog("横屏")
@@ -75,6 +64,23 @@ class ReportViewController: UIViewController,UITableViewDelegate,UITableViewData
         recognizer.direction = UISwipeGestureRecognizerDirection.down
         headView.addGestureRecognizer(recognizer)
     
+        self.view.addSubview(self.reportTable)
+        reportTable.snp.makeConstraints { (maker) in
+            maker.width.equalToSuperview()
+            maker.bottom.equalToSuperview()
+            maker.top.equalTo(60)
+            maker.centerX.equalToSuperview()
+        }
+        
+        calendar = CalendarView.init(frame: CGRect.init(x: 0, y: 0, width: screenWidth, height: 245))
+        self.view.addSubview(calendar)
+        calendar.snp.makeConstraints { (maker) in
+            maker.width.equalToSuperview()
+            maker.height.equalTo(245)
+            maker.centerX.equalToSuperview()
+            maker.top.equalTo(headView)
+        }
+        calendar.isHidden = true
     }
     
     @objc func showView(){
diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Information/Controller/InformationViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Information/Controller/InformationViewController.swift
index 048e48a..8c34cd4 100644
--- a/ParentAssistant/ParentAssistant/Classes/controllers/Information/Controller/InformationViewController.swift
+++ b/ParentAssistant/ParentAssistant/Classes/controllers/Information/Controller/InformationViewController.swift
@@ -41,8 +41,8 @@ class InformationViewController: UIViewController,UISearchBarDelegate {
     
     override func viewDidLoad() {
         super.viewDidLoad()
-        
-        let item = UIBarButtonItem.init(title: "返回", style: .plain, target: self, action: nil)
+        localAddress = "越城区"
+        let item = UIBarButtonItem.init(title: "", style: .plain, target: self, action: nil)
         self.navigationItem.backBarButtonItem = item
         
         drawTopUI()
@@ -54,13 +54,18 @@ class InformationViewController: UIViewController,UISearchBarDelegate {
         if isFirstviewController{
             let leftBtn = UIBarButtonItem.init(customView: self.leftCityView)
             self.navigationItem.leftBarButtonItem = leftBtn
-            if localAddress == "未知" {
-                LocationManger.shared.block = { str in
-                    localAddress = str
-                    self.leftLabel.text = localAddress
-                    self.getDataFromNet()
-                }
-            }
+            
+            
+            self.leftLabel.text = "越城区"
+            
+            self.getDataFromNet()
+//            if localAddress == "未知" {
+//                LocationManger.shared.block = { str in
+//                    localAddress = str
+//                    self.leftLabel.text = localAddress
+//                    self.getDataFromNet()
+//                }
+//            }
         }
     }
     func drawTopUI(){
@@ -94,7 +99,7 @@ class InformationViewController: UIViewController,UISearchBarDelegate {
             position = 3
         }
         group.enter()
-        HTTPServer.shared.getAds(["position":position as AnyObject,"areaName":localAddress as AnyObject], completionHandler: { (str, error) in//getPercentEncodingString(str: localAddress)
+        HTTPServer.shared.getAds(["position":position as AnyObject,"areaName":"越城区" as AnyObject], completionHandler: { (str, error) in//getPercentEncodingString(str: localAddress)
             httpJsonResule(jsonString: str, error: error, successHandler: { (json) in
                 if json["status"] == 1 && error == nil{
                     self.topADs.removeAll()
@@ -199,27 +204,49 @@ class InformationViewController: UIViewController,UISearchBarDelegate {
     //MARK:轮播图跳转
     func chickImage(index:Int){
         
-        let vcs = Story.instantiateViewControllerWithIdentifier("JSViewController", storyName: "JS") as! JSViewController
-        
-        if self.topADs.count > 0 {
-            let model = self.topADs[index]
-            let url = model.url
-            //已登录
-            if AccountManager.shared.isOnline() && url.contains(HOST_VIDEO){
-                let phone = UserDefaults.standard.value(forKey: "user_phone") as! String
-                let password = UserDefaults.standard.value(forKey: "user_password") as! String
-                let params = ["username":phone,"password":password]
-                HTTPServer.shared.otherToken(parameters: params as [String : AnyObject]) { (backData, error) in
-                    if let token = backData {
-                        vcs.webURL = url + "&Token=" + token
-                        self.navigationController?.present(vcs.wrapWithNavigationController(), animated: true, completion: nil)
+        if AccountManager.shared.isOnline(){
+            
+            if self.topADs.count > 0 {
+                let model = self.topADs[index]
+                if model.url.contains(HOST_VIDEO) {
+                    let phone = UserDefaults.standard.value(forKey: "user_phone") as! String
+                    let password = UserDefaults.standard.value(forKey: "user_password") as! String
+                    let params = ["username":phone,"password":password,"type":"1"]
+                    HTTPServer.shared.otherToken(parameters: params as [String : AnyObject]) { (backData, error) in
+                        if let token = backData {
+                            let vcs = Story.instantiateViewControllerWithIdentifier("JSViewController", storyName: "JS") as! JSViewController
+                            vcs.webURL = model.url + "&Token=" + token
+                            self.navigationController?.present(vcs.wrapWithNavigationController(), animated: true, completion: nil)
+                            debugPrint(backData!)
+                        }
                     }
+                }else{
+                    let vcs = Story.instantiateViewControllerWithIdentifier("JSViewController", storyName: "JS") as! JSViewController
+                    vcs.webURL = model.url
+                    self.navigationController?.present(vcs.wrapWithNavigationController(), animated: true, completion: nil)
                 }
-            }else{
-                vcs.webURL = url
-                self.navigationController?.present(vcs.wrapWithNavigationController(), animated: true, completion: nil)
             }
+        }else{
+            appDelegate.window?.makeToast("需要登录才能跳转!")
         }
+        
+        
+//        if self.topADs.count > 0 {
+//            let model = self.topADs[index]
+//            let url = model.url
+//            //已登录
+//            if AccountManager.shared.isOnline() && url.contains(HOST_VIDEO){
+//                let phone = UserDefaults.standard.value(forKey: "user_phone") as! String
+//                let password = UserDefaults.standard.value(forKey: "user_password") as! String
+//                let params = ["username":phone,"password":password]
+//                HTTPServer.shared.otherToken(parameters: params as [String : AnyObject]) { (backData, error) in
+//                    if let token = backData {
+//                        vcs.webURL = url + "&Token=" + token
+//                        self.navigationController?.present(vcs.wrapWithNavigationController(), animated: true, completion: nil)
+//                    }
+//                }
+       
+    
     }
 }
 // MARK: - XRCarouselViewDelegate
@@ -333,7 +360,11 @@ extension InformationViewController:UICollectionViewDataSource,UICollectionViewD
         var reusableview:UICollectionReusableView?
         if kind == UICollectionElementKindSectionHeader{
             let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: UICollectionElementKindSectionHeader, withReuseIdentifier: "headerView", for: indexPath) as! InformationSectionHeader
-            headerView.title.text = "咨讯话题"
+            if isFirstviewController {
+                headerView.title.text = "资讯话题"
+            }else{
+                headerView.title.text = "热门资讯"
+            }
             reusableview = headerView
         }
         if indexPath.section == 2{
diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/main/JSViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/main/JSViewController.swift
index 2c19163..c92de15 100644
--- a/ParentAssistant/ParentAssistant/Classes/controllers/main/JSViewController.swift
+++ b/ParentAssistant/ParentAssistant/Classes/controllers/main/JSViewController.swift
@@ -19,12 +19,15 @@ class JSViewController: UIViewController,WKUIDelegate,WKScriptMessageHandler,UIA
     var loadingView:UIView!
     var loadingImageWidth:CGFloat = 60
     var borderline:Bool = false//web页面有无边框
+    
+    private var hasChildren:Bool!
     override func viewDidLoad() {
         super.viewDidLoad()
-        if let url = URL(string: webURL){
-            
+        let childrenArr = AccountManager.shared.getChildClassInfo()
+        if childrenArr.count > 0 {
+            hasChildren = true
         }else{
-            return
+            hasChildren = false
         }
         // js配置
         // WKWebView的配置
@@ -46,7 +49,10 @@ class JSViewController: UIViewController,WKUIDelegate,WKScriptMessageHandler,UIA
         }
         wkWebView.uiDelegate=self
         wkWebView.navigationDelegate=self
-        self.wkWebView.load(Foundation.URLRequest(url: URL(string: webURL)!))
+        
+        if webURL.count > 0 {
+            self.wkWebView.load(URLRequest.init(url: URL.init(string: webURL)!))
+        }
         wkWebView.addObserver(self, forKeyPath: "estimatedProgress", options: NSKeyValueObservingOptions.new, context: nil)
         wkWebView.addObserver(self, forKeyPath: "title", options: NSKeyValueObservingOptions.new, context: nil)
         if ary.count==0 {
@@ -122,8 +128,10 @@ class JSViewController: UIViewController,WKUIDelegate,WKScriptMessageHandler,UIA
         }
     }
     override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
+        
         if keyPath=="estimatedProgress" {
-            if object as! WKWebView == self.wkWebView {
+            
+            if object as? WKWebView == self.wkWebView {
                 self.progressView.alpha=1.0
                 self.progressView.setProgress(Float(wkWebView.estimatedProgress), animated: true)
                 DebugLog( "+++++++++++++++++\(Float(wkWebView.estimatedProgress))")
@@ -136,9 +144,9 @@ class JSViewController: UIViewController,WKUIDelegate,WKScriptMessageHandler,UIA
                 }
             }else{
                 super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context)
-            }
+            } 
         }else if keyPath=="title" {
-            if object as! WKWebView == self.wkWebView {
+            if object as? WKWebView == self.wkWebView {
                 self.navigationItem.title=self.wkWebView.title
             }else{
                 super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context)
diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/Login/LoginViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/Login/LoginViewController.swift
index d6f16a3..7ca044e 100644
--- a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/Login/LoginViewController.swift
+++ b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/Login/LoginViewController.swift
@@ -110,6 +110,28 @@ class LoginViewController: UITableViewController,UITextFieldDelegate {
     // MARK: - 登录按钮
     @IBAction func loginAction(_ sender: UIButton) {
         self.view.endEditing(true)
+        
+        checkParent()
+    }
+    // MARK: - 判断是否为家长
+    func checkParent(){
+        SVProgressHUD.show()
+        HTTPServer.shared.checkParentType(phoneTextField.text!) { (backData, error) in
+            SVProgressHUD.dismiss()
+            if let isPatent = JSON.fromString(backData)!["data"].bool {
+                if isPatent {
+                    self.gotoLoginAction()
+                }else{
+                    appDelegate.window?.makeToast("账号未注册")
+//                    if let message = JSON.fromString(backData)!["message"].string{
+//                        appDelegate.window?.makeToast(message, duration: 1, position: nil)
+//                    }
+                }
+            }
+        }
+    }
+    func gotoLoginAction(){
+
         SVProgressHUD.show(withStatus: "登录中...")
         HTTPServer.shared.login(completionHandler: { (str, error) in
             SVProgressHUD.dismiss()
@@ -173,7 +195,6 @@ class LoginViewController: UITableViewController,UITextFieldDelegate {
             }
         }
     }
-    
     // MARK: - 注册页面跳转
     @IBAction func registerAction(_ sender: UIButton) {
         let vc = Story.instantiateViewControllerWithIdentifier("RegisterViewController", storyName: "My") as! RegisterViewController
diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyChildrenViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyChildrenViewController.swift
index 12c07f2..0eacf7b 100644
--- a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyChildrenViewController.swift
+++ b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyChildrenViewController.swift
@@ -31,10 +31,11 @@ class MyChildrenViewController: UIViewController{
         emptyView.imageView.image=UIImage(named:"emptyset_1")
         emptyView.labelView.text="暂未关联孩子信息"
         emptyView.buttonView.isHidden=true
-        for j in AccountManager.shared.rawUserInfo!.contentData()["studentClass"].arrayValue {
-            myChildrens.append(StudentClassInfo(json: j))
+        if let j = AccountManager.shared.rawUserInfo?.contentData()["studentClass"].array{
+            for m in j {
+                myChildrens.append(StudentClassInfo(json: m))
+            }
         }
-        
     }
     // MARK: - 添加绑定账号
     @IBAction func addChildrenAction(_ sender: UIButton) {
diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyViewController.swift
index 3522d3a..9275695 100644
--- a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyViewController.swift
+++ b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyViewController.swift
@@ -212,10 +212,15 @@ extension MyViewController: UITableViewDelegate,UITableViewDataSource{
             }
         case 2://家校通订购
             if AccountManager.shared.isOnline() {
-                let vcs = Story.instantiateViewControllerWithIdentifier("JSViewController", storyName: "JS") as! JSViewController
-                vcs.borderline = true
-                vcs.webURL = "\(HOSTWAP!)/ParentOrderCenter.aspx?userid=\(AccountManager.shared.id())"
-                self.navigationController?.present(vcs.wrapWithNavigationController(), animated: true, completion: nil)
+                let children = AccountManager.shared.getChildClassInfo()
+                if children.count > 0 {
+                    let vcs = Story.instantiateViewControllerWithIdentifier("JSViewController", storyName: "JS") as! JSViewController
+                    vcs.borderline = true
+                    vcs.webURL = "\(HOSTWAP!)/ParentOrderCenter.aspx?userid=\(AccountManager.shared.id())"
+                    self.navigationController?.present(vcs.wrapWithNavigationController(), animated: true, completion: nil)
+                }else{
+                    appDelegate.window?.makeToast("绑定孩子后,才能订购!")
+                }
             }else{
                 appDelegate.window!.makeToast("请先登录", duration: 1, position: CSToastPositionCenter)
             }
diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/BindingViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/BindingViewController.swift
index a0217e3..2be10a9 100644
--- a/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/BindingViewController.swift
+++ b/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/BindingViewController.swift
@@ -166,6 +166,7 @@ class BindingViewController: UIViewController {
             if JSON.fromString(str)!["status"] == 1 && error == nil{
                 appDelegate.window!.makeToast("绑定成功")
                 let vc = BindlingSuccessViewController()
+                vc.bindlingSuccData = str!
                 self.navigationController?.pushViewController(vc, animated: true)
             }else{
                 appDelegate.window!.makeToast("绑定失败")
diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/BindlingSuccessViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/BindlingSuccessViewController.swift
index 0a9b22d..ec6a556 100644
--- a/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/BindlingSuccessViewController.swift
+++ b/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/BindlingSuccessViewController.swift
@@ -14,9 +14,15 @@ class BindlingSuccessViewController: UIViewController ,UIWebViewDelegate,UIScrol
     var webBrowserView:UIView!
     var urlStr:String="http://60.190.202.57:8101/RecommendOrder.aspx?userid="
     var bindlingType:Int = 1
+    
+    var bindlingSuccData = String()
+    
     override func viewDidLoad() {
         super.viewDidLoad()
         self.view.backgroundColor = UIColor.white
+        
+     
+        
         // Do any additional setup after loading the view.
         webView = UIWebView()
         webView.frame = CGRect(x: 10, y: 0, width: getScreenWidth()-20, height: getScreenHeight())
@@ -51,7 +57,11 @@ class BindlingSuccessViewController: UIViewController ,UIWebViewDelegate,UIScrol
             header.frame = CGRect(x: 10, y: 0, width: getScreenWidth()-20, height: 150)
             header.backgroundColor = UIColor.clear
             let label = UILabel(frame: CGRect(x: 10, y: 10, width: header.frame.width - 20, height: 100))
-            label.text = "生成孩子\"汇作业\"账号为:\(urlStr),\n初始密码为:\(urlStr)(与账号相同),\n孩子可以下载\"汇作业\"app进行使用,\n"
+            if bindlingSuccData.count>0{
+                if let data = JSON.fromString(bindlingSuccData)?["data"].dictionary{
+                    label.text = "生成孩子\"汇作业\"账号为:\(data["account"]?.stringValue ?? ""),\n初始密码为:\(data["passwprd"]?.stringValue ?? ""),\n孩子可以下载\"汇作业\"app进行使用,\n"
+                }
+            }
             label.numberOfLines = 0
             label.textColor = UIColor.darkGray
             label.font = UIFont.systemFont(ofSize: 15)
@@ -79,7 +89,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]
diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/UserCenter.storyboard b/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/UserCenter.storyboard
index fa3babf..fc2f5bc 100644
--- a/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/UserCenter.storyboard
+++ b/ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/UserCenter.storyboard
@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina4_7" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
         <capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@@ -338,7 +338,7 @@
                     </connections>
                 </tapGestureRecognizer>
             </objects>
-            <point key="canvasLocation" x="77.599999999999994" y="118.29085457271366"/>
+            <point key="canvasLocation" x="-146" y="107"/>
         </scene>
         <!--选择孩子学校-->
         <scene sceneID="jXC-xr-pan">
@@ -600,7 +600,7 @@
         </scene>
     </scenes>
     <resources>
-        <image name="evaluation_icon_pushDown" width="16" height="9"/>
+        <image name="evaluation_icon_pushDown" width="178" height="100"/>
         <image name="my_icon_confirmBtn" width="21" height="19"/>
     </resources>
 </document>
diff --git a/ParentAssistant/ParentAssistant/Classes/util/HTTPServer.swift b/ParentAssistant/ParentAssistant/Classes/util/HTTPServer.swift
index 9ee4f50..4763b4c 100644
--- a/ParentAssistant/ParentAssistant/Classes/util/HTTPServer.swift
+++ b/ParentAssistant/ParentAssistant/Classes/util/HTTPServer.swift
@@ -151,8 +151,10 @@ final class HTTPServer{
     func updatePassword(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){
         KHttp.POST(url: URL_USER_UPDATEPASSWORD, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler)
     }
-    
-    
+    //登录时判断是否是家长
+    func checkParentType(_ mobile:String,completionHandler:@escaping (String?, NSError?) -> Void){
+        KHttp.GET(url: URL_GET_PARENT_JUDGE,parameters:["mobile":mobile as AnyObject], completionHandler: completionHandler)
+    }
     
     //家长注册
     func parentRegister(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){
diff --git a/ParentAssistant/ParentAssistant/Classes/util/Macro.swift b/ParentAssistant/ParentAssistant/Classes/util/Macro.swift
index 941b1a8..58be9eb 100644
--- a/ParentAssistant/ParentAssistant/Classes/util/Macro.swift
+++ b/ParentAssistant/ParentAssistant/Classes/util/Macro.swift
@@ -39,16 +39,28 @@ let appsecret="sincere:3a530f39f99411b454e667d69693c127"
 
 #if DEBUG
 //测试网址
-var HOST:String! = "http://60.190.202.57:1000"
-var HOSTWAP:String! = "http://60.190.202.57:8101"
-var HOSTImage:String! = "http://60.190.202.57:8196"
-let HOST_VIDEO:String! = "http://60.190.202.57:8812/"
+//var HOST:String! = "http://60.190.202.57:1000"
+//var HOSTWAP:String! = "http://60.190.202.57:8101"
+//var HOSTImage:String! = "http://60.190.202.57:8196"
+//let HOST_VIDEO:String! = "http://60.190.202.57:8812/"
+var HOST:String! = "http://campus.myjxt.com"
+var HOSTWAP:String! = "http://parent.myjxt.com"
+var HOSTImage:String! = "http://manage.myjxt.com"
+let HOST_VIDEO:String! = "http://www.sxspy.net/"
+
+//var appkey = "330158c080acdf4dc1092d6a74576c2c"
+//var cername = "parentdevelop"
+var appkey = "a1ff0bc08fa0d6f95b480d131e55584b"
+var cername = "hxyproductpush"
 #else
 //正式网址
 var HOST:String! = "http://campus.myjxt.com"
 var HOSTWAP:String! = "http://parent.myjxt.com"
 var HOSTImage:String! = "http://manage.myjxt.com"
 let HOST_VIDEO:String! = "http://www.sxspy.net/"
+//云信账号
+var appkey = "a1ff0bc08fa0d6f95b480d131e55584b"
+var cername = "hxyproductpush"
 #endif
 
 
@@ -66,8 +78,9 @@ let URL_RESTPW="/api/Account/ReSetpass"
 let URL_SCANLOGINCODE = "/api/Account/ScanLogin"
 let URL_IDENTITYLIST = "/api/Account/IdentityList"
 let URL_IDENTITYCONFRIM = "/api/Account/IdentityConfrim"
-
+//MARK: ------ 登录 --------
 let URL_PARENTREGISTER = "/api/ParentHelper/ParentRegister"//家长注册
+let URL_GET_PARENT_JUDGE = "/api/ParentHelper/ParentJudge" //验证是否是家长账户
 let URL_CAPTCHA="/api/Account/ChangePhoneCaptcha"//获取注册验证码
 let URL_GETPARENTINFO = "/api/ParentHelper/GetParentInfo"//登录获取家长信息(包括关联的孩子信息区分绑定状态)
 let URL_UPDATEPARENTINFO = "/api/ParentHelper/UpdateParentInfo"//更新姓名和性别
diff --git a/ParentAssistant/ParentAssistant/Classes/util/utils.swift b/ParentAssistant/ParentAssistant/Classes/util/utils.swift
index e6eaab9..ed79f24 100644
--- a/ParentAssistant/ParentAssistant/Classes/util/utils.swift
+++ b/ParentAssistant/ParentAssistant/Classes/util/utils.swift
@@ -207,8 +207,8 @@ extension String{
         for i in 0 ..< digestLen {
             hash.appendFormat("%02x", result[i])
         }
-//        result.deinitialize()
-        result.deinitialize(count: digestLen)
+        result.deinitialize()
+//        result.deinitialize(count: digestLen)
         return hash.uppercased
     }
 }
diff --git a/ParentAssistant/ParentAssistant/Supporting Files/Base.lproj/Main.storyboard b/ParentAssistant/ParentAssistant/Supporting Files/Base.lproj/Main.storyboard
index db8c8ba..8809b13 100644
--- a/ParentAssistant/ParentAssistant/Supporting Files/Base.lproj/Main.storyboard
+++ b/ParentAssistant/ParentAssistant/Supporting Files/Base.lproj/Main.storyboard
@@ -1063,11 +1063,11 @@
             </objects>
             <point key="canvasLocation" x="913" y="-971"/>
         </scene>
-        <!--咨询频道-->
+        <!--资讯-->
         <scene sceneID="zMY-cK-guM">
             <objects>
                 <navigationController automaticallyAdjustsScrollViewInsets="NO" id="40K-Kv-ipy" customClass="MainViewController" customModule="ParentAssistant" customModuleProvider="target" sceneMemberID="viewController">
-                    <tabBarItem key="tabBarItem" title="咨询频道" image="Information_bar_icon" selectedImage="Information_bar_icon_select" id="0Ea-ls-Ren"/>
+                    <tabBarItem key="tabBarItem" title="资讯" image="Information_bar_icon" selectedImage="Information_bar_icon_select" id="0Ea-ls-Ren"/>
                     <toolbarItems/>
                     <navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="bTJ-Ap-TDP">
                         <rect key="frame" x="0.0" y="20" width="375" height="44"/>
@@ -1104,11 +1104,11 @@
             </objects>
             <point key="canvasLocation" x="913" y="410"/>
         </scene>
-        <!--个人中心-->
+        <!--我的-->
         <scene sceneID="k70-QL-d6T">
             <objects>
                 <navigationController automaticallyAdjustsScrollViewInsets="NO" id="eER-h6-27H" customClass="MainViewController" customModule="ParentAssistant" customModuleProvider="target" sceneMemberID="viewController">
-                    <tabBarItem key="tabBarItem" title="个人中心" image="my_bar_icon" selectedImage="my_bar_icon_select" id="Rn5-qq-H6e">
+                    <tabBarItem key="tabBarItem" title="我的" image="my_bar_icon" selectedImage="my_bar_icon_select" id="Rn5-qq-H6e">
                         <color key="badgeColor" red="0.42745098039215684" green="0.54509803921568623" blue="0.99215686274509807" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                     </tabBarItem>
                     <toolbarItems/>
diff --git a/ParentAssistant/ParentAssistant/Supporting Files/Info.plist b/ParentAssistant/ParentAssistant/Supporting Files/Info.plist
index 3946944..8d0174d 100644
--- a/ParentAssistant/ParentAssistant/Supporting Files/Info.plist
+++ b/ParentAssistant/ParentAssistant/Supporting Files/Info.plist
@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
 	<key>CFBundleDevelopmentRegion</key>
-	<string>$(DEVELOPMENT_LANGUAGE)</string>
+	<string>zh_CN</string>
 	<key>CFBundleDisplayName</key>
 	<string>家长慧</string>
 	<key>CFBundleExecutable</key>
@@ -17,9 +17,9 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>1.0.1</string>
+	<string>1.0.2</string>
 	<key>CFBundleVersion</key>
-	<string>13</string>
+	<string>15</string>
 	<key>ITSAppUsesNonExemptEncryption</key>
 	<false/>
 	<key>LSRequiresIPhoneOS</key>
@@ -29,6 +29,8 @@
 		<key>NSAllowsArbitraryLoads</key>
 		<true/>
 	</dict>
+	<key>NSLocationUsageDescription</key>
+	<string>家长慧将根据您的地理位置信息,获取与位置相匹配的学校和新闻信息</string>
 	<key>NSLocationWhenInUseUsageDescription</key>
 	<string>家长慧将根据您的地理位置信息,获取与位置相匹配的学校和新闻信息</string>
 	<key>NSMicrophoneUsageDescription</key>
--
libgit2 0.21.0