From 55ec444b274402ec146a32a88a12f404a40d8555 Mon Sep 17 00:00:00 2001
From: 葛建军 <627299690@qq.com>
Date: Fri, 23 Mar 2018 13:34:11 +0800
Subject: [PATCH] 家长助手安卓和iOS端统一修改。
---
.gitignore | 7 +++++++
ParentAssistant/ParentAssistant/Classes/controllers/Information/InformationViewController.swift | 6 +++---
ParentAssistant/ParentAssistant/Classes/controllers/Information/view/ChannelCollectionViewCell.xib | 10 +++++-----
ParentAssistant/ParentAssistant/Classes/controllers/Information/view/ChannelSelectViewCollectionViewCell.xib | 9 ++++++---
ParentAssistant/ParentAssistant/Classes/controllers/evaluation/EvaluationViewController.swift | 6 +++---
ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/GetBackPasswordViewController.swift | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/LoginViewController.swift | 23 +++++++++++++----------
ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/My.storyboard | 41 ++++++++++++++++++-----------------------
ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyViewController.swift | 18 ++++++++++--------
ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/RegisterViewController.swift | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------
ParentAssistant/ParentAssistant/Classes/controllers/my/Model/MyViewControllerModel.swift | 3 +++
ParentAssistant/ParentAssistant/Classes/controllers/report/View/ReportHeaderView.xib | 6 +++---
ParentAssistant/ParentAssistant/Classes/util/utils.swift | 4 ++--
ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/evaluation/evaluation_icon_pushDown.imageset/Contents.json | 2 +-
ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/evaluation/evaluation_icon_pushDown.imageset/down.png | Bin 0 -> 3969 bytes
ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/evaluation/evaluation_icon_pushDown.imageset/下拉.png | Bin 603 -> 0 bytes
ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/my/my_defphoto.imageset/Contents.json | 21 +++++++++++++++++++++
ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/my/my_defphoto.imageset/未登录.png | Bin 0 -> 4042 bytes
ParentAssistant/ParentAssistant/Supporting Files/Base.lproj/Main.storyboard | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------
19 files changed, 305 insertions(+), 105 deletions(-)
create mode 100644 .gitignore
create mode 100644 ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/evaluation/evaluation_icon_pushDown.imageset/down.png
delete mode 100644 ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/evaluation/evaluation_icon_pushDown.imageset/下拉.png
create mode 100644 ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/my/my_defphoto.imageset/Contents.json
create mode 100644 ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/my/my_defphoto.imageset/未登录.png
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0d9dbea
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+*.xccheckout
+*.xcuserstate
+*.xcbkptlist
+ParentAssistant.xcscheme
+xcschememanagement.plist
+*.xcuserdata
+*/xcuserdatad/*
\ No newline at end of file
diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Information/InformationViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Information/InformationViewController.swift
index 253e80d..9e2801f 100644
--- a/ParentAssistant/ParentAssistant/Classes/controllers/Information/InformationViewController.swift
+++ b/ParentAssistant/ParentAssistant/Classes/controllers/Information/InformationViewController.swift
@@ -113,7 +113,7 @@ class InformationViewController: UIViewController,UISearchBarDelegate {
let leftbtn = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 40))
leftLabel = UILabel(frame: CGRect(x: 0, y: 10, width: 60, height: 20))
leftLabel.text = AccountManager.shared.address
- leftLabel.textColor = UIColor.black
+ leftLabel.textColor = UIColor.white
leftLabel.sizeToFit()
let image = UIImageView(frame: CGRect(x: leftLabel.frame.maxX+4, y: 15, width: 16, height: 9))
image.image = #imageLiteral(resourceName: "evaluation_icon_pushDown")
@@ -182,7 +182,7 @@ class InformationViewController: UIViewController,UISearchBarDelegate {
//点击资讯进入详情
func pushToInfoView(index:Int){
let vcs = Story.instantiateViewControllerWithIdentifier("JSViewController", storyName: "JS") as! JSViewController
- vcs.webURL = "http://60.190.202.57:8101/InformationDetail.aspx?id=75&areaname=%E4%BD%99%E6%9D%AD%E5%8C%BA"//(HTTPServer.HOSTWAP+"/InformationDetail.aspx?id="+"\(data.channelContent[index].id)"+"&areaname="+AccountManager.shared.address)//.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
+ vcs.webURL = (HTTPServer.HOSTWAP+"/InformationDetail.aspx?id="+"\(data.channelContent[index].id)"+"&areaname="+AccountManager.shared.address)//.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
self.navigationController?.present(vcs.wrapWithNavigationController(), animated: true, completion: nil)
}
@@ -349,7 +349,7 @@ extension ChannelSelectView:UICollectionViewDataSource,UICollectionViewDelegateF
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "channelcell", for: indexPath) as! ChannelSelectViewCollectionViewCell
- cell.image.sd_setImage(with: URL(string: (HTTPServer.HOSTImage+SubchannelList[indexPath.row].channelImage).addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!), placeholderImage: UIImage(named: "navigationBar_backgrounImage"))
+ cell.image.sd_setImage(with: URL(string: (HTTPServer.HOSTImage+SubchannelList[indexPath.row].channelImage).addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!), placeholderImage: UIImage(named: "evaluation_icon_highSchoolEnter"))
cell.channelName.text = SubchannelList[indexPath.row].channelName
return cell
}
diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Information/view/ChannelCollectionViewCell.xib b/ParentAssistant/ParentAssistant/Classes/controllers/Information/view/ChannelCollectionViewCell.xib
index f362c5b..47a0afc 100644
--- a/ParentAssistant/ParentAssistant/Classes/controllers/Information/view/ChannelCollectionViewCell.xib
+++ b/ParentAssistant/ParentAssistant/Classes/controllers/Information/view/ChannelCollectionViewCell.xib
@@ -41,25 +41,25 @@
-
@@ -59,4 +59,7 @@
+
+
+
diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/evaluation/EvaluationViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/evaluation/EvaluationViewController.swift
index 5ab63ce..26074f3 100644
--- a/ParentAssistant/ParentAssistant/Classes/controllers/evaluation/EvaluationViewController.swift
+++ b/ParentAssistant/ParentAssistant/Classes/controllers/evaluation/EvaluationViewController.swift
@@ -28,7 +28,7 @@ class EvaluationViewController: UIViewController,CLLocationManagerDelegate,Selec
var leftLabel:UILabel!
override func viewDidLoad() {
super.viewDidLoad()
- self.navigationItem.title = "测评"
+ self.navigationItem.title = "慧测慧练"
addLeftBarBtn()
locationAction()
addBottomBtn()
@@ -120,7 +120,7 @@ class EvaluationViewController: UIViewController,CLLocationManagerDelegate,Selec
let leftbtn = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 40))
leftLabel = UILabel(frame: CGRect(x: 0, y: 10, width: 60, height: 20))
leftLabel.text = AccountManager.shared.address
- leftLabel.textColor = UIColor.black
+ leftLabel.textColor = UIColor.white
leftLabel.sizeToFit()
let image = UIImageView(frame: CGRect(x: leftLabel.frame.maxX+4, y: 15, width: 16, height: 9))
image.image = #imageLiteral(resourceName: "evaluation_icon_pushDown")
@@ -260,7 +260,7 @@ extension EvaluationViewController:UICollectionViewDataSource,UICollectionViewDe
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "channelcell", for: indexPath) as! ChannelSelectViewCollectionViewCell
- cell.image.sd_setImage(with: URL(string: (HTTPServer.HOSTImage+toolArr[indexPath.row].toolImage).addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!), placeholderImage: #imageLiteral(resourceName: "defphoto"))
+ cell.image.sd_setImage(with: URL(string: (HTTPServer.HOSTImage+toolArr[indexPath.row].toolImage).addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!), placeholderImage: UIImage(named: "evaluation_icon_highSchoolEnter"))
cell.channelName.text = toolArr[indexPath.row].toolName
return cell
}
diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/GetBackPasswordViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/GetBackPasswordViewController.swift
index 6121d66..fe6eda1 100644
--- a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/GetBackPasswordViewController.swift
+++ b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/GetBackPasswordViewController.swift
@@ -33,7 +33,7 @@ class GetBackPasswordViewController: UIViewController,UITextFieldDelegate {
getCodeBtn.layer.borderColor = UIColor.lightGray.cgColor
topView.constant = (getScreenHeight()-325)/3
passwordHiddenBtn.setImage(UIImage(named: "my_password_look"), for: UIControlState.selected)
- NotificationCenter.default.addObserver(self, selector: #selector(RegisterViewController.keyboardWIllChange(_:)), name: NSNotification.Name.UIKeyboardWillChangeFrame, object: nil)
+ NotificationCenter.default.addObserver(self, selector: #selector(GetBackPasswordViewController.keyboardWIllChange(_:)), name: NSNotification.Name.UIKeyboardWillChangeFrame, object: nil)
}
// MARK: - 根据键盘调整高度
@objc func keyboardWIllChange(_ noti: Notification){
@@ -122,9 +122,63 @@ class GetBackPasswordViewController: UIViewController,UITextFieldDelegate {
httpJsonResule(jsonString: str, error: error, successHandler: { (json) -> Void in
let alertVC = UIAlertController(title: "提示", message: "密码修改成功", preferredStyle: UIAlertControllerStyle.alert)
let showBtn = UIAlertAction(title: "确认", style: UIAlertActionStyle.default) { (action) in
- self.dismiss(animated: true) {
- //登录
- }
+ self.navigationController?.popToRootViewController(animated: true)
+ //登录
+ SVProgressHUD.show(withStatus: "登录中...")
+ HTTPServer.shared.login(completionHandler: { (str, error) in
+ SVProgressHUD.dismiss()
+ let json=JSON.fromString(str)
+ if let ret=json{
+ let er=ret["error"].string
+ if let errorStr=er{
+ let Strings=errorStr.components(separatedBy: ":")
+ if Strings.count >= 2 {
+ switch Strings[1] {
+ //用户关联多个身份,请使用学事号登录:100
+ case "101"://用户认证身份不存在:101
+ appDelegate.window!.makeToast("用户认证身份不存在,请进行账号激活。")
+ break
+ //用户帐号或密码错误:102
+ case "103":// 用户不存在:103
+ appDelegate.window!.makeToast("该号码不存在,请联系客服400-826-2468")
+ break
+ default:
+ appDelegate.window!.makeToast(errorStr)
+ break
+ }
+ }else{
+ appDelegate.window!.makeToast(errorStr)
+ }
+ }else if ret["access_token"].stringValue != ""{
+ AccountManager.shared.setTokenInfo(tokenInfo: ret)
+ AccountManager.shared.saveToken(tokenInfo: ret)
+ AccountManager.shared.refreshUserInfo(self.phoneTextField.text!, completionHandler: { (finish) in
+ if finish{
+ let ID=AccountManager.shared.rawUserInfo!.contentData()["userid"].stringValue
+ YXMessageManager.share.loginWithYX(account: ID, token: ID.md5()) { (success) in
+ SVProgressHUD.dismiss()
+ if !success {
+ AccountManager.shared.logOut()
+ appDelegate.window!.makeToast("聊天服务登录失败,请连接网络重试")
+ }else{
+ //云信登录成功
+ self.dismiss(animated: true, completion: nil)
+ }
+ }
+ }else{
+ appDelegate.window!.makeToast("身份获取失败")
+ SVProgressHUD.dismiss()
+ }
+ })
+ }else{
+ SVProgressHUD.dismiss()
+ appDelegate.window!.makeToast("登录失败,请稍后重试")
+ }
+ }else{
+ SVProgressHUD.dismiss()
+ appDelegate.window!.makeToast("登录失败")
+ }
+ }, phone: self.phoneTextField.text!, password: self.passwordTextField.text!)
}
alertVC.addAction(showBtn)
self.present(alertVC, animated: true, completion: nil)
diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/LoginViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/LoginViewController.swift
index 3c43929..8814cab 100644
--- a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/LoginViewController.swift
+++ b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/LoginViewController.swift
@@ -14,24 +14,22 @@ class LoginViewController: UIViewController,UITextFieldDelegate {
@IBOutlet var phoneTextField: UITextField!//电话号码
@IBOutlet var passwordTextField: UITextField!//密码
@IBOutlet var passwordHiddenBtn: UIButton!//查看密码按钮
- var phoneNumber:String = ""
override func viewDidLoad() {
super.viewDidLoad()
layoutSubViews()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
- self.navigationController?.navigationBar.isHidden = true
+ self.navigationController?.navigationBar.isHidden = false
}
// MARK: - 设置控件属性
func layoutSubViews(){
- self.navigationController?.navigationBar.isHidden = true
+ self.navigationController?.navigationBar.isHidden = false
+ self.navigationItem.title = "登录"
topView.constant = (getScreenHeight()-325)/3
passwordHiddenBtn.setImage(UIImage(named: "my_password_look"), for: UIControlState.selected)
- NotificationCenter.default.addObserver(self, selector: #selector(RegisterViewController.keyboardWIllChange(_:)), name: NSNotification.Name.UIKeyboardWillChangeFrame, object: nil)
- if phoneNumber != "" {
- phoneTextField.text = phoneNumber
- }
+ NotificationCenter.default.addObserver(self, selector: #selector(LoginViewController.keyboardWIllChange(_:)), name: NSNotification.Name.UIKeyboardWillChangeFrame, object: nil)
+ NotificationCenter.default.addObserver(self, selector: #selector(LoginViewController.getPhoneNumber(_:)), name: NSNotification.Name(rawValue: MyPhoneNumberNotification.getPhoneNumber), object: nil)
}
// MARK: - 根据键盘调整高度
@objc func keyboardWIllChange(_ noti: Notification){
@@ -40,9 +38,13 @@ class LoginViewController: UIViewController,UITextFieldDelegate {
if endFrame?.origin.y == getScreenHeight() {
topView.constant = (getScreenHeight()-325)/3
}else{
- topView.constant = (endFrame?.origin.y)!-325
+ topView.constant = (endFrame?.origin.y)!-375
}
}
+ @objc func getPhoneNumber(_ noti: Notification){
+ let userInfo:NSDictionary=noti.userInfo! as NSDictionary
+ phoneTextField.text = userInfo["phoneNumber"] as? String
+ }
// MARK: - 密码显示与否
@IBAction func passwordHiddenAction(_ sender: UIButton) {
@@ -121,14 +123,15 @@ class LoginViewController: UIViewController,UITextFieldDelegate {
appDelegate.window!.makeToast("聊天服务登录失败,请连接网络重试")
}else{
//云信登录成功
- self.dismiss(animated: true, completion: nil)
+ self.navigationController?.popToRootViewController(animated: true)
}
}
}
// MARK: - 注册页面跳转
@IBAction func registerAction(_ sender: UIButton) {
- self.navigationController?.popViewController(animated: true)
+ let vc = Story.instantiateViewControllerWithIdentifier("RegisterViewController", storyName: "My") as! RegisterViewController
+ self.navigationController?.pushViewController(vc, animated: true)
}
// MARK: - 找回密码
@IBAction func getPasswordAction(_ sender: UIButton) {
diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/My.storyboard b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/My.storyboard
index a49ca3a..2bcad60 100644
--- a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/My.storyboard
+++ b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/My.storyboard
@@ -23,7 +23,7 @@
-
+
@@ -32,7 +32,7 @@
-
+
@@ -181,7 +181,7 @@
-
+
@@ -196,14 +196,14 @@
-
-
+
+
-
-
-
+
@@ -264,7 +263,7 @@
-
+
@@ -277,7 +276,7 @@
-
+
@@ -286,7 +285,7 @@
-
+
@@ -552,7 +551,7 @@
-
+
@@ -561,7 +560,7 @@
-
+
@@ -678,17 +677,14 @@
-
-
+
+
-
-
-
-
-
+
+
@@ -698,7 +694,7 @@
-
+
@@ -1608,7 +1604,6 @@
-
diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyViewController.swift
index 0eb68d0..e74142b 100644
--- a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyViewController.swift
+++ b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyViewController.swift
@@ -27,7 +27,6 @@ class MyViewController: UIViewController {
}
// MARK: - 设置控件属性
func layoutSubViews(){
- self.navigationController?.navigationBar.barStyle = UIBarStyle.default// UIColorFromRGB(0xC5DAFF)
let backImage = UIImage(named: "navigationBar_backgrounImage")
self.navigationController?.navigationBar.setBackgroundImage(backImage, for: UIBarMetrics.default)
// MARK: - 是否是iPhoneX顶部刘海
@@ -72,7 +71,7 @@ class MyViewController: UIViewController {
let info = AccountManager.shared
personNameLabel.text = info.name()
personNumberLabel.text = info.phone()
- personIconImageView.sd_setImage(with: URL(string: AccountManager.shared.photo().addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!), placeholderImage: UIImage(named: "defphoto"))
+ personIconImageView.sd_setImage(with: URL(string: AccountManager.shared.photo().addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!), placeholderImage: UIImage(named: "my_defphoto"))
}else{
logoutBtn.isHidden = true
personNameLabel.isHidden = true
@@ -80,14 +79,14 @@ class MyViewController: UIViewController {
loginBtn.isHidden = false
currentInfoBtn.isHidden = true
headerBackGroundImageView.image = UIImage(named: "navigationBar_backgrounImage")
- personIconImageView.image = UIImage(named: "defphoto")
+ personIconImageView.image = UIImage(named: "my_defphoto")
}
currentInfoTableView.reloadData()
}
// MARK: - 登录按钮点击方法
@IBAction func showLoginAction(_ sender: UIButton) {
- let vc = Story.instantiateViewControllerWithIdentifier("RegisterViewController", storyName: "My") as! RegisterViewController
- self.present(vc.wrapWithNavigationController(), animated: true, completion: nil)
+ let vc = Story.instantiateViewControllerWithIdentifier("LoginViewController", storyName: "My") as! LoginViewController
+ self.navigationController?.pushViewController(vc, animated: true)
}
// MARK: - 个人信息按钮点击方法
@@ -175,10 +174,13 @@ extension MyViewController: UITableViewDelegate,UITableViewDataSource{
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
switch indexPath.row {
- case 0,3,5,6,7:
+ case 5,6,7:
return 44
- case 1,2:
- if !AccountManager.shared.isOnline() || (AccountManager.shared.isOnline() && AccountManager.shared.name()=="葛建军") {//隐藏支付相关功能
+ case 0,1,2,3:
+ if !AccountManager.shared.isOnline() {
+ return 0
+ }
+ if AccountManager.shared.isOnline() && AccountManager.shared.name()=="葛建军" && (indexPath.row == 1 || indexPath.row == 2){//隐藏支付相关功能
return 0
}else{
return 44
diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/RegisterViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/RegisterViewController.swift
index cb22fbf..96921a6 100644
--- a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/RegisterViewController.swift
+++ b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/RegisterViewController.swift
@@ -26,7 +26,8 @@ class RegisterViewController: UIViewController,UITextFieldDelegate {
}
// MARK: - 设置控件属性
func layoutSubViews(){
- self.navigationController?.navigationBar.isHidden = true
+ self.navigationController?.navigationBar.isHidden = false
+ self.navigationItem.title = "注册"
getCodeBtn.layer.borderWidth = 1.0
getCodeBtn.layer.borderColor = UIColor.lightGray.cgColor
topView.constant = (getScreenHeight()-325)/3
@@ -40,7 +41,7 @@ class RegisterViewController: UIViewController,UITextFieldDelegate {
if endFrame?.origin.y == getScreenHeight() {
topView.constant = (getScreenHeight()-325)/3
}else{
- topView.constant = (endFrame?.origin.y)!-325
+ topView.constant = (endFrame?.origin.y)!-375
}
}
// MARK: - 获取验证码
@@ -107,14 +108,67 @@ class RegisterViewController: UIViewController,UITextFieldDelegate {
//登录并返回页面
let alertVC = UIAlertController(title: "提示", message: "您已注册成功", preferredStyle: UIAlertControllerStyle.alert)
let backBtn = UIAlertAction(title: "返回", style: UIAlertActionStyle.default) { (action) in
- let vc = Story.instantiateViewControllerWithIdentifier("LoginViewController", storyName: "My") as! LoginViewController
- vc.phoneNumber = self.phoneTextField.text!
- self.navigationController?.pushViewController(vc, animated: true)
+ NotificationCenter.default.post(name: Notification.Name(rawValue: MyPhoneNumberNotification.getPhoneNumber), object: nil, userInfo: ["phoneNumber":self.phoneTextField.text!])
+ self.navigationController?.popViewController(animated: true)
}
let showBtn = UIAlertAction(title: "进入首页", style: UIAlertActionStyle.default) { (action) in
- self.dismiss(animated: true) {
- //登录
- }
+ self.navigationController?.popToRootViewController(animated: true)
+ //登录
+ SVProgressHUD.show(withStatus: "登录中...")
+ HTTPServer.shared.login(completionHandler: { (str, error) in
+ SVProgressHUD.dismiss()
+ let json=JSON.fromString(str)
+ if let ret=json{
+ let er=ret["error"].string
+ if let errorStr=er{
+ let Strings=errorStr.components(separatedBy: ":")
+ if Strings.count >= 2 {
+ switch Strings[1] {
+ //用户关联多个身份,请使用学事号登录:100
+ case "101"://用户认证身份不存在:101
+ appDelegate.window!.makeToast("用户认证身份不存在,请进行账号激活。")
+ break
+ //用户帐号或密码错误:102
+ case "103":// 用户不存在:103
+ appDelegate.window!.makeToast("该号码不存在,请联系客服400-826-2468")
+ break
+ default:
+ appDelegate.window!.makeToast(errorStr)
+ break
+ }
+ }else{
+ appDelegate.window!.makeToast(errorStr)
+ }
+ }else if ret["access_token"].stringValue != ""{
+ AccountManager.shared.setTokenInfo(tokenInfo: ret)
+ AccountManager.shared.saveToken(tokenInfo: ret)
+ AccountManager.shared.refreshUserInfo(self.phoneTextField.text!, completionHandler: { (finish) in
+ if finish{
+ let ID=AccountManager.shared.rawUserInfo!.contentData()["userid"].stringValue
+ YXMessageManager.share.loginWithYX(account: ID, token: ID.md5()) { (success) in
+ SVProgressHUD.dismiss()
+ if !success {
+ AccountManager.shared.logOut()
+ appDelegate.window!.makeToast("聊天服务登录失败,请连接网络重试")
+ }else{
+ //云信登录成功
+ self.dismiss(animated: true, completion: nil)
+ }
+ }
+ }else{
+ appDelegate.window!.makeToast("身份获取失败")
+ SVProgressHUD.dismiss()
+ }
+ })
+ }else{
+ SVProgressHUD.dismiss()
+ appDelegate.window!.makeToast("登录失败,请稍后重试")
+ }
+ }else{
+ SVProgressHUD.dismiss()
+ appDelegate.window!.makeToast("登录失败")
+ }
+ }, phone: self.phoneTextField.text!, password: self.passwordTextField.text!)
}
alertVC.addAction(backBtn)
alertVC.addAction(showBtn)
@@ -135,8 +189,7 @@ class RegisterViewController: UIViewController,UITextFieldDelegate {
// MARK: - 登录页面跳转
@IBAction func loginAction(_ sender: UIButton) {
- let vc = Story.instantiateViewControllerWithIdentifier("LoginViewController", storyName: "My") as! LoginViewController
- self.navigationController?.pushViewController(vc, animated: true)
+ self.navigationController?.popViewController(animated: true)
}
diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/my/Model/MyViewControllerModel.swift b/ParentAssistant/ParentAssistant/Classes/controllers/my/Model/MyViewControllerModel.swift
index 3682a63..2dca834 100644
--- a/ParentAssistant/ParentAssistant/Classes/controllers/my/Model/MyViewControllerModel.swift
+++ b/ParentAssistant/ParentAssistant/Classes/controllers/my/Model/MyViewControllerModel.swift
@@ -20,3 +20,6 @@ public enum MyType: Int {
case null
case unknown
}
+class MyPhoneNumberNotification: NSObject {
+ static let getPhoneNumber = "ReceivePhoneNumber"
+}
diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/report/View/ReportHeaderView.xib b/ParentAssistant/ParentAssistant/Classes/controllers/report/View/ReportHeaderView.xib
index 0067893..12143ee 100644
--- a/ParentAssistant/ParentAssistant/Classes/controllers/report/View/ReportHeaderView.xib
+++ b/ParentAssistant/ParentAssistant/Classes/controllers/report/View/ReportHeaderView.xib
@@ -20,7 +20,7 @@
-
+
@@ -30,7 +30,7 @@
-
+
@@ -40,7 +40,7 @@
-
+
diff --git a/ParentAssistant/ParentAssistant/Classes/util/utils.swift b/ParentAssistant/ParentAssistant/Classes/util/utils.swift
index 7a8e48e..9e9df33 100644
--- a/ParentAssistant/ParentAssistant/Classes/util/utils.swift
+++ b/ParentAssistant/ParentAssistant/Classes/util/utils.swift
@@ -571,10 +571,10 @@ extension UIViewController{
func configTheme(){
self.navigationItem.title=self.navigationController?.title
self.navigationController?.navigationBar.barTintColor=Theme.topBarColor()
- self.navigationController?.navigationBar.tintColor=UIColor.black
+ self.navigationController?.navigationBar.tintColor=UIColor.white
self.navigationController?.navigationBar.isTranslucent=false
let textAttributes = NSMutableDictionary(capacity:1)
- textAttributes.setObject(UIColor.black, forKey: NSAttributedStringKey.foregroundColor as NSCopying)
+ textAttributes.setObject(UIColor.white, forKey: NSAttributedStringKey.foregroundColor as NSCopying)
self.navigationController?.navigationBar.titleTextAttributes=textAttributes as! [AnyHashable: Any] as? [NSAttributedStringKey : Any]
}
///套上UINavigationController
diff --git a/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/evaluation/evaluation_icon_pushDown.imageset/Contents.json b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/evaluation/evaluation_icon_pushDown.imageset/Contents.json
index 3f0f458..6040c0d 100644
--- a/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/evaluation/evaluation_icon_pushDown.imageset/Contents.json
+++ b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/evaluation/evaluation_icon_pushDown.imageset/Contents.json
@@ -6,7 +6,7 @@
},
{
"idiom" : "universal",
- "filename" : "下拉.png",
+ "filename" : "down.png",
"scale" : "2x"
},
{
diff --git a/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/evaluation/evaluation_icon_pushDown.imageset/down.png b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/evaluation/evaluation_icon_pushDown.imageset/down.png
new file mode 100644
index 0000000..8183b2d
Binary files /dev/null and b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/evaluation/evaluation_icon_pushDown.imageset/down.png differ
diff --git a/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/evaluation/evaluation_icon_pushDown.imageset/下拉.png b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/evaluation/evaluation_icon_pushDown.imageset/下拉.png
deleted file mode 100644
index 10fe0b4..0000000
Binary files a/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/evaluation/evaluation_icon_pushDown.imageset/下拉.png and /dev/null differ
diff --git a/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/my/my_defphoto.imageset/Contents.json b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/my/my_defphoto.imageset/Contents.json
new file mode 100644
index 0000000..15fe293
--- /dev/null
+++ b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/my/my_defphoto.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "filename" : "未登录.png",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
diff --git a/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/my/my_defphoto.imageset/未登录.png b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/my/my_defphoto.imageset/未登录.png
new file mode 100644
index 0000000..cdef7e5
Binary files /dev/null and b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/my/my_defphoto.imageset/未登录.png differ
diff --git a/ParentAssistant/ParentAssistant/Supporting Files/Base.lproj/Main.storyboard b/ParentAssistant/ParentAssistant/Supporting Files/Base.lproj/Main.storyboard
index fd15f93..69e62dc 100644
--- a/ParentAssistant/ParentAssistant/Supporting Files/Base.lproj/Main.storyboard
+++ b/ParentAssistant/ParentAssistant/Supporting Files/Base.lproj/Main.storyboard
@@ -50,7 +50,7 @@
-
+
@@ -64,10 +64,11 @@
-
-
+
+
+
@@ -79,15 +80,24 @@
+
+
+
+
+
+
-
-
+
+
+
+
+
-
+
@@ -121,21 +131,31 @@
-
+
+
+
+
+
+
+
+
-
-
+
+
+
+
-
+
+
@@ -245,9 +265,6 @@
-
-
-
@@ -255,17 +272,27 @@
+
+
+
+
+
+
+
+
+
+
@@ -290,9 +317,6 @@
-
-
-
@@ -300,17 +324,27 @@
+
+
+
+
+
+
+
+
+
+
@@ -334,9 +368,6 @@
-
-
-
@@ -344,6 +375,12 @@
+
+
+
+
+
+
@@ -353,7 +390,11 @@
+
+
+
+
@@ -414,23 +455,33 @@
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -1629,7 +1680,7 @@
-
+
@@ -2050,7 +2101,7 @@
-
+
@@ -2087,15 +2138,18 @@
-
+
-
+
+
+
+
@@ -2153,6 +2207,10 @@
+
+
+
+
@@ -2174,6 +2232,7 @@
+
--
libgit2 0.21.0