充电管理

This commit is contained in:
ddisfriend
2026-07-21 16:01:24 +08:00
parent 8d7ab063c1
commit 324b4e22a5
5 changed files with 68 additions and 27 deletions
@@ -49,6 +49,7 @@ open class WebViewTool : NSObject {
case vehicleAlarmList = "车辆报警" case vehicleAlarmList = "车辆报警"
case kpiCaseNew = "服务商案件和车辆情况统计" case kpiCaseNew = "服务商案件和车辆情况统计"
case managerPeople = "管理人员" case managerPeople = "管理人员"
case gjUrl = "充电管理"
} }
public override init() { public override init() {
@@ -168,6 +169,9 @@ open class WebViewTool : NSObject {
case .managerPeople: case .managerPeople:
vc = WebViewController(showNavBar:false, title: nil, url: "\((h5Models?.managerPeople)!)?token=\((USER.token)!)"+(appending ?? "")) vc = WebViewController(showNavBar:false, title: nil, url: "\((h5Models?.managerPeople)!)?token=\((USER.token)!)"+(appending ?? ""))
break break
case .gjUrl:
vc = WebViewController(showNavBar:true, title: nil, url: "\((h5Models?.gjUrl)!)?"+(appending ?? ""))
break
} }
if let vc { if let vc {
@@ -93,4 +93,6 @@ open class ApiList {
public let vehicleMonitorInfo = "/supplierAppV2/dispatchApp/order/vehicleMonitorInfo" public let vehicleMonitorInfo = "/supplierAppV2/dispatchApp/order/vehicleMonitorInfo"
public let selectCountBySupplierId = "/order/taskInvoiceBatch/selectCountBySupplierId" public let selectCountBySupplierId = "/order/taskInvoiceBatch/selectCountBySupplierId"
public let gjTokenInfo = "/supplierAppV2/dispatchApp/user/gj/tokenInfo"
} }
@@ -192,4 +192,8 @@ open class RequestList {
func selectCountBySupplierId<P:Encodable>(parameters:P) -> Single<ResponseModel<Int>?> { func selectCountBySupplierId<P:Encodable>(parameters:P) -> Single<ResponseModel<Int>?> {
return DDAF.get(urlString: HOST+API.selectCountBySupplierId,parameters: parameters,encoding: URLEncodedFormParameterEncoder.default,headers: [tokenHeader()],responseType: ResponseModel<Int>.self) return DDAF.get(urlString: HOST+API.selectCountBySupplierId,parameters: parameters,encoding: URLEncodedFormParameterEncoder.default,headers: [tokenHeader()],responseType: ResponseModel<Int>.self)
} }
func gjTokenInfo() -> Single<ResponseModel<String>?> {
return DDAF.post(urlString: HOST+API.gjTokenInfo,encoding: URLEncodedFormParameterEncoder.default,headers: [tokenHeader()],responseType: ResponseModel<String>.self)
}
} }
@@ -293,6 +293,7 @@ public class DispatchAppH5UrlDataModel : Decodable {
var vehicleAlarmDetail : String var vehicleAlarmDetail : String
var kpiCaseNew : String var kpiCaseNew : String
var managerPeople : String var managerPeople : String
var gjUrl : String
} }
public class UpdateVersionDataModel : Decodable { public class UpdateVersionDataModel : Decodable {
@@ -208,6 +208,25 @@ extension MineController {
}) })
.disposed(by: disposeBag) .disposed(by: disposeBag)
mineView.chongdianGes.rx.event
.observe(on: MainScheduler.instance)
.do(onNext: {[weak self] _ in
self?.view.dd_showHUD()
})
.flatMapLatest { _ in
return RQ.gjTokenInfo()
}
.observe(on: MainScheduler.instance)
.subscribe(onNext: {[weak self] response in
self?.view.dd_hideHUD()
if response?.success == true, let token = response?.data, let userId = USER.userId {
WEBTOOL.open(name: .gjUrl, appending: "userId=zd\(userId)&token=\(token)")
} else {
self?.view.dd_makeToast(response?.msg ?? "获取失败")
}
})
.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
@@ -273,6 +292,7 @@ open class MineController : ZDViewController {
mineView.wendangziliao.titleLabel.text = "文档资料" mineView.wendangziliao.titleLabel.text = "文档资料"
mineView.ershouche.titleLabel.text = "二手车信息" mineView.ershouche.titleLabel.text = "二手车信息"
mineView.canbao.titleLabel.text = "参保救援职业责任险" mineView.canbao.titleLabel.text = "参保救援职业责任险"
mineView.chongdian.titleLabel.text = "充电管理"
mineView.banbenjiance.titleLabel.text = "版本检测" mineView.banbenjiance.titleLabel.text = "版本检测"
mineView.tongzhitixing.titleLabel.text = "通知提醒" mineView.tongzhitixing.titleLabel.text = "通知提醒"
@@ -325,33 +345,31 @@ open class MineController : ZDViewController {
open override func viewWillAppear(_ animated: Bool) { open override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
if WEBTOOL.bannerInMineDataSourcesContains(name: .indexList) || WEBTOOL.bannerInMineDataSourcesContains(name: .insuredPage) { mineView.usedCarRadiusView.isHidden = false
mineView.usedCarRadiusView.isHidden = false
if WEBTOOL.bannerInMineDataSourcesContains(name: .indexList) { if WEBTOOL.bannerInMineDataSourcesContains(name: .indexList) {
mineView.ershouche.isHidden = false mineView.ershouche.isHidden = false
mineView.ershouche.snp.updateConstraints { make in mineView.ershouche.snp.updateConstraints { make in
make.height.equalTo(auto(55)) 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{ }else{
mineView.usedCarRadiusView.isHidden = true 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.line.isHidden = false
mineView.canbao.snp.updateConstraints { make in
make.height.equalTo(auto(55))
}
}else{
mineView.canbao.isHidden = true
mineView.canbao.line.isHidden = true
mineView.canbao.snp.updateConstraints { make in
make.height.equalTo(0)
}
} }
} }
} }
@@ -398,6 +416,8 @@ open class MineView : DDView {
public let ershouche : MineCell public let ershouche : MineCell
public let canbaoGes : UITapGestureRecognizer public let canbaoGes : UITapGestureRecognizer
public let canbao : MineCell public let canbao : MineCell
public let chongdianGes : UITapGestureRecognizer
public let chongdian : 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
@@ -446,6 +466,8 @@ open class MineView : DDView {
ershouche = MineCell() ershouche = MineCell()
canbaoGes = UITapGestureRecognizer() canbaoGes = UITapGestureRecognizer()
canbao = MineCell() canbao = MineCell()
chongdianGes = UITapGestureRecognizer()
chongdian = MineCell()
banbenjianceGes = UITapGestureRecognizer() banbenjianceGes = UITapGestureRecognizer()
banbenjiance = MineCell() banbenjiance = MineCell()
tongzhitixingGes = UITapGestureRecognizer() tongzhitixingGes = UITapGestureRecognizer()
@@ -529,9 +551,11 @@ open class MineView : DDView {
ershouche.isHidden = true ershouche.isHidden = true
usedCarRadiusView.addSubview(ershouche) usedCarRadiusView.addSubview(ershouche)
canbao.addGestureRecognizer(canbaoGes) canbao.addGestureRecognizer(canbaoGes)
canbao.line.isHidden = true
canbao.isHidden = true canbao.isHidden = true
usedCarRadiusView.addSubview(canbao) usedCarRadiusView.addSubview(canbao)
chongdian.addGestureRecognizer(chongdianGes)
chongdian.line.isHidden = true
usedCarRadiusView.addSubview(chongdian)
banbenjiance.addGestureRecognizer(banbenjianceGes) banbenjiance.addGestureRecognizer(banbenjianceGes)
settingsRadiusView.addSubview(banbenjiance) settingsRadiusView.addSubview(banbenjiance)
tongzhitixing.line.isHidden = true tongzhitixing.line.isHidden = true
@@ -675,10 +699,16 @@ open class MineView : DDView {
canbao.snp.makeConstraints { make in canbao.snp.makeConstraints { make in
make.top.equalTo(ershouche.snp.bottom) make.top.equalTo(ershouche.snp.bottom)
make.left.bottom.right.equalToSuperview() make.left.right.equalToSuperview()
make.height.equalTo(0) make.height.equalTo(0)
} }
chongdian.snp.makeConstraints { make in
make.top.equalTo(canbao.snp.bottom)
make.left.bottom.right.equalToSuperview()
make.height.equalTo(auto(55))
}
banbenjiance.snp.makeConstraints { make in banbenjiance.snp.makeConstraints { make in
make.left.top.right.equalToSuperview() make.left.top.right.equalToSuperview()
make.height.equalTo(auto(55)) make.height.equalTo(auto(55))