Commit 7a171969 by cwq0219

直播间-控制台

1 parent d7ff8ccb
......@@ -5897,9 +5897,9 @@
}
},
"glsx-components": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/glsx-components/-/glsx-components-1.0.9.tgz",
"integrity": "sha512-mDSQuZM9m4yJoUBqEcZ7Ir9lzo7im1Ph2O1qDzHXLVTsJX04+H9aHnB1aV+YGdHbbYRXbsxwPIk+NVgxo+A2lg==",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/glsx-components/-/glsx-components-1.1.0.tgz",
"integrity": "sha512-NiTfxOj07MsxymLcZYo3JuBrkSoTTWQ4pyNYfyCM/QREaaA51rYutxDmmdCZS3MGMIixyq+kugMoOGQ1Jj8Z8Q==",
"requires": {
"core-js": "^3.6.5",
"element-ui": "^2.15.6",
......
......@@ -12,7 +12,7 @@
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5",
"glsx-common": "^1.4.6",
"glsx-components": "^1.0.9",
"glsx-components": "^1.1.0",
"lodash": "^4.17.21",
"vue": "^2.6.10",
"vue-router": "^3.1.3",
......
......@@ -5,6 +5,14 @@
box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.10);
}
.el-scrollbar__bar.is-horizontal{
height: 10px !important;
left: 10px;
}
.base-container-right .el-main-scroll .el-scrollbar__thumb {
background-color: rgba(144, 147, 153, 0.5) !important;
}
.live-room .el-table .cell {
line-height: 16px;
......
......@@ -72,7 +72,7 @@
</el-form>
<el-form>
<el-form-item>
<el-button type="primary" size="mini" @click="handleConfigImport">导入商品</el-button>
<el-button v-if="![103, 107].includes(editForm.liveStatus)" type="primary" size="mini" @click="handleConfigImport">导入商品</el-button>
</el-form-item>
</el-form>
</div>
......@@ -98,14 +98,16 @@
<p class="edit-title no-border">直播间禁言</p>
<p class="txt">
开启后,所有观众无法在直播间发表评论。
<el-switch :size="size" v-model="editForm.closeComment" active-value="1" inactive-value="0" @change="handleChangeComment"></el-switch>
<el-switch :disabled="editForm.liveStatus != '102'" :size="size" v-model="editForm.closeComment" active-value="1" inactive-value="0" @change="handleChangeComment"></el-switch>
<!-- <el-switch :size="size" v-model="editForm.closeComment" active-value="1" inactive-value="0" @change="handleChangeComment"></el-switch> -->
</p>
</div>
<div>
<p class="edit-title no-border">直播回放</p>
<p class="txt">
开启后,观众可在直播结束页面查看本场直播。
<el-switch :size="size" v-model="editForm.closeReplay" active-value="1" inactive-value="0" @change="handleChangeReplay"></el-switch>
<el-switch :disabled="[103, 107].includes(editForm.liveStatus)" :size="size" v-model="editForm.closeReplay" active-value="1" inactive-value="0" @change="handleChangeReplay"></el-switch>
<!-- <el-switch :size="size" v-model="editForm.closeReplay" active-value="1" inactive-value="0" @change="handleChangeReplay"></el-switch> -->
</p>
</div>
</div>
......@@ -136,6 +138,7 @@
<script>
import { getControlInfoApi, getControlImportListApi, getWaitImportListApi, importGoodsApi, updateCommentApi, updateReplayApi } from '@/api/modules/liveRoom'
// import selectMutiProDialog from './selectMutiProDialog'
import { liveStatusList } from '@/common/constant'
import selectMutiProDialog from '@/components/select-muti-pro'
export default {
name: 'liveControl',
......@@ -238,6 +241,9 @@ export default {
line: 2
}
]
},
baseDataList: {
liveStatusList: liveStatusList
}
}
},
......@@ -261,13 +267,17 @@ export default {
},
methods: {
getInfo() {
getInfo(fn, noChangeList = []) {
getControlInfoApi({ id: this.routeInfo.id }).then(res => {
// liveStatus 直播间状态101:直播中,102:未开始,103已结束,104禁播,105:暂停,106:异常,107:已过期
this.editForm = res
this.liveDataTable = res.liveStatisticsDTOList
this.editForm.closeComment = res.closeComment + ''
this.editForm.closeReplay = res.closeReplay + ''
this.isFirst = true
console.log(this.editForm)
this.countDownTime()
fn && fn()
})
},
beforeConfigSearchFn() {
......@@ -332,7 +342,17 @@ export default {
}
},
handleConfigImport() {
this.isMutiSelectVisible = !this.isMutiSelectVisible
var that = this
this.getInfo(() => {
if ([103, 107].includes(this.editForm.liveStatus)) {
this.$message({
message: '直播' + that.baseDataList.liveStatusList.find(item => item.confId == this.editForm.liveStatus).confName + ',不能导入商品',
type: 'info'
})
return true
}
this.isMutiSelectVisible = !this.isMutiSelectVisible
})
},
handleMutiSelectConfirm(selectedProInfo) {
var params = {
......@@ -353,34 +373,57 @@ export default {
handleMutiSelectClose() {
this.handleConfigImport()
},
// liveStatus 直播间状态101:直播中,102:未开始,103已结束,104禁播,105:暂停,106:异常,107:已过期
handleChangeComment(val) {
var params = {
id: this.routeInfo.id,
banComment: val
}
updateCommentApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code != '0') {
this.editForm.closeComment = val ? 0 : 1
this.getInfo(() => {
if (this.editForm.liveStatus != 102) {
// this.$message({
// message: '当前直播间不处于未开始状态,不能开启禁言',
// type: 'info'
// })
return true
}
var params = {
id: this.routeInfo.id,
banComment: val
}
updateCommentApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code != '0') {
this.editForm.closeComment = val ? '0' : '1'
} else {
this.editForm.closeComment = val
}
})
})
},
handleChangeReplay(val) {
var params = {
id: this.routeInfo.id,
closeReplay: val
}
updateReplayApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code != '0') {
this.editForm.closeReplay = val ? 0 : 1
this.getInfo(() => {
if ([103, 107].includes(this.editForm.liveStatus)) {
// this.$message({
// message: '不能改变回播状态',
// type: 'info'
// })
return true
}
var params = {
id: this.routeInfo.id,
closeReplay: val
}
updateReplayApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code != '0') {
this.editForm.closeReplay = val ? '0' : '1'
} else {
this.editForm.closeReplay = val
}
})
})
},
handleBack() {
......
......@@ -25,8 +25,8 @@
<span class="table-btns" slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="handleDetail(scope.scope)">控制台</el-button>
<el-button type="text" @click="handleShare(scope.scope)">分享</el-button>
<el-button type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
<el-button v-if="scope.scope.liveStatus == '102'" type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
<el-button v-if="scope.scope.liveStatus != '101'" type="text" @click="handleDelete(scope.scope)">删除</el-button>
</span>
</GLTable>
<glsx-dialog title="分享" width="620px" :isVisible="isShareVisible" :noCancel="noCancel" @closeDialog="handleShareClose" @confirmDialog="handleShareClose">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!