123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- //
- // EstuLogPhotoCell.swift
- // JiaPeiManage
- //
- // Created by Ning.ge on 2023/8/30.
- //
- import UIKit
- import ReactorKit
- import RxSwift
- final class EstuLogPhotoCell: BaseCollectionViewCell,View {
-
- let coverImageView = UIImageView().then{
- $0.contentMode = .scaleToFill
- }
-
- let timeLabel = UILabel().then{
- $0.textColor = UIColor.db_fontSelColor
- $0.font = NYFont.SysFont.sys_15
- $0.text = " 2023-08-24 13:18:07"
- $0.textAlignment = .center
- }
-
- let titleLabel = UILabel().then{
- $0.textColor = UIColor.db_fontSelColor
- $0.font = NYFont.SysFont.sys_15
- $0.text = "签退照片"
- $0.textAlignment = .center
- }
-
- var rowInfo:ETeachLogPhotoInfo?
-
- override func initialize() {
-
- let backgroundView = UIView()
- backgroundView.backgroundColor = UIColor("#0B2B4D")
- self.backgroundColor = UIColor("#0B2B4D")
- selectedBackgroundView = backgroundView
-
- coverImageView.image = UIImage(named: "矩形B")
- contentView.addSubview(coverImageView)
- contentView.addSubview(timeLabel)
- contentView.addSubview(titleLabel)
-
- }
-
- func setRowInfo(rowInfo:ETeachLogPhotoInfo){
- self.rowInfo = rowInfo
- coverImageView.sd_setImage(with:rowInfo.filepath?.urlValue)
- timeLabel.text = rowInfo.ptime
- titleLabel.text = rowInfo.eventStr
- }
-
- func bind(reactor: EstuLogPhotoCellReactor) {
- // reactor.state.map{$0.coverURL}
- // .bind(to: coverImageView.rx.image(placeholder: .placeholderImage(bgSize:placeholderSize)))
- // .disposed(by: disposeBag)
- // reactor.state.map{$0.title}
- // .distinctUntilChanged()
- // .bind(to: titleLabel.rx.text)
- // .disposed(by: disposeBag)
- //
- // reactor.state.map{$0.badge}
- // .filterNil()
- // .distinctUntilChanged()
- // .bind(to: badgeButton.rx.title(for: .normal))
- // .disposed(by: disposeBag)
- //
- // reactor.state.map{$0.latestUpdate}
- // .distinctUntilChanged()
- // .bind(to: latestUpdateLabel.rx.text)
- // .disposed(by: disposeBag)
- //
- // reactor.state.map{$0.tagDesc}
- // .filterNil()
- // .distinctUntilChanged()
- // .bind(to: tagLabel.rx.text)
- // .disposed(by: disposeBag)
- //
- // reactor.state.map{$0.latestUpdateColor}
- // .distinctUntilChanged()
- // .bind(to: latestUpdateLabel.rx.textColor)
- // .disposed(by: disposeBag)
- //
- // reactor.state.map{$0.badge == nil}
- // .distinctUntilChanged()
- // .bind(to: badgeButton.rx.isHidden)
- // .disposed(by: disposeBag)
- //
- // reactor.state.map{$0.tagDesc == nil}
- // .distinctUntilChanged()
- // .bind(to: tagLabel.rx.isHidden)
- // .disposed(by: disposeBag)
- //
- // reactor.state.map{!$0.isRcmd}
- // .distinctUntilChanged()
- // .bind(to: dramaButton.rx.isHidden)
- // .disposed(by: disposeBag)
- //
- // reactor.state.map{$0.isHiddenLine}
- // .distinctUntilChanged()
- // .bind(to: bottomLine.rx.isHidden)
- // .disposed(by: disposeBag)
- //
- // reactor.state.map{$0.favourites}
- // .filterNil()
- // .distinctUntilChanged()
- // .bind(to: favouriteLabel.rx.text)
- // .disposed(by: disposeBag)
- //
- // reactor.state.map{$0.watchProgress}
- // .filterNil()
- // .distinctUntilChanged()
- // .bind(to: favouriteLabel.rx.text)
- // .disposed(by: disposeBag)
- //
- //
- // dramaButton.rx.tap.subscribe(onNext: {[unowned self] (_) in
- //
- // self.dramaButton.isSelected = !self.dramaButton.isSelected
- // self.dramaButton.backgroundColor = self.dramaButton.isSelected ? UIColor.db_darkGray : UIColor.db_pink
- // guard let season_id = reactor.currentState.season_id,
- // let season_type = reactor.currentState.season_type
- // else { return }
- //
- // if self.dramaButton.isSelected {
- // reactor.action.onNext(.follow(season_id: season_id, season_type: season_type))
- // }else{
- // reactor.action.onNext(.unFollow(season_id: season_id, season_type: season_type))
- // }
- // }).disposed(by: disposeBag)
- //
- }
-
- class func cellSize(reactor:EstuLogPhotoCellReactor) -> CGSize {
-
- // var cellHeight = reactor.currentState.isRcmd ? Metric.coverRcmdHeight : Metric.coverDramaHeight
- // cellHeight += 2 * kCollectionItemPadding
- //
- return CGSize(width: NYFitReal.screenWidth*0.5, height: 172.0)
- }
-
- override func layoutSubviews() {
- super.layoutSubviews()
-
- coverImageView.snp.makeConstraints { (make) in
- make.left.equalTo(kCollectionItemPadding)
- make.top.equalTo(10)
- make.right.equalTo(-kCollectionItemPadding)
- make.height.equalTo(112)
- }
- timeLabel.snp.makeConstraints { (make) in
- make.left.right.equalToSuperview()
- make.top.equalTo(coverImageView.snp.bottom).offset(10)
- make.height.equalTo(20)
- }
- titleLabel.snp.makeConstraints { (make) in
- make.left.right.equalToSuperview()
- make.top.equalTo(timeLabel.snp.bottom)
- make.height.equalTo(20)
- }
-
- }
- }
|