|
@@ -305,7 +305,7 @@ const setUserJoin = async (res) => {
|
|
|
name = "主持人";
|
|
|
Dialog.toast({ content: `主持人進入房間` });
|
|
|
socket.value.emit("action", { type: "user-init" });
|
|
|
- }
|
|
|
+ }
|
|
|
let data = {
|
|
|
role: res.user.Role,
|
|
|
mode: mode.value,
|
|
@@ -506,6 +506,7 @@ const startFollow = (app) => {
|
|
|
|
|
|
connectStatus.value = 1;
|
|
|
if (role.value == "customer") {
|
|
|
+ socket.value.emit("action", { type: "ask-currentscene" });
|
|
|
socket.value.emit("action", { type: "user-init" });
|
|
|
if (data.user.IsMuted) {
|
|
|
disableMic.value = true;
|
|
@@ -599,6 +600,7 @@ const startFollow = (app) => {
|
|
|
});
|
|
|
|
|
|
socket.value.on("action", (data) => {
|
|
|
+ console.log(data,'=============');
|
|
|
if (data.type == "error") {
|
|
|
Dialog.toast({ content: `房間未找到`, type: "error" });
|
|
|
emit("closeSocket");
|
|
@@ -658,6 +660,25 @@ const startFollow = (app) => {
|
|
|
data: {},
|
|
|
});
|
|
|
}
|
|
|
+ } else if (data.type == "ask-currentscene") {
|
|
|
+ console.log(111111111);
|
|
|
+ if (role.value == "leader") {
|
|
|
+ socket.value.emit("action", {
|
|
|
+ type: "answer-currentscene",
|
|
|
+ data: {
|
|
|
+ scene: browser.getURLParam("m"),
|
|
|
+ pose: browser.getURLParam("pose"),
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else if (data.type == "answer-currentscene") {
|
|
|
+ if (role.value == "customer") {
|
|
|
+ if (data.data.scene != browser.getURLParam("m")) {
|
|
|
+ let url1 = browser.replaceQueryString(window.location.href, "m", data.data.scene);
|
|
|
+ let url = browser.replaceQueryString(url1, "pose", data.data.pose);
|
|
|
+ location.replace(url)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
|