Commit dcb18491 authored by Alex朱枝文's avatar Alex朱枝文

首页增加售后测评H5

parent b873454f
......@@ -586,6 +586,7 @@
04B360F32C636525001EB053 /* YHPrincipleWaitResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B360F22C636525001EB053 /* YHPrincipleWaitResultViewController.swift */; };
04B360F52C646844001EB053 /* YHPrincipleApprovedMailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B360F42C646844001EB053 /* YHPrincipleApprovedMailViewController.swift */; };
04B360F72C646B4F001EB053 /* YHPrincipleEnvelopeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B360F62C646B4F001EB053 /* YHPrincipleEnvelopeModel.swift */; };
04B401802CDB4B3C005C61A9 /* YHTalentProgramEvaluationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B4017F2CDB4B3B005C61A9 /* YHTalentProgramEvaluationView.swift */; };
04B4B8D52C89CE5E00ED82BC /* YHButlerServiceMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B4B8D42C89CE5E00ED82BC /* YHButlerServiceMessage.swift */; };
04B4B8D72C8AE77C00ED82BC /* YHButlerServiceMessageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B4B8D62C8AE77C00ED82BC /* YHButlerServiceMessageHandler.swift */; };
04B4B8DC2C90696E00ED82BC /* YHResignDocumentManagementVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B4B8DB2C90696E00ED82BC /* YHResignDocumentManagementVC.swift */; };
......@@ -1555,6 +1556,7 @@
04B360F22C636525001EB053 /* YHPrincipleWaitResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleWaitResultViewController.swift; sourceTree = "<group>"; };
04B360F42C646844001EB053 /* YHPrincipleApprovedMailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleApprovedMailViewController.swift; sourceTree = "<group>"; };
04B360F62C646B4F001EB053 /* YHPrincipleEnvelopeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleEnvelopeModel.swift; sourceTree = "<group>"; };
04B4017F2CDB4B3B005C61A9 /* YHTalentProgramEvaluationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHTalentProgramEvaluationView.swift; sourceTree = "<group>"; };
04B4B8D42C89CE5E00ED82BC /* YHButlerServiceMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHButlerServiceMessage.swift; sourceTree = "<group>"; };
04B4B8D62C8AE77C00ED82BC /* YHButlerServiceMessageHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHButlerServiceMessageHandler.swift; sourceTree = "<group>"; };
04B4B8DB2C90696E00ED82BC /* YHResignDocumentManagementVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignDocumentManagementVC.swift; sourceTree = "<group>"; };
......@@ -4487,6 +4489,7 @@
041470912C898EB700B7B688 /* YHGalaxyManagerTipsItemView.swift */,
04C85DE02C3677CB008B20D6 /* YHConsultantQRCodeView.swift */,
A59B43C62C48F68200B28379 /* YHEvaluationView.swift */,
04B4017F2CDB4B3B005C61A9 /* YHTalentProgramEvaluationView.swift */,
04213B222C48B7F700797900 /* YHIdentityTabBar.swift */,
04213B262C48C95E00797900 /* YHHomeIdentityCell.swift */,
04213B2A2C48F1BE00797900 /* YHHomeInfoSectionCell.swift */,
......@@ -6250,6 +6253,7 @@
047AA3F62C50E773009C4554 /* YHShareCashOutModel.swift in Sources */,
0472CBAC2C5A11640096F48F /* YHPrincleViewModel.swift in Sources */,
044F39542CB80731007CA277 /* YHVisaRenewalPayTipsCell.swift in Sources */,
04B401802CDB4B3C005C61A9 /* YHTalentProgramEvaluationView.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
......@@ -25,7 +25,7 @@ class YHHomePageViewController: YHBaseViewController {
let serviceCenterMainReqVM : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel()
var homeHeaderViewHeight : CGFloat = 0.0 // = self.homeHeaderView.getHomeHeadViewH(showTips: false)
var homeHeaderViewHeight : CGFloat = 0.0
private var isGoYHManagerFlag : Bool = false
......@@ -152,11 +152,11 @@ private extension YHHomePageViewController {
// 是否展示订单提示视图
func showOrderTipsView(_ show:Bool) {
func updateHomeHeadViewStyle(_ styleType:YHHomeHeadViewStyleType) {
homeHeaderViewHeight = homeHeaderView.getHomeHeadViewH(showTips: show)//show ? homeHeaderView.homeHeadViewH : YHHomeHeadView.fixViewH
homeHeaderViewHeight = homeHeaderView.getHomeHeadViewH(headStyle: styleType)
homeHeaderView.frame = CGRect(x: 20, y: -homeHeaderViewHeight, width: KScreenWidth - 40, height: homeHeaderViewHeight)
homeHeaderView.isNeedHideOrderTipsView = !show
homeHeaderView.homeHeadViewStyleType = styleType
homeCollectView.contentInset = UIEdgeInsets(top: homeHeaderViewHeight, left: 0, bottom: 0, right: 0)
self.homeCollectView.setContentOffset(CGPoint(x: 0, y: -homeHeaderViewHeight), animated: false)
......@@ -313,9 +313,9 @@ private extension YHHomePageViewController {
}
let headViewH : CGFloat = homeHeaderView.getHomeHeadViewH(showTips: false)
let headViewH : CGFloat = homeHeaderView.getHomeHeadViewH(headStyle: .evaluationA)
homeHeaderViewHeight = headViewH
homeHeaderView.isNeedHideOrderTipsView = false
homeHeaderView.homeHeadViewStyleType = .evaluationA
homeHeaderView.frame = CGRect(x: 20, y: -headViewH, width: KScreenWidth - 40, height: headViewH)
homeCollectView.addSubview(homeHeaderView)
......@@ -398,7 +398,7 @@ extension YHHomePageViewController {
// 请求订单数据
func requestOrder() {
if YHLoginManager.shared.isLogin() == false {
self.showOrderTipsView(false)
self.updateHomeHeadViewStyle(.evaluationA)
return
}
self.serviceCenterMainReqVM.getContactList {
......@@ -412,7 +412,10 @@ extension YHHomePageViewController {
} else {
}
let showEvaluationB = self.viewModel.signerModel?.after_sales_h5_info?.show == true
if let url = self.viewModel.signerModel?.after_sales_h5_info?.url, url.count > 0 {
self.homeHeaderView.talentEvaluationView.updateUrl(url)
}
self.viewModel.getLastTwoMessagesForSigner { success, error in
if success {
self.homeHeaderView.orderTipsView.arrLastTwoMessage = self.viewModel.arrLastTwoMessages
......@@ -422,11 +425,15 @@ extension YHHomePageViewController {
self.updateMgrItem()
self.homeHeaderView.updateSubViewsConstraints()
}
self.showOrderTipsView(isShow)
if showEvaluationB {
self.updateHomeHeadViewStyle(.evaluationBAndOrderTips)
} else {
self.updateHomeHeadViewStyle(.orderTips)
}
}
}
} else {
self.showOrderTipsView(isShow)
self.updateHomeHeadViewStyle(.evaluationA)
}
}
}
......
......@@ -15,7 +15,8 @@ class YHSignerInfoModel: SmartCodable {
var registration_timestamp: Int64 = -1
//售后H5问卷信息
var afterSalesH5Info:YHAfterSalesH5InfoModel?
var after_sales_h5_info: YHAfterSalesH5InfoModel?
required init() {
}
}
......
......@@ -7,6 +7,36 @@
//
import UIKit
// 定义类型枚举
enum YHHomeHeadViewStyleType {
// 新人测评页入口A
case evaluationA
// 优才新政交付B--测评
case evaluationB
// 优才订单提示视图
case orderTips
// 新人测评页入口A和优才新政交付B--测评
case evaluationAAndB
// 优才新政交付B--测评和优才订单提示视图
case evaluationBAndOrderTips
func getHeight(_ orderTipsHeight: CGFloat = 0) -> CGFloat {
switch self {
case .evaluationA:
return 20 + YHEvaluationView.viewH
case .evaluationB:
return 20 + YHTalentProgramEvaluationView.viewH
case .orderTips:
return 20 + orderTipsHeight
case .evaluationAAndB:
return (20 + YHEvaluationView.viewH) + YHTalentProgramEvaluationView.viewH + 20
case .evaluationBAndOrderTips:
return 20 + YHTalentProgramEvaluationView.viewH + 20 + orderTipsHeight
}
}
}
class YHHomeHeadView: UIView {
private static let topMargin : CGFloat = 10.0
......@@ -14,21 +44,11 @@ class YHHomeHeadView: UIView {
// 不包含订单提示视图的总高度
private static let fixViewH : CGFloat = YHHomeHeadView.topMargin + (YHHomeBannerView.viewH) + (20 + YHHomeKingKongBlockView.viewH) + (20 + 1) + (20 + YHAiRadarAreaView.viewH) + (20 + YHHomeSalonAreaView.viewH) + (20 + 1) + 20
//展示 订单提示时候的 高度
private var homeHeadViewH : CGFloat {
return YHHomeHeadView.fixViewH + (20 + orderTipsView.tipViewH) + YHHomeHeadView.topMargin
}
var galaxyManagerItemClickEvent: (() -> Void)?
var orderTipsViewClickEvent: (() -> Void)?
//获取headView的具体高度
func getHomeHeadViewH(showTips : Bool) -> CGFloat {
if showTips {
return homeHeadViewH
} else {
return YHHomeHeadView.fixViewH + (20 + YHEvaluationView.viewH) + YHHomeHeadView.topMargin
}
func getHomeHeadViewH(headStyle : YHHomeHeadViewStyleType) -> CGFloat {
return YHHomeHeadView.fixViewH + headStyle.getHeight(orderTipsView.height) + YHHomeHeadView.topMargin
}
override init(frame: CGRect) {
......@@ -73,13 +93,19 @@ class YHHomeHeadView: UIView {
}()
//4.1 测评页入口 - 未登录时/没有订单时 展示
//4.1 测评页入口A - 未登录时/没有订单时 展示
lazy var evaluationView: YHEvaluationView = {
let view = YHEvaluationView(frame: .zero)
view.isHidden = true
return view
}()
// 4.2 优才新政交付B--测评功能(B端)
lazy var talentEvaluationView: YHTalentProgramEvaluationView = {
let view = YHTalentProgramEvaluationView(frame: .zero)
view.isHidden = true
return view
}()
//5. ai人脉雷达
lazy var aiRadarArea: YHAiRadarAreaView = {
......@@ -105,9 +131,8 @@ class YHHomeHeadView: UIView {
// 是否隐藏优才订单提示视图
var isNeedHideOrderTipsView:Bool = true {
var homeHeadViewStyleType: YHHomeHeadViewStyleType = .evaluationA {
didSet {
self.orderTipsView.isHidden = isNeedHideOrderTipsView
updateSubViewsConstraints()
}
}
......@@ -132,40 +157,74 @@ class YHHomeHeadView: UIView {
// orderTipsView.snp.removeConstraints()
if self.orderTipsView.isHidden {
var lastView: UIView = evaluationView
switch homeHeadViewStyleType {
case .evaluationA:
orderTipsView.isHidden = true
evaluationView.isHidden = false
talentEvaluationView.isHidden = true
evaluationView.snp.remakeConstraints { make in
make.top.equalTo(bannerLineTop.snp.bottom).offset(20)
make.left.right.equalToSuperview()
make.height.equalTo(YHEvaluationView.viewH)
}
aiRadarArea.snp.remakeConstraints { make in
make.top.equalTo(evaluationView.snp.bottom).offset(20)
lastView = evaluationView
case .evaluationB:
orderTipsView.isHidden = true
evaluationView.isHidden = true
talentEvaluationView.isHidden = false
talentEvaluationView.snp.remakeConstraints { make in
make.top.equalTo(bannerLineTop.snp.bottom).offset(20)
make.left.right.equalToSuperview()
make.height.equalTo(YHAiRadarAreaView.viewH)
make.height.equalTo(YHEvaluationView.viewH)
}
} else {
lastView = talentEvaluationView
case .orderTips:
orderTipsView.isHidden = false
evaluationView.isHidden = true
talentEvaluationView.isHidden = true
orderTipsView.snp.remakeConstraints { make in
make.top.equalTo(bannerLineTop.snp.bottom).offset(20)
make.left.right.equalToSuperview()
make.height.equalTo(orderTipsView.tipViewH)
}
aiRadarArea.snp.remakeConstraints { make in
make.top.equalTo(orderTipsView.snp.bottom).offset(20)
lastView = orderTipsView
case .evaluationAAndB:
orderTipsView.isHidden = true
evaluationView.isHidden = false
talentEvaluationView.isHidden = false
evaluationView.snp.remakeConstraints { make in
make.top.equalTo(bannerLineTop.snp.bottom).offset(20)
make.left.right.equalToSuperview()
make.height.equalTo(YHAiRadarAreaView.viewH)
make.height.equalTo(YHEvaluationView.viewH)
}
talentEvaluationView.snp.remakeConstraints { make in
make.top.equalTo(evaluationView.snp.bottom).offset(20)
make.left.right.equalToSuperview()
make.height.equalTo(YHEvaluationView.viewH)
}
lastView = talentEvaluationView
case .evaluationBAndOrderTips:
orderTipsView.isHidden = false
evaluationView.isHidden = true
talentEvaluationView.isHidden = false
talentEvaluationView.snp.remakeConstraints { make in
make.top.equalTo(bannerLineTop.snp.bottom).offset(20)
make.left.right.equalToSuperview()
make.height.equalTo(YHEvaluationView.viewH)
}
orderTipsView.snp.remakeConstraints { make in
make.top.equalTo(talentEvaluationView.snp.bottom).offset(20)
make.left.right.equalToSuperview()
make.height.equalTo(orderTipsView.tipViewH)
}
lastView = orderTipsView
}
aiRadarArea.snp.remakeConstraints { make in
make.top.equalTo(lastView.snp.bottom).offset(20)
make.left.right.equalToSuperview()
make.height.equalTo(YHAiRadarAreaView.viewH)
}
salonArea.snp.remakeConstraints { make in
make.top.equalTo(aiRadarArea.snp.bottom).offset(20)
make.left.right.equalToSuperview()
......@@ -221,6 +280,13 @@ private extension YHHomeHeadView {
make.height.equalTo(YHEvaluationView.viewH)
}
addSubview(talentEvaluationView)
talentEvaluationView.snp.makeConstraints { make in
make.top.equalTo(evaluationView.snp.bottom).offset(20)
make.left.right.equalToSuperview()
make.height.equalTo(YHEvaluationView.viewH)
}
addSubview(aiRadarArea)
aiRadarArea.snp.makeConstraints { make in
......
//
// YHTalentProgramEvaluationView.swift
// galaxy
//
// Created by alexzzw on 2024/11/6.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHTalentProgramEvaluationView: UIView {
private var url: String = ""
static let viewH = 82.0
private lazy var bgImageView: UIImageView = {
let view = UIImageView(image: UIImage(named: "talent_program_evaluation"))
return view
}()
override init(frame: CGRect) {
super.init(frame: frame)
setupViews()
let tap : UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(tapButton(gestureRecognizer:)))
addGestureRecognizer(tap)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func updateUrl(_ url: String) {
self.url = url
}
private func setupViews() {
addSubview(bgImageView)
let ratio: CGFloat = 82.0 / 335.0
bgImageView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(bgImageView.snp.width).multipliedBy(ratio)
}
}
@objc func tapButton(gestureRecognizer:UITapGestureRecognizer) {
guard url.count > 0 else {
return
}
//跳转测评页
let vc = YHH5WebViewVC()
var retUrl = ""
if YHLoginManager.shared.isLogin() {
let token = YHLoginManager.shared.h5Token
if url.contains("?") {
retUrl = url + "&param=" + token
} else {
retUrl = url + "?param=" + token
}
} else {
retUrl = url
}
if !retUrl.contains("navigationH=") {
if retUrl.contains("?") {
retUrl = retUrl + "&navigationH=\(k_Height_NavigationtBarAndStatuBar)"
} else {
retUrl = retUrl + "?navigationH=\(k_Height_NavigationtBarAndStatuBar)"
}
}
vc.url = retUrl
vc.isShowRightShareItemFlag = true
parentViewController?.navigationController?.pushViewController(vc)
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "talent_program_evaluation@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "talent_program_evaluation@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