Commit 4f08d75a authored by Alex朱枝文's avatar Alex朱枝文

扫码相关功能

parent 69a1a665
......@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 70;
objectVersion = 60;
objects = {
/* Begin PBXBuildFile section */
......@@ -2661,7 +2661,7 @@
/* End PBXFileReference section */
/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
043F0ED92E02A60C003354EB /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = {
043F0ED92E02A60C003354EB /* Exceptions for "yinheReplayExt" folder in "yinheReplayExt" target */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = (
Info.plist,
......@@ -2671,7 +2671,18 @@
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
/* Begin PBXFileSystemSynchronizedRootGroup section */
043F0ECD2E02A60C003354EB /* yinheReplayExt */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (043F0ED92E02A60C003354EB /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = yinheReplayExt; sourceTree = "<group>"; };
043F0ECD2E02A60C003354EB /* yinheReplayExt */ = {
isa = PBXFileSystemSynchronizedRootGroup;
exceptions = (
043F0ED92E02A60C003354EB /* Exceptions for "yinheReplayExt" folder in "yinheReplayExt" target */,
);
explicitFileTypes = {
};
explicitFolders = (
);
path = yinheReplayExt;
sourceTree = "<group>";
};
/* End PBXFileSystemSynchronizedRootGroup section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -7270,14 +7281,10 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-galaxy/Pods-galaxy-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-galaxy/Pods-galaxy-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-galaxy/Pods-galaxy-frameworks.sh\"\n";
......@@ -7291,14 +7298,10 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-galaxy/Pods-galaxy-resources-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-galaxy/Pods-galaxy-resources-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-galaxy/Pods-galaxy-resources.sh\"\n";
......
......@@ -26,10 +26,18 @@ class YHScanViewController: LBXScanViewController {
setupScanStyle()
}
override func handleCodeResult(arrayResult: [LBXScanResult]) {
//
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
let navBar = gk_navigationBar
if view.subviews.contains(navBar) {
view.bringSubviewToFront(navBar)
}
}
// override func handleCodeResult(arrayResult: [LBXScanResult]) {
// //
// }
deinit {
//
}
......
......@@ -11,7 +11,7 @@ import Foundation
import AVFoundation
protocol LBXScanViewControllerDelegate: AnyObject {
func scanFinished(scanResult: LBXScanResult, error: String?)
func scanFinished(scanResult: LBXScanResult?, error: String?)
}
protocol QRRectDelegate: AnyObject {
......@@ -45,7 +45,6 @@ class LBXScanViewController: YHBaseViewController, UIImagePickerControllerDelega
override open func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = UIColor.black
drawScanView()
// self.edgesForExtendedLayout = UIRectEdge(rawValue: 0)
}
......@@ -60,6 +59,7 @@ class LBXScanViewController: YHBaseViewController, UIImagePickerControllerDelega
override open func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
drawScanView()
LBXPermissions.authorizeCameraWith { [weak self] granted in
......@@ -135,15 +135,28 @@ class LBXScanViewController: YHBaseViewController, UIImagePickerControllerDelega
open func handleCodeResult(arrayResult: [LBXScanResult]) {
if let delegate = scanResultDelegate {
self.navigationController?.popViewController(animated: true)
let result: LBXScanResult = arrayResult[0]
delegate.scanFinished(scanResult: result, error: nil)
if arrayResult.count > 0 {
let result: LBXScanResult = arrayResult[0]
delegate.scanFinished(scanResult: result, error: nil)
} else {
delegate.scanFinished(scanResult: nil, error: "扫码结束,无结果")
}
} else {
for result: LBXScanResult in arrayResult {
debugPrint("%@", result.strScanned ?? "")
}
let result: LBXScanResult = arrayResult[0]
YHCommonAlertView.show(result.strBarCodeType, result.strScanned, "", "确定", fullGuestureEnable: false) {
} callBack: {
if arrayResult.count > 0 {
let result: LBXScanResult = arrayResult[0]
YHCommonAlertView.show(result.strBarCodeType, result.strScanned, "", "确定", fullGuestureEnable: false) {
} callBack: { [weak self] in
self?.startScan()
}
} else {
YHCommonAlertView.show("", "扫码结束,无结果", "", "确定", fullGuestureEnable: false) {
} callBack: { [weak self] in
self?.startScan()
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment