@ -4,7 +4,6 @@ import AudioToolbox
// MARK: - 扫 描 界 面 覆 盖 层
// MARK: - 扫 描 界 面 覆 盖 层
struct ScanningOverlayView : View {
struct ScanningOverlayView : View {
let showPreviewPause : Bool
let showPreviewPause : Bool
@ Binding var selectedStyle : ScanningLineStyle
let detectedCodesCount : Int
let detectedCodesCount : Int
let onImageDecode : ( ) -> Void
let onImageDecode : ( ) -> Void
@ -14,7 +13,7 @@ struct ScanningOverlayView: View {
// 扫 描 线 组 件
// 扫 描 线 组 件
if ! showPreviewPause {
if ! showPreviewPause {
ScanningLineView ( style : selectedStyle )
ScanningLineView ( style : . modern )
}
}
// 提 示 文 本
// 提 示 文 本
@ -28,7 +27,6 @@ struct ScanningOverlayView: View {
// 底 部 按 钮 区 域
// 底 部 按 钮 区 域
ScanningBottomButtonsView (
ScanningBottomButtonsView (
showPreviewPause : showPreviewPause ,
showPreviewPause : showPreviewPause ,
selectedStyle : $ selectedStyle ,
onImageDecode : onImageDecode
onImageDecode : onImageDecode
)
)
}
}
@ -70,16 +68,10 @@ struct ScanningInstructionView: View {
// MARK: - 扫 描 底 部 按 钮 视 图
// MARK: - 扫 描 底 部 按 钮 视 图
struct ScanningBottomButtonsView : View {
struct ScanningBottomButtonsView : View {
let showPreviewPause : Bool
let showPreviewPause : Bool
@ Binding var selectedStyle : ScanningLineStyle
let onImageDecode : ( ) -> Void
let onImageDecode : ( ) -> Void
var body : some View {
var body : some View {
VStack ( spacing : 15 ) {
VStack ( spacing : 15 ) {
// 扫 描 线 样 式 选 择 器
if ! showPreviewPause {
ScanningStyleSelectorView ( selectedStyle : $ selectedStyle )
}
// 图 片 解 码 按 钮
// 图 片 解 码 按 钮
if ! showPreviewPause {
if ! showPreviewPause {
Button ( action : {
Button ( action : {
@ -98,10 +90,10 @@ struct ScanningBottomButtonsView: View {
. padding ( . vertical , 10 )
. padding ( . vertical , 10 )
. background (
. background (
RoundedRectangle ( cornerRadius : 12 )
RoundedRectangle ( cornerRadius : 12 )
. fill ( Color . blue . opacity ( 0. 8 ) )
. fill ( Color . blue . opacity ( 0. 3 ) )
. overlay (
. overlay (
RoundedRectangle ( cornerRadius : 12 )
RoundedRectangle ( cornerRadius : 12 )
. stroke ( Color . blue , lineWidth : 1 )
. stroke ( Color . blue .opacity ( 0.6 ) , lineWidth : 1 )
)
)
)
)
}
}