_Layout.cshtml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. @using WebChallenge.Controllers;
  3. @using WebChallenge.Extensions;
  4. @using System.Globalization;
  5. @using Newtonsoft.Json;
  6. @{
  7. }
  8. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="vi" lang="vi">
  9. <head>
  10. <meta charset="UTF-8" />
  11. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  12. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  13. <title>Dezafiu</title>
  14. <!--CSS-->
  15. <link rel="stylesheet" href="~/css/all.min.css" />
  16. <link rel="stylesheet" href="~/css/custom.css" />
  17. <!--JS-->
  18. <script src="~/lib/jquery/jquery.min.js"></script>
  19. <script src="~/js/input.js"></script>
  20. </head>
  21. <body>
  22. @Html.AntiForgeryToken()
  23. <div class="main-content logo-background game h-dvh login">
  24. <!-- Content -->
  25. <!-- Body content -->
  26. @RenderBody()
  27. <div id="dialogResult" data-open="false"
  28. class="modal-popup fixed top-0 left-0 inset-0 bg-black bg-opacity-50 flex justify-center items-center hidden">
  29. <!-- Modal Content -->
  30. <div class="px-4 w-full content-modal overflow-auto max-h-dvh">
  31. <div class="modal-container">
  32. <div class="modal mx-4">
  33. <div class="popup-buy-error">
  34. <p class="text-2xl font-bold uppercase" id="dialogHeader">
  35. </p>
  36. <img src="~/assets/icons/error.svg" alt="error" id="dialogIcon" />
  37. <p class="text-center" id="dialogMessage">
  38. </p>
  39. <input type="hidden" id="reload" />
  40. <input type="hidden" id="exit" />
  41. <a href="#" onclick="closeDialog('dialogResult')" class="font-Alatsi text-2xl bg-[#F06522] rounded-[1.25rem] w-full max-w-[224px] px-[0.625rem] text-center">
  42. @Lang.Close
  43. </a>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. <div id="dialogGameOver" data-open="false"
  50. class="modal-popup fixed top-0 left-0 inset-0 bg-black bg-opacity-50 flex justify-center items-center hidden">
  51. <!-- Modal Content -->
  52. <div class="px-4 w-full content-modal overflow-auto max-h-dvh">
  53. <div class="modal-container">
  54. <div class="modal mx-4">
  55. <div class="popup-linear text-white flex flex-col items-center gap-5 pt-[2.65625rem] pr-[0.875rem] pb-[2.71875rem] pl-[0.875rem]">
  56. <div class="text-center">
  57. <p class="text-2xl font-bold uppercase leading-none">@Lang.GameOver</p>
  58. <p class="text-[#FBFF00] text-xl font-black uppercase leading-none">
  59. @Lang.Challenge <span id="challengeOver">1</span>
  60. </p>
  61. </div>
  62. <img src="../assets/icons/error.svg" alt="success" />
  63. @*<p>
  64. Total score: <span class="text-[#FBFF00] font-extrabold ml-5">200</span>
  65. </p>*@
  66. <p class="text-center w-full max-w-[250px]">
  67. @Lang.PlayAgainOrClose
  68. </p>
  69. <div class="w-full flex gap-5 justify-between px-5">
  70. <a href="/Home/CheckPlay"
  71. class="bg-4 h-[41px] w-full max-w-[136.5px] text-[#5A5A5A] font-Alatsi text-2xl rounded-[1.25rem] flex justify-center items-center text-center">
  72. @Lang.PlayNow
  73. </a>
  74. <a href="#" onclick="hideModal('dialogGameOver')"
  75. class="bg-[#F06522] h-[41px] w-full max-w-[136.5px] text-white font-Alatsi text-2xl rounded-[1.25rem] flex justify-center items-center text-center">
  76. @Lang.Close
  77. </a>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. <div id="exitModal"
  85. class="modal-popup fixed top-0 left-0 inset-0 bg-black bg-opacity-50 flex justify-center items-center hidden">
  86. <!-- Modal Content -->
  87. <div class="px-4 w-full content-modal overflow-auto max-h-dvh">
  88. <div class="popup-buy-error">
  89. <p class="text-center">
  90. @Lang.ConfirmExit
  91. </p>
  92. <div class="w-full flex gap-5 justify-between px-5">
  93. <a href="/Home/Logout"
  94. class="bg-4 h-[41px] w-full max-w-[136.5px] text-[#5A5A5A] font-Alatsi text-2xl rounded-[1.25rem] flex justify-center items-center text-center">
  95. @Lang.Exit
  96. </a>
  97. <a href="#" onclick="hideModal('exitModal')"
  98. id="closeModal"
  99. class="bg-[#F06522] h-[41px] w-full max-w-[136.5px] text-white font-Alatsi text-2xl rounded-[1.25rem] flex justify-center items-center text-center">
  100. @Lang.Close
  101. </a>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. <div id="dialogCancel"
  107. class="modal-popup fixed top-0 left-0 inset-0 bg-black bg-opacity-50 flex justify-center items-center hidden">
  108. <!-- Modal Content -->
  109. <div class="px-4 w-full content-modal overflow-auto max-h-dvh">
  110. <div class="popup-buy-error">
  111. <p class="text-left">
  112. @Html.Raw(Lang.CancelDetailInfo)
  113. </p>
  114. <div class="w-full flex gap-5 justify-center px-5">
  115. <a href="#" onclick="hideModal('dialogCancel')"
  116. id="closeModal"
  117. class="bg-[#F06522] h-[41px] w-full max-w-[136.5px] text-white font-Alatsi text-2xl rounded-[1.25rem] flex justify-center items-center text-center">
  118. @Lang.Close
  119. </a>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. <div id="optionPayment" data-open="false"
  125. class="modal-popup fixed top-0 left-0 inset-0 bg-black bg-opacity-50 flex justify-center items-center hidden">
  126. <!-- Modal Content -->
  127. <div class="px-4 w-full content-modal overflow-auto max-h-dvh">
  128. <div class="popup-buy-error">
  129. <p class="text-center uppercase">
  130. @Lang.SelectPaymentChannel
  131. </p>
  132. <div class="w-full">
  133. <input type="hidden" id="packagePeriod"/>
  134. <div>
  135. <input type="radio" id="basicAccount" name="payment" value="THUTHACH_REGISTER_DAILY" checked=checked />
  136. <label for="basicAccount">@Lang.PayBasic</label>
  137. </div>
  138. @* <div>
  139. <input type="radio" id="eMola" name="payment" value="WALLET_AUTO" />
  140. <label for="eMola">@Lang.PayEmola</label>
  141. </div> *@
  142. @*<div>
  143. <input type="radio" id="eMolaReNew" name="payment" value="3" />
  144. <label for="eMolaReNew">Pay via e-Mola auto renew</label>
  145. </div>*@
  146. <div class="w-full flex gap-5 justify-center px-5 mt-3">
  147. <button type="button" onclick="hideModal('optionPayment')" class="bg-4 h-[41px] w-full max-w-[136.5px] text-[#5A5A5A] font-Alatsi text-2xl rounded-[1.25rem] flex justify-center items-center text-center">
  148. @Lang.Cancel
  149. </button>
  150. <button type="button" onclick="selectPayment();" class="bg-[#F06522] h-[41px] w-full max-w-[136.5px] text-white font-Alatsi text-2xl rounded-[1.25rem] flex justify-center items-center text-center">
  151. @Lang.Submit
  152. </button>
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. <div id="dialogOtp" data-open="false"
  159. class="modal-popup fixed top-0 left-0 inset-0 bg-black bg-opacity-50 flex justify-center items-center hidden">
  160. <div class="px-4 w-full content-modal overflow-auto max-h-dvh">
  161. <div class="popup-buy-error">
  162. <p class="text-center">
  163. @Lang.EnterOtp
  164. </p>
  165. <div class="enter-otp">
  166. <input class="input-otp font-roboto bg-transparent text-[18px] font-normal" id="otp1" maxlength="1" placeholder="" />
  167. <input class="input-otp font-roboto bg-transparent text-[18px] font-normal" id="otp2" maxlength="1" placeholder="" />
  168. <input class="input-otp font-roboto bg-transparent text-[18px] font-normal" id="otp3" maxlength="1" placeholder="" />
  169. <input class="input-otp font-roboto bg-transparent text-[18px] font-normal" id="otp4" maxlength="1" placeholder="" />
  170. <input class="input-otp font-roboto bg-transparent text-[18px] font-normal" id="otp5" maxlength="1" placeholder="" />
  171. <input class="input-otp font-roboto bg-transparent text-[18px] font-normal" id="otp6" maxlength="1" placeholder="" />
  172. </div>
  173. <p class="otp-error"></p>
  174. <div class="w-full flex gap-5 justify-between px-5 ">
  175. <button class="bg-4 h-[41px] w-full max-w-[136.5px] text-[#5A5A5A] font-Alatsi text-2xl rounded-[1.25rem] flex justify-center items-center text-center btn-confirm">
  176. @Lang.Confirm
  177. </button>
  178. <a href="#" onclick="hideModal('dialogOtp')"
  179. id="closeModal"
  180. class="bg-[#F06522] h-[41px] w-full max-w-[136.5px] text-white font-Alatsi text-2xl rounded-[1.25rem] flex justify-center items-center text-center">
  181. @Lang.Close
  182. </a>
  183. </div>
  184. </div>
  185. </div>
  186. </div>
  187. </div>
  188. @*<script src="~/js/spin.js"></script>*@
  189. <script>
  190. var flag = false;
  191. var clicked = false;
  192. </script>
  193. <script>
  194. $('#dialogOtp').on('show', function () {
  195. console.log("open");
  196. $("#otp1").focus();
  197. });
  198. $("#dialogOtp .btn-confirm").click(function () {
  199. var otp = $("#otp1").val() + $("#otp2").val() + $("#otp3").val() + $("#otp4").val() + $("#otp5").val() + $("#otp6").val();
  200. if (otp.length < 6) {
  201. return;
  202. }
  203. $.ajax({
  204. url: "/Home/ConfirmOtp",
  205. data: {
  206. otp: otp
  207. },
  208. type: "POST",
  209. success: function (data) {
  210. if (data.error == "0") {
  211. hideModal("dialogOtp");
  212. hideModal("optionPayment");
  213. // success
  214. showDialog('dialogResult', "@Lang.Success", data.content, data.error);
  215. } else {
  216. // show error
  217. $(".otp-error").html(data.content);
  218. }
  219. },
  220. error: function (data) {
  221. console.log(data);
  222. }
  223. });
  224. });
  225. function selectPayment() {
  226. var option = $("input[name='payment']:checked").val();
  227. var period = $("#packagePeriod").val();
  228. requestOtp(period + "_" + option);
  229. }
  230. function requestOtp(subServiceCode) {
  231. $.ajax({
  232. url: "/Home/RequestOtp",
  233. data: {
  234. subServiceCode: subServiceCode
  235. },
  236. type: "POST",
  237. success: function (data) {
  238. console.log(data);
  239. if (data.error == "100") {
  240. // otp
  241. $(".input-otp").val('');
  242. hideModal("optionPayment");
  243. showModal("dialogOtp");
  244. } else if (data.error == "0") {
  245. // success
  246. hideModal("optionPayment");
  247. showDialog('dialogResult', "@Lang.Success", data.content, data.error);
  248. } else if (data.error == "109") {
  249. // waiting
  250. hideModal("optionPayment");
  251. showDialog('dialogResult', "@Lang.Result", data.content, data.error, 'warning');
  252. } else {
  253. // show dialog failed
  254. hideModal("optionPayment");
  255. showDialog('dialogResult', "@Lang.Error", data.content, data.error);
  256. }
  257. },
  258. error: function (data) {
  259. console.log(data);
  260. }
  261. });
  262. }
  263. $(".input-otp").on('keydown', function (e) {
  264. if (e.which == 8 || e.which == 46) {
  265. $(this).val('');
  266. $(this).prev(".input-otp").focus();
  267. } else {
  268. var num = String.fromCharCode();
  269. $(this).val(num);
  270. //$(this).next(".input-otp").focus();
  271. }
  272. });
  273. $(".input-otp").on('keyup', function (e) {
  274. if (e.which == 8 || e.which == 46) {
  275. } else {
  276. $(this).next(".input-otp").focus();
  277. }
  278. //}
  279. });
  280. function buyMore(packg) {
  281. requestOtp(packg);
  282. }
  283. function register(packg) {
  284. $("#packagePeriod").val(packg);
  285. showModal('optionPayment');
  286. //requestOtp(packg);
  287. }
  288. </script>
  289. @RenderSection("scripts", required: false)
  290. </body>
  291. </html>