_SelectCamp.cshtml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. @using IwbZero.ToolCommon.StringModel
  2. @using WeApp.Helpers
  3. @model WeApp.Views.Shared.Camp.SelectCampModel
  4. @{
  5. string url = Model.PageUrl.Ew("/"), camps = Model.CampSelect,title = Model.PageTitle;
  6. bool hasGroup = Model.HasGroup;
  7. }
  8. <!-- TABLE SELECTCAMP START-->
  9. <style>
  10. body {
  11. --mc: #11998e;
  12. }
  13. .body {
  14. background: #fff;
  15. display: flex;
  16. flex-direction: column;
  17. height: 100vh;
  18. width: 100vw;
  19. box-sizing: padding-box;
  20. padding: 0px;
  21. background: url('../../../Content/Image/Stu/select-bg.png') no-repeat top;
  22. background-size: 100% 35%;
  23. }
  24. .title-box {
  25. width: 100%;
  26. display: flex;
  27. justify-content: center;
  28. align-items: flex-end;
  29. position: relative;
  30. height: 40%;
  31. }
  32. .title-box .title {
  33. color: #fff;
  34. font-size: 40px;
  35. font-weight: 600;
  36. letter-spacing: 5px;
  37. margin-bottom: 100px;
  38. }
  39. .logo {
  40. position: absolute;
  41. top: 20px;
  42. left: 20px;
  43. width: 300px;
  44. height: 90px;
  45. background-image: url('../../../Content/Image/Stu/gwLogo.png');
  46. background-size: 100% 100%;
  47. }
  48. .form-box {
  49. width: 100%;
  50. display: flex;
  51. justify-content: center;
  52. align-items: center;
  53. height: 60%;
  54. }
  55. .form-box form {
  56. width: 400px;
  57. margin-top: -15%;
  58. }
  59. .input-group {
  60. margin-bottom: 15px;
  61. }
  62. .input-group .input-group-addon {
  63. width: 45px;
  64. height: 40px;
  65. background: var(--mc);
  66. padding: 8px 10px 12px;
  67. }
  68. .input-group .input-group-addon img {
  69. width: 100%;
  70. height: 100%;
  71. }
  72. .input-group select {
  73. width: calc(100% - 45px)
  74. }
  75. .form-box .select2-container--default .select2-selection--single {
  76. border: 1px solid var(--mc);
  77. border-radius: 0px;
  78. background: #f5f5f5;
  79. height: 40px;
  80. outline: none;
  81. }
  82. .select2-container--default .select2-selection--single .select2-selection__rendered {
  83. color: var(--mc);
  84. }
  85. .select2-container--default .select2-results__option--highlighted[aria-selected], .select2-container--default .select2-results__option--highlighted[aria-selected], .select2-container--default .select2-results__option--highlighted[aria-selected]:hover {
  86. background-color: var(--mc);
  87. color: #eee;
  88. outline: none;
  89. }
  90. .select2-container--default .select2-results__option[aria-selected=true] {
  91. background-color: var(--mc);
  92. color: #fff;
  93. }
  94. .select2-search {
  95. display: none;
  96. }
  97. .select2-container--default .select2-selection--single .select2-selection__arrow {
  98. background-color: var(--mc);
  99. height: 40px;
  100. }
  101. .select2-container--default .select2-selection--single .select2-selection__arrow b {
  102. border-color: #fff transparent transparent transparent;
  103. }
  104. .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  105. border-color: transparent transparent #fff transparent;
  106. }
  107. .btn-box {
  108. text-align: center;
  109. }
  110. .btn-box .btn {
  111. color: #fff;
  112. width: 150px;
  113. font-size: 18px!important;
  114. background: var(--mc);
  115. }
  116. .btn-box .btn:hover {
  117. background-image: linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))
  118. }
  119. @@media(min-device-width: 1025px) {
  120. .title-box .title {
  121. font-size: 60px;
  122. letter-spacing: 10px;
  123. }
  124. .logo {
  125. top: 30px;
  126. left: 30px;
  127. width: 500px;
  128. height: 150px;
  129. }
  130. }
  131. </style>
  132. <div class="body">
  133. <div class="title-box">
  134. <div class="logo"></div>
  135. <div class="title">选择演练培训营</div>
  136. </div>
  137. <div class="form-box">
  138. <form>
  139. <div class="input-group">
  140. <span class="input-group-addon" for="camp">
  141. <img src="~/Content/Image/Stu/camp.png" />
  142. </span>
  143. <select id="camp" class="form-control" style="">
  144. @(Html.Raw(camps))
  145. </select>
  146. </div>
  147. @*<div class="form-group">
  148. <select id="camp" class="form-control" style="width: 100%">
  149. @(Html.Raw(camps))
  150. </select>
  151. </div>*@
  152. @if (hasGroup)
  153. {
  154. <div class="input-group">
  155. <span class="input-group-addon" for="camp-group">
  156. <img src="~/Content/Image/Stu/group.png" />
  157. </span>
  158. <select id="camp-group" class="form-control" style="">
  159. <option value="">请选择培训营分组</option>
  160. </select>
  161. </div>
  162. }
  163. <div class="btn-box">
  164. <button class="btn" type="button" onclick="Go()">确定</button>
  165. </div>
  166. </form>
  167. </div>
  168. </div>
  169. @using (Html.BeginScripts())
  170. {
  171. <script>
  172. function Go() {
  173. var no = $("#camp").val();
  174. if (no) {
  175. @if (hasGroup)
  176. {
  177. <text>
  178. var groupNo = $("#camp-group").val();
  179. if (groupNo) {
  180. window.location.href = '@(url)' + groupNo ;
  181. } else {
  182. abp.message.warn("请选择一个分组!");
  183. }
  184. </text>
  185. }
  186. else
  187. {
  188. <text>
  189. window.location.href = '@(url)' + no;
  190. </text>
  191. }
  192. } else {
  193. abp.message.warn("请选择一个培训营!");
  194. }
  195. }
  196. $(function () {
  197. //document.title = '@(title)' + document.title;
  198. $("#camp").select2();
  199. @if (hasGroup)
  200. {
  201. <text>
  202. $("#camp-group").select2();
  203. var campNo = "";
  204. $("#camp").on('change',function() {
  205. var no = $("#camp").val();
  206. if (no && campNo != no) {
  207. campNo = no;
  208. $.iwbAjax4({
  209. url: abp.appUrl + 'Query/GetCampGroupSelectStr?no='+no,
  210. success: function(res) {
  211. $("#camp-group").html(res).select2();
  212. }
  213. });
  214. }
  215. });
  216. </text>
  217. }
  218. });
  219. </script>
  220. }
  221. <!-- TABLE SELECTCAMP END-->