|
@@ -19,11 +19,24 @@ public let cUserProtocol = "https://weapppiccdn.yishihui.com/resources/agreement
|
|
public let cPrivacy = "https://weapppiccdn.yishihui.com/resources/agreements/shishuo/videoagreement.html?type=20"
|
|
public let cPrivacy = "https://weapppiccdn.yishihui.com/resources/agreements/shishuo/videoagreement.html?type=20"
|
|
|
|
|
|
class INRecorderController: BFBaseViewController {
|
|
class INRecorderController: BFBaseViewController {
|
|
- lazy var addVideoBtn: UIButton = {
|
|
|
|
|
|
+ lazy var photoBtn: UIButton = {
|
|
let btn = UIButton(type: .custom)
|
|
let btn = UIButton(type: .custom)
|
|
- // btn.setTitle("Add", for: .normal)
|
|
|
|
btn.setImage(UIImage(named: "add"), for: .normal)
|
|
btn.setImage(UIImage(named: "add"), for: .normal)
|
|
|
|
+ btn.setTitle("从相册选择", for: .normal)
|
|
|
|
+ btn.titleLabel?.font = UIFont.systemFont(ofSize: 14)
|
|
btn.addTarget(self, action: #selector(addVideo), for: .touchUpInside)
|
|
btn.addTarget(self, action: #selector(addVideo), for: .touchUpInside)
|
|
|
|
+ btn.imageEdgeInsets = UIEdgeInsets(top: -btn.imageView!.height, left: 0, bottom: 0, right: -btn.titleLabel!.width)
|
|
|
|
+ btn.titleEdgeInsets = UIEdgeInsets(top: btn.titleLabel!.height + 2, left: -btn.imageView!.width, bottom: 0, right: 0)
|
|
|
|
+ return btn
|
|
|
|
+ }()
|
|
|
|
+
|
|
|
|
+ lazy var camaraBtn: UIButton = {
|
|
|
|
+ let btn = UIButton(type: .custom)
|
|
|
|
+ btn.setImage(UIImage(named: "add"), for: .normal)
|
|
|
|
+ btn.setTitle("拍摄录制", for: .normal)
|
|
|
|
+ btn.titleLabel?.font = UIFont.systemFont(ofSize: 14)
|
|
|
|
+ btn.addTarget(self, action: #selector(cameraBtnAction), for: .touchUpInside)
|
|
|
|
+
|
|
return btn
|
|
return btn
|
|
}()
|
|
}()
|
|
|
|
|
|
@@ -177,16 +190,23 @@ class INRecorderController: BFBaseViewController {
|
|
view.addSubview(centerView)
|
|
view.addSubview(centerView)
|
|
view.addSubview(bottomView)
|
|
view.addSubview(bottomView)
|
|
centerView.snp.makeConstraints { make in
|
|
centerView.snp.makeConstraints { make in
|
|
- make.width.equalTo(140)
|
|
|
|
|
|
+ make.width.equalToSuperview()
|
|
make.height.equalTo(209)
|
|
make.height.equalTo(209)
|
|
make.center.equalToSuperview()
|
|
make.center.equalToSuperview()
|
|
}
|
|
}
|
|
|
|
|
|
- centerView.addSubview(addVideoBtn)
|
|
|
|
- addVideoBtn.snp.makeConstraints { make in
|
|
|
|
- make.top.equalToSuperview().offset(5)
|
|
|
|
- make.left.equalToSuperview().offset(5)
|
|
|
|
- make.width.height.equalTo(130)
|
|
|
|
|
|
+ centerView.addSubview(camaraBtn)
|
|
|
|
+ centerView.addSubview(photoBtn)
|
|
|
|
+ camaraBtn.snp.makeConstraints { make in
|
|
|
|
+ make.width.equalTo(130)
|
|
|
|
+ make.height.equalTo(180)
|
|
|
|
+ make.centerX.equalToSuperview().offset(-71.5)
|
|
|
|
+ make.centerY.equalToSuperview()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ photoBtn.snp.makeConstraints { make in
|
|
|
|
+ make.left.equalTo(camaraBtn.snp.right).offset(13)
|
|
|
|
+ make.width.height.centerY.equalTo(camaraBtn)
|
|
}
|
|
}
|
|
|
|
|
|
let l = UILabel()
|
|
let l = UILabel()
|
|
@@ -205,10 +225,10 @@ class INRecorderController: BFBaseViewController {
|
|
l.sizeToFit()
|
|
l.sizeToFit()
|
|
l.numberOfLines = 2
|
|
l.numberOfLines = 2
|
|
l.snp.makeConstraints { make in
|
|
l.snp.makeConstraints { make in
|
|
- make.top.equalTo(addVideoBtn.snp.bottom).offset(19)
|
|
|
|
|
|
+ make.bottom.equalTo(photoBtn.snp.top).offset(-5)
|
|
make.centerX.equalToSuperview()
|
|
make.centerX.equalToSuperview()
|
|
make.width.equalTo(200)
|
|
make.width.equalTo(200)
|
|
- make.height.equalTo(60)
|
|
|
|
|
|
+ make.height.equalTo(40)
|
|
}
|
|
}
|
|
|
|
|
|
//欢迎界面
|
|
//欢迎界面
|
|
@@ -263,6 +283,16 @@ class INRecorderController: BFBaseViewController {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ override func viewDidLayoutSubviews() {
|
|
|
|
+ var btn = camaraBtn
|
|
|
|
+ btn.imageEdgeInsets = UIEdgeInsets(top: -btn.titleLabel!.height - 2, left: 0, bottom: 0, right: -btn.titleLabel!.width)
|
|
|
|
+ btn.titleEdgeInsets = UIEdgeInsets(top: btn.imageView!.height + 8, left: -btn.imageView!.width, bottom: 0, right: 0)
|
|
|
|
+
|
|
|
|
+ btn = photoBtn
|
|
|
|
+ btn.imageEdgeInsets = UIEdgeInsets(top: -btn.titleLabel!.height - 2, left: 0, bottom: 0, right: -btn.titleLabel!.width)
|
|
|
|
+ btn.titleEdgeInsets = UIEdgeInsets(top: btn.imageView!.height + 8, left: -btn.imageView!.width, bottom: 0, right: 0)
|
|
|
|
+ }
|
|
|
|
+
|
|
@objc func doneAction() {
|
|
@objc func doneAction() {
|
|
welcomeBackView.isHidden = true
|
|
welcomeBackView.isHidden = true
|
|
|
|
|
|
@@ -295,6 +325,11 @@ class INRecorderController: BFBaseViewController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @objc func cameraBtnAction() {
|
|
|
|
+ let vc = INIntroduceController()
|
|
|
|
+ navigationController?.pushViewController(vc, animated: true)
|
|
|
|
+ }
|
|
|
|
+
|
|
@objc func protocolClick(sender:UIButton) {
|
|
@objc func protocolClick(sender:UIButton) {
|
|
var link: String?
|
|
var link: String?
|
|
if sender.tag == 1 {
|
|
if sender.tag == 1 {
|