访客端少加载点记录

pull/23/head
taoshihan1991 4 years ago
parent 6ea3ec1215
commit 5402144f65

@ -27,6 +27,16 @@
:closable="false"
type="success">
</el-alert>
<el-alert
style="margin:10px auto;width: 100%;"
center
:title="flyLang['moremessage']"
close-text="more"
@close="getMesssagesByVisitorId(true)"
v-show="msgList.length>10"
show-icon
type="info">
</el-alert>
<el-row :gutter="2" v-for="v in msgList" v-bind:class="{'chatBoxMe': v.is_kefu==true}">
<div class="chatTime" v-bind:class="{'chatTimeHide': v.show_time==false}"><{v.time}></div>
<el-col :span="3"><el-avatar :src="v.avator"></el-avatar></el-col>

@ -5,6 +5,7 @@ var GOFLY_LANG={
"connectok":"连接成功!",
"chating":"正在与您沟通!",
"historymes":"—— 以上是历史消息 ——",
"moremessage":"点击more加载更多记录",
"copyright":"GO-FLY1.0.0客服陶士涵提供技术支持",
"textarea":"请输入内容",
},
@ -14,6 +15,7 @@ var GOFLY_LANG={
"connectok":"connection succeeded!",
"chating":"chating with you!",
"historymes":"—— Today ——",
"moremessage":"click buuton show more messages",
"copyright":"We run on GOFLY",
"textarea":"Enter your message",
},

@ -199,7 +199,7 @@ new Vue({
// }
},
//获取信息列表
getMesssagesByVisitorId:function(){
getMesssagesByVisitorId:function(isAll){
let _this=this;
$.ajax({
type:"get",
@ -208,7 +208,12 @@ new Vue({
if(data.code==200 && data.result!=null&&data.result.length!=0){
let msgList=data.result;
_this.msgList=[];
for(let i=0;i<msgList.length;i++){
if(!isAll&&msgList.length>10){
var i=msgList.length-10
}else{
var i=0;
}
for(;i<msgList.length;i++){
let visitorMes=msgList[i];
let content = {}
if(visitorMes["mes_type"]=="kefu"){

Loading…
Cancel
Save