123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218 |
- <template>
- <div id="PageRtcLive">
- <div class="member_number">
- <div class="members"></div>
- <span>{{ user_list.length }}觀看</span>
- </div>
- <chat v-show="chatShow" :chatList="chatList" :user_info="user_info"></chat>
- <Trtccom :audioMuted="audioMuted" :videoMuted="videoMuted" v-if="isJoined" />
- <div class="contorlBar" v-if="!showInput">
- <div v-if="connectStatus == 1" :class="{ disabled: !user_info.IsWords }" class="saySomething" @click="onFocus">
- <!-- <i class="speakIcon"
- :class="{'dis':!user_info.IsWords}"></i> -->
- <span v-if="user_info.IsWords">說點什麼</span>
- <span v-if="!user_info.IsWords">已被禁言</span>
- <div class="disSpeakBtn" @click.stop="chatShow = !chatShow" :class="{ dis: !chatShow }"></div>
- </div>
- <div style="text-align: right; width: 100%" v-if="connectStatus == 0">連接中...</div>
- <div v-if="connectStatus == 1" class="contorl_btn">
- <div v-if="isBrushes && user_info.Role == 'leader'" @click="onDrawUndo" class="brushesBack" :class="{ disabled: !canUndo }"></div>
- <div v-if="user_info.Role == 'leader'" @click="onDraw(!isBrushes)" :class="{ brushesed: isBrushes }" class="brushes"></div>
- <div v-if="user_list.length < 5" class="invitation" @click="onClickShare"></div>
- <div v-if="role == 'leader'" class="members" @click="openMember"></div>
- <div v-if="!disableMic" @click="handleMuteAduio" :class="{ mic_off: audioMuted, disabled: !audioDeviceId }" class="mic_on"></div>
- <div v-if="disableMic" class="mic_no" :class="{ disabled: !audioDeviceId }"></div>
- <div v-if="role == 'leader'" @click="handleMuteVideo" :class="[videoMuted ? 'video_no' : 'video_on', videoDeviceId ? '' : 'disabled']"></div>
- <div class="exit" @click="openDialog('dialogIndex')"></div>
- </div>
- </div>
- <div class="layer" v-if="showInput" @click="closeInput">
- <div class="inputBox" @click.stop>
- <div class="msgBox">
- <input id="input_msg" type="text" maxlength="200" v-model.trim="text" :placeholder="`說點什麼~`" />
- <span class="iconsend_icon" :class="{ disable: text == '' }" @click.stop="sendText">發送</span>
- </div>
- </div>
- </div>
- <!-- 成員 -->
- <div class="layer" v-if="showMember" @click.self="closeMember">
- <div class="memberContent animated" :class="animateActive ? 'fadeInUpBig' : 'fadeOutDownBig'">
- <div class="blurBox"></div>
- <div class="content">
- <div class="memberHeader">
- <span> 成員管理({{ user_list.length }})</span>
- <i class="iconfont"></i>
- </div>
- <div class="memberList">
- <div class="memberItem">
- <div class="userMsg">
- <div class="avatar">
- <img :src="require('@/assets/images/rtcLive/avatar_small@2x.png')" alt="" />
- </div>
- <div class="name" v-if="user_info.Role == 'leader'">{{ user_info.Nickname }} (主持人,我)</div>
- <div class="name" v-else>{{ user_info.Nickname }} (我)</div>
- </div>
- <div class="button" v-if="user_info.Role == 'leader'">
- <!-- <div class="outBtn iconfont iconremove"></div> -->
- <!-- <div v-if="audioDevices.length>0" class="micBtn iconfont" @click="changeMedia('audio',hideMic)" :class="user_info.muted ?'iconmic_off':'iconmic_on'"></div>
- <div v-else class="micBtn iconfont iconmic_off"></div> -->
- <div @click="setAllMuted(!all_mute_mic)" class="micBtn mute_all_mic" :class="{ open_all_mic: all_mute_mic }"></div>
- </div>
- </div>
- <div v-show="user_info.UserId != i.UserId && i.Role != 'leader'" class="memberItem" v-for="(i, idx) in user_list" :key="idx">
- <div class="userMsg">
- <div class="avatar">
- <img :src="require('@/assets/images/rtcLive/avatar_small@2x.png')" alt="" />
- </div>
- <div class="name">{{ i.Nickname }}</div>
- </div>
- <div class="button" v-if="user_info.Role == 'leader'">
- <div class="micBtn" :class="i.IsWords ? 'ban_speak_on' : 'ban_speak_off'" @click="userCanSpeak(i)"></div>
- <!-- <div class="outBtn icon_remove" @click="userGetOut(i, idx)"></div> -->
- <div class="micBtn" :class="i.IsMuted ? 'mute_one_mic_off' : 'mute_one_mic_on'" @click="onMemberMuted(i)"></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <teleport :to="`#app`">
- <div v-if="showShare" @click="showShare = false" class="sharetip">
- <img @click.stop :style="`right:${isMP ? '16%' : '6%'}`" :src="require('@/assets/images/icon/img_scene_share.png')" alt="" />
- </div>
- </teleport>
- </template>
- <script setup>
- 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/";
- import common from "@/utils/common";
- import { mapGetters } from "vuex";
- import chat from "./chat/chat.vue";
- import Trtccom from "./Trtccom.vue";
- import browser from "@/utils/browser";
- import wxShare from "@/utils/wxshare";
- const emit = defineEmits(["openDialog", "closeSocket"]);
- const store = useStore();
- let jumpNewScene = (sceneFirstView) => {
- let url = window.location.href;
- if (!browser.hasURLParam("pose")) {
- url += `&${sceneFirstView.sceneview}`;
- } else {
- url = browser.replaceQueryString(url, "pose", sceneFirstView.sceneview.replace("pose=", ""));
- }
- url = browser.replaceQueryString(url, "m", sceneFirstView.num);
- return url;
- };
- let chatAutoScroll = () => {
- let el = document.getElementById("chat");
- let client_h = document.getElementById("chat").clientHeight;
- let all = document.getElementById("contents").clientHeight;
- el.scrollTo(0, client_h + all);
- };
- let createSocket = (config) => {
- console.log(process.env.VUE_APP_SOCKET_URL, "process.env.VUE_APP_SOCKET_URL");
- var socket = io(process.env.VUE_APP_SOCKET_URL, {
- path: "/ws-sync",
- transports: ["websocket"],
- });
- return socket;
- };
- store.commit("rtc/setSocket", createSocket());
- let getUrl = (href, queryArr) => {
- queryArr.forEach((item) => {
- if (!browser.hasURLParam(item.key)) {
- let ttt = href.split("index.html?");
- href = `${ttt[0]}index.html?${item.key}=${item.val}&${ttt[1]}`;
- console.log(href, "------index.htmlindex.htmlindex.htmlindex.htmlindex.htmlindex.htmlindex.html----------");
- } else {
- href = browser.replaceQueryString(href, item.key, item.val);
- }
- });
- return href;
- };
- const videoDeviceId = computed(() => store.getters["rtc/videoDeviceId"]);
- const audioDeviceId = computed(() => store.getters["rtc/audioDeviceId"]);
- const connectStatus = ref(0);
- const isBrushes = ref(false);
- const showInput = ref(false);
- const showMember = ref(false);
- const animateActive = ref(false);
- const showShare = ref(false);
- const isMP = ref(false);
- const audioMuted = ref(false);
- const videoMuted = ref(false);
- const socket = computed(() => store.getters["rtc/socket"]);
- const myVideoShow = ref(false);
- const userVideoShow = ref(false);
- const user_info = ref({});
- const user_list = ref([]);
- const mode = ref(browser.getURLParam("mode"));
- const role = ref(browser.getURLParam("role"));
- const userId = computed(() => store.getters["rtc/userId"]);
- const roomId = computed(() => store.getters["rtc/roomId"]);
- const isJoined = ref(false);
- const paint = reactive({});
- const chatList = ref([]);
- const text = ref("");
- const shareLink = ref("");
- const canUndo = ref(false);
- const audioDevices = ref([1]);
- const videoDevices = ref([1]);
- const disableMic = ref(false);
- const chatShow = ref(true);
- const all_mute_mic = ref(false);
- const tags = computed(() => {
- return store.getters["tag/tags"] || [];
- });
- const onClickShare = () => {
- if (browser.detectWeixin()) {
- //ios的ua中无miniProgram,但都有MicroMessenger(表示是微信浏览器)
- wx.miniProgram.getEnv((res) => {
- showShare.value = true;
- if (res.miniprogram) {
- isMP.value = true;
- //在小程序里
- } else {
- // 不在小程序里
- isMP.value = false;
- }
- });
- } else {
- openDialog("dialogShare", shareLink.value);
- }
- };
- const userGetOut = (item, i) => {
- socket.value &&
- socket.value.emit("action", {
- type: "getout",
- data: {
- id: item.UserId,
- },
- });
- user_list.value = user_list.value.splice(i, 1);
- };
- const setUserWords = (res) => {
- if (res.userId == user_info.value.UserId) {
- user_info.value.IsWords = res.words;
- Dialog.toast({ content: !user_info.value.IsWords ? `主持人設置了禁言` : `主持人已解除禁言` });
- }
- };
- const handleMuteVideo = () => {
- videoMuted.value = !videoMuted.value;
- };
- const handleMuteAduio = () => {
- audioMuted.value = !audioMuted.value;
- if (role.value == "leader") {
- socket.value.emit("action", { type: "users-muted", muted: audioMuted.value, userId: user_info.value.UserId });
- }
- };
- const setUserMuted = (res) => {
- if (res.userId) {
- if (res.userId == user_info.value.UserId && role.value == "customer") {
- user_info.value.IsMuted = res.muted;
- Dialog.toast({ content: !user_info.value.IsMuted ? `主持人設置了開麥` : `主持人設置了靜音` });
- disableMic.value = res.muted;
- audioMuted.value = res.muted;
- }
- } else {
- onAllMuted(res);
- }
- };
- const setAllMuted = (data) => {
- console.log(data, "IsMuted");
- socket.value.emit("action", { type: "users-muted", muted: data });
- };
- const onAllMuted = (res) => {
- user_list.value = res.members.reduce(function (tempArr, item) {
- if (tempArr.findIndex((ele) => ele.UserId === item.UserId) === -1) {
- tempArr.push(item);
- }
- return tempArr;
- }, []);
- if (role.value == "leader") {
- all_mute_mic.value = res.muted;
- }
- user_list.value.forEach((item) => {
- user_info.value.IsMuted = res.muted;
- item.IsMuted = res.muted;
- if (role.value == "customer") {
- Dialog.toast({ content: !user_info.value.IsMuted ? `主持人設置了開麥` : `主持人設置了靜音` });
- disableMic.value = res.muted;
- audioMuted.value = res.muted;
- }
- });
- };
- //用戶加入
- const setUserJoin = async (res) => {
- console.log("有人進來了", res);
- // self.user_info = res.user;
- user_list.value = res.members.reduce(function (tempArr, item) {
- if (tempArr.findIndex((ele) => ele.UserId === item.UserId) === -1) {
- tempArr.push(item);
- }
- return tempArr;
- }, []);
- // self.chekcLeaderInfo();
- let name = res.user.Nickname;
- if (res.user.Role == "leader") {
- name = "主持人";
- Dialog.toast({ content: `主持人進入房間` });
- socket.value.emit("action", { type: "user-init" });
- }
- let data = {
- role: res.user.Role,
- mode: mode.value,
- Nickname: name,
- UserId: res.user.UserId,
- text: "進入房間",
- };
- chatList.value.push(data);
- await nextTick();
- try {
- chatAutoScroll();
- } catch (error) {}
- };
- const onDrawUndo = async () => {
- let app = await getApp();
- app.Connect.paint.undo();
- canUndo.value = app.Connect.paint.records.length > 0;
- console.log(app.Connect.paint.records, "app.Connect.paint.records");
- };
- // 畫筆開啟
- const onDraw = async (status) => {
- isBrushes.value = status;
- if (isBrushes.value) {
- await getApp().Connect.paint.show({ role: role.value, paint: role.value == "leader" ? true : false });
- if (role.value == "leader") {
- socket.value.emit("action", { type: "user-paint", open: true });
- }
- } else {
- await getApp().Connect.paint.hide();
- if (role.value == "leader") {
- socket.value.emit("action", { type: "user-paint", open: false });
- }
- }
- };
- //打開輸入框
- const onFocus = () => {
- showInput.value = true;
- nextTick(() => {
- let input_msg = document.getElementById("input_msg");
- input_msg.focus();
- });
- };
- //發彈幕
- const sendText = async () => {
- if (text.value == "") {
- return;
- }
- let data = {
- role: role.value,
- mode: mode.value,
- Nickname: user_info.value.Nickname,
- UserId: user_info.value.UserId,
- text: text.value,
- };
- socket.value &&
- socket.value.emit("action", {
- type: "danmumsg",
- data,
- });
- chatList.value.push(data);
- await nextTick();
- try {
- chatAutoScroll();
- let input_msg = document.getElementById("input_msg");
- input_msg.blur();
- } catch (error) {}
- closeInput();
- };
- //接收消息
- const setReceiveMsg = async (res) => {
- console.log(res);
- if (res.role == "leader") {
- res.Nickname = "主持人";
- }
- chatList.value.push(res);
- await nextTick();
- try {
- chatAutoScroll();
- } catch (error) {}
- };
- // 關閉輸入框
- const closeInput = () => {
- showInput.value = false;
- text.value = "";
- };
- // 開啟成員
- const openMember = () => {
- showMember.value = true;
- animateActive.value = true;
- };
- // 關閉成員
- const closeMember = () => {
- animateActive.value = false;
- let t = setTimeout(() => {
- clearTimeout(t);
- showMember.value = false;
- }, 200);
- };
- const openDialog = (str, link) => {
- emit("openDialog", str, link);
- };
- const onMemberMuted = (item) => {
- item.IsMuted = !item.IsMuted;
- socket.value.emit("action", { type: "users-muted", muted: item.IsMuted, userId: item.UserId });
- };
- const onMemberLeave = async (res) => {
- console.log("有人離開了", res);
- user_list.value = res.members.reduce(function (tempArr, item) {
- if (tempArr.findIndex((ele) => ele.UserId === item.UserId) === -1) {
- tempArr.push(item);
- }
- return tempArr;
- }, []);
- let name = res.user.Nickname;
- if (res.user.Role == "leader") {
- name = "主持人";
- Dialog.toast({ content: `主持人離開了房間` });
- }
- let data = {
- role: res.user.Role,
- mode: mode.value,
- Nickname: name,
- UserId: res.user.UserId,
- text: "離開房間",
- };
- chatList.value.push(data);
- await nextTick();
- try {
- chatAutoScroll();
- } catch (error) {}
- };
- const userCanSpeak = (item) => {
- item.IsWords = !item.IsWords;
- socket.value.emit("action", { type: "users-words", words: item.IsWords, userId: item.UserId });
- };
- const onGetOuT = (data) => {
- if (data.id == user_info.value.UserId) {
- emit("closeSocket");
- Dialog.toast({ content: `您已被移除` });
- }
- };
- watch(
- user_list,
- () => {
- if (role.value == "leader") {
- all_mute_mic.value = !user_list.value.some((item) => !item.IsMuted && item.Role == "customer");
- }
- },
- {
- deep: true,
- }
- );
- const startFollow = (app) => {
- app.Connect.follow.start({ follow: role.value == "customer" });
- store.commit("rtc/setUserId", browser.getURLParam("vruserId") || `user_${role.value}${Math.floor(Math.random() * 100000000)}`);
- store.commit("rtc/setRoomId", browser.getURLParam("roomId") || `room_${Math.floor(Math.random() * 100000000)}`);
- socket.value.on("connect", (e) => {
- socket.value.emit("join", {
- userId: userId.value,
- roomId: roomId.value,
- role: role.value || "leader",
- nickname: browser.getURLParam("name"),
- });
- });
- // 加入房間成功
- socket.value.on("join", (data) => {
- let meblist = data.members.reduce(function (tempArr, item) {
- if (tempArr.findIndex((ele) => ele.UserId === item.UserId) === -1) {
- tempArr.push(item);
- }
- return tempArr;
- }, []);
- if (meblist.length > 5 && role.value == "customer") {
- Dialog.toast({ content: `房間已滿員` });
- emit("closeSocket");
- return;
- }
- connectStatus.value = 1;
- if (role.value == "customer") {
- socket.value.emit("action", { type: "user-init" });
- if (data.user.IsMuted) {
- disableMic.value = true;
- audioMuted.value = true;
- }
- } else {
- if (data.user.IsMuted) {
- audioMuted.value = true;
- }
- }
- isJoined.value = true;
- user_info.value = data.user;
- user_list.value = meblist;
- //更新分享鏈接
- shareLink.value = getUrl(window.location.href, [
- {
- key: "mode",
- val: mode.value,
- },
- {
- key: "name",
- val: "",
- },
- {
- key: "vruserId",
- val: "",
- },
- {
- key: "role",
- val: "customer",
- },
- {
- key: "roomId",
- val: user_info.value.RoomId,
- },
- ]);
- wxShare({
- donotconfig: true,
- title: `【好友推薦】一起雲逛店吧~`,
- desc: "【好友推薦】一起雲逛店吧~",
- link: shareLink.value,
- imgUrl: "https://glp-vr.cdfmembers.com/cdf/file/91dd5305525f463286f03a31abd1c154.jpg",
- });
- if (browser.detectWeixin()) {
- //ios的ua中无miniProgram,但都有MicroMessenger(表示是微信浏览器)
- wx.miniProgram.getEnv((res) => {
- if (res.miniprogram) {
- wx.miniProgram.postMessage({
- data: {
- title: "【好友推薦】一起雲逛店吧~",
- imageUrl: "https://glp-vr.cdfmembers.com/cdf/file/91dd5305525f463286f03a31abd1c154.jpg",
- h5Url: shareLink.value,
- },
- });
- //在小程序里
- }
- });
- }
- console.log("分享", shareLink.value);
- let tmp = "";
- if (user_info.value.Role == "leader") {
- tmp = getUrl(window.location.href, [
- {
- key: "roomId",
- val: user_info.value.RoomId,
- },
- {
- key: "vruserId",
- val: user_info.value.UserId,
- },
- ]);
- } else {
- tmp = getUrl(window.location.href, [
- {
- key: "vruserId",
- val: user_info.value.UserId,
- },
- ]);
- }
- console.log("創建房間後更新url", tmp);
- store.commit("rtc/setRole", user_info.value.Role);
- history.replaceState(null, null, tmp);
- });
- socket.value.on("action", (data) => {
- if (data.type == "error") {
- Dialog.toast({ content: `房間未找到`, type: "error" });
- emit("closeSocket");
- } else if (data.type == "danmumsg") {
- setReceiveMsg(data.data);
- } else if (data.type == "getout") {
- onGetOuT(data.data);
- } else if (data.type == "user-init") {
- app.Connect.follow.sync();
- } else if (data.type == "user-paint") {
- onDraw(data.open);
- if (role.value == "customer") {
- if (data.open) {
- Dialog.toast({ content: `主持人開啟畫筆` });
- } else {
- Dialog.toast({ content: `主持人關閉畫筆` });
- }
- }
- } else if (data.type == "user-join") {
- setUserJoin(data);
- } else if (data.type == "users-muted") {
- setUserMuted(data);
- //閉麥
- } else if (data.type == "users-words") {
- setUserWords(data);
- //禁言
- } else if (data.type == "user-leave") {
- // 房間解散
- onMemberLeave(data);
- } else if (data.type == "leader-dismiss") {
- emit("closeSocket");
- Dialog.toast({ content: `主持人已解散房間` });
- } else if (data.type == "tagclick") {
- if (role.value == "customer") {
- let item = tags.value.find((item) => item.sid == data.data.sid);
- if (item.type == "commodity") {
- store.commit("tag/setTagClickType", {
- type: "goodlist",
- data: item,
- });
- } else if (item.type == "waterfall") {
- store.commit("tag/setTagClickType", {
- type: "waterfall",
- data: item,
- });
- } else if (item.type == "link_scene") {
- let sceneFirstView = item.hotContent.sceneFirstView;
- window.location.href = jumpNewScene(sceneFirstView);
- }
- // document.querySelector(`[data-tag-id="${data.data.sid}"]`).click();
- // console.log(data.data.sid);
- }
- } else if (data.type == "tagclose") {
- if (role.value == "customer") {
- store.commit("tag/setTagClickType", {
- type: "",
- data: {},
- });
- }
- }
- });
- // 同屏帶看
- socket.value.on("sync", (data) => {
- if (role.value == "customer") {
- app.Connect.follow.receive(data);
- }
- });
- // 畫筆
- socket.value.on("paint", (data) => {
- if (role.value == "customer") {
- app.Connect.paint.receive(data);
- }
- });
- };
- let onfollowData = (data) => {
- if (isJoined.value) {
- socket.value.emit("sync", data);
- }
- };
- let onfollowPaint = async (data) => {
- canUndo.value = (await getApp().Connect.paint.records.length) > 0;
- socket.value.emit("paint", data);
- };
- onMounted(async () => {
- let app = await getApp();
- startFollow(app);
- app.Connect.follow.on("data", onfollowData);
- app.Connect.paint.on("data", onfollowPaint);
- });
- onUnmounted(async () => {
- let app = await getApp();
- app.Connect.follow.off("data", onfollowData);
- app.Connect.follow.off("data", onfollowData);
- });
- </script>
- <style scoped lang="scss">
- #PageRtcLive {
- position: absolute;
- left: 0;
- bottom: 0;
- // height: 7.31rem;
- width: 100%;
- z-index: 999;
- // background: rgba(0, 0, 0, 0.1);
- padding: 0 0.44rem;
- box-sizing: border-box;
- // pointer-events: none;
- .member_number {
- // width: 1.67rem;
- height: 0.5rem;
- background: rgba(0, 0, 0, 0.3);
- border-radius: 0.25rem;
- position: fixed;
- top: 0.56rem;
- right: 0.44rem;
- padding: 0.07rem 0.17rem;
- display: flex;
- align-items: center;
- justify-content: center;
- .members {
- width: 0.42rem;
- height: 0.42rem;
- background: url(~@/assets/images/rtcLive/members@2x.png);
- background-size: 100% 100%;
- margin-right: 0.07rem;
- }
- span {
- font-size: 0.24rem;
- color: #fff;
- }
- }
- .contorlBar {
- width: 9.51rem;
- height: 1.173333rem;
- background: rgba(0, 0, 0, 0.5);
- border-radius: 0.67rem;
- border: 0.03rem solid rgba(255, 255, 255, 0.1);
- margin: 0.67rem auto 0;
- // position: absolute;
- position: fixed;
- z-index: 9999;
- left: 50%;
- transform: translateX(-50%);
- padding: 0 0.266667rem;
- box-sizing: border-box;
- bottom: 0.94rem;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .saySomething {
- color: #fff;
- // font-size: 0.42rem;
- height: 0.8rem;
- position: relative;
- display: flex;
- align-items: center;
- justify-content: center;
- background: rgba(0, 0, 0, 0.5);
- padding: 0 0.2rem 0 0.2rem;
- border-radius: 0.64rem;
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .disSpeakBtn {
- width: 0.533333rem;
- height: 0.533333rem;
- background: url(~@/assets/images/rtcLive/pop-up_screen_on@2x.png) no-repeat;
- background-size: 100% 100%;
- cursor: pointer;
- &.dis {
- background: url(~@/assets/images/rtcLive/pop-up_screen_off@2x.png) no-repeat;
- background-size: 100% 100%;
- }
- }
- .speakIcon {
- width: 0.32rem;
- height: 0.32rem;
- background: url(~@/assets/images/rtcLive/Input_norma@2x.png);
- background-size: 100% 100%;
- display: block;
- margin-right: 0.1rem;
- &.dis {
- background: url(~@/assets/images/rtcLive/Input_disabled@2x.png);
- background-size: 100% 100%;
- }
- }
- span {
- font-size: 0.266667rem;
- }
- // &::after {
- // content: "";
- // position: absolute;
- // width: 0.04rem;
- // height: 0.44rem;
- // background: #ffffff;
- // border-radius: 0.03rem;
- // top: 50%;
- // transform: translateY(-50%);
- // right: -0.28rem;
- // }
- }
- .contorl_btn {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-left: 0.2rem;
- > div {
- // width: 0.56rem;
- // height: 0.56rem;
- width: 0.65rem;
- height: 0.65rem;
- // font-size: 0.56rem;
- // background: #FD5151;
- margin-right: 0.33rem;
- // &.iconexit {
- // // width: 0.56rem;
- // // height: 0.56rem;
- // color: #fd5151;
- // // background: #fff;
- // // border-radius: 50%;
- // // overflow: hidden;
- // }
- &.brushesBack {
- background: url(~@/assets/images/rtcLive/revocation@2x.png);
- background-size: 100% 100%;
- }
- &.brushes {
- // background: url(~@/assets/images/rtcLive/brushes@2x.png);
- background: url(~@/assets/images/rtcLive/brushes@2x.png);
- background-size: 100% 100%;
- }
- &.brushesed {
- background: url(~@/assets/images/rtcLive/brushes_selected@2_1.png);
- background-size: 100% 100%;
- }
- &.invitation {
- background: url(~@/assets/images/rtcLive/invitation@2x.png);
- background-size: 100% 100%;
- }
- &.members {
- background: url(~@/assets/images/rtcLive/members@2x.png);
- background-size: 100% 100%;
- }
- &.mic_on {
- background: url(~@/assets/images/rtcLive/mic_on@2x.png);
- background-size: 100% 100%;
- }
- &.mic_no {
- background: url(~@/assets/images/rtcLive/mic_off_50@2x.png);
- background-size: 100% 100%;
- }
- &.mic_off {
- background: url(~@/assets/images/rtcLive/mic_off@2x.png);
- background-size: 100% 100%;
- }
- &.video_on {
- background: url(~@/assets/images/rtcLive/video_on@2x.png);
- background-size: 100% 100%;
- }
- &.video_no {
- background: url(~@/assets/images/rtcLive/video_off_50@2x.png);
- background-size: 100% 100%;
- }
- &.video_off {
- background: url(~@/assets/images/rtcLive/video_off@2x.png);
- background-size: 100% 100%;
- }
- &.exit {
- background: url(~@/assets/images/rtcLive/exit@2x.png);
- background-size: 100% 100%;
- }
- &:last-child {
- margin-right: 0;
- }
- }
- }
- }
- .layer {
- width: 100vw;
- height: 100vh;
- background: rgba(0, 0, 0, 0.1);
- z-index: 10000;
- position: fixed;
- bottom: 0;
- left: 0;
- // right: unset;
- // top: unset;
- .inputBox {
- width: 100vw;
- height: 1.39rem;
- // background: #f2f2f2;
- border: 1px solid rgba(255, 255, 255, 0.1);
- background: rgba(0, 0, 0, 0.5);
- position: absolute;
- bottom: 0;
- left: 0;
- padding: 0 0.44rem;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- justify-content: center;
- .msgBox {
- width: 9.53rem;
- height: 0.94rem;
- position: absolute;
- > input {
- width: 9.53rem;
- height: 0.94rem;
- background: rgba(0, 0, 0, 0.5);
- border-radius: 0.56rem;
- font-size: 0.42rem;
- padding: 0 1.6rem 0 0.44rem;
- box-sizing: border-box;
- border: none;
- outline: none;
- color: #fff;
- resize: none;
- line &::placeholder {
- color: rgba(255, 255, 255, 0.5);
- }
- }
- .iconfont {
- // width: 0.56rem;
- // height: 0.56rem;
- // background: #ed5d18;
- font-size: 0.56rem;
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- right: 0.78rem;
- color: #fff;
- &.active {
- color: #ed5d18;
- }
- }
- .iconsend_icon {
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- // right: 0.78rem;
- right: 0.106667rem;
- width: 1.28rem;
- height: 0.693333rem;
- background: #ed5d18;
- color: #fff;
- font-size: 0.32rem;
- text-align: center;
- line-height: 0.693333rem;
- border-radius: 0.533333rem;
- // width: 0.67rem;
- // height: 0.67rem;
- // background-image: url(~@/assets/images/rtcLive/send_selected@2x.png);
- // background-size: 100% 100%;
- }
- }
- }
- .memberContent {
- height: auto;
- width: 100%;
- // background: #ffffff;
- border-radius: 0.28rem 0.28rem 0px 0px;
- position: absolute;
- left: 0;
- bottom: 0;
- &.animated {
- animation-duration: 0.3s;
- }
- .blurBox {
- background: rgba(0, 0, 0, 0.9);
- border-radius: 0.14rem 0.14rem 0px 0px;
- filter: blur(1px);
- position: absolute;
- width: 100%;
- height: 100%;
- z-index: 1;
- top: 0;
- left: 0;
- }
- .content {
- position: relative;
- width: 100%;
- height: 100%;
- z-index: 2;
- top: 0;
- left: 0;
- }
- .memberHeader {
- width: 100%;
- height: 1.28rem;
- text-align: center;
- line-height: 1.28rem;
- > span {
- font-size: 0.42rem;
- color: #fff;
- }
- }
- .memberList {
- width: 100%;
- height: 8.33rem;
- border-top-style: solid;
- border-top-color: rgba(0, 0, 0, 0.1);
- border-top-width: 1px;
- border-bottom-style: solid;
- border-bottom-color: rgba(0, 0, 0, 0.1);
- border-bottom-width: 1px;
- box-sizing: border-box;
- overflow-y: auto;
- &::-webkit-scrollbar {
- display: none;
- }
- .memberItem {
- width: 100%;
- height: 1.39rem;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0.19rem 0.44rem;
- .userMsg {
- display: flex;
- align-items: center;
- justify-content: center;
- .avatar {
- width: 1rem;
- height: 1rem;
- border-radius: 50%;
- // overflow: hidden;
- margin-right: 0.28rem;
- > img {
- // width: 100%;
- // height: 100%;
- width: 1rem;
- height: 1rem;
- }
- }
- .name {
- font-size: 0.39rem;
- color: #fff;
- }
- }
- .button {
- display: flex;
- align-items: center;
- justify-content: center;
- > div {
- // width: 0.56rem;
- // height: 0.56rem;
- // background: #fc6970;
- font-size: 0.65rem;
- color: #fff;
- &.micBtn {
- width: 0.65rem;
- height: 0.65rem;
- margin-right: 0.3rem;
- &.mute_all_mic {
- background-image: url(~@/assets/images/rtcLive/mic_all_on@2x.png);
- background-size: 100% 100%;
- }
- &.open_all_mic {
- background-image: url(~@/assets/images/rtcLive/mic_all_off@2x.png);
- background-size: 100% 100%;
- }
- &.mute_one_mic_on {
- background-image: url(~@/assets/images/rtcLive/mic_on@2x.png);
- background-size: 100% 100%;
- }
- &.mute_one_mic_off {
- background-image: url(~@/assets/images/rtcLive/mic_off@2x.png);
- background-size: 100% 100%;
- }
- &.ban_speak_on {
- background-image: url(~@/assets/images/rtcLive/chat_on@2x.png);
- background-size: 100% 100%;
- }
- &.ban_speak_off {
- background-image: url(~@/assets/images/rtcLive/chat_off@2x.png);
- background-size: 100% 100%;
- }
- }
- &.outBtn {
- margin-right: 0.3rem;
- width: 0.65rem;
- height: 0.65rem;
- &.icon_remove {
- background-image: url(~@/assets/images/rtcLive/remove@2x.png);
- background-size: 100% 100%;
- }
- }
- }
- }
- }
- }
- .memberBottom {
- width: 100%;
- padding: 0 0.44rem;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 0.28rem 0;
- box-sizing: border-box;
- > div {
- width: 4.61rem;
- height: 1.11rem;
- color: #ed5d18;
- border-radius: 0.11rem;
- border: 0.03rem solid #ed5d18;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 0.39rem;
- &.mute_all {
- margin-right: 0.31rem;
- }
- }
- }
- }
- }
- .chat__area-layoutBox {
- display: block;
- width: 100%;
- height: auto;
- position: fixed;
- bottom: 0;
- left: 0;
- right: unset;
- top: unset;
- background: #fff;
- // padding-bottom: 0.821256rem;
- .chat__area-layoutBox_bg {
- width: 100vw;
- height: 100vh;
- position: fixed;
- z-index: 1;
- top: 0;
- left: 0;
- }
- .chat__area-l-content {
- display: -webkit-box;
- display: -ms-flexbox;
- display: flex;
- -webkit-box-orient: horizontal;
- -webkit-box-direction: normal;
- -ms-flex-direction: row;
- flex-direction: row;
- -webkit-box-align: center;
- -ms-flex-align: center;
- align-items: center;
- -webkit-box-pack: center;
- -ms-flex-pack: center;
- justify-content: center;
- min-height: 0.821256rem;
- padding: 0.241546rem 0;
- width: 100%;
- position: relative;
- z-index: 100;
- textarea {
- width: calc(100% - 0.96618rem);
- -ms-flex-preferred-size: calc(100% - 0.96618rem);
- flex-basis: calc(100% - 0.96618rem);
- background: none;
- border: none;
- border-radius: 0;
- color: #000;
- font-size: 0.386473rem;
- line-height: 0.483092rem;
- padding: 0 0.241546rem;
- resize: none;
- -webkit-user-select: text;
- caret-color: #ff4500;
- overflow: hidden !important;
- }
- }
- }
- @keyframes myAnimation {
- 0% {
- background-position: 0px 0px;
- background-size: 13.3344rem auto;
- }
- 100% {
- background-position: -13.1104rem 0px;
- background-size: 13.3344rem auto;
- }
- }
- }
- .sharetip {
- position: fixed;
- z-index: 99999;
- width: 100%;
- height: 100%;
- left: 0;
- right: 0;
- bottom: 0;
- top: 0;
- background-color: rgba($color: #000000, $alpha: 0.66);
- > img {
- position: absolute;
- right: 16%;
- top: 0;
- max-width: 70vw;
- }
- }
- </style>
|