gemercheung 1 год назад
Родитель
Сommit
9b30f70d4e

+ 1 - 1
package.json

@@ -24,7 +24,7 @@
     "consola": "^2.15.3",
     "crypto-js": "^4.1.1",
     "dayjs": "^1.11.6",
-    "kankan-components": "^0.0.3",
+    "kankan-components": "^0.0.6",
     "lodash-es": "^4.17.21",
     "pinia": "^2.0.23",
     "pinia-plugin-persistedstate": "^2.3.0",

+ 33 - 4
pnpm-lock.yaml

@@ -24,8 +24,8 @@ dependencies:
     specifier: ^1.11.6
     version: 1.11.6
   kankan-components:
-    specifier: ^0.0.3
-    version: 0.0.3(vue@3.2.41)
+    specifier: ^0.0.6
+    version: 0.0.6(vue@3.2.41)
   lodash-es:
     specifier: ^4.17.21
     version: 4.17.21
@@ -493,6 +493,7 @@ packages:
   /@commitlint/config-validator@17.4.4:
     resolution: {integrity: sha512-bi0+TstqMiqoBAQDvdEP4AFh0GaKyLFlPPEObgI29utoKEYoPQTvF0EYqIwYYLEoJYhj5GfMIhPHJkTJhagfeg==}
     engines: {node: '>=v14'}
+    requiresBuild: true
     dependencies:
       '@commitlint/types': 17.4.4
       ajv: 8.12.0
@@ -502,6 +503,7 @@ packages:
   /@commitlint/execute-rule@17.4.0:
     resolution: {integrity: sha512-LIgYXuCSO5Gvtc0t9bebAMSwd68ewzmqLypqI2Kke1rqOqqDbMpYcYfoPfFlv9eyLIh4jocHWwCK5FS7z9icUA==}
     engines: {node: '>=v14'}
+    requiresBuild: true
     dev: true
     optional: true
 
@@ -533,6 +535,7 @@ packages:
   /@commitlint/resolve-extends@17.4.4:
     resolution: {integrity: sha512-znXr1S0Rr8adInptHw0JeLgumS11lWbk5xAWFVno+HUFVN45875kUtqjrI6AppmD3JI+4s0uZlqqlkepjJd99A==}
     engines: {node: '>=v14'}
+    requiresBuild: true
     dependencies:
       '@commitlint/config-validator': 17.4.4
       '@commitlint/types': 17.4.4
@@ -546,6 +549,7 @@ packages:
   /@commitlint/types@17.4.4:
     resolution: {integrity: sha512-amRN8tRLYOsxRr6mTnGGGvB5EmW/4DDjLMgiwK3CCVEmN6Sr/6xePGEpWaspKkckILuUORCwe6VfDBw6uj4axQ==}
     engines: {node: '>=v14'}
+    requiresBuild: true
     dependencies:
       chalk: 4.1.2
     dev: true
@@ -554,6 +558,7 @@ packages:
   /@cspotcode/source-map-support@0.8.1:
     resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==}
     engines: {node: '>=12'}
+    requiresBuild: true
     dependencies:
       '@jridgewell/trace-mapping': 0.3.9
     dev: true
@@ -904,6 +909,7 @@ packages:
   /@jridgewell/resolve-uri@3.1.1:
     resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==}
     engines: {node: '>=6.0.0'}
+    requiresBuild: true
     dev: true
 
   /@jridgewell/set-array@1.1.2:
@@ -932,6 +938,7 @@ packages:
 
   /@jridgewell/trace-mapping@0.3.9:
     resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==}
+    requiresBuild: true
     dependencies:
       '@jridgewell/resolve-uri': 3.1.1
       '@jridgewell/sourcemap-codec': 1.4.15
@@ -1121,18 +1128,22 @@ packages:
 
   /@tsconfig/node10@1.0.9:
     resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==}
+    requiresBuild: true
     dev: true
 
   /@tsconfig/node12@1.0.11:
     resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==}
+    requiresBuild: true
     dev: true
 
   /@tsconfig/node14@1.0.3:
     resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==}
+    requiresBuild: true
     dev: true
 
   /@tsconfig/node16@1.0.4:
     resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==}
+    requiresBuild: true
     dev: true
 
   /@types/babel__core@7.20.1:
@@ -1711,6 +1722,7 @@ packages:
   /acorn-walk@8.2.0:
     resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==}
     engines: {node: '>=0.4.0'}
+    requiresBuild: true
     dev: true
 
   /acorn@7.4.1:
@@ -1767,6 +1779,7 @@ packages:
 
   /ajv@8.12.0:
     resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==}
+    requiresBuild: true
     dependencies:
       fast-deep-equal: 3.1.3
       json-schema-traverse: 1.0.0
@@ -1841,6 +1854,7 @@ packages:
 
   /arg@4.1.3:
     resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==}
