zengyicheng 3 年之前
父節點
當前提交
2417d5514f
共有 1 個文件被更改,包括 11 次插入2 次删除
  1. 11 2
      src/components/liveRoom.vue

+ 11 - 2
src/components/liveRoom.vue

@@ -80,7 +80,7 @@
                 </div>
                 <div style="color: #2fdb88">
                   <!-- 共{{ JSON.parse(item.chapters).length }}讲 -->
-                  共4
+                  共1
                 </div>
                 <div>
                   <span style="color: #999">{{ item.createTime }}</span>
@@ -105,7 +105,7 @@ export default {
           courseid: "9a4e8dbe-132e-438e-97db-b07eb01fa04c",
           title: "湖心亭看雪可可乐博模拟展示课件",
           chapters: [],
-          createTime: new Date().getTime(),
+          createTime: this.getNowTime(),
         },
       ],
       studentMessage: [],
@@ -119,6 +119,15 @@ export default {
     goTo(path) {
       this.$router.push(path);
     },
+    getNowTime() {
+      const yy = new Date().getFullYear()
+      const MM = (new Date().getMonth() + 1) < 10 ? '0' + (new Date().getMonth() + 1) : (new Date().getMonth() + 1)
+      const dd = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
+      const HH = new Date().getHours() < 10 ? '0' + new Date().getHours() : new Date().getHours()
+      const mm = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes()
+      const ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds()
+      return yy + '-' + MM + '-' + dd + ' ' + HH + ':' + mm + ':' + ss
+    },
     selectSDetail() {
       let params = {
         uid: this.userid,