JackpotDetail.cshtml 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. @model LotteryWebApp.Models.HomeIndex_ViewModel
  2. @using System
  3. @using System.Globalization
  4. @using System.Collections.Generic
  5. @using LotteryWebApp.Common
  6. @using LotteryWebApp.Languages
  7. @using LotteryWebApp.Service
  8. @{
  9. ViewData["Title"] = "Millions - Jackpot Detail";
  10. Layout = "~/Areas/Millions/Views/Shared/_Layout.cshtml";
  11. var drawId = (ViewBag.DrawId as string) ?? "";
  12. var winners = ViewBag.Winners as List<JackpotWinnerItem> ?? new List<JackpotWinnerItem>();
  13. var firstWinner = winners.Count > 0 ? winners[0] : null;
  14. var mainBalls = new string[5];
  15. var mbBall = "0";
  16. var resultStr = firstWinner != null ? firstWinner.result : "";
  17. var balls = !string.IsNullOrEmpty(resultStr) ? resultStr.Split(',') : new string[0];
  18. for (int i = 0; i < 5; i++)
  19. {
  20. mainBalls[i] = i < balls.Length ? balls[i].Trim() : "0";
  21. }
  22. if (balls.Length >= 6) mbBall = balls[5].Trim();
  23. string drawDateFmt = "";
  24. string drawDateLong = "";
  25. string drawTime = "";
  26. DateTime drawDt;
  27. string rawDate = firstWinner != null ? firstWinner.randomDate : "";
  28. string[] tryFormats = { "M/d/yyyy h:mm:ss tt", "MM/dd/yyyy h:mm:ss tt", "dd/MM/yyyy HH:mm:ss", "yyyy-MM-dd HH:mm:ss" };
  29. if (!string.IsNullOrEmpty(rawDate)
  30. && (DateTime.TryParseExact(rawDate, tryFormats, CultureInfo.InvariantCulture, DateTimeStyles.None, out drawDt)
  31. || DateTime.TryParse(rawDate, CultureInfo.InvariantCulture, DateTimeStyles.None, out drawDt)))
  32. {
  33. drawDateFmt = drawDt.ToString("MMM dd, yyyy", new CultureInfo("en-US"));
  34. drawDateLong = drawDt.ToString("dddd, MMM dd, yyyy", new CultureInfo("en-US"));
  35. drawTime = drawDt.ToString("HH:mm");
  36. }
  37. long jackpotPrizeTotal = 0;
  38. foreach (var w in winners)
  39. {
  40. long m;
  41. if (long.TryParse(w.moneyWin, out m)) jackpotPrizeTotal += m;
  42. }
  43. var jackpotPrize = jackpotPrizeTotal.ToString();
  44. var winnersCount = winners.Count;
  45. }
  46. @section Styles {
  47. <link rel="preconnect" href="https://fonts.googleapis.com">
  48. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  49. <link href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&display=swap" rel="stylesheet">
  50. <link rel="stylesheet" href="/Millions/css/all.min.css"/>
  51. <link rel="stylesheet" href="/Millions/css/jackpot.css"/>
  52. }
  53. <div class="main-content h-dvh w-full max-w-[430px] mx-auto bg-[#f5f7fb] relative overflow-hidden font-bricolage">
  54. <!-- Header gradient -->
  55. <div class="header-bg absolute inset-x-0 top-0 h-[160px] flex flex-col items-center pt-4 px-3 z-0">
  56. <div class="w-full flex items-center justify-between">
  57. <button onclick="location.href=subDomain + '@Url.Action("JackpotResults", "Home", new { area = "Millions", termType = Model.termType })';" class="js-back w-6 h-6 flex items-center justify-center">
  58. <img src="/Millions/assets/icons/arrow-left.svg" alt="Back" class="w-6 h-6"/>
  59. </button>
  60. <p class="text-white text-base font-bold">@Lang.millions_jackpot_results_title</p>
  61. <span class="w-6 h-6"></span>
  62. </div>
  63. <p class="text-white/80 text-xs -mt-1">@Lang.millions_draw_no_short<span class="font-bold">@drawId</span></p>
  64. </div>
  65. <!-- White rounded body (overlaps header, scrollable) -->
  66. <div class="absolute inset-x-0 top-[56px] bottom-0 bg-white rounded-t-[40px] flex flex-col gap-2 px-3 pt-4 pb-[96px] overflow-y-auto hide-scrollbar z-10" style="box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);">
  67. <!-- Top: Draw info + MB ball + Jackpot prize -->
  68. <div class="flex items-start justify-between shrink-0">
  69. <div class="flex flex-col gap-1 items-start">
  70. <span class="bg-[#0062ff] text-white text-base font-bold rounded-xl px-2 py-1">@Lang.millions_draw_no_short@drawId</span>
  71. <div class="flex items-center gap-1">
  72. <img src="/Millions/assets/icons/calendar.png" alt="" class="w-5 h-5"/>
  73. <span class="text-xs text-black">@drawDateLong</span>
  74. </div>
  75. <div class="flex items-center gap-1">
  76. <svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="#0062ff" stroke-width="2"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2" stroke-linecap="round"/></svg>
  77. <span class="text-xs text-black">@drawTime</span>
  78. </div>
  79. </div>
  80. <div class="flex items-center gap-2 relative">
  81. <div class="relative">
  82. <img src="/Millions/assets/icons/crown.png" alt="" class="absolute -top-3 -right-1 w-5 h-auto rotate-[15deg] z-0 pointer-events-none"/>
  83. <div class="ball ball-mb relative z-10" style="width:52px;height:52px;font-size:22px;">@mbBall</div>
  84. <span class="absolute -bottom-1 -right-1 bg-[#ee0033] text-white text-[10px] font-bold px-1 py-0.5 rounded z-20">MB</span>
  85. </div>
  86. <div class="flex flex-col">
  87. <span class="text-xs font-bold text-black">@Lang.millions_jackpot_prize</span>
  88. <p class="leading-none mt-1">
  89. <span class="text-[28px] font-condensed font-bold text-[#002bff] tracking-tight">@Utils.FormatMoney(jackpotPrize)</span><span class="text-xs font-bold text-black ml-1 align-top">@Lang.v2_htg</span>
  90. </p>
  91. <span class="text-[8px] font-bold text-[#8e8e93] mt-1">@Lang.millions_mega_jackpot</span>
  92. </div>
  93. </div>
  94. </div>
  95. <!-- Winning Numbers box -->
  96. <div class="result-box rounded-[32px] py-3 flex flex-col gap-2 shrink-0">
  97. <p class="text-xs font-bold text-black text-center">@Lang.millions_winning_numbers</p>
  98. <div class="flex items-center justify-center gap-3 px-4">
  99. @for (int i = 0; i < 5; i++)
  100. {
  101. <div class="ball ball-blue">@mainBalls[i]</div>
  102. }
  103. <div class="relative">
  104. <img src="/Millions/assets/icons/crown.png" alt="" class="absolute -top-4 -right-1 w-7 h-auto rotate-[15deg] z-0 pointer-events-none"/>
  105. <div class="ball ball-mb relative z-10">@mbBall</div>
  106. <span class="absolute -bottom-1 -right-2 bg-[#ee0033] text-white text-[8px] font-bold px-1.5 py-0.5 rounded z-20">MB</span>
  107. </div>
  108. </div>
  109. </div>
  110. <!-- Winning Subscribes -->
  111. <div class="result-box rounded-xl py-3 flex flex-col gap-2 shrink-0">
  112. <div class="flex flex-col px-3 gap-1">
  113. <p class="text-xs font-bold text-black">@Lang.millions_winning_subscribes (@winnersCount)</p>
  114. <p class="text-xs text-black">@string.Format(Lang.millions_subscribers_won_jackpot, winnersCount)</p>
  115. </div>
  116. <div class="grid grid-cols-2 gap-2 px-3">
  117. @{ int idx = 0; }
  118. @foreach (var w in winners)
  119. {
  120. idx++;
  121. var phone = w.msisdn ?? "";
  122. string masked = phone;
  123. if (phone.Length >= 7)
  124. {
  125. masked = "+" + phone.Substring(0, 3) + " " + phone.Substring(3, 2) + "****" + phone.Substring(phone.Length - 2);
  126. }
  127. <div class="flex items-center gap-2 border border-[#ccc] rounded-lg px-2 py-1.5"><span class="bg-[#0062ff] text-white text-xs font-bold rounded-lg w-4 h-4 flex items-center justify-center">@idx</span><span class="text-xs font-bold text-black">@masked</span></div>
  128. }
  129. @if (winnersCount == 0)
  130. {
  131. <p class="text-xs text-[#8e8e93] col-span-2 text-center py-2">@Lang.millions_no_winners</p>
  132. }
  133. </div>
  134. </div>
  135. <!-- Draw information -->
  136. <div class="result-box rounded-xl py-3 flex flex-col gap-2 px-3">
  137. <p class="text-xs font-bold text-black">@Lang.millions_draw_information</p>
  138. <div class="grid grid-cols-2 gap-x-1 gap-y-1 text-xs">
  139. <p class="text-[#8e8e93]">@Lang.millions_game_type</p>
  140. <p class="font-bold text-black">@Lang.millions_mega_jackpot</p>
  141. <p class="text-[#8e8e93]">@Lang.millions_total_winners</p>
  142. <p class="font-bold text-black">@winnersCount</p>
  143. <p class="text-[#8e8e93]">@Lang.millions_draw_date_time</p>
  144. <p class="font-bold text-black">@drawDateFmt - @drawTime</p>
  145. </div>
  146. </div>
  147. <!-- Note -->
  148. <div class="bg-[#ecf3fd] rounded-xl px-3 py-2 flex flex-col gap-1 shrink-0">
  149. <div class="flex items-center gap-1">
  150. <span class="bg-[#0062ff] text-white text-sm font-bold rounded-xl w-[17px] h-5 flex items-center justify-center leading-none">i</span>
  151. <p class="text-[10px] font-bold text-[#0062ff]">@Lang.millions_note</p>
  152. </div>
  153. <div class="text-xs text-[#8e8e93] leading-tight">
  154. <p>@Lang.millions_note_results_public</p>
  155. <p>@Lang.millions_note_thank_you</p>
  156. </div>
  157. </div>
  158. <!-- Back button -->
  159. <a href="@Url.Action("JackpotResults", "Home", new { area = "Millions", termType = Model.termType })" class="bg-[#0062ff] text-white text-sm font-bold text-center rounded-xl px-3 py-3 mt-2 mb-1 shrink-0">@Lang.millions_back_to_results_list</a>
  160. </div>
  161. </div>
  162. @section Scripts {
  163. <script src="/Millions/js/all.min.js"></script>
  164. }