|
@@ -7,10 +7,7 @@
|
|
|
</h2>
|
|
|
<div class="m-core">
|
|
|
<auth auths="imLiveBroadcastRoom/add">
|
|
|
- <el-button
|
|
|
- @click="newLiveClass"
|
|
|
- type="primary"
|
|
|
- style="margin-bottom: 20px"
|
|
|
+ <el-button @click="newLiveClass" type="primary" style="margin-bottom: 20px"
|
|
|
>新建直播课</el-button
|
|
|
>
|
|
|
</auth>
|
|
@@ -26,7 +23,7 @@
|
|
|
v-model.trim="searchForm.search"
|
|
|
clearable
|
|
|
@keyup.enter.native="
|
|
|
- e => {
|
|
|
+ (e) => {
|
|
|
e.target.blur();
|
|
|
$refs.searchForm.save();
|
|
|
search();
|
|
@@ -36,21 +33,13 @@
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="popularize">
|
|
|
- <el-select
|
|
|
- placeholder="是否推广"
|
|
|
- v-model="searchForm.popularize"
|
|
|
- clearable
|
|
|
- >
|
|
|
+ <el-select placeholder="是否推广" v-model="searchForm.popularize" clearable>
|
|
|
<el-option label="否" value="0"></el-option>
|
|
|
<el-option label="是" value="1"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="liveState">
|
|
|
- <el-select
|
|
|
- placeholder="直播状态"
|
|
|
- v-model="searchForm.liveState"
|
|
|
- clearable
|
|
|
- >
|
|
|
+ <el-select placeholder="直播状态" v-model="searchForm.liveState" clearable>
|
|
|
<el-option label="未开始" value="0"></el-option>
|
|
|
<el-option label="直播中" value="1"></el-option>
|
|
|
<el-option label="已结束" value="2"></el-option>
|
|
@@ -75,7 +64,7 @@
|
|
|
start-placeholder="直播开始日期"
|
|
|
end-placeholder="直播结束日期"
|
|
|
:picker-options="{
|
|
|
- firstDayOfWeek: 1
|
|
|
+ firstDayOfWeek: 1,
|
|
|
}"
|
|
|
>
|
|
|
</el-date-picker>
|
|
@@ -92,11 +81,7 @@
|
|
|
:header-cell-style="{ background: '#EDEEF0', color: '#444' }"
|
|
|
:data="tableList"
|
|
|
>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- prop="id"
|
|
|
- label="直播间编号"
|
|
|
- ></el-table-column>
|
|
|
+ <el-table-column align="center" prop="id" label="直播间编号"></el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
prop="roomTitle"
|
|
@@ -107,11 +92,7 @@
|
|
|
prop="speakerName"
|
|
|
label="主讲人"
|
|
|
></el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- prop="liveStartTime"
|
|
|
- label="直播开始时间"
|
|
|
- >
|
|
|
+ <el-table-column align="center" prop="liveStartTime" label="直播开始时间">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
{{ scope.row.liveStartTime | dateForMinFormat }}
|
|
@@ -147,11 +128,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- prop="serviceProvider"
|
|
|
- label="直播方案"
|
|
|
- >
|
|
|
+ <el-table-column align="center" prop="serviceProvider" label="直播方案">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
{{ scope.row.serviceProvider | serviceProvider }}
|
|
@@ -167,10 +144,7 @@
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
<auth auths="imLiveBroadcastRoom/query/roomUser">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- @click="lookReservationDetail(scope.row)"
|
|
|
- >
|
|
|
+ <el-button type="text" @click="lookReservationDetail(scope.row)">
|
|
|
{{ scope.row.roomReservationNum }}</el-button
|
|
|
>
|
|
|
</auth>
|
|
@@ -180,11 +154,7 @@
|
|
|
<el-table-column align="center" prop="studentId" label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
- <el-dropdown
|
|
|
- trigger="click"
|
|
|
- placement="bottom"
|
|
|
- :hide-on-click="false"
|
|
|
- >
|
|
|
+ <el-dropdown trigger="click" placement="bottom" :hide-on-click="false">
|
|
|
<span class="el-dropdown-link">
|
|
|
操作<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
</span>
|
|
@@ -192,8 +162,18 @@
|
|
|
<el-dropdown-item
|
|
|
style="width: 100px"
|
|
|
v-if="
|
|
|
+ permission('imLiveBroadcastRoom/roomStart') &&
|
|
|
+ scope.row.liveState == 0
|
|
|
+ "
|
|
|
+ @click.native="onStartLive(scope.row)"
|
|
|
+ >
|
|
|
+ <el-button type="text">开启直播</el-button>
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item
|
|
|
+ style="width: 100px"
|
|
|
+ v-if="
|
|
|
permission('/liveStudentList') &&
|
|
|
- scope.row.popularizeType !== 'ALL'
|
|
|
+ scope.row.popularizeType !== 'ALL'
|
|
|
"
|
|
|
@click.native="lookStudentDetail(scope.row)"
|
|
|
>
|
|
@@ -202,7 +182,7 @@
|
|
|
<el-dropdown-item
|
|
|
v-if="
|
|
|
permission('imLiveBroadcastRoom/opsPopularize') &&
|
|
|
- scope.row.liveState != 2
|
|
|
+ scope.row.liveState != 2
|
|
|
"
|
|
|
@click.native="popularizeRoom(scope.row)"
|
|
|
>
|
|
@@ -214,7 +194,7 @@
|
|
|
<el-dropdown-item
|
|
|
v-if="
|
|
|
permission('imLiveBroadcastRoom/roomDestroy') &&
|
|
|
- scope.row.liveState == 1
|
|
|
+ scope.row.liveState == 1
|
|
|
"
|
|
|
@click.native="closeRoom(scope.row)"
|
|
|
>
|
|
@@ -233,20 +213,13 @@
|
|
|
</el-dropdown-item>
|
|
|
</auth>
|
|
|
<el-dropdown-item
|
|
|
- v-if="
|
|
|
- permission('liveGoodsMapper/page') &&
|
|
|
- ishowCart(scope.row)
|
|
|
- "
|
|
|
+ v-if="permission('liveGoodsMapper/page') && ishowCart(scope.row)"
|
|
|
@click.native="setShop(scope.row)"
|
|
|
>
|
|
|
<el-button type="text">商品设置</el-button>
|
|
|
</el-dropdown-item>
|
|
|
- <auth
|
|
|
- auths="imLiveBroadcastRoom/queryLiveRoomGoodsOrderList"
|
|
|
- >
|
|
|
- <el-dropdown-item
|
|
|
- @click.native="gotoBlacklist(scope.row)"
|
|
|
- >
|
|
|
+ <auth auths="imLiveBroadcastRoom/queryLiveRoomGoodsOrderList">
|
|
|
+ <el-dropdown-item @click.native="gotoBlacklist(scope.row)">
|
|
|
<el-button type="text">黑名单</el-button>
|
|
|
</el-dropdown-item>
|
|
|
</auth>
|
|
@@ -260,12 +233,10 @@
|
|
|
<el-dropdown-item
|
|
|
v-if="
|
|
|
permission('imLiveBroadcastRoom/update') &&
|
|
|
- scope.row.liveState == 0
|
|
|
+ scope.row.liveState == 0
|
|
|
"
|
|
|
>
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- @click.native="resetLive(scope.row)"
|
|
|
+ <el-button type="text" @click.native="resetLive(scope.row)"
|
|
|
>修改</el-button
|
|
|
>
|
|
|
</el-dropdown-item>
|
|
@@ -275,9 +246,7 @@
|
|
|
v-if="scope.row.liveState == 0"
|
|
|
>
|
|
|
<el-dropdown-item>
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- @click.native="deteleLive(scope.row)"
|
|
|
+ <el-button type="text" @click.native="deteleLive(scope.row)"
|
|
|
>删除</el-button
|
|
|
>
|
|
|
</el-dropdown-item>
|
|
@@ -389,7 +358,8 @@ import {
|
|
|
getLiveBroadcastList,
|
|
|
delLiveBroadcast,
|
|
|
closeBroadcastRoomList,
|
|
|
- opsPopularize
|
|
|
+ opsPopularize,
|
|
|
+ roomStart,
|
|
|
} from "./api";
|
|
|
export default {
|
|
|
components: {
|
|
@@ -397,7 +367,7 @@ export default {
|
|
|
shareDetail,
|
|
|
popularizeRoom,
|
|
|
reservationDetail,
|
|
|
- sellShopList
|
|
|
+ sellShopList,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -406,7 +376,7 @@ export default {
|
|
|
timer: [],
|
|
|
serviceProvider: null,
|
|
|
liveState: null,
|
|
|
- popularize: null
|
|
|
+ popularize: null,
|
|
|
},
|
|
|
|
|
|
tableList: [],
|
|
@@ -416,10 +386,10 @@ export default {
|
|
|
limit: 10, // 限制显示条数
|
|
|
page: 1, // 当前页
|
|
|
total: 0, // 总条数
|
|
|
- page_size: [10, 20, 40, 50] // 选择限制显示条数
|
|
|
+ page_size: [10, 20, 40, 50], // 选择限制显示条数
|
|
|
},
|
|
|
shareVisible: false,
|
|
|
- activeRow: null
|
|
|
+ activeRow: null,
|
|
|
};
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
@@ -442,7 +412,7 @@ export default {
|
|
|
...rest,
|
|
|
...getTimes(timer, ["startTime", "endTime"]),
|
|
|
rows: this.rules.limit,
|
|
|
- page: this.rules.page
|
|
|
+ page: this.rules.page,
|
|
|
});
|
|
|
this.tableList = res.data.rows;
|
|
|
this.rules.total = res.data.total;
|
|
@@ -460,9 +430,9 @@ export default {
|
|
|
},
|
|
|
newLiveClass() {
|
|
|
let params = {
|
|
|
- path: "/business/createLiveClass"
|
|
|
+ path: "/business/createLiveClass",
|
|
|
};
|
|
|
- this.$router.push(params, route => {
|
|
|
+ this.$router.push(params, (route) => {
|
|
|
route.meta.title = "新建直播课";
|
|
|
});
|
|
|
this.$router.push("/business/createLiveClass");
|
|
@@ -471,7 +441,7 @@ export default {
|
|
|
gotoDetail(row) {
|
|
|
this.$router.push({
|
|
|
path: "/business/liveClassDetail",
|
|
|
- query: { roomUid: row.roomUid }
|
|
|
+ query: { roomUid: row.roomUid },
|
|
|
});
|
|
|
//
|
|
|
},
|
|
@@ -482,10 +452,10 @@ export default {
|
|
|
resetLive(row) {
|
|
|
let params = {
|
|
|
path: "/business/createLiveClass",
|
|
|
- query: { id: row.id, roomUid: row.roomUid }
|
|
|
+ query: { id: row.id, roomUid: row.roomUid },
|
|
|
};
|
|
|
// ,
|
|
|
- this.$router.push(params, route => {
|
|
|
+ this.$router.push(params, (route) => {
|
|
|
route.meta.title = "修改直播课";
|
|
|
});
|
|
|
},
|
|
@@ -493,7 +463,7 @@ export default {
|
|
|
this.$confirm("您确定删除该直播间", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
+ type: "warning",
|
|
|
})
|
|
|
.then(async () => {
|
|
|
try {
|
|
@@ -509,8 +479,8 @@ export default {
|
|
|
closeRoom(row) {
|
|
|
this.$confirm("您确定关闭直播间", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
- type: "warning"
|
|
|
- }).then(async res => {
|
|
|
+ type: "warning",
|
|
|
+ }).then(async (res) => {
|
|
|
try {
|
|
|
const res = await closeBroadcastRoomList(row.id);
|
|
|
this.$message.success("关闭成功");
|
|
@@ -531,13 +501,13 @@ export default {
|
|
|
this.$confirm(`您是否${str}直播间"${row.roomTitle}"`, "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
+ type: "warning",
|
|
|
})
|
|
|
.then(async () => {
|
|
|
try {
|
|
|
const res = await opsPopularize({
|
|
|
popularize,
|
|
|
- id: row.id
|
|
|
+ id: row.id,
|
|
|
});
|
|
|
this.$message.success(`${str}成功`);
|
|
|
this.getList();
|
|
@@ -550,7 +520,7 @@ export default {
|
|
|
setShop(row) {
|
|
|
this.$router.push({
|
|
|
path: "/business/liveShopControl",
|
|
|
- query: { roomUid: row.roomUid }
|
|
|
+ query: { roomUid: row.roomUid },
|
|
|
});
|
|
|
//
|
|
|
},
|
|
@@ -563,8 +533,8 @@ export default {
|
|
|
query: {
|
|
|
roomUid: row.roomUid,
|
|
|
name: row.roomTitle,
|
|
|
- liveState: row.liveState
|
|
|
- }
|
|
|
+ liveState: row.liveState,
|
|
|
+ },
|
|
|
});
|
|
|
},
|
|
|
gotoBuylist(row) {
|
|
@@ -573,7 +543,7 @@ export default {
|
|
|
lookStudentDetail(row) {
|
|
|
this.$router.push({
|
|
|
path: "/business/liveStudentList",
|
|
|
- query: { roomUid: row.roomUid, name: row.roomTitle }
|
|
|
+ query: { roomUid: row.roomUid, name: row.roomTitle },
|
|
|
});
|
|
|
},
|
|
|
ishowCart(row) {
|
|
@@ -583,8 +553,18 @@ export default {
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
+ },
|
|
|
+ async onStartLive(row) {
|
|
|
+ try {
|
|
|
+ await this.$confirm("确定开启直播?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+ await roomStart(row.id);
|
|
|
+ } catch (e) {}
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|