Commit c83e09cf8f70bd8067a07231e38883083245a1fe

Authored by liushiyu
1 parent ddddcbe5

付费显示逻辑

metaCode/Classes/Main/VideoPage/Controller/CNLiveShortVideoViewController.swift
... ... @@ -156,18 +156,9 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele
156 156 self.controlView.videoPlayer((self.player)!, currentTime: self.player.currentTime, totalTime: self.player.totalTime)
157 157 let index = self.dataURLArray.index(of: assetURL.absoluteString)
158 158 let homeModel = self.dataArray[index] as! CNLiveAlbumListModel
159   - if (homeModel.product!.check == true) {
  159 + if homeModel.product?.check == false {
160 160 (self.player)!.stopCurrentPlayingCell()
161 161 }
162   - if homeModel.product?.check == true {
163   - if homeModel.product?.albumProductType != "0" {
164   - (self.player)!.stopCurrentPlayingCell()
165   - }
166   - } else {
167   - if homeModel.product?.albumProductType != "0" {
168   - (self.player)!.stopCurrentPlayingCell()
169   - }
170   - }
171 162 }
172 163 // 更新另一个控制层的时间
173 164 player.playerPlayTimeChanged = { [weak self] asset, currentTime, duration in
... ...
metaCode/Classes/Main/VideoPage/View/CNLiveShortVideoCommentListView.swift
... ... @@ -284,8 +284,8 @@ extension CNLiveShortVideoCommentListView {
284 284 cell.deleteBlock = {[weak self] commentModel in
285 285 guard let self = self else { return }
286 286 self.pageNum = 1
  287 + showLoading(message: "")
287 288 self.requestDataSource()
288   -
289 289 // let tempArray = NSMutableArray(array: self.dataArray)
290 290 // let tempModel = commentModel as! ShortVideoHomeCommentFListModel
291 291 // tempArray.forEach { itemModel in
... ... @@ -656,7 +656,7 @@ extension CNLiveShortVideoCommentListTableViewCell {
656 656 cell.setupWithReplyModel(replyModel: replyModel.replys[indexPath.row])
657 657 cell.deleteItemBlock = {[weak self] commentModel in
658 658 guard let self = self else { return }
659   - self.reloadBlcok(commentModel)
  659 + self.deleteBlock(commentModel)
660 660 // let tempArray = NSMutableArray(array: replyModel.replys)
661 661 // let tempModel = commentModel as! ShortVideoHomeCommentRListItemModel
662 662 // tempArray.forEach { itemModel in
... ...
metaCode/Classes/Main/VideoPage/View/CNLiveShortVideoContentListView.swift
... ... @@ -183,7 +183,7 @@ class CNLiveShortVideoContentListTableViewCell: UITableViewCell {
183 183  
184 184 lazy var tipView: UIImageView = {
185 185 let imageView = UIImageView.init()
186   - imageView.contentMode = .scaleAspectFill
  186 + imageView.contentMode = .scaleAspectFit
187 187 imageView.layer.cornerRadius = 5
188 188 imageView.layer.masksToBounds = true
189 189 imageView.clipsToBounds = true
... ... @@ -223,8 +223,7 @@ class CNLiveShortVideoContentListTableViewCell: UITableViewCell {
223 223 contentView.addSubview(tipView)
224 224 tipView.snp.makeConstraints { make in
225 225 make.left.top.equalToSuperview().offset(20)
226   - make.width.equalTo(50)
227   - make.height.equalTo(10)
  226 + make.height.equalTo(15)
228 227 }
229 228 contentView.addSubview(titleLabel)
230 229 titleLabel.snp.makeConstraints { make in
... ... @@ -254,10 +253,8 @@ class CNLiveShortVideoContentListTableViewCell: UITableViewCell {
254 253 tipView.image = UIImage(named: "short_video_free")
255 254 }
256 255 } else {
257   - if listModel.product?.albumProductType != "0" {
258   - tipView.isHidden = false
259   - tipView.image = UIImage(named: "short_video_pay")
260   - }
  256 + tipView.isHidden = false
  257 + tipView.image = UIImage(named: "short_video_pay")
261 258 }
262 259 }
263 260  
... ...
metaCode/Classes/Main/VideoPage/View/CNLiveShortVideoListTableViewCell.swift
... ... @@ -200,25 +200,14 @@ class CNLiveShortVideoListTableViewCell: UITableViewCell {
200 200  
201 201 let tipV: UIImageView = payView.viewWithTag(1001) as! UIImageView
202 202 if model.product?.check == true {
203   - //免费
204   - if model.product?.albumProductType == "0" {
205   - hiddenView(isHidden: false)
206   - } else {
207   - hiddenView(isHidden: true)
208   - payButton.setTitle("\(model.product!.point)积分解锁全集", for: .normal)
209   - tipV.isHidden = false
210   - tipV.image = UIImage(named: "short_video_free")
211   - }
  203 + //免费或者付过费了
  204 + hiddenView(isHidden: false)
212 205 } else {
213 206 //需要付费
214   - if model.product?.albumProductType == "0" {
215   - hiddenView(isHidden: false)
216   - } else {
217   - hiddenView(isHidden: true)
218   - payButton.setTitle("\(model.product!.point)积分解锁全集", for: .normal)
219   - tipV.isHidden = false
220   - tipV.image = UIImage(named: "short_video_pay")
221   - }
  207 + hiddenView(isHidden: true)
  208 + payButton.setTitle("\(model.product!.point)积分解锁全集", for: .normal)
  209 + tipV.isHidden = false
  210 + tipV.image = UIImage(named: "short_video_pay")
222 211 }
223 212 }
224 213  
... ... @@ -380,7 +369,7 @@ extension CNLiveShortVideoListTableViewCell {
380 369 }
381 370  
382 371 let tipView = UIImageView.init()
383   - tipView.contentMode = .scaleAspectFill
  372 + tipView.contentMode = .scaleAspectFit
384 373 tipView.isHidden = true
385 374 tipView.layer.cornerRadius = 5
386 375 tipView.layer.masksToBounds = true
... ... @@ -389,8 +378,7 @@ extension CNLiveShortVideoListTableViewCell {
389 378 view.addSubview(tipView)
390 379 tipView.snp.makeConstraints { make in
391 380 make.left.top.equalToSuperview().offset(20)
392   - make.width.equalTo(50)
393   - make.height.equalTo(10)
  381 + make.height.equalTo(15)
394 382 }
395 383  
396 384 let titleLabel = UILabel.init()
... ...