tremble 3 years ago
parent
commit
8b22707595

+ 2 - 2
public/index.html

@@ -29,8 +29,8 @@
 
         <script src="<%= VUE_APP_STATIC_DIR %>/static/lib/jweixin-1.6.0.js"></script>
         
-        <script src="<%= VUE_APP_SDK_DIR %>/kankan-sdk-deps.js?v=4.37.2-alpha.52"></script>
-        <script src="<%= VUE_APP_SDK_DIR %>/kankan-sdk.js?v=4.37.2-alpha.52"></script>
+        <script src="<%= VUE_APP_SDK_DIR %>/kankan-sdk-deps.js?v=4.37.3-alpha.52"></script>
+        <script src="<%= VUE_APP_SDK_DIR %>/kankan-sdk.js?v=4.37.3-alpha.52"></script>
 
         <!-- <script src="https://4dkk.4dage.com/v4/www/sdk/kankan-sdk-deps.js?v=4.0.0-alpha.44"></script>
         <script src="https://4dkk.4dage.com/v4/www/sdk/kankan-sdk.js?v=4.0.0-alpha.44"></script> -->

+ 1 - 1
src/components/RTC/PageRtcLive.vue

@@ -94,7 +94,7 @@
 </template>
 
 <script setup>
-import { onMounted,onUnmounted, watch, defineEmits, ref, reactive, computed, nextTick } from "vue";
+import { onMounted, onUnmounted, watch, defineEmits, ref, reactive, computed, nextTick } from "vue";
 import { useApp, getApp } from "@/app";
 import { useStore } from "vuex";
 import { Dialog } from "@/global_components/";

+ 24 - 14
src/components/RTC/Trtccom.vue

@@ -101,14 +101,14 @@ watch(
   }
 );
 
-watch(
-  () => isJoined.value,
-  () => {
-    if (!isJoined.value) {
-      handleLeave();
-    }
-  }
-);
+// watch(
+//   () => isJoined.value,
+//   () => {
+//     if (!isJoined.value) {
+//       handleLeave();
+//     }
+//   }
+// );
 
 TRTC.checkSystemRequirements().then((checkResult) => {
   if (!checkResult.result) {
@@ -235,7 +235,9 @@ async function handleUnpublish() {
   try {
     await localClient.unpublish(localStream);
     store.commit("rtc/setIsPublished", false);
-  } catch (error) {}
+  } catch (error) {
+    console.error(error, "-----------handleUnpublish--------------");
+  }
 }
 
 async function handleLeave() {
@@ -245,17 +247,24 @@ async function handleLeave() {
   try {
     uninstallEventHandlers();
     await localClient.leave();
+    localClient.destroy();
+    localClient = null;
+    invitedRemoteStreams.value.forEach((item) => {
+      item.stop();
+    });
     invitedRemoteStreams.value = [];
     store.commit("rtc/setVideoDeviceId", "");
     store.commit("rtc/setAudioDeviceId", "");
 
     if (localStream) {
-      console.log('有执行到这里-------------');
       localStream.stop();
       localStream.close();
       localStream = null;
+      console.log("有执行到这里-------------");
     }
-  } catch (error) {}
+  } catch (error) {
+    console.error(error, "-----------handleLeave--------------");
+  }
 }
 
 function installEventHandlers() {
@@ -371,6 +380,7 @@ async function handleStreamSubscribed(event) {
   if (remoteStream.userId_ == store.getters["rtc/userId"]) {
     return;
   }
+  console.error(remoteStream.userId_, store.getters["rtc/userId"], "handleStreamSubscribedhandleStreamSubscribed.value");
 
   if (!invitedRemoteStreams.value.some((item) => item.userId_ == remoteStream.userId_)) {
     invitedRemoteStreams.value.push(remoteStream);
@@ -424,9 +434,9 @@ let switchDevice = async ({ videoId, audioId }) => {
   }
 };
 
-onUnmounted(()=>{
-  handleLeave()
-})
+onUnmounted(() => {
+  handleLeave();
+});
 
 let canUseDevice = () => {
   console.log("可用");

+ 2 - 0
src/components/RTC/index.vue

@@ -47,6 +47,8 @@ const confirmDialog = async () => {
   if (socket.value) {
     if (browser.getURLParam("role") == "leader") {
       socket.value.emit("action", { type: "leader-dismiss" });
+    } else{
+      location.reload()
     }
 
     setTimeout(() => {

+ 4 - 3
src/components/Tags/goods-list.vue

@@ -102,9 +102,7 @@ const viewDetail = (item) => {
 };
 
 const onClickSku = (item) => {
-  if (isshoppingguide.value) {
-      return;
-  }
+ 
   let tempData = toRaw(tagclick.value.data);
 
   tempData.products[current.value] = {
@@ -119,6 +117,9 @@ const onClickSku = (item) => {
 };
 
 const addCart = async (item) => {
+  if (isshoppingguide.value) {
+      return;
+  }
   Loading.show();
 
   let result = await apis.inCat({