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

规则优化

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