Commit 0b64d6d5 authored by David黄金龙's avatar David黄金龙

添加 预览相关的界面

parent 19196252
......@@ -139,6 +139,9 @@ extension AppDelegate {
private func setupRootVC() {
let tabBarController = YHTabBarViewController()
let v0 = YHNavigationController(rootVC:YHHomeViewController())
// let v0 = YHNavigationController(rootVC:YHPersonInformMainViewController())//for test hjl
let v1 = YHNavigationController(rootVC:YHServiceCenterMainViewController())
let v2 = YHNavigationController(rootVC:YHMyViewController())
......
......@@ -141,7 +141,9 @@ extension YHServiceCenterMainViewController : UITableViewDelegate,UITableViewDat
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
printLog("点击了 tableView Cell \(indexPath.row)")
let vc = YHServiceCenterSecondViewController()
// let vc = YHServiceCenterSecondViewController()
let vc = YHPersonInformMainViewController() //for test hjl
self.navigationController?.pushViewController(vc)
}
}
......@@ -23,21 +23,21 @@ class YHPersonInfoControllerHoldViewController: UIViewController {
let arrItemTitles = ["主申请人信息","家庭成员信息","基本资料","学历/专业资格","工作经验","其他信息"]
var arrItemVCs : [YHDavidTestViewController] = []
var segmentedView : JXSegmentedView = JXSegmentedView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 40))
var segmentedView : JXSegmentedView = JXSegmentedView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 58))
lazy var segmentedDataSource: JXSegmentedBaseDataSource = {
let dataSource = JXSegmentedTitleDataSource()
dataSource.isTitleColorGradientEnabled = true
// dataSource.isTitleColorGradientEnabled = true
dataSource.titles = arrItemTitles
dataSource.titleNormalFont = UIFont.PingFangScM(ofSize: 16)
dataSource.titleNormalColor = .commonColor25
dataSource.titleNormalFont = UIFont.PingFangScR(ofSize: 16)
dataSource.titleSelectedColor = UIColor(hex: 0x888F98)
dataSource.titleSelectedFont = UIFont.PingFangScM(ofSize: 18)
dataSource.titleSelectedColor = .commonColor100
dataSource.titleSelectedColor = UIColor(hex: 0x4388FF)
dataSource.isItemSpacingAverageEnabled = false
dataSource.itemWidth = JXSegmentedViewAutomaticDimension
dataSource.itemSpacing = 24
dataSource.itemSpacing = 21.5
return dataSource
}()
......@@ -71,9 +71,10 @@ class YHPersonInfoControllerHoldViewController: UIViewController {
//配置指示器
let indicator = JXSegmentedIndicatorLineView()
indicator.indicatorWidth = 16
indicator.indicatorColor = .blue
indicator.indicatorHeight = 4
indicator.indicatorCornerRadius = 2
indicator.indicatorColor = UIColor(hex:0x4388FF)
segmentedView.indicators = [indicator]
segmentedView.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1)
}
override func viewWillAppear(_ animated: Bool) {
......@@ -93,8 +94,9 @@ class YHPersonInfoControllerHoldViewController: UIViewController {
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
segmentedView.frame = CGRect(x: 0, y: 0, width: view.bounds.size.width, height: 50)
listContainerView.frame = CGRect(x: 0, y: 50, width: view.bounds.size.width, height: view.bounds.size.height - 50)
segmentedView.frame = CGRect(x: 0, y: 0, width: view.bounds.size.width, height: 58)
listContainerView.frame = CGRect(x: 0, y: 58, width: view.bounds.size.width, height: view.bounds.size.height - 58)
segmentedView.backgroundColor = .white
}
}
......
......@@ -11,78 +11,23 @@ import GKNavigationBarSwift
//import JXSegmentedView
class YHPersonInformMainViewController: YHBaseViewController {
let sectionHeaderHeight : CGFloat = 40
let cellHeight : CGFloat = 80
var arrItemVc : [UIViewController] = []
var canScroll : Bool = true
var myCellHeight : CGFloat {
get {
return view.bounds.size.height - homeNavBarView.height - k_TabBar_Height
return view.bounds.size.height - k_TabBar_Height
}
}
let cellView: YHMainContentBaseViewController = YHMainContentBaseViewController()
let cellView: YHPersonInfoControllerHoldViewController = YHPersonInfoControllerHoldViewController()
// //model 及网络请求
// lazy var homeReqVM : YHHomePageViewModel = {
// return YHHomePageViewModel()
// }()
//头部背景图片
lazy var headBkgImagV: UIImageView = {
let imagV = UIImageView()
imagV.image = UIImage(named: "home_head_bkg")
imagV.contentMode = .scaleAspectFill
return imagV
}()
//自定义导航栏
lazy var homeNavBarView: UIView = {
let view1 = UIView()
view1.backgroundColor = .clear
view1.isUserInteractionEnabled = true
let icon = UIImageView(image: UIImage(named: "home_nav_icon"))
icon.contentMode = .scaleAspectFill
view1.addSubview(icon)
icon.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalToSuperview().offset(16)
make.height.equalTo(26)
make.width.equalTo(120)
}
let btnMsg = UIButton(type: .custom)
btnMsg.setImage(UIImage(named: "home_nav_msg"), for: .normal)
view1.addSubview(btnMsg)
btnMsg.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.right.equalToSuperview().offset(-16)
make.height.width.equalTo(34)
}
btnMsg.addTarget(self, action: #selector(tapSearch), for: .touchUpInside)
let btnSearch = UIButton(type: .custom)
btnSearch.setImage(UIImage(named: "home_nav_search"), for: .normal)
btnSearch.addTarget(self, action: #selector(tapSearch), for: .touchUpInside)
view1.addSubview(btnSearch)
btnSearch.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.right.equalTo(btnMsg.snp.left).offset(-12)
make.height.width.equalTo(34)
}
return view1
}()
var homeTableView: YHGestureTableView = {
let tableView = YHGestureTableView(frame: .zero, style: .plain)
let tableView = YHGestureTableView(frame: .zero, style: .grouped)
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false
......@@ -91,6 +36,38 @@ class YHPersonInformMainViewController: YHBaseViewController {
return tableView
}()
var myHeadView : UIView = {
let view = UIView(frame: CGRect(x: 16, y: 0, width: KScreenWidth - 16 * 2, height: 105 + 17 + 6))
// view.backgroundColor = .yellow //for test hjl
return view
}()
//头像
private lazy var headImagV : UIImageView = {
let imageV = UIImageView(image: UIImage(named: "score_header_default"))
imageV.contentMode = .scaleAspectFit
return imageV
}()
//姓名
private lazy var nameLable : UILabel = {
let lable0 = UILabel(text: "DavidHuang")
lable0.textColor = UIColor(hex: 0x222222)
lable0.font = UIFont.PingFangScM(ofSize: 16)
return lable0
}()
//电话号码
private lazy var phoneLable : UILabel = {
let lable0 = UILabel(text: "15818743775")
lable0.textColor = UIColor(hex: 0x888F98)
lable0.font = UIFont.PingFangScR(ofSize: 12)
return lable0
}()
// MARK: - 生命周期方法
override func viewDidLoad() {
super.viewDidLoad()
......@@ -115,6 +92,10 @@ class YHPersonInformMainViewController: YHBaseViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
}
}
// MARK: - 私有方法
......@@ -149,40 +130,88 @@ extension YHPersonInformMainViewController {
}
private func initView()->Void {
gk_navigationBar.isHidden = true
gk_navigationBar.isHidden = false
gk_backStyle = .black
gk_navTitle = "预览"
gk_navBackgroundColor = .white
gk_navTitleColor = UIColor(hex:0x0F1214)
gk_navBarAlpha = 1
view.addSubview(headBkgImagV)
headBkgImagV.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(307)
}
view.addSubview(homeNavBarView)
homeNavBarView.layer.zPosition = 1
homeNavBarView.snp.makeConstraints { make in
make.top.equalTo(k_Height_safeAreaInsetsTop())
make.left.right.equalToSuperview()
make.height.equalTo(48)
}
homeTableView.delegate = self
homeTableView.dataSource = self
view.addSubview(homeTableView)
homeTableView.snp.makeConstraints { make in
make.top.equalTo(homeNavBarView.snp.bottom).offset(0)
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.bottom.equalToSuperview()
}
// homeTableView.backgroundColor = .red//for test hjl
homeTableView.tableHeaderView = myHeadView
self.homeTableView.es.addPullToRefresh {
self.loadFirstItem()
let headSubView = UIView()
headSubView.backgroundColor = .clear
headSubView.layer.cornerRadius = 12
headSubView.clipsToBounds = true
myHeadView.addSubview(headSubView)
headSubView.snp.makeConstraints { make in
make.top.equalTo(17)
make.left.equalTo(16)
make.right.equalTo(-16)
make.height.equalTo(105)
}
self.homeTableView.es.startPullToRefresh()
self.homeTableView.es.addInfiniteScrolling {
self.loadFakeData()
let bkgImageV = UIImageView(image: UIImage(named: "person_info_head_bkg"))
bkgImageV.contentMode = .scaleAspectFill
headSubView.addSubview(bkgImageV)
bkgImageV.snp.makeConstraints { make in
make.edges.equalTo(0)
}
// 头像 名称 电话号码
headSubView.addSubview(headImagV)
headImagV.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(21)
make.width.height.equalTo(42)
}
headSubView.addSubview(nameLable)
nameLable.snp.makeConstraints { make in
make.top.equalTo(headImagV.snp.top)
make.left.equalTo(headImagV.snp.right).offset(12)
make.height.equalTo(24)
make.right.equalTo(-12)
}
headSubView.addSubview(phoneLable)
phoneLable.snp.makeConstraints { make in
make.top.equalTo(nameLable.snp.bottom)
make.left.equalTo(headImagV.snp.right).offset(12)
make.height.equalTo(20)
make.right.equalTo(-12)
}
let iconImageV = UIImageView(image: UIImage(named: "person_info_head_icon"))
iconImageV.contentMode = .scaleAspectFill
headSubView.addSubview(iconImageV)
iconImageV.snp.makeConstraints { make in
make.top.bottom.right.equalToSuperview()
make.width.equalTo(125)
}
// self.homeTableView.es.addPullToRefresh {
// self.loadFirstItem()
// }
// self.homeTableView.es.startPullToRefresh()
// self.homeTableView.es.addInfiniteScrolling {
// self.loadFakeData()
// }
}
private func loadFirstItem() {
......@@ -218,18 +247,20 @@ extension YHPersonInformMainViewController : UITableViewDelegate,UITableViewData
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 0
return 0.001
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 0.001))
return view
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0
return 0.001
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 0.001))
return view
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
......@@ -251,7 +282,7 @@ extension YHPersonInformMainViewController : UITableViewDelegate,UITableViewData
extension YHPersonInformMainViewController: UIScrollViewDelegate {
func scrollViewDidScroll(_ scrollView: UIScrollView) {
let bottomCellOffset: CGFloat = homeTableView.rect(forSection: 1).origin.y - 64 + 80 - 12 //48
let bottomCellOffset: CGFloat = homeTableView.rect(forSection: 0).origin.y
if (scrollView.contentOffset.y >= bottomCellOffset) {
scrollView.contentOffset = CGPointMake(0, bottomCellOffset)
if canScroll == true {
......
......@@ -117,7 +117,7 @@ extension YHScorePersonInfoCell {
}
let bkgImageV = UIImageView(image: UIImage(named: "scroe_icon_bkg"))
let bkgImageV = UIImageView(image: UIImage(named: "score_icon_bkg"))
bkgImageV.contentMode = .scaleAspectFill
holdView.addSubview(bkgImageV)
bkgImageV.snp.makeConstraints { make in
......
{
"images" : [
{
"filename" : "Rectangle 2418.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Rectangle 2418@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Rectangle 2418@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "截屏2023-04-10 上午9.43.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "截屏2023-04-10 上午9.43@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "截屏2023-04-10 上午9.43@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment