PWA Fundvelo der Caritas.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

CaritasServiceFundVeloMissingConclusion.razor 9.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. @page "/fundvelo/conclusion_missing"
  2. @using cwebplusApp.Shared.Services;
  3. @using cwebplusApp.Shared.Models;
  4. @using cwebplusApp.Components;
  5. @inject NavigationManager NavigationManager;
  6. @inject IStringLocalizer<Resources> I18n;
  7. @inject PageHistoryManager PageHistoryManager;
  8. @inject ReportDataProvider ReportDataProvider;
  9. @inject IBicycleRestService IBicycleRestService;
  10. @inject Toaster Toaster;
  11. @inject AppState AppState;
  12. <div class="row px-3 h-100">
  13. <div class="row no-gutters align-items-start justify-content-center w-100">
  14. <MatHeadline4 Style="font-family:Ubuntu;padding-top:0.5em">@I18n["Info"]</MatHeadline4>
  15. </div>
  16. <div class="row no-gutters align-items-start justify-content-center w-100">
  17. @if (running) {
  18. <div style="width:48px;margin:0 auto;">
  19. <MatProgressCircle Indeterminate="true" Size="MatProgressCircleSize.Large" />
  20. </div>
  21. <div class="w-100" style="text-align:center;">
  22. <h6 style="font-style:italic;padding-bottom:1em">@I18n["Info.Report.Transmitting"]</h6>
  23. </div>
  24. } else {
  25. if (ResponseStatus.OK == responseStatus) {
  26. <MatHeadline5 Style="font-family:Ubuntu; text-align:center">@I18n["FinishedTextMissing"]</MatHeadline5>
  27. <MatSubtitle1 Class="w-100" Style="font-family:Ubuntu; text-align:left; font-weight:800">@I18n["FinishedTextMissing_Heading1"]</MatSubtitle1>
  28. <ul class="w-100" style="margin-bottom:0">
  29. <li class="w-100" style="font-family: Ubuntu; text-align: left">@I18n["FinishedTextMissing_2"]</li>
  30. <li class="w-100" style="font-family: Ubuntu; text-align: left">@I18n["FinishedTextMissing_3"]</li>
  31. </ul>
  32. <MatSubtitle1 Class="w-100" Style="font-family:Ubuntu; text-align:left; font-weight:800;padding-top:20px">@I18n["FinishedTextMissing_Heading2"]</MatSubtitle1>
  33. <ul class="w-100" style="margin-bottom:0">
  34. <li class="w-100" style="font-family: Ubuntu; text-align: left">@I18n["FinishedTextMissing_4"]</li>
  35. <li class="w-100" style="font-family: Ubuntu; text-align: left">@I18n["FinishedTextMissing_5"]</li>
  36. <li class="w-100" style="font-family: Ubuntu; text-align: left">@I18n["FinishedTextMissing_6"]</li>
  37. </ul>
  38. <MatHeadline5 Class="w-100" Style="font-family: Ubuntu; text-align: left;padding-top:20px">@I18n["FinishedTextMissing_Heading3"]</MatHeadline5>
  39. <div class="w-100">
  40. <MatIcon Style="padding-right:1rem">
  41. <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000">
  42. <path d="M0 0h24v24H0V0z" fill="none" />
  43. <path d="M19 17.47c-.88-.07-1.75-.22-2.6-.45l-1.19 1.19c1.2.41 2.48.67 3.8.75v-1.49zM5.03 5c.09 1.32.35 2.59.75 3.8l1.2-1.2c-.23-.84-.38-1.71-.44-2.6H5.03z" opacity=".3" />
  44. <path d="M9.07 7.57C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.49c0-.55-.45-1-1-1-1.24 0-2.45-.2-3.57-.57-.1-.04-.21-.05-.31-.05-.26 0-.51.1-.71.29l-2.2 2.2c-2.83-1.45-5.15-3.76-6.59-6.59l2.2-2.2c.28-.28.36-.67.25-1.02zm7.33 9.45c.85.24 1.72.39 2.6.45v1.49c-1.32-.09-2.59-.35-3.8-.75l1.2-1.19zM5.79 8.8c-.41-1.21-.67-2.48-.76-3.8h1.5c.07.89.22 1.76.46 2.59L5.79 8.8z" />
  45. </svg>
  46. </MatIcon>
  47. <MatSubtitle1 Class="w-100" Style="font-family:Ubuntu; text-align:left; font-weight:800;display:contents">@I18n["FinishedTextMissing_LostOffice_Phone"]</MatSubtitle1>
  48. </div>
  49. <div class="w-100">
  50. <MatIcon Style="padding-right:1rem">
  51. <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000">
  52. <path d="M0 0h24v24H0V0z" fill="none" />
  53. <path d="M20 8l-8 5-8-5v10h16zm0-2H4l8 4.99z" opacity=".3" />
  54. <path d="M4 20h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2zM20 6l-8 4.99L4 6h16zM4 8l8 5 8-5v10H4V8z" />
  55. </svg>
  56. </MatIcon>
  57. <MatSubtitle1 Class="w-100" Style="font-family: Ubuntu;text-align:left; font-weight:800; display:contents">@I18n["FinishedTextMissing_LostOffice_Mail"]</MatSubtitle1>
  58. </div>
  59. <div class="w-100">
  60. <MatIcon Style="padding-right:1rem">
  61. <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000">
  62. <path d="M0 0h24v24H0V0z" fill="none" />
  63. <path d="M12 4C9.24 4 7 6.24 7 9c0 2.85 2.92 7.21 5 9.88 2.11-2.69 5-7 5-9.88 0-2.76-2.24-5-5-5zm0 7.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z" opacity=".3" />
  64. <path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zM7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 2.88-2.88 7.19-5 9.88C9.92 16.21 7 11.85 7 9z" />
  65. <circle cx="12" cy="9" r="2.5" />
  66. </svg>
  67. </MatIcon>
  68. <MatSubtitle1 Class="w-100" Style="font-family:Ubuntu; text-align:left; font-weight:800; display:contents">@I18n["FinishedTextMissing_LostOffice_Address"]</MatSubtitle1>
  69. </div>
  70. } else if (ResponseStatus.Error == responseStatus) {
  71. <Animate Animation="Animations.ZoomIn" Duration="TimeSpan.FromSeconds(2.5)">
  72. <FailureImage></FailureImage>
  73. </Animate>
  74. } else {
  75. <Animate Animation="Animations.ZoomIn" Duration="TimeSpan.FromSeconds(2.5)">
  76. <WarningImage></WarningImage>
  77. </Animate>
  78. }
  79. }
  80. </div>
  81. @if (!running) {
  82. if (ResponseStatus.Error == responseStatus) {
  83. <div class="row no-gutters align-items-end justify-content-center w-100" style="padding-bottom:2em;padding-top:2em">
  84. <div class="col" style="padding-right:0.5em">
  85. <MatButton Class="w-100" Outlined="true" @onclick="EditData" Style="padding-left: 3px; padding-right: 3px">@I18n["EditData"]</MatButton>
  86. </div>
  87. <div class="col" style="padding-left:0.5em">
  88. <MatButton Class="w-100" Raised="true" @onclick="Cancel">@I18n["Cancel"]</MatButton>
  89. </div>
  90. </div>
  91. } else {
  92. <div class="row no-gutters align-items-end justify-content-center w-100" style="padding-bottom:2em;padding-top:2em">
  93. <div class="col w-100 text-center">
  94. <MatButton Class="w-50" Raised="true" @onclick="Finished">@I18n["Finished"]</MatButton>
  95. </div>
  96. </div>
  97. }
  98. }
  99. </div>
  100. @code {
  101. enum ResponseStatus : ushort {
  102. OK = 1,
  103. Error = 10,
  104. NoConnection = 20
  105. }
  106. private ResponseStatus responseStatus = ResponseStatus.NoConnection;
  107. private bool running = true;
  108. private ReportResponse response;
  109. protected async override void OnInitialized() {
  110. base.OnInitialized();
  111. try {
  112. if (ReportDataProvider.ReportRepositoryItem != null) {
  113. response = await IBicycleRestService.SendMissingReport((MissingReportRepositoryItem)ReportDataProvider.ReportRepositoryItem);
  114. } else {
  115. response = await IBicycleRestService.SendMissingReport(ReportDataProvider.Report);
  116. }
  117. responseStatus = response == null ? ResponseStatus.NoConnection : System.Net.HttpStatusCode.OK == response.StatusCode ? ResponseStatus.OK : ResponseStatus.Error;
  118. } catch (HttpRequestException ex) {
  119. response = new(I18n.GetString("MissingBike"), new string[] { ex.Message });
  120. responseStatus = ResponseStatus.Error;
  121. }
  122. running = false;
  123. if (ResponseStatus.OK == responseStatus) {
  124. Toaster.ShowSuccess(I18n.GetString("MissingBike"), response.Message);
  125. PageHistoryManager.Reset();
  126. } else if (ResponseStatus.Error == responseStatus) {
  127. Toaster.ShowError(response.Message, response.GetDataAsFormattedList());
  128. } else {
  129. Toaster.ShowWarning(I18n.GetString("Warning.NoConnection.Title"), I18n.GetString("Warning.NoConnection.Msg"));
  130. PageHistoryManager.Reset();
  131. }
  132. StateHasChanged();
  133. AppState.NotifyChanged();
  134. }
  135. private void Finished() {
  136. NavigationManager.NavigateTo("caritas_services");
  137. }
  138. private void Cancel() {
  139. NavigationManager.NavigateTo("caritas_services");
  140. }
  141. private void EditData() {
  142. NavigationManager.NavigateTo("fundvelo/keydata/Missing");
  143. }
  144. }