Sfoglia il codice sorgente

Merge branch '1.1'

* 1.1:
  首页UI修改
harry 3 anni fa
parent
commit
c62d84822a

+ 2 - 2
Introduce/Record/INIntroduceController.swift

@@ -112,9 +112,9 @@ class INIntroduceController: BFBaseViewController {
 
         let okAction = UIAlertAction(title: "确认退出", style: .cancel, handler: {[weak self]
            action in
-           print("点击了确定")
            self?.recordScreenVC.backBtnClick()
-            self?.super_back()
+//            self?.super_back()
+            self?.navigationController?.popToRootViewController(animated: true)
         })
         okAction.setValue(UIColor.red, forKey:"titleTextColor")
 

+ 45 - 10
Introduce/Record/INRecorderController.swift

@@ -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"
 
 class INRecorderController: BFBaseViewController {
-    lazy var addVideoBtn: UIButton = {
+    lazy var photoBtn: UIButton = {
         let btn = UIButton(type: .custom)
-        //        btn.setTitle("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.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
     }()
     
@@ -177,16 +190,23 @@ class INRecorderController: BFBaseViewController {
         view.addSubview(centerView)
         view.addSubview(bottomView)
         centerView.snp.makeConstraints { make in
-            make.width.equalTo(140)
+            make.width.equalToSuperview()
             make.height.equalTo(209)
             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()
@@ -205,10 +225,10 @@ class INRecorderController: BFBaseViewController {
         l.sizeToFit()
         l.numberOfLines = 2
         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.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() {
         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) {
         var link: String?
         if sender.tag == 1 {