You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
750 B
30 lines
750 B
using SunlightAggregationTerminal.View;
|
|
using ZXing.Multi;
|
|
using ZXing.Net.Maui;
|
|
|
|
namespace SunlightAggregationTerminal;
|
|
|
|
public partial class ScanPage : ContentPage
|
|
{
|
|
private int mode;
|
|
public ScanPage(int i)
|
|
{
|
|
InitializeComponent();
|
|
mode = i;
|
|
}
|
|
private async void OnBarcodesDetected(object sender, BarcodeDetectionEventArgs e)
|
|
{
|
|
var firstResult = e.Results?.FirstOrDefault();
|
|
if (firstResult is not null)
|
|
{
|
|
barcodeReader.IsDetecting = false;
|
|
|
|
// 触发回调
|
|
if (mode == 0) QueryPage.OnScanQuery?.Invoke(firstResult.Value);
|
|
if (mode == 3) LogPage.OnScanProfile?.Invoke(firstResult.Value);
|
|
|
|
await Navigation.PopAsync();
|
|
}
|
|
}
|
|
|
|
}
|