Administrator 1 month ago
parent
commit
164c229cb2
  1. 8
      AppShell.xaml.cs
  2. 9
      SunlightAggregationTerminal.csproj
  3. 21
      View/LogLoading.xaml
  4. 17
      View/LogLoading.xaml.cs

8
AppShell.xaml.cs

@ -27,15 +27,15 @@ namespace SunlightAggregationTerminal
await Navigation.PushModalAsync(loading); await Navigation.PushModalAsync(loading);
if (await AppModels.LogIn()) if (await AppModels.LogIn())
{//拒绝登陆时打开登录页面 {
await loading.Navigation.PopModalAsync(); await loading.Navigation.PopModalAsync();
} }
else else
{ {//拒绝登陆时打开登录页面
await loading.Navigation.PopModalAsync(); await loading.Navigation.PopModalAsync();
var logpage = new View.LogPage(); var logpage = new View.LogPage();
await Navigation.PushModalAsync(logpage); await Navigation.PushModalAsync(new NavigationPage(logpage));
} }
} }

9
SunlightAggregationTerminal.csproj

@ -101,6 +101,12 @@
<PackageReference Include="ZXing.Net.Maui.Controls" Version="0.7.4" /> <PackageReference Include="ZXing.Net.Maui.Controls" Version="0.7.4" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Compile Update="View\LogLoading.xaml.cs">
<DependentUpon>LogLoading.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup> <ItemGroup>
<MauiXaml Update="InfoChemicalStatistics.xaml"> <MauiXaml Update="InfoChemicalStatistics.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@ -135,6 +141,9 @@
<MauiXaml Update="ScanPage.xaml"> <MauiXaml Update="ScanPage.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="View\LogLoading.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="View\Loading.xaml"> <MauiXaml Update="View\Loading.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>

21
View/LogLoading.xaml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="SunlightAggregationTerminal.View.LogLoading"
Title="LogLoading">
<Grid x:Name="LoadingIndicator" BackgroundColor="Gray"
IsVisible="True" Opacity="0.9">
<VerticalStackLayout Padding="30" Spacing="10"
VerticalOptions="Center"
HorizontalOptions="Center">
<Button Text="登 录"
BackgroundColor="#512BD4"
TextColor="White"
HeightRequest="50"
WidthRequest="100"
CornerRadius="10"
Margin="0,10,0,0"
Clicked="Button_Clicked"/>
</VerticalStackLayout>
</Grid>
</ContentPage>

17
View/LogLoading.xaml.cs

@ -0,0 +1,17 @@
namespace SunlightAggregationTerminal.View;
public partial class LogLoading : ContentPage
{
public LogLoading()
{
InitializeComponent();
}
private async void Button_Clicked(object sender, EventArgs e)
{
await Navigation.PopModalAsync();
var logpage = new View.LogPage();
await Navigation.PushModalAsync(logpage);
}
}
Loading…
Cancel
Save