Commit 2843d18bb3d80822964c680567c6a58e99639a4b

Authored by 葛建军
2 parents 7d617a95 9f390667
Exists in newLive

Merge branch 'newLive' of http://git.shunzhi.net/iosgroup/newlive into newLive

YouerLiveVideo/YouerLiveVideo/controllers/User/UserEditViewController.swift
@@ -23,13 +23,26 @@ class UserEditViewController: UIViewController ,UIImagePickerControllerDelegate, @@ -23,13 +23,26 @@ class UserEditViewController: UIViewController ,UIImagePickerControllerDelegate,
23 } 23 }
24 24
25 func setContentArr(){ 25 func setContentArr(){
26 - var ident = ""  
27 - if user.isParent(){  
28 - ident = "家长"  
29 - }else{  
30 - ident = "教师" 26 + contentArr = [user.name(),user.phone(),getIdent(),user.schoolName()]
  27 + }
  28 +
  29 + func getIdent()->String{
  30 + switch user.roletype() {
  31 + case 1:
  32 + return "学校管理员"
  33 + case 2:
  34 + return "教师"
  35 + case 3:
  36 + return "家长"
  37 + case 4:
  38 + return "学生"
  39 + case 5:
  40 + return "游客"
  41 + case 6:
  42 + return "教研员"
  43 + default:
  44 + return ""
31 } 45 }
32 - contentArr = [user.name(),user.phone(),ident,user.schoolName()]  
33 } 46 }
34 47
35 override func viewWillAppear(_ animated: Bool) { 48 override func viewWillAppear(_ animated: Bool) {
YouerLiveVideo/YouerLiveVideo/util/account.swift
@@ -77,12 +77,20 @@ class AccountManager{ @@ -77,12 +77,20 @@ class AccountManager{
77 return "" 77 return ""
78 } 78 }
79 79
  80 + func schoolid()->String{
  81 + if let info=rawUserInfo{
  82 + return info.contentData()["schoolid"].stringValue
  83 + }
  84 + return ""
  85 + }
  86 +
80 func schoolName()->String{ 87 func schoolName()->String{
81 if let info=rawUserInfo{ 88 if let info=rawUserInfo{
82 - return info.contentData()["f_SchoolName"].stringValue 89 + return info.contentData()["schoolname"].stringValue
83 } 90 }
84 return "" 91 return ""
85 } 92 }
  93 +
86 94
87 func isParent()->Bool{ 95 func isParent()->Bool{
88 if let info=rawUserInfo{ 96 if let info=rawUserInfo{