More.cshtml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. @model LotteryWebApp.Models.HomeIndex_ViewModel
  2. @{
  3. ViewData["Title"] = "Millions - More";
  4. ViewData["ActiveTab"] = "More";
  5. Layout = "~/Areas/Millions/Views/Shared/_Layout.cshtml";
  6. string SubText(string key) => Lang.ResourceManager.GetString(key, System.Globalization.CultureInfo.CurrentUICulture) ?? key;
  7. }
  8. @using LotteryWebApp.Languages;
  9. @using LotteryWebApp.Common;
  10. <script src="https://cdn.tailwindcss.com"></script>
  11. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
  12. <link rel="stylesheet" href="/Millions/css/site.css" />
  13. <link rel="stylesheet" href="/Millions/css/more.css" />
  14. @functions {
  15. public string FormatMoney(string amount) {
  16. if (string.IsNullOrEmpty(amount)) return "0";
  17. var clean = new string(amount.Where(c => char.IsDigit(c)).ToArray());
  18. if (long.TryParse(clean, out long val)) {
  19. return val.ToString("#,##0", new System.Globalization.CultureInfo("vi-VN")).Replace(",", ".");
  20. }
  21. return amount;
  22. }
  23. }
  24. <div class="main-container animate__animated animate__fadeIn min-h-screen relative flex flex-col pb-24 overflow-x-hidden font-bricolage" style="background-color: #EAEAEA !important;">
  25. <!-- User Profile Header (Center Aligned, Red Background) -->
  26. <div class="w-full bg-[#0062FF] flex flex-col items-center justify-center pt-8 pb-6 px-6 relative z-10 border-none m-0">
  27. <!-- Avatar Ring -->
  28. <div class="w-[88px] h-[88px] bg-[#EAEAEA] rounded-full flex items-center justify-center border-4 border-[#FFF9CB] shadow-lg mb-3 overflow-hidden">
  29. <img src="/Millions/img/avatar.png" class="w-full h-full object-cover" onerror="this.outerHTML='<i class=\'fa-solid fa-user text-gray-500 text-4xl\'></i>'" />
  30. </div>
  31. <!-- Info -->
  32. <span class="font-bold text-lg text-white tracking-wide">@(Model?.profile?.fullName ?? "User")</span>
  33. <span class="text-sm text-white font-medium tracking-wide mb-2">@(Model?.profile?.users ?? "0000000000")</span>
  34. <!-- Coin Display (Matching GameHome aesthetic) -->
  35. <div class="flex items-center gap-1.5 mt-1 bg-black/10 px-4 py-1 rounded-full border border-white/10 backdrop-blur-sm">
  36. <img src="/Millions/img/gold_coin.png" class="w-5 h-5 object-contain" onerror="this.style.display='none'" />
  37. <span class="text-[22px] font-black text-[#FBF3A7]" style="text-shadow: 0 1px 2px rgba(0,0,0,0.2)">@FormatMoney(Model?.userStatus?.bet_coin)</span>
  38. <span class="text-[10px] font-bold text-[#FBF3A7] uppercase mt-1.5">@Lang.millions_htg</span>
  39. </div>
  40. </div>
  41. <!-- Menu List (White Full Container) -->
  42. <div class="w-full bg-white flex flex-col px-6 pt-2 pb-6 relative z-10 m-0 border-none">
  43. <!-- Item: Winning Account
  44. <div class="flex items-center justify-between py-[18px] border-b-2 border-dashed border-gray-100 cursor-pointer transition-colors active:bg-gray-50">
  45. <div class="flex items-center gap-4">
  46. <img src="/Millions/img/gold_coin.png" class="w-6 h-6 object-contain" onerror="this.outerHTML='<i class=\'fa-solid fa-sack-dollar text-[#4A4A4A] text-[20px] w-6 text-center\'></i>'" />
  47. <span class="text-[#212121] font-bold text-[13px]">@Lang.winning_account</span>
  48. </div>
  49. <span class="font-extrabold text-[15px] text-[#212121]">@(Model?.userStatus?.cash_coin ?? "0") HTG</span>
  50. </div> -->
  51. <!-- Item: Profile -->
  52. <div class="flex items-center justify-between py-[18px] border-b-2 border-dashed border-gray-100 cursor-pointer transition-colors active:bg-gray-50" onclick="window.location.href='/Millions/Home/Profile'">
  53. <div class="flex items-center gap-4">
  54. <i class="fa-regular fa-user text-[#4A4A4A] text-[20px] w-6 text-center"></i>
  55. <span class="text-[#212121] font-bold text-[13px]">@Lang.profile</span>
  56. </div>
  57. <i class="fa-solid fa-chevron-right text-gray-400 text-sm opacity-80"></i>
  58. </div>
  59. <!-- Item: Reward History -->
  60. <div class="flex items-center justify-between py-[18px] border-b-2 border-dashed border-gray-100 cursor-pointer transition-colors active:bg-gray-50" onclick="window.location.href='/Millions/Home/RewardHistory'">
  61. <div class="flex items-center gap-4">
  62. <i class="fa-solid fa-gift text-[#4A4A4A] text-[20px] w-6 text-center"></i>
  63. <span class="text-[#212121] font-bold text-[13px]">Reward History</span>
  64. </div>
  65. <i class="fa-solid fa-chevron-right text-gray-400 text-sm opacity-80"></i>
  66. </div>
  67. <!-- Item: Millions Subscription (Only visible if currently subscribed) -->
  68. <div id="subCancelMenuItem" class="@(ViewBag.IsSub == true ? "flex" : "hidden") items-center justify-between py-[18px] border-b-2 border-dashed border-gray-100 transition-colors">
  69. <div class="flex items-center gap-4">
  70. <div class="w-6 flex items-center justify-center text-[#0062FF]">
  71. <i class="fa-solid fa-ticket text-[20px]"></i>
  72. </div>
  73. <div>
  74. <div class="flex items-center gap-2">
  75. <span class="text-[#212121] font-bold text-[13px]">@SubText("sub_million_package_name")</span>
  76. <span class="text-[10px] font-extrabold text-[#0062FF] bg-[#0062FF]/10 px-2 py-0.5 rounded-full uppercase">@SubText("sub_million_active_badge")</span>
  77. </div>
  78. <span class="text-[11px] text-[#797979]">5 HTG/@SubText("sub_million_benefit_daily_short")</span>
  79. </div>
  80. </div>
  81. <button type="button" onclick="openCancelSubModal()" class="text-[12px] font-bold text-[#e53935] bg-red-50 hover:bg-red-100 active:scale-95 transition-all px-3 py-1.5 rounded-lg border border-red-200 cursor-pointer">
  82. @SubText("sub_million_cancel_btn")
  83. </button>
  84. </div>
  85. <!-- Item: How to play Pick 10
  86. <div class="flex items-center justify-between py-[18px] border-b-2 border-dashed border-gray-100 cursor-pointer transition-colors active:bg-gray-50" onclick="window.location.href='/Millions/Home/HowToPlay'">
  87. <div class="flex items-center gap-4">
  88. <i class="fa-regular fa-circle-question text-[#4A4A4A] text-[20px] w-6 text-center"></i>
  89. <span class="text-[#212121] font-bold text-[13px]">@Lang.how_to_play_pick10</span>
  90. </div>
  91. <i class="fa-solid fa-chevron-right text-gray-400 text-sm opacity-80"></i>
  92. </div>
  93. -->
  94. <!-- Item: Change Lang
  95. <div class="flex items-center justify-between py-[18px] border-b-2 border-dashed border-gray-100 cursor-pointer transition-colors active:bg-gray-50" onclick="toggleLanguage()">
  96. <div class="flex items-center gap-4">
  97. <i class="fa-solid fa-language text-[#1689FC] text-[22px] w-6 text-center shadow-blue-500 drop-shadow-sm"></i>
  98. <span class="text-[#212121] font-bold text-[13px]">@Lang.change_language</span>
  99. </div>
  100. <i class="fa-solid fa-chevron-right text-gray-400 text-sm opacity-80"></i>
  101. </div>
  102. -->
  103. <!-- Item: Contact Us -->
  104. <div class="flex items-center justify-between py-[18px] cursor-pointer transition-colors active:bg-gray-50">
  105. <div class="flex items-center gap-4">
  106. <i class="fa-solid fa-phone-volume text-[#4A4A4A] text-[18px] w-6 text-center" style="transform: rotate(-15deg);"></i>
  107. <span class="text-[#212121] font-bold text-[13px]">@Lang.contact_us</span>
  108. </div>
  109. <div class="flex items-center gap-3">
  110. <span class="font-extrabold text-[15px] text-[#0062FF]">191</span>
  111. <i class="fa-solid fa-chevron-right text-gray-400 text-sm opacity-80"></i>
  112. </div>
  113. </div>
  114. <!-- Log out Button -->
  115. <div class="mt-6 w-full px-1">
  116. <a href="@Url.Action("Logout", "Home", new { area = "Millions" })" class="w-full flex items-center justify-center bg-[#f00b39] text-white font-bold text-[18px] py-[14px] rounded-[10px] shadow-[0_5px_15px_rgba(238,0,51,0.2)] hover:bg-red-700 transition-colors cursor-pointer no-underline active:scale-95 duration-150">
  117. @Lang.logout
  118. </a>
  119. </div>
  120. <!-- Item: Change Language Flags -->
  121. <div class="mt-8 flex items-center justify-center w-full px-1">
  122. <div class="flex items-center gap-2 bg-gray-100 p-1.5 rounded-xl w-full">
  123. @{
  124. var currentLang = System.Threading.Thread.CurrentThread.CurrentCulture.Name;
  125. }
  126. <a href="javascript:void(0)" onclick="setLanguage('fr')" class="flex flex-1 justify-center items-center gap-2 px-3 py-2 rounded-lg transition-all @(currentLang == "fr" ? "bg-white shadow-sm border border-gray-200" : "opacity-60 hover:opacity-100")">
  127. <img src="/img/en_flag.png" alt="English" class="w-7 h-auto drop-shadow-sm" />
  128. <span class="text-[13px] font-bold text-gray-700">English</span>
  129. </a>
  130. <a href="javascript:void(0)" onclick="setLanguage('en')" class="flex flex-1 justify-center items-center gap-2 px-3 py-2 rounded-lg transition-all @(currentLang != "fr" ? "bg-white shadow-sm border border-gray-200" : "opacity-60 hover:opacity-100")">
  131. <img src="/img/Flag_of_Haiti.png" alt="Natcom" class="w-7 h-auto drop-shadow-sm" />
  132. <span class="text-[13px] font-bold text-gray-700">Natcom</span>
  133. </a>
  134. </div>
  135. </div>
  136. </div>
  137. <!-- Real scalloped edge using CSS mask trick below the white box -->
  138. <div class="w-full relative z-10 scalloped-bottom"></div>
  139. <!-- Bottom Navbar shared component -->
  140. <partial name="_BottomNavbar" />
  141. </div>
  142. <!-- Cancel Subscription Modal -->
  143. <div id="cancelSubModal" class="fixed inset-0 z-[100] flex items-center justify-center hidden px-6 font-bricolage" style="background: rgba(5, 0, 60, 0.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);">
  144. <div class="relative w-full max-w-[343px] bg-white rounded-[24px] overflow-hidden flex flex-col p-6 animate__animated animate__zoomIn animate__faster shadow-2xl">
  145. <!-- Close button in top-right -->
  146. <button type="button" onclick="closeCancelSubModal()" class="absolute top-3 right-3 w-8 h-8 rounded-full bg-gray-100 hover:bg-gray-200 flex items-center justify-center text-gray-500 transition-colors text-sm cursor-pointer">
  147. <i class="fa-solid fa-xmark"></i>
  148. </button>
  149. <!-- Confirm View -->
  150. <div id="cancelSubConfirmView" class="w-full flex flex-col items-center pt-2">
  151. <div class="w-16 h-16 rounded-full bg-red-50 border-4 border-red-100 flex items-center justify-center text-[#e53935] text-2xl mb-4">
  152. <i class="fa-solid fa-bell-slash"></i>
  153. </div>
  154. <h3 class="text-[#0a1f44] font-[800] text-[20px] leading-tight text-center mb-2">
  155. @SubText("sub_million_cancel_confirm_title")
  156. </h3>
  157. <p class="text-[#4a4a4a] text-[13px] leading-relaxed text-center mb-6 px-1">
  158. @SubText("sub_million_cancel_confirm_desc")
  159. </p>
  160. <button type="button" id="confirmCancelSubBtn" onclick="executeCancelSub()" class="w-full bg-[#e53935] hover:bg-[#d32f2f] text-white font-[800] text-[16px] py-3 rounded-[14px] shadow-[0_4px_12px_rgba(229,57,53,0.3)] active:scale-95 transition-all flex items-center justify-center gap-2 cursor-pointer">
  161. <span>@SubText("sub_million_cancel_confirm_yes")</span>
  162. <i id="cancelSpinner" class="fa-solid fa-spinner fa-spin hidden"></i>
  163. </button>
  164. <button type="button" onclick="closeCancelSubModal()" class="mt-2.5 w-full py-2.5 rounded-[14px] text-gray-600 bg-gray-100 hover:bg-gray-200 active:scale-95 font-bold text-[14px] transition-all text-center cursor-pointer">
  165. @SubText("sub_million_cancel_keep")
  166. </button>
  167. </div>
  168. <!-- Result View -->
  169. <div id="cancelSubResultView" class="w-full flex-col items-center pt-2 hidden">
  170. <div id="cancelResultSuccessIcon" class="w-16 h-16 rounded-full bg-emerald-50 border-4 border-emerald-100 flex items-center justify-center text-emerald-600 text-2xl mb-4 hidden">
  171. <i class="fa-solid fa-check"></i>
  172. </div>
  173. <div id="cancelResultFailIcon" class="w-16 h-16 rounded-full bg-red-50 border-4 border-red-100 flex items-center justify-center text-[#e53935] text-2xl mb-4 hidden">
  174. <i class="fa-solid fa-exclamation"></i>
  175. </div>
  176. <h3 id="cancelResultTitle" class="text-[#0a1f44] font-[800] text-[20px] leading-tight text-center mb-2"></h3>
  177. <p id="cancelResultMessage" class="text-[#4a4a4a] text-[13px] leading-relaxed text-center mb-6 px-1"></p>
  178. <button type="button" onclick="closeCancelSubModal()" class="w-full bg-[#0062FF] hover:bg-[#0052d9] text-white font-[800] text-[16px] py-3 rounded-[14px] shadow-lg active:scale-95 transition-all cursor-pointer">
  179. @Lang.v2_close
  180. </button>
  181. </div>
  182. </div>
  183. </div>
  184. @section Scripts {
  185. <script>
  186. function setLanguage(newLang) {
  187. fetch(subDomain + '/Home/SetCulture?lang=' + newLang)
  188. .then(response => {
  189. location.reload();
  190. })
  191. .catch(error => {
  192. location.reload();
  193. });
  194. }
  195. function openCancelSubModal() {
  196. $('#cancelSubResultView').addClass('hidden').removeClass('flex');
  197. $('#cancelSubConfirmView').removeClass('hidden').addClass('flex');
  198. $('#cancelSubModal').removeClass('hidden').addClass('flex');
  199. }
  200. function closeCancelSubModal() {
  201. $('#cancelSubModal').addClass('hidden').removeClass('flex');
  202. }
  203. function showCancelResult(isSuccess, message) {
  204. $('#cancelSubConfirmView').addClass('hidden').removeClass('flex');
  205. if (isSuccess) {
  206. $('#cancelResultSuccessIcon').removeClass('hidden');
  207. $('#cancelResultFailIcon').addClass('hidden');
  208. $('#cancelResultTitle').text('@Html.Raw(SubText("sub_million_cancel_success_title"))');
  209. } else {
  210. $('#cancelResultSuccessIcon').addClass('hidden');
  211. $('#cancelResultFailIcon').removeClass('hidden');
  212. $('#cancelResultTitle').text('Failed');
  213. }
  214. $('#cancelResultMessage').text(message);
  215. $('#cancelSubResultView').removeClass('hidden').addClass('flex');
  216. }
  217. function executeCancelSub() {
  218. var $btn = $('#confirmCancelSubBtn');
  219. $btn.prop('disabled', true).addClass('opacity-70');
  220. $('#cancelSpinner').removeClass('hidden');
  221. $.ajax({
  222. url: subDomain + '/Millions/Home/CancelSub',
  223. type: 'POST',
  224. data: {
  225. __RequestVerificationToken: $('input[name="__RequestVerificationToken"]').val()
  226. },
  227. success: function (res) {
  228. if (res && res.responseCode === "0") {
  229. $('#subCancelMenuItem').addClass('hidden').removeClass('flex');
  230. showCancelResult(true, "@Html.Raw(SubText("sub_million_cancel_success_desc"))");
  231. } else if (res && res.responseCode === "@Code.SESSION_EXPIRED") {
  232. window.location.href = subDomain + "/Account/Login";
  233. } else {
  234. var msg = (res && res.responseMessage) || "@Html.Raw(SubText("sub_million_cancel_fail"))";
  235. showCancelResult(false, msg);
  236. }
  237. },
  238. error: function () {
  239. showCancelResult(false, "@Html.Raw(SubText("sub_million_cancel_fail"))");
  240. },
  241. complete: function () {
  242. $btn.prop('disabled', false).removeClass('opacity-70');
  243. $('#cancelSpinner').addClass('hidden');
  244. }
  245. });
  246. }
  247. $(document).ready(function () {
  248. $('#cancelSubModal').on('click', function(e) {
  249. if (e.target === this) closeCancelSubModal();
  250. });
  251. // Sync subscription status with backend API
  252. $.ajax({
  253. url: subDomain + '/Millions/Home/CheckSub',
  254. type: 'POST',
  255. global: false,
  256. data: {
  257. __RequestVerificationToken: $('input[name="__RequestVerificationToken"]').val()
  258. },
  259. success: function (res) {
  260. if (res && res.responseCode === "0") {
  261. if (res.isSub === true) {
  262. $('#subCancelMenuItem').removeClass('hidden').addClass('flex');
  263. } else {
  264. $('#subCancelMenuItem').addClass('hidden').removeClass('flex');
  265. }
  266. }
  267. }
  268. });
  269. });
  270. </script>
  271. }