Jelajahi Sumber

添加设置界面

jsonwang 3 tahun lalu
induk
melakukan
5f89f7c0f6

+ 6 - 0
Introduce.xcodeproj/project.pbxproj

@@ -11,6 +11,7 @@
 		415C49D22763022900814766 /* Resources.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 415C49D12763022900814766 /* Resources.bundle */; };
 		41A112792766E12C0093BBF0 /* PQConfig.plist in Resources */ = {isa = PBXBuildFile; fileRef = 41A112782766E12C0093BBF0 /* PQConfig.plist */; };
 		41AA02822795579600597954 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 41AA02842795579600597954 /* InfoPlist.strings */; };
+		41B61B2D279ED11200F2AC54 /* INRecorderSetting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41B61B2C279ED11200F2AC54 /* INRecorderSetting.swift */; };
 		4A426DDD275484DF00B3733B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A426DDC275484DF00B3733B /* AppDelegate.swift */; };
 		4A426DE4275484DF00B3733B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4A426DE2275484DF00B3733B /* Main.storyboard */; };
 		4A426DE6275484E000B3733B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4A426DE5275484E000B3733B /* Assets.xcassets */; };
@@ -43,6 +44,7 @@
 		41AA027F2795572300597954 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
 		41AA0286279557C300597954 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = "<group>"; };
 		41AA0287279557C300597954 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/LaunchScreen.strings"; sourceTree = "<group>"; };
+		41B61B2C279ED11200F2AC54 /* INRecorderSetting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = INRecorderSetting.swift; sourceTree = "<group>"; };
 		4A426DD9275484DF00B3733B /* Introduce.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Introduce.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		4A426DDC275484DF00B3733B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
 		4A426DE3275484DF00B3733B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
@@ -129,6 +131,7 @@
 				4A426DFD2754A4F600B3733B /* INVideoExportController.swift */,
 				2D80D52A2773528C00D24520 /* INAppConfigUtil.swift */,
 				2D80D52C27741AC100D24520 /* Introduce-Bridging-Header.h */,
+				41B61B2C279ED11200F2AC54 /* INRecorderSetting.swift */,
 			);
 			path = Record;
 			sourceTree = "<group>";
@@ -303,6 +306,7 @@
 				2D80D52B2773528C00D24520 /* INAppConfigUtil.swift in Sources */,
 				4A426DF52754A27D00B3733B /* INRecorderController.swift in Sources */,
 				4A426DFE2754A4F600B3733B /* INVideoExportController.swift in Sources */,
+				41B61B2D279ED11200F2AC54 /* INRecorderSetting.swift in Sources */,
 				4A426DFC2754A4B200B3733B /* INIntroduceController.swift in Sources */,
 				4A426DF22754A1E300B3733B /* INTabbarController.swift in Sources */,
 			);
