参保救援责任险

This commit is contained in:
ddisfriend
2025-08-26 16:28:45 +08:00
parent 4179a8057c
commit c1e2d1747d
3 changed files with 105 additions and 6 deletions

View File

@@ -19,7 +19,9 @@ open class WebViewTool : NSObject {
private var disposeBag = DisposeBag() private var disposeBag = DisposeBag()
public var h5Models : DispatchAppH5UrlDataModel? public var h5Models : DispatchAppH5UrlDataModel?
public var bannerInMineDataSources : [ConfigByCodeDataModel.ConfigByCodeBannerModel]?
enum WebViewNameEnum : String { enum WebViewNameEnum : String {
case todoList = "待办事项" case todoList = "待办事项"
case workOrderReconciliation = "工单对账" case workOrderReconciliation = "工单对账"
@@ -39,6 +41,7 @@ open class WebViewTool : NSObject {
case batteryList = "电瓶进销存" case batteryList = "电瓶进销存"
case invoiceListInfo = "开票信息" case invoiceListInfo = "开票信息"
case indexList = "二手车信息" case indexList = "二手车信息"
case insuredPage = "参保救援职业责任险"
case reportIndex = "报备" case reportIndex = "报备"
case vehicleAlarmDetail = "报警详情" case vehicleAlarmDetail = "报警详情"
case vehicleAlarmList = "车辆报警" case vehicleAlarmList = "车辆报警"
@@ -141,7 +144,10 @@ open class WebViewTool : NSObject {
vc = WebViewController(showNavBar:false, title: nil, url: "\((h5Models?.invoiceListInfo)!)?token=\((USER.token)!)"+(appending ?? "")) vc = WebViewController(showNavBar:false, title: nil, url: "\((h5Models?.invoiceListInfo)!)?token=\((USER.token)!)"+(appending ?? ""))
break break
case .indexList: case .indexList:
vc = WebViewController(showNavBar:false, title: nil, url: "\((h5Models?.indexList)!)?token=\((USER.token)!)"+(appending ?? "")) vc = WebViewController(showNavBar:false, title: nil, url: "\(bannerInMineDataSourcesLinkUrl(name: .indexList) ?? "")?token=\((USER.token)!)"+(appending ?? ""))
break
case .insuredPage:
vc = WebViewController(showNavBar:false, title: nil, url: "\(bannerInMineDataSourcesLinkUrl(name: .insuredPage) ?? "")?token=\((USER.token)!)"+(appending ?? ""))
break break
case .reportIndex: case .reportIndex:
vc = WebViewController(showNavBar:true, title: WebViewNameEnum.reportIndex.rawValue, url: "\((h5Models?.reportIndex)!)?token=\((USER.token)!)"+(appending ?? "")) vc = WebViewController(showNavBar:true, title: WebViewNameEnum.reportIndex.rawValue, url: "\((h5Models?.reportIndex)!)?token=\((USER.token)!)"+(appending ?? ""))
@@ -165,4 +171,40 @@ open class WebViewTool : NSObject {
requestModelRelay.accept(name) requestModelRelay.accept(name)
appendingRelay.accept(appending) appendingRelay.accept(appending)
} }
func bannerInMineDataSourcesContains(name: WebViewNameEnum) -> Bool {
if name == .indexList {
if let source = bannerInMineDataSources?.first(where: { bannerModel in
bannerModel.linkUrl?.contains("indexList") == true
}) {
return true
}
}
if name == .insuredPage {
if let source = bannerInMineDataSources?.first(where: { bannerModel in
bannerModel.linkUrl?.contains("insuredPage") == true
}) {
return true
}
}
return false
}
func bannerInMineDataSourcesLinkUrl(name: WebViewNameEnum) -> String? {
if name == .indexList {
if let source = bannerInMineDataSources?.first(where: { bannerModel in
bannerModel.linkUrl?.contains("indexList") == true
}) {
return source.linkUrl
}
}
if name == .insuredPage {
if let source = bannerInMineDataSources?.first(where: { bannerModel in
bannerModel.linkUrl?.contains("insuredPage") == true
}) {
return source.linkUrl
}
}
return nil
}
} }

View File

@@ -168,6 +168,13 @@ extension MineController {
}) })
.disposed(by: disposeBag) .disposed(by: disposeBag)
mineView.canbaoGes.rx.event
.observe(on: ConcurrentMainScheduler.instance)
.subscribe(onNext: { _ in
WEBTOOL.open(name: .insuredPage, appending: nil)
})
.disposed(by: disposeBag)
mineView.banbenjianceGes.rx.event mineView.banbenjianceGes.rx.event
.observe(on: MainScheduler.instance) .observe(on: MainScheduler.instance)
.subscribe(onNext: { _ in .subscribe(onNext: { _ in
@@ -229,6 +236,7 @@ open class MineController : ZDViewController {
mineView.peixunwendang.titleLabel.text = "培训文档" mineView.peixunwendang.titleLabel.text = "培训文档"
mineView.wendangziliao.titleLabel.text = "文档资料" mineView.wendangziliao.titleLabel.text = "文档资料"
mineView.ershouche.titleLabel.text = "二手车信息" mineView.ershouche.titleLabel.text = "二手车信息"
mineView.canbao.titleLabel.text = "参保救援职业责任险"
mineView.banbenjiance.titleLabel.text = "版本检测" mineView.banbenjiance.titleLabel.text = "版本检测"
mineView.tongzhitixing.titleLabel.text = "通知提醒" mineView.tongzhitixing.titleLabel.text = "通知提醒"
@@ -278,6 +286,38 @@ open class MineController : ZDViewController {
NewTraining.default.newTrainingRelay.accept(nil) NewTraining.default.newTrainingRelay.accept(nil)
preRefreshRelay.accept(nil) preRefreshRelay.accept(nil)
} }
open override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if WEBTOOL.bannerInMineDataSourcesContains(name: .indexList) || WEBTOOL.bannerInMineDataSourcesContains(name: .insuredPage) {
mineView.usedCarRadiusView.isHidden = false
if WEBTOOL.bannerInMineDataSourcesContains(name: .indexList) {
mineView.ershouche.isHidden = false
mineView.ershouche.snp.updateConstraints { make in
make.height.equalTo(auto(55))
}
}else{
mineView.ershouche.isHidden = true
mineView.ershouche.snp.updateConstraints { make in
make.height.equalTo(0)
}
}
if WEBTOOL.bannerInMineDataSourcesContains(name: .insuredPage) {
mineView.canbao.isHidden = false
mineView.canbao.snp.updateConstraints { make in
make.height.equalTo(auto(55))
}
}else{
mineView.canbao.isHidden = true
mineView.canbao.snp.updateConstraints { make in
make.height.equalTo(0)
}
}
}else{
mineView.usedCarRadiusView.isHidden = true
}
}
} }
open class MineView : DDView { open class MineView : DDView {
@@ -315,6 +355,8 @@ open class MineView : DDView {
public let wendangziliao : MineCell public let wendangziliao : MineCell
public let ershoucheGes : UITapGestureRecognizer public let ershoucheGes : UITapGestureRecognizer
public let ershouche : MineCell public let ershouche : MineCell
public let canbaoGes : UITapGestureRecognizer
public let canbao : MineCell
public let banbenjianceGes : UITapGestureRecognizer public let banbenjianceGes : UITapGestureRecognizer
public let banbenjiance : MineCell public let banbenjiance : MineCell
public let tongzhitixingGes : UITapGestureRecognizer public let tongzhitixingGes : UITapGestureRecognizer
@@ -356,6 +398,8 @@ open class MineView : DDView {
wendangziliao = MineCell() wendangziliao = MineCell()
ershoucheGes = UITapGestureRecognizer() ershoucheGes = UITapGestureRecognizer()
ershouche = MineCell() ershouche = MineCell()
canbaoGes = UITapGestureRecognizer()
canbao = MineCell()
banbenjianceGes = UITapGestureRecognizer() banbenjianceGes = UITapGestureRecognizer()
banbenjiance = MineCell() banbenjiance = MineCell()
tongzhitixingGes = UITapGestureRecognizer() tongzhitixingGes = UITapGestureRecognizer()
@@ -420,11 +464,16 @@ open class MineView : DDView {
wendangziliao.line.isHidden = true wendangziliao.line.isHidden = true
wendangziliao.addGestureRecognizer(wendangziliaoGes) wendangziliao.addGestureRecognizer(wendangziliaoGes)
materialRadiusView.addSubview(wendangziliao) materialRadiusView.addSubview(wendangziliao)
usedCarRadiusView.isHidden = true
ershouche.addGestureRecognizer(ershoucheGes) ershouche.addGestureRecognizer(ershoucheGes)
ershouche.line.isHidden = true
ershouche.contentImageView.image = UIImage(named: "ershouche_new") ershouche.contentImageView.image = UIImage(named: "ershouche_new")
ershouche.contentLabel.text = "0" ershouche.contentLabel.text = "0"
ershouche.isHidden = true
usedCarRadiusView.addSubview(ershouche) usedCarRadiusView.addSubview(ershouche)
canbao.addGestureRecognizer(canbaoGes)
canbao.line.isHidden = true
canbao.isHidden = true
usedCarRadiusView.addSubview(canbao)
banbenjiance.addGestureRecognizer(banbenjianceGes) banbenjiance.addGestureRecognizer(banbenjianceGes)
settingsRadiusView.addSubview(banbenjiance) settingsRadiusView.addSubview(banbenjiance)
tongzhitixing.line.isHidden = true tongzhitixing.line.isHidden = true
@@ -509,7 +558,6 @@ open class MineView : DDView {
make.top.equalTo(materialRadiusView.snp.bottom).offset(auto(10)) make.top.equalTo(materialRadiusView.snp.bottom).offset(auto(10))
make.width.equalTo(infoRadiusView) make.width.equalTo(infoRadiusView)
make.centerX.equalToSuperview() make.centerX.equalToSuperview()
make.height.equalTo(auto(55))
} }
settingsRadiusView.snp.makeConstraints { make in settingsRadiusView.snp.makeConstraints { make in
@@ -563,7 +611,14 @@ open class MineView : DDView {
} }
ershouche.snp.makeConstraints { make in ershouche.snp.makeConstraints { make in
make.edges.equalToSuperview() make.left.top.right.equalToSuperview()
make.height.equalTo(0)
}
canbao.snp.makeConstraints { make in
make.top.equalTo(ershouche.snp.bottom)
make.left.bottom.right.equalToSuperview()
make.height.equalTo(0)
} }
banbenjiance.snp.makeConstraints { make in banbenjiance.snp.makeConstraints { make in

View File

@@ -123,7 +123,9 @@ extension RescueController {
.observe(on: MainScheduler.instance) .observe(on: MainScheduler.instance)
.subscribe(onNext: {[weak self] response in .subscribe(onNext: {[weak self] response in
if response?.success == true { if response?.success == true {
self?.bannerDataSources = response?.data?.bannerConfig ?? [] let bannerConfig = response?.data?.bannerConfig ?? []
WEBTOOL.bannerInMineDataSources = bannerConfig
self?.bannerDataSources = bannerConfig
self?.pagerView.reloadData() self?.pagerView.reloadData()
if let count = self?.bannerDataSources.count, count > 0 { if let count = self?.bannerDataSources.count, count > 0 {
self?.pagerView.snp.updateConstraints({ make in self?.pagerView.snp.updateConstraints({ make in