|
@@ -10,14 +10,44 @@
|
|
</div>
|
|
</div>
|
|
<div class="live-container">
|
|
<div class="live-container">
|
|
<div class="live-container-left">
|
|
<div class="live-container-left">
|
|
- <div id="draw-parent"></div>
|
|
|
|
|
|
+ <div id="draw-parent">
|
|
|
|
+ <div v-show="isDrawSetting" class="draw-setting">
|
|
|
|
+ <span class="brush-shape">
|
|
|
|
+ <svg-icon icon-class="brush-shape" />
|
|
|
|
+ </span>
|
|
|
|
+ <span
|
|
|
|
+ v-for="item in drawColorList"
|
|
|
|
+ :key="item"
|
|
|
|
+ :class="['draw-color', item === '#FF4747' ? 'current' : '']"
|
|
|
|
+ :style="{ 'background-color': item }"
|
|
|
|
+ ></span>
|
|
|
|
+ <span v-for="item in drawThicknessList" :key="item" class="draw-thickness">
|
|
|
|
+ <span :style="{ width: item * 2 + 'px', height: item * 2 + 'px' }"></span>
|
|
|
|
+ </span>
|
|
|
|
+ <span class="brush-clear">
|
|
|
|
+ <svg-icon icon-class="clear" />
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
<div class="button-group">
|
|
<div class="button-group">
|
|
<div>
|
|
<div>
|
|
<el-dropdown placement="top" @command="invite">
|
|
<el-dropdown placement="top" @command="invite">
|
|
<el-button>语音连麦</el-button>
|
|
<el-button>语音连麦</el-button>
|
|
<el-dropdown-menu slot="dropdown">
|
|
<el-dropdown-menu slot="dropdown">
|
|
<el-dropdown-item
|
|
<el-dropdown-item
|
|
- v-for="item in speakData.onlineUsers"
|
|
|
|
|
|
+ v-for="item in roomContext.onlineUsers"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ :command="item.uid"
|
|
|
|
+ >
|
|
|
|
+ {{ item.name }}
|
|
|
|
+ </el-dropdown-item>
|
|
|
|
+ </el-dropdown-menu>
|
|
|
|
+ </el-dropdown>
|
|
|
|
+ <el-dropdown placement="top" @command="invite">
|
|
|
|
+ <el-button>视屏连麦</el-button>
|
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
|
+ <el-dropdown-item
|
|
|
|
+ v-for="item in roomContext.onlineUsers"
|
|
:key="item.id"
|
|
:key="item.id"
|
|
:command="item.uid"
|
|
:command="item.uid"
|
|
>
|
|
>
|
|
@@ -25,15 +55,38 @@
|
|
</el-dropdown-item>
|
|
</el-dropdown-item>
|
|
</el-dropdown-menu>
|
|
</el-dropdown-menu>
|
|
</el-dropdown>
|
|
</el-dropdown>
|
|
- <el-button>视频连麦</el-button>
|
|
|
|
<!-- <el-button>群组讨论</el-button>
|
|
<!-- <el-button>群组讨论</el-button>
|
|
<el-button>推送课件</el-button> -->
|
|
<el-button>推送课件</el-button> -->
|
|
- <el-button>屏幕画笔</el-button>
|
|
|
|
|
|
+ <el-button @click="showDrawSetting">屏幕画笔</el-button>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div>
|
|
<el-button @click="publishShareStream">共享屏幕</el-button>
|
|
<el-button @click="publishShareStream">共享屏幕</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="live-container-left-chat">
|
|
|
|
+ <div class="chat-top">
|
|
|
|
+ <span>聊天窗口</span>
|
|
|
|
+ <a @click="chatBans">群体禁言</a>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="chat-window">
|
|
|
|
+ <ul class="chat-window-ul">
|
|
|
|
+ <li v-for="(item, i) in chatList" :key="i">
|
|
|
|
+ <div class="msg-normal">
|
|
|
|
+ <span>{{ item.username }}: </span>
|
|
|
|
+ <span>{{ item.msg }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ </li>
|
|
|
|
+ </ul>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="chat-speak">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="msg"
|
|
|
|
+ placeholder="输入发言"
|
|
|
|
+ maxlength="400"
|
|
|
|
+ @keydown.enter.native="sendMsg"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
<div class="live-container-right">
|
|
<div class="live-container-right">
|
|
<div class="live-teacher-lens">
|
|
<div class="live-teacher-lens">
|
|
@@ -53,11 +106,11 @@ export default {
|
|
return {
|
|
return {
|
|
userid: '53A22FC29AD2216D',
|
|
userid: '53A22FC29AD2216D',
|
|
roomid: 'DCDD385394BFEDEB9C33DC5901307461',
|
|
roomid: 'DCDD385394BFEDEB9C33DC5901307461',
|
|
- sessionid: 'CF58A9D16DA6EE252C274DD0F18E7307C048EE85FE61DFFC251D7324CD2B85D0',
|
|
|
|
|
|
+ sessionid: '958244269B68153D59A89B76263163F718F9C0729ED1220093D5B392FC86FFF6',
|
|
rtc: null,
|
|
rtc: null,
|
|
roomData: {
|
|
roomData: {
|
|
desc: '直播间标题',
|
|
desc: '直播间标题',
|
|
- name: '教师姓名',
|
|
|
|
|
|
+ name: '姓名',
|
|
user: {
|
|
user: {
|
|
id: '',
|
|
id: '',
|
|
name: '',
|
|
name: '',
|
|
@@ -71,7 +124,12 @@ export default {
|
|
},
|
|
},
|
|
loadedNumber: 0,
|
|
loadedNumber: 0,
|
|
speakData: {},
|
|
speakData: {},
|
|
- roomContext: {}
|
|
|
|
|
|
+ roomContext: {},
|
|
|
|
+ msg: '',
|
|
|
|
+ chatList: [],
|
|
|
|
+ isDrawSetting: false,
|
|
|
|
+ drawColorList: ['#FF4747', '#343434', '#628EFF', '#FFCA0E'],
|
|
|
|
+ drawThicknessList: ['1', '3', '5']
|
|
};
|
|
};
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
@@ -85,6 +143,29 @@ export default {
|
|
created() {
|
|
created() {
|
|
this.downloadWebSDK();
|
|
this.downloadWebSDK();
|
|
},
|
|
},
|
|
|
|
+ mounted() {
|
|
|
|
+ document.addEventListener(
|
|
|
|
+ 'click',
|
|
|
|
+ e => {
|
|
|
|
+ let target = e.target;
|
|
|
|
+ let isHasClass = false;
|
|
|
|
+ do {
|
|
|
|
+ if (target === null) {
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ if (target.className === 'draw-setting') {
|
|
|
|
+ isHasClass = true;
|
|
|
|
+ }
|
|
|
|
+ target = target.parentElement;
|
|
|
|
+ } while (!isHasClass);
|
|
|
|
+
|
|
|
|
+ if (!isHasClass) {
|
|
|
|
+ this.isDrawSetting = false;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ true
|
|
|
|
+ );
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
// 加载直播所需 SDK,加载完成后才能初始化
|
|
// 加载直播所需 SDK,加载完成后才能初始化
|
|
downloadWebSDK() {
|
|
downloadWebSDK() {
|
|
@@ -166,6 +247,32 @@ export default {
|
|
|
|
|
|
invite(uid) {
|
|
invite(uid) {
|
|
common.invite(uid);
|
|
common.invite(uid);
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ sendMsg() {
|
|
|
|
+ common.sendMsg(this.msg);
|
|
|
|
+ this.msg = '';
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ chatBans() {
|
|
|
|
+ common.roomUpdate({
|
|
|
|
+ allow_chat: false,
|
|
|
|
+ roomUpdateSuccess: function (data) {
|
|
|
|
+ console.log(data, '房间模板配置更新请求成功!');
|
|
|
|
+ },
|
|
|
|
+ roomUpdateFailed: function (data) {
|
|
|
|
+ console.log(data, '房间模板配置更新请求失败! 请稍后再试!');
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 画笔变更
|
|
|
|
+ drawChange(action, value) {
|
|
|
|
+ common.drawChange(action, value);
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ showDrawSetting() {
|
|
|
|
+ this.isDrawSetting = !this.isDrawSetting;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
@@ -180,13 +287,16 @@ export default {
|
|
&-page-title {
|
|
&-page-title {
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
}
|
|
}
|
|
|
|
+
|
|
&-desc {
|
|
&-desc {
|
|
margin: 17px 0 8px;
|
|
margin: 17px 0 8px;
|
|
}
|
|
}
|
|
|
|
+
|
|
&-info {
|
|
&-info {
|
|
display: flex;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
}
|
|
}
|
|
|
|
+
|
|
&-name {
|
|
&-name {
|
|
opacity: 0.4;
|
|
opacity: 0.4;
|
|
line-height: 30px;
|
|
line-height: 30px;
|
|
@@ -207,11 +317,125 @@ export default {
|
|
height: 331px;
|
|
height: 331px;
|
|
margin-bottom: 14px;
|
|
margin-bottom: 14px;
|
|
border: 1px solid #ccc;
|
|
border: 1px solid #ccc;
|
|
|
|
+ position: relative;
|
|
|
|
+ background-color: #3d3938;
|
|
|
|
+
|
|
|
|
+ // 设置屏幕画笔
|
|
|
|
+ .draw-setting {
|
|
|
|
+ position: absolute;
|
|
|
|
+ bottom: 13px;
|
|
|
|
+ left: 22px;
|
|
|
|
+ z-index: 9999;
|
|
|
|
+ background-color: #a0a0a0;
|
|
|
|
+ padding: 6px;
|
|
|
|
+ border-radius: 40px;
|
|
|
|
+ height: 40px;
|
|
|
|
+ width: 275px;
|
|
|
|
+ line-height: 28px;
|
|
|
|
+
|
|
|
|
+ & > span {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ text-align: center;
|
|
|
|
+ margin-right: 10px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ & > span.brush-shape {
|
|
|
|
+ width: 28px;
|
|
|
|
+ height: 28px;
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .draw-color {
|
|
|
|
+ position: relative;
|
|
|
|
+ top: 5px;
|
|
|
|
+ height: 18px;
|
|
|
|
+ width: 18px;
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .current::after {
|
|
|
|
+ content: '';
|
|
|
|
+ position: absolute;
|
|
|
|
+ bottom: -7px;
|
|
|
|
+ left: 7px;
|
|
|
|
+ width: 4px;
|
|
|
|
+ height: 4px;
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ background-color: #292929;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .draw-thickness {
|
|
|
|
+ height: 18px;
|
|
|
|
+ width: 18px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ display: inline-flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ vertical-align: middle;
|
|
|
|
+ align-items: center;
|
|
|
|
+
|
|
|
|
+ span {
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ background-color: #000;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ & > .brush-clear {
|
|
|
|
+ width: 28px;
|
|
|
|
+ height: 28px;
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ background-color: #666;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ margin-right: 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
.button-group {
|
|
.button-group {
|
|
display: flex;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // 聊天窗口
|
|
|
|
+ &-chat {
|
|
|
|
+ margin-top: 15px;
|
|
|
|
+ height: 278px;
|
|
|
|
+ border: 1px solid #ccc;
|
|
|
|
+ border-radius: 8px;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+
|
|
|
|
+ .chat-top {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ padding: 15px 15px 10px;
|
|
|
|
+ border-bottom: 1px solid #e6e6e6;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .chat-window {
|
|
|
|
+ position: relative;
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+
|
|
|
|
+ &-ul {
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ overflow: auto;
|
|
|
|
+
|
|
|
|
+ .msg-normal {
|
|
|
|
+ padding: 7px 16px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
&-right {
|
|
&-right {
|
|
@@ -227,5 +451,13 @@ export default {
|
|
border-radius: 8px;
|
|
border-radius: 8px;
|
|
padding: 7px 12px;
|
|
padding: 7px 12px;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .el-dropdown + .el-dropdown {
|
|
|
|
+ margin-left: 10px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .el-dropdown + .el-button {
|
|
|
|
+ margin-left: 10px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|