Contact page shows operator specific info

This commit is contained in:
Oliver Hauff 2021-07-20 23:06:09 +02:00
parent e436e83c1d
commit a58c33f005
51 changed files with 948 additions and 221 deletions

View file

@ -113,23 +113,13 @@ namespace TINK.ViewModel.BikesAtStation
/// <summary>
/// Informs about need to log in before requesting an bike.
/// </summary>
public FormattedString LoginRequiredHintText
{
get
{
if (ActiveUser.IsLoggedIn)
{
return string.Empty;
}
public string LoginRequiredHintText
=> ActiveUser.IsLoggedIn
? string.Empty
: AppResources.MarkingLoginRequiredToRerserve;
var l_oHint = new FormattedString();
l_oHint.Spans.Add(new Span { Text = "Bitte Anmelden um Fahrräder zu reservieren! " });
l_oHint.Spans.Add(new Span { Text = "Hier", ForegroundColor = ViewModelHelper.LINK_COLOR });
l_oHint.Spans.Add(new Span { Text = " tippen um auf Anmeldeseite zu wechseln."});
return l_oHint;
}
}
public string ContactSupportHintText
=> string.Format(AppResources.MarkingContactSupport, m_oStation?.OperatorData?.Name ?? "Operator");
/// <summary> Returns if info about the fact that user did not request or book any bikes is visible or not.<summary>
/// Gets message that logged in user has not booked any bikes.
@ -154,21 +144,22 @@ namespace TINK.ViewModel.BikesAtStation
}
/// <summary> Command object to bind login page redirect link to view model.</summary>
public System.Windows.Input.ICommand LoginRequiredHintClickedCommand
{
get
{
public System.Windows.Input.ICommand ContactSupportClickedCommand
#if USEMASTERDETAIL || USEFLYOUT
return new Xamarin.Forms.Command(() => OpenLoginPageAsync());
=> new Xamarin.Forms.Command(() => OpenSupportPageAsync());
#else
return new Xamarin.Forms.Command(async () => await OpenLoginPageAsync());
=> new Xamarin.Forms.Command(async () => await OpenLoginPageAsync());
#endif
}
}
/// <summary>
/// Opens login page.
/// </summary>
/// <summary> Command object to bind login page redirect link to view model.</summary>
public System.Windows.Input.ICommand LoginRequiredHintClickedCommand
#if USEMASTERDETAIL || USEFLYOUT
=> new Xamarin.Forms.Command(() => OpenLoginPageAsync());
#else
=> new Xamarin.Forms.Command(async () => await OpenLoginPageAsync());
#endif
/// <summary> Opens login page. </summary>
#if USEMASTERDETAIL || USEFLYOUT
public void OpenLoginPageAsync()
#else
@ -192,6 +183,30 @@ namespace TINK.ViewModel.BikesAtStation
}
}
/// <summary> Opens login page. </summary>
#if USEMASTERDETAIL || USEFLYOUT
public void OpenSupportPageAsync()
#else
public async Task OpenLoginPageAsync()
#endif
{
try
{
// Switch to map page
#if USEMASTERDETAIL || USEFLYOUT
ViewService.ShowPage(ViewTypes.ContactPage, m_oStation?.OperatorData?.Name ?? AppResources.MarkingFeedbackAndContact);
#else
await ViewService.ShowPage("//LoginPage");
#endif
}
catch (Exception p_oException)
{
Log.Error("Ein unerwarteter Fehler ist auf der Seite Kontakt aufgetreten. Kontext: Klick auf Hinweistext auf Station N- seite ohne Anmeldung. {@Exception}", p_oException);
return;
}
}
/// <summary>
/// Invoked when page is shown.
/// Starts update process.