+    requiresBuild: true
     dev: true
 
   /argparse@1.0.10:
@@ -2302,6 +2316,7 @@ packages:
   /cosmiconfig-typescript-loader@4.3.0(@types/node@18.11.7)(cosmiconfig@8.2.0)(ts-node@10.9.1)(typescript@4.8.4):
     resolution: {integrity: sha512-NTxV1MFfZDLPiBMjxbHRwSh5LaLcPMwNdCutmnHJCKoVnlvldPWlllonKwrsRJ5pYZBIBGRWWU2tfvzxgeSW5Q==}
     engines: {node: '>=12', npm: '>=6'}
+    requiresBuild: true
     peerDependencies:
       '@types/node': '*'
       cosmiconfig: '>=7'
@@ -2318,6 +2333,7 @@ packages:
   /cosmiconfig@8.2.0:
     resolution: {integrity: sha512-3rTMnFJA1tCOPwRxtgF4wd7Ab2qvDbL8jX+3smjIbS4HlZBagTlpERbdN7iAbWlrfxE3M8c27kTwTawQ7st+OQ==}
     engines: {node: '>=14'}
+    requiresBuild: true
     dependencies:
       import-fresh: 3.3.0
       js-yaml: 4.1.0
@@ -2328,6 +2344,7 @@ packages:
 
   /create-require@1.1.1:
     resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==}
+    requiresBuild: true
     dev: true
 
   /cross-spawn@6.0.5:
@@ -2502,6 +2519,7 @@ packages:
   /diff@4.0.2:
     resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==}
     engines: {node: '>=0.3.1'}
+    requiresBuild: true
     dev: true
 
   /dir-glob@3.0.1:
@@ -3374,6 +3392,7 @@ packages:
   /global-dirs@0.1.1:
     resolution: {integrity: sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg==}
     engines: {node: '>=4'}
+    requiresBuild: true
     dependencies:
       ini: 1.3.8
     dev: true
@@ -4446,6 +4465,7 @@ packages:
 
   /json-schema-traverse@1.0.0:
     resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==}
+    requiresBuild: true
     dev: true
     optional: true
 
@@ -4467,8 +4487,8 @@ packages:
       graceful-fs: 4.2.11
     dev: true
 
-  /kankan-components@0.0.3(vue@3.2.41):
-    resolution: {integrity: sha512-MS1tl0YukyB+DznVcE9/l6QKxD5SgiewoHr0GS51oEl3oBCTde50vWRVInmLqU/0hJ09j6F2UNh7k4FTC78G1A==}
+  /kankan-components@0.0.6(vue@3.2.41):
+    resolution: {integrity: sha512-jqFQ8hMvqyHPAZR+fj3M6CFkE++W1pv+7XZXFYFL+EGZ8Uu08LKXKUFu9vviolXtyP+iigc4VrrJjdyJIgonpw==}
     peerDependencies:
       vue: ^3.2.0
     dependencies:
@@ -4606,6 +4626,7 @@ packages:
 
   /lodash.isplainobject@4.0.6:
     resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==}
+    requiresBuild: true
     dev: true
     optional: true
 
@@ -4619,11 +4640,13 @@ packages:
 
   /lodash.mergewith@4.6.2:
     resolution: {integrity: sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==}
+    requiresBuild: true
     dev: true
     optional: true
 
   /lodash.uniq@4.5.0:
     resolution: {integrity: sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==}
+    requiresBuild: true
     dev: true
     optional: true
 
@@ -4694,6 +4717,7 @@ packages:
 
   /make-error@1.3.6:
     resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==}
+    requiresBuild: true
     dev: true
 
   /makeerror@1.0.12:
@@ -5252,6 +5276,7 @@ packages:
   /require-from-string@2.0.2:
     resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
     engines: {node: '>=0.10.0'}
+    requiresBuild: true
     dev: true
     optional: true
 
@@ -5287,6 +5312,7 @@ packages:
   /resolve-global@1.0.0:
     resolution: {integrity: sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw==}
     engines: {node: '>=8'}
+    requiresBuild: true
     dependencies:
       global-dirs: 0.1.1
     dev: true
@@ -5842,6 +5868,7 @@ packages:
   /ts-node@10.9.1(@types/node@18.11.7)(typescript@4.8.4):
     resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==}
     hasBin: true
+    requiresBuild: true
     peerDependencies:
       '@swc/core': '>=1.2.50'
       '@swc/wasm': '>=1.2.50'
@@ -5994,6 +6021,7 @@ packages:
 
   /v8-compile-cache-lib@3.0.1:
     resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==}
+    requiresBuild: true
     dev: true
 
   /v8-to-istanbul@8.1.1:
