From 66f62debace91f3c35b6c9c96825eaf74b7dc366 Mon Sep 17 00:00:00 2001 From: 葛建军 Date: Mon, 22 May 2017 14:38:35 +0800 Subject: [PATCH] 首页界面间距调整,微课首页界面搭建及数据填充。 --- YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj | 4 ++++ YouerLiveVideo/YouerLiveVideo.xcodeproj/project.xcworkspace/xcuserdata/jun.xcuserdatad/UserInterfaceState.xcuserstate | Bin 47288 -> 0 bytes YouerLiveVideo/YouerLiveVideo.xcodeproj/xcuserdata/jun.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist | 18 ------------------ YouerLiveVideo/YouerLiveVideo/Base.lproj/Main.storyboard | 611 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controllers/HomePage/MainHomeTableViewController.swift | 18 ++++++++++-------- YouerLiveVideo/YouerLiveVideo/controllers/MicroCourse/MicroCourseViewController.swift | 180 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------- YouerLiveVideo/YouerLiveVideo/controllers/Resource/FilterViewController.swift | 35 +++++++++++++++++++++++++++++++++++ YouerLiveVideo/YouerLiveVideo/controllers/Resource/LiveInforViewController.swift | 21 ++++++++++----------- YouerLiveVideo/YouerLiveVideo/controllers/Resource/Resource.storyboard | 22 ++++++++++++++++++++-- YouerLiveVideo/YouerLiveVideo/controllers/Resource/ResourceViewController.swift | 8 ++++++++ 10 files changed, 671 insertions(+), 246 deletions(-) create mode 100644 YouerLiveVideo/YouerLiveVideo/controllers/Resource/FilterViewController.swift diff --git a/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj b/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj index 083943f..559fe27 100644 --- a/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj +++ b/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj @@ -139,6 +139,7 @@ BF6977971E2DEC98006FA934 /* loginBackGround.png in Resources */ = {isa = PBXBuildFile; fileRef = BF6977941E2DEC98006FA934 /* loginBackGround.png */; }; BF6977981E2DEC98006FA934 /* userId.png in Resources */ = {isa = PBXBuildFile; fileRef = BF6977951E2DEC98006FA934 /* userId.png */; }; BF6977991E2DEC98006FA934 /* userPassword.png in Resources */ = {isa = PBXBuildFile; fileRef = BF6977961E2DEC98006FA934 /* userPassword.png */; }; + BF7722F31ED283D400226D44 /* FilterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF7722F21ED283D400226D44 /* FilterViewController.swift */; }; BF7B75961E305A6D0011D5C7 /* MJRefreshAutoFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = BF7B756A1E305A6D0011D5C7 /* MJRefreshAutoFooter.m */; }; BF7B75971E305A6D0011D5C7 /* MJRefreshBackFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = BF7B756C1E305A6D0011D5C7 /* MJRefreshBackFooter.m */; }; BF7B75981E305A6D0011D5C7 /* MJRefreshComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = BF7B756E1E305A6D0011D5C7 /* MJRefreshComponent.m */; }; @@ -458,6 +459,7 @@ BF6977941E2DEC98006FA934 /* loginBackGround.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = loginBackGround.png; sourceTree = ""; }; BF6977951E2DEC98006FA934 /* userId.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = userId.png; sourceTree = ""; }; BF6977961E2DEC98006FA934 /* userPassword.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = userPassword.png; sourceTree = ""; }; + BF7722F21ED283D400226D44 /* FilterViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FilterViewController.swift; sourceTree = ""; }; BF7B75691E305A6D0011D5C7 /* MJRefreshAutoFooter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshAutoFooter.h; sourceTree = ""; }; BF7B756A1E305A6D0011D5C7 /* MJRefreshAutoFooter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJRefreshAutoFooter.m; sourceTree = ""; }; BF7B756B1E305A6D0011D5C7 /* MJRefreshBackFooter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJRefreshBackFooter.h; sourceTree = ""; }; @@ -620,6 +622,7 @@ isa = PBXGroup; children = ( 5904FC471ECA8B8C00E631FF /* ResourceViewController.swift */, + BF7722F21ED283D400226D44 /* FilterViewController.swift */, 59AE3DFA1ECECD7D003E2C62 /* LiveInforViewController.swift */, 59AE3DFC1ECED5B1003E2C62 /* MoivePlayerViewController.swift */, 597185B41ECA990C00D7F478 /* Resource.storyboard */, @@ -1558,6 +1561,7 @@ BF25DFF91DDAA36A003EC0C1 /* NSImage+WebCache.m in Sources */, BF8E52EE1ECFD16000E472E8 /* RankingTableViewController.swift in Sources */, 59F8014F1DD2C7AD000A78B0 /* AppDelegate.swift in Sources */, + BF7722F31ED283D400226D44 /* FilterViewController.swift in Sources */, BF25DFED1DDAA36A003EC0C1 /* ResponseSerialization.swift in Sources */, BF25E0031DDAA36A003EC0C1 /* UIImage+GIF.m in Sources */, BFBB83E91ECC445D008B404B /* RegisterViewController.swift in Sources */, diff --git a/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.xcworkspace/xcuserdata/jun.xcuserdatad/UserInterfaceState.xcuserstate b/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.xcworkspace/xcuserdata/jun.xcuserdatad/UserInterfaceState.xcuserstate index d77a839..ef2c8b1 100644 Binary files a/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.xcworkspace/xcuserdata/jun.xcuserdatad/UserInterfaceState.xcuserstate and b/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.xcworkspace/xcuserdata/jun.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/YouerLiveVideo/YouerLiveVideo.xcodeproj/xcuserdata/jun.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/YouerLiveVideo/YouerLiveVideo.xcodeproj/xcuserdata/jun.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index b0984b7..fe2b454 100644 --- a/YouerLiveVideo/YouerLiveVideo.xcodeproj/xcuserdata/jun.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/YouerLiveVideo/YouerLiveVideo.xcodeproj/xcuserdata/jun.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -2,22 +2,4 @@ - - - - - - diff --git a/YouerLiveVideo/YouerLiveVideo/Base.lproj/Main.storyboard b/YouerLiveVideo/YouerLiveVideo/Base.lproj/Main.storyboard index 9258dd6..8d301be 100644 --- a/YouerLiveVideo/YouerLiveVideo/Base.lproj/Main.storyboard +++ b/YouerLiveVideo/YouerLiveVideo/Base.lproj/Main.storyboard @@ -11,26 +11,7 @@ - - - - - - - - - - - - - - - - - - - - + @@ -60,6 +41,9 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/HomePage/MainHomeTableViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/HomePage/MainHomeTableViewController.swift index 0aa5043..6760f93 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/HomePage/MainHomeTableViewController.swift +++ b/YouerLiveVideo/YouerLiveVideo/controllers/HomePage/MainHomeTableViewController.swift @@ -80,12 +80,14 @@ class MainHomeTableViewController: UITableViewController { return 4 } override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { - if indexPath.row==0 || indexPath.row==1{ - return (getScreenWidth()-16)/2+86 + if indexPath.row==0{ + return (getScreenWidth()-45)/2/33*25+80 + }else if indexPath.row==1{ + return (getScreenWidth()-45)/2/33*16+132 }else if indexPath.row==2{ - return (getScreenWidth()-16)/3+103+86 + return (getScreenWidth()-40)/3+170.5 }else{ - return (getScreenWidth()-30)/3+30+86 + return (getScreenWidth()-40)/3+110 } } override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { @@ -153,7 +155,7 @@ class HomeFirstTableViewCell: UITableViewCell,UICollectionViewDelegate,UICollect } } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { - return CGSize(width: (getScreenWidth()-16)/2, height: (getScreenWidth()-16)/2) + return CGSize(width: (getScreenWidth()-45)/2, height: (getScreenWidth()-45)/2/33*25) } func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { @@ -207,7 +209,7 @@ class HomeSecondTableViewCell: UITableViewCell,UICollectionViewDelegate,UICollec NSLog("点击了****\(dataSet[indexPath.row])") } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { - return CGSize(width: (getScreenWidth()-16)/2, height: (getScreenWidth()-16)/2) + return CGSize(width: (getScreenWidth()-45)/2, height: ((getScreenWidth()-45)/2/33*16+67)) } func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return dataSet.count @@ -329,7 +331,7 @@ class HomeThirdTableViewCell: UITableViewCell,UICollectionViewDelegate,UICollect NSLog("点击了****\(dataSet[indexPath.row])") } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { - return CGSize(width: (getScreenWidth()-16)/3, height: (getScreenWidth()-16)/3+103) + return CGSize(width: (getScreenWidth()-40)/3, height: (getScreenWidth()-40)/3+105.5) } func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return dataSet.count @@ -388,7 +390,7 @@ class HomeFourTableViewCell: UITableViewCell,UICollectionViewDelegate,UICollecti NSLog("点击了****\(dataSet[indexPath.row])") } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { - return CGSize(width: (getScreenWidth()-32)/3, height: (getScreenWidth()-32)/3+30) + return CGSize(width: (getScreenWidth()-40)/3, height: (getScreenWidth()-40)/3+30) } func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return dataSet.count diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/MicroCourse/MicroCourseViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/MicroCourse/MicroCourseViewController.swift index e54ba0b..2fbe75e 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/MicroCourse/MicroCourseViewController.swift +++ b/YouerLiveVideo/YouerLiveVideo/controllers/MicroCourse/MicroCourseViewController.swift @@ -8,28 +8,176 @@ import UIKit -class MicroCourseViewController: UIViewController { - +class MicroCourseViewController: UIViewController,UITableViewDelegate,UITableViewDataSource,UISearchControllerDelegate,UISearchResultsUpdating { + @IBOutlet var tableView: UITableView! + + @IBOutlet var grayView: UIView! + @IBOutlet var searchTableView: UITableView! + @IBOutlet var searchTableHeight: NSLayoutConstraint! + + var searchController:UISearchController! + var dataSetAry:[String]=["葛建军","张道峰","徐晓杰","左承","段合江"] + var searchAry:[String]=[] + var currentPage:Int=0 //当前页数,每次取十个数据 + var resourceData:[MicroCourseModel]=[] override func viewDidLoad() { super.viewDidLoad() self.configTheme() - // Do any additional setup after loading the view. + addSearchController() + addRefresh() + self.refreshLivesAction(tag: self.currentPage, completionHandler: { (success) in + if success{ + self.tableView.reloadData() + } + }) } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. + func addSearchController(){ + self.definesPresentationContext=true + searchController=UISearchController(searchResultsController: nil) + searchController.delegate=self + searchController.searchResultsUpdater=self + searchController.searchBar.barTintColor=UIColor.groupTableViewBackground + searchController.searchBar.placeholder="搜索" + //设置UISearchController的显示属性,以下3个属性默认为YES + //搜索时,背景变暗色 + self.searchController.dimsBackgroundDuringPresentation=false + //搜索时,背景变模糊 + // self.searchController.obscuresBackgroundDuringPresentation=false + //点击搜索的时候,是否隐藏导航栏 + // searchController.hidesNavigationBarDuringPresentation=true + //位置 + searchController.searchBar.frame=CGRect(x: self.searchController.searchBar.frame.origin.x, y: self.searchController.searchBar.frame.origin.y, width: self.searchController.searchBar.frame.size.width, height: 44.0); + // self.view.addSubview(searchController.searchBar) + searchTableView.tableHeaderView=searchController.searchBar + } + func addRefresh(){ + let header=MJRefreshNormalHeader(refreshingBlock: { + //下拉刷新 + self.currentPage=0 + self.resourceData.removeAll() + self.refreshLivesAction(tag: self.currentPage, completionHandler: { (success) in + if success{ + self.tableView.reloadData() + } + self.tableView.mj_header.endRefreshing() + }) + }) + header?.lastUpdatedTimeLabel.isHidden=true + tableView.mj_header=header + tableView.mj_footer=MJRefreshBackNormalFooter(refreshingBlock: { + //上拉加载更多 + self.refreshLivesAction(tag: self.currentPage, completionHandler: { (success) in + if success{ + self.tableView.reloadData() + } + self.tableView.mj_footer.endRefreshing() + }) + }) + } + // MARK: - 刷新数据接口 + func refreshLivesAction(tag:Int,completionHandler:@escaping (Bool) -> ()){ + let parameters:Dictionary=["type":0 as AnyObject,"pageIndex":tag as AnyObject,"pageSize":1 as AnyObject] + AppDelegate.instance().httpServer.getHotRescourse(parameters: parameters) { (str, error) in + var success:Bool=true + if error==nil { + if JSON.fromString(jsonString: str)!["status"].intValue == 1{ + httpJsonResule(jsonString: str, error: error, successHandler: { (json) in + if JSON.fromString(jsonString: str)!["data"].arrayValue.count>0{ + self.currentPage+=1 + } + for item in JSON.fromString(jsonString: str)!["data"].arrayValue { + self.resourceData.append(MicroCourseModel(j: item)) + } + success=true + }, failHandler: { (error) in + success=false + appRootViewController().view.makeToast("获取资源失败:\(error.localizedDescription)") + }) + }else{ + success=false + appRootViewController().view.makeToast("获取资源失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") + } + }else{ + success=false + appRootViewController().view.makeToast("获取资源失败:\(error!.description)") + } + completionHandler(success) + } + } + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + if tableView==searchTableView{ + return searchAry.count + }else{ + return resourceData.count + } + } + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + if tableView==searchTableView { + let cell=tableView.dequeueReusableCell(withIdentifier: "cell") + cell?.textLabel?.text=searchAry[indexPath.row] + return cell! + }else{ + let cell=tableView.dequeueReusableCell(withIdentifier: "identifier") as! MicroCourseViewControllerTableViewCell + cell.superVC=self + cell.setUpWith(item: resourceData[indexPath.row]) + return cell + } + } + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + if tableView==searchTableView { + let vc = UIStoryboard(name: "HomePage", bundle: nil).instantiateViewController(withIdentifier: "RankingTableViewController") as! RankingTableViewController + self.navigationController?.pushViewController(vc, animated: true) + }else{ +// let vc = UIStoryboard(name: "Resource", bundle: nil).instantiateViewController(withIdentifier: "LiveInforViewControllerVC") as! LiveInforViewController +// vc.item=resourceData[indexPath.row] +// self.navigationController?.pushViewController(vc, animated: true) + } + } + //取消键盘输入状态 + @IBAction func cancleSearchActivit(_ sender: UITapGestureRecognizer) { + searchController.isActive=false + } + func willPresentSearchController(_ searchController: UISearchController) { + grayView.isHidden=false + } + func willDismissSearchController(_ searchController: UISearchController) { + searchTableHeight.constant=44 + grayView.isHidden=true + } + //谓词搜索过滤 + func updateSearchResults(for searchController: UISearchController) { + let searchString=searchController.searchBar.text + let predicate=NSPredicate(format: "SELF CONTAINS[c] %@", searchString!) + searchAry=(dataSetAry as NSArray).filtered(using: predicate) as! [String] + if CGFloat((searchAry.count+1)*44)>(getScreenHeight()-64){ + searchTableHeight.constant=getScreenHeight()-64 + }else{ + searchTableHeight.constant=CGFloat((searchAry.count+1)*44) + } + searchTableView.reloadData() } +} - /* - // MARK: - Navigation - - // In a storyboard-based application, you will often want to do a little preparation before navigation - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - // Get the new view controller using segue.destinationViewController. - // Pass the selected object to the new view controller. +class MicroCourseViewControllerTableViewCell:UITableViewCell{ + @IBOutlet var iconImageView: UIImageView! + @IBOutlet var titleLabel: UILabel! + @IBOutlet var updateTeacherLabel: UILabel! + @IBOutlet var timeLabel: UILabel! + @IBOutlet var downLoadCountLabel: UILabel! + var item:MicroCourseModel! + var superVC:MicroCourseViewController! + func setUpWith(item: MicroCourseModel){ + self.item=item + iconImageView.sd_setImage(with: URL(string: item.f_Img), placeholderImage: UIImage(named: "icon_course_placeholder")) + titleLabel.text=item.f_Title + updateTeacherLabel.text="上传者:\(item.f_CreatorName) 老师" + timeLabel.text=item.f_CreatorTime + downLoadCountLabel.text="\(item.f_DownloadSum)" + } + @IBAction func pushDetailVC(_ sender: UIButton) { + let vc = UIStoryboard(name: "Resource", bundle: nil).instantiateViewController(withIdentifier: "LiveInforViewControllerVC") as! LiveInforViewController + vc.item=item + self.superVC.navigationController!.pushViewController(vc, animated: true) } - */ - } diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/Resource/FilterViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/Resource/FilterViewController.swift new file mode 100644 index 0000000..129b6f7 --- /dev/null +++ b/YouerLiveVideo/YouerLiveVideo/controllers/Resource/FilterViewController.swift @@ -0,0 +1,35 @@ +// +// FilterViewController.swift +// YouerLiveVideo +// +// Created by 葛建军 on 17/5/22. +// Copyright © 2017年 左丞. All rights reserved. +// + +import UIKit + +class FilterViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destinationViewController. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/Resource/LiveInforViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/Resource/LiveInforViewController.swift index 73764c6..f01c8fb 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/Resource/LiveInforViewController.swift +++ b/YouerLiveVideo/YouerLiveVideo/controllers/Resource/LiveInforViewController.swift @@ -16,27 +16,26 @@ class LiveInforViewController: UIViewController { @IBOutlet weak var updataPersonPhoto: UIImageView! @IBOutlet weak var updataPersonName: UILabel! @IBOutlet weak var updataTime: UILabel! - - var tvStation:TVStationSubject! + var item:MicroCourseModel! override func viewDidLoad() { super.viewDidLoad() - AppDelegate.instance().httpServer.getResourceModel(parameters: ["f_id":"2be92331-ea5a-41c9-9025-c954d7df904c" as AnyObject]) { (str, error) in + updataPersonPhoto.layer.cornerRadius = updataPersonPhoto.frame.size.height/2 + updataPersonPhoto.layer.masksToBounds = true + AppDelegate.instance().httpServer.getResourceModel(parameters: ["f_id":item.f_Id as AnyObject]) { (str, error) in httpJsonResule(jsonString: str, error: error, successHandler: { (json) in - self.tvStation = TVStationSubject(json: json.contentData()) - self.setAllInfor() + self.setAllInfor(item: TVStationSubject(json: json.contentData())) }, failHandler: { (error) in }) } + // Do any additional setup after loading the view. } - func setAllInfor(){ - updataTime.text = setDateToString(date: dateFromISO8601(dateString: tvStation.f_CreatorTime)) - updataPersonName.text = "上传者: \(tvStation.f_CreatorName!)" - updataPersonPhoto.layer.cornerRadius = updataPersonPhoto.frame.size.height/2 - updataPersonPhoto.layer.masksToBounds = true - updataPersonPhoto.sd_setImage(with: URL(string: tvStation.f_Img), placeholderImage: #imageLiteral(resourceName: "defphoto.png")) + func setAllInfor(item:TVStationSubject){ + updataTime.text = setDateToString(date: dateFromISO8601(dateString: item.f_CreatorTime)) + updataPersonName.text = "上传者: \(item.f_CreatorName!)" + updataPersonPhoto.sd_setImage(with: URL(string: item.f_Img), placeholderImage: #imageLiteral(resourceName: "defphoto.png")) } override func didReceiveMemoryWarning() { diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/Resource/Resource.storyboard b/YouerLiveVideo/YouerLiveVideo/controllers/Resource/Resource.storyboard index 4b61339..33ab745 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/Resource/Resource.storyboard +++ b/YouerLiveVideo/YouerLiveVideo/controllers/Resource/Resource.storyboard @@ -1,5 +1,5 @@ - - + + @@ -9,6 +9,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/Resource/ResourceViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/Resource/ResourceViewController.swift index b5fac17..d6d3bce 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/Resource/ResourceViewController.swift +++ b/YouerLiveVideo/YouerLiveVideo/controllers/Resource/ResourceViewController.swift @@ -104,6 +104,12 @@ class ResourceViewController: UIViewController,UITableViewDelegate,UITableViewDa completionHandler(success) } } + // MARK: - 跳转到筛选 + @IBAction func jumpFilterVCAction(_ sender: UIButton) { + let vc = UIStoryboard(name: "Resource", bundle: nil).instantiateViewController(withIdentifier: "FilterViewController") as! FilterViewController + self.navigationController?.pushViewController(vc, animated: true) + } + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { if tableView==searchTableView{ return searchAry.count @@ -126,6 +132,8 @@ class ResourceViewController: UIViewController,UITableViewDelegate,UITableViewDa if tableView==searchTableView { let vc = UIStoryboard(name: "HomePage", bundle: nil).instantiateViewController(withIdentifier: "RankingTableViewController") as! RankingTableViewController self.navigationController?.pushViewController(vc, animated: true) + }else{ + } } //取消键盘输入状态 -- libgit2 0.21.0