_SelectCampV2.cshtml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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. overflow: hidden;
  12. --c: #7fbaff;
  13. --c2: #094B88;
  14. }
  15. .box {
  16. width: 100%;
  17. position: relative;
  18. font-family: 'Source Han Sans';
  19. background: none;
  20. }
  21. .box .body {
  22. width: 100%;
  23. display: flex;
  24. justify-content: center;
  25. align-items: center;
  26. height: calc(100vh - 150px);
  27. }
  28. .form {
  29. width: 400px;
  30. margin-top: -15%;
  31. font-size: 14px;
  32. }
  33. .input-group {
  34. margin-bottom: 15px;
  35. }
  36. .input-group .input-group-addon {
  37. width: 45px;
  38. height: 40px;
  39. background: var(--c);
  40. padding: 8px 10px 12px;
  41. display: flex;
  42. justify-content: center;
  43. align-items: center;
  44. border-radius: 5px 0 0 5px;
  45. }
  46. .input-group .input-group-addon img {
  47. width: 18px;
  48. height: 18px;
  49. }
  50. .input-group select {
  51. width: calc(100% - 45px)
  52. }
  53. .form .select2-container--default .select2-selection--single {
  54. border: 1px solid var(--c);
  55. border-radius: 0px;
  56. background: #f5f5f5;
  57. height: 40px;
  58. outline: none;
  59. border-radius: 0 5px 5px 0;
  60. }
  61. .select2-container--default .select2-selection--single .select2-selection__rendered {
  62. color: var(--c2);
  63. }
  64. .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 {
  65. background-color: var(--c2);
  66. color: #eee;
  67. outline: none;
  68. }
  69. .select2-container--default .select2-results__option[aria-selected=true] {
  70. background-color: var(--c2);
  71. color: #fff;
  72. }
  73. .select2-search {
  74. display: none;
  75. }
  76. .select2-container--default .select2-selection--single .select2-selection__arrow {
  77. background-color: var(--c);
  78. height: 40px;
  79. border-radius: 0 5px 5px 0;
  80. }
  81. .select2-container--default .select2-selection--single .select2-selection__arrow b {
  82. border-color: #fff transparent transparent transparent;
  83. }
  84. .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  85. border-color: transparent transparent #fff transparent;
  86. }
  87. .btn-box {
  88. text-align: center;
  89. }
  90. .btn-box .btn {
  91. color: #fff;
  92. width: 150px;
  93. font-size: 18px !important;
  94. background: var(--c);
  95. border-radius: 5px;
  96. }
  97. .btn-box .btn:hover {
  98. background-image: linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))
  99. }
  100. </style>
  101. @Html.Partial("Layout/V2/_Bg", true)
  102. <div class="body">
  103. <div class="box no-select" style="">
  104. <div id="bg_title">
  105. <span class="title">选择演练培训营</span>
  106. </div>
  107. <div class="body">
  108. <form class="form">
  109. <div class="input-group">
  110. <span class="input-group-addon" for="camp">
  111. <img src="~/Content/Image/Stu/camp.png" />
  112. </span>
  113. <select id="camp" class="form-control" style="">
  114. @(Html.Raw(camps))
  115. </select>
  116. </div>
  117. @if (hasGroup)
  118. {
  119. <div class="input-group">
  120. <span class="input-group-addon" for="camp-group">
  121. <img src="~/Content/Image/Stu/group.png" />
  122. </span>
  123. <select id="camp-group" class="form-control" style="">
  124. <option value="">请选择培训营分组</option>
  125. </select>
  126. </div>
  127. }
  128. <div class="btn-box">
  129. <button class="btn" type="button" onclick="Go()">确定</button>
  130. </div>
  131. </form>
  132. </div>
  133. </div>
  134. </div>
  135. @using (Html.BeginScripts())
  136. {
  137. <script>
  138. function Go() {
  139. var no = $("#camp").val();
  140. if (no) {
  141. @if (hasGroup)
  142. {
  143. <text>
  144. var groupNo = $("#camp-group").val();
  145. if (groupNo) {
  146. window.location.href = '@(url)' + groupNo ;
  147. } else {
  148. abp.message.warn("请选择一个分组!");
  149. }
  150. </text>
  151. }
  152. else
  153. {
  154. <text>
  155. window.location.href = '@(url)' + no;
  156. </text>
  157. }
  158. } else {
  159. abp.message.warn("请选择一个培训营!");
  160. }
  161. }
  162. $(function () {
  163. //document.title = '@(title)' + document.title;
  164. $("#camp").select2();
  165. @if (hasGroup)
  166. {
  167. <text>
  168. $("#camp-group").select2();
  169. var campNo = "";
  170. $("#camp").on('change',function() {
  171. var no = $("#camp").val();
  172. if (no && campNo != no) {
  173. campNo = no;
  174. $.iwbAjax4({
  175. url: abp.appUrl + 'Query/GetCampGroupSelectStr?no='+no,
  176. success: function(res) {
  177. $("#camp-group").html(res).select2();
  178. }
  179. });
  180. }
  181. });
  182. </text>
  183. }
  184. });
  185. </script>
  186. }
  187. <!-- TABLE SELECTCAMP END-->