参保救援责任险
This commit is contained in:
@@ -20,6 +20,8 @@ open class WebViewTool : NSObject {
|
||||
private var disposeBag = DisposeBag()
|
||||
public var h5Models : DispatchAppH5UrlDataModel?
|
||||
|
||||
public var bannerInMineDataSources : [ConfigByCodeDataModel.ConfigByCodeBannerModel]?
|
||||
|
||||
enum WebViewNameEnum : String {
|
||||
case todoList = "待办事项"
|
||||
case workOrderReconciliation = "工单对账"
|
||||
@@ -39,6 +41,7 @@ open class WebViewTool : NSObject {
|
||||
case batteryList = "电瓶进销存"
|
||||
case invoiceListInfo = "开票信息"
|
||||
case indexList = "二手车信息"
|
||||
case insuredPage = "参保救援职业责任险"
|
||||
case reportIndex = "报备"
|
||||
case vehicleAlarmDetail = "报警详情"
|
||||
case vehicleAlarmList = "车辆报警"
|
||||
@@ -141,7 +144,10 @@ open class WebViewTool : NSObject {
|
||||
vc = WebViewController(showNavBar:false, title: nil, url: "\((h5Models?.invoiceListInfo)!)?token=\((USER.token)!)"+(appending ?? ""))
|
||||
break
|
||||
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
|
||||
case .reportIndex:
|
||||
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)
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,6 +168,13 @@ extension MineController {
|
||||
})
|
||||
.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
|
||||
.observe(on: MainScheduler.instance)
|
||||
.subscribe(onNext: { _ in
|
||||
@@ -229,6 +236,7 @@ open class MineController : ZDViewController {
|
||||
mineView.peixunwendang.titleLabel.text = "培训文档"
|
||||
mineView.wendangziliao.titleLabel.text = "文档资料"
|
||||
mineView.ershouche.titleLabel.text = "二手车信息"
|
||||
mineView.canbao.titleLabel.text = "参保救援职业责任险"
|
||||
mineView.banbenjiance.titleLabel.text = "版本检测"
|
||||
mineView.tongzhitixing.titleLabel.text = "通知提醒"
|
||||
|
||||
@@ -278,6 +286,38 @@ open class MineController : ZDViewController {
|
||||
NewTraining.default.newTrainingRelay.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 {
|
||||
@@ -315,6 +355,8 @@ open class MineView : DDView {
|
||||
public let wendangziliao : MineCell
|
||||
public let ershoucheGes : UITapGestureRecognizer
|
||||
public let ershouche : MineCell
|
||||
public let canbaoGes : UITapGestureRecognizer
|
||||
public let canbao : MineCell
|
||||
public let banbenjianceGes : UITapGestureRecognizer
|
||||
public let banbenjiance : MineCell
|
||||
public let tongzhitixingGes : UITapGestureRecognizer
|
||||
@@ -356,6 +398,8 @@ open class MineView : DDView {
|
||||
wendangziliao = MineCell()
|
||||
ershoucheGes = UITapGestureRecognizer()
|
||||
ershouche = MineCell()
|
||||
canbaoGes = UITapGestureRecognizer()
|
||||
canbao = MineCell()
|
||||
banbenjianceGes = UITapGestureRecognizer()
|
||||
banbenjiance = MineCell()
|
||||
tongzhitixingGes = UITapGestureRecognizer()
|
||||
@@ -420,11 +464,16 @@ open class MineView : DDView {
|
||||
wendangziliao.line.isHidden = true
|
||||
wendangziliao.addGestureRecognizer(wendangziliaoGes)
|
||||
materialRadiusView.addSubview(wendangziliao)
|
||||
usedCarRadiusView.isHidden = true
|
||||
ershouche.addGestureRecognizer(ershoucheGes)
|
||||
ershouche.line.isHidden = true
|
||||
ershouche.contentImageView.image = UIImage(named: "ershouche_new")
|
||||
ershouche.contentLabel.text = "0"
|
||||
ershouche.isHidden = true
|
||||
usedCarRadiusView.addSubview(ershouche)
|
||||
canbao.addGestureRecognizer(canbaoGes)
|
||||
canbao.line.isHidden = true
|
||||
canbao.isHidden = true
|
||||
usedCarRadiusView.addSubview(canbao)
|
||||
banbenjiance.addGestureRecognizer(banbenjianceGes)
|
||||
settingsRadiusView.addSubview(banbenjiance)
|
||||
tongzhitixing.line.isHidden = true
|
||||
@@ -509,7 +558,6 @@ open class MineView : DDView {
|
||||
make.top.equalTo(materialRadiusView.snp.bottom).offset(auto(10))
|
||||
make.width.equalTo(infoRadiusView)
|
||||
make.centerX.equalToSuperview()
|
||||
make.height.equalTo(auto(55))
|
||||
}
|
||||
|
||||
settingsRadiusView.snp.makeConstraints { make in
|
||||
@@ -563,7 +611,14 @@ open class MineView : DDView {
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
@@ -123,7 +123,9 @@ extension RescueController {
|
||||
.observe(on: MainScheduler.instance)
|
||||
.subscribe(onNext: {[weak self] response in
|
||||
if response?.success == true {
|
||||
self?.bannerDataSources = response?.data?.bannerConfig ?? []
|
||||
let bannerConfig = response?.data?.bannerConfig ?? []
|
||||
WEBTOOL.bannerInMineDataSources = bannerConfig
|
||||
self?.bannerDataSources = bannerConfig
|
||||
self?.pagerView.reloadData()
|
||||
if let count = self?.bannerDataSources.count, count > 0 {
|
||||
self?.pagerView.snp.updateConstraints({ make in
|
||||
|
||||
Reference in New Issue
Block a user