Commit e867fc22 authored by Steven杜宇's avatar Steven杜宇

Merge branch 'youhua-dev' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into youhua-dev

parents 6b9944e7 a4826c78
......@@ -47,7 +47,8 @@ extension YHInvatationShareViewController {
}()
view.addSubview(centerImageView)
centerImageView.snp.makeConstraints { make in
make.center.equalToSuperview()
make.centerX.equalToSuperview()
make.centerY.equalToSuperview().offset(-30)
make.height.equalTo(480)
make.width.equalTo(270)
}
......
......@@ -13,7 +13,38 @@ class YHInvitationWithGiftsViewController: YHBaseViewController {
var tableView: UITableView!
var bottomViewForShare: YHInvitationWithGiftsShareBottomView!
var viewModel: YHInvitationWithGiftsViewModel = YHInvitationWithGiftsViewModel()
lazy var navBar: YHCustomNavigationBar = {
let bar = YHCustomNavigationBar.navBar()
bar.backgroundColor = .clear
bar.backButton.setImage(UIImage(named: "back_icon"), for: .normal)
bar.backBlock = {
[weak self] in
guard let self = self else { return }
let view = YHInvitationWithGiftsShareView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
view.block = {[weak self] tag in
if tag == 0 {
self?.navigationController?.popViewController()
} else {
let vc = YHInvatationShareViewController()
self?.navigationController?.pushViewController(vc)
}
}
let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
}
return bar
}()
lazy var navView:UIView = {
let view = UIView()
view.backgroundColor = .clear
view.addSubview(self.navBar)
self.navBar.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(k_Height_NavContentBar)
}
return view
}()
lazy var headView : YHInvitationWithGiftsHeadView = {
let headView = YHInvitationWithGiftsHeadView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 666))
return headView
......@@ -27,8 +58,13 @@ class YHInvitationWithGiftsViewController: YHBaseViewController {
override func backItemClick(_ sender: Any) {
let view = YHInvitationWithGiftsShareView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
view.block = { tag in
self.navigationController?.popViewController()
view.block = {[weak self] tag in
if tag == 0 {
self?.navigationController?.popViewController()
} else {
let vc = YHInvatationShareViewController()
self?.navigationController?.pushViewController(vc)
}
}
let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
......@@ -40,8 +76,13 @@ class YHInvitationWithGiftsViewController: YHBaseViewController {
/// 是否可以返回,包括点击返回和手势返回,默认YES
override func navigationShouldPop() -> Bool {
let view = YHInvitationWithGiftsShareView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
view.block = { tag in
self.navigationController?.popViewController()
view.block = {[weak self] tag in
if tag == 0 {
self?.navigationController?.popViewController()
} else {
let vc = YHInvatationShareViewController()
self?.navigationController?.pushViewController(vc)
}
}
let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
......@@ -110,6 +151,7 @@ extension YHInvitationWithGiftsViewController {
}
func setView() {
gk_navigationBar.isHidden = true
view.backgroundColor = .contentBkgColor
let rightButtonItem = UIBarButtonItem(title: "规则", style: .plain, target: self, action: #selector(lookDeatil))
rightButtonItem.setTitleTextAttributes([.foregroundColor: UIColor.mainTextColor], for: .normal)
......@@ -150,6 +192,11 @@ extension YHInvitationWithGiftsViewController {
make.bottom.left.right.equalToSuperview()
make.height.equalTo(98)
}
view.addSubview(self.navView)
self.navView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(k_Height_NavigationtBarAndStatuBar)
}
}
@objc func lookDeatil() {
......@@ -175,3 +222,24 @@ extension YHInvitationWithGiftsViewController {
}
}
}
extension YHInvitationWithGiftsViewController: UIScrollViewDelegate {
func scrollViewDidScroll(_ scrollView: UIScrollView) {
var percent = scrollView.contentOffset.y/k_Height_NavigationtBarAndStatuBar
if percent < 0.0 {
percent = 0.0
} else if percent > 1.0 {
percent = 1.0
}
navView.backgroundColor = UIColor(hex: 0xFFFFFF, alpha: percent)
if percent >= 0.5 {
navBar.backButton.setImage(UIImage(named: "back_icon"), for: .normal)
navBar.title = "关于银河湾"
} else {
navBar.backButton.setImage(UIImage(named: "back_icon"), for: .normal)
navBar.title = ""
}
}
}
......@@ -93,10 +93,12 @@ class YHInvitationWithGiftsHeadView: UIView {
bgView = {
let view = UIView()
view.backgroundColor = .white
view.backgroundColor = .white.withAlphaComponent(0.68)
view.clipsToBounds = true
view.layer.masksToBounds = true
view.layer.cornerRadius = 15
view.layer.borderWidth = 1
view.layer.borderColor = UIColor.white.cgColor
view.isHidden = true
return view
}()
......
......@@ -47,7 +47,7 @@ class YHInvitationWithGiftsSecondTableViewCell: UITableViewCell {
if tableData?.list.count == 0 {
let label = UILabel(frame: CGRect(x: 0, y: 0, width: self.width - 30, height: 40))
label.text = "还未有推荐信息,快分享给好友吧~"
label.textColor = UIColor.mainTextColor30
label.textColor = UIColor.yhGreyColor
label.font = UIFont.PFSC_M(ofSize: 12)
label.textAlignment = .center
self.tableView.tableFooterView = label
......@@ -237,7 +237,7 @@ class YHInvitationWithGiftsSecondTableViewCell: UITableViewCell {
let view = UILabel()
view.text = "*积分发放及提取方式,详见规则"
view.font = UIFont.PFSC_M(ofSize: 11)
view.textColor = UIColor.yhGreyColor
view.textColor = UIColor.mainTextColor50
view.textAlignment = .center
return view
}()
......
......@@ -98,6 +98,7 @@ class YHInvitationWithGiftsShareView: UIView {
@objc func share() {
removeFromSuperview()
block?(1)
}
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "mine_item_appoint@2x.png",
"filename" : "wode_xiaoxi@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "mine_item_appoint@3x.png",
"filename" : "wode_xiaoxi@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
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