zengyicheng 3 years ago
parent
commit
2417d5514f
1 changed files with 11 additions and 2 deletions
  1. 11 2
      src/components/liveRoom.vue

+ 11 - 2
src/components/liveRoom.vue

@@ -80,7 +80,7 @@
                 </div>
                 </div>
                 <div style="color: #2fdb88">
                 <div style="color: #2fdb88">
                   <!-- 共{{ JSON.parse(item.chapters).length }}讲 -->
                   <!-- 共{{ JSON.parse(item.chapters).length }}讲 -->
-                  共4
+                  共1
                 </div>
                 </div>
                 <div>
                 <div>
                   <span style="color: #999">{{ item.createTime }}</span>
                   <span style="color: #999">{{ item.createTime }}</span>
@@ -105,7 +105,7 @@ export default {
           courseid: "9a4e8dbe-132e-438e-97db-b07eb01fa04c",
           courseid: "9a4e8dbe-132e-438e-97db-b07eb01fa04c",
           title: "湖心亭看雪可可乐博模拟展示课件",
           title: "湖心亭看雪可可乐博模拟展示课件",
           chapters: [],
           chapters: [],
-          createTime: new Date().getTime(),
+          createTime: this.getNowTime(),
         },
         },
       ],
       ],
       studentMessage: [],
       studentMessage: [],
@@ -119,6 +119,15 @@ export default {
     goTo(path) {
     goTo(path) {
       this.$router.push(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() {
     selectSDetail() {
       let params = {
       let params = {
         uid: this.userid,
         uid: this.userid,