Code.cshtml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. @using WeOnlineApp.Configuration
  2. @{
  3. Layout = "~/Views/Shared/Layout/_Layout.Play.cshtml";
  4. ViewBag.PageId = "start";
  5. ViewBag.Title = "输入邀请码";
  6. }
  7. <link href="~/Content/Css/input.min.css" rel="stylesheet" />
  8. <style>
  9. .code-box {
  10. width: 100%;
  11. height: 100%;
  12. display: flex;
  13. flex-direction: column;
  14. justify-content: center;
  15. align-items: center;
  16. }
  17. .code-title {
  18. margin-bottom: 30px;
  19. text-align: center;
  20. color: #008080;
  21. }
  22. </style>
  23. <div class="code-box">
  24. <div style="width: 50%;margin-top: -10%">
  25. <h4 class="code-title">请填写邀请码加入演练</h4>
  26. <div class="controls">
  27. <input type="text" id="code" class="float-label required" name="name" autocomplete="off">
  28. <label for="code"><i class="fa fa-edit"></i>&nbsp;&nbsp;邀请码</label>
  29. </div>
  30. <div class="controls">
  31. <button type="button" onclick="Go()">加入演练</button>
  32. </div>
  33. </div>
  34. </div>
  35. @section scripts
  36. {
  37. <script>
  38. $(function() {
  39. InputFloatLabel(".float-label");
  40. });
  41. function Go() {
  42. var code = $('#code').val();
  43. if (code) {
  44. $.iwbAjax1({
  45. url: abp.appUrl +"campPlay/GetPlayByCode?code="+code,
  46. success: function (res) {
  47. if (res) {
  48. if (res.playState == @(CampPlayStateDefinition.New)) {
  49. window.location.href = "/play/run/" + code;
  50. } else {
  51. abp.message.warn("演练已开始,不能加入!");
  52. }
  53. } else {
  54. abp.message.warn("邀请码错误,未查询到演练!");
  55. }
  56. }
  57. });
  58. } else {
  59. abp.message.warn("请填写邀请码!");
  60. }
  61. }
  62. </script>
  63. }