Sfoglia il codice sorgente

fix: liveroomList start

furffico 1 anno fa
parent
commit
8a7960065f

+ 0 - 7
src/avue/form/liveroominfo.ts

@@ -60,13 +60,6 @@ export default (isnew: boolean = false) => {
           label: '是',
           value: true
         }],
-      }, {
-        label: '开始时间',
-        prop: "startTime",
-        type: "datetime",
-        span: 8,
-        row: true,
-        rules: [{ required: true, message: "开始时间不能为空" }]
       }, {
         label: "直播间有效期",
         prop: "hours",

+ 1 - 1
src/views/modules/liveroom/liveroomEdit.vue

@@ -93,7 +93,7 @@ export default Vue.extend({
         title: form.title,
         imageShare: form.imageShare[0] || "",
         imageCover: form.imageCover[0] || "",
-        startTime: datetime_format(form.startTime),
+        startTime: form.startTime ? datetime_format(form.startTime) : "",
         livePushUrl: form.livePushUrl,
         livePullHlsUrl: form.livePullHlsUrl,
         livePullRtmpUrl: form.livePullRtmpUrl,

+ 8 - 5
src/views/modules/liveroom/liveroomList.vue

@@ -7,13 +7,12 @@
       </template>
 
       <template slot-scope="scope" slot="showInList">
-        <el-switch :value="scope.row.showInList" @change="(e) => updateShowStatus(scope.row.id, e)" />
+        <el-switch :value="scope.row.showInList === 1" @change="(e) => updateShowStatus(scope.row.id, e)" />
       </template>
 
       <template slot-scope="{row}" slot="startup">
         <div class="icon-button">
-          <el-button type="primary" size="small" @click="startLiveRoom(row.id)" disabled><icon-svg
-              name="play" /></el-button>
+          <el-button type="primary" size="small" @click="startLiveRoom(row)"><icon-svg name="play" /></el-button>
         </div>
       </template>
 
@@ -80,8 +79,12 @@ export default Vue.extend({
         this.$message.success()
       })
     },
-    startLiveRoom({ id }: { id: number }) {
-      // TODO
+    startLiveRoom({ id, hours }: { id: number, hours: number }) {
+      httpx.post(httpx.makeurl("/rooms/startup"), { id, hours }).then(() => {
+        this.getDataList()
+        //@ts-ignore
+        this.$message.success()
+      })
     },
     onDisplayDetail({ id, index }: { id: number, index: number }) {
       this.item = this.dataList[index]