@@ -6471,6 +6499,7 @@ packages:
   /yn@3.1.1:
     resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==}
     engines: {node: '>=6'}
+    requiresBuild: true
     dev: true
 
   /yocto-queue@0.1.0:

+ 11 - 10
src/components/chatRoom/controls/join.ts

@@ -80,16 +80,17 @@ export function handleJoin(data: any) {
         data: unref(currentScene),
       });
       console.log('进入,主持人禁音-1');
-      const appStore = useAppStore();
-      console.log('检查是否输入过密码', appStore.isPassWordConfirm);
-      if (appStore.isPassWordConfirm) {
-        socket.emit('action', {
-          type: 'confirm-password',
-          data: {
-            userId: rtcStore.userId,
-          },
-        });
-      }
+    }
+
+    const appStore = useAppStore();
+    console.log('检查是否输入过密码', appStore.isPassWordConfirm);
+    if (appStore.isPassWordConfirm) {
+      socket.emit('action', {
+        type: 'confirm-password',
+        data: {
+          userId: rtcStore.userId,
+        },
+      });
     }
   }, 1500);
 }

+ 12 - 3
src/components/chatRoom/dialog/password.vue

@@ -7,6 +7,7 @@
         <div class="dialog_title">请输入房间密码</div>
         <div class="pass_container">
           <input v-model.trim="password" class="pass-input" type="password" maxlength="4" />
+          <span class="limitNum"> {{ `${password.length} / 4`}}</span>
           <!-- <v-otp-input
             class="otp-input-container"
             ref="otpInput"
@@ -27,7 +28,7 @@
           <div class="created_cancel" v-if="!isSingle" @click="closeCreated">{{
             t('base.cancel')
           }}</div>
-          <div class="created_confirm" @click="createdConfirm">{{ t('base.confirm') }}</div>
+          <div class="created_confirm" :class="password.length !==4 ?'disable':''" @click="createdConfirm">{{ t('base.confirm') }}</div>
         </div>
       </div>
     </div>
@@ -75,7 +76,6 @@
     const { validPassRoom, firstNum } = useRoom();
 
     if (unref(password).length > 0 && unref(password).length === 4) {
-
       const encyrptPassword = md5(unref(password)).toString();
       let rid = unref(roomId);
       if (!rid) {
@@ -208,7 +208,7 @@
         display: flex;
         .limitNum {
           position: absolute;
-          right: 0.64rem;
+          right: 0.94rem;
           top: 50%;
           transform: translateY(-50%);
           font-size: 0.33rem;
@@ -282,6 +282,15 @@
           }
           &.created_confirm {
             color: #ed5d18;
+            &:hover {
+              cursor: pointer;
+            }
+            &.disable {
+              opacity: 0.4;
+              &:hover {
+                cursor: not-allowed;
+              }
+            }
           }
         }
       }

+ 1 - 1
src/components/chatRoom/memberList.vue

@@ -46,7 +46,7 @@
               ></div>
               <ImageIcon
                 class="assistant_icon"
-                v-if="isLeaderOrAssistant && i.Role !== 'leader'"
+                v-if="isNativeLeader && i.Role !== 'leader'"
                 type="assistants"
                 @click="(isNativeLeader || i.IsAssistant) && userCanBeAssistant(i)"
               />

+ 5 - 0
src/components/hotspot/metas/metas-video.vue

@@ -10,6 +10,7 @@
       v-show="!loading"
       :key="index"
       id="video"
+      :muted="muted"
       v-for="(i, index) in videoSrc"
       class="video-item"
       x5-video-player-type="h5-page"
@@ -48,6 +49,10 @@
       type: Boolean,
       default: false,
     },
+    muted: {
+      type: Boolean,
+      default: false,
+    },
   });
   const loading = ref(true);
 

+ 52 - 27
src/components/hotspot/show-tag.vue

@@ -1,29 +1,34 @@
 <!--  -->
 <template>
   <div class="show-tag" :id="`tagBox_${tag.sid}`">
-    <div class="tag-title">
-      <h2>
-        {{ tag.title }}
+    <div class="show-content">
+      <div class="share-box" v-if="tag.type == 'audio' && audioInfo.length > 0">
         <kk-audio
           v-if="tag.type == 'audio' && audioInfo.length > 0"
           class="audio"
           ref="audio"
+          :muted="isLive"
           :src="changeUrl(audioInfo[0].src)"
         />
