|
@@ -11,18 +11,35 @@ import BFFramework
|
|
|
|
|
|
class MVBannerCell: UICollectionViewCell {
|
|
|
|
|
|
- lazy var iconIView: UIImageView = {
|
|
|
+ //封面
|
|
|
+ lazy var converView: UIImageView = {
|
|
|
let iv = UIImageView()
|
|
|
+ iv.frame = CGRect.init(x: 0, y: 0, width: self.bounds.size.width, height: self.bounds.size.height)
|
|
|
iv.contentMode = .scaleAspectFill
|
|
|
+ iv.layer.masksToBounds = false
|
|
|
+ iv.layer.shadowColor = UIColor.black.cgColor
|
|
|
+ iv.layer.shadowOpacity = 0.8;//设置阴影的透明度
|
|
|
+ iv.layer.shadowOffset = CGSize.init(width: 5, height: 15)//设置阴影的偏移量
|
|
|
+
|
|
|
return iv
|
|
|
}()
|
|
|
|
|
|
+ lazy var progressView:UIProgressView = {
|
|
|
+
|
|
|
+ let progressView = UIProgressView(progressViewStyle: .default)
|
|
|
+ progressView.progressTintColor = .white
|
|
|
+ return progressView
|
|
|
+
|
|
|
+ }()
|
|
|
+
|
|
|
+
|
|
|
+ //下面 marks view
|
|
|
lazy var bottmMaskView: UIImageView = {
|
|
|
let bottmMaskView = UIImageView.init(image: UIImage.init(named: "home_marks"))
|
|
|
|
|
|
return bottmMaskView
|
|
|
}()
|
|
|
-
|
|
|
+ //暂停view
|
|
|
lazy var pauseView: UIImageView = {
|
|
|
let pauseView = UIImageView.init(image: UIImage.init(named: "video_pause"))
|
|
|
pauseView.isHidden = false
|
|
@@ -100,7 +117,7 @@ class MVBannerCell: UICollectionViewCell {
|
|
|
|
|
|
override func layoutSubviews() {
|
|
|
super.layoutSubviews()
|
|
|
- self.iconIView.frame = CGRect.init(x: 0, y: 0, width: self.bounds.size.width, height: self.bounds.size.height)
|
|
|
+
|
|
|
|
|
|
|
|
|
self.typeLabe.snp.remakeConstraints { make in
|
|
@@ -129,16 +146,23 @@ class MVBannerCell: UICollectionViewCell {
|
|
|
make.height.equalTo(82)
|
|
|
make.center.equalToSuperview()
|
|
|
}
|
|
|
+
|
|
|
+ self.progressView.snp.remakeConstraints { make in
|
|
|
+ make.width.equalTo(self.bounds.size.width)
|
|
|
+ make.height.equalTo(2)
|
|
|
+ make.bottom.equalToSuperview()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
override init(frame: CGRect) {
|
|
|
super.init(frame: frame)
|
|
|
- self.contentView.addSubview(self.iconIView)
|
|
|
+ self.contentView.addSubview(self.converView)
|
|
|
self.contentView.addSubview(self.bottmMaskView)
|
|
|
self.contentView.addSubview(self.typeLabe)
|
|
|
self.contentView.addSubview(self.musicNameView)
|
|
|
self.contentView.addSubview(self.reCreateBtn)
|
|
|
self.contentView.addSubview(self.pauseView)
|
|
|
+ self.contentView.addSubview(self.progressView)
|
|
|
|
|
|
}
|
|
|
|
|
@@ -151,7 +175,7 @@ class MVBannerCell: UICollectionViewCell {
|
|
|
|
|
|
let coverImg = (videoData?.videoCoverSnapshotPath != nil && (videoData?.videoCoverSnapshotPath?.count ?? 0) > 0) ? videoData?.videoCoverSnapshotPath ?? "" : (videoData?.coverImg?["coverImgPath"] as? String ?? "")
|
|
|
BFLog(message: "coverImg url is \(coverImg)")
|
|
|
- netImage(url: coverImg, mainView: iconIView)
|
|
|
+ netImage(url: coverImg, mainView: converView)
|
|
|
}
|
|
|
|
|
|
@objc func btnClick(sender: UIButton) {
|