Update versione JS XZing x barcode

This commit is contained in:
Samuele Locatelli
2025-04-09 07:37:23 +02:00
parent 3768a9de85
commit ecc84f119c
4 changed files with 44 additions and 23 deletions
@@ -5,31 +5,39 @@
<div class="card my-2">
<div class="card-header"><h4>Test Barcode Reader</h4></div>
<div class="card-body">
<BarcodeReader
@ref="barcodeReaderCustom"
ScanResult="(e) => ScanDoneHandler(e)"
ScanBtnTitle="Scan"
ResetBtnTitle="Reset"
CloseBtnTitle="Close"
UseBuiltinDiv="false"
SelectDeviceBtnTitle="Select Device">
</BarcodeReader>
@if (ShowScanBarcode)
{
<BarcodeReader
@ref="barcodeReaderCustom"
ScanResult="(e) => ScanDoneHandler(e)"
ScanBtnTitle="Scan"
ResetBtnTitle="Reset"
CloseBtnTitle="Close"
UseBuiltinDiv="false"
SelectDeviceBtnTitle="Select Device">
</BarcodeReader>
<div @ref="barcodeReaderCustom.Element" class="d-flex justify-content-center">
<div class="col-12 col-md-8 col-lg-6">
<button class="btn btn-outline-success p-2 m-1 w-25" data-action="startButton">Scan</button>
<button class="btn btn-outline-success p-2 m-1 w-25" data-action="resetButton">Reset</button>
<div @ref="barcodeReaderCustom.Element" class="d-flex justify-content-center">
<div class="col-12 col-md-8 col-lg-6">
<button class="btn btn-outline-success p-2 m-1 w-25" data-action="startButton">Scan</button>
<button class="btn btn-outline-success p-2 m-1 w-25" data-action="resetButton">Reset</button>
<button class="btn btn-outline-success p-2 m-1 w-25" @onclick="() => ToggleCodeScan()">Close</button>
<div data-action="sourceSelectPanel" style="display:none">
<label for="sourceSelect">Source:</label>
<select data-action="sourceSelect" style="max-width:100%" class="form-control">
</select>
</div>
<div>
<video id="video" playsinline="true" autoplay="true" class="w-100 h-100 border rounded shadow shadow-lg image-mirror" muted="true"></video>
<div data-action="sourceSelectPanel" style="display:none">
<label for="sourceSelect">Source:</label>
<select data-action="sourceSelect" style="max-width:100%" class="form-control">
</select>
</div>
<div>
<video id="video" playsinline="true" autoplay="true" class="w-100 h-100 border rounded shadow shadow-lg image-mirror" muted="true"></video>
</div>
</div>
</div>
</div>
}
else
{
<button class="btn btn-outline-success p-2 m-1 w-25" @onclick="() => ToggleCodeScan()">Open</button>
}
</div>
</div>
@@ -48,4 +56,10 @@
}
protected string qrCodeVal { get; set; } = "https://office.egalware.com/WDC/UI";
protected void ToggleCodeScan()
{
ShowScanBarcode = !ShowScanBarcode;
}
private bool ShowScanBarcode = true;
}
+4
View File
@@ -1,6 +1,7 @@
using EgwCoreLib.BlazorTest;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Radzen;
var builder = WebApplication.CreateBuilder(args);
@@ -28,6 +29,9 @@ if (!app.Environment.IsDevelopment())
app.UseHsts();
}
app.UsePathBase("/BlazorTest/");
// disabilita risposta compressa in debug
if (!app.Environment.IsDevelopment())
{
+3
View File
@@ -172,6 +172,9 @@ namespace EgwCoreLib.Razor
{
if (!firstRender) return;
Storage = new StorageService(JS);
#if false
module = await JS.InvokeAsync<IJSObjectReference>("import", "./_content/EgwCoreLib.Razor/BarcodeReader.razor.js" + "?v=" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
#endif
module = await JS.InvokeAsync<IJSObjectReference>("import", "./_content/EgwCoreLib.Razor/BarcodeReader.razor.js" + "?v=" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
Instance = DotNetObjectReference.Create(this);
if (Options == null)
+2 -2
View File
@@ -75,8 +75,8 @@
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.36" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.1.1" />
<PackageReference Include="System.Text.Encodings.Web" Version="6.0.1" />
<PackageReference Include="ZXing.Net" Version="0.16.9" />
<PackageReference Include="ZXing.Net.Bindings.Windows.Compatibility" Version="0.16.12" />
<PackageReference Include="ZXing.Net" Version="0.16.10" />
<PackageReference Include="ZXing.Net.Bindings.Windows.Compatibility" Version="0.16.13" />
</ItemGroup>
<ItemGroup>