CNLiveMineGiftCell.swift
3.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//
// CNLiveMineGiftCell.swift
// metaCode
//
// Created by zx on 2025/4/25.
//
import Foundation
import CNLiveShareToolKit
class CNLiveMineGiftCell:UITableViewCell{
//giftModel
var _giftModel : CNLiveHomePageHuBiLieGiftModel?
var giftModel : CNLiveHomePageHuBiLieGiftModel? {
get{
_giftModel
}
set{
_giftModel = newValue
let mine_image = _giftModel?.data?.share_app_banner?.mine_image
self.iconImgView.kf.setImage(with: URL(string: mine_image ?? ""))
}
}
lazy var mainView: UIView = {
let mainView = UIView.init()
mainView.backgroundColor = .white
mainView.layer.cornerRadius = 15
mainView.layer.masksToBounds = true
return mainView
}()
lazy var iconImgView :UIImageView = {
let imageView = UIImageView()
imageView.layer.cornerRadius = 9
imageView.clipsToBounds = true
imageView.contentMode = .scaleAspectFill
imageView.isUserInteractionEnabled = true
imageView.addGestureRecognizer(UITapGestureRecognizer.init(target: self, action: #selector(imgTapAction)))
return imageView
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
self.selectionStyle = .none
self.backgroundColor = .clear
contentView.backgroundColor = .clear
self.contentView.clipsToBounds = true
self.initUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func initUI(){
addSubview(mainView)
mainView.addSubview(iconImgView)
mainView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.left.equalToSuperview().offset(15)
make.right.equalToSuperview().offset(-15)
make.top.bottom.equalToSuperview()
}
iconImgView.snp.makeConstraints { make in
make.left.equalTo(0)
make.top.equalTo(0)
make.height.equalTo(Float(CNLiveHomeADH))
make.width.equalTo(CNLiveHomeADW)
}
}
@objc func imgTapAction(ges: UITapGestureRecognizer){
// let jumpUrl = self.giftModel?.data?.share_app_banner?.jumpUrl
let shareTitle = metaAppDelegate.giftModel?.data?.share_app_banner?.share_title
let shareDesc = metaAppDelegate.giftModel?.data?.share_app_banner?.share_content
let shareImage = metaAppDelegate.giftModel?.data?.share_app_banner?.share_icon
let shareUrl = metaAppDelegate.giftModel?.data?.share_app_banner?.jumpUrl
CNLiveShareManager.showShareViewWithParam(forShareTitle: shareTitle, shareUrl: shareUrl, shareDesc: shareDesc, shareImage: shareImage, screenFull: false, hiddenWjj: true, hiddenQQ: true, hiddenWB: true, hiddenLifeCircle: true, hiddenWechatCircle: false, hiddenWechat: false, hiddenSafari: true, formVC: currentViewController(), topImage: [], topTitles: [], platformType: .all) { title in
} completerBlock: { resultType, platformType, typeString in
if resultType == .succ{
print("succ")
}
}
}
}