提取公共js css

pull/30/head
陶士涵 4 years ago
parent e3be8e8828
commit 984e971949

@ -0,0 +1,2 @@
.floatRight{float: right;}
.clear{clear: both;}

@ -5,7 +5,9 @@
<meta name="description" content=""> <meta name="description" content="">
<meta name="author" content="陶士涵"> <meta name="author" content="陶士涵">
<title>聊天界面</title> <title>聊天界面</title>
<link rel="stylesheet" href="/static/css/common.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/theme-chalk/index.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/theme-chalk/index.css">
<script src="/static/js/functions.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/index.js"></script> <script src="https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/index.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
@ -122,8 +124,9 @@
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<el-input type="textarea" class="chatArea" v-model="messageContent"></el-input> <el-input type="textarea" class="chatArea" v-model="messageContent" v-on:keyup.enter.native="chatToUser"></el-input>
<el-button type="primary" v-on:click="chatToUser">发送</el-button> <el-button class="floatRight" type="primary" v-on:click="chatToUser">发送</el-button>
<div class="clear"></div>
</div> </div>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
@ -167,7 +170,7 @@
leftTabActive:"first", leftTabActive:"first",
users:[], users:[],
usersMap:[], usersMap:[],
server:"wss://"+window.location.host+"/chat_server", server:getWsBaseUrl()+"/chat_server",
socket:null, socket:null,
messageContent:"", messageContent:"",
currentGuest:"", currentGuest:"",

@ -6,6 +6,7 @@
<meta name="author" content="陶士涵"> <meta name="author" content="陶士涵">
<title>GO-FLY咨询页</title> <title>GO-FLY咨询页</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/theme-chalk/index.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/theme-chalk/index.css">
<script src="/static/js/functions.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/index.js"></script> <script src="https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/index.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
@ -132,7 +133,7 @@
delimiters:["<{","}>"], delimiters:["<{","}>"],
data: { data: {
window:window, window:window,
server:"wss://"+window.location.host+"/chat_server", server:getWsBaseUrl()+"/chat_server",
socket:null, socket:null,
msgList:[], msgList:[],
messageContent:"", messageContent:"",

@ -0,0 +1,20 @@
function getBaseUrl() {
var ishttps = 'https:' == document.location.protocol ? true : false;
var url = window.location.host;
if (ishttps) {
url = 'https://' + url;
} else {
url = 'http://' + url;
}
return url;
}
function getWsBaseUrl() {
var ishttps = 'https:' == document.location.protocol ? true : false;
var url = window.location.host;
if (ishttps) {
url = 'wss://' + url;
} else {
url = 'ws://' + url;
}
return url;
}
Loading…
Cancel
Save