master
taoshihan 2 months ago
parent 05e8b3f788
commit 5efe4dc591

@ -55,12 +55,12 @@
<el-avatar class="mainLogo" title="Customer Support" :size="45" src="/static/images/1.jpg"></el-avatar> <el-avatar class="mainLogo" title="Customer Support" :size="45" src="/static/images/1.jpg"></el-avatar>
</el-badge> </el-badge>
</div> </div>
<div class="menuLeftItem" v-on:click="openIframeUrl('/pannel')"> <div class="menuLeftItem active" v-on:click="openIframeUrl('/pannel')">
<i class="el-icon-platform-eleme"></i> <i class="el-icon-platform-eleme"></i>
<span slot="title">Dashboard</span> <span slot="title">Dashboard</span>
</div> </div>
<div class="menuLeftItem active" v-on:click="haveNewMessage='';openIframeUrl('/chat_main')"> <div class="menuLeftItem" v-on:click="haveNewMessage='';openIframeUrl('/chat_main')">
<el-badge :value="haveNewMessage" class="item"> <el-badge :value="haveNewMessage" class="item">
<i class="el-icon-chat-dot-round"></i> <i class="el-icon-chat-dot-round"></i>
</el-badge> </el-badge>
@ -99,7 +99,7 @@
adminRole:"", adminRole:"",
onlineType:"success", onlineType:"success",
haveNewMessage:"", haveNewMessage:"",
iframeUrl:"/chat_main", iframeUrl:"/pannel",
}, },
methods: { methods: {
focusWindow(){ focusWindow(){
@ -148,7 +148,7 @@
} else { } else {
_this.adminAvator=data.result.avator; _this.adminAvator=data.result.avator;
_this.adminRole=data.result.role_name; _this.adminRole=data.result.role_name;
_this.iframeUrl = "/chat_main"; _this.iframeUrl = "/pannel";
} }
} }
}); });

@ -1,61 +1,87 @@
{{template "header" }} {{template "header"}}
<div id="app" style="width:100%;background: #eef0f6"> <style>
.deployment-guide {
max-width: 1200px;
margin: 20px auto;
padding: 24px;
background: #fff;
border-radius: 8px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}
.deployment-section {
margin: 30px 0;
padding: 20px;
background: #f8fafc;
border-radius: 8px;
}
.el-input {
width: 100%;
}
.el-input__inner {
height: 40px;
font-size: 14px;
padding: 0 12px;
}
.el-step__title {
font-size: 14px;
}
.el-step__description {
font-size: 12px;
}
h2 {
color: #303133;
font-size: 24px;
margin-bottom: 20px;
}
h3 {
color: #606266;
font-size: 18px;
margin-bottom: 16px;
}
#app {
background: #f5f7fa;
padding: 20px;
min-height: calc(100vh - 40px);
}
.el-card {
border-radius: 8px;
}
.el-card__header {
padding: 18px 20px;
}
</style>
<div id="app" style="width:100%;background: #f5f7fa">
<template> <template>
<div class="tongji"> <el-card class="deployment-guide">
<div class="tongjiItem"> <div slot="header" class="clearfix">
<div class="tongjiHeader"> <h2>System Deployment Guide</h2>
全部客户
</div>
<div class="tongjiBody">
33
</div>
<div class="tongjiFooter">
累计客户数量<span>xx</span>
</div>
</div> </div>
<div class="tongjiItem">
<div class="tongjiHeader"> <el-steps :active="3" align-center>
日新增客户 <el-step title="Server Setup" description="Prepare your hosting environment"></el-step>
</div> <el-step title="System Installation" description="Deploy the application"></el-step>
<div class="tongjiBody"> <el-step title="Configuration" description="Set up system parameters"></el-step>
33 <el-step title="Go Live" description="Launch your chat system"></el-step>
</div> </el-steps>
<div class="tongjiFooter">
累计客户数量<span>xx</span> <div class="deployment-section">
</div> <h3>Quick Start via Chat Link</h3>
</div> <p>To immediately access your customer support chat interface:</p>
<div class="tongjiItem"> <p>Your live chat endpoint is available at:</p>
<div class="tongjiHeader"> <el-input v-model="chatEndpoint" readonly style="width: 100%; margin-top: 10px;">
月新增客户 <el-button slot="append" icon="el-icon-document-copy"
</div> v-on:click="copyText(chatEndpoint)"></el-button>
<div class="tongjiBody"> </el-input>
33
</div>
<div class="tongjiFooter">
累计客户数量<span>xx</span>
</div>
</div>
<div class="tongjiItem">
<div class="tongjiHeader">
年新增客户
</div>
<div class="tongjiBody">
33
</div>
<div class="tongjiFooter">
累计客户数量<span>xx</span>
</div>
</div> </div>
</div>
<div style="background: #fff;margin: 10px;padding: 10px" id="visitorNums">
</div> </el-card>
</template> </template>
</div> </div>
</body> </body>
<script src="/static/js/echarts.min.js?v=1.0.0"></script> <script src="/static/js/echarts.min.js?v=1.0.0"></script>
<script> <script>
const ACTION="pannel"; const ACTION="pannel";
</script> </script>
{{template "setting_bottom" .}} {{template "setting_bottom" .}}

@ -105,6 +105,7 @@
confirm_new_pass:"" confirm_new_pass:""
}, },
avatarUrl:"", avatarUrl:"",
chatEndpoint: "",
}, },
methods: { methods: {
@ -539,6 +540,29 @@
type: 'success' type: 'success'
}); });
}, },
//获取客服信息
getKefuInfo(){
let _this=this;
$.ajax({
type:"get",
url:"/kefuinfo",
headers:{
"token":localStorage.getItem("token")
},
success: function(data) {
if(data.code==200 && data.result!=null){
_this.kefuInfo=data.result;
_this.chatEndpoint=window.location.origin + '/chatIndex?kefu_id='+_this.kefuInfo.username;
}
if(data.code!=200){
_this.$message({
message: data.msg,
type: 'error'
});
}
}
});
},
}, },
mounted:function(){ mounted:function(){
@ -548,9 +572,7 @@
} }
}, },
created: function () { created: function () {
// if(ACTION=="setting"){ this.getKefuInfo();
// this.showNotice();
// }
this.initInfo(); this.initInfo();
} }
}) })

@ -86,7 +86,7 @@ func AddVisitorToList(user *User) {
userInfo["avator"] = user.Avator userInfo["avator"] = user.Avator
userInfo["last_message"] = lastMessage.Content userInfo["last_message"] = lastMessage.Content
if userInfo["last_message"] == "" { if userInfo["last_message"] == "" {
userInfo["last_message"] = "新访客" userInfo["last_message"] = "new visitor"
} }
msg := TypeMessage{ msg := TypeMessage{
Type: "userOnline", Type: "userOnline",
@ -105,7 +105,7 @@ func VisitorOnline(kefuId string, visitor models.Visitor) {
userInfo["avator"] = visitor.Avator userInfo["avator"] = visitor.Avator
userInfo["last_message"] = lastMessage.Content userInfo["last_message"] = lastMessage.Content
if userInfo["last_message"] == "" { if userInfo["last_message"] == "" {
userInfo["last_message"] = "新访客" userInfo["last_message"] = "new visitor"
} }
msg := TypeMessage{ msg := TypeMessage{
Type: "userOnline", Type: "userOnline",

Loading…
Cancel
Save