_Right_1.cshtml 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. @using WeApp.Helpers
  2. @model List<WeApp.TrainingCampGroup.Dto.CampGroupDto>
  3. @if (Model?.Count > 0)
  4. {
  5. <div class="scene-group-box" id="scene-group">
  6. @for (int i = 0; i < Model.Count; i++)
  7. {
  8. var group = Model[i];
  9. <span class="group-name @(i == Model?.Count - 1 ? "show" : "")">当前组别:@(group.Name)</span>
  10. }
  11. <div class="p-0" style="width: 100%; height: 100%; overflow: hidden;">
  12. @for (int i = 0; i < Model.Count; i++)
  13. {
  14. var group = Model[i];
  15. <div class="area-v group-box @(i == Model?.Count - 1 ? "show" : "")" data-index="@(i)">
  16. <div class="area-h p-0" style="height: calc(100% * 0.3)">
  17. <div class="area p-0">
  18. @Html.Partial("/Views/Play/__/_SceneInfo.cshtml", $"{group.Id}#{(i == 0 ? 1 : 0)}#2")
  19. </div>
  20. </div>
  21. <div class="area-h p-0" style="height: calc(100% * 0.24)">
  22. <div class="area p-0">
  23. @Html.Partial("/Views/Play/__/_SceneScore.cshtml", $"{group.Id}#{(i == 0 ? 1 : 0)}#2")
  24. </div>
  25. </div>
  26. <div class="area-h p-0" style="height: calc(100% * 0.48)">
  27. <div class="area p-0">
  28. @Html.Partial("/Views/Play/__/_SceneFlow.cshtml", $"{group.Id}#{(i == 0 ? 1 : 0)}#2")
  29. </div>
  30. </div>
  31. </div>
  32. }
  33. </div>
  34. </div>
  35. }
  36. @using (Html.BeginScripts())
  37. {
  38. <script>
  39. var $sceneGroupsBox = $('#scene-group');
  40. var groupCount = @(Model?.Count);
  41. //function ScrollGroup() {
  42. // var $current = $sceneGroupsBox.find('.scene-group-box.show');
  43. // var nextIndex = Number($current.data('index')) + 1;
  44. // nextIndex = nextIndex >= groupCount ? 0 : nextIndex;
  45. // var $next = $sceneGroupsBox.find('.scene-group-box').eq(nextIndex);
  46. // $current.addClass("active");
  47. // $next.addClass("next");
  48. // setTimeout(() => {
  49. // $current.removeClass("active").removeClass("show");
  50. // $next.removeClass("next").addClass("show");
  51. // },
  52. // 500);
  53. // setTimeout(ScrollGroup, 1000 * 3);
  54. //}
  55. function ScrollGroup() {
  56. var $current = $sceneGroupsBox.find('.group-box.show'),$currentName = $sceneGroupsBox.find('.group-name.show');
  57. var nextIndex = Number($current.data('index')) + 1;
  58. nextIndex = nextIndex >= groupCount ? 0 : nextIndex;
  59. var $next = $sceneGroupsBox.find('.group-box').eq(nextIndex), $nextName = $sceneGroupsBox.find('.group-name').eq(nextIndex);
  60. $current.fadeOut(300, () => {
  61. $current.removeClass("show");
  62. $currentName.removeClass("show");
  63. $next.fadeIn(800, () => { $next.addClass("show");window.Scroll2Bottom($next.find('.scroll-box')); });
  64. $nextName.fadeIn(800, () => { $nextName.addClass("show") });
  65. });
  66. $currentName.fadeOut(300);
  67. setTimeout(ScrollGroup, 1000 * 30);
  68. }
  69. $(function() {
  70. ScrollGroup();
  71. });
  72. </script>
  73. }