-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,6 @@ PORT=8888 | |
|
||
#公共组件使用cdn加速 | ||
VUE_APP_CDN=false | ||
|
||
#即时通讯项目地址 | ||
VUE_APP_CHAT_URL=http://server.boboooooo.top:9999 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<!-- | ||
* @file: OnlineChat | ||
* @copyright: NanJing Anshare Tech .Com | ||
* @author: BoBo | ||
* @Date: 2020年11月16 16:29:48 | ||
--> | ||
|
||
<template> | ||
<el-tooltip content="在线交流" placement="bottom"> | ||
<i class="chat-icon el-icon el-icon-chat-dot-round" @click="redirectToChat"></i> | ||
</el-tooltip> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { Component, Vue, Prop } from 'vue-property-decorator'; | ||
import { mapGetters } from 'vuex'; | ||
import { Getter } from 'vuex-class'; | ||
|
||
@Component({ | ||
name: 'OnlineChat', | ||
}) | ||
export default class OnlineChat extends Vue { | ||
@Getter userid!: string; | ||
|
||
@Getter realname!: string; | ||
|
||
redirectToChat() { | ||
this.openwindow(`${this.CHAT_URL}?userId=${this.userid}&username=${this.realname}`, '在线交流', 1024, 680); | ||
} | ||
|
||
openwindow(url, name, iWidth, iHeight) { | ||
const iTop = (window.screen.availHeight - 30 - iHeight) / 2; // 获得窗口的垂直位置; | ||
const iLeft = (window.screen.availWidth - 10 - iWidth) / 2; // 获得窗口的水平位置; | ||
window.open( | ||
url, | ||
name, | ||
`height=${iHeight},,innerHeight=${iHeight},width=${iWidth},innerWidth=${iWidth},top=${iTop},left=${iLeft}, | ||
toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no`, | ||
); | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.chat-icon { | ||
position: absolute; | ||
cursor: pointer; | ||
right: 280px; | ||
top: 20px; | ||
font-size: 26px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters