|
@@ -3,8 +3,10 @@
|
|
|
ViewData["Title"] = "Millions - More";
|
|
ViewData["Title"] = "Millions - More";
|
|
|
ViewData["ActiveTab"] = "More";
|
|
ViewData["ActiveTab"] = "More";
|
|
|
Layout = "~/Areas/Millions/Views/Shared/_Layout.cshtml";
|
|
Layout = "~/Areas/Millions/Views/Shared/_Layout.cshtml";
|
|
|
|
|
+ string SubText(string key) => Lang.ResourceManager.GetString(key, System.Globalization.CultureInfo.CurrentUICulture) ?? key;
|
|
|
}
|
|
}
|
|
|
@using LotteryWebApp.Languages;
|
|
@using LotteryWebApp.Languages;
|
|
|
|
|
+@using LotteryWebApp.Common;
|
|
|
|
|
|
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
@@ -22,7 +24,7 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-<div class="main-container animate__animated animate__fadeIn min-h-screen relative flex flex-col pb-24 overflow-x-hidden" style="background-color: #EAEAEA !important;">
|
|
|
|
|
|
|
+<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;">
|
|
|
|
|
|
|
|
<!-- User Profile Header (Center Aligned, Red Background) -->
|
|
<!-- User Profile Header (Center Aligned, Red Background) -->
|
|
|
<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">
|
|
<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">
|
|
@@ -72,6 +74,25 @@
|
|
|
<i class="fa-solid fa-chevron-right text-gray-400 text-sm opacity-80"></i>
|
|
<i class="fa-solid fa-chevron-right text-gray-400 text-sm opacity-80"></i>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
+ <!-- Item: Millions Subscription (Only visible if currently subscribed) -->
|
|
|
|
|
+ <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">
|
|
|
|
|
+ <div class="flex items-center gap-4">
|
|
|
|
|
+ <div class="w-6 flex items-center justify-center text-[#0062FF]">
|
|
|
|
|
+ <i class="fa-solid fa-ticket text-[20px]"></i>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <div class="flex items-center gap-2">
|
|
|
|
|
+ <span class="text-[#212121] font-bold text-[13px]">@SubText("sub_million_package_name")</span>
|
|
|
|
|
+ <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>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <span class="text-[11px] text-[#797979]">5 HTG/@SubText("sub_million_benefit_daily_short")</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <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">
|
|
|
|
|
+ @SubText("sub_million_cancel_btn")
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
<!-- Item: How to play Pick 10
|
|
<!-- Item: How to play Pick 10
|
|
|
<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'">
|
|
<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'">
|
|
|
<div class="flex items-center gap-4">
|
|
<div class="flex items-center gap-4">
|
|
@@ -92,8 +113,6 @@
|
|
|
</div>
|
|
</div>
|
|
|
-->
|
|
-->
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
<!-- Item: Contact Us -->
|
|
<!-- Item: Contact Us -->
|
|
|
<div class="flex items-center justify-between py-[18px] cursor-pointer transition-colors active:bg-gray-50">
|
|
<div class="flex items-center justify-between py-[18px] cursor-pointer transition-colors active:bg-gray-50">
|
|
|
<div class="flex items-center gap-4">
|
|
<div class="flex items-center gap-4">
|
|
@@ -138,10 +157,53 @@
|
|
|
<partial name="_BottomNavbar" />
|
|
<partial name="_BottomNavbar" />
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
+<!-- Cancel Subscription Modal -->
|
|
|
|
|
+<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);">
|
|
|
|
|
+ <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">
|
|
|
|
|
+ <!-- Close button in top-right -->
|
|
|
|
|
+ <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">
|
|
|
|
|
+ <i class="fa-solid fa-xmark"></i>
|
|
|
|
|
+ </button>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- Confirm View -->
|
|
|
|
|
+ <div id="cancelSubConfirmView" class="w-full flex flex-col items-center pt-2">
|
|
|
|
|
+ <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">
|
|
|
|
|
+ <i class="fa-solid fa-bell-slash"></i>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <h3 class="text-[#0a1f44] font-[800] text-[20px] leading-tight text-center mb-2">
|
|
|
|
|
+ @SubText("sub_million_cancel_confirm_title")
|
|
|
|
|
+ </h3>
|
|
|
|
|
+ <p class="text-[#4a4a4a] text-[13px] leading-relaxed text-center mb-6 px-1">
|
|
|
|
|
+ @SubText("sub_million_cancel_confirm_desc")
|
|
|
|
|
+ </p>
|
|
|
|
|
+ <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">
|
|
|
|
|
+ <span>@SubText("sub_million_cancel_confirm_yes")</span>
|
|
|
|
|
+ <i id="cancelSpinner" class="fa-solid fa-spinner fa-spin hidden"></i>
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <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">
|
|
|
|
|
+ @SubText("sub_million_cancel_keep")
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
|
|
+ <!-- Result View -->
|
|
|
|
|
+ <div id="cancelSubResultView" class="w-full flex-col items-center pt-2 hidden">
|
|
|
|
|
+ <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">
|
|
|
|
|
+ <i class="fa-solid fa-check"></i>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <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">
|
|
|
|
|
+ <i class="fa-solid fa-exclamation"></i>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <h3 id="cancelResultTitle" class="text-[#0a1f44] font-[800] text-[20px] leading-tight text-center mb-2"></h3>
|
|
|
|
|
+ <p id="cancelResultMessage" class="text-[#4a4a4a] text-[13px] leading-relaxed text-center mb-6 px-1"></p>
|
|
|
|
|
+ <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">
|
|
|
|
|
+ @Lang.v2_close
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</div>
|
|
|
|
|
|
|
|
|
|
+@section Scripts {
|
|
|
<script>
|
|
<script>
|
|
|
-
|
|
|
|
|
function setLanguage(newLang) {
|
|
function setLanguage(newLang) {
|
|
|
fetch(subDomain + '/Home/SetCulture?lang=' + newLang)
|
|
fetch(subDomain + '/Home/SetCulture?lang=' + newLang)
|
|
|
.then(response => {
|
|
.then(response => {
|
|
@@ -151,6 +213,90 @@
|
|
|
location.reload();
|
|
location.reload();
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ function openCancelSubModal() {
|
|
|
|
|
+ $('#cancelSubResultView').addClass('hidden').removeClass('flex');
|
|
|
|
|
+ $('#cancelSubConfirmView').removeClass('hidden').addClass('flex');
|
|
|
|
|
+ $('#cancelSubModal').removeClass('hidden').addClass('flex');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function closeCancelSubModal() {
|
|
|
|
|
+ $('#cancelSubModal').addClass('hidden').removeClass('flex');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function showCancelResult(isSuccess, message) {
|
|
|
|
|
+ $('#cancelSubConfirmView').addClass('hidden').removeClass('flex');
|
|
|
|
|
+ if (isSuccess) {
|
|
|
|
|
+ $('#cancelResultSuccessIcon').removeClass('hidden');
|
|
|
|
|
+ $('#cancelResultFailIcon').addClass('hidden');
|
|
|
|
|
+ $('#cancelResultTitle').text('@Html.Raw(SubText("sub_million_cancel_success_title"))');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $('#cancelResultSuccessIcon').addClass('hidden');
|
|
|
|
|
+ $('#cancelResultFailIcon').removeClass('hidden');
|
|
|
|
|
+ $('#cancelResultTitle').text('Failed');
|
|
|
|
|
+ }
|
|
|
|
|
+ $('#cancelResultMessage').text(message);
|
|
|
|
|
+ $('#cancelSubResultView').removeClass('hidden').addClass('flex');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function executeCancelSub() {
|
|
|
|
|
+ var $btn = $('#confirmCancelSubBtn');
|
|
|
|
|
+ $btn.prop('disabled', true).addClass('opacity-70');
|
|
|
|
|
+ $('#cancelSpinner').removeClass('hidden');
|
|
|
|
|
+
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ url: subDomain + '/Millions/Home/CancelSub',
|
|
|
|
|
+ type: 'POST',
|
|
|
|
|
+ data: {
|
|
|
|
|
+ __RequestVerificationToken: $('input[name="__RequestVerificationToken"]').val()
|
|
|
|
|
+ },
|
|
|
|
|
+ success: function (res) {
|
|
|
|
|
+ if (res && res.responseCode === "0") {
|
|
|
|
|
+ $('#subCancelMenuItem').addClass('hidden').removeClass('flex');
|
|
|
|
|
+ showCancelResult(true, "@Html.Raw(SubText("sub_million_cancel_success_desc"))");
|
|
|
|
|
+ } else if (res && res.responseCode === "@Code.SESSION_EXPIRED") {
|
|
|
|
|
+ window.location.href = subDomain + "/Account/Login";
|
|
|
|
|
+ } else {
|
|
|
|
|
+ var msg = (res && res.responseMessage) || "@Html.Raw(SubText("sub_million_cancel_fail"))";
|
|
|
|
|
+ showCancelResult(false, msg);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ error: function () {
|
|
|
|
|
+ showCancelResult(false, "@Html.Raw(SubText("sub_million_cancel_fail"))");
|
|
|
|
|
+ },
|
|
|
|
|
+ complete: function () {
|
|
|
|
|
+ $btn.prop('disabled', false).removeClass('opacity-70');
|
|
|
|
|
+ $('#cancelSpinner').addClass('hidden');
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $(document).ready(function () {
|
|
|
|
|
+ $('#cancelSubModal').on('click', function(e) {
|
|
|
|
|
+ if (e.target === this) closeCancelSubModal();
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // Sync subscription status with backend API
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ url: subDomain + '/Millions/Home/CheckSub',
|
|
|
|
|
+ type: 'POST',
|
|
|
|
|
+ global: false,
|
|
|
|
|
+ data: {
|
|
|
|
|
+ __RequestVerificationToken: $('input[name="__RequestVerificationToken"]').val()
|
|
|
|
|
+ },
|
|
|
|
|
+ success: function (res) {
|
|
|
|
|
+ if (res && res.responseCode === "0") {
|
|
|
|
|
+ if (res.isSub === true) {
|
|
|
|
|
+ $('#subCancelMenuItem').removeClass('hidden').addClass('flex');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $('#subCancelMenuItem').addClass('hidden').removeClass('flex');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
</script>
|
|
</script>
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|