@@ -472,6 +476,7 @@
 			isa = XCBuildConfiguration;
 			baseConfigurationReference = F6FE9FC563C2B8CC6005F8C8 /* Pods-Introduce.debug.xcconfig */;
 			buildSettings = {
+				ARCHS = arm64;
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
@@ -518,6 +523,7 @@
 			isa = XCBuildConfiguration;
 			baseConfigurationReference = 3051DB0957784182F3E1AAD3 /* Pods-Introduce.release.xcconfig */;
 			buildSettings = {
+				ARCHS = arm64;
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";

+ 23 - 0
Introduce/Assets.xcassets/home/set.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "filename" : "set.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "set@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "set@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

TEMPAT SAMPAH
Introduce/Assets.xcassets/home/set.imageset/set.png


TEMPAT SAMPAH
Introduce/Assets.xcassets/home/set.imageset/set@2x.png


TEMPAT SAMPAH
Introduce/Assets.xcassets/home/set.imageset/set@3x.png


+ 23 - 41
Introduce/Record/INRecorderController.swift

@@ -147,51 +147,21 @@ class INRecorderController: BFBaseViewController {
         return cancleBtn
     }()
     
+    lazy var settingBtn: UIButton = {
+        let btn = UIButton(type: .custom)
+        btn.setImage(UIImage(named: "set"), for: .normal)
+        btn.addTarget(self, action: #selector(settingBtnAction), for: .touchUpInside)
+
+        return btn
+    }()
+    
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
         hiddenNavigation()
         // 曝光上报
         BFEventTrackAdaptor.baseReportUpload(businessType: .bt_pageView, objectType: nil, pageSource: .sp_homePage, commonParams: commonParams())
     }
-    
-    lazy var bottomView:UIView = {
-        let bottomView = UIView(frame:CGRect.init(x: 0, y: view.frame.height - cSafeAreaHeight - 20 - 30, width: view.frame.width, height: 30))
-        let userProBtn = UIButton.init(type: .custom)
-        userProBtn.setTitle("hone_privacy".BFLocale, for: .normal)
-        userProBtn.tag = 1
-        userProBtn.titleLabel?.font = UIFont.systemFont(ofSize: 13)
-        userProBtn.setTitleColor(UIColor.hexColor(hexadecimal: "6E7F9A"), for: .normal)
-        userProBtn.addTarget(self, action: #selector(protocolClick(sender:)), for: .touchUpInside)
-        
-        let lineLab = UILabel()
-        lineLab.text = "   |   "
-        lineLab.font = UIFont.systemFont(ofSize: 13)
-        lineLab.textColor = UIColor.hexColor(hexadecimal: "6E7F9A")
-        
-        let priProBtn = UIButton.init(type: .custom)
-        priProBtn.setTitle("hone_service".BFLocale, for: .normal)
-        priProBtn.tag = 2
-        priProBtn.titleLabel?.font = UIFont.systemFont(ofSize: 13)
-        priProBtn.setTitleColor(UIColor.hexColor(hexadecimal: "6E7F9A"), for: .normal)
-        priProBtn.addTarget(self, action: #selector(protocolClick(sender:)), for: .touchUpInside)
-        
-        bottomView.addSubview(userProBtn)
-        bottomView.addSubview(lineLab)
-        bottomView.addSubview(priProBtn)
-        lineLab.snp.makeConstraints { make in
-            make.center.equalToSuperview()
-        }
-        userProBtn.snp.makeConstraints { make in
-            make.right.equalTo(lineLab.snp.left)
-            make.centerY.equalToSuperview()
-        }
-        priProBtn.snp.makeConstraints { make in
-            make.left.equalTo(lineLab.snp.right)
-            make.centerY.equalToSuperview()
-        }
-        return bottomView
-    }()
-    
+
     // MARK: - 生命周期
     override func viewDidAppear(_ animated: Bool) {
         super.viewDidAppear(animated)
@@ -216,14 +186,20 @@ class INRecorderController: BFBaseViewController {
             view.addSubview(buildTimeLabel)
         }
       
-        view.addSubview(bottomView)
-
+ 
         view.addSubview(centerView)
+        view.addSubview(settingBtn)
         centerView.snp.makeConstraints { make in
             make.width.equalTo(140)
             make.height.equalTo(209)
             make.center.equalToSuperview()
         }
+        settingBtn.snp.makeConstraints { make in
+            make.width.height.equalTo(40)
+            make.right.equalToSuperview().offset(-10)
+            make.top.equalToSuperview().offset(51)
+        }
+
         
         centerView.addSubview(titleL)
         centerView.addSubview(camaraBtn)
@@ -353,6 +329,12 @@ class INRecorderController: BFBaseViewController {
         }
     }
     
+    @objc func settingBtnAction() {
+        let vc = INRecorderSetting()
+        navigationController?.pushViewController(vc, animated: true)
+    }
+    
+    
     func chechCameraPromission() -> Bool{
         if  AVCaptureDevice.authorizationStatus(for: AVMediaType.video) != AVAuthorizationStatus.denied {
             return true

+ 110 - 0
Introduce/Record/INRecorderSetting.swift

@@ -0,0 +1,110 @@
+//
+//  INRecorderSetting.swift
+//  Introduce
+//
+//  Created by ak on 2022/1/24.
+//  Copyright © 2022 BytesFlow. All rights reserved.
+//  功能:设置界面
+
+import Foundation
+import BFUIKit
+import BFCommonKit
+
+class INRecorderSetting:BFBaseViewController{
+    var cUserProtocol:String = "https://weapppiccdn.yishihui.com/resources/agreements/shishuo/videoservice_\( BFLocalizedUtil.currentLanguage()).html"
+    var cPrivacy:String = "https://weapppiccdn.yishihui.com/resources/agreements/shishuo/videoagreement_\( BFLocalizedUtil.currentLanguage()).html"
+    
+    lazy var tipsA: UILabel = {
+        let tipsA = UILabel()
+        tipsA.font = UIFont.systemFont(ofSize: 40, weight: .medium)
+        tipsA.textColor = UIColor.hexColor(hexadecimal: "#929292")
+        let infoDictionary = Bundle.main.infoDictionary
+         
+        let majorVersion :String = infoDictionary! ["CFBundleShortVersionString"] as! String//主程序版本号
+        let buildVersion :String = infoDictionary! ["CFBundleVersion"] as! String//主程序版本号
+        tipsA.text = "v\(majorVersion)"
+        tipsA.lineBreakMode = .byWordWrapping
+        tipsA.textAlignment = .center
+        tipsA.numberOfLines = 0
+        return tipsA
+    }()
+    
+    lazy var bottomView:UIView = {
+        let bottomView = UIView(frame:CGRect.init(x: 0, y: view.frame.height - cSafeAreaHeight - 20 - 30, width: view.frame.width, height: 30))
+        let userProBtn = UIButton.init(type: .custom)
+        userProBtn.setTitle("hone_privacy".BFLocale, for: .normal)
+        userProBtn.tag = 1
+        userProBtn.titleLabel?.font = UIFont.systemFont(ofSize: 13)
+        userProBtn.setTitleColor(UIColor.hexColor(hexadecimal: "6E7F9A"), for: .normal)
+        userProBtn.addTarget(self, action: #selector(protocolClick(sender:)), for: .touchUpInside)
+        
+        let lineLab = UILabel()
+        lineLab.text = "   |   "
+        lineLab.font = UIFont.systemFont(ofSize: 13)
+        lineLab.textColor = UIColor.hexColor(hexadecimal: "6E7F9A")
+        
+        let priProBtn = UIButton.init(type: .custom)
+        priProBtn.setTitle("hone_service".BFLocale, for: .normal)
+        priProBtn.tag = 2
+        priProBtn.titleLabel?.font = UIFont.systemFont(ofSize: 13)
+        priProBtn.setTitleColor(UIColor.hexColor(hexadecimal: "6E7F9A"), for: .normal)
+        priProBtn.addTarget(self, action: #selector(protocolClick(sender:)), for: .touchUpInside)
+        
+        bottomView.addSubview(userProBtn)
+        bottomView.addSubview(lineLab)
+        bottomView.addSubview(priProBtn)
+        lineLab.snp.makeConstraints { make in
+            make.center.equalToSuperview()
+        }
+        userProBtn.snp.makeConstraints { make in
+            make.right.equalTo(lineLab.snp.left)
+            make.centerY.equalToSuperview()
+        }
+        priProBtn.snp.makeConstraints { make in
+            make.left.equalTo(lineLab.snp.right)
+            make.centerY.equalToSuperview()
+        }
+        return bottomView
+    }()
+    
+    override func viewWillAppear(_: Bool) {
+        super.viewWillAppear(true)
+        
+        navigationController?.isNavigationBarHidden = true
+        leftButton(image: nil, imageName: nil, tintColor: UIColor.black)
+
+        showNavigation()
+ 
+ 
+    }
+    
+    override func viewDidLoad() {
+        view.backgroundColor = UIColor.hexColor(hexadecimal: "#F2F2F2")
+        view.addSubview(bottomView)
+        
+        view.addSubview(tipsA)
+   
+        tipsA.snp.remakeConstraints { make in
+            make.width.equalTo(182)
+            make.height.equalTo(160)
+            make.centerX.equalToSuperview()
+            make.top.equalToSuperview().offset(320)
+        }
+
+    }
+    
+    @objc func protocolClick(sender:UIButton) {
+        var link: String?
+        if sender.tag == 1 {
+            link = cUserProtocol
+        } else {
+            link = cPrivacy
+        }
+        if link != nil, (link?.count ?? 0) > 0 {
+            let detail = BFBaseWebViewController()
+            detail.baseUrl = link
+            self.navigationController?.pushViewController(detail, animated: true)
+        }
+    }
+
+}