-      </h2>
-    </div>
-    <div class="desc" v-if="tag.content != ''">
-      <div class="text" v-html="tag.content"></div>
-    </div>
-    <div
-      class="tag-metas"
-      @click.stop="open"
-      :class="{ mask: tag.type == 'link', nocursor: tag.type == 'video' }"
-      v-if="show && tag.media[tag.type].length > 0 && tag.type != 'audio'"
-    >
-      <metasImage :data="tag" v-if="tag.type == 'image'" />
-      <metasWeb :data="tag" v-if="tag.type == 'link' && isUsingMiniApp" />
-      <metasVideo :show="show" :data="tag" v-if="tag.type == 'video'" />
+      </div>
+      <div class="tag-title">
+        <h2>
+          {{ tag.title }}
+        </h2>
+      </div>
+      <div class="desc" v-if="tag.content != ''">
+        <div class="text" v-html="tag.content"></div>
+      </div>
+      <div
+        class="tag-metas"
+        @click.stop="open"
+        :class="{ mask: tag.type == 'link', nocursor: tag.type == 'video' }"
+        v-if="show && tag.media[tag.type].length > 0 && tag.type != 'audio'"
+      >
+        <metasImage :data="tag" v-if="tag.type == 'image'" />
+        <metasWeb :data="tag" v-if="tag.type == 'link' && isUsingMiniApp" />
+        <metasVideo :muted="isLive" :show="show" :data="tag" v-if="tag.type == 'video'" />
+      </div>
     </div>
   </div>
 </template>
@@ -38,7 +43,9 @@
   import { KkAudio } from 'kankan-components';
   import { watchEffect, unref } from 'vue';
   import { useMiniApp } from '/@/hooks/useMiniApp';
+  import browser from '/@/utils/browser';
 
+  const isLive = computed(() => Number(browser.getURLParam('isTour')) === 0);
   const { isUsingMiniApp } = useMiniApp();
   const audio = ref(null);
   const props = defineProps({
@@ -64,9 +71,14 @@
     watchEffect(() => {
       if (props.show) {
         if (unref(audioInfo)?.length && unref(audio)) {
-          console.log('audio-play');
+          console.log('audio-play', audio.value);
           // @ts-ignore
           audio.value?.play();
+          // @ts-ignore
+          if (isLive.value) {
+            // @ts-ignore
+            audio.value?.muted(true);
+          }
         }
       } else {
         if (unref(audioInfo)?.length && unref(audio)) {
@@ -84,10 +96,23 @@
     border-radius: 4px;
     // border: 1px solid #000000;
     // backdrop-filter: blur(4px);
-    min-width: 400px;
+    min-width: 420px;
     // min-height: 100px;
-    padding: 30px 20px;
-
+    padding: 30px 0 30px 20px;
+    .share-box {
+      height: 0.64rem;
+      margin-bottom: 0.1333rem;
+      position: relative;
+      display: flex;
+      justify-content: space-between;
+    }
+    .show-content {
+      position: relative;
+      z-index: 2;
+      max-height: 50vh;
+      overflow-y: auto;
+      padding: 0 20px 0 0;
+    }
     .edit-btn {
       margin-top: 20px;
       text-align: right;
@@ -139,7 +164,7 @@
         line-height: 30px;
         color: #ffffff;
         position: relative;
-
+        text-align: left;
         display: flex;
         align-items: flex-start;
         justify-content: space-between;
@@ -171,13 +196,13 @@
   [is-mobile] {
     .show-tag {
       pointer-events: auto;
-      background: rgba(27, 27, 28, 0.8);
       border-radius: 0.0533rem;
-      // border: 1px solid #000000;
-      // backdrop-filter: blur(0.0533rem);
       min-width: 7.4667rem;
-      // min-height: 4rem;
-      padding: 0.4rem 0.2667rem;
+      border-radius: 0.1067rem;
+      padding: 0.4rem 0 0.4rem 0.4rem;
+      box-shadow: 0 0.1067rem 0.1067rem 0 rgba(0, 0, 0, 0.25),
+        inset 0 0 0 0.0533rem hsla(0, 0%, 100%, 0.1);
+      opacity: 1;
 
       .edit-btn {
         margin-top: 0.2667rem;

+ 7 - 0
src/hooks/useRoom.ts

@@ -120,6 +120,11 @@ const shopAxios = axios.create({
   // baseURL: !import.meta.env.DEV ? import.meta.env.VITE_APP_APIS_URL : '',
   baseURL: import.meta.env.VITE_APP_APIS_URL,
 });
+const wxToken = browser.getURLParam('wxToken') || '';
+
+if (wxToken) {
+  shopAxios.defaults.headers['wxToken'] = wxToken;
+}
 
 export const initialRoom = async () => {
   shopAxios.defaults.headers.platform = browser.getURLParam('platform') || '';
@@ -198,9 +203,11 @@ export const getSign = async (
 
 export const validPassRoom = async (roomId: string, password: string) => {
   shopAxios.defaults.headers.platform = browser.getURLParam('platform') || '';
+
   const res = await shopAxios.post('/takelook/checkRoomVisitPassword', {
     roomId: roomId,
     password: password,
+    // wxToken: wxToken,
   });
 
   return res.data?.data || false;