video.blade.php 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <!-- resources/views/lectures/index.blade.php -->
  2. @extends('layouts.app')
  3. @section('title', 'Lecture List')
  4. @section('tab_nav')
  5. <li class="active" style ="border-radius:10px 10px 0 0;">
  6. <a href="https://whdx-psy.qingerai.com/index.php?op=team&amp;task=team&amp;mk=4">
  7. <div id="menu_25" style="display:none;"><div class="number">0</div></div>
  8. 健康科普
  9. </a>
  10. </li>
  11. <!-- <li>
  12. <a href="https://whdx-psy.qingerai.com/index.php?op=test&amp;task=testList&amp;mk=4">
  13. <div id="menu_39" style="display:none;"><div class="number">0</div></div>
  14. </a>
  15. </li> -->
  16. @endsection
  17. @section('content')
  18. <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
  19. <link rel="stylesheet" href="{{asset('css/list.css')}}">
  20. <div class="container">
  21. <!-- 左侧分类区域 -->
  22. <div class="left">
  23. <div class="head">
  24. <div class="title">分类</div>
  25. <div class="add" onclick="handleAdd()">新增</div>
  26. </div>
  27. <div class="search">
  28. <input type="text" id="searchInput" placeholder="搜索分类名称" onkeyup="filterCategories()">
  29. </div>
  30. <div class="list" id="categoryList">
  31. <!-- 分类列表将通过JS动态渲染 -->
  32. @foreach ($categories as $category)
  33. <!-- <div class="item "
  34. onclick="">
  35. <img src="https://teen.qingerai.com/js/zTree/css/metroStyle/img/icon-file.gif" alt="icon">
  36. <span style="font-size: 12px;">{{$category['name']}}</span>
  37. <div class="operations">
  38. <div class="edit" onclick="event.stopPropagation();handleEdit({{$category['id']}})">
  39. <img src="https://teen.qingerai.com/js/zTree/css/metroStyle/img/icon21.png" alt="edit">
  40. </div>
  41. <div class="delete" onclick="event.stopPropagation();handleDelete({{$category['id']}})">
  42. <img src="https://teen.qingerai.com/js/zTree/css/metroStyle/img/icon23.png" alt="delete">
  43. </div>
  44. </div>
  45. </div> -->
  46. @endforeach
  47. </div>
  48. </div>
  49. <!-- 右侧内容区域 -->
  50. <div class="right" >
  51. <div class="head">
  52. <div class="plate-bt">
  53. <div class="plate-bt-item" onclick="handleAddCourse()">新增课程</div>
  54. <div class="plate-bt-item" onclick="handleBatchDelete()">批量删除</div>
  55. </div>
  56. <div class="plate-nr">
  57. <div class="plate-nr-item">
  58. <input type="text" id="courseSearchInput" value ="{{$condition['keywords']}}" placeholder="请输入课程名称">
  59. </div>
  60. <div class="plate-nr-item">
  61. <div class="search-btn" onclick="searchCourses()">搜索</div>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="main">
  66. <div class="main-wrap" id="courseList">
  67. <!-- 课程列表将通过JS动态渲染 -->
  68. </div>
  69. <div id="paginationContainer"></div>
  70. </div>
  71. </div>
  72. <!-- 分类编辑弹窗 -->
  73. <div class="dialog" id="categoryDialog">
  74. <div class="dialog-content">
  75. <h3 id="categoryDialogTitle">新增分类</h3>
  76. <form id="categoryForm">
  77. <div class="form-item">
  78. <label>分类标题</label>
  79. <input type="text" name="title" placeholder="请输入分类标题">
  80. </div>
  81. <div class="form-item">
  82. <label>排序</label>
  83. <input type="number" name="sort" min="0">
  84. <input type="hidden" name="_token" value="{{ csrf_token() }}" />
  85. </div>
  86. <div class="dialog-footer">
  87. <button type="button" onclick="closeDialog('categoryDialog')">取消</button>
  88. <button type="button" onclick="submitCategoryForm()">确定</button>
  89. </div>
  90. </form>
  91. </div>
  92. </div>
  93. <!-- 课程编辑弹窗 -->
  94. <div class="dialog" id="courseDialog">
  95. <div class="dialog-content">
  96. <h3 id="courseDialogTitle">新增课程</h3>
  97. <form id="courseForm">
  98. <div class="form-item">
  99. <label>文章分类</label>
  100. <select name="categoryId" required>
  101. <!-- 分类选项将通过JS动态渲染 -->
  102. </select>
  103. </div>
  104. <div class="form-item">
  105. <label>文章标题</label>
  106. <input type="text" name="title" required placeholder="请输入文章标题">
  107. </div>
  108. <div class="form-item">
  109. <label>封面图</label>
  110. <div class="upload-box">
  111. <label class="upload-btn" id="coverUploadBtn">
  112. <input type="file" name="coverImage" accept="image/*" style="display: none;" onchange="handleImageUpload(this)">
  113. <i class="el-icon-upload"></i> 点击上传封面图
  114. </label>
  115. <input type="hidden" id="coverImageUrl" name="cover">
  116. <div class="preview-box" id="previewBox" style="display: none;">
  117. <img id="previewImage" src="" alt="预览图">
  118. <div class="remove-btn" onclick="removeImage()" title="删除图片">×</div>
  119. </div>
  120. </div>
  121. </div>
  122. <div class="form-item">
  123. <label>视频文件</label>
  124. <div class="upload-box">
  125. <label class="upload-btn" id="videoUploadBtn">
  126. <input type="file" name="videoFile" accept="video/*" style="display: none;" onchange="handleVideoUpload(this)">
  127. <i class="el-icon-upload"></i> 点击上传视频
  128. </label>
  129. <input type="hidden" id="videoUrl" name="video_url">
  130. <div class="video-preview" id="videoPreviewBox" style="display: none;">
  131. <video id="previewVideo" controls style="width: 100%; max-width: 400px;"></video>
  132. <div class="remove-btn" onclick="removeVideo()" title="删除视频">×</div>
  133. <div class="upload-progress" id="videoProgress" style="display: none;">
  134. <div class="progress-bar"></div>
  135. <span class="progress-text">0%</span>
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. <div class="form-item">
  141. <label>文章内容</label>
  142. <textarea name="content" rows="6" required placeholder="请输入文章内容"></textarea>
  143. </div>
  144. <div class="form-item">
  145. <label>排序</label>
  146. <input type="number" name="sort" min="0">
  147. <input type="hidden" name="_token" value="{{ csrf_token() }}" />
  148. </div>
  149. <div class="dialog-footer">
  150. <button type="button" onclick="closeDialog('courseDialog')">取消</button>
  151. <button type="button" onclick="submitCourseForm()">确定</button>
  152. </div>
  153. </form>
  154. </div>
  155. </div>
  156. <!-- 课程详情弹窗 -->
  157. <div class="dialog" id="viewDialog">
  158. <div class="dialog-content">
  159. <h3>课程详情</h3>
  160. <div class="course-detail" id="courseDetail">
  161. <!-- 课程详情将通过JS动态渲染 -->
  162. </div>
  163. <div class="dialog-footer">
  164. <button onclick="closeDialog('viewDialog')">关闭</button>
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169. <script>
  170. var categoryData = @json($categories);
  171. var currentCategoryId = {{ $condition['category_id'] }};
  172. var videoData = @json($video['list']);
  173. </script>
  174. <script src="{{asset('js/script.js')}}"></script>
  175. @endsection