|
|
@@ -2,7 +2,7 @@
|
|
|
include "../pcdl/html_head.php";
|
|
|
?>
|
|
|
<body>
|
|
|
-
|
|
|
+<script src="../course/lesson.js"></script>
|
|
|
<?php
|
|
|
require_once("../pcdl/head_bar.php");
|
|
|
?>
|
|
|
@@ -67,98 +67,11 @@ echo "</div>";
|
|
|
|
|
|
?>
|
|
|
</div>
|
|
|
-<script src="../public/js/marked.js"></script>
|
|
|
<script>
|
|
|
- $("#main_video_win").height($("#main_video_win").width()*9/16);
|
|
|
-
|
|
|
- $.get("../course/lesson_get.php",
|
|
|
- {
|
|
|
- id:"<?php echo $_GET["id"]; ?>"
|
|
|
- },
|
|
|
- function(data,status){
|
|
|
- let arrLesson = JSON.parse(data);
|
|
|
- let html="";
|
|
|
- for(const lesson of arrLesson){
|
|
|
- html+= '<div class="card" style="display:flex;margin:1em;padding:10px;">';
|
|
|
-
|
|
|
- html+= '<div style="flex:7;">';
|
|
|
- html+= '<div class="pd-10">';
|
|
|
- html+= '<div class="title" style="padding-bottom:5px;font-size:200%;font-weight:600;">'+lesson["title"]+'</div>';
|
|
|
- html += '<div style="">';
|
|
|
- let summary = "";
|
|
|
- try{
|
|
|
- summary = marked(lesson["summary"]);
|
|
|
- }
|
|
|
- catch{
|
|
|
-
|
|
|
- }
|
|
|
- html+= '<div class="summary" style="padding-bottom:5px;">'+summary+'</div>';
|
|
|
- let live = "";
|
|
|
- try{
|
|
|
- live = marked(lesson["live"]);
|
|
|
- }
|
|
|
- catch{
|
|
|
-
|
|
|
- }
|
|
|
- html+= '<div class="summary" style="padding-bottom:5px;">'+live+'</div>';
|
|
|
- let replay = "";
|
|
|
- try{
|
|
|
- replay = marked(lesson["replay"]);
|
|
|
- }
|
|
|
- catch{
|
|
|
|
|
|
- }
|
|
|
- html+= '<div class="summary" style="padding-bottom:5px;">'+replay+'</div>';
|
|
|
- let attachment = "";
|
|
|
- try{
|
|
|
- attachment = marked(lesson["attachment"]);
|
|
|
- }
|
|
|
- catch{
|
|
|
+$("#main_video_win").height($("#main_video_win").width()*9/16);
|
|
|
+lesson_show("<?php echo $_GET["id"]; ?>");
|
|
|
|
|
|
- }
|
|
|
- html+= '<div class="summary" style="padding-bottom:5px;">'+attachment+'</div>';
|
|
|
- html+= '</div>';
|
|
|
- html+= '</div>';
|
|
|
- html+= '</div>';
|
|
|
-
|
|
|
- html+= '<div style="flex:3;max-width:15em;">';
|
|
|
- let d = new Date();
|
|
|
- d.setTime(lesson["date"]);
|
|
|
- let strData = d.toLocaleDateString();
|
|
|
- let strTime = d.toLocaleTimeString();
|
|
|
- html+= '<div >开始日期:'+strData +'</div>';
|
|
|
- html+= '<div >开始时间:'+strTime +'</div>';
|
|
|
- let dt = lesson["duration"]/60;
|
|
|
- let sdt = "";
|
|
|
- if(dt>59){
|
|
|
- sdt += Math.floor(dt/60)+"小时";
|
|
|
- }
|
|
|
- let m = (dt % 60);
|
|
|
- if(m>0){
|
|
|
- sdt +=(dt % 60)+"分钟";
|
|
|
- }
|
|
|
- html+= "<div >持续时间:"+sdt+"</div>";
|
|
|
- let now = new Date();
|
|
|
-
|
|
|
- let lesson_time="";
|
|
|
- if(now<lesson["date"]){
|
|
|
- lesson_time = "尚未开始";
|
|
|
- }
|
|
|
- else if(now>lesson["date"] && now<(lesson["date"]+dt*1000)){
|
|
|
- lesson_time = "正在进行";
|
|
|
- }
|
|
|
- else{
|
|
|
- lesson_time = "已经结束";
|
|
|
- }
|
|
|
- html+= '<div ><span class="lesson_status">'+lesson_time+'</span></div>';
|
|
|
-
|
|
|
- html+= '</div>';
|
|
|
-
|
|
|
- html+= '</div>';
|
|
|
-
|
|
|
- }
|
|
|
- $("#lesson_list").html(html);
|
|
|
- });
|
|
|
</script>
|
|
|
<?php
|
|
|
include "../pcdl/html_foot.php";
|