Transfer.cshtml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. @{
  2. ViewData["Title"] = "Transfer";
  3. Layout = "~/Views/Shared/_NothingLayout.cshtml";
  4. }
  5. @using LotteryWebApp.Languages;
  6. @using LotteryWebApp.Controllers;
  7. @using LotteryWebApp.Common;
  8. @using LotteryWebApp.Extensions;
  9. @using LotteryWebApp.Service;
  10. @model HomeTransfer_ViewModel
  11. @{
  12. if (Model.transferData != null)
  13. {
  14. }
  15. }
  16. <div class="app-content content" style="position:relative">
  17. <div class="card-title text-center ">
  18. <div class="news-button-header-container" style="text-align: start; margin: 0 10px;">
  19. @await Component.InvokeAsync("SmallHeader", new { title = Lang.transfer.ToUpper()})
  20. </div>
  21. </div>
  22. <div class="content-wrapper transfer-container" style="">
  23. <div class="content-body">
  24. <section class="flexbox-container">
  25. <div class="col-12 align-items-center justify-content-center">
  26. <div class="">
  27. @{
  28. if (Model.step != Constants.TRANSFER_RESULT)
  29. {
  30. <div class="row">
  31. <div class="col-6">
  32. @Lang.bee_account
  33. </div>
  34. <div class="col-6" style="text-align:end;">
  35. @Functions.FormatNumber(Model.userStatus.bet_coin) @Lang.curency
  36. </div>
  37. </div>
  38. <hr class="line2" style="margin-top:0px;" />
  39. }
  40. }
  41. <form class="form-horizontal" action="@ViewBag.MyConfig.MyValue/Home/Transfer" method="post">
  42. @Html.AntiForgeryToken()
  43. <input type="hidden" name="walletType" class="walletType" id="walletType" value="@Model.walletType" />
  44. <input type="hidden" name="content" class="content" id="content" value="" />
  45. @{
  46. if (Model.step == Constants.TRANSFER_SHOW || Model.step == Constants.TRANSFER_CONFIRM)
  47. {
  48. // for choosing
  49. <div>
  50. @Lang.select_an_account
  51. </div>
  52. if (Model.step == Constants.TRANSFER_SHOW)
  53. {
  54. <div class="scroll-item-container" style="margin-bottom:20px;">
  55. <div class="">
  56. <a class="@(Model.walletType == Constants.NATCASH_WALLET_TRANSFER ? "active": "")" href="#">
  57. <img style="" src="~/img/mosan.png" />
  58. </a>
  59. </div>
  60. </div>
  61. }
  62. else
  63. {
  64. if (Model.walletType == Constants.BASIC_WALLET_TRANSFER)
  65. {
  66. }
  67. else
  68. {
  69. <div class="scroll-item-container" style="margin-bottom:20px;">
  70. <div class="">
  71. <a class="active" href="#" style="padding-top: 5px;">
  72. <img style="" src="~/img/mosan.png" />
  73. </a>
  74. </div>
  75. </div>
  76. }
  77. }
  78. <fieldset class="form-group position-relative has-icon-left">
  79. <label>@Lang.money_on</label>
  80. <input type="text" class="data-input-line form-control" id="moneyon" placeholder="@Lang.enter_amount" name="moneyon" required
  81. @(Model.step == Constants.TRANSFER_CONFIRM ? "disabled" : "") value="@(Model.transferData != null ? Model.transferData.money : "")">
  82. </fieldset>
  83. if (Model.step == Constants.TRANSFER_SHOW)
  84. {
  85. @Lang.or_select
  86. <div class="row">
  87. <div class="col-4">
  88. <div class="box-coin-choose" onclick="chooseBox_Click(25)">
  89. 25
  90. </div>
  91. </div>
  92. <div class="col-4">
  93. <div class="box-coin-choose" onclick="chooseBox_Click(100)">
  94. 100
  95. </div>
  96. </div>
  97. <div class="col-4">
  98. <div class="box-coin-choose" onclick="chooseBox_Click(1000)">
  99. 1,000
  100. </div>
  101. </div>
  102. <div class="col-4">
  103. <div class="box-coin-choose" onclick="chooseBox_Click(50000)">
  104. 50,000
  105. </div>
  106. </div>
  107. <div class="col-4">
  108. <div class="box-coin-choose" onclick="chooseBox_Click(100000)">
  109. 100,000
  110. </div>
  111. </div>
  112. <div class="col-4">
  113. <div class="box-coin-choose" onclick="chooseBox_Click(150000)">
  114. 150,000
  115. </div>
  116. </div>
  117. </div>
  118. <script>
  119. function chooseBox_Click(value){
  120. $("#moneyon").val(value);
  121. }
  122. </script>
  123. }
  124. else if (Model.step == Constants.TRANSFER_CONFIRM)
  125. {
  126. <div>
  127. @Lang.fee_tranfer
  128. </div>
  129. <div>
  130. @Lang.free
  131. </div>
  132. }
  133. }
  134. else if (Model.step == Constants.TRANSFER_RESULT)
  135. {
  136. <div class="card-header border-0 card-box">
  137. <div class="card-title text-center ">
  138. @if(Model.code == Code.SUCCESS) {
  139. <div>
  140. <div style="margin-top: 50px;">
  141. <img class="logo-app" src="~/img/Group854.png" />
  142. </div>
  143. <div style="position: relative; margin-top: 10px;">
  144. <h2 class="text-style-main-large">
  145. @Lang.success
  146. </h2>
  147. </div>
  148. <div style="position: relative; margin-top: 10px;">
  149. <h4 class="">
  150. @Lang.transfer_success
  151. </h4>
  152. </div>
  153. </div>
  154. } else
  155. {
  156. <div>
  157. <div style="margin-top: 50px;">
  158. <img class="logo-app" src="~/img/fail.png" />
  159. </div>
  160. <div style="position: relative; margin-top: 10px;">
  161. <h2 class="text-style-main-large">
  162. @Lang.fail
  163. </h2>
  164. </div>
  165. <div style="position: relative; margin-top: 10px;">
  166. <h4 class="">
  167. @Model.message
  168. </h4>
  169. </div>
  170. </div>
  171. }
  172. </div>
  173. </div>
  174. }
  175. }
  176. <div class="row button-on-footer" style="margin-top:50px;">
  177. <div class="col-12">
  178. <button type="button" class="btn btn-outline-primary btn-block login-button"
  179. onclick="@(Model.step == Constants.TRANSFER_SHOW ? "transactionConfirmButtonAction_Click(" + Model.walletType + ")" :
  180. Model.step == Constants.TRANSFER_CONFIRM ? "transactionConfirmOtpButtonAction_Click()": "transactionRedirectButtonAction_Click()")">
  181. <i class="ft-unlock"></i> @(Model.step == Constants.TRANSFER_SHOW ? Lang._continue.ToUpper() :
  182. Model.step == Constants.TRANSFER_CONFIRM ? Lang.confirm : Lang.return_home_page)
  183. </button>
  184. </div>
  185. </div>
  186. </form>
  187. </div>
  188. </div>
  189. </section>
  190. </div>
  191. </div>
  192. </div>
  193. <script>
  194. stopLoading();
  195. </script>
  196. <script>
  197. var walletTypeG = null;
  198. function transactionConfirmButtonAction_Click(walletType) {
  199. let check = 1;
  200. let receivernumber = null;
  201. walletTypeG = walletType;
  202. let moneyon = $("#moneyon").val();
  203. if (moneyon == null || moneyon == "" || moneyon > 150000) {
  204. check *= 0;
  205. $("#moneyon").addClass("error-note-line");
  206. if (moneyon > 150000) {
  207. toastr.error('@Lang.max_transfer_1000HTG');
  208. }
  209. }
  210. if (check == 1) {
  211. let subDomain = $("#subDomain").val();
  212. // show modal to enter otp
  213. let otpUrl = subDomain + '/Home/TransactionConfirm_Action'
  214. startLoading();
  215. $.ajax({
  216. type: "POST",
  217. url: otpUrl,
  218. headers: { 'RequestVerificationToken': $('input[name=__RequestVerificationToken]').val() },
  219. data: {
  220. "__RequestVerificationToken": $('input[name=__RequestVerificationToken]').val(),
  221. walletType: walletType,
  222. receivernumber: receivernumber,
  223. moneyon: moneyon
  224. },
  225. success: function (data) {
  226. stopLoading();
  227. if (data.code == success) {
  228. // redirect to success
  229. window.location.href = subDomain + '/Home/Transfer?step=2&walletType=' + walletType;
  230. } else if (data.code == session_expired) {
  231. window.location.href = subDomain + '/Account/Login';
  232. } else {
  233. toastr.error(data.message);
  234. }
  235. },
  236. failure: function (data) {
  237. stopLoading();
  238. },
  239. error: function (data) {
  240. stopLoading();
  241. }
  242. });
  243. }
  244. }
  245. </script>