From eb22308c8ce2f93075db5429e478b2f4cbdbbd94 Mon Sep 17 00:00:00 2001 From: Cao yang Date: Sat, 24 Mar 2018 15:39:12 +0800 Subject: [PATCH] 合并冲突 --- ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj | 14 ++++++++++++++ ParentAssistant/ParentAssistant.xcodeproj/xcuserdata/caoyang.xcuserdatad/xcschemes/xcschememanagement.plist | 2 +- ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate | Bin 80734 -> 0 bytes ParentAssistant/ParentAssistant/AppDelegate.swift | 67 +++++++++++++++++++++++++++++++++++++++++++++---------------------- ParentAssistant/ParentAssistant/Classes/controllers/Information/InformationViewController.swift | 21 +++++++++++++++------ ParentAssistant/ParentAssistant/Classes/controllers/Information/view/ChannelCollectionViewCell.xib | 10 +++++----- ParentAssistant/ParentAssistant/Classes/controllers/evaluation/EvaluationViewController.swift | 10 +++++++++- ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/LoginViewController.swift | 10 ++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/My.storyboard | 5 +++-- ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyViewController.swift | 4 ++-- ParentAssistant/ParentAssistant/Classes/controllers/report/ReportViewController.swift | 23 +++++++++++------------ ParentAssistant/ParentAssistant/Classes/libs/LaunchIntroduction/LaunchIntroductionView.h | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/libs/LaunchIntroduction/LaunchIntroductionView.m | 199 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/libs/ZLaunchAd/ZLaunchAd.swift | 2 +- ParentAssistant/ParentAssistant/Classes/libs/ZLaunchAd/ZLaunchAdConfig.swift | 2 +- ParentAssistant/ParentAssistant/Classes/libs/ZLaunchAd/ZLaunchAdView.swift | 1 + ParentAssistant/ParentAssistant/Classes/util/network.swift | 8 ++------ ParentAssistant/ParentAssistant/NIM/YXMessageManager.swift | 7 +++++++ ParentAssistant/ParentAssistant/ParentAssistant-Bridging-Header.h | 1 + ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/evaluation/evaluation_icon_camera.imageset/Contents.json | 21 +++++++++++++++++++++ ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/evaluation/evaluation_icon_camera.imageset/camera.png | Bin 0 -> 1104 bytes ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/icon_getin.imageset/Contents.json | 21 +++++++++++++++++++++ ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/icon_getin.imageset/icon.png | Bin 0 -> 3012 bytes ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/report_none_icon.imageset/Contents.json | 21 +++++++++++++++++++++ ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/report_none_icon.imageset/baogao_back.jpg | Bin 0 -> 8835 bytes ParentAssistant/ParentAssistant/Supporting Files/Base.lproj/Main.storyboard | 28 ++++++++++++++++++++++++++-- ParentAssistant/Pods/Pods.xcodeproj/xcuserdata/caoyang.xcuserdatad/xcschemes/xcschememanagement.plist | 18 +++++++++--------- 27 files changed, 488 insertions(+), 70 deletions(-) create mode 100755 ParentAssistant/ParentAssistant/Classes/libs/LaunchIntroduction/LaunchIntroductionView.h create mode 100755 ParentAssistant/ParentAssistant/Classes/libs/LaunchIntroduction/LaunchIntroductionView.m create mode 100644 ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/evaluation/evaluation_icon_camera.imageset/Contents.json create mode 100644 ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/evaluation/evaluation_icon_camera.imageset/camera.png create mode 100644 ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/icon_getin.imageset/Contents.json create mode 100644 ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/icon_getin.imageset/icon.png create mode 100644 ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/report_none_icon.imageset/Contents.json create mode 100644 ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/report_none_icon.imageset/baogao_back.jpg diff --git a/ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj b/ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj index 800b33c..55708f8 100644 --- a/ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj +++ b/ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj @@ -105,6 +105,7 @@ BFBC06CC2063AE8900CCFAFF /* ZLaunchAdWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBC06C22063AE8800CCFAFF /* ZLaunchAdWindow.swift */; }; BFBC06CD2063AE8900CCFAFF /* ZLaunchImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBC06C32063AE8800CCFAFF /* ZLaunchImageView.swift */; }; BFBC06CE2063AE8900CCFAFF /* ZLaunchLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBC06C42063AE8800CCFAFF /* ZLaunchLog.swift */; }; + BFBC06D22064FDDE00CCFAFF /* LaunchIntroductionView.m in Sources */ = {isa = PBXBuildFile; fileRef = BFBC06D12064FDDE00CCFAFF /* LaunchIntroductionView.m */; }; BFCED888205280B700055373 /* MyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFCED887205280B700055373 /* MyViewController.swift */; }; BFCED88B20528DE700055373 /* MyViewControllerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFCED88A20528DE700055373 /* MyViewControllerModel.swift */; }; BFEAAAA7205118370072FAAF /* TabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFEAAAA6205118370072FAAF /* TabBarController.swift */; }; @@ -254,6 +255,8 @@ BFBC06C22063AE8800CCFAFF /* ZLaunchAdWindow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ZLaunchAdWindow.swift; sourceTree = ""; }; BFBC06C32063AE8800CCFAFF /* ZLaunchImageView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ZLaunchImageView.swift; sourceTree = ""; }; BFBC06C42063AE8800CCFAFF /* ZLaunchLog.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ZLaunchLog.swift; sourceTree = ""; }; + BFBC06D02064FDDE00CCFAFF /* LaunchIntroductionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LaunchIntroductionView.h; sourceTree = ""; }; + BFBC06D12064FDDE00CCFAFF /* LaunchIntroductionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LaunchIntroductionView.m; sourceTree = ""; }; BFCED887205280B700055373 /* MyViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyViewController.swift; sourceTree = ""; }; BFCED88A20528DE700055373 /* MyViewControllerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyViewControllerModel.swift; sourceTree = ""; }; BFEAAAA6205118370072FAAF /* TabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarController.swift; sourceTree = ""; }; @@ -622,6 +625,15 @@ path = ZLaunchAd; sourceTree = ""; }; + BFBC06CF2064FDDE00CCFAFF /* LaunchIntroduction */ = { + isa = PBXGroup; + children = ( + BFBC06D02064FDDE00CCFAFF /* LaunchIntroductionView.h */, + BFBC06D12064FDDE00CCFAFF /* LaunchIntroductionView.m */, + ); + path = LaunchIntroduction; + sourceTree = ""; + }; BFCED886205280B700055373 /* Controller */ = { isa = PBXGroup; children = ( @@ -663,6 +675,7 @@ BFEAAAAC205257270072FAAF /* libs */ = { isa = PBXGroup; children = ( + BFBC06CF2064FDDE00CCFAFF /* LaunchIntroduction */, BFBC06BA2063AE8800CCFAFF /* ZLaunchAd */, 5980BF5F2061048A00F4A35E /* LZCityPickerClass */, BFEAAAAD205257460072FAAF /* LXCalendar */, @@ -932,6 +945,7 @@ BFEAAAA9205248AC0072FAAF /* TaskPresentationTableViewCell.swift in Sources */, AD24AA202065FBAF00ECA428 /* SceneTopCell.swift in Sources */, 5980BF6A2061048A00F4A35E /* LZPickerModel.m in Sources */, + BFBC06D22064FDDE00CCFAFF /* LaunchIntroductionView.m in Sources */, BFEAAAA7205118370072FAAF /* TabBarController.swift in Sources */, BF67F3C020590A2F002FDC61 /* SwiftyJSON.swift in Sources */, 599364ED204E62E700C8B371 /* InformationViewController.swift in Sources */, diff --git a/ParentAssistant/ParentAssistant.xcodeproj/xcuserdata/caoyang.xcuserdatad/xcschemes/xcschememanagement.plist b/ParentAssistant/ParentAssistant.xcodeproj/xcuserdata/caoyang.xcuserdatad/xcschemes/xcschememanagement.plist index 51a860c..449940c 100644 --- a/ParentAssistant/ParentAssistant.xcodeproj/xcuserdata/caoyang.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/ParentAssistant/ParentAssistant.xcodeproj/xcuserdata/caoyang.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,7 +7,7 @@ ParentAssistant.xcscheme orderHint - 0 + 9 diff --git a/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate b/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate index 8aa4f92..6a0b16e 100644 Binary files a/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate and b/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ParentAssistant/ParentAssistant/AppDelegate.swift b/ParentAssistant/ParentAssistant/AppDelegate.swift index c0e2d62..92fc8e9 100644 --- a/ParentAssistant/ParentAssistant/AppDelegate.swift +++ b/ParentAssistant/ParentAssistant/AppDelegate.swift @@ -38,8 +38,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate { }) } setShareSDKSetting() + let tabbarVC = Story.instantiateViewControllerWithIdentifier("TabBarController", storyName: "Main") as! TabBarController + self.window?.rootViewController = tabbarVC + self.window?.makeKeyAndVisible() // 加载广告 - requestAD() + requestAD(vc: tabbarVC) return true } //设置云信的appkey @@ -60,33 +63,53 @@ class AppDelegate: UIResponder, UIApplicationDelegate { YXMessageManager.share.addYXDelegate() } // MARK: - 加载广告页 - func requestAD() -> Void { + func requestAD(vc:TabBarController) -> Void { var position:Int = 0 - if Setting.getString("isFirst") == "true" {//是否是第一次下载 + if Setting.getString("isFirst") == "\(AppDelegate.version())" {//是否是第一次下载 position = 1 + let adView = ZLaunchAd.create() + //position 广告位置0-首次广告位1-开屏广告位2-资讯首页3-频道首页4-频道内容5-文章内容页 AccountManager.shared.address + HTTPServer.shared.getAds(["position":position as AnyObject], completionHandler: { (str, error) in + httpJsonResule(jsonString: str, error: error, successHandler: { (json) in + if json["status"] == 1 && error == nil{ + if json.contentData().arrayValue.count>0 { + let imageResource = ZLaunchAdImageResourceConfigure() + imageResource.imageNameOrImageURL = HTTPServer.HOSTImage+json.contentData().arrayValue[0]["fileSrc"].stringValue.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)! + imageResource.imageDuration = 5 + imageResource.imageFrame = UIScreen.main.bounds + adView.setImageResource(imageResource, action: { + /// 广告点击 + }) + } + } + }, failHandler: { (error) in + }) + }) }else{ +// Thread.sleep(forTimeInterval: 5.0)//延长启动页面10秒 + let view = UIView(frame: CGRect(x: 0, y: 0, width: getScreenWidth(), height: getScreenHeight())) + view.backgroundColor = UIColor.white + vc.view.addSubview(view) position = 0 - Setting.save("true", forKey: "isFirst") - } - //position 广告位置0-首次广告位1-开屏广告位2-资讯首页3-频道首页4-频道内容5-文章内容页 AccountManager.shared.address - HTTPServer.shared.getAds(["position":position as AnyObject,"areaName":"" as AnyObject], completionHandler: { (str, error) in - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in - if json["status"] == 1 && error == nil{ - if json.contentData().arrayValue.count>0 { - let adView = ZLaunchAd.create() - let imageResource = ZLaunchAdImageResourceConfigure() - imageResource.imageNameOrImageURL = HTTPServer.HOSTImage+json.contentData().arrayValue[0]["fileSrc"].stringValue - imageResource.imageDuration = 5 - imageResource.imageFrame = UIScreen.main.bounds - adView.setImageResource(imageResource, action: { - /// 广告点击 - }) + let _ = Setting.save("\(AppDelegate.version())", forKey: "isFirst") + //position 广告位置0-首次广告位1-开屏广告位2-资讯首页3-频道首页4-频道内容5-文章内容页 AccountManager.shared.address + HTTPServer.shared.getAds(["position":position as AnyObject], completionHandler: { (str, error) in + view.removeFromSuperview() + httpJsonResule(jsonString: str, error: error, successHandler: { (json) in + if json["status"] == 1 && error == nil{ + var images:[String] = [] + if json.contentData().arrayValue.count>0 { + for item in json.contentData().arrayValue { + NSLog("************\(HTTPServer.HOSTImage+item["fileSrc"].stringValue.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!)"); images.append(HTTPServer.HOSTImage+item["fileSrc"].stringValue.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!) + } + LaunchIntroductionView.shared(withImages: images, buttonImage: "icon_getin", buttonFrame: CGRect(x: getScreenWidth()/2-551/4, y: getScreenHeight()-150, width: 551/2, height: 45)) + } } - } - }, failHandler: { (error) in - + }, failHandler: { (error) in + }) }) - }) + + } } // MARK: - 设置网络 @objc func networkStatusChange() { diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Information/InformationViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Information/InformationViewController.swift index 9e2801f..76cd037 100644 --- a/ParentAssistant/ParentAssistant/Classes/controllers/Information/InformationViewController.swift +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Information/InformationViewController.swift @@ -31,7 +31,7 @@ class InformationViewController: UIViewController,UISearchBarDelegate { searchView.placeholder = "请输入搜索内容" searchView.showsCancelButton = false self.navigationItem.titleView = searchView - + self.configTheme() } @@ -182,8 +182,11 @@ class InformationViewController: UIViewController,UISearchBarDelegate { //点击资讯进入详情 func pushToInfoView(index:Int){ let vcs = Story.instantiateViewControllerWithIdentifier("JSViewController", storyName: "JS") as! JSViewController - vcs.webURL = (HTTPServer.HOSTWAP+"/InformationDetail.aspx?id="+"\(data.channelContent[index].id)"+"&areaname="+AccountManager.shared.address)//.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)! - + if data.channelContent[index].url != "" { + vcs.webURL = data.channelContent[index].url + }else{ + 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) } @@ -262,7 +265,7 @@ extension InformationViewController:UICollectionViewDataSource,UICollectionViewD let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "contentCell", for: indexPath) as! ChannelCollectionViewCell cell.title.text = item.title cell.option.text = item.content - cell.optionNum.text = "\(item.talkNum)" + cell.optionNum.text = "\(item.lookNum)" cell.shareNum.text = "\(item.forwardingNum)" cell.picture.sd_setImage(with: URL(string: (HTTPServer.HOSTImage+item.image).addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!), placeholderImage: UIImage(named: "navigationBar_backgrounImage")) return cell @@ -283,10 +286,14 @@ extension InformationViewController:UICollectionViewDataSource,UICollectionViewD break default: let vcs = Story.instantiateViewControllerWithIdentifier("JSViewController", storyName: "JS") as! JSViewController - vcs.webURL = data.channelContent[indexPath.row].url//"\(HTTPServer.HOSTWAP!)/ParentOrderCenter.aspx?userid=\(AccountManager.shared.id())" + if data.channelContent[indexPath.row].url != "" { + vcs.webURL = data.channelContent[indexPath.row].url + }else{ + vcs.webURL = (HTTPServer.HOSTWAP+"/InformationDetail.aspx?id="+"\(data.channelContent[indexPath.row].id)"+"&areaname="+AccountManager.shared.address).addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)! + } self.navigationController?.present(vcs.wrapWithNavigationController(), animated: true, completion: nil) - pushToInfoView(index: indexPath.row) +// pushToInfoView(index: indexPath.row) } } @@ -407,6 +414,7 @@ class ChannelContentDemol: NSObject { var content:String=""// 资讯内容 , var forwardingNum:Int=0// 资讯转发数 , var talkNum:Int=0 // 评论数 , + var lookNum:Int = 0 //浏览数 var orderById:Int=0// 资讯排序 var isAds:Int=0// 是否为广告 1是广告 init(j:JSON){ @@ -417,6 +425,7 @@ class ChannelContentDemol: NSObject { content = j["content"].stringValue forwardingNum = j["forwardingNum"].intValue talkNum = j["talkNum"].intValue + lookNum = j["lookNum"].intValue orderById = j["orderById"].intValue isAds = j["isAds"].intValue } diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Information/view/ChannelCollectionViewCell.xib b/ParentAssistant/ParentAssistant/Classes/controllers/Information/view/ChannelCollectionViewCell.xib index 47a0afc..ff3c811 100644 --- a/ParentAssistant/ParentAssistant/Classes/controllers/Information/view/ChannelCollectionViewCell.xib +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Information/view/ChannelCollectionViewCell.xib @@ -38,25 +38,25 @@ -