update
This commit is contained in:
@@ -615,6 +615,7 @@ extension RescuePendingDispatchController : UITableViewDelegate,UITableViewDataS
|
||||
})
|
||||
}
|
||||
|
||||
cell?.photoCollectionView.tag = indexPath.row
|
||||
cell?.photoCollectionView.delegate = self
|
||||
cell?.photoCollectionView.dataSource = self
|
||||
cell?.photoCollectionView.register(RescuePendingDispatchPhotoCell.self, forCellWithReuseIdentifier: "cell")
|
||||
@@ -630,7 +631,6 @@ extension RescuePendingDispatchController : UITableViewDelegate,UITableViewDataS
|
||||
make.height.equalTo(auto(50))
|
||||
})
|
||||
if let environmentPics {
|
||||
self.environmentPics = environmentPics
|
||||
cell?.photoCollectionView.reloadData()
|
||||
}
|
||||
}else{
|
||||
@@ -763,11 +763,15 @@ extension RescueIsIngController : UITableViewDelegate,UITableViewDataSource {
|
||||
// MARK: UICollectionViewDelegate, UICollectionViewDataSource
|
||||
extension RescuePendingDispatchController : UICollectionViewDelegate, UICollectionViewDataSource {
|
||||
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
||||
let model = resultArr[collectionView.tag]
|
||||
let environmentPics = model.environmentPic?.components(separatedBy: ",") ?? []
|
||||
return environmentPics.count > 4 ? 4 : environmentPics.count
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as? RescuePendingDispatchPhotoCell
|
||||
let model = resultArr[collectionView.tag]
|
||||
let environmentPics = model.environmentPic?.components(separatedBy: ",") ?? []
|
||||
let imageUrlStr = environmentPics[indexPath.item]
|
||||
cell!.imageView.image = nil
|
||||
if imageUrlStr.contains(".mp4?") == true {
|
||||
@@ -787,6 +791,8 @@ extension RescuePendingDispatchController : UICollectionViewDelegate, UICollecti
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
||||
let model = resultArr[collectionView.tag]
|
||||
let environmentPics = model.environmentPic?.components(separatedBy: ",") ?? []
|
||||
let vc = RescuePhotoController(environmentPics: environmentPics)
|
||||
navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
@@ -813,6 +819,7 @@ class RescueController : ZDViewController {
|
||||
super.viewDidLoad()
|
||||
dd_navigationBarBackgroundColor = .hex("354683")
|
||||
dd_navigationBarTitleTextAttributes = [.foregroundColor : UIColor.white(alpha: 0.7),.font:UIFont.mediumFont(auto(15))]
|
||||
dd_navigationBarBarButtonItemAttributes = [.foregroundColor : UIColor.white]
|
||||
dd_navigationItemTitle = "救援工单"
|
||||
navigationItem.leftBarButtonItems = nil
|
||||
addSubviews()
|
||||
@@ -872,7 +879,7 @@ class RescueController : ZDViewController {
|
||||
}
|
||||
|
||||
// MARK: 待派单
|
||||
class RescuePendingOrderController : DDViewController {
|
||||
class RescuePendingOrderController : ZDViewController {
|
||||
private let disposeBag = DisposeBag()
|
||||
public let pendingOrderView = RescuePendingOrderView()
|
||||
private var resultArr : [OrderListDataModel] = []
|
||||
@@ -887,6 +894,7 @@ class RescuePendingOrderController : DDViewController {
|
||||
super.viewDidLoad()
|
||||
dd_navigationBarBackgroundColor = .hex("354683")
|
||||
dd_navigationBarTitleTextAttributes = [.foregroundColor : UIColor.white(alpha: 0.7),.font:UIFont.mediumFont(17)]
|
||||
dd_navigationBarBarButtonItemAttributes = [.foregroundColor : UIColor.white]
|
||||
addSubviews()
|
||||
addActions()
|
||||
}
|
||||
@@ -911,11 +919,10 @@ class RescuePendingOrderController : DDViewController {
|
||||
}
|
||||
|
||||
// MARK: 待派车
|
||||
class RescuePendingDispatchController : DDViewController {
|
||||
class RescuePendingDispatchController : ZDViewController {
|
||||
private let disposeBag = DisposeBag()
|
||||
public let pendingDispatchView = RescuePendingDispatchView()
|
||||
private var resultArr : [OrderListDataModel] = []
|
||||
private var environmentPics : [String] = []
|
||||
private var refreshRelay = ReplayRelay<Int>.create(bufferSize: 1)
|
||||
private var pageNum : Int = 1
|
||||
private var emptyView = EmptyView()
|
||||
@@ -924,6 +931,7 @@ class RescuePendingDispatchController : DDViewController {
|
||||
super.viewDidLoad()
|
||||
dd_navigationBarBackgroundColor = .hex("354683")
|
||||
dd_navigationBarTitleTextAttributes = [.foregroundColor : UIColor.white(alpha: 0.7),.font:UIFont.mediumFont(17)]
|
||||
dd_navigationBarBarButtonItemAttributes = [.foregroundColor : UIColor.white]
|
||||
addSubviews()
|
||||
addActions()
|
||||
}
|
||||
@@ -948,7 +956,7 @@ class RescuePendingDispatchController : DDViewController {
|
||||
}
|
||||
|
||||
// MARK: 救援中
|
||||
class RescueIsIngController : DDViewController {
|
||||
class RescueIsIngController : ZDViewController {
|
||||
private let disposeBag = DisposeBag()
|
||||
public let pendingIsIngView = RescueIsIngView()
|
||||
private var resultArr : [OrderListDataModel] = []
|
||||
@@ -960,6 +968,7 @@ class RescueIsIngController : DDViewController {
|
||||
super.viewDidLoad()
|
||||
dd_navigationBarBackgroundColor = .hex("354683")
|
||||
dd_navigationBarTitleTextAttributes = [.foregroundColor : UIColor.white(alpha: 0.7),.font:UIFont.mediumFont(17)]
|
||||
dd_navigationBarBarButtonItemAttributes = [.foregroundColor : UIColor.white]
|
||||
addSubviews()
|
||||
addActions()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user