Commit a313df9cdd5e7928b0ec432a07359aee5aa6334a
1 parent
4947c6d9
Exists in
parentassistant
bug修改 视频云 接入
Showing
18 changed files
with
197 additions
and
132 deletions
Show diff stats
ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
| ... | ... | @@ -2,32 +2,4 @@ |
| 2 | 2 | <Bucket |
| 3 | 3 | type = "0" |
| 4 | 4 | version = "2.0"> |
| 5 | - <Breakpoints> | |
| 6 | - <BreakpointProxy | |
| 7 | - BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint"> | |
| 8 | - <BreakpointContent | |
| 9 | - shouldBeEnabled = "Yes" | |
| 10 | - ignoreCount = "0" | |
| 11 | - continueAfterRunningActions = "No" | |
| 12 | - scope = "0" | |
| 13 | - stopOnStyle = "0"> | |
| 14 | - </BreakpointContent> | |
| 15 | - </BreakpointProxy> | |
| 16 | - <BreakpointProxy | |
| 17 | - BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | |
| 18 | - <BreakpointContent | |
| 19 | - shouldBeEnabled = "Yes" | |
| 20 | - ignoreCount = "0" | |
| 21 | - continueAfterRunningActions = "No" | |
| 22 | - filePath = "ParentAssistant/Classes/util/NIM/YXMessageManager.swift" | |
| 23 | - timestampString = "546257540.733687" | |
| 24 | - startingColumnNumber = "9223372036854775807" | |
| 25 | - endingColumnNumber = "9223372036854775807" | |
| 26 | - startingLineNumber = "124" | |
| 27 | - endingLineNumber = "124" | |
| 28 | - landmarkName = "onReceive(_:)" | |
| 29 | - landmarkType = "7"> | |
| 30 | - </BreakpointContent> | |
| 31 | - </BreakpointProxy> | |
| 32 | - </Breakpoints> | |
| 33 | 5 | </Bucket> | ... | ... |
ParentAssistant/ParentAssistant/AppDelegate.swift
| ... | ... | @@ -55,22 +55,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { |
| 55 | 55 | } |
| 56 | 56 | //设置云信的appkey |
| 57 | 57 | func setUpYXIM(){ |
| 58 | - var appkey = "" | |
| 59 | - var cername = "" | |
| 60 | - #if DEBUG | |
| 61 | - appkey = "330158c080acdf4dc1092d6a74576c2c" | |
| 62 | - cername = "parentdevelop" | |
| 63 | - #else | |
| 64 | - appkey = "a1ff0bc08fa0d6f95b480d131e55584b" | |
| 65 | - cername = "hxyproductpush" | |
| 66 | - #endif | |
| 67 | -// if Debug.isFormal{ | |
| 68 | -// appkey = "a1ff0bc08fa0d6f95b480d131e55584b" | |
| 69 | -// cername = "hxyproductpush" | |
| 70 | -// }else{ | |
| 71 | -// appkey = "330158c080acdf4dc1092d6a74576c2c" | |
| 72 | -// cername = "parentdevelop" | |
| 73 | -// } | |
| 58 | + | |
| 74 | 59 | let option = NIMSDKOption(appKey: appkey) |
| 75 | 60 | option.apnsCername = cername |
| 76 | 61 | NIMSDK.shared().register(with: option) | ... | ... |
ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramViewController.swift
| ... | ... | @@ -55,14 +55,21 @@ class ProgramViewController: UIViewController,UITableViewDelegate,UITableViewDat |
| 55 | 55 | |
| 56 | 56 | override func viewWillAppear(_ animated: Bool) { |
| 57 | 57 | |
| 58 | - let array = AccountManager.shared.getChildClassInfo() | |
| 59 | - if array.isEmpty { | |
| 58 | +// let array = AccountManager.shared.getChildClassInfo() | |
| 59 | + if AccountManager.shared.rawUserInfo!.contentData()["studentClass"].arrayValue.count == 0 { | |
| 60 | 60 | self.view.addSubview(self.empty) |
| 61 | 61 | self.tableView.isHidden = true |
| 62 | 62 | }else{ |
| 63 | 63 | self.empty.removeFromSuperview() |
| 64 | 64 | self.tableView.isHidden = false |
| 65 | 65 | } |
| 66 | +// if array.isEmpty { | |
| 67 | +// self.view.addSubview(self.empty) | |
| 68 | +// self.tableView.isHidden = true | |
| 69 | +// }else{ | |
| 70 | +// self.empty.removeFromSuperview() | |
| 71 | +// self.tableView.isHidden = false | |
| 72 | +// } | |
| 66 | 73 | } |
| 67 | 74 | |
| 68 | 75 | |
| ... | ... | @@ -126,9 +133,10 @@ class ProgramViewController: UIViewController,UITableViewDelegate,UITableViewDat |
| 126 | 133 | vc.title = "补卡" |
| 127 | 134 | self.navigationController?.pushViewController(vc, animated: true) |
| 128 | 135 | case 2: |
| 129 | - let vc = ProgramVacateViewController() | |
| 130 | - vc.title = "请假" | |
| 131 | - self.navigationController?.pushViewController(vc, animated: true) | |
| 136 | + appDelegate.window?.makeToast("敬请期待!") | |
| 137 | +// let vc = ProgramVacateViewController() | |
| 138 | +// vc.title = "请假" | |
| 139 | +// self.navigationController?.pushViewController(vc, animated: true) | |
| 132 | 140 | default: |
| 133 | 141 | break |
| 134 | 142 | } | ... | ... |
ParentAssistant/ParentAssistant/Classes/controllers/Grow/Report/ReportViewController.swift
| ... | ... | @@ -34,25 +34,14 @@ class ReportViewController: UIViewController,UITableViewDelegate,UITableViewData |
| 34 | 34 | override func viewDidLoad() { |
| 35 | 35 | super.viewDidLoad() |
| 36 | 36 | |
| 37 | - setupDateView() | |
| 38 | - | |
| 39 | - self.view.addSubview(self.reportTable) | |
| 40 | - reportTable.snp.makeConstraints { (maker) in | |
| 41 | - maker.width.equalToSuperview() | |
| 42 | - maker.bottom.equalToSuperview() | |
| 43 | - maker.top.equalTo(60) | |
| 44 | - maker.centerX.equalToSuperview() | |
| 37 | +// setupDateView() | |
| 38 | + ///功能暂未开放 | |
| 39 | + let label = UILabel.init() | |
| 40 | + self.view.addSubview(label) | |
| 41 | + label.text = "敬请期待" | |
| 42 | + label.snp.makeConstraints { (maker) in | |
| 43 | + maker.center.equalToSuperview() | |
| 45 | 44 | } |
| 46 | - | |
| 47 | - calendar = CalendarView.init(frame: CGRect.init(x: 0, y: 0, width: screenWidth, height: 245)) | |
| 48 | - self.view.addSubview(calendar) | |
| 49 | - calendar.snp.makeConstraints { (maker) in | |
| 50 | - maker.width.equalToSuperview() | |
| 51 | - maker.height.equalTo(245) | |
| 52 | - maker.centerX.equalToSuperview() | |
| 53 | - maker.top.equalTo(headView) | |
| 54 | - } | |
| 55 | - calendar.isHidden = true | |
| 56 | 45 | } |
| 57 | 46 | override func viewDidLayoutSubviews() { |
| 58 | 47 | DebugLog("横屏") |
| ... | ... | @@ -75,6 +64,23 @@ class ReportViewController: UIViewController,UITableViewDelegate,UITableViewData |
| 75 | 64 | recognizer.direction = UISwipeGestureRecognizerDirection.down |
| 76 | 65 | headView.addGestureRecognizer(recognizer) |
| 77 | 66 | |
| 67 | + self.view.addSubview(self.reportTable) | |
| 68 | + reportTable.snp.makeConstraints { (maker) in | |
| 69 | + maker.width.equalToSuperview() | |
| 70 | + maker.bottom.equalToSuperview() | |
| 71 | + maker.top.equalTo(60) | |
| 72 | + maker.centerX.equalToSuperview() | |
| 73 | + } | |
| 74 | + | |
| 75 | + calendar = CalendarView.init(frame: CGRect.init(x: 0, y: 0, width: screenWidth, height: 245)) | |
| 76 | + self.view.addSubview(calendar) | |
| 77 | + calendar.snp.makeConstraints { (maker) in | |
| 78 | + maker.width.equalToSuperview() | |
| 79 | + maker.height.equalTo(245) | |
| 80 | + maker.centerX.equalToSuperview() | |
| 81 | + maker.top.equalTo(headView) | |
| 82 | + } | |
| 83 | + calendar.isHidden = true | |
| 78 | 84 | } |
| 79 | 85 | |
| 80 | 86 | @objc func showView(){ | ... | ... |
ParentAssistant/ParentAssistant/Classes/controllers/Information/Controller/InformationViewController.swift
| ... | ... | @@ -41,8 +41,8 @@ class InformationViewController: UIViewController,UISearchBarDelegate { |
| 41 | 41 | |
| 42 | 42 | override func viewDidLoad() { |
| 43 | 43 | super.viewDidLoad() |
| 44 | - | |
| 45 | - let item = UIBarButtonItem.init(title: "返回", style: .plain, target: self, action: nil) | |
| 44 | + localAddress = "越城区" | |
| 45 | + let item = UIBarButtonItem.init(title: "", style: .plain, target: self, action: nil) | |
| 46 | 46 | self.navigationItem.backBarButtonItem = item |
| 47 | 47 | |
| 48 | 48 | drawTopUI() |
| ... | ... | @@ -54,13 +54,18 @@ class InformationViewController: UIViewController,UISearchBarDelegate { |
| 54 | 54 | if isFirstviewController{ |
| 55 | 55 | let leftBtn = UIBarButtonItem.init(customView: self.leftCityView) |
| 56 | 56 | self.navigationItem.leftBarButtonItem = leftBtn |
| 57 | - if localAddress == "未知" { | |
| 58 | - LocationManger.shared.block = { str in | |
| 59 | - localAddress = str | |
| 60 | - self.leftLabel.text = localAddress | |
| 61 | - self.getDataFromNet() | |
| 62 | - } | |
| 63 | - } | |
| 57 | + | |
| 58 | + | |
| 59 | + self.leftLabel.text = "越城区" | |
| 60 | + | |
| 61 | + self.getDataFromNet() | |
| 62 | +// if localAddress == "未知" { | |
| 63 | +// LocationManger.shared.block = { str in | |
| 64 | +// localAddress = str | |
| 65 | +// self.leftLabel.text = localAddress | |
| 66 | +// self.getDataFromNet() | |
| 67 | +// } | |
| 68 | +// } | |
| 64 | 69 | } |
| 65 | 70 | } |
| 66 | 71 | func drawTopUI(){ |
| ... | ... | @@ -94,7 +99,7 @@ class InformationViewController: UIViewController,UISearchBarDelegate { |
| 94 | 99 | position = 3 |
| 95 | 100 | } |
| 96 | 101 | group.enter() |
| 97 | - HTTPServer.shared.getAds(["position":position as AnyObject,"areaName":localAddress as AnyObject], completionHandler: { (str, error) in//getPercentEncodingString(str: localAddress) | |
| 102 | + HTTPServer.shared.getAds(["position":position as AnyObject,"areaName":"越城区" as AnyObject], completionHandler: { (str, error) in//getPercentEncodingString(str: localAddress) | |
| 98 | 103 | httpJsonResule(jsonString: str, error: error, successHandler: { (json) in |
| 99 | 104 | if json["status"] == 1 && error == nil{ |
| 100 | 105 | self.topADs.removeAll() |
| ... | ... | @@ -199,27 +204,49 @@ class InformationViewController: UIViewController,UISearchBarDelegate { |
| 199 | 204 | //MARK:轮播图跳转 |
| 200 | 205 | func chickImage(index:Int){ |
| 201 | 206 | |
| 202 | - let vcs = Story.instantiateViewControllerWithIdentifier("JSViewController", storyName: "JS") as! JSViewController | |
| 203 | - | |
| 204 | - if self.topADs.count > 0 { | |
| 205 | - let model = self.topADs[index] | |
| 206 | - let url = model.url | |
| 207 | - //已登录 | |
| 208 | - if AccountManager.shared.isOnline() && url.contains(HOST_VIDEO){ | |
| 209 | - let phone = UserDefaults.standard.value(forKey: "user_phone") as! String | |
| 210 | - let password = UserDefaults.standard.value(forKey: "user_password") as! String | |
| 211 | - let params = ["username":phone,"password":password] | |
| 212 | - HTTPServer.shared.otherToken(parameters: params as [String : AnyObject]) { (backData, error) in | |
| 213 | - if let token = backData { | |
| 214 | - vcs.webURL = url + "&Token=" + token | |
| 215 | - self.navigationController?.present(vcs.wrapWithNavigationController(), animated: true, completion: nil) | |
| 207 | + if AccountManager.shared.isOnline(){ | |
| 208 | + | |
| 209 | + if self.topADs.count > 0 { | |
| 210 | + let model = self.topADs[index] | |
| 211 | + if model.url.contains(HOST_VIDEO) { | |
| 212 | + let phone = UserDefaults.standard.value(forKey: "user_phone") as! String | |
| 213 | + let password = UserDefaults.standard.value(forKey: "user_password") as! String | |
| 214 | + let params = ["username":phone,"password":password,"type":"1"] | |
| 215 | + HTTPServer.shared.otherToken(parameters: params as [String : AnyObject]) { (backData, error) in | |
| 216 | + if let token = backData { | |
| 217 | + let vcs = Story.instantiateViewControllerWithIdentifier("JSViewController", storyName: "JS") as! JSViewController | |
| 218 | + vcs.webURL = model.url + "&Token=" + token | |
| 219 | + self.navigationController?.present(vcs.wrapWithNavigationController(), animated: true, completion: nil) | |
| 220 | + debugPrint(backData!) | |
| 221 | + } | |
| 216 | 222 | } |
| 223 | + }else{ | |
| 224 | + let vcs = Story.instantiateViewControllerWithIdentifier("JSViewController", storyName: "JS") as! JSViewController | |
| 225 | + vcs.webURL = model.url | |
| 226 | + self.navigationController?.present(vcs.wrapWithNavigationController(), animated: true, completion: nil) | |
| 217 | 227 | } |
| 218 | - }else{ | |
| 219 | - vcs.webURL = url | |
| 220 | - self.navigationController?.present(vcs.wrapWithNavigationController(), animated: true, completion: nil) | |
| 221 | 228 | } |
| 229 | + }else{ | |
| 230 | + appDelegate.window?.makeToast("需要登录才能跳转!") | |
| 222 | 231 | } |
| 232 | + | |
| 233 | + | |
| 234 | +// if self.topADs.count > 0 { | |
| 235 | +// let model = self.topADs[index] | |
| 236 | +// let url = model.url | |
| 237 | +// //已登录 | |
| 238 | +// if AccountManager.shared.isOnline() && url.contains(HOST_VIDEO){ | |
| 239 | +// let phone = UserDefaults.standard.value(forKey: "user_phone") as! String | |
| 240 | +// let password = UserDefaults.standard.value(forKey: "user_password") as! String | |
| 241 | +// let params = ["username":phone,"password":password] | |
| 242 | +// HTTPServer.shared.otherToken(parameters: params as [String : AnyObject]) { (backData, error) in | |
| 243 | +// if let token = backData { | |
| 244 | +// vcs.webURL = url + "&Token=" + token | |
| 245 | +// self.navigationController?.present(vcs.wrapWithNavigationController(), animated: true, completion: nil) | |
| 246 | +// } | |
| 247 | +// } | |
| 248 | + | |
| 249 | + | |
| 223 | 250 | } |
| 224 | 251 | } |
| 225 | 252 | // MARK: - XRCarouselViewDelegate |
| ... | ... | @@ -333,7 +360,11 @@ extension InformationViewController:UICollectionViewDataSource,UICollectionViewD |
| 333 | 360 | var reusableview:UICollectionReusableView? |
| 334 | 361 | if kind == UICollectionElementKindSectionHeader{ |
| 335 | 362 | let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: UICollectionElementKindSectionHeader, withReuseIdentifier: "headerView", for: indexPath) as! InformationSectionHeader |
| 336 | - headerView.title.text = "咨讯话题" | |
| 363 | + if isFirstviewController { | |
| 364 | + headerView.title.text = "资讯话题" | |
| 365 | + }else{ | |
| 366 | + headerView.title.text = "热门资讯" | |
| 367 | + } | |
| 337 | 368 | reusableview = headerView |
| 338 | 369 | } |
| 339 | 370 | if indexPath.section == 2{ | ... | ... |
ParentAssistant/ParentAssistant/Classes/controllers/main/JSViewController.swift
| ... | ... | @@ -19,12 +19,15 @@ class JSViewController: UIViewController,WKUIDelegate,WKScriptMessageHandler,UIA |
| 19 | 19 | var loadingView:UIView! |
| 20 | 20 | var loadingImageWidth:CGFloat = 60 |
| 21 | 21 | var borderline:Bool = false//web页面有无边框 |
| 22 | + | |
| 23 | + private var hasChildren:Bool! | |
| 22 | 24 | override func viewDidLoad() { |
| 23 | 25 | super.viewDidLoad() |
| 24 | - if let url = URL(string: webURL){ | |
| 25 | - | |
| 26 | + let childrenArr = AccountManager.shared.getChildClassInfo() | |
| 27 | + if childrenArr.count > 0 { | |
| 28 | + hasChildren = true | |
| 26 | 29 | }else{ |
| 27 | - return | |
| 30 | + hasChildren = false | |
| 28 | 31 | } |
| 29 | 32 | // js配置 |
| 30 | 33 | // WKWebView的配置 |
| ... | ... | @@ -46,7 +49,10 @@ class JSViewController: UIViewController,WKUIDelegate,WKScriptMessageHandler,UIA |
| 46 | 49 | } |
| 47 | 50 | wkWebView.uiDelegate=self |
| 48 | 51 | wkWebView.navigationDelegate=self |
| 49 | - self.wkWebView.load(Foundation.URLRequest(url: URL(string: webURL)!)) | |
| 52 | + | |
| 53 | + if webURL.count > 0 { | |
| 54 | + self.wkWebView.load(URLRequest.init(url: URL.init(string: webURL)!)) | |
| 55 | + } | |
| 50 | 56 | wkWebView.addObserver(self, forKeyPath: "estimatedProgress", options: NSKeyValueObservingOptions.new, context: nil) |
| 51 | 57 | wkWebView.addObserver(self, forKeyPath: "title", options: NSKeyValueObservingOptions.new, context: nil) |
| 52 | 58 | if ary.count==0 { |
| ... | ... | @@ -122,8 +128,10 @@ class JSViewController: UIViewController,WKUIDelegate,WKScriptMessageHandler,UIA |
| 122 | 128 | } |
| 123 | 129 | } |
| 124 | 130 | override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { |
| 131 | + | |
| 125 | 132 | if keyPath=="estimatedProgress" { |
| 126 | - if object as! WKWebView == self.wkWebView { | |
| 133 | + | |
| 134 | + if object as? WKWebView == self.wkWebView { | |
| 127 | 135 | self.progressView.alpha=1.0 |
| 128 | 136 | self.progressView.setProgress(Float(wkWebView.estimatedProgress), animated: true) |
| 129 | 137 | DebugLog( "+++++++++++++++++\(Float(wkWebView.estimatedProgress))") |
| ... | ... | @@ -136,9 +144,9 @@ class JSViewController: UIViewController,WKUIDelegate,WKScriptMessageHandler,UIA |
| 136 | 144 | } |
| 137 | 145 | }else{ |
| 138 | 146 | super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context) |
| 139 | - } | |
| 147 | + } | |
| 140 | 148 | }else if keyPath=="title" { |
| 141 | - if object as! WKWebView == self.wkWebView { | |
| 149 | + if object as? WKWebView == self.wkWebView { | |
| 142 | 150 | self.navigationItem.title=self.wkWebView.title |
| 143 | 151 | }else{ |
| 144 | 152 | super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context) | ... | ... |
ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/Login/LoginViewController.swift
| ... | ... | @@ -110,6 +110,28 @@ class LoginViewController: UITableViewController,UITextFieldDelegate { |
| 110 | 110 | // MARK: - 登录按钮 |
| 111 | 111 | @IBAction func loginAction(_ sender: UIButton) { |
| 112 | 112 | self.view.endEditing(true) |
| 113 | + | |
| 114 | + checkParent() | |
| 115 | + } | |
| 116 | + // MARK: - 判断是否为家长 | |
| 117 | + func checkParent(){ | |
| 118 | + SVProgressHUD.show() | |
| 119 | + HTTPServer.shared.checkParentType(phoneTextField.text!) { (backData, error) in | |
| 120 | + SVProgressHUD.dismiss() | |
| 121 | + if let isPatent = JSON.fromString(backData)!["data"].bool { | |
| 122 | + if isPatent { | |
| 123 | + self.gotoLoginAction() | |
| 124 | + }else{ | |
| 125 | + appDelegate.window?.makeToast("账号未注册") | |
| 126 | +// if let message = JSON.fromString(backData)!["message"].string{ | |
| 127 | +// appDelegate.window?.makeToast(message, duration: 1, position: nil) | |
| 128 | +// } | |
| 129 | + } | |
| 130 | + } | |
| 131 | + } | |
| 132 | + } | |
| 133 | + func gotoLoginAction(){ | |
| 134 | + | |
| 113 | 135 | SVProgressHUD.show(withStatus: "登录中...") |
| 114 | 136 | HTTPServer.shared.login(completionHandler: { (str, error) in |
| 115 | 137 | SVProgressHUD.dismiss() |
| ... | ... | @@ -173,7 +195,6 @@ class LoginViewController: UITableViewController,UITextFieldDelegate { |
| 173 | 195 | } |
| 174 | 196 | } |
| 175 | 197 | } |
| 176 | - | |
| 177 | 198 | // MARK: - 注册页面跳转 |
| 178 | 199 | @IBAction func registerAction(_ sender: UIButton) { |
| 179 | 200 | let vc = Story.instantiateViewControllerWithIdentifier("RegisterViewController", storyName: "My") as! RegisterViewController | ... | ... |
ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyChildrenViewController.swift
| ... | ... | @@ -31,10 +31,11 @@ class MyChildrenViewController: UIViewController{ |
| 31 | 31 | emptyView.imageView.image=UIImage(named:"emptyset_1") |
| 32 | 32 | emptyView.labelView.text="暂未关联孩子信息" |
| 33 | 33 | emptyView.buttonView.isHidden=true |
| 34 | - for j in AccountManager.shared.rawUserInfo!.contentData()["studentClass"].arrayValue { | |
| 35 | - myChildrens.append(StudentClassInfo(json: j)) | |
| 34 | + if let j = AccountManager.shared.rawUserInfo?.contentData()["studentClass"].array{ | |
| 35 | + for m in j { | |
| 36 | + myChildrens.append(StudentClassInfo(json: m)) | |
| 37 | + } | |
| 36 | 38 | } |
| 37 | - | |
| 38 | 39 | } |
| 39 | 40 | // MARK: - 添加绑定账号 |
| 40 | 41 | @IBAction func addChildrenAction(_ sender: UIButton) { | ... | ... |
ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyViewController.swift
| ... | ... | @@ -212,10 +212,15 @@ extension MyViewController: UITableViewDelegate,UITableViewDataSource{ |
| 212 | 212 | } |
| 213 | 213 | case 2://家校通订购 |
| 214 | 214 | if AccountManager.shared.isOnline() { |
| 215 | - let vcs = Story.instantiateViewControllerWithIdentifier("JSViewController", storyName: "JS") as! JSViewController | |
| 216 | - vcs.borderline = true | |
| 217 | - vcs.webURL = "\(HOSTWAP!)/ParentOrderCenter.aspx?userid=\(AccountManager.shared.id())" | |
| 218 | - self.navigationController?.present(vcs.wrapWithNavigationController(), animated: true, completion: nil) | |
| 215 | + let children = AccountManager.shared.getChildClassInfo() | |
| 216 | + if children.count > 0 { | |
| 217 | + let vcs = Story.instantiateViewControllerWithIdentifier("JSViewController", storyName: "JS") as! JSViewController | |
| 218 | + vcs.borderline = true | |
| 219 | + vcs.webURL = "\(HOSTWAP!)/ParentOrderCenter.aspx?userid=\(AccountManager.shared.id())" | |
| 220 | + self.navigationController?.present(vcs.wrapWithNavigationController(), animated: true, completion: nil) | |
| 221 | + }else{ | |
| 222 | + appDelegate.window?.makeToast("绑定孩子后,才能订购!") | |
| 223 | + } | |
| 219 | 224 | }else{ |
| 220 | 225 | appDelegate.window!.makeToast("请先登录", duration: 1, position: CSToastPositionCenter) |
| 221 | 226 | } | ... | ... |
ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/BindingViewController.swift
| ... | ... | @@ -166,6 +166,7 @@ class BindingViewController: UIViewController { |
| 166 | 166 | if JSON.fromString(str)!["status"] == 1 && error == nil{ |
| 167 | 167 | appDelegate.window!.makeToast("绑定成功") |
| 168 | 168 | let vc = BindlingSuccessViewController() |
| 169 | + vc.bindlingSuccData = str! | |
| 169 | 170 | self.navigationController?.pushViewController(vc, animated: true) |
| 170 | 171 | }else{ |
| 171 | 172 | appDelegate.window!.makeToast("绑定失败") | ... | ... |
ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/BindlingSuccessViewController.swift
| ... | ... | @@ -14,9 +14,15 @@ class BindlingSuccessViewController: UIViewController ,UIWebViewDelegate,UIScrol |
| 14 | 14 | var webBrowserView:UIView! |
| 15 | 15 | var urlStr:String="http://60.190.202.57:8101/RecommendOrder.aspx?userid=" |
| 16 | 16 | var bindlingType:Int = 1 |
| 17 | + | |
| 18 | + var bindlingSuccData = String() | |
| 19 | + | |
| 17 | 20 | override func viewDidLoad() { |
| 18 | 21 | super.viewDidLoad() |
| 19 | 22 | self.view.backgroundColor = UIColor.white |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 20 | 26 | // Do any additional setup after loading the view. |
| 21 | 27 | webView = UIWebView() |
| 22 | 28 | webView.frame = CGRect(x: 10, y: 0, width: getScreenWidth()-20, height: getScreenHeight()) |
| ... | ... | @@ -51,7 +57,11 @@ class BindlingSuccessViewController: UIViewController ,UIWebViewDelegate,UIScrol |
| 51 | 57 | header.frame = CGRect(x: 10, y: 0, width: getScreenWidth()-20, height: 150) |
| 52 | 58 | header.backgroundColor = UIColor.clear |
| 53 | 59 | let label = UILabel(frame: CGRect(x: 10, y: 10, width: header.frame.width - 20, height: 100)) |
| 54 | - label.text = "生成孩子\"汇作业\"账号为:\(urlStr),\n初始密码为:\(urlStr)(与账号相同),\n孩子可以下载\"汇作业\"app进行使用,\n" | |
| 60 | + if bindlingSuccData.count>0{ | |
| 61 | + if let data = JSON.fromString(bindlingSuccData)?["data"].dictionary{ | |
| 62 | + label.text = "生成孩子\"汇作业\"账号为:\(data["account"]?.stringValue ?? ""),\n初始密码为:\(data["passwprd"]?.stringValue ?? ""),\n孩子可以下载\"汇作业\"app进行使用,\n" | |
| 63 | + } | |
| 64 | + } | |
| 55 | 65 | label.numberOfLines = 0 |
| 56 | 66 | label.textColor = UIColor.darkGray |
| 57 | 67 | label.font = UIFont.systemFont(ofSize: 15) |
| ... | ... | @@ -79,7 +89,7 @@ class BindlingSuccessViewController: UIViewController ,UIWebViewDelegate,UIScrol |
| 79 | 89 | backView.frame.size = CGSize(width: btn.frame.width+label2.frame.width+10, height: 30) |
| 80 | 90 | backView.center = CGPoint(x: header.center.x-10, y: label.frame.maxY+10) |
| 81 | 91 | header.frame.size.height = backView.frame.maxY + 10 |
| 82 | - header.addSubview(backView) | |
| 92 | +// header.addSubview(backView) | |
| 83 | 93 | } |
| 84 | 94 | |
| 85 | 95 | webBrowserView = webView.scrollView.subviews[0] | ... | ... |
ParentAssistant/ParentAssistant/Classes/controllers/my/userCenter/UserCenter.storyboard
| 1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | -<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"> | |
| 2 | +<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"> | |
| 3 | 3 | <device id="retina4_7" orientation="portrait"> |
| 4 | 4 | <adaptation id="fullscreen"/> |
| 5 | 5 | </device> |
| 6 | 6 | <dependencies> |
| 7 | 7 | <deployment identifier="iOS"/> |
| 8 | - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/> | |
| 8 | + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/> | |
| 9 | 9 | <capability name="Aspect ratio constraints" minToolsVersion="5.1"/> |
| 10 | 10 | <capability name="Safe area layout guides" minToolsVersion="9.0"/> |
| 11 | 11 | <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> |
| ... | ... | @@ -338,7 +338,7 @@ |
| 338 | 338 | </connections> |
| 339 | 339 | </tapGestureRecognizer> |
| 340 | 340 | </objects> |
| 341 | - <point key="canvasLocation" x="77.599999999999994" y="118.29085457271366"/> | |
| 341 | + <point key="canvasLocation" x="-146" y="107"/> | |
| 342 | 342 | </scene> |
| 343 | 343 | <!--选择孩子学校--> |
| 344 | 344 | <scene sceneID="jXC-xr-pan"> |
| ... | ... | @@ -600,7 +600,7 @@ |
| 600 | 600 | </scene> |
| 601 | 601 | </scenes> |
| 602 | 602 | <resources> |
| 603 | - <image name="evaluation_icon_pushDown" width="16" height="9"/> | |
| 603 | + <image name="evaluation_icon_pushDown" width="178" height="100"/> | |
| 604 | 604 | <image name="my_icon_confirmBtn" width="21" height="19"/> |
| 605 | 605 | </resources> |
| 606 | 606 | </document> | ... | ... |
ParentAssistant/ParentAssistant/Classes/util/HTTPServer.swift
| ... | ... | @@ -151,8 +151,10 @@ final class HTTPServer{ |
| 151 | 151 | func updatePassword(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ |
| 152 | 152 | KHttp.POST(url: URL_USER_UPDATEPASSWORD, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) |
| 153 | 153 | } |
| 154 | - | |
| 155 | - | |
| 154 | + //登录时判断是否是家长 | |
| 155 | + func checkParentType(_ mobile:String,completionHandler:@escaping (String?, NSError?) -> Void){ | |
| 156 | + KHttp.GET(url: URL_GET_PARENT_JUDGE,parameters:["mobile":mobile as AnyObject], completionHandler: completionHandler) | |
| 157 | + } | |
| 156 | 158 | |
| 157 | 159 | //家长注册 |
| 158 | 160 | func parentRegister(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ | ... | ... |
ParentAssistant/ParentAssistant/Classes/util/Macro.swift
| ... | ... | @@ -39,16 +39,28 @@ let appsecret="sincere:3a530f39f99411b454e667d69693c127" |
| 39 | 39 | |
| 40 | 40 | #if DEBUG |
| 41 | 41 | //测试网址 |
| 42 | -var HOST:String! = "http://60.190.202.57:1000" | |
| 43 | -var HOSTWAP:String! = "http://60.190.202.57:8101" | |
| 44 | -var HOSTImage:String! = "http://60.190.202.57:8196" | |
| 45 | -let HOST_VIDEO:String! = "http://60.190.202.57:8812/" | |
| 42 | +//var HOST:String! = "http://60.190.202.57:1000" | |
| 43 | +//var HOSTWAP:String! = "http://60.190.202.57:8101" | |
| 44 | +//var HOSTImage:String! = "http://60.190.202.57:8196" | |
| 45 | +//let HOST_VIDEO:String! = "http://60.190.202.57:8812/" | |
| 46 | +var HOST:String! = "http://campus.myjxt.com" | |
| 47 | +var HOSTWAP:String! = "http://parent.myjxt.com" | |
| 48 | +var HOSTImage:String! = "http://manage.myjxt.com" | |
| 49 | +let HOST_VIDEO:String! = "http://www.sxspy.net/" | |
| 50 | + | |
| 51 | +//var appkey = "330158c080acdf4dc1092d6a74576c2c" | |
| 52 | +//var cername = "parentdevelop" | |
| 53 | +var appkey = "a1ff0bc08fa0d6f95b480d131e55584b" | |
| 54 | +var cername = "hxyproductpush" | |
| 46 | 55 | #else |
| 47 | 56 | //正式网址 |
| 48 | 57 | var HOST:String! = "http://campus.myjxt.com" |
| 49 | 58 | var HOSTWAP:String! = "http://parent.myjxt.com" |
| 50 | 59 | var HOSTImage:String! = "http://manage.myjxt.com" |
| 51 | 60 | let HOST_VIDEO:String! = "http://www.sxspy.net/" |
| 61 | +//云信账号 | |
| 62 | +var appkey = "a1ff0bc08fa0d6f95b480d131e55584b" | |
| 63 | +var cername = "hxyproductpush" | |
| 52 | 64 | #endif |
| 53 | 65 | |
| 54 | 66 | |
| ... | ... | @@ -66,8 +78,9 @@ let URL_RESTPW="/api/Account/ReSetpass" |
| 66 | 78 | let URL_SCANLOGINCODE = "/api/Account/ScanLogin" |
| 67 | 79 | let URL_IDENTITYLIST = "/api/Account/IdentityList" |
| 68 | 80 | let URL_IDENTITYCONFRIM = "/api/Account/IdentityConfrim" |
| 69 | - | |
| 81 | +//MARK: ------ 登录 -------- | |
| 70 | 82 | let URL_PARENTREGISTER = "/api/ParentHelper/ParentRegister"//家长注册 |
| 83 | +let URL_GET_PARENT_JUDGE = "/api/ParentHelper/ParentJudge" //验证是否是家长账户 | |
| 71 | 84 | let URL_CAPTCHA="/api/Account/ChangePhoneCaptcha"//获取注册验证码 |
| 72 | 85 | let URL_GETPARENTINFO = "/api/ParentHelper/GetParentInfo"//登录获取家长信息(包括关联的孩子信息区分绑定状态) |
| 73 | 86 | let URL_UPDATEPARENTINFO = "/api/ParentHelper/UpdateParentInfo"//更新姓名和性别 | ... | ... |
ParentAssistant/ParentAssistant/Classes/util/utils.swift
| ... | ... | @@ -207,8 +207,8 @@ extension String{ |
| 207 | 207 | for i in 0 ..< digestLen { |
| 208 | 208 | hash.appendFormat("%02x", result[i]) |
| 209 | 209 | } |
| 210 | -// result.deinitialize() | |
| 211 | - result.deinitialize(count: digestLen) | |
| 210 | + result.deinitialize() | |
| 211 | +// result.deinitialize(count: digestLen) | |
| 212 | 212 | return hash.uppercased |
| 213 | 213 | } |
| 214 | 214 | } | ... | ... |
ParentAssistant/ParentAssistant/Supporting Files/Base.lproj/Main.storyboard
| ... | ... | @@ -1063,11 +1063,11 @@ |
| 1063 | 1063 | </objects> |
| 1064 | 1064 | <point key="canvasLocation" x="913" y="-971"/> |
| 1065 | 1065 | </scene> |
| 1066 | - <!--咨询频道--> | |
| 1066 | + <!--资讯--> | |
| 1067 | 1067 | <scene sceneID="zMY-cK-guM"> |
| 1068 | 1068 | <objects> |
| 1069 | 1069 | <navigationController automaticallyAdjustsScrollViewInsets="NO" id="40K-Kv-ipy" customClass="MainViewController" customModule="ParentAssistant" customModuleProvider="target" sceneMemberID="viewController"> |
| 1070 | - <tabBarItem key="tabBarItem" title="咨询频道" image="Information_bar_icon" selectedImage="Information_bar_icon_select" id="0Ea-ls-Ren"/> | |
| 1070 | + <tabBarItem key="tabBarItem" title="资讯" image="Information_bar_icon" selectedImage="Information_bar_icon_select" id="0Ea-ls-Ren"/> | |
| 1071 | 1071 | <toolbarItems/> |
| 1072 | 1072 | <navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="bTJ-Ap-TDP"> |
| 1073 | 1073 | <rect key="frame" x="0.0" y="20" width="375" height="44"/> |
| ... | ... | @@ -1104,11 +1104,11 @@ |
| 1104 | 1104 | </objects> |
| 1105 | 1105 | <point key="canvasLocation" x="913" y="410"/> |
| 1106 | 1106 | </scene> |
| 1107 | - <!--个人中心--> | |
| 1107 | + <!--我的--> | |
| 1108 | 1108 | <scene sceneID="k70-QL-d6T"> |
| 1109 | 1109 | <objects> |
| 1110 | 1110 | <navigationController automaticallyAdjustsScrollViewInsets="NO" id="eER-h6-27H" customClass="MainViewController" customModule="ParentAssistant" customModuleProvider="target" sceneMemberID="viewController"> |
| 1111 | - <tabBarItem key="tabBarItem" title="个人中心" image="my_bar_icon" selectedImage="my_bar_icon_select" id="Rn5-qq-H6e"> | |
| 1111 | + <tabBarItem key="tabBarItem" title="我的" image="my_bar_icon" selectedImage="my_bar_icon_select" id="Rn5-qq-H6e"> | |
| 1112 | 1112 | <color key="badgeColor" red="0.42745098039215684" green="0.54509803921568623" blue="0.99215686274509807" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| 1113 | 1113 | </tabBarItem> |
| 1114 | 1114 | <toolbarItems/> | ... | ... |
ParentAssistant/ParentAssistant/Supporting Files/Info.plist
| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | <plist version="1.0"> |
| 4 | 4 | <dict> |
| 5 | 5 | <key>CFBundleDevelopmentRegion</key> |
| 6 | - <string>$(DEVELOPMENT_LANGUAGE)</string> | |
| 6 | + <string>zh_CN</string> | |
| 7 | 7 | <key>CFBundleDisplayName</key> |
| 8 | 8 | <string>家长慧</string> |
| 9 | 9 | <key>CFBundleExecutable</key> |
| ... | ... | @@ -17,9 +17,9 @@ |
| 17 | 17 | <key>CFBundlePackageType</key> |
| 18 | 18 | <string>APPL</string> |
| 19 | 19 | <key>CFBundleShortVersionString</key> |
| 20 | - <string>1.0.1</string> | |
| 20 | + <string>1.0.2</string> | |
| 21 | 21 | <key>CFBundleVersion</key> |
| 22 | - <string>13</string> | |
| 22 | + <string>15</string> | |
| 23 | 23 | <key>ITSAppUsesNonExemptEncryption</key> |
| 24 | 24 | <false/> |
| 25 | 25 | <key>LSRequiresIPhoneOS</key> |
| ... | ... | @@ -29,6 +29,8 @@ |
| 29 | 29 | <key>NSAllowsArbitraryLoads</key> |
| 30 | 30 | <true/> |
| 31 | 31 | </dict> |
| 32 | + <key>NSLocationUsageDescription</key> | |
| 33 | + <string>家长慧将根据您的地理位置信息,获取与位置相匹配的学校和新闻信息</string> | |
| 32 | 34 | <key>NSLocationWhenInUseUsageDescription</key> |
| 33 | 35 | <string>家长慧将根据您的地理位置信息,获取与位置相匹配的学校和新闻信息</string> |
| 34 | 36 | <key>NSMicrophoneUsageDescription</key> | ... | ... |