Commit c725fa81824ff3e8deb9c61ee3e77d62e807f2c2

Authored by 左丞
2 parents 9571367f 2a5f317e
Exists in parentassistant

Merge branch 'parentassistant' of http://git.shunzhi.net/iosgroup/parentassistan…

…t into parentassistant
ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
ParentAssistant/ParentAssistant/AppDelegate.swift
@@ -73,7 +73,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { @@ -73,7 +73,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
73 httpJsonResule(jsonString: str, error: error, successHandler: { (json) in 73 httpJsonResule(jsonString: str, error: error, successHandler: { (json) in
74 if json["status"] == 1 && error == nil{ 74 if json["status"] == 1 && error == nil{
75 if json.contentData().arrayValue.count>0 { 75 if json.contentData().arrayValue.count>0 {
76 - NSLog("************\(HTTPServer.HOSTImage+json.contentData().arrayValue[0]["fileSrc"].stringValue.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!)")  
77 let imageResource = ZLaunchAdImageResourceConfigure() 76 let imageResource = ZLaunchAdImageResourceConfigure()
78 imageResource.imageNameOrImageURL = HTTPServer.HOSTImage+json.contentData().arrayValue[0]["fileSrc"].stringValue.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)! 77 imageResource.imageNameOrImageURL = HTTPServer.HOSTImage+json.contentData().arrayValue[0]["fileSrc"].stringValue.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
79 imageResource.imageDuration = 5 78 imageResource.imageDuration = 5
@@ -102,7 +101,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { @@ -102,7 +101,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
102 var images:[String] = [] 101 var images:[String] = []
103 if json.contentData().arrayValue.count>0 { 102 if json.contentData().arrayValue.count>0 {
104 for item in json.contentData().arrayValue { 103 for item in json.contentData().arrayValue {
105 - NSLog("************\(HTTPServer.HOSTImage+item["fileSrc"].stringValue.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!)"); images.append(HTTPServer.HOSTImage+item["fileSrc"].stringValue.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!) 104 + images.append(HTTPServer.HOSTImage+item["fileSrc"].stringValue.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!)
106 } 105 }
107 LaunchIntroductionView.shared(withImages: images, buttonImage: "icon_getin", buttonFrame: CGRect(x: getScreenWidth()/2-551/4, y: getScreenHeight()-150, width: 551/2, height: 45)) 106 LaunchIntroductionView.shared(withImages: images, buttonImage: "icon_getin", buttonFrame: CGRect(x: getScreenWidth()/2-551/4, y: getScreenHeight()-150, width: 551/2, height: 45))
108 } 107 }
ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyViewController.swift
@@ -49,7 +49,11 @@ class MyViewController: UIViewController { @@ -49,7 +49,11 @@ class MyViewController: UIViewController {
49 // MARK: - 页面将要显示时隐藏navigationbar显示自定义的顶部view 49 // MARK: - 页面将要显示时隐藏navigationbar显示自定义的顶部view
50 override func viewWillAppear(_ animated: Bool) { 50 override func viewWillAppear(_ animated: Bool) {
51 super.viewWillAppear(animated) 51 super.viewWillAppear(animated)
52 - self.navigationController?.setNavigationBarHidden(true, animated: true) 52 + if self.tabBarController?.selectedIndex == 3 {
  53 + self.navigationController?.setNavigationBarHidden(true, animated: true)
  54 + }else{
  55 + self.navigationController?.isNavigationBarHidden = true
  56 + }
53 // MARK: - 设置是否登录及个人信息 57 // MARK: - 设置是否登录及个人信息
54 setupCurrentInfo() 58 setupCurrentInfo()
55 } 59 }
@@ -181,7 +185,7 @@ extension MyViewController: UITableViewDelegate,UITableViewDataSource{ @@ -181,7 +185,7 @@ extension MyViewController: UITableViewDelegate,UITableViewDataSource{
181 return 0 185 return 0
182 } 186 }
183 //"zy105428" 187 //"zy105428"
184 - if AccountManager.shared.isOnline() && AccountManager.shared.id()=="zy10542" && (indexPath.row == 1 || indexPath.row == 2){//隐藏支付相关功能 188 + if AccountManager.shared.isOnline() && AccountManager.shared.id()=="zy105428" && (indexPath.row == 1 || indexPath.row == 2){//隐藏支付相关功能
185 return 0 189 return 0
186 }else{ 190 }else{
187 return 44 191 return 44
ParentAssistant/ParentAssistant/Classes/controllers/report/View/LineChartView.swift
@@ -29,9 +29,11 @@ class LineChartView: UIView { @@ -29,9 +29,11 @@ class LineChartView: UIView {
29 private let xMoveLayer = CAShapeLayer() 29 private let xMoveLayer = CAShapeLayer()
30 //纵坐标Lab数组 30 //纵坐标Lab数组
31 private var yMoveLaArr = Array<UILabel>() 31 private var yMoveLaArr = Array<UILabel>()
32 -  
33 -  
34 - 32 + //折线图数据数组
  33 + private var dateArr = Array<Array<Int>>()
  34 + //显示的数字
  35 + var yLabArray = Array<UILabel>()
  36 +
35 override init(frame: CGRect) { 37 override init(frame: CGRect) {
36 super.init(frame: frame) 38 super.init(frame: frame)
37 print("frame==\(frame)") 39 print("frame==\(frame)")
@@ -68,7 +70,7 @@ class LineChartView: UIView { @@ -68,7 +70,7 @@ class LineChartView: UIView {
68 private func drawX() { 70 private func drawX() {
69 let xWidth = (screenWidth-20)/CGFloat(yCount) 71 let xWidth = (screenWidth-20)/CGFloat(yCount)
70 for index in 0..<xCount { 72 for index in 0..<xCount {
71 - let nameBtn = UIButton.init(frame: CGRect.init(x: xWidth+CGFloat(index)*xWidth, y: self.bounds.height-70, width: 40, height: 20)) 73 + let nameBtn = UIButton.init(frame: CGRect.init(x: xWidth+CGFloat(index)*xWidth, y: self.bounds.height-70, width: 40, height: 25))
72 nameBtn.setTitle(xLabArr[index], for: UIControlState.normal) 74 nameBtn.setTitle(xLabArr[index], for: UIControlState.normal)
73 nameBtn.setTitleColor(UIColorWithRGB(R: 119, G: 119, B: 119), for: UIControlState.normal) 75 nameBtn.setTitleColor(UIColorWithRGB(R: 119, G: 119, B: 119), for: UIControlState.normal)
74 nameBtn.titleLabel!.textAlignment = .center 76 nameBtn.titleLabel!.textAlignment = .center
@@ -97,14 +99,18 @@ class LineChartView: UIView { @@ -97,14 +99,18 @@ class LineChartView: UIView {
97 self.layer.addSublayer(drawLayer) 99 self.layer.addSublayer(drawLayer)
98 drawLayer.setNeedsDisplay() 100 drawLayer.setNeedsDisplay()
99 101
  102 + dateArr.append(point)
  103 +
100 } 104 }
101 - //MARK: - 画竖线 105 + //MARK: - 点击横坐标
102 @objc func touchXAction(tap:UIButton){ 106 @objc func touchXAction(tap:UIButton){
103 107
104 let index = tap.tag 108 let index = tap.tag
105 - 109 +
  110 +
106 if btnTouch != index { 111 if btnTouch != index {
107 112
  113 + //竖虚线
108 lineLayer.strokeColor = UIColorWithRGB(R: 92, G: 145, B: 230).cgColor 114 lineLayer.strokeColor = UIColorWithRGB(R: 92, G: 145, B: 230).cgColor
109 lineLayer.lineWidth = 1 115 lineLayer.lineWidth = 1
110 let arr = [5,5] 116 let arr = [5,5]
@@ -112,6 +118,7 @@ class LineChartView: UIView { @@ -112,6 +118,7 @@ class LineChartView: UIView {
112 lineLayer.lineDashPattern = arr as [NSNumber] 118 lineLayer.lineDashPattern = arr as [NSNumber]
113 self.layer.addSublayer(lineLayer) 119 self.layer.addSublayer(lineLayer)
114 120
  121 + //X轴下划线
115 let movePath = CGMutablePath() 122 let movePath = CGMutablePath()
116 movePath.move(to: CGPoint.init(x: xCenterArr[index], y: yCenterArr[0])) 123 movePath.move(to: CGPoint.init(x: xCenterArr[index], y: yCenterArr[0]))
117 movePath.addLine(to: CGPoint.init(x: xCenterArr[index], y: 10+5*(self.bounds.height-60)/CGFloat(yCount))) 124 movePath.addLine(to: CGPoint.init(x: xCenterArr[index], y: 10+5*(self.bounds.height-60)/CGFloat(yCount)))
@@ -121,17 +128,40 @@ class LineChartView: UIView { @@ -121,17 +128,40 @@ class LineChartView: UIView {
121 xMoveLayer.lineWidth = 2 128 xMoveLayer.lineWidth = 2
122 self.layer.addSublayer(xMoveLayer) 129 self.layer.addSublayer(xMoveLayer)
123 let movePath2 = CGMutablePath() 130 let movePath2 = CGMutablePath()
124 - movePath2.move(to: CGPoint.init(x: xCenterArr[index]-15, y: self.bounds.height-50))  
125 - movePath2.addLine(to: CGPoint.init(x: xCenterArr[index]+15, y: self.bounds.height-50)) 131 + movePath2.move(to: CGPoint.init(x: xCenterArr[index]-15, y: self.bounds.height-45))
  132 + movePath2.addLine(to: CGPoint.init(x: xCenterArr[index]+15, y: self.bounds.height-45))
126 xMoveLayer.path = movePath2 133 xMoveLayer.path = movePath2
127 134
  135 + if yLabArray.count == dateArr.count {
  136 + for label in yLabArray {
  137 + label.removeFromSuperview()
  138 + }
  139 + }
  140 + yLabArray.removeAll()
  141 + //数字显示
  142 + for i in 0..<dateArr.count {
  143 + let arr = dateArr[i]
  144 + //y坐标数值
  145 + let y = arr[index]
  146 + let yLab = yMoveLaArr[GPA-y]
  147 + var rect = yLab.frame
  148 + rect.origin.x = xCenterArr[index]+10
  149 +
  150 + let newLab = UILabel()
  151 + newLab.text = yLab.text
  152 + newLab.textColor = yLab.textColor
  153 + newLab.font = yLab.font
  154 + newLab.frame = rect
  155 + self.addSubview(newLab)
  156 + yLabArray.append(newLab)
  157 + }
  158 + }else{
  159 + print(yLabArray)
128 } 160 }
129 btnTouch = index 161 btnTouch = index
130 162
131 163
132 } 164 }
133 - //MARK: - 特定横坐标颜色,下划线  
134 -  
135 //转换y坐标 165 //转换y坐标
136 func swichPoint(arr:Array<Int>)->Array<Int>{ 166 func swichPoint(arr:Array<Int>)->Array<Int>{
137 var array = Array<Int>() 167 var array = Array<Int>()
ParentAssistant/ParentAssistant/NIM/YXMessageManager.swift
@@ -105,42 +105,8 @@ class YXMessageManager: NSObject,NIMLoginManagerDelegate,NIMSystemNotificationMa @@ -105,42 +105,8 @@ class YXMessageManager: NSObject,NIMLoginManagerDelegate,NIMSystemNotificationMa
105 if let info=JSON.fromString(notification.content) { 105 if let info=JSON.fromString(notification.content) {
106 if info["type"].stringValue=="attach"{//群发通知 106 if info["type"].stringValue=="attach"{//群发通知
107 let attachItem = NSManagedObject.creatWith(identifier: "Message") as! Message 107 let attachItem = NSManagedObject.creatWith(identifier: "Message") as! Message
108 -// if info["fileInfos"].arrayValue != [] {  
109 -// var array:[String]=[]  
110 -// for j in info["fileInfos"].arrayValue {  
111 -// _ = File.newFileByAttach(j)  
112 -// array.append(j["guid"].stringValue)  
113 -// }  
114 -// var fileInfo=Dictionary<String,AnyObject>()  
115 -// fileInfo["fileIds"]=array as AnyObject  
116 -// attachItem.title=(JSON(fileInfo).rawString() ?? "{}")  
117 -// }  
118 attachItem.date=Date(timeIntervalSince1970: notification.timestamp) 108 attachItem.date=Date(timeIntervalSince1970: notification.timestamp)
119 -// attachItem.msgId=info["msgId"].stringValue  
120 -// attachItem.senderId=notification.sender  
121 attachItem.content = info["content"].stringValue 109 attachItem.content = info["content"].stringValue
122 -// attachItem.files=info["files"].stringValue  
123 -// if info["imageHeight"] != "" {  
124 -// var sizeInfo=Dictionary<String,AnyObject>()  
125 -// sizeInfo["imageHeight"]=info["imageHeight"].rawValue as AnyObject  
126 -// sizeInfo["imageWidth"]=info["imageWidth"].rawValue as AnyObject  
127 -// attachItem.userPortrait=JSON(sizeInfo).rawString() ?? "{}"  
128 -// }  
129 -// attachItem.sessionId="attach"  
130 -// if info["isSelectedCityCard"]==true {  
131 -// attachItem.type=4  
132 -// }else{  
133 -// attachItem.type=3  
134 -// }  
135 -// attachItem.isReceive=1 //unread是否需要加一  
136 -// attachItem.isGroup=info["isGroup"].intValue as NSNumber //用来在消息首页是否需要拼合图片  
137 -// if let name=Contact.findTeacherByUserId(notification.sender!)?.name{  
138 -// attachItem.fromName=name  
139 -// }else if let name=Contact.findByUserid(notification.sender!)?.name{  
140 -// attachItem.fromName=name  
141 -// }else{  
142 -// attachItem.fromName="老师"  
143 -// }  
144 attachItem.ownId = AccountManager.shared.userid 110 attachItem.ownId = AccountManager.shared.userid
145 attachItem.save() 111 attachItem.save()
146 NotificationCenter.default.post(name: Notification.Name(rawValue: MessageNotification.receiveMessage), object: nil, userInfo: nil) 112 NotificationCenter.default.post(name: Notification.Name(rawValue: MessageNotification.receiveMessage), object: nil, userInfo: nil)
ParentAssistant/ParentAssistant/Supporting Files/Info.plist
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
19 <key>CFBundleShortVersionString</key> 19 <key>CFBundleShortVersionString</key>
20 <string>1.0.0</string> 20 <string>1.0.0</string>
21 <key>CFBundleVersion</key> 21 <key>CFBundleVersion</key>
22 - <string>1</string> 22 + <string>5</string>
23 <key>LSRequiresIPhoneOS</key> 23 <key>LSRequiresIPhoneOS</key>
24 <true/> 24 <true/>
25 <key>NSAppTransportSecurity</key> 25 <key>NSAppTransportSecurity</key>
@@ -28,7 +28,9 @@ @@ -28,7 +28,9 @@
28 <true/> 28 <true/>
29 </dict> 29 </dict>
30 <key>NSLocationWhenInUseUsageDescription</key> 30 <key>NSLocationWhenInUseUsageDescription</key>
31 - <string>"需要您的同意,才能在使用期间访问位置"</string> 31 + <string>&quot;需要您的同意,才能在使用期间访问位置&quot;</string>
  32 + <key>NSMicrophoneUsageDescription</key>
  33 + <string>访问麦克风</string>
32 <key>NSPhotoLibraryUsageDescription</key> 34 <key>NSPhotoLibraryUsageDescription</key>
33 <string>你可以获取本地照片</string> 35 <string>你可以获取本地照片</string>
34 <key>UILaunchStoryboardName</key> 36 <key>UILaunchStoryboardName</key>