lex-xin 3 年 前
コミット
50af27be82

ファイルの差分が大きいため隠しています
+ 0 - 0
dist/assets/index-legacy.87ed9fff.js


ファイルの差分が大きいため隠しています
+ 0 - 0
dist/assets/index-legacy.91700341.js


ファイルの差分が大きいため隠しています
+ 0 - 0
dist/assets/index-legacy.ff61e330.js


ファイルの差分が大きいため隠しています
+ 0 - 0
dist/assets/index.0c5f6d3a.js


ファイルの差分が大きいため隠しています
+ 0 - 0
dist/assets/index.717fd23a.js


ファイルの差分が大きいため隠しています
+ 0 - 0
dist/assets/index.ba8fd686.js


+ 2 - 2
dist/index.html

@@ -5,7 +5,7 @@
     <link rel="icon" href="./favicon.ico" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title>管乐迷</title>
-    <script type="module" crossorigin src="./assets/index.a567f4c3.js"></script>
+    <script type="module" crossorigin src="./assets/index.0c5f6d3a.js"></script>
     <link rel="modulepreload" href="./assets/vendor.9de3b924.js">
     <link rel="stylesheet" href="./assets/index.fb6968e4.css">
     <script type="module">!function(){try{new Function("m","return import(m)")}catch(o){console.warn("vite: loading legacy build because dynamic import is unsupported, syntax error above should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}}();</script>
@@ -15,6 +15,6 @@
     
     <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
     <script nomodule id="vite-legacy-polyfill" src="./assets/polyfills-legacy.68541211.js"></script>
-    <script nomodule id="vite-legacy-entry" data-src="./assets/index-legacy.17e2d112.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+    <script nomodule id="vite-legacy-entry" data-src="./assets/index-legacy.91700341.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
   </body>
 </html>

+ 13 - 6
src/components/live-message/message.tsx

@@ -2,6 +2,7 @@ import { defineComponent } from "vue";
 import { ElButton } from "element-plus";
 import runtime, * as RuntimeUtils from '/src/components/live-broadcast/runtime'
 import styles from './message.module.less';
+import { state } from '/src/state'
 
 
 type optionsType = 'ALL' | 'JOIN'
@@ -9,17 +10,23 @@ export default defineComponent({
   name: 'message',
   data() {
     return {
-      options: 'ALL' as optionsType
+      options: 'ALL' as optionsType,
+    }
+  },
+  computed: {
+    whetherChat() {
+      const config = state.user?.roomConfig ? JSON.parse(state.user?.roomConfig) : {}
+      return !!config.whetherChat
     }
   },
   methods: {
     async SeatsCtrl() {
-      await RuntimeUtils.sendMessage({seatBan: runtime.allowSeatsCtrl, ...RuntimeUtils.getSendMessageUser()}, 'SeatsCtrl')
-      runtime.allowSeatsCtrl = !runtime.allowSeatsCtrl
+        await RuntimeUtils.sendMessage({seatBan: runtime.allowSeatsCtrl, ...RuntimeUtils.getSendMessageUser()}, 'SeatsCtrl')
+        runtime.allowSeatsCtrl = !runtime.allowSeatsCtrl
     },
     async ChatBan() {
-      await RuntimeUtils.sendMessage({chatBan: runtime.allowChatCtrl, ...RuntimeUtils.getSendMessageUser()}, 'ChatBan')
-      runtime.allowChatCtrl = !runtime.allowChatCtrl
+        await RuntimeUtils.sendMessage({chatBan: runtime.allowChatCtrl, ...RuntimeUtils.getSendMessageUser()}, 'ChatBan')
+        runtime.allowChatCtrl = !runtime.allowChatCtrl
     },
   },
   render() {
@@ -27,7 +34,7 @@ export default defineComponent({
       <div class={styles.message}>
         <div class={styles.buttonGroup}>
         {/* class={[!runtime.allowChatCtrl ? styles.active : null, styles.btn]} */}
-          <ElButton type={!runtime.allowChatCtrl ? 'primary' : 'info'} onClick={this.ChatBan} >{runtime.allowChatCtrl ? '全体禁言' : '关闭全体禁言'}</ElButton>
+          {this.whetherChat ? <ElButton type={!runtime.allowChatCtrl ? 'primary' : 'info'} onClick={this.ChatBan} >{runtime.allowChatCtrl ? '全体禁言' : '关闭全体禁言'}</ElButton> : null}
           {/* class={[!runtime.allowSeatsCtrl ? styles.active : null, styles.btn]} */}
           <ElButton type={!runtime.allowSeatsCtrl ? 'primary' : 'info'} onClick={this.SeatsCtrl}>{runtime.allowSeatsCtrl ? '禁止连麦' : '关闭禁止连麦'}</ElButton>
         </div>

+ 19 - 4
src/components/live-message/model/join-model.tsx

@@ -49,11 +49,12 @@ export default defineComponent({
     onLeave(value: any) {
       // 学生离开时处理
       runtime.lookCount = runtime.lookCount - 1 >= 0 ? runtime.lookCount - 1 : 0
-      if(runtimeModel.joinList[value.userId]) {
-        RuntimeModelUtils.removeJoin(value.userId)
+      const userId = value.userId || value.fromUserId
+      if(runtimeModel.joinList[userId]) {
+        RuntimeModelUtils.removeJoin(userId)
       }
-      if(runtimeModel.lookList[value.userId]) {
-        RuntimeModelUtils.removeLook(value.userId)
+      if(runtimeModel.lookList[userId]) {
+        RuntimeModelUtils.removeLook(userId)
       }
     },
     onSeatApply(evt: any) {
@@ -145,6 +146,20 @@ export default defineComponent({
     onSwitchRole(evt: any) {
       console.log(evt, 'onSwitchRole')
       if (runtimeModel.joinList[evt.userId] && evt.role === 2) {
+        const user = runtimeModel.joinList[evt.userId]
+        const sendTime = dayjs(new Date()).format('HH:mm:ss')
+        let tempObj = {
+          name: user.audienceName,
+          id: user.audienceId,
+          system: 1,
+          isSelf: false,
+          content: '发起了连麦申请',
+          sendTime
+        }
+        RuntimeModelUtils.addMessage(tempObj);
+        event.emit('MESSAGE:Change')
+
+
         RuntimeModelUtils.removeJoin(evt.userId)
       }
       if (runtimeModel.lookList[evt.userId] && evt.role === 2) {

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません