Commit 24773813 authored by Alex朱枝文's avatar Alex朱枝文

规则优化

parent 43907df6
...@@ -35,6 +35,14 @@ struct YHScanType: OptionSet { ...@@ -35,6 +35,14 @@ struct YHScanType: OptionSet {
} }
} }
var prefixString: String {
if self == .checkIn {
return "SLQD_"
} else {
return ""
}
}
var instructionText: String? { var instructionText: String? {
if self == .checkIn { if self == .checkIn {
return "将二维码放到框内" return "将二维码放到框内"
...@@ -50,7 +58,7 @@ struct YHScanType: OptionSet { ...@@ -50,7 +58,7 @@ struct YHScanType: OptionSet {
/// 从二维码内容识别类型 /// 从二维码内容识别类型
func recognizeType(from code: String) -> YHScanType? { func recognizeType(from code: String) -> YHScanType? {
// 根据二维码内容规则识别类型 // 根据二维码内容规则识别类型
if contains(.checkIn) && code.hasPrefix("SLQD_") { if contains(.checkIn) && code.hasPrefix(YHScanType.checkIn.prefixString) {
return .checkIn return .checkIn
} }
......
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