Commit 998c1e9a authored by David黄金龙's avatar David黄金龙

处理一处 视频播放的问题

parent 8c7ff515
......@@ -156,11 +156,14 @@ extension YHHomePageViewController: UICollectionViewDelegate, UICollectionViewDa
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
guard let model = self.viewModel.arrHomeNewsData?[indexPath.row] else { return }
if model.type == 2 {
let vc = YHHomeWebViewController()
vc.url = YHConfigManager.shared.h5Url + "?id=\(model.id)"
vc.id = model.id
self.navigationController?.pushViewController(vc)
} else if model.type == 1 {
printLog("直接播放视频")
}
}
}
......
......@@ -178,9 +178,15 @@ extension YHHomeCollectionViewCell {
heartImageViewBtn.isSelected = listModel.is_like
if listModel.type == 1 {
//视频
playButton.isHidden = false
let tap = UITapGestureRecognizer(target: self, action: #selector(tapView(gestureRecognizer:)))
contentView.addGestureRecognizer(tap)
} else {
//资讯
playButton.isHidden = true
contentView.removeGestureRecognizers()
}
}
......@@ -215,4 +221,9 @@ extension YHHomeCollectionViewCell {
self.parentViewController?.navigationController?.present(vc, animated: true)
}
}
@objc func tapView(gestureRecognizer:UITapGestureRecognizer) {
clickPlayButton()
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment