Enter.cshtml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. @using WeApp.TrainingCampGroup.Dto
  2. @{
  3. Layout = "~/Views/Shared/Layout/_Layout.Stu.cshtml";
  4. CampGroupDto group = ViewBag.Group;
  5. bool isLeader = ViewBag.IsLeader;
  6. string id = group.Id,
  7. campNo = group.CampNo;
  8. var name = (isLeader ? "指挥长" : "组员");
  9. var style = (isLeader ? "1" : "2");
  10. ViewBag.Title = name + "屏(" + group.Name + ")";
  11. }
  12. @section styles{
  13. <link href="~/Content/Css/Exercise/stu-bg.min.css" rel="stylesheet" />
  14. <style>
  15. .group-name {
  16. color: #fff;
  17. position: absolute;
  18. left: 10px;
  19. bottom: 5px;
  20. font-size: 12px;
  21. }
  22. .text-box {
  23. margin-top: -5%;
  24. }
  25. .text-box .name {
  26. margin-top: 25px;
  27. font-size: 24px;
  28. font-weight: 600;
  29. color: #fff;
  30. background: #11998e;
  31. padding: 5px 50px;
  32. letter-spacing: 10px;
  33. padding-right: 40px;
  34. border-radius: 50px;
  35. }
  36. .logo {
  37. width: 250px;
  38. height: 240px;
  39. background-size: 100% 100%;
  40. }
  41. .logo1 {
  42. background-image: url('../../Content/Image/Stu/zhb/zhz.png');
  43. }
  44. .logo2 {
  45. background-image: url('../../Content/Image/Stu/zhb/zuyuan2.png');
  46. }
  47. </style>
  48. }
  49. <div class="body no-select" style="">
  50. <div class="left">
  51. <img src="~/Content/Image/Stu/gwLogo.png" />
  52. </div>
  53. <div class="right">
  54. <img src="~/Content/Image/Stu/loudou.png" />
  55. <div class="text-box">
  56. <div class="logo logo@(style)"></div>
  57. <span class="name"> @(group.Name)</span>
  58. </div>
  59. </div>
  60. <div class="group-name">@(group.Name)</div>
  61. </div>
  62. @section scripts
  63. {
  64. <script>
  65. abp.signalr.connect(['@(id)','@(campNo)']);
  66. var state = 0;
  67. function Go(isLeader) {
  68. if (state) {
  69. window.location.href = isLeader ? "/Exercise/HeadquarterLeader" : "/Exercise/HeadquarterStu";
  70. } else {
  71. abp.message.warn("演练还未开始,请稍后再试!");
  72. }
  73. }
  74. </script>
  75. <script id="hub">
  76. abp.signalr.connect(['@(id)','@(campNo)']);
  77. iwbHub.client.getReloadAll = function (msg) {
  78. console.log('getReloadAll: ', msg);
  79. if (msg) {
  80. try {
  81. var data = JSON.parse(msg);
  82. if (data) {
  83. if (data.no == '@(id)'|| data.no == '@(campNo)') {
  84. window.location.reload();
  85. }
  86. }
  87. } catch (e) {
  88. console.log('getReloadAll: ', e);
  89. }
  90. }
  91. };
  92. @if (isLeader)
  93. {
  94. <text>
  95. iwbHub.client.getReloadLeader = function (msg) {
  96. console.log('getReloadLeader: ', msg);
  97. if (msg) {
  98. try {
  99. var data = JSON.parse(msg);
  100. if (data) {
  101. if (data.no == '@(id)'|| data.no == '@(campNo)') {
  102. window.location.reload();
  103. }
  104. }
  105. } catch (e) {
  106. console.log('getReloadLeader: ', e);
  107. }
  108. }
  109. };
  110. </text>
  111. }
  112. else
  113. {
  114. <text>
  115. iwbHub.client.getReloadStu = function (msg) {
  116. console.log('getReloadStu: ', msg);
  117. if (msg) {
  118. try {
  119. var data = JSON.parse(msg);
  120. if (data) {
  121. if (data.no == '@(id)'|| data.no == '@(campNo)') {
  122. window.location.reload();
  123. }
  124. }
  125. } catch (e) {
  126. console.log('getReloadStu: ', e);
  127. }
  128. }
  129. };
  130. </text>
  131. }
  132. </script>
  133. }