complete rls 2
parent
7e5b388119
commit
6681c11444
|
@ -31,7 +31,7 @@ namespace iElection
|
|||
if (UtilitiesWrapper.Instance.UserUtilities.IsAuthorized)
|
||||
await NavigationService.NavigateAsync("NavigationPage/MainPage");
|
||||
else
|
||||
await NavigationService.NavigateAsync("NavigationPage/SignUpPage");
|
||||
await NavigationService.NavigateAsync("NavigationPage/LoginPage");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
@ -16,5 +16,7 @@ namespace iElection.Services.Rest
|
|||
Task<ApiResult<LoginRespond>> LoginUser([Body] LoginRequest loginRequest);
|
||||
[Post("/RegisterUser")]
|
||||
Task<ApiResult<LoginRespond>> RegisterUser([Body] RegisterDto registerDto);
|
||||
[Post("/ForgetPassUser/{phone}")]
|
||||
Task<ApiResult<LoginRespond>> ForgetPassUser(string phone);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,9 +29,10 @@ namespace iElection.Utilities
|
|||
});
|
||||
}
|
||||
|
||||
public async void PushIndicator()
|
||||
public async void PushIndicator(bool popOthers = true)
|
||||
{
|
||||
await PopAsync();
|
||||
if(popOthers)
|
||||
await PopAsync();
|
||||
var indicator = new Frame
|
||||
{
|
||||
BackgroundColor = Color.White,
|
||||
|
|
|
@ -36,9 +36,15 @@ namespace iElection.ViewModels
|
|||
var contact = parameters.GetValue<InviteContactDto>("Contact");
|
||||
if (contact != null)
|
||||
{
|
||||
PageDto = contact;
|
||||
IsAdding = false;
|
||||
IsReadOnly = true;
|
||||
PageDto.Age = contact.Age;
|
||||
PageDto.District = contact.District;
|
||||
PageDto.FirstName = contact.FirstName;
|
||||
PageDto.LastName = contact.LastName;
|
||||
PageDto.Gender = contact.Gender;
|
||||
PageDto.Job = contact.Job;
|
||||
PageDto.Phone = contact.Phone;
|
||||
Title = PageDto.FullName;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -7,6 +7,7 @@ using System.Windows.Input;
|
|||
using iElection.Models.Api;
|
||||
using iElection.Services.Contracts;
|
||||
using iElection.Utilities;
|
||||
using iElection.Views.PopUps;
|
||||
using Prism.Navigation;
|
||||
using Refit;
|
||||
|
||||
|
@ -16,6 +17,7 @@ namespace iElection.ViewModels
|
|||
{
|
||||
public ICommand SignUpCommand { get; set; }
|
||||
public ICommand LoginCommand { get; set; }
|
||||
public ICommand ForgetPassCommand { get; set; }
|
||||
public LoginPageViewModel(INavigationService navigationService, IRestWrapper restWrapper) : base(navigationService, restWrapper)
|
||||
{
|
||||
|
||||
|
@ -52,6 +54,10 @@ namespace iElection.ViewModels
|
|||
{
|
||||
NavigationService.NavigateAsync("SignUpPage");
|
||||
});
|
||||
ForgetPassCommand = new DelegateCommand(async () =>
|
||||
{
|
||||
await UtilitiesWrapper.Instance.PopUpUtilities.PushAsync(new ForegetPassPopUp());
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,10 +47,7 @@
|
|||
Padding="8,3"
|
||||
HasShadow="True"
|
||||
MaterialTheme="Acrylic">
|
||||
<Grid
|
||||
BackgroundColor="#F1F1F1"
|
||||
ColumnDefinitions="Auto,*"
|
||||
IsVisible="{Binding IsAdding}">
|
||||
<Grid BackgroundColor="#F1F1F1" ColumnDefinitions="Auto,*">
|
||||
<Label
|
||||
Margin="-3,0,8,0"
|
||||
FontFamily="{StaticResource ShabnameBold}"
|
||||
|
@ -61,7 +58,7 @@
|
|||
FontSize="Small"
|
||||
IsReadOnly="{Binding IsReadOnly}"
|
||||
Placeholder="مثال : امیرحسین"
|
||||
Text="{Binding PageDto.FirstName, Mode=TwoWay}" />
|
||||
Text="{Binding Path=PageDto.FirstName, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
</materialFrame:MaterialFrame>
|
||||
<materialFrame:MaterialFrame
|
||||
|
@ -69,10 +66,7 @@
|
|||
Padding="8,3"
|
||||
HasShadow="True"
|
||||
MaterialTheme="Acrylic">
|
||||
<Grid
|
||||
BackgroundColor="#F1F1F1"
|
||||
ColumnDefinitions="Auto,*"
|
||||
IsVisible="{Binding IsAdding}">
|
||||
<Grid BackgroundColor="#F1F1F1" ColumnDefinitions="Auto,*">
|
||||
<Label
|
||||
Margin="-3,0,8,0"
|
||||
FontFamily="{StaticResource ShabnameBold}"
|
||||
|
@ -91,10 +85,7 @@
|
|||
Padding="8,3"
|
||||
HasShadow="True"
|
||||
MaterialTheme="Acrylic">
|
||||
<Grid
|
||||
BackgroundColor="#F1F1F1"
|
||||
ColumnDefinitions="Auto,*"
|
||||
IsVisible="{Binding IsAdding}">
|
||||
<Grid BackgroundColor="#F1F1F1" ColumnDefinitions="Auto,*">
|
||||
<Label
|
||||
Margin="-3,0,8,0"
|
||||
FontFamily="{StaticResource ShabnameBold}"
|
||||
|
@ -104,6 +95,7 @@
|
|||
Grid.Column="1"
|
||||
FontSize="Small"
|
||||
IsReadOnly="{Binding IsReadOnly}"
|
||||
Keyboard="Telephone"
|
||||
Placeholder="مثال : 09124805051"
|
||||
Text="{Binding PageDto.Phone, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
|
@ -114,10 +106,7 @@
|
|||
HasShadow="True"
|
||||
MaterialTheme="Acrylic">
|
||||
<Grid>
|
||||
<Grid
|
||||
BackgroundColor="#F1F1F1"
|
||||
ColumnDefinitions="Auto,*"
|
||||
IsVisible="{Binding IsAdding}">
|
||||
<Grid BackgroundColor="#F1F1F1" ColumnDefinitions="Auto,*">
|
||||
<Label
|
||||
Margin="-3,0,8,0"
|
||||
FontFamily="{StaticResource ShabnameBold}"
|
||||
|
@ -150,11 +139,13 @@
|
|||
SelectionChanged="DistrictSfAutoComplete_OnSelectionChanged"
|
||||
ShowSuggestionsOnFocus="True"
|
||||
SuggestionMode="Contains" />
|
||||
|
||||
<!--<Picker
|
||||
Grid.Column="1"
|
||||
ItemDisplayBinding="{Binding Name}"
|
||||
ItemsSource="{Binding InfoDto.Districts}"
|
||||
SelectedIndexChanged="DistrictPicker_OnSelectedIndexChanged" />-->
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</materialFrame:MaterialFrame>
|
||||
|
@ -164,16 +155,14 @@
|
|||
HasShadow="True"
|
||||
MaterialTheme="Acrylic">
|
||||
<Grid>
|
||||
<Grid
|
||||
BackgroundColor="#F1F1F1"
|
||||
ColumnDefinitions="Auto,*"
|
||||
IsVisible="{Binding IsAdding}">
|
||||
<Grid BackgroundColor="#F1F1F1" ColumnDefinitions="Auto,*">
|
||||
<Label
|
||||
Margin="-3,0,8,0"
|
||||
FontFamily="{StaticResource ShabnameBold}"
|
||||
Text="شغل : "
|
||||
VerticalOptions="Center" />
|
||||
<Entry
|
||||
Grid.Column="1"
|
||||
FontSize="Small"
|
||||
IsReadOnly="{Binding IsReadOnly}"
|
||||
Placeholder="شغل"
|
||||
|
@ -207,10 +196,7 @@
|
|||
Padding="8,3"
|
||||
HasShadow="True"
|
||||
MaterialTheme="Acrylic">
|
||||
<Grid
|
||||
BackgroundColor="#F1F1F1"
|
||||
ColumnDefinitions="Auto,*"
|
||||
IsVisible="{Binding IsAdding}">
|
||||
<Grid BackgroundColor="#F1F1F1" ColumnDefinitions="Auto,*">
|
||||
<Label
|
||||
Margin="-3,0,8,0"
|
||||
FontFamily="{StaticResource ShabnameBold}"
|
||||
|
@ -220,6 +206,7 @@
|
|||
Grid.Column="1"
|
||||
FontSize="Small"
|
||||
IsReadOnly="{Binding IsReadOnly}"
|
||||
Keyboard="Numeric"
|
||||
Placeholder="مثال : 32"
|
||||
Text="{Binding PageDto.Age, Mode=TwoWay, StringFormat='{}{0:#}'}" />
|
||||
</Grid>
|
||||
|
@ -230,16 +217,14 @@
|
|||
HasShadow="True"
|
||||
MaterialTheme="Acrylic">
|
||||
<Grid>
|
||||
<Grid
|
||||
BackgroundColor="#F1F1F1"
|
||||
ColumnDefinitions="Auto,*"
|
||||
IsVisible="{Binding IsAdding}">
|
||||
<Grid BackgroundColor="#F1F1F1" ColumnDefinitions="Auto,*">
|
||||
<Label
|
||||
Margin="-3,0,8,0"
|
||||
FontFamily="{StaticResource ShabnameBold}"
|
||||
Text="جنسیت : "
|
||||
VerticalOptions="Center" />
|
||||
<Entry
|
||||
Grid.Column="1"
|
||||
FontSize="Small"
|
||||
IsReadOnly="{Binding IsReadOnly}"
|
||||
Placeholder="جنسیت"
|
||||
|
|
|
@ -77,6 +77,12 @@
|
|||
TextColor="White" />
|
||||
|
||||
</Grid>
|
||||
<Button
|
||||
Margin="0,10"
|
||||
BackgroundColor="Transparent"
|
||||
Command="{Binding ForgetPassCommand}"
|
||||
HorizontalOptions="Center"
|
||||
Text="فراموشی رمز عبور" />
|
||||
</StackLayout>
|
||||
</Grid>
|
||||
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<ContentView
|
||||
x:Class="iElection.Views.PopUps.ForegetPassPopUp"
|
||||
xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
Margin="40,0"
|
||||
FlowDirection="RightToLeft"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center">
|
||||
<ContentView.Content>
|
||||
<Frame BackgroundColor="{StaticResource Gray-100}" CornerRadius="10">
|
||||
<StackLayout HorizontalOptions="Center">
|
||||
<StackLayout HorizontalOptions="Center">
|
||||
<Label
|
||||
x:Name="messageLabel"
|
||||
FontFamily="{StaticResource Shabname}"
|
||||
FontSize="Body"
|
||||
HorizontalOptions="Center"
|
||||
HorizontalTextAlignment="Center"
|
||||
Text="اگر رمز خود را فراموش کرده اید ، شماره تلفن خود را وارد کنید تا رمز عبور جدید برای شماره تلفن شما ارسال شود"
|
||||
TextColor="#444"
|
||||
VerticalOptions="Center" />
|
||||
<Grid ColumnDefinitions="Auto,*">
|
||||
<Label
|
||||
Margin="-3,0,8,0"
|
||||
FontFamily="{StaticResource ShabnameBold}"
|
||||
Text="شماره تلفن : "
|
||||
VerticalOptions="Center" />
|
||||
<Entry
|
||||
x:Name="phoneEntry"
|
||||
Grid.Column="1"
|
||||
FontSize="Small"
|
||||
IsReadOnly="{Binding IsReadOnly}"
|
||||
Keyboard="Telephone"
|
||||
Placeholder="مثال : 09124805051" />
|
||||
</Grid>
|
||||
</StackLayout>
|
||||
<StackLayout
|
||||
Margin="0,10,0,0"
|
||||
HorizontalOptions="Center"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
Padding="30,0"
|
||||
BackgroundColor="{StaticResource Green}"
|
||||
Clicked="AcceptButton_OnClicked"
|
||||
CornerRadius="6"
|
||||
FontFamily="{StaticResource ShabnameBold}"
|
||||
FontSize="17"
|
||||
HeightRequest="40"
|
||||
Text="تایید"
|
||||
TextColor="White" />
|
||||
<Button
|
||||
Padding="25,0"
|
||||
BackgroundColor="#30FA0941"
|
||||
Clicked="CancelButton_OnClicked"
|
||||
CornerRadius="6"
|
||||
FontFamily="{StaticResource ShabnameBold}"
|
||||
FontSize="17"
|
||||
HeightRequest="40"
|
||||
Text="انصراف"
|
||||
TextColor="#FA0941" />
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
</Frame>
|
||||
</ContentView.Content>
|
||||
</ContentView>
|
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using iElection.Services;
|
||||
using iElection.Utilities;
|
||||
using Refit;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace iElection.Views.PopUps
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class ForegetPassPopUp : ContentView
|
||||
{
|
||||
private RestWrapper RestWrapper = new RestWrapper();
|
||||
public ForegetPassPopUp()
|
||||
{
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private async void AcceptButton_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(phoneEntry.Text))
|
||||
throw new Exception("شماره تلفن را وارد کنید");
|
||||
UtilitiesWrapper.Instance.PopUpUtilities.PushIndicator(false);
|
||||
var rest = await RestWrapper.AccountApiRest.ForgetPassUser(phoneEntry.Text);
|
||||
UtilitiesWrapper.Instance.PopUpUtilities.PopAsync();
|
||||
if (rest.IsSuccess)
|
||||
UtilitiesWrapper.Instance.PopUpUtilities.PushSuccess("فراموشی رمز در صورت صحت شماره تلفن برای شما پیامک خواهد شد");
|
||||
}
|
||||
catch (ApiException ex)
|
||||
{
|
||||
RestWrapper.UnhandledExceptionRaiser(ex);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
UtilitiesWrapper.Instance.PopUpUtilities.PushError(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void CancelButton_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
Utilities.UtilitiesWrapper.Instance.PopUpUtilities.PopAsync();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -95,6 +95,7 @@
|
|||
Grid.Column="1"
|
||||
FontSize="Small"
|
||||
IsReadOnly="{Binding IsReadOnly}"
|
||||
Keyboard="Telephone"
|
||||
Placeholder="مثال : 09124805051"
|
||||
Text="{Binding PageDto.Phone, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
|
@ -172,6 +173,7 @@
|
|||
Grid.Column="1"
|
||||
FontSize="Small"
|
||||
IsReadOnly="{Binding IsReadOnly}"
|
||||
Keyboard="Numeric"
|
||||
Placeholder="مثال : 32"
|
||||
Text="{Binding PageDto.Age, Mode=TwoWay, StringFormat='{}{0:#}'}" />
|
||||
</Grid>
|
||||
|
|
|
@ -40,6 +40,9 @@
|
|||
<EmbeddedResource Update="Views\PopUps\ErrorPopUp.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="Views\PopUps\ForegetPassPopUp.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="Views\PopUps\QuestionPopUp.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
</EmbeddedResource>
|
||||
|
|
Loading…
Reference in New Issue