Commit e4ea9d941a1c085d235f272ceca34c632426082a
Merge branch 'master' of http://bj.gitlab.cnlive.com/ios-team/CNLiveMateCode
Showing
9 changed files
with
106 additions
and
17 deletions
metaCode/Classes/Common/Util/CNLiveCommonQiniuTool.swift
| ... | ... | @@ -94,11 +94,15 @@ class UploadManager: NSObject { |
| 94 | 94 | param.setValue("POST", forKey: "verb") |
| 95 | 95 | param.setValue("2", forKey: "storageType") |
| 96 | 96 | param.setValue(kBucketName_QN, forKey: "bucket") |
| 97 | + let custom_param = NSMutableDictionary() | |
| 98 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appId, forKey: "appId") | |
| 99 | + custom_param.setValue(CNLiveEnvironmentManager.shared.appKey, forKey: "appKey") | |
| 100 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | |
| 97 | 101 | CNLiveNetworking.setupShowResult(true) |
| 98 | 102 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 99 | 103 | CNLiveNetworking.setupShowDataResult(false) |
| 100 | 104 | CNLiveNetworking.setupSignRequestKey(APPKey)//APPKey_wjj APPKey |
| 101 | - | |
| 105 | + | |
| 102 | 106 | CNLiveNetworking.requestNetwork(with: .POST, urlString: "\(CNLiveEnvironmentManager.shared.img_token_url)/vod_epg/getUploadAuthForApp", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 103 | 107 | hiddenLoading() |
| 104 | 108 | ... | ... |
metaCode/Classes/Main/VideoPage/View/CNLiveShortVideoContentListView.swift
| ... | ... | @@ -181,6 +181,16 @@ class CNLiveShortVideoContentListTableViewCell: UITableViewCell { |
| 181 | 181 | return imageView |
| 182 | 182 | }() |
| 183 | 183 | |
| 184 | + lazy var tipView: UIImageView = { | |
| 185 | + let imageView = UIImageView.init() | |
| 186 | + imageView.contentMode = .scaleAspectFill | |
| 187 | + imageView.layer.cornerRadius = 5 | |
| 188 | + imageView.layer.masksToBounds = true | |
| 189 | + imageView.clipsToBounds = true | |
| 190 | + imageView.isHidden = true | |
| 191 | + return imageView | |
| 192 | + }() | |
| 193 | + | |
| 184 | 194 | lazy var titleLabel: UILabel = { |
| 185 | 195 | let titleLabel = UILabel.init() |
| 186 | 196 | titleLabel.textColor = .white |
| ... | ... | @@ -210,6 +220,12 @@ class CNLiveShortVideoContentListTableViewCell: UITableViewCell { |
| 210 | 220 | make.width.equalTo(50) |
| 211 | 221 | make.height.equalTo(70) |
| 212 | 222 | } |
| 223 | + contentView.addSubview(tipView) | |
| 224 | + tipView.snp.makeConstraints { make in | |
| 225 | + make.left.top.equalToSuperview().offset(20) | |
| 226 | + make.width.equalTo(50) | |
| 227 | + make.height.equalTo(10) | |
| 228 | + } | |
| 213 | 229 | contentView.addSubview(titleLabel) |
| 214 | 230 | titleLabel.snp.makeConstraints { make in |
| 215 | 231 | make.left.equalTo(iconView.snp.right).offset(10) |
| ... | ... | @@ -231,6 +247,18 @@ class CNLiveShortVideoContentListTableViewCell: UITableViewCell { |
| 231 | 247 | paragraphStyle.lineSpacing = 6 |
| 232 | 248 | titleLabel.attributedText = NSAttributedString(string: listModel.title, attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle, ]) |
| 233 | 249 | timeLabel.text = listModel.duration |
| 250 | + | |
| 251 | + if listModel.product?.check == true { | |
| 252 | + if listModel.product?.albumProductType != "0" { | |
| 253 | + tipView.isHidden = false | |
| 254 | + tipView.image = UIImage(named: "short_video_free") | |
| 255 | + } | |
| 256 | + } else { | |
| 257 | + if listModel.product?.albumProductType != "0" { | |
| 258 | + tipView.isHidden = false | |
| 259 | + tipView.image = UIImage(named: "short_video_pay") | |
| 260 | + } | |
| 261 | + } | |
| 234 | 262 | } |
| 235 | 263 | |
| 236 | 264 | required init?(coder: NSCoder) { | ... | ... |
metaCode/Classes/Main/VideoPage/View/CNLiveShortVideoListTableViewCell.swift
| ... | ... | @@ -189,36 +189,35 @@ class CNLiveShortVideoListTableViewCell: UITableViewCell { |
| 189 | 189 | faviBtn.isHidden = model.albumMsgModel!.collection |
| 190 | 190 | listBtn.setTitle(model.albumMsgModel?.albumName, for: .normal) |
| 191 | 191 | |
| 192 | - | |
| 193 | - | |
| 194 | - | |
| 195 | - | |
| 196 | - | |
| 197 | - | |
| 198 | 192 | let imageV: UIImageView = payView.viewWithTag(1000) as! UIImageView |
| 199 | 193 | imageV.kf.indicatorType = .activity |
| 200 | 194 | imageV.kf.setImage(with: URL(string: model.poster)) |
| 201 | - let titleL: UILabel = payView.viewWithTag(1001) as! UILabel | |
| 195 | + let titleL: UILabel = payView.viewWithTag(1002) as! UILabel | |
| 202 | 196 | titleL.text = model.title |
| 203 | - let timeL: UILabel = payView.viewWithTag(1002) as! UILabel | |
| 197 | + let timeL: UILabel = payView.viewWithTag(1003) as! UILabel | |
| 204 | 198 | timeL.text = model.duration |
| 205 | - let payButton: APButton = payView.viewWithTag(1003) as! APButton | |
| 199 | + let payButton: APButton = payView.viewWithTag(1004) as! APButton | |
| 206 | 200 | |
| 201 | + let tipV: UIImageView = payView.viewWithTag(1001) as! UIImageView | |
| 207 | 202 | if model.product?.check == true { |
| 208 | 203 | //免费 |
| 209 | 204 | if model.product?.albumProductType == "0" { |
| 210 | - hiddenView(isHidden: true) | |
| 211 | - } else { | |
| 212 | 205 | hiddenView(isHidden: false) |
| 206 | + } else { | |
| 207 | + hiddenView(isHidden: true) | |
| 213 | 208 | payButton.setTitle("\(model.product!.point)积分解锁全集", for: .normal) |
| 209 | + tipV.isHidden = false | |
| 210 | + tipV.image = UIImage(named: "short_video_free") | |
| 214 | 211 | } |
| 215 | 212 | } else { |
| 216 | 213 | //需要付费 |
| 217 | 214 | if model.product?.albumProductType == "0" { |
| 218 | - hiddenView(isHidden: true) | |
| 219 | - } else { | |
| 220 | 215 | hiddenView(isHidden: false) |
| 216 | + } else { | |
| 217 | + hiddenView(isHidden: true) | |
| 221 | 218 | payButton.setTitle("\(model.product!.point)积分解锁全集", for: .normal) |
| 219 | + tipV.isHidden = false | |
| 220 | + tipV.image = UIImage(named: "short_video_pay") | |
| 222 | 221 | } |
| 223 | 222 | } |
| 224 | 223 | } |
| ... | ... | @@ -380,11 +379,25 @@ extension CNLiveShortVideoListTableViewCell { |
| 380 | 379 | make.height.equalTo(70) |
| 381 | 380 | } |
| 382 | 381 | |
| 382 | + let tipView = UIImageView.init() | |
| 383 | + tipView.contentMode = .scaleAspectFill | |
| 384 | + tipView.isHidden = true | |
| 385 | + tipView.layer.cornerRadius = 5 | |
| 386 | + tipView.layer.masksToBounds = true | |
| 387 | + tipView.clipsToBounds = true | |
| 388 | + tipView.tag = 1001 | |
| 389 | + view.addSubview(tipView) | |
| 390 | + tipView.snp.makeConstraints { make in | |
| 391 | + make.left.top.equalToSuperview().offset(20) | |
| 392 | + make.width.equalTo(50) | |
| 393 | + make.height.equalTo(10) | |
| 394 | + } | |
| 395 | + | |
| 383 | 396 | let titleLabel = UILabel.init() |
| 384 | 397 | titleLabel.textColor = .white |
| 385 | 398 | titleLabel.lineBreakMode = .byTruncatingTail |
| 386 | 399 | titleLabel.numberOfLines = 2 |
| 387 | - titleLabel.tag = 1001 | |
| 400 | + titleLabel.tag = 1002 | |
| 388 | 401 | titleLabel.font = medium_adapt_font(pointSize: 12) |
| 389 | 402 | view.addSubview(titleLabel) |
| 390 | 403 | titleLabel.snp.makeConstraints { make in |
| ... | ... | @@ -395,7 +408,7 @@ extension CNLiveShortVideoListTableViewCell { |
| 395 | 408 | |
| 396 | 409 | let timeLabel = UILabel.init() |
| 397 | 410 | timeLabel.textColor = .white |
| 398 | - timeLabel.tag = 1002 | |
| 411 | + timeLabel.tag = 1003 | |
| 399 | 412 | timeLabel.font = light_adapt_font(pointSize: 13) |
| 400 | 413 | view.addSubview(timeLabel) |
| 401 | 414 | timeLabel.snp.makeConstraints { make in |
| ... | ... | @@ -419,7 +432,7 @@ extension CNLiveShortVideoListTableViewCell { |
| 419 | 432 | payButton.layer.cornerRadius = 20 |
| 420 | 433 | payButton.activityIndicator.color = .white |
| 421 | 434 | payButton.layer.masksToBounds = true |
| 422 | - payButton.tag = 1003 | |
| 435 | + payButton.tag = 1004 | |
| 423 | 436 | payButton.backgroundColor = HexColor("#67C5FF") |
| 424 | 437 | payButton.titleLabel?.font = medium_adapt_font(pointSize: 15) |
| 425 | 438 | payButton.addTarget(self, action: #selector(payMethod), for: .touchUpInside) | ... | ... |
metaCode/Supporting Files/Assets.xcassets/Video/short_video_free.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "short_video_free@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "short_video_free@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
metaCode/Supporting Files/Assets.xcassets/Video/short_video_free.imageset/short_video_free@2x.png
0 → 100644
2.86 KB
metaCode/Supporting Files/Assets.xcassets/Video/short_video_free.imageset/short_video_free@3x.png
0 → 100644
5.77 KB
metaCode/Supporting Files/Assets.xcassets/Video/short_video_pay.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "short_video_pay@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "short_video_pay@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
metaCode/Supporting Files/Assets.xcassets/Video/short_video_pay.imageset/short_video_pay@2x.png
0 → 100644
2.2 KB
metaCode/Supporting Files/Assets.xcassets/Video/short_video_pay.imageset/short_video_pay@3x.png
0 → 100644
4.44 KB