Commit d2bf43ab553fd77c3e7f5b14c0b706e2b76f1892
1 parent
55ec444b
Exists in
parentassistant
广告页
Showing
18 changed files
with
423 additions
and
47 deletions
 
Show diff stats
ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj
| ... | ... | @@ -98,6 +98,7 @@ | 
| 98 | 98 | BFBC06CC2063AE8900CCFAFF /* ZLaunchAdWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBC06C22063AE8800CCFAFF /* ZLaunchAdWindow.swift */; }; | 
| 99 | 99 | BFBC06CD2063AE8900CCFAFF /* ZLaunchImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBC06C32063AE8800CCFAFF /* ZLaunchImageView.swift */; }; | 
| 100 | 100 | BFBC06CE2063AE8900CCFAFF /* ZLaunchLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBC06C42063AE8800CCFAFF /* ZLaunchLog.swift */; }; | 
| 101 | + BFBC06D22064FDDE00CCFAFF /* LaunchIntroductionView.m in Sources */ = {isa = PBXBuildFile; fileRef = BFBC06D12064FDDE00CCFAFF /* LaunchIntroductionView.m */; }; | |
| 101 | 102 | BFCED888205280B700055373 /* MyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFCED887205280B700055373 /* MyViewController.swift */; }; | 
| 102 | 103 | BFCED88B20528DE700055373 /* MyViewControllerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFCED88A20528DE700055373 /* MyViewControllerModel.swift */; }; | 
| 103 | 104 | BFEAAAA7205118370072FAAF /* TabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFEAAAA6205118370072FAAF /* TabBarController.swift */; }; | 
| ... | ... | @@ -240,6 +241,8 @@ | 
| 240 | 241 | BFBC06C22063AE8800CCFAFF /* ZLaunchAdWindow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ZLaunchAdWindow.swift; sourceTree = "<group>"; }; | 
| 241 | 242 | BFBC06C32063AE8800CCFAFF /* ZLaunchImageView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ZLaunchImageView.swift; sourceTree = "<group>"; }; | 
| 242 | 243 | BFBC06C42063AE8800CCFAFF /* ZLaunchLog.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ZLaunchLog.swift; sourceTree = "<group>"; }; | 
| 244 | + BFBC06D02064FDDE00CCFAFF /* LaunchIntroductionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LaunchIntroductionView.h; sourceTree = "<group>"; }; | |
| 245 | + BFBC06D12064FDDE00CCFAFF /* LaunchIntroductionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LaunchIntroductionView.m; sourceTree = "<group>"; }; | |
| 243 | 246 | BFCED887205280B700055373 /* MyViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyViewController.swift; sourceTree = "<group>"; }; | 
| 244 | 247 | BFCED88A20528DE700055373 /* MyViewControllerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyViewControllerModel.swift; sourceTree = "<group>"; }; | 
| 245 | 248 | BFEAAAA6205118370072FAAF /* TabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarController.swift; sourceTree = "<group>"; }; | 
| ... | ... | @@ -601,6 +604,15 @@ | 
| 601 | 604 | path = ZLaunchAd; | 
| 602 | 605 | sourceTree = "<group>"; | 
| 603 | 606 | }; | 
| 607 | + BFBC06CF2064FDDE00CCFAFF /* LaunchIntroduction */ = { | |
| 608 | + isa = PBXGroup; | |
| 609 | + children = ( | |
| 610 | + BFBC06D02064FDDE00CCFAFF /* LaunchIntroductionView.h */, | |
| 611 | + BFBC06D12064FDDE00CCFAFF /* LaunchIntroductionView.m */, | |
| 612 | + ); | |
| 613 | + path = LaunchIntroduction; | |
| 614 | + sourceTree = "<group>"; | |
| 615 | + }; | |
| 604 | 616 | BFCED886205280B700055373 /* Controller */ = { | 
| 605 | 617 | isa = PBXGroup; | 
| 606 | 618 | children = ( | 
| ... | ... | @@ -642,6 +654,7 @@ | 
| 642 | 654 | BFEAAAAC205257270072FAAF /* libs */ = { | 
| 643 | 655 | isa = PBXGroup; | 
| 644 | 656 | children = ( | 
| 657 | + BFBC06CF2064FDDE00CCFAFF /* LaunchIntroduction */, | |
| 645 | 658 | BFBC06BA2063AE8800CCFAFF /* ZLaunchAd */, | 
| 646 | 659 | 5980BF5F2061048A00F4A35E /* LZCityPickerClass */, | 
| 647 | 660 | BFEAAAAD205257460072FAAF /* LXCalendar */, | 
| ... | ... | @@ -910,6 +923,7 @@ | 
| 910 | 923 | BF7A4C36204CD55300460463 /* ViewController.swift in Sources */, | 
| 911 | 924 | BFEAAAA9205248AC0072FAAF /* TaskPresentationTableViewCell.swift in Sources */, | 
| 912 | 925 | 5980BF6A2061048A00F4A35E /* LZPickerModel.m in Sources */, | 
| 926 | + BFBC06D22064FDDE00CCFAFF /* LaunchIntroductionView.m in Sources */, | |
| 913 | 927 | BFEAAAA7205118370072FAAF /* TabBarController.swift in Sources */, | 
| 914 | 928 | BF67F3C020590A2F002FDC61 /* SwiftyJSON.swift in Sources */, | 
| 915 | 929 | 599364ED204E62E700C8B371 /* InformationViewController.swift in Sources */, | ... | ... | 
ParentAssistant/ParentAssistant/AppDelegate.swift
| ... | ... | @@ -38,8 +38,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate { | 
| 38 | 38 | }) | 
| 39 | 39 | } | 
| 40 | 40 | setShareSDKSetting() | 
| 41 | + let tabbarVC = Story.instantiateViewControllerWithIdentifier("TabBarController", storyName: "Main") as! TabBarController | |
| 42 | + self.window?.rootViewController = tabbarVC | |
| 43 | + self.window?.makeKeyAndVisible() | |
| 41 | 44 | // 加载广告 | 
| 42 | - requestAD() | |
| 45 | + requestAD(vc: tabbarVC) | |
| 43 | 46 | return true | 
| 44 | 47 | } | 
| 45 | 48 | //设置云信的appkey | 
| ... | ... | @@ -60,33 +63,61 @@ class AppDelegate: UIResponder, UIApplicationDelegate { | 
| 60 | 63 | YXMessageManager.share.addYXDelegate() | 
| 61 | 64 | } | 
| 62 | 65 | // MARK: - 加载广告页 | 
| 63 | - func requestAD() -> Void { | |
| 66 | + func requestAD(vc:TabBarController) -> Void { | |
| 64 | 67 | var position:Int = 0 | 
| 65 | - if Setting.getString("isFirst") == "true" {//是否是第一次下载 | |
| 68 | + if Setting.getString("isFirst") == "\(AppDelegate.version())" {//是否是第一次下载 | |
| 66 | 69 | position = 1 | 
| 70 | + let adView = ZLaunchAd.create() | |
| 71 | + //position 广告位置0-首次广告位1-开屏广告位2-资讯首页3-频道首页4-频道内容5-文章内容页 AccountManager.shared.address | |
| 72 | + HTTPServer.shared.getAds(["position":position as AnyObject], completionHandler: { (str, error) in | |
| 73 | + httpJsonResule(jsonString: str, error: error, successHandler: { (json) in | |
| 74 | + if json["status"] == 1 && error == nil{ | |
| 75 | + if json.contentData().arrayValue.count>0 { | |
| 76 | + let imageResource = ZLaunchAdImageResourceConfigure() | |
| 77 | + imageResource.imageNameOrImageURL = HTTPServer.HOSTImage+json.contentData().arrayValue[0]["fileSrc"].stringValue.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)! | |
| 78 | + imageResource.imageDuration = 5 | |
| 79 | + imageResource.imageFrame = UIScreen.main.bounds | |
| 80 | + adView.setImageResource(imageResource, action: { | |
| 81 | + /// 广告点击 | |
| 82 | + }) | |
| 83 | + } | |
| 84 | + } | |
| 85 | + }, failHandler: { (error) in | |
| 86 | + let imageResource = ZLaunchAdImageResourceConfigure() | |
| 87 | + imageResource.imageNameOrImageURL = "http://chatm-icon.oss-cn-beijing.aliyuncs.com/pic/pic_20170725104352981.jpg" | |
| 88 | + imageResource.imageDuration = 5 | |
| 89 | + imageResource.imageFrame = UIScreen.main.bounds | |
| 90 | + adView.setImageResource(imageResource, action: { | |
| 91 | + /// 广告点击 | |
| 92 | + }) | |
| 93 | + | |
| 94 | + }) | |
| 95 | + }) | |
| 67 | 96 | }else{ | 
| 97 | +// Thread.sleep(forTimeInterval: 5.0)//延长启动页面10秒 | |
| 98 | + let view = UIView(frame: CGRect(x: 0, y: 0, width: getScreenWidth(), height: getScreenHeight())) | |
| 99 | + view.backgroundColor = UIColor.red | |
| 100 | + vc.view.addSubview(view) | |
| 68 | 101 | position = 0 | 
| 69 | - Setting.save("true", forKey: "isFirst") | |
| 70 | - } | |
| 71 | - //position 广告位置0-首次广告位1-开屏广告位2-资讯首页3-频道首页4-频道内容5-文章内容页 AccountManager.shared.address | |
| 72 | - HTTPServer.shared.getAds(["position":position as AnyObject,"areaName":"" as AnyObject], completionHandler: { (str, error) in | |
| 73 | - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in | |
| 74 | - if json["status"] == 1 && error == nil{ | |
| 75 | - if json.contentData().arrayValue.count>0 { | |
| 76 | - let adView = ZLaunchAd.create() | |
| 77 | - let imageResource = ZLaunchAdImageResourceConfigure() | |
| 78 | - imageResource.imageNameOrImageURL = HTTPServer.HOSTImage+json.contentData().arrayValue[0]["fileSrc"].stringValue | |
| 79 | - imageResource.imageDuration = 5 | |
| 80 | - imageResource.imageFrame = UIScreen.main.bounds | |
| 81 | - adView.setImageResource(imageResource, action: { | |
| 82 | - /// 广告点击 | |
| 83 | - }) | |
| 102 | + let _ = Setting.save("\(AppDelegate.version())", forKey: "isFirst") | |
| 103 | + //position 广告位置0-首次广告位1-开屏广告位2-资讯首页3-频道首页4-频道内容5-文章内容页 AccountManager.shared.address | |
| 104 | + HTTPServer.shared.getAds(["position":position as AnyObject], completionHandler: { (str, error) in | |
| 105 | + view.removeFromSuperview() | |
| 106 | + httpJsonResule(jsonString: str, error: error, successHandler: { (json) in | |
| 107 | + if json["status"] == 1 && error == nil{ | |
| 108 | + var images:[String] = [] | |
| 109 | + if json.contentData().arrayValue.count>0 { | |
| 110 | + for item in json.contentData().arrayValue { | |
| 111 | + NSLog("************\(HTTPServer.HOSTImage+item["fileSrc"].stringValue.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!)"); images.append(HTTPServer.HOSTImage+item["fileSrc"].stringValue.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!) | |
| 112 | + } | |
| 113 | + LaunchIntroductionView.shared(withImages: images, buttonImage: "icon_image", buttonFrame: CGRect(x: getScreenWidth()/2-551/4, y: getScreenHeight()-150, width: 551/2, height: 45)) | |
| 114 | + } | |
| 84 | 115 | } | 
| 85 | - } | |
| 86 | - }, failHandler: { (error) in | |
| 87 | - | |
| 116 | + }, failHandler: { (error) in | |
| 117 | + }) | |
| 88 | 118 | }) | 
| 89 | - }) | |
| 119 | + | |
| 120 | + } | |
| 90 | 121 | } | 
| 91 | 122 | // MARK: - 设置网络 | 
| 92 | 123 | @objc func networkStatusChange() { | ... | ... | 
ParentAssistant/ParentAssistant/Classes/controllers/Information/InformationViewController.swift
| ... | ... | @@ -31,7 +31,7 @@ class InformationViewController: UIViewController,UISearchBarDelegate { | 
| 31 | 31 | searchView.placeholder = "请输入搜索内容" | 
| 32 | 32 | searchView.showsCancelButton = false | 
| 33 | 33 | self.navigationItem.titleView = searchView | 
| 34 | - | |
| 34 | + self.configTheme() | |
| 35 | 35 | |
| 36 | 36 | } | 
| 37 | 37 | |
| ... | ... | @@ -182,8 +182,11 @@ class InformationViewController: UIViewController,UISearchBarDelegate { | 
| 182 | 182 | //点击资讯进入详情 | 
| 183 | 183 | func pushToInfoView(index:Int){ | 
| 184 | 184 | let vcs = Story.instantiateViewControllerWithIdentifier("JSViewController", storyName: "JS") as! JSViewController | 
| 185 | - vcs.webURL = (HTTPServer.HOSTWAP+"/InformationDetail.aspx?id="+"\(data.channelContent[index].id)"+"&areaname="+AccountManager.shared.address)//.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)! | |
| 186 | - | |
| 185 | + if data.channelContent[index].url != "" { | |
| 186 | + vcs.webURL = data.channelContent[index].url | |
| 187 | + }else{ | |
| 188 | + vcs.webURL = (HTTPServer.HOSTWAP+"/InformationDetail.aspx?id="+"\(data.channelContent[index].id)"+"&areaname="+AccountManager.shared.address).addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)! | |
| 189 | + } | |
| 187 | 190 | self.navigationController?.present(vcs.wrapWithNavigationController(), animated: true, completion: nil) | 
| 188 | 191 | } | 
| 189 | 192 | |
| ... | ... | @@ -262,7 +265,7 @@ extension InformationViewController:UICollectionViewDataSource,UICollectionViewD | 
| 262 | 265 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "contentCell", for: indexPath) as! ChannelCollectionViewCell | 
| 263 | 266 | cell.title.text = item.title | 
| 264 | 267 | cell.option.text = item.content | 
| 265 | - cell.optionNum.text = "\(item.talkNum)" | |
| 268 | + cell.optionNum.text = "\(item.lookNum)" | |
| 266 | 269 | cell.shareNum.text = "\(item.forwardingNum)" | 
| 267 | 270 | cell.picture.sd_setImage(with: URL(string: (HTTPServer.HOSTImage+item.image).addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!), placeholderImage: UIImage(named: "navigationBar_backgrounImage")) | 
| 268 | 271 | return cell | 
| ... | ... | @@ -283,10 +286,14 @@ extension InformationViewController:UICollectionViewDataSource,UICollectionViewD | 
| 283 | 286 | break | 
| 284 | 287 | default: | 
| 285 | 288 | let vcs = Story.instantiateViewControllerWithIdentifier("JSViewController", storyName: "JS") as! JSViewController | 
| 286 | - vcs.webURL = data.channelContent[indexPath.row].url//"\(HTTPServer.HOSTWAP!)/ParentOrderCenter.aspx?userid=\(AccountManager.shared.id())" | |
| 289 | + if data.channelContent[indexPath.row].url != "" { | |
| 290 | + vcs.webURL = data.channelContent[indexPath.row].url | |
| 291 | + }else{ | |
| 292 | + vcs.webURL = (HTTPServer.HOSTWAP+"/InformationDetail.aspx?id="+"\(data.channelContent[indexPath.row].id)"+"&areaname="+AccountManager.shared.address).addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)! | |
| 293 | + } | |
| 287 | 294 | self.navigationController?.present(vcs.wrapWithNavigationController(), animated: true, completion: nil) | 
| 288 | 295 | |
| 289 | - pushToInfoView(index: indexPath.row) | |
| 296 | +// pushToInfoView(index: indexPath.row) | |
| 290 | 297 | } | 
| 291 | 298 | } | 
| 292 | 299 | |
| ... | ... | @@ -407,6 +414,7 @@ class ChannelContentDemol: NSObject { | 
| 407 | 414 | var content:String=""// 资讯内容 , | 
| 408 | 415 | var forwardingNum:Int=0// 资讯转发数 , | 
| 409 | 416 | var talkNum:Int=0 // 评论数 , | 
| 417 | + var lookNum:Int = 0 //浏览数 | |
| 410 | 418 | var orderById:Int=0// 资讯排序 | 
| 411 | 419 | var isAds:Int=0// 是否为广告 1是广告 | 
| 412 | 420 | init(j:JSON){ | 
| ... | ... | @@ -417,6 +425,7 @@ class ChannelContentDemol: NSObject { | 
| 417 | 425 | content = j["content"].stringValue | 
| 418 | 426 | forwardingNum = j["forwardingNum"].intValue | 
| 419 | 427 | talkNum = j["talkNum"].intValue | 
| 428 | + lookNum = j["lookNum"].intValue | |
| 420 | 429 | orderById = j["orderById"].intValue | 
| 421 | 430 | isAds = j["isAds"].intValue | 
| 422 | 431 | } | ... | ... | 
ParentAssistant/ParentAssistant/Classes/controllers/Information/view/ChannelCollectionViewCell.xib
| ... | ... | @@ -38,25 +38,25 @@ | 
| 38 | 38 | <color key="textColor" red="0.27503338459999999" green="0.50970917940000005" blue="0.90092128520000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | 
| 39 | 39 | <nil key="highlightedColor"/> | 
| 40 | 40 | </label> | 
| 41 | - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="评论:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Lvp-kr-OuU"> | |
| 42 | - <rect key="frame" x="8" y="72" width="24" height="12"/> | |
| 41 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="浏览量:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Lvp-kr-OuU"> | |
| 42 | + <rect key="frame" x="8" y="72" width="34" height="12"/> | |
| 43 | 43 | <fontDescription key="fontDescription" type="system" pointSize="10"/> | 
| 44 | 44 | <color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> | 
| 45 | 45 | <nil key="highlightedColor"/> | 
| 46 | 46 | </label> | 
| 47 | 47 | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="30" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3KK-be-Vix"> | 
| 48 | - <rect key="frame" x="40" y="72" width="13" height="12"/> | |
| 48 | + <rect key="frame" x="50" y="72" width="13" height="12"/> | |
| 49 | 49 | <fontDescription key="fontDescription" type="system" pointSize="10"/> | 
| 50 | 50 | <color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> | 
| 51 | 51 | <nil key="highlightedColor"/> | 
| 52 | 52 | </label> | 
| 53 | - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="转发:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wMQ-5O-LNi"> | |
| 53 | + <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="转发:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wMQ-5O-LNi"> | |
| 54 | 54 | <rect key="frame" x="182" y="72" width="24" height="12"/> | 
| 55 | 55 | <fontDescription key="fontDescription" type="system" pointSize="10"/> | 
| 56 | 56 | <color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> | 
| 57 | 57 | <nil key="highlightedColor"/> | 
| 58 | 58 | </label> | 
| 59 | - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="15" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Dfn-o9-z6k"> | |
| 59 | + <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="15" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Dfn-o9-z6k"> | |
| 60 | 60 | <rect key="frame" x="214" y="72" width="11.5" height="12"/> | 
| 61 | 61 | <fontDescription key="fontDescription" type="system" pointSize="10"/> | 
| 62 | 62 | <color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> | ... | ... | 
ParentAssistant/ParentAssistant/Classes/controllers/evaluation/EvaluationViewController.swift
| ... | ... | @@ -229,7 +229,11 @@ class EvaluationViewController: UIViewController,CLLocationManagerDelegate,Selec | 
| 229 | 229 | return | 
| 230 | 230 | } | 
| 231 | 231 | let vcs = Story.instantiateViewControllerWithIdentifier("JSViewController", storyName: "JS") as! JSViewController | 
| 232 | + if activityArr[sender.tag-3000].toolUrl != "" { | |
| 232 | 233 | vcs.webURL = activityArr[sender.tag-3000].toolUrl | 
| 234 | + }else{ | |
| 235 | + vcs.webURL = (HTTPServer.HOSTWAP+"/InformationDetail.aspx?id="+"\(activityArr[sender.tag-3000].toolId)"+"&areaname="+AccountManager.shared.address).addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)! | |
| 236 | + } | |
| 233 | 237 | self.navigationController?.present(vcs.wrapWithNavigationController(), animated: true, completion: nil) | 
| 234 | 238 | } | 
| 235 | 239 | |
| ... | ... | @@ -267,7 +271,11 @@ extension EvaluationViewController:UICollectionViewDataSource,UICollectionViewDe | 
| 267 | 271 | |
| 268 | 272 | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { | 
| 269 | 273 | let vcs = Story.instantiateViewControllerWithIdentifier("JSViewController", storyName: "JS") as! JSViewController | 
| 270 | - vcs.webURL = toolArr[indexPath.row].toolUrl | |
| 274 | + if toolArr[indexPath.row].toolUrl != "" { | |
| 275 | + vcs.webURL = toolArr[indexPath.row].toolUrl | |
| 276 | + }else{ | |
| 277 | + vcs.webURL = (HTTPServer.HOSTWAP+"/InformationDetail.aspx?id="+"\(toolArr[indexPath.row].toolId)"+"&areaname="+AccountManager.shared.address).addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)! | |
| 278 | + } | |
| 271 | 279 | self.navigationController?.present(vcs.wrapWithNavigationController(), animated: true, completion: nil) | 
| 272 | 280 | } | 
| 273 | 281 | } | ... | ... | 
ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/LoginViewController.swift
| ... | ... | @@ -14,6 +14,7 @@ class LoginViewController: UIViewController,UITextFieldDelegate { | 
| 14 | 14 | @IBOutlet var phoneTextField: UITextField!//电话号码 | 
| 15 | 15 | @IBOutlet var passwordTextField: UITextField!//密码 | 
| 16 | 16 | @IBOutlet var passwordHiddenBtn: UIButton!//查看密码按钮 | 
| 17 | + @IBOutlet var loginBtn: UIButton! | |
| 17 | 18 | override func viewDidLoad() { | 
| 18 | 19 | super.viewDidLoad() | 
| 19 | 20 | layoutSubViews() | 
| ... | ... | @@ -61,6 +62,15 @@ class LoginViewController: UIViewController,UITextFieldDelegate { | 
| 61 | 62 | self.view.endEditing(true) | 
| 62 | 63 | return true | 
| 63 | 64 | } | 
| 65 | + func textFieldDidEndEditing(_ textField: UITextField) { | |
| 66 | + if textField==passwordTextField && phoneTextField.text! != "" && passwordTextField.text! != ""{ | |
| 67 | + loginBtn.isUserInteractionEnabled = true | |
| 68 | + loginBtn.backgroundColor = UIColorFromRGB(0xC5DAFF) | |
| 69 | + }else{ | |
| 70 | + loginBtn.isUserInteractionEnabled = false | |
| 71 | + loginBtn.backgroundColor = UIColor.lightGray | |
| 72 | + } | |
| 73 | + } | |
| 64 | 74 | func isMobilePhoneNumber(_ mobile:String)->Bool { | 
| 65 | 75 | let str="^1[0-9]{10}" | 
| 66 | 76 | return NSPredicate(format: "SELF MATCHES %@", str).evaluate(with: mobile) | ... | ... | 
ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/My.storyboard
| ... | ... | @@ -654,9 +654,9 @@ | 
| 654 | 654 | <constraint firstAttribute="trailing" secondItem="1J2-p5-3X1" secondAttribute="trailing" constant="16" id="zP0-t8-7QU"/> | 
| 655 | 655 | </constraints> | 
| 656 | 656 | </view> | 
| 657 | - <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8rh-jr-h8p"> | |
| 657 | + <button opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8rh-jr-h8p"> | |
| 658 | 658 | <rect key="frame" x="8" y="198" width="359" height="40"/> | 
| 659 | - <color key="backgroundColor" red="0.7725490196" green="0.85490196080000003" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | |
| 659 | + <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/> | |
| 660 | 660 | <constraints> | 
| 661 | 661 | <constraint firstAttribute="height" constant="40" id="EUp-oS-yvq"/> | 
| 662 | 662 | </constraints> | 
| ... | ... | @@ -746,6 +746,7 @@ | 
| 746 | 746 | <nil key="simulatedTopBarMetrics"/> | 
| 747 | 747 | <connections> | 
| 748 | 748 | <outlet property="iconImageView" destination="MuP-eU-u8t" id="PTg-zh-c8A"/> | 
| 749 | + <outlet property="loginBtn" destination="8rh-jr-h8p" id="sCl-jk-qmI"/> | |
| 749 | 750 | <outlet property="passwordHiddenBtn" destination="1J2-p5-3X1" id="nRt-UB-PLr"/> | 
| 750 | 751 | <outlet property="passwordTextField" destination="IOQ-sk-Ckx" id="WdM-7n-kAj"/> | 
| 751 | 752 | <outlet property="phoneTextField" destination="zJR-4G-Ym9" id="9rT-Uj-tRY"/> | ... | ... | 
ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyViewController.swift
| ... | ... | @@ -19,7 +19,7 @@ class MyViewController: UIViewController { | 
| 19 | 19 | @IBOutlet var loginBtn: UIButton!//登录按钮 | 
| 20 | 20 | @IBOutlet var currentInfoBtn: UIButton!//查看个人信息按钮 | 
| 21 | 21 | @IBOutlet var logoutBtn: UIButton! | 
| 22 | - var titleDataSet:[String]=["消息","订购详情","家校通订购","我的孩子","空白","意见与反馈","清除缓存","关于"] | |
| 22 | + var titleDataSet:[String]=["消息","订购详情","订购中心","我的孩子","空白","意见与反馈","清除缓存","关于"] | |
| 23 | 23 | var iconDataSet:[String] = ["my_icon_orderMessage","my_icon_orderDetail","my_icon_order","my_icon_children","","my_icon_service","my_icon_cachingClear","my_icon_about"] | 
| 24 | 24 | override func viewDidLoad() { | 
| 25 | 25 | super.viewDidLoad() | 
| ... | ... | @@ -71,7 +71,7 @@ class MyViewController: UIViewController { | 
| 71 | 71 | let info = AccountManager.shared | 
| 72 | 72 | personNameLabel.text = info.name() | 
| 73 | 73 | personNumberLabel.text = info.phone() | 
| 74 | - personIconImageView.sd_setImage(with: URL(string: AccountManager.shared.photo().addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!), placeholderImage: UIImage(named: "my_defphoto")) | |
| 74 | + personIconImageView.sd_setImage(with: URL(string: AccountManager.shared.photo().addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!), placeholderImage: UIImage(named: "defphoto")) | |
| 75 | 75 | }else{ | 
| 76 | 76 | logoutBtn.isHidden = true | 
| 77 | 77 | personNameLabel.isHidden = true | ... | ... | 
ParentAssistant/ParentAssistant/Classes/controllers/report/ReportViewController.swift
| ... | ... | @@ -27,7 +27,8 @@ class ReportViewController: UIViewController { | 
| 27 | 27 | self.navigationController?.navigationBar.barStyle = UIBarStyle.default// UIColorFromRGB(0xC5DAFF) | 
| 28 | 28 | let backImage = UIImage(named: "navigationBar_backgrounImage") | 
| 29 | 29 | self.navigationController?.navigationBar.setBackgroundImage(backImage, for: UIBarMetrics.default) | 
| 30 | - setuptitleView() | |
| 30 | + self.navigationItem.title = "报告" | |
| 31 | +// setuptitleView() | |
| 31 | 32 | titleView.frame = CGRect(x: 0, y: 0, width: screenWidth, height: 44) | 
| 32 | 33 | self.navigationItem.titleView = titleView | 
| 33 | 34 | titleView.layoutSubviews() | 
| ... | ... | @@ -55,9 +56,6 @@ class ReportViewController: UIViewController { | 
| 55 | 56 | dateAry = getCurrentWeeks() | 
| 56 | 57 | //添加日历 | 
| 57 | 58 | dateView = LXCalendarView(frame: CGRect(x: 0, y: 0, width: screenWidth, height: screenWidth/2)) | 
| 58 | -// dateView.currentMonthTitleColor = UIColorFromRGB(0xC5DAFF) | |
| 59 | -// dateView.lastMonthTitleColor = UIColorFromRGB(0xC5DAFF) | |
| 60 | -// dateView.nextMonthTitleColor = UIColorFromRGB(0xC5DAFF) | |
| 61 | 59 | dateView.isHaveAnimation = true | 
| 62 | 60 | dateView.isCanScroll = true | 
| 63 | 61 | dateView.isShowLastAndNextBtn = false | 
| ... | ... | @@ -138,7 +136,6 @@ extension ReportViewController: ReportHeaderViewDelegate{ | 
| 138 | 136 | func selectTypeButton() { | 
| 139 | 137 | appDelegate.window!.makeToast("该功能暂不开放", duration: 1, position: CSToastPositionCenter) | 
| 140 | 138 | return | 
| 141 | - appDelegate.window!.makeToast("筛选", duration: 3, position: CSToastPositionCenter) | |
| 142 | 139 | } | 
| 143 | 140 | } | 
| 144 | 141 | // MARK: - 顶部展示日期 | ... | ... | 
ParentAssistant/ParentAssistant/Classes/libs/LaunchIntroduction/LaunchIntroductionView.h
0 → 100755
| ... | ... | @@ -0,0 +1,63 @@ | 
| 1 | +// | |
| 2 | +// LaunchIntroductionView.h | |
| 3 | +// ZYGLaunchIntroductionDemo | |
| 4 | +// | |
| 5 | +// Created by ZhangYunguang on 16/4/7. | |
| 6 | +// Copyright © 2016年 ZhangYunguang. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import <UIKit/UIKit.h> | |
| 10 | + | |
| 11 | +#define kScreen_height [[UIScreen mainScreen] bounds].size.height | |
| 12 | +#define kScreen_width [[UIScreen mainScreen] bounds].size.width | |
| 13 | + | |
| 14 | +@interface LaunchIntroductionView : UIView | |
| 15 | +/** | |
| 16 | + * 选中page的指示器颜色,默认白色 | |
| 17 | + */ | |
| 18 | +@property (nonatomic, strong) UIColor *currentColor; | |
| 19 | +/** | |
| 20 | + * 其他状态下的指示器的颜色,默认 | |
| 21 | + */ | |
| 22 | +@property (nonatomic, strong) UIColor *nomalColor; | |
| 23 | +/** | |
| 24 | + * 不带按钮的引导页,滑动到最后一页,再向右滑直接隐藏引导页 | |
| 25 | + * | |
| 26 | + * @param imageNames 背景图片数组 | |
| 27 | + * | |
| 28 | + * @return LaunchIntroductionView对象 | |
| 29 | + */ | |
| 30 | ++(instancetype)sharedWithImages:(NSArray *) imageNames; | |
| 31 | +/** | |
| 32 | + * 带按钮的引导页 | |
| 33 | + * | |
| 34 | + * @param imageNames 背景图片数组 | |
| 35 | + * @param buttonImageName 按钮的图片 | |
| 36 | + * @param frame 按钮的frame | |
| 37 | + * | |
| 38 | + * @return LaunchIntroductionView对象 | |
| 39 | + */ | |
| 40 | ++(instancetype)sharedWithImages:(NSArray *) imageNames buttonImage:(NSString *) buttonImageName buttonFrame:(CGRect ) frame; | |
| 41 | + | |
| 42 | +/** | |
| 43 | + 用storyboard创建的project调用此方法 | |
| 44 | + | |
| 45 | + @param storyboardName storyboardName | |
| 46 | + @param imageNames 图片名字数组 | |
| 47 | + @return LaunchIntroductionView对象 | |
| 48 | + */ | |
| 49 | ++ (instancetype)sharedWithStoryboardName:(NSString *)storyboardName images:(NSArray *)imageNames; | |
| 50 | + | |
| 51 | +/** | |
| 52 | + 用storyboard创建的project调用此方法 | |
| 53 | + | |
| 54 | + @param storyboardName storyboardName | |
| 55 | + @param imageNames 图片名字数组 | |
| 56 | + @param buttonImageName 按钮图片名字 | |
| 57 | + @param frame 按钮的frame | |
| 58 | + @return LaunchIntroductionView对象 | |
| 59 | + */ | |
| 60 | ++(instancetype)sharedWithStoryboard:(NSString *)storyboardName images:(NSArray *) imageNames buttonImage:(NSString *) buttonImageName buttonFrame:(CGRect ) frame; | |
| 61 | + | |
| 62 | + | |
| 63 | +@end | ... | ... | 
ParentAssistant/ParentAssistant/Classes/libs/LaunchIntroduction/LaunchIntroductionView.m
0 → 100755
| ... | ... | @@ -0,0 +1,199 @@ | 
| 1 | +// | |
| 2 | +// LaunchIntroductionView.m | |
| 3 | +// ZYGLaunchIntroductionDemo | |
| 4 | +// | |
| 5 | +// Created by ZhangYunguang on 16/4/7. | |
| 6 | +// Copyright © 2016年 ZhangYunguang. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "LaunchIntroductionView.h" | |
| 10 | +#import "UIImageView+WebCache.h" | |
| 11 | +static NSString *const kAppVersion = @"appVersion"; | |
| 12 | + | |
| 13 | +@interface LaunchIntroductionView ()<UIScrollViewDelegate> | |
| 14 | +{ | |
| 15 | + UIScrollView *launchScrollView; | |
| 16 | + UIPageControl *page; | |
| 17 | +} | |
| 18 | + | |
| 19 | +@end | |
| 20 | + | |
| 21 | +@implementation LaunchIntroductionView | |
| 22 | +NSArray *images; | |
| 23 | +BOOL isScrollOut;//在最后一页再次滑动是否隐藏引导页 | |
| 24 | +CGRect enterBtnFrame; | |
| 25 | +NSString *enterBtnImage; | |
| 26 | +static LaunchIntroductionView *launch = nil; | |
| 27 | +NSString *storyboard; | |
| 28 | + | |
| 29 | +#pragma mark - 创建对象-->>不带button | |
| 30 | ++(instancetype)sharedWithImages:(NSArray *)imageNames{ | |
| 31 | + images = imageNames; | |
| 32 | + isScrollOut = YES; | |
| 33 | + launch = [[LaunchIntroductionView alloc] initWithFrame:CGRectMake(0, 0, kScreen_width, kScreen_height)]; | |
| 34 | + launch.backgroundColor = [UIColor whiteColor]; | |
| 35 | + return launch; | |
| 36 | +} | |
| 37 | + | |
| 38 | +#pragma mark - 创建对象-->>带button | |
| 39 | ++(instancetype)sharedWithImages:(NSArray *)imageNames buttonImage:(NSString *)buttonImageName buttonFrame:(CGRect)frame{ | |
| 40 | + images = imageNames; | |
| 41 | + isScrollOut = NO; | |
| 42 | + enterBtnFrame = frame; | |
| 43 | + enterBtnImage = buttonImageName; | |
| 44 | + launch = [[LaunchIntroductionView alloc] initWithFrame:CGRectMake(0, 0, kScreen_width, kScreen_height)]; | |
| 45 | + launch.backgroundColor = [UIColor whiteColor]; | |
| 46 | + return launch; | |
| 47 | +} | |
| 48 | +#pragma mark - 用storyboard创建的项目时调用,不带button | |
| 49 | ++ (instancetype)sharedWithStoryboardName:(NSString *)storyboardName images:(NSArray *)imageNames { | |
| 50 | + images = imageNames; | |
| 51 | + storyboard = storyboardName; | |
| 52 | + isScrollOut = YES; | |
| 53 | + launch = [[LaunchIntroductionView alloc] initWithFrame:CGRectMake(0, 0, kScreen_width, kScreen_height)]; | |
| 54 | + launch.backgroundColor = [UIColor whiteColor]; | |
| 55 | + return launch; | |
| 56 | +} | |
| 57 | +#pragma mark - 用storyboard创建的项目时调用,带button | |
| 58 | ++ (instancetype)sharedWithStoryboard:(NSString *)storyboardName images:(NSArray *)imageNames buttonImage:(NSString *)buttonImageName buttonFrame:(CGRect)frame{ | |
| 59 | + images = imageNames; | |
| 60 | + isScrollOut = NO; | |
| 61 | + enterBtnFrame = frame; | |
| 62 | + storyboard = storyboardName; | |
| 63 | + enterBtnImage = buttonImageName; | |
| 64 | + launch = [[LaunchIntroductionView alloc] initWithFrame:CGRectMake(0, 0, kScreen_width, kScreen_height)]; | |
| 65 | + launch.backgroundColor = [UIColor whiteColor]; | |
| 66 | + return launch; | |
| 67 | +} | |
| 68 | +#pragma mark - 初始化 | |
| 69 | +- (instancetype)initWithFrame:(CGRect)frame | |
| 70 | +{ | |
| 71 | + self = [super initWithFrame:frame]; | |
| 72 | + if (self) { | |
| 73 | + [self addObserver:self forKeyPath:@"currentColor" options:NSKeyValueObservingOptionNew context:nil]; | |
| 74 | + [self addObserver:self forKeyPath:@"nomalColor" options:NSKeyValueObservingOptionNew context:nil]; | |
| 75 | + if ([self isFirstLauch]) { | |
| 76 | + UIStoryboard *story; | |
| 77 | + if (storyboard) { | |
| 78 | + story = [UIStoryboard storyboardWithName:storyboard bundle:nil]; | |
| 79 | + } | |
| 80 | + UIWindow *window = [UIApplication sharedApplication].windows.lastObject; | |
| 81 | + if (story) { | |
| 82 | + UIViewController * vc = story.instantiateInitialViewController; | |
| 83 | + window.rootViewController = vc; | |
| 84 | + [vc.view addSubview:self]; | |
| 85 | + }else { | |
| 86 | + [window addSubview:self]; | |
| 87 | + } | |
| 88 | + [self addImages]; | |
| 89 | + }else{ | |
| 90 | + [self removeFromSuperview]; | |
| 91 | + } | |
| 92 | + } | |
| 93 | + return self; | |
| 94 | +} | |
| 95 | +#pragma mark - 判断是不是首次登录或者版本更新 | |
| 96 | +-(BOOL )isFirstLauch{ | |
| 97 | + //获取当前版本号 | |
| 98 | + NSDictionary *infoDic = [[NSBundle mainBundle] infoDictionary]; | |
| 99 | + NSString *currentAppVersion = infoDic[@"CFBundleShortVersionString"]; | |
| 100 | + //获取上次启动应用保存的appVersion | |
| 101 | + NSString *version = [[NSUserDefaults standardUserDefaults] objectForKey:kAppVersion]; | |
| 102 | + //版本升级或首次登录 | |
| 103 | + if (version == nil || ![version isEqualToString:currentAppVersion]) { | |
| 104 | + [[NSUserDefaults standardUserDefaults] setObject:currentAppVersion forKey:kAppVersion]; | |
| 105 | + [[NSUserDefaults standardUserDefaults] synchronize]; | |
| 106 | + return YES; | |
| 107 | + }else{ | |
| 108 | + return NO; | |
| 109 | + } | |
| 110 | +} | |
| 111 | +#pragma mark - 添加引导页图片 | |
| 112 | +-(void)addImages{ | |
| 113 | + [self createScrollView]; | |
| 114 | +} | |
| 115 | +#pragma mark - 创建滚动视图 | |
| 116 | +-(void)createScrollView{ | |
| 117 | + launchScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, kScreen_width, kScreen_height)]; | |
| 118 | + launchScrollView.showsHorizontalScrollIndicator = NO; | |
| 119 | + launchScrollView.bounces = NO; | |
| 120 | + launchScrollView.pagingEnabled = YES; | |
| 121 | + launchScrollView.delegate = self; | |
| 122 | + launchScrollView.contentSize = CGSizeMake(kScreen_width * images.count, kScreen_height); | |
| 123 | + [self addSubview:launchScrollView]; | |
| 124 | + for (int i = 0; i < images.count; i ++) { | |
| 125 | + UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(i * kScreen_width, 0, kScreen_width, kScreen_height)]; | |
| 126 | + imageView.contentMode = UIViewContentModeScaleAspectFit; | |
| 127 | +// imageView.image = [UIImage imageNamed:images[i]]; | |
| 128 | + [imageView sd_setImageWithURL:[NSURL URLWithString:images[i]]]; | |
| 129 | + [launchScrollView addSubview:imageView]; | |
| 130 | + if (i == images.count - 1) { | |
| 131 | + //判断要不要添加button | |
| 132 | + if (!isScrollOut) { | |
| 133 | + UIButton *enterButton = [[UIButton alloc] initWithFrame:CGRectMake(enterBtnFrame.origin.x, enterBtnFrame.origin.y, enterBtnFrame.size.width, enterBtnFrame.size.height)]; | |
| 134 | + [enterButton setImage:[UIImage imageNamed:enterBtnImage] forState:UIControlStateNormal]; | |
| 135 | + [enterButton addTarget:self action:@selector(enterBtnClick) forControlEvents:UIControlEventTouchUpInside]; | |
| 136 | + [imageView addSubview:enterButton]; | |
| 137 | + imageView.userInteractionEnabled = YES; | |
| 138 | + } | |
| 139 | + } | |
| 140 | + } | |
| 141 | + page = [[UIPageControl alloc] initWithFrame:CGRectMake(0, kScreen_height - 50, kScreen_width, 30)]; | |
| 142 | + page.numberOfPages = images.count; | |
| 143 | + page.backgroundColor = [UIColor clearColor]; | |
| 144 | + page.currentPage = 0; | |
| 145 | + page.defersCurrentPageDisplay = YES; | |
| 146 | + [self addSubview:page]; | |
| 147 | +} | |
| 148 | +#pragma mark - 进入按钮 | |
| 149 | +-(void)enterBtnClick{ | |
| 150 | + [self hideGuidView]; | |
| 151 | +} | |
| 152 | +#pragma mark - 隐藏引导页 | |
| 153 | +-(void)hideGuidView{ | |
| 154 | + [UIView animateWithDuration:0.5 animations:^{ | |
| 155 | + self.alpha = 0; | |
| 156 | + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | |
| 157 | + [self removeFromSuperview]; | |
| 158 | + }); | |
| 159 | + | |
| 160 | + }]; | |
| 161 | +} | |
| 162 | +#pragma mark - scrollView Delegate | |
| 163 | +-(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView{ | |
| 164 | + int cuttentIndex = (int)(scrollView.contentOffset.x + kScreen_width/2)/kScreen_width; | |
| 165 | + if (cuttentIndex == images.count - 1) { | |
| 166 | + if ([self isScrolltoLeft:scrollView]) { | |
| 167 | + if (!isScrollOut) { | |
| 168 | + return ; | |
| 169 | + } | |
| 170 | + [self hideGuidView]; | |
| 171 | + } | |
| 172 | + } | |
| 173 | +} | |
| 174 | +-(void)scrollViewDidScroll:(UIScrollView *)scrollView{ | |
| 175 | + if (scrollView == launchScrollView) { | |
| 176 | + int cuttentIndex = (int)(scrollView.contentOffset.x + kScreen_width/2)/kScreen_width; | |
| 177 | + page.currentPage = cuttentIndex; | |
| 178 | + } | |
| 179 | +} | |
| 180 | +#pragma mark - 判断滚动方向 | |
| 181 | +-(BOOL )isScrolltoLeft:(UIScrollView *) scrollView{ | |
| 182 | + //返回YES为向左反动,NO为右滚动 | |
| 183 | + if ([scrollView.panGestureRecognizer translationInView:scrollView.superview].x < 0) { | |
| 184 | + return YES; | |
| 185 | + }else{ | |
| 186 | + return NO; | |
| 187 | + } | |
| 188 | +} | |
| 189 | +#pragma mark - KVO监测值的变化 | |
| 190 | +-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSString *,id> *)change context:(void *)context{ | |
| 191 | + if ([keyPath isEqualToString:@"currentColor"]) { | |
| 192 | + page.currentPageIndicatorTintColor = self.currentColor; | |
| 193 | + } | |
| 194 | + if ([keyPath isEqualToString:@"nomalColor"]) { | |
| 195 | + page.pageIndicatorTintColor = self.nomalColor; | |
| 196 | + } | |
| 197 | +} | |
| 198 | + | |
| 199 | +@end | ... | ... | 
ParentAssistant/ParentAssistant/Classes/libs/ZLaunchAd/ZLaunchAd.swift
| ... | ... | @@ -20,7 +20,7 @@ public class ZLaunchAd: NSObject { | 
| 20 | 20 | /// - adNetRequest: 广告网络请求。如果需要每次进入前台是显示不同的广告图片,网络请求写在此闭包中 | 
| 21 | 21 | /// - Returns: ZLaunchAdView | 
| 22 | 22 | @discardableResult | 
| 23 | - @objc public class func create(waitTime: Int = 3, showEnterForeground: Bool = false, adNetRequest: ((ZLaunchAdView)->())? = nil) -> ZLaunchAdView { | |
| 23 | + @objc public class func create(waitTime: Int = 5, showEnterForeground: Bool = false, adNetRequest: ((ZLaunchAdView)->())? = nil) -> ZLaunchAdView { | |
| 24 | 24 | let launchAdView: ZLaunchAdView | 
| 25 | 25 | if showEnterForeground { | 
| 26 | 26 | launchAdView = ZLaunchAdView.default | ... | ... | 
ParentAssistant/ParentAssistant/Classes/libs/ZLaunchAd/ZLaunchAdConfig.swift
| ... | ... | @@ -82,7 +82,7 @@ public typealias ZLaunchClosure = ()->() | 
| 82 | 82 | /// 数字大小 | 
| 83 | 83 | @objc public var timeFont = UIFont.systemFont(ofSize: 15) | 
| 84 | 84 | /// 数字颜色 | 
| 85 | - @objc public var timeColor = UIColor.red | |
| 85 | + @objc public var timeColor = UIColor.white | |
| 86 | 86 | /// 跳过按钮类型 | 
| 87 | 87 | @objc public var skipBtnType: ZLaunchSkipButtonType = .textLeftTimerRight | 
| 88 | 88 | /// 圆形进度颜色 | ... | ... | 
ParentAssistant/ParentAssistant/Classes/libs/ZLaunchAd/ZLaunchAdView.swift
| ... | ... | @@ -91,6 +91,7 @@ extension ZLaunchAdView { | 
| 91 | 91 | guard let imageResource = imageResource, | 
| 92 | 92 | let imageNameOrImageURL = imageResource.imageNameOrImageURL else { return } | 
| 93 | 93 | launchAdImgView.frame = imageResource.imageFrame | 
| 94 | + launchAdImgView.contentMode = UIViewContentMode.scaleAspectFit | |
| 94 | 95 | addSubview(launchAdImgView) | 
| 95 | 96 | if imageNameOrImageURL.contains("http://") || imageNameOrImageURL.contains("https://") { | 
| 96 | 97 | launchAdImgView.setImage(with: imageNameOrImageURL, options: imageResource.imageOptions) { | ... | ... | 
ParentAssistant/ParentAssistant/ParentAssistant-Bridging-Header.h
ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/evaluation/evaluation_icon_camera.imageset/Contents.json
0 → 100644
| ... | ... | @@ -0,0 +1,21 @@ | 
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "idiom" : "universal", | |
| 9 | + "filename" : "camera.png", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "scale" : "3x" | |
| 15 | + } | |
| 16 | + ], | |
| 17 | + "info" : { | |
| 18 | + "version" : 1, | |
| 19 | + "author" : "xcode" | |
| 20 | + } | |
| 21 | +} | |
| 0 | 22 | \ No newline at end of file | ... | ... | 
ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/evaluation/evaluation_icon_camera.imageset/camera.png
0 → 100644
1.08 KB
ParentAssistant/ParentAssistant/Supporting Files/Base.lproj/Main.storyboard
| ... | ... | @@ -456,7 +456,7 @@ | 
| 456 | 456 | <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/> | 
| 457 | 457 | </view> | 
| 458 | 458 | <navigationItem key="navigationItem" title="测评" id="1Lk-x4-9OW"> | 
| 459 | - <barButtonItem key="rightBarButtonItem" systemItem="camera" id="e8u-Kr-J32"> | |
| 459 | + <barButtonItem key="rightBarButtonItem" image="evaluation_icon_camera" id="e8u-Kr-J32"> | |
| 460 | 460 | <color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | 
| 461 | 461 | <connections> | 
| 462 | 462 | <action selector="selectCamareAction:" destination="BYZ-38-t0r" id="ePR-Ms-0ze"/> | 
| ... | ... | @@ -491,7 +491,7 @@ | 
| 491 | 491 | <!--Tab Bar Controller--> | 
| 492 | 492 | <scene sceneID="6yA-8W-l0b"> | 
| 493 | 493 | <objects> | 
| 494 | - <tabBarController automaticallyAdjustsScrollViewInsets="NO" id="PbF-i7-G0s" customClass="TabBarController" customModule="ParentAssistant" customModuleProvider="target" sceneMemberID="viewController"> | |
| 494 | + <tabBarController storyboardIdentifier="TabBarController" automaticallyAdjustsScrollViewInsets="NO" id="PbF-i7-G0s" customClass="TabBarController" customModule="ParentAssistant" customModuleProvider="target" sceneMemberID="viewController"> | |
| 495 | 495 | <toolbarItems/> | 
| 496 | 496 | <navigationItem key="navigationItem" id="Xea-Ll-sGg"/> | 
| 497 | 497 | <tabBar key="tabBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="6Bt-XK-CLv"> | 
| ... | ... | @@ -848,19 +848,39 @@ | 
| 848 | 848 | <constraint firstAttribute="bottom" secondItem="wGp-kr-l5S" secondAttribute="bottom" id="p0u-d2-Uig"/> | 
| 849 | 849 | </constraints> | 
| 850 | 850 | </view> | 
| 851 | + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="A43-XP-A41"> | |
| 852 | + <rect key="frame" x="0.0" y="64" width="375" height="554"/> | |
| 853 | + <subviews> | |
| 854 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="该功能暂不开放" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Xcu-Qc-1gt"> | |
| 855 | + <rect key="frame" x="133.5" y="268" width="107.5" height="18"/> | |
| 856 | + <fontDescription key="fontDescription" type="system" pointSize="15"/> | |
| 857 | + <color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> | |
| 858 | + <nil key="highlightedColor"/> | |
| 859 | + </label> | |
| 860 | + </subviews> | |
| 861 | + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | |
| 862 | + <constraints> | |
| 863 | + <constraint firstItem="Xcu-Qc-1gt" firstAttribute="centerX" secondItem="A43-XP-A41" secondAttribute="centerX" id="Fwg-CW-1E4"/> | |
| 864 | + <constraint firstItem="Xcu-Qc-1gt" firstAttribute="centerY" secondItem="A43-XP-A41" secondAttribute="centerY" id="HhT-1o-bSm"/> | |
| 865 | + </constraints> | |
| 866 | + </view> | |
| 851 | 867 | </subviews> | 
| 852 | 868 | <color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/> | 
| 853 | 869 | <constraints> | 
| 854 | 870 | <constraint firstItem="hwJ-Xg-tKm" firstAttribute="leading" secondItem="9O4-jf-dgu" secondAttribute="leading" id="5Q0-Yi-ShV"/> | 
| 855 | 871 | <constraint firstItem="hwJ-Xg-tKm" firstAttribute="top" secondItem="9O4-jf-dgu" secondAttribute="top" id="61Z-vW-5DV"/> | 
| 872 | + <constraint firstItem="A43-XP-A41" firstAttribute="trailing" secondItem="9O4-jf-dgu" secondAttribute="trailing" id="Iba-zi-BPh"/> | |
| 856 | 873 | <constraint firstItem="EEs-Ae-t7U" firstAttribute="bottom" secondItem="9O4-jf-dgu" secondAttribute="bottom" id="JYY-zh-cHV"/> | 
| 857 | 874 | <constraint firstItem="k9z-2G-Fhx" firstAttribute="trailing" secondItem="9O4-jf-dgu" secondAttribute="trailing" id="JtI-9e-igF"/> | 
| 858 | 875 | <constraint firstItem="EEs-Ae-t7U" firstAttribute="leading" secondItem="9O4-jf-dgu" secondAttribute="leading" id="MzB-kU-gbs"/> | 
| 859 | 876 | <constraint firstItem="EEs-Ae-t7U" firstAttribute="trailing" secondItem="9O4-jf-dgu" secondAttribute="trailing" id="NPL-F1-7Sg"/> | 
| 877 | + <constraint firstItem="A43-XP-A41" firstAttribute="leading" secondItem="9O4-jf-dgu" secondAttribute="leading" id="NsR-AG-Nxb"/> | |
| 860 | 878 | <constraint firstItem="k9z-2G-Fhx" firstAttribute="leading" secondItem="9O4-jf-dgu" secondAttribute="leading" id="QZG-IF-A8F"/> | 
| 861 | 879 | <constraint firstItem="EEs-Ae-t7U" firstAttribute="top" secondItem="k9z-2G-Fhx" secondAttribute="bottom" constant="5" id="SBe-2c-H4J"/> | 
| 880 | + <constraint firstItem="A43-XP-A41" firstAttribute="bottom" secondItem="9O4-jf-dgu" secondAttribute="bottom" id="ShD-0u-kTc"/> | |
| 862 | 881 | <constraint firstItem="k9z-2G-Fhx" firstAttribute="top" secondItem="9O4-jf-dgu" secondAttribute="top" id="UIi-qU-PBc"/> | 
| 863 | 882 | <constraint firstAttribute="bottom" secondItem="hwJ-Xg-tKm" secondAttribute="bottom" id="YjS-6f-Gk9"/> | 
| 883 | + <constraint firstItem="A43-XP-A41" firstAttribute="top" secondItem="9O4-jf-dgu" secondAttribute="top" id="hu6-HC-sc0"/> | |
| 864 | 884 | <constraint firstItem="hwJ-Xg-tKm" firstAttribute="trailing" secondItem="9O4-jf-dgu" secondAttribute="trailing" id="sNr-ZT-Lsy"/> | 
| 865 | 885 | </constraints> | 
| 866 | 886 | <viewLayoutGuide key="safeArea" id="9O4-jf-dgu"/> | 
| ... | ... | @@ -2227,6 +2247,7 @@ | 
| 2227 | 2247 | <image name="Information_bar_icon_select" width="22" height="20"/> | 
| 2228 | 2248 | <image name="evaluation_bar_icon" width="22" height="21"/> | 
| 2229 | 2249 | <image name="evaluation_bar_icon_select" width="22" height="21"/> | 
| 2250 | + <image name="evaluation_icon_camera" width="32" height="32"/> | |
| 2230 | 2251 | <image name="evaluation_icon_learningManagement" width="45" height="47"/> | 
| 2231 | 2252 | <image name="evaluation_icon_play" width="59" height="59"/> | 
| 2232 | 2253 | <image name="evaluation_icon_training" width="47" height="47"/> | ... | ... |