提交 8933dfcb 编写于 作者: 张磊's avatar 张磊

add rtc im

上级 325fbe36
...@@ -15,17 +15,20 @@ ...@@ -15,17 +15,20 @@
<v-footer></v-footer> <v-footer></v-footer>
</div> </div>
</el-container> </el-container>
<chat :showChat="showChat" :currentUser="{}"></chat>
</div> </div>
</template> </template>
<script> <script>
import VHeader from "./views/layout/header.vue"; import VHeader from "./views/layout/header.vue";
import VSlidebar from "./views/layout/slidebar.vue"; import VSlidebar from "./views/layout/slidebar.vue";
import VFooter from "./views/layout/footer.vue"; import VFooter from "./views/layout/footer.vue";
import chat from './components/IM/chat'
import { import {
base64decode, base64decode,
isNotEmptyUtils, isNotEmptyUtils,
getUrlParamsMap, getUrlParamsMap,
ssoLogin ssoLogin,
bindDragHeader
} from "./utils/utils.js"; } from "./utils/utils.js";
import { mapActions, mapGetters } from "vuex"; import { mapActions, mapGetters } from "vuex";
import { getLoginUrl, getInnerLoginUrl } from "./utils/index.js"; import { getLoginUrl, getInnerLoginUrl } from "./utils/index.js";
...@@ -34,7 +37,8 @@ export default { ...@@ -34,7 +37,8 @@ export default {
components: { components: {
VHeader, VHeader,
VSlidebar, VSlidebar,
VFooter VFooter,
chat
}, },
data() { data() {
return { return {
...@@ -42,6 +46,7 @@ export default { ...@@ -42,6 +46,7 @@ export default {
userName: "", userName: "",
authList: [], authList: [],
systemType: 0, systemType: 0,
showChat:false
}; };
}, },
computed: { computed: {
...@@ -51,7 +56,11 @@ export default { ...@@ -51,7 +56,11 @@ export default {
vm = this; vm = this;
vm.getToken(); vm.getToken();
}, },
mounted() {}, mounted() {
setTimeout( function () {
bindDragHeader('.c-header', '.chat-wrap');
}, 1000)
},
methods: { methods: {
// 解密token // 解密token
getToken() { getToken() {
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
...@@ -816,3 +816,41 @@ const change = (num) => { ...@@ -816,3 +816,41 @@ const change = (num) => {
} }
return num; return num;
} }
export const bindDragHeader = (classname,content) =>{
const dragDom = document.querySelector(classname);
const con = document.querySelector(content);
let translate,contranslate;
dragDom.onmousedown = (e) => {
const disX = e.clientX;
const disY = e.clientY;
translate = dragDom.style.transform.replace(/[^0-9\-,]/g,'').split(',');
contranslate = con.style.transform.replace(/[^0-9\-,]/g,'').split(',');
con.style.transition = "transform 100ms liner";
document.onmousemove = function (e) {
const l = e.clientX - disX;
const t = e.clientY - disY;
let x, y, tran;
if(contranslate.length> 1){
x= (l+ Number(contranslate[0])) + 'px';
y = (t + Number(contranslate[1])) + 'px';
}else{
x= (l) + 'px';
y = (t ) + 'px';
}
tran = `translate(${x},${y})`;
con.style.transform = tran;
};
document.onmouseup = function (e) {
document.onmousemove = null;
document.onmouseup = null;
};
}
}
...@@ -99,7 +99,6 @@ ...@@ -99,7 +99,6 @@
</div> </div>
</template> </template>
<script> <script>
import RtcClient from "@/utils/live/rtc-client.js";
import { import {
getLiveTimeText, getLiveTimeText,
countDown, countDown,
...@@ -107,6 +106,7 @@ import { ...@@ -107,6 +106,7 @@ import {
laseTime, laseTime,
lastm, lastm,
} from "@/utils/live"; } from "@/utils/live";
import RtcClient from "../../../utils/live/RtcClient.js";
import { openLoading, closeLoading } from "@/utils/utils"; import { openLoading, closeLoading } from "@/utils/utils";
import alert from "@/components/common/alert.vue"; import alert from "@/components/common/alert.vue";
import timeLeft from "@/components/timeLeft"; import timeLeft from "@/components/timeLeft";
...@@ -390,7 +390,6 @@ export default { ...@@ -390,7 +390,6 @@ export default {
}, },
// 显示文案 // 显示文案
showText(status, role, item) { showText(status, role, item) {
console.log("status", status);
// 1 呼叫中 2 接入 3离线 // 1 呼叫中 2 接入 3离线
if (item.status == 2) { if (item.status == 2) {
item.timeleft = 0; item.timeleft = 0;
...@@ -555,19 +554,19 @@ export default { ...@@ -555,19 +554,19 @@ export default {
// 获取信息失败 // 获取信息失败
getErr() { getErr() {
closeLoading(this); closeLoading(this);
this.$nextTick(() => { // this.$nextTick(() => {
this.$refs.alert // this.$refs.alert
.init({ // .init({
confirmTxt: "我知道了", // confirmTxt: "我知道了",
title: `获取信息失败,请稍后重试`, // title: `获取信息失败,请稍后重试`,
}) // })
.then(() => { // .then(() => {
this.$router.go(-1); // // this.$router.go(-1);
}) // })
.catch((err) => { // .catch((err) => {
this.$router.go(-1); // // this.$router.go(-1);
}); // });
}); // });
}, },
reloadfn(msg) { reloadfn(msg) {
this.$nextTick(() => { this.$nextTick(() => {
......
...@@ -70,11 +70,14 @@ ...@@ -70,11 +70,14 @@
</el-pagination> </el-pagination>
</el-row> </el-row>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
components: {
},
data(){ data(){
return { return {
tabPosition:"all", tabPosition:"all",
...@@ -82,7 +85,8 @@ export default { ...@@ -82,7 +85,8 @@ export default {
currentPage4:0, currentPage4:0,
// 判断是否是管理员 // 判断是否是管理员
isdon:'1', isdon:'1',
name:'' showChat: true
} }
}, },
methods:{ methods:{
...@@ -167,4 +171,4 @@ export default { ...@@ -167,4 +171,4 @@ export default {
} }
</style>node </style>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册